42 lines
1.3 KiB
Rust
42 lines
1.3 KiB
Rust
// file: kb_decoder_lending_marginfi_v2/src/decoder.rs
|
|
// version: 5
|
|
|
|
//! Decoder scaffold for the `kb_decoder_lending_marginfi_v2` crate.
|
|
|
|
/// Initial decoder implementation placeholder.
|
|
#[derive(Clone, Debug, Default)]
|
|
pub struct LendingMarginfiV2Decoder;
|
|
|
|
impl kb_decoder_api::ProtocolDecoder for crate::LendingMarginfiV2Decoder {
|
|
fn decoder_name(&self) -> &'static str {
|
|
return "kb_decoder_lending_marginfi_v2";
|
|
}
|
|
|
|
fn decoder_version(&self) -> &'static str {
|
|
return env!("CARGO_PKG_VERSION");
|
|
}
|
|
|
|
fn program_ids(&self) -> &'static [&'static str] {
|
|
return &[kb_program_ids::LENDING_MARGINFI_V2_PROGRAM_ID];
|
|
}
|
|
|
|
fn supports_observation(
|
|
&self,
|
|
observation: &kb_model::ProgramObservation,
|
|
) -> kb_decoder_api::DecoderSupport {
|
|
return if self.handles_program_id(&observation.program_id) {
|
|
kb_decoder_api::DecoderSupport::Maybe
|
|
} else {
|
|
kb_decoder_api::DecoderSupport::No
|
|
};
|
|
}
|
|
|
|
fn decode_observation(
|
|
&self,
|
|
_observation: &kb_model::ProgramObservation,
|
|
) -> kb_core::Result<std::vec::Vec<kb_model::DecodedProtocolEvent>> {
|
|
let _target = crate::TRACING_TARGET;
|
|
return std::result::Result::Ok(std::vec::Vec::new());
|
|
}
|
|
}
|