v0.1.0-pre.062

This commit is contained in:
2026-07-30 10:27:06 +02:00
parent f40fb78817
commit 460671e19d
319 changed files with 392513 additions and 9507 deletions

View File

@@ -1,9 +1,12 @@
// file: kb-lib/src/decoder/adapter.rs
// version: 4
// version: 5
//! `adapter` decoder family.
mod saber_decimal_wrapper;
mod spl_token_wrap;
/// Reserved `kb-lib.decoder.adapter.saber_decimal_wrapper` decoder.
pub use self::saber_decimal_wrapper::DcAdapterSaberDecimalWrapperDecoder;
/// Reserved `kb-lib.decoder.adapter.spl_token_wrap` decoder.
pub use self::spl_token_wrap::DcAdapterSplTokenWrapDecoder;

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/adapter/spl_token_wrap.rs
// version: 1
//! Reserved protocol decoder for `adapter_spl_token_wrap`.
/// Reserved decoder for the `adapter_spl_token_wrap` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcAdapterSplTokenWrapDecoder;
impl crate::DcApiProtocolDecoder for crate::DcAdapterSplTokenWrapDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.adapter.spl_token_wrap";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::ADAPTER_SPL_TOKEN_WRAP_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}

View File

@@ -1,12 +0,0 @@
// file: kb-lib/src/decoder/admin.rs
// version: 4
//! `admin` decoder family.
mod jupiter_lock;
mod pump_fees;
/// Reserved `kb-lib.decoder.admin.jupiter_lock` decoder.
pub use self::jupiter_lock::DcAdminJupiterLockDecoder;
/// Reserved `kb-lib.decoder.admin.pump_fees` decoder.
pub use self::pump_fees::DcAdminPumpFeesDecoder;

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/decoder/amm.rs
// version: 4
// version: 5
//! `amm` decoder family.
@@ -14,7 +14,6 @@ mod goosefx_gamma;
mod goosefx_v2;
mod guac_swap;
mod lifinity_swap_v2;
mod metadao_futarchy_amm;
mod metadao_v0_5;
mod meteora_damm_v1;
mod meteora_damm_v2;
@@ -25,7 +24,6 @@ mod raydium_lp_v4;
mod solfi;
mod solfi_v2;
mod vertigo;
mod virtuals;
mod woofi;
mod zero_fi;
mod zora;
@@ -52,8 +50,6 @@ pub use self::goosefx_v2::DcAmmGoosefxV2Decoder;
pub use self::guac_swap::DcAmmGuacSwapDecoder;
/// Reserved `kb-lib.decoder.amm.lifinity_swap_v2` decoder.
pub use self::lifinity_swap_v2::DcAmmLifinitySwapV2Decoder;
/// Reserved `kb-lib.decoder.amm.metadao_futarchy_amm` decoder.
pub use self::metadao_futarchy_amm::DcAmmMetadaoFutarchyAmmDecoder;
/// Reserved `kb-lib.decoder.amm.metadao_v0_5` decoder.
pub use self::metadao_v0_5::DcAmmMetadaoV05Decoder;
/// Reserved `kb-lib.decoder.amm.meteora_damm_v1` decoder.
@@ -74,8 +70,6 @@ pub use self::solfi::DcAmmSolfiDecoder;
pub use self::solfi_v2::DcAmmSolfiV2Decoder;
/// Reserved `kb-lib.decoder.amm.vertigo` decoder.
pub use self::vertigo::DcAmmVertigoDecoder;
/// Reserved `kb-lib.decoder.amm.virtuals` decoder.
pub use self::virtuals::DcAmmVirtualsDecoder;
/// Reserved `kb-lib.decoder.amm.woofi` decoder.
pub use self::woofi::DcAmmWoofiDecoder;
/// Reserved `kb-lib.decoder.amm.zero_fi` decoder.

View File

@@ -1,12 +1,15 @@
// file: kb-lib/src/decoder/fees.rs
// version: 4
// version: 5
//! `fees` decoder family.
mod bags_fee_share_v1;
mod bags_fee_share_v2;
mod pump_fees;
/// Reserved `kb-lib.decoder.fees.bags_fee_share_v1` decoder.
pub use self::bags_fee_share_v1::DcFeesBagsFeeShareV1Decoder;
/// Reserved `kb-lib.decoder.fees.bags_fee_share_v2` decoder.
pub use self::bags_fee_share_v2::DcFeesBagsFeeShareV2Decoder;
/// Reserved `kb-lib.decoder.fees.pump_fees` decoder.
pub use self::pump_fees::DcFeesPumpFeesDecoder;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/decoder/amm/virtuals.rs
// file: kb-lib/src/decoder/fees/pump_fees.rs
// version: 4
//! Reserved protocol decoder for `amm_virtuals`.
//! Reserved protocol decoder for `fees_pump_fees`.
/// Reserved decoder for the `amm_virtuals` program surface.
/// Reserved decoder for the `fees_pump_fees` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcAmmVirtualsDecoder;
pub struct DcFeesPumpFeesDecoder;
impl crate::DcApiProtocolDecoder for crate::DcAmmVirtualsDecoder {
impl crate::DcApiProtocolDecoder for crate::DcFeesPumpFeesDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.amm.virtuals";
return "kb-lib.decoder.fees.pump_fees";
}
fn decoder_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::DcApiProtocolDecoder for crate::DcAmmVirtualsDecoder {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::AMM_VIRTUALS_PROGRAM_ID];
return &[kb_program_ids::FEES_PUMP_FEES_PROGRAM_ID];
}
fn supports_observation(

View File

@@ -1,9 +1,15 @@
// file: kb-lib/src/decoder/governance.rs
// version: 4
// version: 5
//! `governance` decoder family.
mod metadao_bid_wall;
mod metadao_futarchy;
mod squads_multisig;
/// Reserved `kb-lib.decoder.governance.metadao_bid_wall` decoder.
pub use self::metadao_bid_wall::DcGovernanceMetadaoBidWallDecoder;
/// Reserved `kb-lib.decoder.governance.metadao_futarchy` decoder.
pub use self::metadao_futarchy::DcGovernanceMetadaoFutarchyDecoder;
/// Reserved `kb-lib.decoder.governance.squads_multisig` decoder.
pub use self::squads_multisig::DcGovernanceSquadsMultisigDecoder;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/decoder/amm/metadao_futarchy_amm.rs
// file: kb-lib/src/decoder/governance/metadao_futarchy.rs
// version: 4
//! Reserved protocol decoder for `amm_metadao_futarchy_amm`.
//! Reserved protocol decoder for `governance_metadao_futarchy`.
/// Reserved decoder for the `amm_metadao_futarchy_amm` program surface.
/// Reserved decoder for the `governance_metadao_futarchy` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcAmmMetadaoFutarchyAmmDecoder;
pub struct DcGovernanceMetadaoFutarchyDecoder;
impl crate::DcApiProtocolDecoder for crate::DcAmmMetadaoFutarchyAmmDecoder {
impl crate::DcApiProtocolDecoder for crate::DcGovernanceMetadaoFutarchyDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.amm.metadao_futarchy_amm";
return "kb-lib.decoder.governance.metadao_futarchy";
}
fn decoder_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::DcApiProtocolDecoder for crate::DcAmmMetadaoFutarchyAmmDecoder {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::AMM_METADAO_FUTARCHY_AMM_PROGRAM_ID];
return &[kb_program_ids::GOVERNANCE_METADAO_FUTARCHY_PROGRAM_ID];
}
fn supports_observation(

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/governance/squads_multisig.rs
// version: 1
//! Reserved protocol decoder for `governance_squads_multisig`.
/// Reserved decoder for the `governance_squads_multisig` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcGovernanceSquadsMultisigDecoder;
impl crate::DcApiProtocolDecoder for crate::DcGovernanceSquadsMultisigDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.governance.squads_multisig";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::GOVERNANCE_SQUADS_MULTISIG_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/decoder/launchpad.rs
// version: 4
// version: 5
//! `launchpad` decoder family.
@@ -12,6 +12,7 @@ mod printr;
mod pump_fun;
mod pump_pumpup_ai;
mod raydium_launchlab;
mod virtuals;
/// Reserved `kb-lib.decoder.launchpad.boop_fun` decoder.
pub use self::boop_fun::DcLaunchpadBoopFunDecoder;
@@ -31,3 +32,5 @@ pub use self::pump_fun::DcLaunchpadPumpFunDecoder;
pub use self::pump_pumpup_ai::DcLaunchpadPumpPumpupAiDecoder;
/// Reserved `kb-lib.decoder.launchpad.raydium_launchlab` decoder.
pub use self::raydium_launchlab::DcLaunchpadRaydiumLaunchlabDecoder;
/// Reserved `kb-lib.decoder.launchpad.virtuals` decoder.
pub use self::virtuals::DcLaunchpadVirtualsDecoder;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/decoder/admin/jupiter_lock.rs
// file: kb-lib/src/decoder/launchpad/virtuals.rs
// version: 4
//! Reserved protocol decoder for `admin_jupiter_lock`.
//! Reserved protocol decoder for `launchpad_virtuals`.
/// Reserved decoder for the `admin_jupiter_lock` program surface.
/// Reserved decoder for the `launchpad_virtuals` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcAdminJupiterLockDecoder;
pub struct DcLaunchpadVirtualsDecoder;
impl crate::DcApiProtocolDecoder for crate::DcAdminJupiterLockDecoder {
impl crate::DcApiProtocolDecoder for crate::DcLaunchpadVirtualsDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.admin.jupiter_lock";
return "kb-lib.decoder.launchpad.virtuals";
}
fn decoder_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::DcApiProtocolDecoder for crate::DcAdminJupiterLockDecoder {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::ADMIN_JUPITER_LOCK_PROGRAM_ID];
return &[kb_program_ids::LAUNCHPAD_VIRTUALS_PROGRAM_ID];
}
fn supports_observation(

View File

@@ -4,6 +4,7 @@
//! `metadata` decoder family.
mod metaplex_token_metadata;
mod solana_program_metadata;
mod spl_name_service;
/// Exhaustive published Metaplex account-key inventory.
@@ -76,6 +77,8 @@ pub use self::metaplex_token_metadata::decoder_metadata_metaplex_token_metadata_
pub use self::metaplex_token_metadata::decoder_metadata_metaplex_token_metadata_decode_token_record_account;
/// Decodes one Use Authority Record account.
pub use self::metaplex_token_metadata::decoder_metadata_metaplex_token_metadata_decode_use_authority_record_account;
/// Reserved `kb-lib.decoder.metadata.solana_program_metadata` decoder.
pub use self::solana_program_metadata::DcMetadataSolanaProgramMetadataDecoder;
/// Reserved `kb-lib.decoder.metadata.spl_name_service` decoder.
pub use self::spl_name_service::DcMetadataSplNameServiceDecoder;

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/decoder/metadata/metaplex_token_metadata/constants.rs
// version: 30
// version: 31
//! Internal constants for Metaplex Token Metadata decoding.
/// Stable decoder surface code.
pub(crate) const DC_METADATA_MTM_SURFACE_CODE: &str = "metadata_metaplex_token_metadata";
pub(crate) const DC_METADATA_MTM_SURFACE_CODE: &str = "metadata.metaplex_token_metadata";
/// Maximum retained instruction payload size.
pub(crate) const DC_METADATA_MTM_MAX_INSTRUCTION_BYTES: usize = 16_384;
/// Maximum encoded base64 instruction payload size.

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/metadata/solana_program_metadata.rs
// version: 1
//! Reserved protocol decoder for `metadata_solana_program_metadata`.
/// Reserved decoder for the `metadata_solana_program_metadata` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcMetadataSolanaProgramMetadataDecoder;
impl crate::DcApiProtocolDecoder for crate::DcMetadataSolanaProgramMetadataDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.metadata.solana_program_metadata";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::METADATA_SOLANA_PROGRAM_METADATA_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}

View File

@@ -1,9 +1,12 @@
// file: kb-lib/src/decoder/nft.rs
// version: 4
// version: 5
//! `nft` decoder family.
mod metaplex_bubblegum;
mod tensor_cnft;
/// Reserved `kb-lib.decoder.nft.metaplex_bubblegum` decoder.
pub use self::metaplex_bubblegum::DcNftMetaplexBubblegumDecoder;
/// Reserved `kb-lib.decoder.nft.tensor_cnft` decoder.
pub use self::tensor_cnft::DcNftTensorCnftDecoder;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/decoder/admin/pump_fees.rs
// version: 4
// file: kb-lib/src/decoder/nft/tensor_cnft.rs
// version: 1
//! Reserved protocol decoder for `admin_pump_fees`.
//! Reserved protocol decoder for `nft_tensor_cnft`.
/// Reserved decoder for the `admin_pump_fees` program surface.
/// Reserved decoder for the `nft_tensor_cnft` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcAdminPumpFeesDecoder;
pub struct DcNftTensorCnftDecoder;
impl crate::DcApiProtocolDecoder for crate::DcAdminPumpFeesDecoder {
impl crate::DcApiProtocolDecoder for crate::DcNftTensorCnftDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.admin.pump_fees";
return "kb-lib.decoder.nft.tensor_cnft";
}
fn decoder_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::DcApiProtocolDecoder for crate::DcAdminPumpFeesDecoder {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::ADMIN_PUMP_FEES_PROGRAM_ID];
return &[kb_program_ids::NFT_TENSOR_CNFT_PROGRAM_ID];
}
fn supports_observation(

View File

@@ -1,15 +1,18 @@
// file: kb-lib/src/decoder/perpetuals.rs
// version: 4
// version: 5
//! `perpetuals` decoder family.
mod drift_v2;
mod jupiter;
mod phoenix_eternal;
mod zeta;
/// Reserved `kb-lib.decoder.perpetuals.drift_v2` decoder.
pub use self::drift_v2::DcPerpetualsDriftV2Decoder;
/// Reserved `kb-lib.decoder.perpetuals.jupiter` decoder.
pub use self::jupiter::DcPerpetualsJupiterDecoder;
/// Reserved `kb-lib.decoder.perpetuals.phoenix_eternal` decoder.
pub use self::phoenix_eternal::DcPerpetualsPhoenixEternalDecoder;
/// Reserved `kb-lib.decoder.perpetuals.zeta` decoder.
pub use self::zeta::DcPerpetualsZetaDecoder;

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/perpetuals/phoenix_eternal.rs
// version: 1
//! Reserved protocol decoder for `perpetuals_phoenix_eternal`.
/// Reserved decoder for the `perpetuals_phoenix_eternal` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcPerpetualsPhoenixEternalDecoder;
impl crate::DcApiProtocolDecoder for crate::DcPerpetualsPhoenixEternalDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.perpetuals.phoenix_eternal";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::PERPETUALS_PHOENIX_ETERNAL_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}

View File

@@ -1,12 +1,11 @@
// file: kb-lib/src/decoder/router.rs
// version: 4
// version: 5
//! `router` decoder family.
mod dflow_aggregator_v4;
mod jupiter_aggregator_v4;
mod jupiter_aggregator_v6;
mod jupiter_dca;
mod okx_labs_v1;
mod okx_labs_v2;
@@ -16,8 +15,6 @@ pub use self::dflow_aggregator_v4::DcRouterDflowAggregatorV4Decoder;
pub use self::jupiter_aggregator_v4::DcRouterJupiterAggregatorV4Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_aggregator_v6` decoder.
pub use self::jupiter_aggregator_v6::DcRouterJupiterAggregatorV6Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_dca` decoder.
pub use self::jupiter_dca::DcRouterJupiterDcaDecoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v1` decoder.
pub use self::okx_labs_v1::DcRouterOkxLabsV1Decoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v2` decoder.

View File

@@ -1,48 +1,48 @@
// file: kb-lib/src/decoder/solana/core/constants.rs
// version: 14
// version: 15
//! Local constants for the Solana Core decoder component.
/// Stable protocol code shared by native Solana events.
pub(crate) const DC_SOLANA_CORE_PROTOCOL_CODE: &str = "solana_native";
pub(crate) const DC_SOLANA_CORE_PROTOCOL_CODE: &str = "solana.core";
/// Stable System Program surface code.
pub(crate) const DC_SOLANA_CORE_SYSTEM_SURFACE_CODE: &str = "solana_native_system";
pub(crate) const DC_SOLANA_CORE_SYSTEM_SURFACE_CODE: &str = "solana.core.system";
/// Stable deprecated immutable BPF Loader surface code.
pub(crate) const DC_SOLANA_CORE_BPF_LOADER_DEPRECATED_SURFACE_CODE: &str =
"solana_native_bpf_loader_deprecated";
"solana.core.bpf_loader_deprecated";
/// Stable immutable BPF Loader v2 surface code.
pub(crate) const DC_SOLANA_CORE_BPF_LOADER_SURFACE_CODE: &str = "solana_native_bpf_loader";
pub(crate) const DC_SOLANA_CORE_BPF_LOADER_SURFACE_CODE: &str = "solana.core.bpf_loader";
/// Stable upgradeable BPF Loader surface code.
pub(crate) const DC_SOLANA_CORE_BPF_LOADER_UPGRADEABLE_SURFACE_CODE: &str =
"solana_native_bpf_loader_upgradeable";
"solana.core.bpf_loader_upgradeable";
/// Stable Loader v4 surface code.
pub(crate) const DC_SOLANA_CORE_LOADER_V4_SURFACE_CODE: &str = "solana_native_loader_v4";
pub(crate) const DC_SOLANA_CORE_LOADER_V4_SURFACE_CODE: &str = "solana.core.loader_v4";
/// Stable Native Loader surface code.
pub(crate) const DC_SOLANA_CORE_NATIVE_LOADER_SURFACE_CODE: &str = "solana_native_loader";
pub(crate) const DC_SOLANA_CORE_NATIVE_LOADER_SURFACE_CODE: &str = "solana.core.loader";
/// Stable Compute Budget surface code.
pub(crate) const DC_SOLANA_CORE_COMPUTE_BUDGET_SURFACE_CODE: &str = "solana_native_compute_budget";
pub(crate) const DC_SOLANA_CORE_COMPUTE_BUDGET_SURFACE_CODE: &str = "solana.core.compute_budget";
/// Stable Address Lookup Table surface code.
pub(crate) const DC_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_SURFACE_CODE: &str =
"solana_native_address_lookup_table";
"solana.core.address_lookup_table";
/// Stable Vote Program surface code.
pub(crate) const DC_SOLANA_CORE_VOTE_SURFACE_CODE: &str = "solana_native_vote";
pub(crate) const DC_SOLANA_CORE_VOTE_SURFACE_CODE: &str = "solana.core.vote";
/// Stable Stake Program surface code.
pub(crate) const DC_SOLANA_CORE_STAKE_SURFACE_CODE: &str = "solana_native_stake";
pub(crate) const DC_SOLANA_CORE_STAKE_SURFACE_CODE: &str = "solana.core.stake";
/// Stable Config Program surface code.
pub(crate) const DC_SOLANA_CORE_CONFIG_SURFACE_CODE: &str = "solana_native_config";
pub(crate) const DC_SOLANA_CORE_CONFIG_SURFACE_CODE: &str = "solana.core.config";
/// Stable Feature Gate surface code.
pub(crate) const DC_SOLANA_CORE_FEATURE_SURFACE_CODE: &str = "solana_native_feature";
pub(crate) const DC_SOLANA_CORE_FEATURE_SURFACE_CODE: &str = "solana.core.feature";
/// Stable Ed25519 signature precompile surface code.
pub(crate) const DC_SOLANA_CORE_ED25519_SURFACE_CODE: &str = "solana_native_ed25519";
pub(crate) const DC_SOLANA_CORE_ED25519_SURFACE_CODE: &str = "solana.core.ed25519";
/// Stable secp256k1 signature precompile surface code.
pub(crate) const DC_SOLANA_CORE_SECP256K1_SURFACE_CODE: &str = "solana_native_secp256k1";
pub(crate) const DC_SOLANA_CORE_SECP256K1_SURFACE_CODE: &str = "solana.core.secp256k1";
/// Stable secp256r1 signature precompile surface code.
pub(crate) const DC_SOLANA_CORE_SECP256R1_SURFACE_CODE: &str = "solana_native_secp256r1";
pub(crate) const DC_SOLANA_CORE_SECP256R1_SURFACE_CODE: &str = "solana.core.secp256r1";
/// Stable native ZK ElGamal Proof surface code.
pub(crate) const DC_SOLANA_CORE_ZK_ELGAMAL_PROOF_SURFACE_CODE: &str =
"solana_native_zk_elgamal_proof";
"solana.core.zk_elgamal_proof";
/// Stable historical ZK Token Proof surface code.
pub(crate) const DC_SOLANA_CORE_ZK_TOKEN_PROOF_SURFACE_CODE: &str = "solana_native_zk_token_proof";
pub(crate) const DC_SOLANA_CORE_ZK_TOKEN_PROOF_SURFACE_CODE: &str = "solana.core.zk_token_proof";
/// Byte length shared by compact Ed25519, secp256k1 and secp256r1 signatures.
pub(crate) const DC_SOLANA_CORE_SIGNATURE_BYTES: usize = 64;
/// Byte length of an Ed25519 public key.
@@ -56,7 +56,7 @@ pub(crate) const DC_SOLANA_CORE_U16_OFFSETS_BYTES: usize = 14;
/// Byte length of one secp256k1 offsets entry.
pub(crate) const DC_SOLANA_CORE_U8_OFFSETS_BYTES: usize = 11;
/// Stable Slashing Program decoder surface code.
pub(crate) const DC_SOLANA_CORE_SLASHING_SURFACE_CODE: &str = "solana_native_slashing";
pub(crate) const DC_SOLANA_CORE_SLASHING_SURFACE_CODE: &str = "solana.core.slashing";
/// Runtime maximum number of secp256r1 signatures in one precompile instruction.
pub(crate) const DC_SOLANA_CORE_SECP256R1_MAX_SIGNATURES: usize = 8;
/// Maximum number of component bytes retained as a hexadecimal event prefix.

View File

@@ -1,97 +1,97 @@
// file: kb-lib/src/decoder/solana/core/decoder.rs
// version: 26
// version: 27
//! Runtime-native Solana program classifier for the common decode pipeline.
const NATIVE_SURFACES: &[crate::DcApiDecoderSurface] = &[
crate::DcApiDecoderSurface {
program_id: kb_program_ids::ADDRESS_LOOKUP_TABLE_PROGRAM_ID,
surface_code: "solana_native_address_lookup_table",
surface_code: "solana.core.address_lookup_table",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::BPF_LOADER_DEPRECATED_PROGRAM_ID,
surface_code: "solana_native_bpf_loader_deprecated",
surface_code: "solana.core.bpf_loader_deprecated",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::BPF_LOADER_PROGRAM_ID,
surface_code: "solana_native_bpf_loader",
surface_code: "solana.core.bpf_loader",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::BPF_LOADER_UPGRADEABLE_PROGRAM_ID,
surface_code: "solana_native_bpf_loader_upgradeable",
surface_code: "solana.core.bpf_loader_upgradeable",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::COMPUTE_BUDGET_PROGRAM_ID,
surface_code: "solana_native_compute_budget",
surface_code: "solana.core.compute_budget",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::CONFIG_PROGRAM_ID,
surface_code: "solana_native_config",
surface_code: "solana.core.config",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::ED25519_PROGRAM_ID,
surface_code: "solana_native_ed25519",
surface_code: "solana.core.ed25519",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::FEATURE_PROGRAM_ID,
surface_code: "solana_native_feature",
surface_code: "solana.core.feature",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::LOADER_V4_PROGRAM_ID,
surface_code: "solana_native_loader_v4",
surface_code: "solana.core.loader_v4",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::NATIVE_LOADER_PROGRAM_ID,
surface_code: "solana_native_loader",
surface_code: "solana.core.loader",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::SECP256K1_PROGRAM_ID,
surface_code: "solana_native_secp256k1",
surface_code: "solana.core.secp256k1",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::SECP256R1_PROGRAM_ID,
surface_code: "solana_native_secp256r1",
surface_code: "solana.core.secp256r1",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::SLASHING_PROGRAM_ID,
surface_code: "solana_native_slashing",
surface_code: "solana.core.slashing",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::STAKE_PROGRAM_ID,
surface_code: "solana_native_stake",
surface_code: "solana.core.stake",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::SYSTEM_PROGRAM_ID,
surface_code: "solana_native_system",
surface_code: "solana.core.system",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::VOTE_PROGRAM_ID,
surface_code: "solana_native_vote",
surface_code: "solana.core.vote",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::ZK_ELGAMAL_PROOF_PROGRAM_ID,
surface_code: "solana_native_zk_elgamal_proof",
surface_code: "solana.core.zk_elgamal_proof",
priority: 100,
},
crate::DcApiDecoderSurface {
program_id: kb_program_ids::ZK_TOKEN_PROOF_PROGRAM_ID,
surface_code: "solana_native_zk_token_proof",
surface_code: "solana.core.zk_token_proof",
priority: 100,
},
];
@@ -157,7 +157,7 @@ impl crate::DcApiProtocolDecoder for crate::DcSolanaCoreDecoder {
impl crate::DcApiInstructionDecoder for crate::DcSolanaCoreDecoder {
fn identity(&self) -> crate::DcApiDecoderIdentity {
return crate::DcApiDecoderIdentity {
name: "solana_native_classifier".to_string(),
name: "solana.core".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -304,7 +304,7 @@ impl crate::DcApiInstructionDecoder for crate::DcSolanaCoreDecoder {
slot = input.slot,
instruction_path = %input.instruction_path,
program_id = %input.program_id,
processor_name = "solana_native_classifier",
processor_name = "solana.core",
processor_version = env!("CARGO_PKG_VERSION"),
input_key = %input.replay_input_key,
payload_hash = ?input.instruction_payload_hash,
@@ -376,7 +376,7 @@ mod tests {
assert!(recognition.compatible);
assert_eq!(
recognition.surface_code.as_deref(),
std::option::Option::Some("solana_native_vote")
std::option::Option::Some("solana.core.vote")
);
assert_eq!(
recognition.entry_code.as_deref(),
@@ -395,7 +395,7 @@ mod tests {
assert!(recognition.compatible);
assert_eq!(
recognition.surface_code.as_deref(),
std::option::Option::Some("solana_native_stake")
std::option::Option::Some("solana.core.stake")
);
assert_eq!(
recognition.entry_code.as_deref(),
@@ -414,7 +414,7 @@ mod tests {
assert!(recognition.compatible);
assert_eq!(
recognition.surface_code.as_deref(),
std::option::Option::Some("solana_native_zk_token_proof")
std::option::Option::Some("solana.core.zk_token_proof")
);
assert_eq!(
recognition.entry_code.as_deref(),
@@ -486,7 +486,7 @@ mod tests {
assert!(recognition.compatible);
assert_eq!(
recognition.surface_code.as_deref(),
std::option::Option::Some("solana_native_slashing")
std::option::Option::Some("solana.core.slashing")
);
assert_eq!(
recognition.entry_code.as_deref(),

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/decoder/solana/core/precompiles.rs
// version: 4
// version: 5
//! Bounded structural decoding for Solana signature verification precompiles.
@@ -1654,7 +1654,7 @@ mod tests {
assert_eq!(first, second);
assert_eq!(
first.observations[0].event.event_code.0,
"solana_native_secp256r1.signature_verification"
"solana.core.secp256r1.signature_verification"
);
assert_eq!(parameters(&first)["runtimeVerification"], "accepted_in_successful_transaction");
let decoded_bytes = match crate::decoder_solana_core_decode_instruction_data(&input) {

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/decoder/spl/associated_token_account/constants.rs
// version: 2
// version: 3
//! Local constants for the `kb-lib` SPL Associated Token Account component.
/// Stable protocol and surface code for the Associated Token Account program.
pub(crate) const DC_SPL_ATA_SURFACE_CODE: &str = "spl_associated_token_account";
pub(crate) const DC_SPL_ATA_SURFACE_CODE: &str = "spl.associated_token_account";
/// Current stable decoded event contract version.
pub(crate) const DC_SPL_ATA_EVENT_VERSION: u32 = 1;
/// Maximum retained instruction payload size.

View File

@@ -1,9 +1,9 @@
// file: kb-lib/src/decoder/spl/elgamal_registry/constants.rs
// version: 2
// version: 3
//! Constants for the SPL ElGamal registry decoder.
pub(crate) const DC_SPL_ELGAMAL_REGISTRY_SURFACE_CODE: &str = "spl_elgamal_registry";
pub(crate) const DC_SPL_ELGAMAL_REGISTRY_SURFACE_CODE: &str = "spl.elgamal_registry";
pub(crate) const DC_SPL_ELGAMAL_REGISTRY_EVENT_VERSION: u32 = 1;
pub(crate) const DC_SPL_ELGAMAL_REGISTRY_MAX_INSTRUCTION_BYTES: usize = 16;

View File

@@ -6,7 +6,7 @@
const SURFACES: &[crate::DcApiDecoderSurface] = &[crate::DcApiDecoderSurface {
program_id: kb_program_ids::SPL_TOKEN_2022_ELGAMAL_REGISTRY_PROGRAM_ID,
surface_code: crate::DC_SPL_ELGAMAL_REGISTRY_SURFACE_CODE,
priority: 100,
priority: 101,
}];
const PROGRAM_IDS: &[&str] = &[kb_program_ids::SPL_TOKEN_2022_ELGAMAL_REGISTRY_PROGRAM_ID];
@@ -50,7 +50,7 @@ impl crate::DcApiProtocolDecoder for crate::DcSplElgamalRegistryDecoder {
impl crate::DcApiInstructionDecoder for crate::DcSplElgamalRegistryDecoder {
fn identity(&self) -> crate::DcApiDecoderIdentity {
return crate::DcApiDecoderIdentity {
name: "spl_elgamal_registry".to_string(),
name: "spl.elgamal_registry".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -131,7 +131,7 @@ impl crate::DcApiInstructionDecoder for crate::DcSplElgamalRegistryDecoder {
slot = input.slot,
instruction_path = %input.instruction_path,
program_id = %input.program_id,
processor_name = "spl_elgamal_registry",
processor_name = "spl.elgamal_registry",
processor_version = env!("CARGO_PKG_VERSION"),
input_key = %input.replay_input_key,
payload_hash = ?input.instruction_payload_hash,

View File

@@ -1,16 +1,16 @@
// file: kb-lib/src/decoder/spl/memo/constants.rs
// version: 3
// version: 4
//! Local constants for the `kb-lib` SPL Memo component. Program identifiers live in `kb_program_ids`.
/// Stable protocol code shared by Memo generations.
pub(crate) const DC_SPL_MEMO_PROTOCOL_CODE: &str = "spl_memo";
pub(crate) const DC_SPL_MEMO_PROTOCOL_CODE: &str = "spl.memo";
/// Stable Memo v1 surface code.
pub(crate) const DC_SPL_MEMO_V1_SURFACE_CODE: &str = "spl_memo_v1";
pub(crate) const DC_SPL_MEMO_V1_SURFACE_CODE: &str = "spl.memo.v1";
/// Stable Memo v3 surface code.
pub(crate) const DC_SPL_MEMO_V3_SURFACE_CODE: &str = "spl_memo_v3";
pub(crate) const DC_SPL_MEMO_V3_SURFACE_CODE: &str = "spl.memo.v3";
/// Stable Memo v4 surface code.
pub(crate) const DC_SPL_MEMO_V4_SURFACE_CODE: &str = "spl_memo_v4";
pub(crate) const DC_SPL_MEMO_V4_SURFACE_CODE: &str = "spl.memo.v4";
/// Maximum decoded instruction data retained as a complete Memo payload.
pub(crate) const DC_SPL_MEMO_MAX_PAYLOAD_BYTES: usize = 4_096;
/// Maximum payload prefix retained for bounded diagnostics.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/decoder/spl/memo/decoder.rs
// version: 3
// version: 4
//! Exact SPL Memo v1, v3 and v4 dispatch for the common decode pipeline.
@@ -65,7 +65,7 @@ impl crate::DcApiProtocolDecoder for crate::DcSplMemoDecoder {
impl crate::DcApiInstructionDecoder for crate::DcSplMemoDecoder {
fn identity(&self) -> crate::DcApiDecoderIdentity {
return crate::DcApiDecoderIdentity {
name: "spl_memo".to_string(),
name: "spl.memo".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -130,7 +130,7 @@ impl crate::DcApiInstructionDecoder for crate::DcSplMemoDecoder {
slot = input.slot,
instruction_path = %input.instruction_path,
program_id = %input.program_id,
processor_name = "spl_memo",
processor_name = "spl.memo",
processor_version = env!("CARGO_PKG_VERSION"),
input_key = %input.replay_input_key,
payload_hash = ?input.instruction_payload_hash,

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/decoder/spl/token/constants.rs
// version: 2
// version: 3
//! Local constants for the `kb-lib` SPL Token component. Program identifiers live in `kb_program_ids`.
/// Stable protocol and surface code for the classic SPL Token program.
pub(crate) const DC_SPL_TOKEN_SURFACE_CODE: &str = "spl_token";
pub(crate) const DC_SPL_TOKEN_SURFACE_CODE: &str = "spl.token";
/// Current stable decoded event contract version.
pub(crate) const DC_SPL_TOKEN_EVENT_VERSION: u32 = 1;
/// Maximum retained instruction payload size.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/decoder/spl/token/decoder.rs
// version: 3
// version: 4
//! Exact classic SPL Token dispatch for the common decode pipeline.
@@ -50,7 +50,7 @@ impl crate::DcApiProtocolDecoder for crate::DcSplTokenDecoder {
impl crate::DcApiInstructionDecoder for crate::DcSplTokenDecoder {
fn identity(&self) -> crate::DcApiDecoderIdentity {
return crate::DcApiDecoderIdentity {
name: "spl_token".to_string(),
name: "spl.token".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -115,7 +115,7 @@ impl crate::DcApiInstructionDecoder for crate::DcSplTokenDecoder {
slot = input.slot,
instruction_path = %input.instruction_path,
program_id = %input.program_id,
processor_name = "spl_token",
processor_name = "spl.token",
processor_version = env!("CARGO_PKG_VERSION"),
input_key = %input.replay_input_key,
payload_hash = ?input.instruction_payload_hash,

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/decoder/spl/token_2022/constants.rs
// version: 3
// version: 4
//! Local constants for the exact Token-2022 decoder. Program identifiers live in `kb_program_ids`.
/// Stable Token-2022 surface code.
pub(crate) const DC_SPL_TOKEN_2022_SURFACE_CODE: &str = "spl_token_2022";
pub(crate) const DC_SPL_TOKEN_2022_SURFACE_CODE: &str = "spl.token_2022";
/// Current decoded event contract version.
pub(crate) const DC_SPL_TOKEN_2022_EVENT_VERSION: u32 = 1;
/// Maximum retained instruction payload size.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/decoder/spl/token_2022/decoder.rs
// version: 4
// version: 5
//! Exact Token-2022 dispatch for the common decode pipeline.
@@ -50,7 +50,7 @@ impl crate::DcApiProtocolDecoder for crate::DcSplToken2022Decoder {
impl crate::DcApiInstructionDecoder for crate::DcSplToken2022Decoder {
fn identity(&self) -> crate::DcApiDecoderIdentity {
return crate::DcApiDecoderIdentity {
name: "spl_token_2022".to_string(),
name: "spl.token_2022".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -115,7 +115,7 @@ impl crate::DcApiInstructionDecoder for crate::DcSplToken2022Decoder {
slot = input.slot,
instruction_path = %input.instruction_path,
program_id = %input.program_id,
processor_name = "spl_token_2022",
processor_name = "spl.token_2022",
processor_version = env!("CARGO_PKG_VERSION"),
input_key = %input.replay_input_key,
payload_hash = ?input.instruction_payload_hash,

View File

@@ -1,12 +1,15 @@
// file: kb-lib/src/decoder/staking.rs
// version: 4
// version: 5
//! `staking` decoder family.
mod jito_tip_distribution;
mod kamino_farm;
mod marinade_finance;
mod solayer;
/// Reserved `kb-lib.decoder.staking.jito_tip_distribution` decoder.
pub use self::jito_tip_distribution::DcStakingJitoTipDistributionDecoder;
/// Reserved `kb-lib.decoder.staking.kamino_farm` decoder.
pub use self::kamino_farm::DcStakingKaminoFarmDecoder;
/// Reserved `kb-lib.decoder.staking.marinade_finance` decoder.

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/staking/jito_tip_distribution.rs
// version: 1
//! Reserved protocol decoder for `staking_jito_tip_distribution`.
/// Reserved decoder for the `staking_jito_tip_distribution` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcStakingJitoTipDistributionDecoder;
impl crate::DcApiProtocolDecoder for crate::DcStakingJitoTipDistributionDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.staking.jito_tip_distribution";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::STAKING_JITO_TIP_DISTRIBUTION_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}

View File

@@ -0,0 +1,9 @@
// file: kb-lib/src/decoder/storage.rs
// version: 5
//! `storage` decoder family.
mod solana_record;
/// Reserved `kb-lib.decoder.storage.solana_record` decoder.
pub use self::solana_record::DcStorageSolanaRecordDecoder;

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/storage/solana_record.rs
// version: 1
//! Reserved protocol decoder for `storage_solana_record`.
/// Reserved decoder for the `storage_solana_record` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcStorageSolanaRecordDecoder;
impl crate::DcApiProtocolDecoder for crate::DcStorageSolanaRecordDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.storage.solana_record";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::STORAGE_SOLANA_RECORD_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}

View File

@@ -0,0 +1,9 @@
// file: kb-lib/src/decoder/strategy.rs
// version: 5
//! `strategy` decoder family.
mod jupiter_dca;
/// Reserved `kb-lib.decoder.strategy.jupiter_dca` decoder.
pub use self::jupiter_dca::DcStrategyJupiterDcaDecoder;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/decoder/router/jupiter_dca.rs
// file: kb-lib/src/decoder/strategy/jupiter_dca.rs
// version: 4
//! Reserved protocol decoder for `router_jupiter_dca`.
//! Reserved protocol decoder for `strategy_jupiter_dca`.
/// Reserved decoder for the `router_jupiter_dca` program surface.
/// Reserved decoder for the `strategy_jupiter_dca` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcRouterJupiterDcaDecoder;
pub struct DcStrategyJupiterDcaDecoder;
impl crate::DcApiProtocolDecoder for crate::DcRouterJupiterDcaDecoder {
impl crate::DcApiProtocolDecoder for crate::DcStrategyJupiterDcaDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.router.jupiter_dca";
return "kb-lib.decoder.strategy.jupiter_dca";
}
fn decoder_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::DcApiProtocolDecoder for crate::DcRouterJupiterDcaDecoder {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::ROUTER_JUPITER_DCA_PROGRAM_ID];
return &[kb_program_ids::STRATEGY_JUPITER_DCA_PROGRAM_ID];
}
fn supports_observation(

View File

@@ -1,9 +1,12 @@
// file: kb-lib/src/decoder/vesting.rs
// version: 4
// version: 5
//! `vesting` decoder family.
mod jupiter_lock;
mod streamflow;
/// Reserved `kb-lib.decoder.vesting.jupiter_lock` decoder.
pub use self::jupiter_lock::DcVestingJupiterLockDecoder;
/// Reserved `kb-lib.decoder.vesting.streamflow` decoder.
pub use self::streamflow::DcVestingStreamflowDecoder;

View File

@@ -0,0 +1,39 @@
// file: kb-lib/src/decoder/vesting/jupiter_lock.rs
// version: 4
//! Reserved protocol decoder for `vesting_jupiter_lock`.
/// Reserved decoder for the `vesting_jupiter_lock` program surface.
#[derive(Clone, Debug, Default)]
pub struct DcVestingJupiterLockDecoder;
impl crate::DcApiProtocolDecoder for crate::DcVestingJupiterLockDecoder {
fn decoder_name(&self) -> &'static str {
return "kb-lib.decoder.vesting.jupiter_lock";
}
fn decoder_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::VESTING_JUPITER_LOCK_PROGRAM_ID];
}
fn supports_observation(
&self,
observation: &crate::MdProgramObservation,
) -> crate::DcApiDecoderSupport {
if crate::DcApiProtocolDecoder::handles_program_id(self, &observation.program_id) {
return crate::DcApiDecoderSupport::Maybe;
}
return crate::DcApiDecoderSupport::No;
}
fn decode_observation(
&self,
_observation: &crate::MdProgramObservation,
) -> kb_core::Result<std::vec::Vec<crate::MdDecodedProtocolEvent>> {
return std::result::Result::Ok(std::vec::Vec::new());
}
}