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

@@ -4,7 +4,6 @@
//! Consolidated decoder modules.
mod adapter;
mod admin;
mod amm;
mod anchor;
mod api;
@@ -27,6 +26,8 @@ mod solana;
mod spl;
mod stable;
mod staking;
mod storage;
mod strategy;
mod treasury;
mod vault;
mod vesting;
@@ -35,10 +36,9 @@ mod weighted;
/// Reserved `kb-lib.decoder.adapter.saber_decimal_wrapper` decoder.
pub use self::adapter::DcAdapterSaberDecimalWrapperDecoder;
/// Reserved `kb-lib.decoder.admin.jupiter_lock` decoder.
pub use self::admin::DcAdminJupiterLockDecoder;
/// Reserved `kb-lib.decoder.admin.pump_fees` decoder.
pub use self::admin::DcAdminPumpFeesDecoder;
/// Approve Collection Authority discriminator.
/// Reserved `kb-lib.decoder.adapter.spl_token_wrap` decoder.
pub use self::adapter::DcAdapterSplTokenWrapDecoder;
/// Reserved `kb-lib.decoder.amm.aldrin_v1` decoder.
pub use self::amm::DcAmmAldrinV1Decoder;
/// Reserved `kb-lib.decoder.amm.aldrin_v2` decoder.
@@ -61,8 +61,6 @@ pub use self::amm::DcAmmGoosefxV2Decoder;
pub use self::amm::DcAmmGuacSwapDecoder;
/// Reserved `kb-lib.decoder.amm.lifinity_swap_v2` decoder.
pub use self::amm::DcAmmLifinitySwapV2Decoder;
/// Reserved `kb-lib.decoder.amm.metadao_futarchy_amm` decoder.
pub use self::amm::DcAmmMetadaoFutarchyAmmDecoder;
/// Reserved `kb-lib.decoder.amm.metadao_v0_5` decoder.
pub use self::amm::DcAmmMetadaoV05Decoder;
/// Reserved `kb-lib.decoder.amm.meteora_damm_v1` decoder.
@@ -83,8 +81,6 @@ pub use self::amm::DcAmmSolfiDecoder;
pub use self::amm::DcAmmSolfiV2Decoder;
/// Reserved `kb-lib.decoder.amm.vertigo` decoder.
pub use self::amm::DcAmmVertigoDecoder;
/// Reserved `kb-lib.decoder.amm.virtuals` decoder.
pub use self::amm::DcAmmVirtualsDecoder;
/// Reserved `kb-lib.decoder.amm.woofi` decoder.
pub use self::amm::DcAmmWoofiDecoder;
/// Reserved `kb-lib.decoder.amm.zero_fi` decoder.
@@ -161,8 +157,14 @@ pub use self::dlmm::DcDlmmMeteoraDecoder;
pub use self::fees::DcFeesBagsFeeShareV1Decoder;
/// Reserved `kb-lib.decoder.fees.bags_fee_share_v2` decoder.
pub use self::fees::DcFeesBagsFeeShareV2Decoder;
/// Reserved `kb-lib.decoder.admin.pump_fees` decoder.
pub use self::fees::DcFeesPumpFeesDecoder;
/// Reserved `kb-lib.decoder.governance.metadao_bid_wall` decoder.
pub use self::governance::DcGovernanceMetadaoBidWallDecoder;
/// Reserved `kb-lib.decoder.amm.metadao_futarchy_amm` decoder.
pub use self::governance::DcGovernanceMetadaoFutarchyDecoder;
/// Reserved `kb-lib.decoder.governance.squads_multisig` decoder.
pub use self::governance::DcGovernanceSquadsMultisigDecoder;
/// Reserved `kb-lib.decoder.launchpad.boop_fun` decoder.
pub use self::launchpad::DcLaunchpadBoopFunDecoder;
/// Reserved `kb-lib.decoder.launchpad.metadao_ico` decoder.
@@ -181,6 +183,8 @@ pub use self::launchpad::DcLaunchpadPumpFunDecoder;
pub use self::launchpad::DcLaunchpadPumpPumpupAiDecoder;
/// Reserved `kb-lib.decoder.launchpad.raydium_launchlab` decoder.
pub use self::launchpad::DcLaunchpadRaydiumLaunchlabDecoder;
/// Reserved `kb-lib.decoder.amm.virtuals` decoder.
pub use self::launchpad::DcLaunchpadVirtualsDecoder;
/// Reserved `kb-lib.decoder.lending.clone` decoder.
pub use self::lending::DcLendingCloneDecoder;
/// Reserved `kb-lib.decoder.lending.jupiter_lend_borrow` decoder.
@@ -197,176 +201,6 @@ pub use self::lending::DcLendingKaminoDecoder;
pub use self::lending::DcLendingMarginfiV2Decoder;
/// Reserved `kb-lib.decoder.lock.raydium_lp` decoder.
pub use self::lock::DcLockRaydiumLpDecoder;
/// Exhaustive published Metaplex account-key inventory.
pub use self::metadata::DC_METADATA_MTM_METADATA_ACCOUNT_LAYOUT_AUDIT;
/// Exact decoder for the Metaplex Token Metadata program.
pub use self::metadata::DcMetadataMetaplexTokenMetadataDecoder;
/// Canonical projection shared by Collection and Use Authority records.
pub use self::metadata::DcMetadataMtmAuthorityRecordAccountSnapshot;
/// Stable identity and policy of one canonical account snapshot.
pub use self::metadata::DcMetadataMtmCanonicalAccountIdentity;
/// Lifecycle class of one canonical account layout.
pub use self::metadata::DcMetadataMtmCanonicalAccountLifecycle;
/// Provenance retained for one canonical account observation.
pub use self::metadata::DcMetadataMtmCanonicalAccountProvenance;
/// Execution policy separated from historical materialization.
pub use self::metadata::DcMetadataMtmCanonicalExecutionPolicy;
/// Materialization policy for active or historical state.
pub use self::metadata::DcMetadataMtmCanonicalMaterializationPolicy;
/// Canonical account envelope used by materializers and replay.
pub use self::metadata::DcMetadataMtmCanonicalMetadataAccountSnapshot;
/// Typed canonical Metaplex account state.
pub use self::metadata::DcMetadataMtmCanonicalMetadataAccountState;
/// Origin of one canonical account observation.
pub use self::metadata::DcMetadataMtmCanonicalObservationSource;
/// Canonical projection shared by Metadata and Holder delegate records.
pub use self::metadata::DcMetadataMtmDelegateRecordAccountSnapshot;
/// Supported edition account layout.
pub use self::metadata::DcMetadataMtmEditionAccountKind;
/// Canonical bounded projection of one edition or master-edition account.
pub use self::metadata::DcMetadataMtmEditionAccountSnapshot;
/// Supported Edition Marker account layout.
pub use self::metadata::DcMetadataMtmEditionMarkerAccountKind;
/// Canonical bounded projection of one Edition Marker account.
pub use self::metadata::DcMetadataMtmEditionMarkerAccountSnapshot;
/// Bounded error returned while decoding a Metadata account.
pub use self::metadata::DcMetadataMtmMetadataAccountDecodeError;
/// One entry in the exhaustive published account-key audit.
pub use self::metadata::DcMetadataMtmMetadataAccountLayoutAuditEntry;
/// Canonical bounded projection of one Metadata account.
pub use self::metadata::DcMetadataMtmMetadataAccountSnapshot;
/// One bounded historical reservation entry.
pub use self::metadata::DcMetadataMtmReservationEntrySnapshot;
/// Historical Reservation List account generation.
pub use self::metadata::DcMetadataMtmReservationListAccountKind;
/// Canonical decode-only projection of a historical Reservation List account.
pub use self::metadata::DcMetadataMtmReservationListAccountSnapshot;
/// Canonical projection of one Token Owned Escrow account.
pub use self::metadata::DcMetadataMtmTokenOwnedEscrowAccountSnapshot;
/// Authority form used by one Token Owned Escrow account.
pub use self::metadata::DcMetadataMtmTokenOwnedEscrowAuthorityKind;
/// Canonical bounded projection of one programmable Token Record account.
pub use self::metadata::DcMetadataMtmTokenRecordAccountSnapshot;
/// Reserved `kb-lib.decoder.metadata.spl_name_service` decoder.
pub use self::metadata::DcMetadataSplNameServiceDecoder;
/// Decodes one Collection Authority Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_collection_authority_record_account;
/// Decodes and validates one edition or master-edition account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_edition_account;
/// Decodes and validates one Edition Marker account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_edition_marker_account;
/// Decodes one Holder Delegate Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_holder_delegate_record_account;
/// Decodes and validates one canonical Metadata account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_metadata_account;
/// Decodes one Metadata Delegate Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_metadata_delegate_record_account;
/// Decodes one historical Reservation List V1 or V2 account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_reservation_list_account;
/// Decodes one Token Owned Escrow account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_token_owned_escrow_account;
/// Decodes and validates one programmable Token Record account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_token_record_account;
/// Decodes one Use Authority Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_use_authority_record_account;
/// Reserved `kb-lib.decoder.nft.metaplex_bubblegum` decoder.
pub use self::nft::DcNftMetaplexBubblegumDecoder;
/// Reserved `kb-lib.decoder.orderbook.jupiter_limit_order` decoder.
pub use self::orderbook::DcOrderbookJupiterLimitOrderDecoder;
/// Reserved `kb-lib.decoder.orderbook.jupiter_limit_order_v2` decoder.
pub use self::orderbook::DcOrderbookJupiterLimitOrderV2Decoder;
/// Reserved `kb-lib.decoder.orderbook.openbook_v2` decoder.
pub use self::orderbook::DcOrderbookOpenbookV2Decoder;
/// Reserved `kb-lib.decoder.perpetuals.drift_v2` decoder.
pub use self::perpetuals::DcPerpetualsDriftV2Decoder;
/// Reserved `kb-lib.decoder.perpetuals.jupiter` decoder.
pub use self::perpetuals::DcPerpetualsJupiterDecoder;
/// Reserved `kb-lib.decoder.perpetuals.zeta` decoder.
pub use self::perpetuals::DcPerpetualsZetaDecoder;
/// Reserved `kb-lib.decoder.router.dflow_aggregator_v4` decoder.
pub use self::router::DcRouterDflowAggregatorV4Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_aggregator_v4` decoder.
pub use self::router::DcRouterJupiterAggregatorV4Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_aggregator_v6` decoder.
pub use self::router::DcRouterJupiterAggregatorV6Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_dca` decoder.
pub use self::router::DcRouterJupiterDcaDecoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v1` decoder.
pub use self::router::DcRouterOkxLabsV1Decoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v2` decoder.
pub use self::router::DcRouterOkxLabsV2Decoder;
/// Reserved `kb-lib.decoder.rwa.ondo_global_markets` decoder.
pub use self::rwa::DcRwaOndoGlobalMarketsDecoder;
/// Runtime-native Solana decoder with phased maximal native coverage.
pub use self::solana::DcSolanaCoreDecoder;
/// Exact byte length of one SPL ElGamal registry account.
pub use self::spl::DC_SPL_ELGAMAL_REGISTRY_ACCOUNT_LEN;
/// Reserved `kb-lib.decoder.spl.account_compression` decoder.
pub use self::spl::DcSplAccountCompressionDecoder;
/// Exact decoder for the SPL Associated Token Account program.
pub use self::spl::DcSplAssociatedTokenAccountDecoder;
/// Parsed SPL ElGamal public-key registry account.
pub use self::spl::DcSplElGamalRegistryState;
/// Exact decoder for the SPL ElGamal registry program.
pub use self::spl::DcSplElgamalRegistryDecoder;
/// Exact decoder for the three registered SPL Memo generations.
pub use self::spl::DcSplMemoDecoder;
/// Reserved `kb-lib.decoder.spl.noop` decoder.
pub use self::spl::DcSplNoopDecoder;
/// Reserved `kb-lib.decoder.spl.single_pool` decoder.
pub use self::spl::DcSplSinglePoolDecoder;
/// Reserved `kb-lib.decoder.spl.stake_pool` decoder.
pub use self::spl::DcSplStakePoolDecoder;
/// Exact decoder for the Token-2022 program.
pub use self::spl::DcSplToken2022Decoder;
/// Exact decoder for the classic SPL Token program.
pub use self::spl::DcSplTokenDecoder;
/// Parsed Token-2022 Mint, Account, or Multisig state.
pub use self::spl::DcToken2022State;
/// Exact Token-2022 base account state kind.
pub use self::spl::DcToken2022StateKind;
/// One exact Token-2022 TLV entry.
pub use self::spl::DcToken2022TlvEntry;
/// Parses one exact SPL ElGamal registry account.
pub use self::spl::decoder_spl_elgamal_registry_parse_elgamal_registry_state;
/// Parses one Token-2022 Mint, Account, or Multisig state.
pub use self::spl::decoder_spl_token_2022_parse_token_2022_state;
/// Reserved `kb-lib.decoder.stable.swap_hylo_exchange` decoder.
pub use self::stable::DcStableSwapHyloExchangeDecoder;
/// Reserved `kb-lib.decoder.stable.swap_jupiter_stable` decoder.
pub use self::stable::DcStableSwapJupiterStableDecoder;
/// Reserved `kb-lib.decoder.stable.swap_numeraire` decoder.
pub use self::stable::DcStableSwapNumeraireDecoder;
/// Reserved `kb-lib.decoder.stable.swap_stabble` decoder.
pub use self::stable::DcStableSwapStabbleDecoder;
/// Reserved `kb-lib.decoder.staking.kamino_farm` decoder.
pub use self::staking::DcStakingKaminoFarmDecoder;
/// Reserved `kb-lib.decoder.staking.marinade_finance` decoder.
pub use self::staking::DcStakingMarinadeFinanceDecoder;
/// Reserved `kb-lib.decoder.staking.solayer` decoder.
pub use self::staking::DcStakingSolayerDecoder;
/// Reserved `kb-lib.decoder.treasury.helium_treasury_management` decoder.
pub use self::treasury::DcTreasuryHeliumTreasuryManagementDecoder;
/// Reserved `kb-lib.decoder.vault.carrot_defi` decoder.
pub use self::vault::DcVaultCarrotDefiDecoder;
/// Reserved `kb-lib.decoder.vault.hylo_stability_pool` decoder.
pub use self::vault::DcVaultHyloStabilityPoolDecoder;
/// Reserved `kb-lib.decoder.vault.kamino` decoder.
pub use self::vault::DcVaultKaminoDecoder;
/// Reserved `kb-lib.decoder.vault.kamino_v2` decoder.
pub use self::vault::DcVaultKaminoV2Decoder;
/// Reserved `kb-lib.decoder.vault.kamino_yvaults` decoder.
pub use self::vault::DcVaultKaminoYvaultsDecoder;
/// Reserved `kb-lib.decoder.vault.meteora` decoder.
pub use self::vault::DcVaultMeteoraDecoder;
/// Reserved `kb-lib.decoder.vesting.streamflow` decoder.
pub use self::vesting::DcVestingStreamflowDecoder;
/// Reserved `kb-lib.decoder.wallet.jupiter_apepro_smart_wallet` decoder.
pub use self::wallet::DcWalletJupiterApeproSmartWalletDecoder;
/// Reserved `kb-lib.decoder.weighted.swap_stabble` decoder.
pub use self::weighted::DcWeightedSwapStabbleDecoder;
/// Approve Collection Authority discriminator.
pub(crate) use self::metadata::DC_METADATA_MTM_APPROVE_COLLECTION_AUTHORITY_DISCRIMINATOR;
/// Approve Use Authority discriminator.
pub(crate) use self::metadata::DC_METADATA_MTM_APPROVE_USE_AUTHORITY_DISCRIMINATOR;
@@ -430,6 +264,8 @@ pub(crate) use self::metadata::DC_METADATA_MTM_MAX_BASE64_BYTES;
pub(crate) use self::metadata::DC_METADATA_MTM_MAX_INSTRUCTION_ACCOUNTS;
/// Maximum retained instruction payload size.
pub(crate) use self::metadata::DC_METADATA_MTM_MAX_INSTRUCTION_BYTES;
/// Exhaustive published Metaplex account-key inventory.
pub use self::metadata::DC_METADATA_MTM_METADATA_ACCOUNT_LAYOUT_AUDIT;
/// Migrate discriminator.
pub(crate) use self::metadata::DC_METADATA_MTM_MIGRATE_DISCRIMINATOR;
/// Modern Mint discriminator.
@@ -496,14 +332,116 @@ pub(crate) use self::metadata::DC_METADATA_MTM_VERIFY_COLLECTION_DISCRIMINATOR;
pub(crate) use self::metadata::DC_METADATA_MTM_VERIFY_DISCRIMINATOR;
/// Verify Sized Collection Item discriminator.
pub(crate) use self::metadata::DC_METADATA_MTM_VERIFY_SIZED_COLLECTION_ITEM_DISCRIMINATOR;
/// Exact decoder for the Metaplex Token Metadata program.
pub use self::metadata::DcMetadataMetaplexTokenMetadataDecoder;
/// Canonical projection shared by Collection and Use Authority records.
pub use self::metadata::DcMetadataMtmAuthorityRecordAccountSnapshot;
/// Stable identity and policy of one canonical account snapshot.
pub use self::metadata::DcMetadataMtmCanonicalAccountIdentity;
/// Lifecycle class of one canonical account layout.
pub use self::metadata::DcMetadataMtmCanonicalAccountLifecycle;
/// Provenance retained for one canonical account observation.
pub use self::metadata::DcMetadataMtmCanonicalAccountProvenance;
/// Execution policy separated from historical materialization.
pub use self::metadata::DcMetadataMtmCanonicalExecutionPolicy;
/// Materialization policy for active or historical state.
pub use self::metadata::DcMetadataMtmCanonicalMaterializationPolicy;
/// Canonical account envelope used by materializers and replay.
pub use self::metadata::DcMetadataMtmCanonicalMetadataAccountSnapshot;
/// Typed canonical Metaplex account state.
pub use self::metadata::DcMetadataMtmCanonicalMetadataAccountState;
/// Origin of one canonical account observation.
pub use self::metadata::DcMetadataMtmCanonicalObservationSource;
/// Canonical projection shared by Metadata and Holder delegate records.
pub use self::metadata::DcMetadataMtmDelegateRecordAccountSnapshot;
/// Supported edition account layout.
pub use self::metadata::DcMetadataMtmEditionAccountKind;
/// Canonical bounded projection of one edition or master-edition account.
pub use self::metadata::DcMetadataMtmEditionAccountSnapshot;
/// Supported Edition Marker account layout.
pub use self::metadata::DcMetadataMtmEditionMarkerAccountKind;
/// Canonical bounded projection of one Edition Marker account.
pub use self::metadata::DcMetadataMtmEditionMarkerAccountSnapshot;
/// Bounded error returned while decoding a Metadata account.
pub use self::metadata::DcMetadataMtmMetadataAccountDecodeError;
/// One entry in the exhaustive published account-key audit.
pub use self::metadata::DcMetadataMtmMetadataAccountLayoutAuditEntry;
/// Canonical bounded projection of one Metadata account.
pub use self::metadata::DcMetadataMtmMetadataAccountSnapshot;
/// One bounded historical reservation entry.
pub use self::metadata::DcMetadataMtmReservationEntrySnapshot;
/// Historical Reservation List account generation.
pub use self::metadata::DcMetadataMtmReservationListAccountKind;
/// Canonical decode-only projection of a historical Reservation List account.
pub use self::metadata::DcMetadataMtmReservationListAccountSnapshot;
/// Canonical projection of one Token Owned Escrow account.
pub use self::metadata::DcMetadataMtmTokenOwnedEscrowAccountSnapshot;
/// Authority form used by one Token Owned Escrow account.
pub use self::metadata::DcMetadataMtmTokenOwnedEscrowAuthorityKind;
/// Canonical bounded projection of one programmable Token Record account.
pub use self::metadata::DcMetadataMtmTokenRecordAccountSnapshot;
/// Reserved `kb-lib.decoder.metadata.solana_program_metadata` decoder.
pub use self::metadata::DcMetadataSolanaProgramMetadataDecoder;
/// Reserved `kb-lib.decoder.metadata.spl_name_service` decoder.
pub use self::metadata::DcMetadataSplNameServiceDecoder;
/// Canonical tracing target for this crate.
pub(crate) use self::metadata::TRACING_TARGET_DECODER_METADATA_METAPLEX_TOKEN_METADATA;
/// Crate-root access to `decode` from `instruction`.
pub(crate) use self::metadata::decoder_metadata_metaplex_token_metadata_decode;
/// Decodes one Collection Authority Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_collection_authority_record_account;
/// Decodes and validates one edition or master-edition account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_edition_account;
/// Decodes and validates one Edition Marker account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_edition_marker_account;
/// Decodes one Holder Delegate Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_holder_delegate_record_account;
/// Decodes and validates one canonical Metadata account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_metadata_account;
/// Decodes one Metadata Delegate Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_metadata_delegate_record_account;
/// Decodes one historical Reservation List V1 or V2 account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_reservation_list_account;
/// Decodes one Token Owned Escrow account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_token_owned_escrow_account;
/// Decodes and validates one programmable Token Record account snapshot.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_token_record_account;
/// Decodes one Use Authority Record account.
pub use self::metadata::decoder_metadata_metaplex_token_metadata_decode_use_authority_record_account;
/// Crate-root access to `entry_for_discriminator` from `instruction`.
pub(crate) use self::metadata::decoder_metadata_metaplex_token_metadata_entry_for_discriminator;
/// Crate-root access to `payload_discriminator` from `instruction`.
pub(crate) use self::metadata::decoder_metadata_metaplex_token_metadata_payload_discriminator;
/// Reserved `kb-lib.decoder.nft.metaplex_bubblegum` decoder.
pub use self::nft::DcNftMetaplexBubblegumDecoder;
/// Reserved `kb-lib.decoder.nft.tensor_cnft` decoder.
pub use self::nft::DcNftTensorCnftDecoder;
/// Reserved `kb-lib.decoder.orderbook.jupiter_limit_order` decoder.
pub use self::orderbook::DcOrderbookJupiterLimitOrderDecoder;
/// Reserved `kb-lib.decoder.orderbook.jupiter_limit_order_v2` decoder.
pub use self::orderbook::DcOrderbookJupiterLimitOrderV2Decoder;
/// Reserved `kb-lib.decoder.orderbook.openbook_v2` decoder.
pub use self::orderbook::DcOrderbookOpenbookV2Decoder;
/// Reserved `kb-lib.decoder.perpetuals.drift_v2` decoder.
pub use self::perpetuals::DcPerpetualsDriftV2Decoder;
/// Reserved `kb-lib.decoder.perpetuals.jupiter` decoder.
pub use self::perpetuals::DcPerpetualsJupiterDecoder;
/// Reserved `kb-lib.decoder.perpetuals.phoenix_eternal` decoder.
pub use self::perpetuals::DcPerpetualsPhoenixEternalDecoder;
/// Reserved `kb-lib.decoder.perpetuals.zeta` decoder.
pub use self::perpetuals::DcPerpetualsZetaDecoder;
/// Reserved `kb-lib.decoder.router.dflow_aggregator_v4` decoder.
pub use self::router::DcRouterDflowAggregatorV4Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_aggregator_v4` decoder.
pub use self::router::DcRouterJupiterAggregatorV4Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_aggregator_v6` decoder.
pub use self::router::DcRouterJupiterAggregatorV6Decoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v1` decoder.
pub use self::router::DcRouterOkxLabsV1Decoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v2` decoder.
pub use self::router::DcRouterOkxLabsV2Decoder;
/// Reserved `kb-lib.decoder.rwa.ondo_global_markets` decoder.
pub use self::rwa::DcRwaOndoGlobalMarketsDecoder;
pub(crate) use self::solana::DC_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_SURFACE_CODE;
pub(crate) use self::solana::DC_SOLANA_CORE_BPF_LOADER_DEPRECATED_SURFACE_CODE;
pub(crate) use self::solana::DC_SOLANA_CORE_BPF_LOADER_SURFACE_CODE;
@@ -534,6 +472,8 @@ pub(crate) use self::solana::DC_SOLANA_CORE_VOTE_SURFACE_CODE;
pub(crate) use self::solana::DC_SOLANA_CORE_ZK_ELGAMAL_PROOF_SURFACE_CODE;
pub(crate) use self::solana::DC_SOLANA_CORE_ZK_TOKEN_PROOF_SURFACE_CODE;
pub(crate) use self::solana::DcSolanaCoreAccountRole;
/// Runtime-native Solana decoder with phased maximal native coverage.
pub use self::solana::DcSolanaCoreDecoder;
pub(crate) use self::solana::DcSolanaCoreResolvedInstructionPayload;
pub(crate) use self::solana::TRACING_TARGET_DECODER_SOLANA_CORE;
pub(crate) use self::solana::decoder_solana_core_address_lookup_table_coverage;
@@ -605,6 +545,8 @@ pub(crate) use self::spl::DC_SPL_ATA_MAX_INSTRUCTION_BYTES;
pub(crate) use self::spl::DC_SPL_ATA_MAX_TRANSACTION_KEYS;
/// Stable protocol and surface code for the Associated Token Account program.
pub(crate) use self::spl::DC_SPL_ATA_SURFACE_CODE;
/// Exact byte length of one SPL ElGamal registry account.
pub use self::spl::DC_SPL_ELGAMAL_REGISTRY_ACCOUNT_LEN;
/// Current stable SPL ElGamal registry event contract version.
pub(crate) use self::spl::DC_SPL_ELGAMAL_REGISTRY_EVENT_VERSION;
/// Maximum retained SPL ElGamal registry instruction payload size.
@@ -655,8 +597,34 @@ pub(crate) use self::spl::DC_SPL_TOKEN_MAX_BATCH_INSTRUCTIONS;
pub(crate) use self::spl::DC_SPL_TOKEN_MAX_INSTRUCTION_BYTES;
/// Stable protocol and surface code for the classic SPL Token program.
pub(crate) use self::spl::DC_SPL_TOKEN_SURFACE_CODE;
/// Reserved `kb-lib.decoder.spl.account_compression` decoder.
pub use self::spl::DcSplAccountCompressionDecoder;
/// Exact decoder for the SPL Associated Token Account program.
pub use self::spl::DcSplAssociatedTokenAccountDecoder;
/// One parsed SPL ElGamal registry instruction.
pub(crate) use self::spl::DcSplElGamalRegistryParsedRegistryInstruction;
/// Parsed SPL ElGamal public-key registry account.
pub use self::spl::DcSplElGamalRegistryState;
/// Exact decoder for the SPL ElGamal registry program.
pub use self::spl::DcSplElgamalRegistryDecoder;
/// Exact decoder for the three registered SPL Memo generations.
pub use self::spl::DcSplMemoDecoder;
/// Reserved `kb-lib.decoder.spl.noop` decoder.
pub use self::spl::DcSplNoopDecoder;
/// Reserved `kb-lib.decoder.spl.single_pool` decoder.
pub use self::spl::DcSplSinglePoolDecoder;
/// Reserved `kb-lib.decoder.spl.stake_pool` decoder.
pub use self::spl::DcSplStakePoolDecoder;
/// Exact decoder for the Token-2022 program.
pub use self::spl::DcSplToken2022Decoder;
/// Exact decoder for the classic SPL Token program.
pub use self::spl::DcSplTokenDecoder;
/// Parsed Token-2022 Mint, Account, or Multisig state.
pub use self::spl::DcToken2022State;
/// Exact Token-2022 base account state kind.
pub use self::spl::DcToken2022StateKind;
/// One exact Token-2022 TLV entry.
pub use self::spl::DcToken2022TlvEntry;
/// Canonical tracing target for the Associated Token Account decoder.
pub(crate) use self::spl::TRACING_TARGET_DECODER_SPL_ATA;
/// Canonical tracing target for the SPL ElGamal registry decoder.
@@ -679,12 +647,16 @@ pub(crate) use self::spl::decoder_spl_elgamal_registry_decode;
pub(crate) use self::spl::decoder_spl_elgamal_registry_decode_payload;
/// Parses one exact SPL ElGamal registry instruction.
pub(crate) use self::spl::decoder_spl_elgamal_registry_parse;
/// Parses one exact SPL ElGamal registry account.
pub use self::spl::decoder_spl_elgamal_registry_parse_elgamal_registry_state;
/// Decodes one bounded SPL Memo instruction.
pub(crate) use self::spl::decoder_spl_memo_decode;
/// Decodes one bounded Token-2022 instruction.
pub(crate) use self::spl::decoder_spl_token_2022_decode;
/// Returns the exact entry matching one Token-2022 tag.
pub(crate) use self::spl::decoder_spl_token_2022_entry_for_tag;
/// Parses one Token-2022 Mint, Account, or Multisig state.
pub use self::spl::decoder_spl_token_2022_parse_token_2022_state;
/// Returns the first byte of one retained Token-2022 payload.
pub(crate) use self::spl::decoder_spl_token_2022_payload_tag;
/// Decodes one bounded classic SPL Token instruction.
@@ -693,15 +665,63 @@ pub(crate) use self::spl::decoder_spl_token_decode;
pub(crate) use self::spl::decoder_spl_token_entry_for_tag;
/// Returns the first byte of one retained classic SPL Token payload.
pub(crate) use self::spl::decoder_spl_token_payload_tag;
/// Reserved `kb-lib.decoder.stable.swap_hylo_exchange` decoder.
pub use self::stable::DcStableSwapHyloExchangeDecoder;
/// Reserved `kb-lib.decoder.stable.swap_jupiter_stable` decoder.
pub use self::stable::DcStableSwapJupiterStableDecoder;
/// Reserved `kb-lib.decoder.stable.swap_numeraire` decoder.
pub use self::stable::DcStableSwapNumeraireDecoder;
/// Reserved `kb-lib.decoder.stable.swap_stabble` decoder.
pub use self::stable::DcStableSwapStabbleDecoder;
/// Reserved `kb-lib.decoder.staking.jito_tip_distribution` decoder.
pub use self::staking::DcStakingJitoTipDistributionDecoder;
/// Reserved `kb-lib.decoder.staking.kamino_farm` decoder.
pub use self::staking::DcStakingKaminoFarmDecoder;
/// Reserved `kb-lib.decoder.staking.marinade_finance` decoder.
pub use self::staking::DcStakingMarinadeFinanceDecoder;
/// Reserved `kb-lib.decoder.staking.solayer` decoder.
pub use self::staking::DcStakingSolayerDecoder;
/// Reserved `kb-lib.decoder.storage.solana_record` decoder.
pub use self::storage::DcStorageSolanaRecordDecoder;
/// Reserved `kb-lib.decoder.router.jupiter_dca` decoder.
pub use self::strategy::DcStrategyJupiterDcaDecoder;
/// Reserved `kb-lib.decoder.treasury.helium_treasury_management` decoder.
pub use self::treasury::DcTreasuryHeliumTreasuryManagementDecoder;
/// Reserved `kb-lib.decoder.vault.carrot_defi` decoder.
pub use self::vault::DcVaultCarrotDefiDecoder;
/// Reserved `kb-lib.decoder.vault.hylo_stability_pool` decoder.
pub use self::vault::DcVaultHyloStabilityPoolDecoder;
/// Reserved `kb-lib.decoder.vault.kamino` decoder.
pub use self::vault::DcVaultKaminoDecoder;
/// Reserved `kb-lib.decoder.vault.kamino_v2` decoder.
pub use self::vault::DcVaultKaminoV2Decoder;
/// Reserved `kb-lib.decoder.vault.kamino_yvaults` decoder.
pub use self::vault::DcVaultKaminoYvaultsDecoder;
/// Reserved `kb-lib.decoder.vault.meteora` decoder.
pub use self::vault::DcVaultMeteoraDecoder;
/// Reserved `kb-lib.decoder.admin.jupiter_lock` decoder.
pub use self::vesting::DcVestingJupiterLockDecoder;
/// Reserved `kb-lib.decoder.vesting.streamflow` decoder.
pub use self::vesting::DcVestingStreamflowDecoder;
/// Reserved `kb-lib.decoder.wallet.jupiter_apepro_smart_wallet` decoder.
pub use self::wallet::DcWalletJupiterApeproSmartWalletDecoder;
/// Reserved `kb-lib.decoder.weighted.swap_stabble` decoder.
pub use self::weighted::DcWeightedSwapStabbleDecoder;
#[cfg(test)]
mod reserved_decoder_tests {
#[test]
fn every_reserved_decoder_exposes_only_registered_program_ids() {
let decoders: [&dyn crate::DcApiProtocolDecoder; 98] = [
let decoders: [&dyn crate::DcApiProtocolDecoder; 105] = [
&crate::DcAdapterSaberDecimalWrapperDecoder,
&crate::DcAdminJupiterLockDecoder,
&crate::DcAdminPumpFeesDecoder,
&crate::DcAdapterSplTokenWrapDecoder,
&crate::DcGovernanceSquadsMultisigDecoder,
&crate::DcMetadataSolanaProgramMetadataDecoder,
&crate::DcNftTensorCnftDecoder,
&crate::DcPerpetualsPhoenixEternalDecoder,
&crate::DcStakingJitoTipDistributionDecoder,
&crate::DcStorageSolanaRecordDecoder,
&crate::DcVestingJupiterLockDecoder,
&crate::DcFeesPumpFeesDecoder,
&crate::DcAmmAldrinV1Decoder,
&crate::DcAmmAldrinV2Decoder,
&crate::DcAmmAlphaqDecoder,
@@ -713,7 +733,7 @@ mod reserved_decoder_tests {
&crate::DcAmmGoosefxV2Decoder,
&crate::DcAmmGuacSwapDecoder,
&crate::DcAmmLifinitySwapV2Decoder,
&crate::DcAmmMetadaoFutarchyAmmDecoder,
&crate::DcGovernanceMetadaoFutarchyDecoder,
&crate::DcAmmMetadaoV05Decoder,
&crate::DcAmmMeteoraDammV1Decoder,
&crate::DcAmmMeteoraDammV2Decoder,
@@ -724,7 +744,7 @@ mod reserved_decoder_tests {
&crate::DcAmmSolfiDecoder,
&crate::DcAmmSolfiV2Decoder,
&crate::DcAmmVertigoDecoder,
&crate::DcAmmVirtualsDecoder,
&crate::DcLaunchpadVirtualsDecoder,
&crate::DcAmmWoofiDecoder,
&crate::DcAmmZeroFiDecoder,
&crate::DcAmmZoraDecoder,
@@ -772,7 +792,7 @@ mod reserved_decoder_tests {
&crate::DcRouterDflowAggregatorV4Decoder,
&crate::DcRouterJupiterAggregatorV4Decoder,
&crate::DcRouterJupiterAggregatorV6Decoder,
&crate::DcRouterJupiterDcaDecoder,
&crate::DcStrategyJupiterDcaDecoder,
&crate::DcRouterOkxLabsV1Decoder,
&crate::DcRouterOkxLabsV2Decoder,
&crate::DcRwaOndoGlobalMarketsDecoder,
@@ -827,6 +847,6 @@ mod reserved_decoder_tests {
assert!(decode_result.is_ok_and(|events| return events.is_empty()));
}
}
assert_eq!(names.len(), 98);
assert_eq!(names.len(), 105);
}
}

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());
}
}

View File

@@ -4,7 +4,6 @@
//! Consolidated executor modules.
mod adapter;
mod admin;
mod amm;
mod api;
mod bridge;
@@ -27,6 +26,8 @@ mod solana;
mod spl;
mod stable;
mod staking;
mod storage;
mod strategy;
mod treasury;
mod vault;
mod vesting;
@@ -35,10 +36,8 @@ mod weighted;
/// Exposes the reserved `adapter/saber_decimal_wrapper` executor.
pub use self::adapter::ExAdapterSaberDecimalWrapperExecutor;
/// Exposes the reserved `admin/jupiter_lock` executor.
pub use self::admin::ExAdminJupiterLockExecutor;
/// Exposes the reserved `admin/pump_fees` executor.
pub use self::admin::ExAdminPumpFeesExecutor;
/// Reserved `kb-lib.executor.adapter.spl_token_wrap` executor.
pub use self::adapter::ExAdapterSplTokenWrapExecutor;
/// Exposes the reserved `amm/aldrin_v1` executor.
pub use self::amm::ExAmmAldrinV1Executor;
/// Exposes the reserved `amm/aldrin_v2` executor.
@@ -61,8 +60,6 @@ pub use self::amm::ExAmmGoosefxV2Executor;
pub use self::amm::ExAmmGuacSwapExecutor;
/// Exposes the reserved `amm/lifinity_swap_v2` executor.
pub use self::amm::ExAmmLifinitySwapV2Executor;
/// Exposes the reserved `amm/metadao_futarchy_amm` executor.
pub use self::amm::ExAmmMetadaoFutarchyAmmExecutor;
/// Exposes the reserved `amm/metadao_v0_5` executor.
pub use self::amm::ExAmmMetadaoV05Executor;
/// Exposes the reserved `amm/meteora_damm_v1` executor.
@@ -83,8 +80,6 @@ pub use self::amm::ExAmmSolfiExecutor;
pub use self::amm::ExAmmSolfiV2Executor;
/// Exposes the reserved `amm/vertigo` executor.
pub use self::amm::ExAmmVertigoExecutor;
/// Exposes the reserved `amm/virtuals` executor.
pub use self::amm::ExAmmVirtualsExecutor;
/// Exposes the reserved `amm/woofi` executor.
pub use self::amm::ExAmmWoofiExecutor;
/// Exposes the reserved `amm/zero_fi` executor.
@@ -169,8 +164,14 @@ pub use self::dlmm::ExDlmmMeteoraExecutor;
pub use self::fees::ExFeesBagsFeeShareV1Executor;
/// Exposes the reserved `fees/bags_fee_share_v2` executor.
pub use self::fees::ExFeesBagsFeeShareV2Executor;
/// Exposes the reserved `admin/pump_fees` executor.
pub use self::fees::ExFeesPumpFeesExecutor;
/// Exposes the reserved `governance/metadao_bid_wall` executor.
pub use self::governance::ExGovernanceMetadaoBidWallExecutor;
/// Exposes the reserved `amm/metadao_futarchy_amm` executor.
pub use self::governance::ExGovernanceMetadaoFutarchyExecutor;
/// Reserved `kb-lib.executor.governance.squads_multisig` executor.
pub use self::governance::ExGovernanceSquadsMultisigExecutor;
/// Exposes the reserved `launchpad/boop_fun` executor.
pub use self::launchpad::ExLaunchpadBoopFunExecutor;
/// Exposes the reserved `launchpad/metadao_ico` executor.
@@ -189,6 +190,8 @@ pub use self::launchpad::ExLaunchpadPumpFunExecutor;
pub use self::launchpad::ExLaunchpadPumpPumpupAiExecutor;
/// Exposes the reserved `launchpad/raydium_launchlab` executor.
pub use self::launchpad::ExLaunchpadRaydiumLaunchlabExecutor;
/// Exposes the reserved `amm/virtuals` executor.
pub use self::launchpad::ExLaunchpadVirtualsExecutor;
/// Exposes the reserved `lending/clone` executor.
pub use self::lending::ExLendingCloneExecutor;
/// Exposes the reserved `lending/jupiter_lend_borrow` executor.
@@ -207,10 +210,14 @@ pub use self::lending::ExLendingMarginfiV2Executor;
pub use self::lock::ExLockRaydiumLpExecutor;
/// Exposes the reserved `metadata/metaplex_token_metadata` executor.
pub use self::metadata::ExMetadataMetaplexTokenMetadataExecutor;
/// Reserved `kb-lib.executor.metadata.solana_program_metadata` executor.
pub use self::metadata::ExMetadataSolanaProgramMetadataExecutor;
/// Exposes the reserved `metadata/spl_name_service` executor.
pub use self::metadata::ExMetadataSplNameServiceExecutor;
/// Exposes the reserved `nft/metaplex_bubblegum` executor.
pub use self::nft::ExNftMetaplexBubblegumExecutor;
/// Reserved `kb-lib.executor.nft.tensor_cnft` executor.
pub use self::nft::ExNftTensorCnftExecutor;
/// Exposes the reserved `orderbook/jupiter_limit_order` executor.
pub use self::orderbook::ExOrderbookJupiterLimitOrderExecutor;
/// Exposes the reserved `orderbook/jupiter_limit_order_v2` executor.
@@ -221,6 +228,8 @@ pub use self::orderbook::ExOrderbookOpenbookV2Executor;
pub use self::perpetuals::ExPerpetualsDriftV2Executor;
/// Exposes the reserved `perpetuals/jupiter` executor.
pub use self::perpetuals::ExPerpetualsJupiterExecutor;
/// Reserved `kb-lib.executor.perpetuals.phoenix_eternal` executor.
pub use self::perpetuals::ExPerpetualsPhoenixEternalExecutor;
/// Exposes the reserved `perpetuals/zeta` executor.
pub use self::perpetuals::ExPerpetualsZetaExecutor;
/// Exposes the reserved `router/dflow_aggregator_v4` executor.
@@ -229,8 +238,6 @@ pub use self::router::ExRouterDflowAggregatorV4Executor;
pub use self::router::ExRouterJupiterAggregatorV4Executor;
/// Exposes the reserved `router/jupiter_aggregator_v6` executor.
pub use self::router::ExRouterJupiterAggregatorV6Executor;
/// Exposes the reserved `router/jupiter_dca` executor.
pub use self::router::ExRouterJupiterDcaExecutor;
/// Exposes the reserved `router/okx_labs_v1` executor.
pub use self::router::ExRouterOkxLabsV1Executor;
/// Exposes the reserved `router/okx_labs_v2` executor.
@@ -873,12 +880,18 @@ pub use self::stable::ExStableSwapJupiterStableExecutor;
pub use self::stable::ExStableSwapNumeraireExecutor;
/// Exposes the reserved `stable/swap_stabble` executor.
pub use self::stable::ExStableSwapStabbleExecutor;
/// Reserved `kb-lib.executor.staking.jito_tip_distribution` executor.
pub use self::staking::ExStakingJitoTipDistributionExecutor;
/// Exposes the reserved `staking/kamino_farm` executor.
pub use self::staking::ExStakingKaminoFarmExecutor;
/// Exposes the reserved `staking/marinade_finance` executor.
pub use self::staking::ExStakingMarinadeFinanceExecutor;
/// Exposes the reserved `staking/solayer` executor.
pub use self::staking::ExStakingSolayerExecutor;
/// Reserved `kb-lib.executor.storage.solana_record` executor.
pub use self::storage::ExStorageSolanaRecordExecutor;
/// Exposes the reserved `router/jupiter_dca` executor.
pub use self::strategy::ExStrategyJupiterDcaExecutor;
/// Exposes the reserved `treasury/helium_treasury_management` executor.
pub use self::treasury::ExTreasuryHeliumTreasuryManagementExecutor;
/// Exposes the reserved `vault/carrot_defi` executor.
@@ -893,6 +906,8 @@ pub use self::vault::ExVaultKaminoV2Executor;
pub use self::vault::ExVaultKaminoYvaultsExecutor;
/// Exposes the reserved `vault/meteora` executor.
pub use self::vault::ExVaultMeteoraExecutor;
/// Exposes the reserved `admin/jupiter_lock` executor.
pub use self::vesting::ExVestingJupiterLockExecutor;
/// Exposes the reserved `vesting/streamflow` executor.
pub use self::vesting::ExVestingStreamflowExecutor;
/// Exposes the reserved `wallet/jupiter_apepro_smart_wallet` executor.
@@ -983,10 +998,17 @@ pub(crate) use self::spl::executor_spl_token_build_prepared_plan;
mod reserved_executor_tests {
#[test]
fn every_reserved_executor_is_registered_and_builds_only_an_empty_plan() {
let executors: [&dyn crate::ExApiInstructionExecutor; 98] = [
let executors: [&dyn crate::ExApiInstructionExecutor; 105] = [
&crate::ExAdapterSaberDecimalWrapperExecutor,
&crate::ExAdminJupiterLockExecutor,
&crate::ExAdminPumpFeesExecutor,
&crate::ExAdapterSplTokenWrapExecutor,
&crate::ExGovernanceSquadsMultisigExecutor,
&crate::ExMetadataSolanaProgramMetadataExecutor,
&crate::ExNftTensorCnftExecutor,
&crate::ExPerpetualsPhoenixEternalExecutor,
&crate::ExStakingJitoTipDistributionExecutor,
&crate::ExStorageSolanaRecordExecutor,
&crate::ExVestingJupiterLockExecutor,
&crate::ExFeesPumpFeesExecutor,
&crate::ExAmmAldrinV1Executor,
&crate::ExAmmAldrinV2Executor,
&crate::ExAmmAlphaqExecutor,
@@ -998,7 +1020,7 @@ mod reserved_executor_tests {
&crate::ExAmmGoosefxV2Executor,
&crate::ExAmmGuacSwapExecutor,
&crate::ExAmmLifinitySwapV2Executor,
&crate::ExAmmMetadaoFutarchyAmmExecutor,
&crate::ExGovernanceMetadaoFutarchyExecutor,
&crate::ExAmmMetadaoV05Executor,
&crate::ExAmmMeteoraDammV1Executor,
&crate::ExAmmMeteoraDammV2Executor,
@@ -1009,7 +1031,7 @@ mod reserved_executor_tests {
&crate::ExAmmSolfiExecutor,
&crate::ExAmmSolfiV2Executor,
&crate::ExAmmVertigoExecutor,
&crate::ExAmmVirtualsExecutor,
&crate::ExLaunchpadVirtualsExecutor,
&crate::ExAmmWoofiExecutor,
&crate::ExAmmZeroFiExecutor,
&crate::ExAmmZoraExecutor,
@@ -1057,7 +1079,7 @@ mod reserved_executor_tests {
&crate::ExRouterDflowAggregatorV4Executor,
&crate::ExRouterJupiterAggregatorV4Executor,
&crate::ExRouterJupiterAggregatorV6Executor,
&crate::ExRouterJupiterDcaExecutor,
&crate::ExStrategyJupiterDcaExecutor,
&crate::ExRouterOkxLabsV1Executor,
&crate::ExRouterOkxLabsV2Executor,
&crate::ExRwaOndoGlobalMarketsExecutor,
@@ -1083,7 +1105,7 @@ mod reserved_executor_tests {
&crate::ExWalletJupiterApeproSmartWalletExecutor,
&crate::ExWeightedSwapStabbleExecutor,
];
assert_eq!(executors.len(), 98);
assert_eq!(executors.len(), 105);
for executor in executors {
assert!(!executor.program_ids().is_empty());
for program_id in executor.program_ids() {

View File

@@ -1,8 +1,12 @@
// file: kb-lib/src/executor/adapter.rs
// version: 2
// version: 3
//! `adapter` executor family.
mod saber_decimal_wrapper;
mod spl_token_wrap;
/// Exposes the reserved `adapter/saber_decimal_wrapper` executor.
pub use self::saber_decimal_wrapper::ExAdapterSaberDecimalWrapperExecutor;
/// Exposes the reserved `adapter/spl_token_wrap` executor.
pub use self::spl_token_wrap::ExAdapterSplTokenWrapExecutor;

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/adapter/spl_token_wrap.rs
// version: 1
//! Reserved executor for `adapter_spl_token_wrap`.
/// Reserved executor for the `adapter_spl_token_wrap` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExAdapterSplTokenWrapExecutor;
impl crate::ExApiInstructionExecutor for crate::ExAdapterSplTokenWrapExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.adapter.spl_token_wrap";
}
fn executor_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_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"adapter_spl_token_wrap"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.adapter.spl_token_wrap".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -1,11 +0,0 @@
// file: kb-lib/src/executor/admin.rs
// version: 2
//! `admin` executor family.
mod jupiter_lock;
mod pump_fees;
/// Exposes the reserved `admin/jupiter_lock` executor.
pub use self::jupiter_lock::ExAdminJupiterLockExecutor;
/// Exposes the reserved `admin/pump_fees` executor.
pub use self::pump_fees::ExAdminPumpFeesExecutor;

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/amm.rs
// version: 2
// version: 3
//! `amm` executor 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,10 +24,10 @@ mod raydium_lp_v4;
mod solfi;
mod solfi_v2;
mod vertigo;
mod virtuals;
mod woofi;
mod zero_fi;
mod zora;
/// Exposes the reserved `amm/aldrin_v1` executor.
pub use self::aldrin_v1::ExAmmAldrinV1Executor;
/// Exposes the reserved `amm/aldrin_v2` executor.
@@ -51,8 +50,6 @@ pub use self::goosefx_v2::ExAmmGoosefxV2Executor;
pub use self::guac_swap::ExAmmGuacSwapExecutor;
/// Exposes the reserved `amm/lifinity_swap_v2` executor.
pub use self::lifinity_swap_v2::ExAmmLifinitySwapV2Executor;
/// Exposes the reserved `amm/metadao_futarchy_amm` executor.
pub use self::metadao_futarchy_amm::ExAmmMetadaoFutarchyAmmExecutor;
/// Exposes the reserved `amm/metadao_v0_5` executor.
pub use self::metadao_v0_5::ExAmmMetadaoV05Executor;
/// Exposes the reserved `amm/meteora_damm_v1` executor.
@@ -73,8 +70,6 @@ pub use self::solfi::ExAmmSolfiExecutor;
pub use self::solfi_v2::ExAmmSolfiV2Executor;
/// Exposes the reserved `amm/vertigo` executor.
pub use self::vertigo::ExAmmVertigoExecutor;
/// Exposes the reserved `amm/virtuals` executor.
pub use self::virtuals::ExAmmVirtualsExecutor;
/// Exposes the reserved `amm/woofi` executor.
pub use self::woofi::ExAmmWoofiExecutor;
/// Exposes the reserved `amm/zero_fi` executor.

View File

@@ -1,11 +1,15 @@
// file: kb-lib/src/executor/fees.rs
// version: 2
// version: 3
//! `fees` executor family.
mod bags_fee_share_v1;
mod bags_fee_share_v2;
mod pump_fees;
/// Exposes the reserved `fees/bags_fee_share_v1` executor.
pub use self::bags_fee_share_v1::ExFeesBagsFeeShareV1Executor;
/// Exposes the reserved `fees/bags_fee_share_v2` executor.
pub use self::bags_fee_share_v2::ExFeesBagsFeeShareV2Executor;
/// Exposes the reserved `fees/pump_fees` executor.
pub use self::pump_fees::ExFeesPumpFeesExecutor;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/executor/amm/virtuals.rs
// file: kb-lib/src/executor/fees/pump_fees.rs
// version: 3
//! Reserved executor for `amm_virtuals`.
//! Reserved executor for `fees_pump_fees`.
/// Reserved executor for the `amm_virtuals` program surface.
/// Reserved executor for the `fees_pump_fees` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExAmmVirtualsExecutor;
pub struct ExFeesPumpFeesExecutor;
impl crate::ExApiInstructionExecutor for crate::ExAmmVirtualsExecutor {
impl crate::ExApiInstructionExecutor for crate::ExFeesPumpFeesExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.amm.virtuals";
return "kb-lib.executor.fees.pump_fees";
}
fn executor_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::ExApiInstructionExecutor for crate::ExAmmVirtualsExecutor {
}
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_request(
@@ -35,13 +35,13 @@ impl crate::ExApiInstructionExecutor for crate::ExAmmVirtualsExecutor {
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"amm_virtuals"}),
&serde_json::json!({"status":"reserved_executor","surface":"fees_pump_fees"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.amm.virtuals".to_string(),
executor_name: "kb-lib.executor.fees.pump_fees".to_string(),
instruction_count: 0,
payload_json,
});

View File

@@ -1,8 +1,15 @@
// file: kb-lib/src/executor/governance.rs
// version: 2
// version: 3
//! `governance` executor family.
mod metadao_bid_wall;
mod metadao_futarchy;
mod squads_multisig;
/// Exposes the reserved `governance/metadao_bid_wall` executor.
pub use self::metadao_bid_wall::ExGovernanceMetadaoBidWallExecutor;
/// Exposes the reserved `governance/metadao_futarchy` executor.
pub use self::metadao_futarchy::ExGovernanceMetadaoFutarchyExecutor;
/// Exposes the reserved `governance/squads_multisig` executor.
pub use self::squads_multisig::ExGovernanceSquadsMultisigExecutor;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/executor/amm/metadao_futarchy_amm.rs
// file: kb-lib/src/executor/governance/metadao_futarchy.rs
// version: 3
//! Reserved executor for `amm_metadao_futarchy_amm`.
//! Reserved executor for `governance_metadao_futarchy`.
/// Reserved executor for the `amm_metadao_futarchy_amm` program surface.
/// Reserved executor for the `governance_metadao_futarchy` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExAmmMetadaoFutarchyAmmExecutor;
pub struct ExGovernanceMetadaoFutarchyExecutor;
impl crate::ExApiInstructionExecutor for crate::ExAmmMetadaoFutarchyAmmExecutor {
impl crate::ExApiInstructionExecutor for crate::ExGovernanceMetadaoFutarchyExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.amm.metadao_futarchy_amm";
return "kb-lib.executor.governance.metadao_futarchy";
}
fn executor_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::ExApiInstructionExecutor for crate::ExAmmMetadaoFutarchyAmmExecutor
}
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_request(
@@ -35,13 +35,13 @@ impl crate::ExApiInstructionExecutor for crate::ExAmmMetadaoFutarchyAmmExecutor
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"amm_metadao_futarchy_amm"}),
&serde_json::json!({"status":"reserved_executor","surface":"governance_metadao_futarchy"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.amm.metadao_futarchy_amm".to_string(),
executor_name: "kb-lib.executor.governance.metadao_futarchy".to_string(),
instruction_count: 0,
payload_json,
});

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/governance/squads_multisig.rs
// version: 1
//! Reserved executor for `governance_squads_multisig`.
/// Reserved executor for the `governance_squads_multisig` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExGovernanceSquadsMultisigExecutor;
impl crate::ExApiInstructionExecutor for crate::ExGovernanceSquadsMultisigExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.governance.squads_multisig";
}
fn executor_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_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"governance_squads_multisig"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.governance.squads_multisig".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/launchpad.rs
// version: 2
// version: 3
//! `launchpad` executor family.
@@ -12,6 +12,8 @@ mod printr;
mod pump_fun;
mod pump_pumpup_ai;
mod raydium_launchlab;
mod virtuals;
/// Exposes the reserved `launchpad/boop_fun` executor.
pub use self::boop_fun::ExLaunchpadBoopFunExecutor;
/// Exposes the reserved `launchpad/metadao_ico` executor.
@@ -30,3 +32,5 @@ pub use self::pump_fun::ExLaunchpadPumpFunExecutor;
pub use self::pump_pumpup_ai::ExLaunchpadPumpPumpupAiExecutor;
/// Exposes the reserved `launchpad/raydium_launchlab` executor.
pub use self::raydium_launchlab::ExLaunchpadRaydiumLaunchlabExecutor;
/// Exposes the reserved `launchpad/virtuals` executor.
pub use self::virtuals::ExLaunchpadVirtualsExecutor;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/executor/router/jupiter_dca.rs
// file: kb-lib/src/executor/launchpad/virtuals.rs
// version: 3
//! Reserved executor for `router_jupiter_dca`.
//! Reserved executor for `launchpad_virtuals`.
/// Reserved executor for the `router_jupiter_dca` program surface.
/// Reserved executor for the `launchpad_virtuals` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExRouterJupiterDcaExecutor;
pub struct ExLaunchpadVirtualsExecutor;
impl crate::ExApiInstructionExecutor for crate::ExRouterJupiterDcaExecutor {
impl crate::ExApiInstructionExecutor for crate::ExLaunchpadVirtualsExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.router.jupiter_dca";
return "kb-lib.executor.launchpad.virtuals";
}
fn executor_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::ExApiInstructionExecutor for crate::ExRouterJupiterDcaExecutor {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::ROUTER_JUPITER_DCA_PROGRAM_ID];
return &[kb_program_ids::LAUNCHPAD_VIRTUALS_PROGRAM_ID];
}
fn supports_request(
@@ -35,13 +35,13 @@ impl crate::ExApiInstructionExecutor for crate::ExRouterJupiterDcaExecutor {
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"router_jupiter_dca"}),
&serde_json::json!({"status":"reserved_executor","surface":"launchpad_virtuals"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.router.jupiter_dca".to_string(),
executor_name: "kb-lib.executor.launchpad.virtuals".to_string(),
instruction_count: 0,
payload_json,
});

View File

@@ -4,8 +4,11 @@
//! `metadata` executor family.
mod metaplex_token_metadata;
mod solana_program_metadata;
mod spl_name_service;
/// Exposes the reserved `metadata/metaplex_token_metadata` executor.
pub use self::metaplex_token_metadata::ExMetadataMetaplexTokenMetadataExecutor;
/// Exposes the reserved `metadata/solana_program_metadata` executor.
pub use self::solana_program_metadata::ExMetadataSolanaProgramMetadataExecutor;
/// Exposes the reserved `metadata/spl_name_service` executor.
pub use self::spl_name_service::ExMetadataSplNameServiceExecutor;

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/metadata/metaplex_token_metadata.rs
// version: 3
// version: 4
//! Reserved executor for `metadata_metaplex_token_metadata`.
@@ -35,7 +35,7 @@ impl crate::ExApiInstructionExecutor for crate::ExMetadataMetaplexTokenMetadataE
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"metadata_metaplex_token_metadata"}),
&serde_json::json!({"status":"reserved_executor","surface":"metadata.metaplex_token_metadata"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/metadata/solana_program_metadata.rs
// version: 1
//! Reserved executor for `metadata_solana_program_metadata`.
/// Reserved executor for the `metadata_solana_program_metadata` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExMetadataSolanaProgramMetadataExecutor;
impl crate::ExApiInstructionExecutor for crate::ExMetadataSolanaProgramMetadataExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.metadata.solana_program_metadata";
}
fn executor_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_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"metadata_solana_program_metadata"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.metadata.solana_program_metadata".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -1,8 +1,12 @@
// file: kb-lib/src/executor/nft.rs
// version: 2
// version: 3
//! `nft` executor family.
mod metaplex_bubblegum;
mod tensor_cnft;
/// Exposes the reserved `nft/metaplex_bubblegum` executor.
pub use self::metaplex_bubblegum::ExNftMetaplexBubblegumExecutor;
/// Exposes the reserved `nft/tensor_cnft` executor.
pub use self::tensor_cnft::ExNftTensorCnftExecutor;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/executor/admin/pump_fees.rs
// version: 3
// file: kb-lib/src/executor/nft/tensor_cnft.rs
// version: 1
//! Reserved executor for `admin_pump_fees`.
//! Reserved executor for `nft_tensor_cnft`.
/// Reserved executor for the `admin_pump_fees` program surface.
/// Reserved executor for the `nft_tensor_cnft` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExAdminPumpFeesExecutor;
pub struct ExNftTensorCnftExecutor;
impl crate::ExApiInstructionExecutor for crate::ExAdminPumpFeesExecutor {
impl crate::ExApiInstructionExecutor for crate::ExNftTensorCnftExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.admin.pump_fees";
return "kb-lib.executor.nft.tensor_cnft";
}
fn executor_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::ExApiInstructionExecutor for crate::ExAdminPumpFeesExecutor {
}
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_request(
@@ -35,13 +35,13 @@ impl crate::ExApiInstructionExecutor for crate::ExAdminPumpFeesExecutor {
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"admin_pump_fees"}),
&serde_json::json!({"status":"reserved_executor","surface":"nft_tensor_cnft"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.admin.pump_fees".to_string(),
executor_name: "kb-lib.executor.nft.tensor_cnft".to_string(),
instruction_count: 0,
payload_json,
});

View File

@@ -1,14 +1,18 @@
// file: kb-lib/src/executor/perpetuals.rs
// version: 2
// version: 3
//! `perpetuals` executor family.
mod drift_v2;
mod jupiter;
mod phoenix_eternal;
mod zeta;
/// Exposes the reserved `perpetuals/drift_v2` executor.
pub use self::drift_v2::ExPerpetualsDriftV2Executor;
/// Exposes the reserved `perpetuals/jupiter` executor.
pub use self::jupiter::ExPerpetualsJupiterExecutor;
/// Exposes the reserved `perpetuals/phoenix_eternal` executor.
pub use self::phoenix_eternal::ExPerpetualsPhoenixEternalExecutor;
/// Exposes the reserved `perpetuals/zeta` executor.
pub use self::zeta::ExPerpetualsZetaExecutor;

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/perpetuals/phoenix_eternal.rs
// version: 1
//! Reserved executor for `perpetuals_phoenix_eternal`.
/// Reserved executor for the `perpetuals_phoenix_eternal` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExPerpetualsPhoenixEternalExecutor;
impl crate::ExApiInstructionExecutor for crate::ExPerpetualsPhoenixEternalExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.perpetuals.phoenix_eternal";
}
fn executor_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_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"perpetuals_phoenix_eternal"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.perpetuals.phoenix_eternal".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -1,22 +1,20 @@
// file: kb-lib/src/executor/router.rs
// version: 2
// version: 3
//! `router` executor family.
mod dflow_aggregator_v4;
mod jupiter_aggregator_v4;
mod jupiter_aggregator_v6;
mod jupiter_dca;
mod okx_labs_v1;
mod okx_labs_v2;
/// Exposes the reserved `router/dflow_aggregator_v4` executor.
pub use self::dflow_aggregator_v4::ExRouterDflowAggregatorV4Executor;
/// Exposes the reserved `router/jupiter_aggregator_v4` executor.
pub use self::jupiter_aggregator_v4::ExRouterJupiterAggregatorV4Executor;
/// Exposes the reserved `router/jupiter_aggregator_v6` executor.
pub use self::jupiter_aggregator_v6::ExRouterJupiterAggregatorV6Executor;
/// Exposes the reserved `router/jupiter_dca` executor.
pub use self::jupiter_dca::ExRouterJupiterDcaExecutor;
/// Exposes the reserved `router/okx_labs_v1` executor.
pub use self::okx_labs_v1::ExRouterOkxLabsV1Executor;
/// Exposes the reserved `router/okx_labs_v2` executor.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/solana/core/executor.rs
// version: 2
// version: 3
//! Exact capability dispatch and typed plan construction for Solana core.
@@ -566,7 +566,7 @@ mod tests {
&crate::MdProgramId(std::string::String::from(
kb_program_ids::ZK_TOKEN_PROOF_PROGRAM_ID,
)),
"solana_core.zk_token.verify_zero_balance",
"solana.core.zk_token.verify_zero_balance",
);
assert!(matches!(
historical_zk,

View File

@@ -1,302 +1,302 @@
// file: kb-lib/src/executor/solana/core/intent.rs
// version: 1
// version: 2
//! Typed Solana core execution intents.
use ts_rs::TS; // rust-rules: derive-import
/// Stable operation code for a System Program lamport transfer.
pub const EX_SOLANA_CORE_SYSTEM_TRANSFER_OPERATION: &str = "solana_core.system.transfer";
pub const EX_SOLANA_CORE_SYSTEM_TRANSFER_OPERATION: &str = "solana.core.system.transfer";
/// Stable operation code for a bounded batch of System Program transfers.
pub const EX_SOLANA_CORE_SYSTEM_TRANSFER_MANY_OPERATION: &str = "solana_core.system.transfer_many";
pub const EX_SOLANA_CORE_SYSTEM_TRANSFER_MANY_OPERATION: &str = "solana.core.system.transfer_many";
/// Stable operation code for controlled System Program account creation.
pub const EX_SOLANA_CORE_SYSTEM_CREATE_ACCOUNT_OPERATION: &str =
"solana_core.system.create_account";
"solana.core.system.create_account";
/// Stable operation code for System Program account creation with a seed.
pub const EX_SOLANA_CORE_SYSTEM_CREATE_ACCOUNT_WITH_SEED_OPERATION: &str =
"solana_core.system.create_account_with_seed";
"solana.core.system.create_account_with_seed";
/// Stable operation code for System Program account allocation.
pub const EX_SOLANA_CORE_SYSTEM_ALLOCATE_OPERATION: &str = "solana_core.system.allocate";
pub const EX_SOLANA_CORE_SYSTEM_ALLOCATE_OPERATION: &str = "solana.core.system.allocate";
/// Stable operation code for System Program seeded account allocation.
pub const EX_SOLANA_CORE_SYSTEM_ALLOCATE_WITH_SEED_OPERATION: &str =
"solana_core.system.allocate_with_seed";
"solana.core.system.allocate_with_seed";
/// Stable operation code for System Program account owner assignment.
pub const EX_SOLANA_CORE_SYSTEM_ASSIGN_OPERATION: &str = "solana_core.system.assign";
pub const EX_SOLANA_CORE_SYSTEM_ASSIGN_OPERATION: &str = "solana.core.system.assign";
/// Stable operation code for System Program seeded account owner assignment.
pub const EX_SOLANA_CORE_SYSTEM_ASSIGN_WITH_SEED_OPERATION: &str =
"solana_core.system.assign_with_seed";
"solana.core.system.assign_with_seed";
/// Stable operation code for a System Program transfer from a seeded account.
pub const EX_SOLANA_CORE_SYSTEM_TRANSFER_WITH_SEED_OPERATION: &str =
"solana_core.system.transfer_with_seed";
"solana.core.system.transfer_with_seed";
/// Stable operation code for System Program account creation that accepts prefunding.
pub const EX_SOLANA_CORE_SYSTEM_CREATE_ACCOUNT_ALLOW_PREFUND_OPERATION: &str =
"solana_core.system.create_account_allow_prefund";
"solana.core.system.create_account_allow_prefund";
/// Stable operation code for durable nonce account creation.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_CREATE_OPERATION: &str = "solana_core.system.nonce.create";
pub const EX_SOLANA_CORE_SYSTEM_NONCE_CREATE_OPERATION: &str = "solana.core.system.nonce.create";
/// Stable operation code for seeded durable nonce account creation.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_CREATE_WITH_SEED_OPERATION: &str =
"solana_core.system.nonce.create_with_seed";
"solana.core.system.nonce.create_with_seed";
/// Stable operation code for durable nonce initialization.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_INITIALIZE_OPERATION: &str =
"solana_core.system.nonce.initialize";
"solana.core.system.nonce.initialize";
/// Stable operation code for durable nonce advancement.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_ADVANCE_OPERATION: &str = "solana_core.system.nonce.advance";
pub const EX_SOLANA_CORE_SYSTEM_NONCE_ADVANCE_OPERATION: &str = "solana.core.system.nonce.advance";
/// Stable operation code for durable nonce authority changes.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_AUTHORIZE_OPERATION: &str =
"solana_core.system.nonce.authorize";
"solana.core.system.nonce.authorize";
/// Stable operation code for durable nonce withdrawal.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_WITHDRAW_OPERATION: &str =
"solana_core.system.nonce.withdraw";
"solana.core.system.nonce.withdraw";
/// Stable operation code for durable nonce state upgrade.
pub const EX_SOLANA_CORE_SYSTEM_NONCE_UPGRADE_OPERATION: &str = "solana_core.system.nonce.upgrade";
pub const EX_SOLANA_CORE_SYSTEM_NONCE_UPGRADE_OPERATION: &str = "solana.core.system.nonce.upgrade";
/// Stable operation code for a Compute Budget heap-frame request.
pub const EX_SOLANA_CORE_COMPUTE_BUDGET_REQUEST_HEAP_FRAME_OPERATION: &str =
"solana_core.compute_budget.request_heap_frame";
"solana.core.compute_budget.request_heap_frame";
/// Stable operation code for a Compute Budget unit limit.
pub const EX_SOLANA_CORE_COMPUTE_BUDGET_SET_UNIT_LIMIT_OPERATION: &str =
"solana_core.compute_budget.set_compute_unit_limit";
"solana.core.compute_budget.set_compute_unit_limit";
/// Stable operation code for a Compute Budget unit price.
pub const EX_SOLANA_CORE_COMPUTE_BUDGET_SET_UNIT_PRICE_OPERATION: &str =
"solana_core.compute_budget.set_compute_unit_price";
"solana.core.compute_budget.set_compute_unit_price";
/// Stable operation code for a Compute Budget loaded-account data-size limit.
pub const EX_SOLANA_CORE_COMPUTE_BUDGET_SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_OPERATION: &str =
"solana_core.compute_budget.set_loaded_accounts_data_size_limit";
"solana.core.compute_budget.set_loaded_accounts_data_size_limit";
/// Stable operation code for Address Lookup Table creation.
pub const EX_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_CREATE_OPERATION: &str =
"solana_core.address_lookup_table.create";
"solana.core.address_lookup_table.create";
/// Stable operation code for Address Lookup Table extension.
pub const EX_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_EXTEND_OPERATION: &str =
"solana_core.address_lookup_table.extend";
"solana.core.address_lookup_table.extend";
/// Stable operation code for permanently freezing an Address Lookup Table.
pub const EX_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_FREEZE_OPERATION: &str =
"solana_core.address_lookup_table.freeze";
"solana.core.address_lookup_table.freeze";
/// Stable operation code for Address Lookup Table deactivation.
pub const EX_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_DEACTIVATE_OPERATION: &str =
"solana_core.address_lookup_table.deactivate";
"solana.core.address_lookup_table.deactivate";
/// Stable operation code for closing an Address Lookup Table.
pub const EX_SOLANA_CORE_ADDRESS_LOOKUP_TABLE_CLOSE_OPERATION: &str =
"solana_core.address_lookup_table.close";
"solana.core.address_lookup_table.close";
/// Stable operation code for one inline Ed25519 verification.
pub const EX_SOLANA_CORE_ED25519_VERIFY_INLINE_OPERATION: &str =
"solana_core.ed25519.verify_inline";
"solana.core.ed25519.verify_inline";
/// Stable operation code for an Ed25519 verification table with explicit offsets.
pub const EX_SOLANA_CORE_ED25519_VERIFY_OFFSETS_OPERATION: &str =
"solana_core.ed25519.verify_offsets";
"solana.core.ed25519.verify_offsets";
/// Stable operation code for one inline secp256k1 verification.
pub const EX_SOLANA_CORE_SECP256K1_VERIFY_INLINE_OPERATION: &str =
"solana_core.secp256k1.verify_inline";
"solana.core.secp256k1.verify_inline";
/// Stable operation code for a secp256k1 verification table with explicit offsets.
pub const EX_SOLANA_CORE_SECP256K1_VERIFY_OFFSETS_OPERATION: &str =
"solana_core.secp256k1.verify_offsets";
"solana.core.secp256k1.verify_offsets";
/// Stable operation code for one inline secp256r1 verification.
pub const EX_SOLANA_CORE_SECP256R1_VERIFY_INLINE_OPERATION: &str =
"solana_core.secp256r1.verify_inline";
"solana.core.secp256r1.verify_inline";
/// Stable operation code for a secp256r1 verification table with explicit offsets.
pub const EX_SOLANA_CORE_SECP256R1_VERIFY_OFFSETS_OPERATION: &str =
"solana_core.secp256r1.verify_offsets";
"solana.core.secp256r1.verify_offsets";
/// Stable operation code for initializing a Stake account.
pub const EX_SOLANA_CORE_STAKE_INITIALIZE_OPERATION: &str = "solana_core.stake.initialize";
pub const EX_SOLANA_CORE_STAKE_INITIALIZE_OPERATION: &str = "solana.core.stake.initialize";
/// Stable operation code for checked Stake account initialization.
pub const EX_SOLANA_CORE_STAKE_INITIALIZE_CHECKED_OPERATION: &str =
"solana_core.stake.initialize_checked";
"solana.core.stake.initialize_checked";
/// Stable operation code for creating and initializing a Stake account.
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_OPERATION: &str = "solana_core.stake.create_account";
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_OPERATION: &str = "solana.core.stake.create_account";
/// Stable operation code for seeded Stake account creation.
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_WITH_SEED_OPERATION: &str =
"solana_core.stake.create_account_with_seed";
"solana.core.stake.create_account_with_seed";
/// Stable operation code for checked Stake account creation.
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_CHECKED_OPERATION: &str =
"solana_core.stake.create_account_checked";
"solana.core.stake.create_account_checked";
/// Stable operation code for checked seeded Stake account creation.
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_WITH_SEED_CHECKED_OPERATION: &str =
"solana_core.stake.create_account_with_seed_checked";
"solana.core.stake.create_account_with_seed_checked";
/// Stable operation code for splitting a Stake account.
pub const EX_SOLANA_CORE_STAKE_SPLIT_OPERATION: &str = "solana_core.stake.split";
pub const EX_SOLANA_CORE_STAKE_SPLIT_OPERATION: &str = "solana.core.stake.split";
/// Stable operation code for splitting into a seeded Stake account.
pub const EX_SOLANA_CORE_STAKE_SPLIT_WITH_SEED_OPERATION: &str =
"solana_core.stake.split_with_seed";
"solana.core.stake.split_with_seed";
/// Stable operation code for merging Stake accounts.
pub const EX_SOLANA_CORE_STAKE_MERGE_OPERATION: &str = "solana_core.stake.merge";
pub const EX_SOLANA_CORE_STAKE_MERGE_OPERATION: &str = "solana.core.stake.merge";
/// Stable operation code for creating and delegating a Stake account.
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_AND_DELEGATE_OPERATION: &str =
"solana_core.stake.create_account_and_delegate";
"solana.core.stake.create_account_and_delegate";
/// Stable operation code for seeded Stake account creation and delegation.
pub const EX_SOLANA_CORE_STAKE_CREATE_ACCOUNT_WITH_SEED_AND_DELEGATE_OPERATION: &str =
"solana_core.stake.create_account_with_seed_and_delegate";
"solana.core.stake.create_account_with_seed_and_delegate";
/// Stable operation code for changing a Stake authority.
pub const EX_SOLANA_CORE_STAKE_AUTHORIZE_OPERATION: &str = "solana_core.stake.authorize";
pub const EX_SOLANA_CORE_STAKE_AUTHORIZE_OPERATION: &str = "solana.core.stake.authorize";
/// Stable operation code for a checked Stake authority change.
pub const EX_SOLANA_CORE_STAKE_AUTHORIZE_CHECKED_OPERATION: &str =
"solana_core.stake.authorize_checked";
"solana.core.stake.authorize_checked";
/// Stable operation code for changing a seeded Stake authority.
pub const EX_SOLANA_CORE_STAKE_AUTHORIZE_WITH_SEED_OPERATION: &str =
"solana_core.stake.authorize_with_seed";
"solana.core.stake.authorize_with_seed";
/// Stable operation code for a checked seeded Stake authority change.
pub const EX_SOLANA_CORE_STAKE_AUTHORIZE_CHECKED_WITH_SEED_OPERATION: &str =
"solana_core.stake.authorize_checked_with_seed";
"solana.core.stake.authorize_checked_with_seed";
/// Stable operation code for delegating Stake.
pub const EX_SOLANA_CORE_STAKE_DELEGATE_OPERATION: &str = "solana_core.stake.delegate";
pub const EX_SOLANA_CORE_STAKE_DELEGATE_OPERATION: &str = "solana.core.stake.delegate";
/// Stable operation code for withdrawing lamports from a Stake account.
pub const EX_SOLANA_CORE_STAKE_WITHDRAW_OPERATION: &str = "solana_core.stake.withdraw";
pub const EX_SOLANA_CORE_STAKE_WITHDRAW_OPERATION: &str = "solana.core.stake.withdraw";
/// Stable operation code for deactivating Stake.
pub const EX_SOLANA_CORE_STAKE_DEACTIVATE_OPERATION: &str = "solana_core.stake.deactivate";
pub const EX_SOLANA_CORE_STAKE_DEACTIVATE_OPERATION: &str = "solana.core.stake.deactivate";
/// Stable operation code for changing a Stake lockup.
pub const EX_SOLANA_CORE_STAKE_SET_LOCKUP_OPERATION: &str = "solana_core.stake.set_lockup";
pub const EX_SOLANA_CORE_STAKE_SET_LOCKUP_OPERATION: &str = "solana.core.stake.set_lockup";
/// Stable operation code for a checked Stake lockup change.
pub const EX_SOLANA_CORE_STAKE_SET_LOCKUP_CHECKED_OPERATION: &str =
"solana_core.stake.set_lockup_checked";
"solana.core.stake.set_lockup_checked";
/// Stable operation code for querying the minimum delegation.
pub const EX_SOLANA_CORE_STAKE_GET_MINIMUM_DELEGATION_OPERATION: &str =
"solana_core.stake.get_minimum_delegation";
"solana.core.stake.get_minimum_delegation";
/// Stable operation code for deactivating delinquent Stake.
pub const EX_SOLANA_CORE_STAKE_DEACTIVATE_DELINQUENT_OPERATION: &str =
"solana_core.stake.deactivate_delinquent";
"solana.core.stake.deactivate_delinquent";
/// Stable operation code for moving delegated Stake.
pub const EX_SOLANA_CORE_STAKE_MOVE_STAKE_OPERATION: &str = "solana_core.stake.move_stake";
pub const EX_SOLANA_CORE_STAKE_MOVE_STAKE_OPERATION: &str = "solana.core.stake.move_stake";
/// Stable operation code for moving lamports between Stake accounts.
pub const EX_SOLANA_CORE_STAKE_MOVE_LAMPORTS_OPERATION: &str = "solana_core.stake.move_lamports";
pub const EX_SOLANA_CORE_STAKE_MOVE_LAMPORTS_OPERATION: &str = "solana.core.stake.move_lamports";
/// Stable operation code for initializing a legacy Vote account.
pub const EX_SOLANA_CORE_VOTE_INITIALIZE_ACCOUNT_OPERATION: &str =
"solana_core.vote.initialize_account";
"solana.core.vote.initialize_account";
/// Stable operation code for initializing a Vote v2 account.
pub const EX_SOLANA_CORE_VOTE_INITIALIZE_ACCOUNT_V2_OPERATION: &str =
"solana_core.vote.initialize_account_v2";
"solana.core.vote.initialize_account_v2";
/// Stable operation code for creating and initializing a legacy Vote account.
pub const EX_SOLANA_CORE_VOTE_CREATE_ACCOUNT_OPERATION: &str = "solana_core.vote.create_account";
pub const EX_SOLANA_CORE_VOTE_CREATE_ACCOUNT_OPERATION: &str = "solana.core.vote.create_account";
/// Stable operation code for creating a seeded legacy Vote account.
pub const EX_SOLANA_CORE_VOTE_CREATE_ACCOUNT_WITH_SEED_OPERATION: &str =
"solana_core.vote.create_account_with_seed";
"solana.core.vote.create_account_with_seed";
/// Stable operation code for creating and initializing a Vote v2 account.
pub const EX_SOLANA_CORE_VOTE_CREATE_ACCOUNT_V2_OPERATION: &str =
"solana_core.vote.create_account_v2";
"solana.core.vote.create_account_v2";
/// Stable operation code for creating a seeded Vote v2 account.
pub const EX_SOLANA_CORE_VOTE_CREATE_ACCOUNT_WITH_SEED_V2_OPERATION: &str =
"solana_core.vote.create_account_with_seed_v2";
"solana.core.vote.create_account_with_seed_v2";
/// Stable operation code for changing a Vote authority.
pub const EX_SOLANA_CORE_VOTE_AUTHORIZE_OPERATION: &str = "solana_core.vote.authorize";
pub const EX_SOLANA_CORE_VOTE_AUTHORIZE_OPERATION: &str = "solana.core.vote.authorize";
/// Stable operation code for a checked Vote authority change.
pub const EX_SOLANA_CORE_VOTE_AUTHORIZE_CHECKED_OPERATION: &str =
"solana_core.vote.authorize_checked";
"solana.core.vote.authorize_checked";
/// Stable operation code for changing a seed-derived Vote authority.
pub const EX_SOLANA_CORE_VOTE_AUTHORIZE_WITH_SEED_OPERATION: &str =
"solana_core.vote.authorize_with_seed";
"solana.core.vote.authorize_with_seed";
/// Stable operation code for a checked seed-derived Vote authority change.
pub const EX_SOLANA_CORE_VOTE_AUTHORIZE_CHECKED_WITH_SEED_OPERATION: &str =
"solana_core.vote.authorize_checked_with_seed";
"solana.core.vote.authorize_checked_with_seed";
/// Stable operation code for submitting a Vote instruction.
pub const EX_SOLANA_CORE_VOTE_SUBMIT_OPERATION: &str = "solana_core.vote.vote";
pub const EX_SOLANA_CORE_VOTE_SUBMIT_OPERATION: &str = "solana.core.vote.vote";
/// Stable operation code for submitting a switch-proof Vote instruction.
pub const EX_SOLANA_CORE_VOTE_SWITCH_OPERATION: &str = "solana_core.vote.vote_switch";
pub const EX_SOLANA_CORE_VOTE_SWITCH_OPERATION: &str = "solana.core.vote.vote_switch";
/// Stable operation code for withdrawing lamports from a Vote account.
pub const EX_SOLANA_CORE_VOTE_WITHDRAW_OPERATION: &str = "solana_core.vote.withdraw";
pub const EX_SOLANA_CORE_VOTE_WITHDRAW_OPERATION: &str = "solana.core.vote.withdraw";
/// Stable operation code for changing a validator identity.
pub const EX_SOLANA_CORE_VOTE_UPDATE_VALIDATOR_IDENTITY_OPERATION: &str =
"solana_core.vote.update_validator_identity";
"solana.core.vote.update_validator_identity";
/// Stable operation code for changing a legacy Vote commission percentage.
pub const EX_SOLANA_CORE_VOTE_UPDATE_COMMISSION_OPERATION: &str =
"solana_core.vote.update_commission";
"solana.core.vote.update_commission";
/// Stable operation code for replacing Vote state.
pub const EX_SOLANA_CORE_VOTE_UPDATE_VOTE_STATE_OPERATION: &str =
"solana_core.vote.update_vote_state";
"solana.core.vote.update_vote_state";
/// Stable operation code for replacing Vote state with a switch proof.
pub const EX_SOLANA_CORE_VOTE_UPDATE_VOTE_STATE_SWITCH_OPERATION: &str =
"solana_core.vote.update_vote_state_switch";
"solana.core.vote.update_vote_state_switch";
/// Stable operation code for compact Vote-state replacement.
pub const EX_SOLANA_CORE_VOTE_COMPACT_UPDATE_VOTE_STATE_OPERATION: &str =
"solana_core.vote.compact_update_vote_state";
"solana.core.vote.compact_update_vote_state";
/// Stable operation code for compact Vote-state replacement with a switch proof.
pub const EX_SOLANA_CORE_VOTE_COMPACT_UPDATE_VOTE_STATE_SWITCH_OPERATION: &str =
"solana_core.vote.compact_update_vote_state_switch";
"solana.core.vote.compact_update_vote_state_switch";
/// Stable operation code for synchronizing a Vote tower.
pub const EX_SOLANA_CORE_VOTE_TOWER_SYNC_OPERATION: &str = "solana_core.vote.tower_sync";
pub const EX_SOLANA_CORE_VOTE_TOWER_SYNC_OPERATION: &str = "solana.core.vote.tower_sync";
/// Stable operation code for synchronizing a Vote tower with a switch proof.
pub const EX_SOLANA_CORE_VOTE_TOWER_SYNC_SWITCH_OPERATION: &str =
"solana_core.vote.tower_sync_switch";
"solana.core.vote.tower_sync_switch";
/// Stable operation code for changing a Vote v2 commission collector.
pub const EX_SOLANA_CORE_VOTE_UPDATE_COMMISSION_COLLECTOR_OPERATION: &str =
"solana_core.vote.update_commission_collector";
"solana.core.vote.update_commission_collector";
/// Stable operation code for changing a Vote v2 commission in basis points.
pub const EX_SOLANA_CORE_VOTE_UPDATE_COMMISSION_BPS_OPERATION: &str =
"solana_core.vote.update_commission_bps";
"solana.core.vote.update_commission_bps";
/// Stable operation code for depositing delegator rewards into a Vote account.
pub const EX_SOLANA_CORE_VOTE_DEPOSIT_DELEGATOR_REWARDS_OPERATION: &str =
"solana_core.vote.deposit_delegator_rewards";
"solana.core.vote.deposit_delegator_rewards";
/// Stable operation code for atomically creating and initializing a Loader v3 buffer.
pub const EX_SOLANA_CORE_LOADER_V3_CREATE_BUFFER_OPERATION: &str =
"solana_core.loader_v3.create_buffer";
"solana.core.loader_v3.create_buffer";
/// Stable operation code for writing one bounded chunk into a Loader v3 buffer.
pub const EX_SOLANA_CORE_LOADER_V3_WRITE_OPERATION: &str = "solana_core.loader_v3.write";
pub const EX_SOLANA_CORE_LOADER_V3_WRITE_OPERATION: &str = "solana.core.loader_v3.write";
/// Stable operation code for atomically creating and deploying a Loader v3 program.
pub const EX_SOLANA_CORE_LOADER_V3_DEPLOY_WITH_MAX_PROGRAM_LEN_OPERATION: &str =
"solana_core.loader_v3.deploy_with_max_program_len";
"solana.core.loader_v3.deploy_with_max_program_len";
/// Stable operation code for upgrading a Loader v3 program from a buffer.
pub const EX_SOLANA_CORE_LOADER_V3_UPGRADE_OPERATION: &str = "solana_core.loader_v3.upgrade";
pub const EX_SOLANA_CORE_LOADER_V3_UPGRADE_OPERATION: &str = "solana.core.loader_v3.upgrade";
/// Stable operation code for changing a Loader v3 buffer authority.
pub const EX_SOLANA_CORE_LOADER_V3_SET_BUFFER_AUTHORITY_OPERATION: &str =
"solana_core.loader_v3.set_buffer_authority";
"solana.core.loader_v3.set_buffer_authority";
/// Stable operation code for a checked Loader v3 buffer authority change.
pub const EX_SOLANA_CORE_LOADER_V3_SET_BUFFER_AUTHORITY_CHECKED_OPERATION: &str =
"solana_core.loader_v3.set_buffer_authority_checked";
"solana.core.loader_v3.set_buffer_authority_checked";
/// Stable operation code for changing or revoking a Loader v3 program authority.
pub const EX_SOLANA_CORE_LOADER_V3_SET_UPGRADE_AUTHORITY_OPERATION: &str =
"solana_core.loader_v3.set_upgrade_authority";
"solana.core.loader_v3.set_upgrade_authority";
/// Stable operation code for a checked Loader v3 program authority change.
pub const EX_SOLANA_CORE_LOADER_V3_SET_UPGRADE_AUTHORITY_CHECKED_OPERATION: &str =
"solana_core.loader_v3.set_upgrade_authority_checked";
"solana.core.loader_v3.set_upgrade_authority_checked";
/// Stable operation code for closing an initialized Loader v3 buffer.
pub const EX_SOLANA_CORE_LOADER_V3_CLOSE_OPERATION: &str = "solana_core.loader_v3.close";
pub const EX_SOLANA_CORE_LOADER_V3_CLOSE_OPERATION: &str = "solana.core.loader_v3.close";
/// Stable operation code for closing any supported Loader v3 account shape.
pub const EX_SOLANA_CORE_LOADER_V3_CLOSE_ANY_OPERATION: &str = "solana_core.loader_v3.close_any";
pub const EX_SOLANA_CORE_LOADER_V3_CLOSE_ANY_OPERATION: &str = "solana.core.loader_v3.close_any";
/// Stable operation code for extending a Loader v3 ProgramData allocation.
pub const EX_SOLANA_CORE_LOADER_V3_EXTEND_PROGRAM_OPERATION: &str =
"solana_core.loader_v3.extend_program";
"solana.core.loader_v3.extend_program";
/// Stable operation code for atomically creating and initializing a Loader v4 buffer.
pub const EX_SOLANA_CORE_LOADER_V4_CREATE_BUFFER_OPERATION: &str =
"solana_core.loader_v4.create_buffer";
"solana.core.loader_v4.create_buffer";
/// Stable operation code for changing a Loader v4 program allocation.
pub const EX_SOLANA_CORE_LOADER_V4_SET_PROGRAM_LENGTH_OPERATION: &str =
"solana_core.loader_v4.set_program_length";
"solana.core.loader_v4.set_program_length";
/// Stable operation code for writing one bounded chunk into a Loader v4 program account.
pub const EX_SOLANA_CORE_LOADER_V4_WRITE_OPERATION: &str = "solana_core.loader_v4.write";
pub const EX_SOLANA_CORE_LOADER_V4_WRITE_OPERATION: &str = "solana.core.loader_v4.write";
/// Stable operation code for copying bytes between Loader v4 program accounts.
pub const EX_SOLANA_CORE_LOADER_V4_COPY_OPERATION: &str = "solana_core.loader_v4.copy";
pub const EX_SOLANA_CORE_LOADER_V4_COPY_OPERATION: &str = "solana.core.loader_v4.copy";
/// Stable operation code for deploying a Loader v4 program in place.
pub const EX_SOLANA_CORE_LOADER_V4_DEPLOY_OPERATION: &str = "solana_core.loader_v4.deploy";
pub const EX_SOLANA_CORE_LOADER_V4_DEPLOY_OPERATION: &str = "solana.core.loader_v4.deploy";
/// Stable operation code for deploying a Loader v4 program from a source buffer.
pub const EX_SOLANA_CORE_LOADER_V4_DEPLOY_FROM_SOURCE_OPERATION: &str =
"solana_core.loader_v4.deploy_from_source";
"solana.core.loader_v4.deploy_from_source";
/// Stable operation code for retracting a Loader v4 program into maintenance.
pub const EX_SOLANA_CORE_LOADER_V4_RETRACT_OPERATION: &str = "solana_core.loader_v4.retract";
pub const EX_SOLANA_CORE_LOADER_V4_RETRACT_OPERATION: &str = "solana.core.loader_v4.retract";
/// Stable operation code for transferring Loader v4 program authority.
pub const EX_SOLANA_CORE_LOADER_V4_TRANSFER_AUTHORITY_OPERATION: &str =
"solana_core.loader_v4.transfer_authority";
"solana.core.loader_v4.transfer_authority";
/// Stable operation code for finalizing a Loader v4 program.
pub const EX_SOLANA_CORE_LOADER_V4_FINALIZE_OPERATION: &str = "solana_core.loader_v4.finalize";
pub const EX_SOLANA_CORE_LOADER_V4_FINALIZE_OPERATION: &str = "solana.core.loader_v4.finalize";
/// Stable operation code for creating and initializing a Config Program account.
pub const EX_SOLANA_CORE_CONFIG_CREATE_ACCOUNT_OPERATION: &str =
"solana_core.config.create_account";
"solana.core.config.create_account";
/// Stable operation code for storing opaque serialized data in a Config Program account.
pub const EX_SOLANA_CORE_CONFIG_STORE_OPERATION: &str = "solana_core.config.store";
pub const EX_SOLANA_CORE_CONFIG_STORE_OPERATION: &str = "solana.core.config.store";
/// Stable operation code for activating a native feature account.
pub const EX_SOLANA_CORE_FEATURE_ACTIVATE_OPERATION: &str = "solana_core.feature.activate";
pub const EX_SOLANA_CORE_FEATURE_ACTIVATE_OPERATION: &str = "solana.core.feature.activate";
/// Stable operation code for revoking a pending native feature activation.
pub const EX_SOLANA_CORE_FEATURE_REVOKE_PENDING_ACTIVATION_OPERATION: &str =
"solana_core.feature.revoke_pending_activation";
"solana.core.feature.revoke_pending_activation";
/// Stable operation code for closing a retained Slashing violation report.
pub const EX_SOLANA_CORE_SLASHING_CLOSE_VIOLATION_REPORT_OPERATION: &str =
"solana_core.slashing.close_violation_report";
"solana.core.slashing.close_violation_report";
/// Stable operation code for the atomic duplicate-block proof submission plan.
pub const EX_SOLANA_CORE_SLASHING_SUBMIT_DUPLICATE_BLOCK_PROOF_OPERATION: &str =
"solana_core.slashing.submit_duplicate_block_proof";
"solana.core.slashing.submit_duplicate_block_proof";
/// Stable operation code for an inline ZK ElGamal proof verification.
pub const EX_SOLANA_CORE_ZK_ELGAMAL_VERIFY_INLINE_OPERATION: &str =
"solana_core.zk_elgamal.verify_inline";
"solana.core.zk_elgamal.verify_inline";
/// Stable operation code for a ZK ElGamal proof read from an account.
pub const EX_SOLANA_CORE_ZK_ELGAMAL_VERIFY_FROM_ACCOUNT_OPERATION: &str =
"solana_core.zk_elgamal.verify_from_account";
"solana.core.zk_elgamal.verify_from_account";
/// Stable operation code for closing a ZK ElGamal context-state account.
pub const EX_SOLANA_CORE_ZK_ELGAMAL_CLOSE_CONTEXT_STATE_OPERATION: &str =
"solana_core.zk_elgamal.close_context_state";
"solana.core.zk_elgamal.close_context_state";
/// Every stable callable operation code exposed by the Solana core executor.
pub const EX_SOLANA_CORE_OPERATION_CODES: [&str; 109] = [

View File

@@ -1,11 +1,11 @@
// file: kb-lib/src/executor/solana/transaction/constants.rs
// version: 2
// version: 3
//! Local constants for Solana transaction assembly.
/// Stable operation code for the nonce advance injected by durable transaction assembly.
pub(crate) const EX_SOLANA_TRANSACTION_DURABLE_NONCE_ADVANCE_OPERATION: &str =
"solana_core.system.nonce.advance";
"solana.core.system.nonce.advance";
/// Maximum over-the-wire size of a Solana transaction packet.
pub(crate) const EX_SOLANA_TRANSACTION_MAX_WIRE_BYTES: usize = 1_232;
/// Canonical tracing target for Solana transaction assembly.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/spl/associated_token_account/executor.rs
// version: 5
// version: 6
//! Exact ATA capability dispatch and typed plan construction.
@@ -218,7 +218,7 @@ mod tests {
(kb_program_ids::SYSTEM_PROGRAM_ID, crate::EX_SPL_ATA_CREATE_OPERATION),
(
kb_program_ids::ASSOCIATED_TOKEN_PROGRAM_ID,
"spl_associated_token_account.close",
"spl.associated_token_account.close",
),
] {
let request = request(program_id, operation_code);

View File

@@ -1,17 +1,17 @@
// file: kb-lib/src/executor/spl/associated_token_account/intent.rs
// version: 4
// version: 5
//! Typed SPL Associated Token Account execution intents.
use ts_rs::TS; // rust-rules: derive-import
/// Stable operation code for strict ATA creation.
pub const EX_SPL_ATA_CREATE_OPERATION: &str = "spl_associated_token_account.create";
pub const EX_SPL_ATA_CREATE_OPERATION: &str = "spl.associated_token_account.create";
/// Stable operation code for idempotent ATA creation or reuse.
pub const EX_SPL_ATA_CREATE_IDEMPOTENT_OPERATION: &str =
"spl_associated_token_account.create_idempotent";
"spl.associated_token_account.create_idempotent";
/// Stable operation code for nested ATA recovery.
pub const EX_SPL_ATA_RECOVER_NESTED_OPERATION: &str = "spl_associated_token_account.recover_nested";
pub const EX_SPL_ATA_RECOVER_NESTED_OPERATION: &str = "spl.associated_token_account.recover_nested";
/// Every current officially constructible ATA operation.
pub const EX_SPL_ATA_SUPPORTED_OPERATION_CODES: &[&str] = &[
EX_SPL_ATA_CREATE_OPERATION,

View File

@@ -1,14 +1,14 @@
// file: kb-lib/src/executor/spl/elgamal_registry/intent.rs
// version: 2
// version: 3
//! Typed intents for the SPL ElGamal public-key registry.
use ts_rs::TS; // rust-rules: derive-import
/// Stable operation code for registry creation.
pub const EX_SPL_ELGAMAL_REGISTRY_CREATE_OPERATION: &str = "spl_elgamal_registry.create_registry";
pub const EX_SPL_ELGAMAL_REGISTRY_CREATE_OPERATION: &str = "spl.elgamal_registry.create_registry";
/// Stable operation code for registry update.
pub const EX_SPL_ELGAMAL_REGISTRY_UPDATE_OPERATION: &str = "spl_elgamal_registry.update_registry";
pub const EX_SPL_ELGAMAL_REGISTRY_UPDATE_OPERATION: &str = "spl.elgamal_registry.update_registry";
/// Exact location of the public-key validity proof.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/spl/memo/executor.rs
// version: 2
// version: 3
//! Exact capability dispatch and typed plan construction for SPL Memo.
@@ -257,7 +257,7 @@ mod tests {
);
let unsupported_operation = request(
kb_program_ids::SPL_MEMO_V4_PROGRAM_ID,
"spl_memo.remove_memo",
"spl.memo.remove_memo",
std::string::String::from("{}"),
);
assert_eq!(

View File

@@ -1,12 +1,12 @@
// file: kb-lib/src/executor/spl/memo/intent.rs
// version: 1
// version: 2
//! Typed SPL Memo execution intents.
use ts_rs::TS; // rust-rules: derive-import
/// Stable operation code for adding one SPL Memo annotation.
pub const EX_SPL_MEMO_ADD_MEMO_OPERATION: &str = "spl_memo.add_memo";
pub const EX_SPL_MEMO_ADD_MEMO_OPERATION: &str = "spl.memo.add_memo";
/// Conservative UTF-8 payload bound used before transaction assembly.
pub const EX_SPL_MEMO_MAX_MESSAGE_BYTES: usize = 566;
/// Conservative bound on ordered signer occurrences accepted by one intent.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/spl/token/executor.rs
// version: 8
// version: 9
//! Exact classic SPL Token capability dispatch and typed plan construction.
@@ -24,10 +24,10 @@ impl crate::ExSplTokenExecutor {
}
if matches!(
operation_code,
"spl_token.initialize_mint_with_rent"
| "spl_token.initialize_account_with_rent"
| "spl_token.initialize_multisig_with_rent"
| "spl_token.initialize_account2"
"spl.token.initialize_mint_with_rent"
| "spl.token.initialize_account_with_rent"
| "spl.token.initialize_multisig_with_rent"
| "spl.token.initialize_account2"
) {
return crate::ExApiExecutionCapability::unsupported(
"execution_spl_token_historical_variant_decode_only",
@@ -176,10 +176,10 @@ mod tests {
);
}
for operation_code in [
"spl_token.initialize_mint_with_rent",
"spl_token.initialize_account_with_rent",
"spl_token.initialize_multisig_with_rent",
"spl_token.initialize_account2",
"spl.token.initialize_mint_with_rent",
"spl.token.initialize_account_with_rent",
"spl.token.initialize_multisig_with_rent",
"spl.token.initialize_account2",
] {
let capability = crate::ExApiTypedInstructionExecutor::capability(
&executor,

View File

@@ -1,60 +1,60 @@
// file: kb-lib/src/executor/spl/token/intent.rs
// version: 4
// version: 5
//! Typed classic SPL Token execution intents.
use ts_rs::TS; // rust-rules: derive-import
/// Stable operation code for mint initialization through `InitializeMint2`.
pub const EX_SPL_TOKEN_INITIALIZE_MINT_OPERATION: &str = "spl_token.initialize_mint";
pub const EX_SPL_TOKEN_INITIALIZE_MINT_OPERATION: &str = "spl.token.initialize_mint";
/// Stable operation code for token-account initialization through `InitializeAccount3`.
pub const EX_SPL_TOKEN_INITIALIZE_ACCOUNT_OPERATION: &str = "spl_token.initialize_account";
pub const EX_SPL_TOKEN_INITIALIZE_ACCOUNT_OPERATION: &str = "spl.token.initialize_account";
/// Stable operation code for multisig initialization through `InitializeMultisig2`.
pub const EX_SPL_TOKEN_INITIALIZE_MULTISIG_OPERATION: &str = "spl_token.initialize_multisig";
pub const EX_SPL_TOKEN_INITIALIZE_MULTISIG_OPERATION: &str = "spl.token.initialize_multisig";
/// Stable operation code for an unchecked token transfer.
pub const EX_SPL_TOKEN_TRANSFER_OPERATION: &str = "spl_token.transfer";
pub const EX_SPL_TOKEN_TRANSFER_OPERATION: &str = "spl.token.transfer";
/// Stable operation code for an approval.
pub const EX_SPL_TOKEN_APPROVE_OPERATION: &str = "spl_token.approve";
pub const EX_SPL_TOKEN_APPROVE_OPERATION: &str = "spl.token.approve";
/// Stable operation code for a delegate revocation.
pub const EX_SPL_TOKEN_REVOKE_OPERATION: &str = "spl_token.revoke";
pub const EX_SPL_TOKEN_REVOKE_OPERATION: &str = "spl.token.revoke";
/// Stable operation code for an authority change.
pub const EX_SPL_TOKEN_SET_AUTHORITY_OPERATION: &str = "spl_token.set_authority";
pub const EX_SPL_TOKEN_SET_AUTHORITY_OPERATION: &str = "spl.token.set_authority";
/// Stable operation code for minting tokens.
pub const EX_SPL_TOKEN_MINT_TO_OPERATION: &str = "spl_token.mint_to";
pub const EX_SPL_TOKEN_MINT_TO_OPERATION: &str = "spl.token.mint_to";
/// Stable operation code for burning tokens.
pub const EX_SPL_TOKEN_BURN_OPERATION: &str = "spl_token.burn";
pub const EX_SPL_TOKEN_BURN_OPERATION: &str = "spl.token.burn";
/// Stable operation code for closing a token account.
pub const EX_SPL_TOKEN_CLOSE_ACCOUNT_OPERATION: &str = "spl_token.close_account";
pub const EX_SPL_TOKEN_CLOSE_ACCOUNT_OPERATION: &str = "spl.token.close_account";
/// Stable operation code for freezing a token account.
pub const EX_SPL_TOKEN_FREEZE_ACCOUNT_OPERATION: &str = "spl_token.freeze_account";
pub const EX_SPL_TOKEN_FREEZE_ACCOUNT_OPERATION: &str = "spl.token.freeze_account";
/// Stable operation code for thawing a token account.
pub const EX_SPL_TOKEN_THAW_ACCOUNT_OPERATION: &str = "spl_token.thaw_account";
pub const EX_SPL_TOKEN_THAW_ACCOUNT_OPERATION: &str = "spl.token.thaw_account";
/// Stable operation code for a checked token transfer.
pub const EX_SPL_TOKEN_TRANSFER_CHECKED_OPERATION: &str = "spl_token.transfer_checked";
pub const EX_SPL_TOKEN_TRANSFER_CHECKED_OPERATION: &str = "spl.token.transfer_checked";
/// Stable operation code for a checked approval.
pub const EX_SPL_TOKEN_APPROVE_CHECKED_OPERATION: &str = "spl_token.approve_checked";
pub const EX_SPL_TOKEN_APPROVE_CHECKED_OPERATION: &str = "spl.token.approve_checked";
/// Stable operation code for checked minting.
pub const EX_SPL_TOKEN_MINT_TO_CHECKED_OPERATION: &str = "spl_token.mint_to_checked";
pub const EX_SPL_TOKEN_MINT_TO_CHECKED_OPERATION: &str = "spl.token.mint_to_checked";
/// Stable operation code for checked burning.
pub const EX_SPL_TOKEN_BURN_CHECKED_OPERATION: &str = "spl_token.burn_checked";
pub const EX_SPL_TOKEN_BURN_CHECKED_OPERATION: &str = "spl.token.burn_checked";
/// Stable operation code for synchronizing wrapped SOL.
pub const EX_SPL_TOKEN_SYNC_NATIVE_OPERATION: &str = "spl_token.sync_native";
pub const EX_SPL_TOKEN_SYNC_NATIVE_OPERATION: &str = "spl.token.sync_native";
/// Stable operation code for querying account data size.
pub const EX_SPL_TOKEN_GET_ACCOUNT_DATA_SIZE_OPERATION: &str = "spl_token.get_account_data_size";
pub const EX_SPL_TOKEN_GET_ACCOUNT_DATA_SIZE_OPERATION: &str = "spl.token.get_account_data_size";
/// Stable operation code for the classic compatibility no-op.
pub const EX_SPL_TOKEN_INITIALIZE_IMMUTABLE_OWNER_OPERATION: &str =
"spl_token.initialize_immutable_owner";
"spl.token.initialize_immutable_owner";
/// Stable operation code for raw-to-UI amount conversion.
pub const EX_SPL_TOKEN_AMOUNT_TO_UI_AMOUNT_OPERATION: &str = "spl_token.amount_to_ui_amount";
pub const EX_SPL_TOKEN_AMOUNT_TO_UI_AMOUNT_OPERATION: &str = "spl.token.amount_to_ui_amount";
/// Stable operation code for UI-to-raw amount conversion.
pub const EX_SPL_TOKEN_UI_AMOUNT_TO_AMOUNT_OPERATION: &str = "spl_token.ui_amount_to_amount";
pub const EX_SPL_TOKEN_UI_AMOUNT_TO_AMOUNT_OPERATION: &str = "spl.token.ui_amount_to_amount";
/// Stable operation code for rescuing excess lamports.
pub const EX_SPL_TOKEN_WITHDRAW_EXCESS_LAMPORTS_OPERATION: &str =
"spl_token.withdraw_excess_lamports";
"spl.token.withdraw_excess_lamports";
/// Stable operation code for the recent wrapped-SOL partial unwrap.
pub const EX_SPL_TOKEN_UNWRAP_LAMPORTS_OPERATION: &str = "spl_token.unwrap_lamports";
pub const EX_SPL_TOKEN_UNWRAP_LAMPORTS_OPERATION: &str = "spl.token.unwrap_lamports";
/// Stable operation code for a recent bounded batch.
pub const EX_SPL_TOKEN_BATCH_OPERATION: &str = "spl_token.batch";
pub const EX_SPL_TOKEN_BATCH_OPERATION: &str = "spl.token.batch";
/// Operation codes constructible by this executor.
pub const EX_SPL_TOKEN_SUPPORTED_OPERATION_CODES: &[&str] = &[

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/executor/spl/token_2022/executor.rs
// version: 22
// version: 23
//! Exact Token-2022 capability dispatch and typed plan construction.
@@ -30,10 +30,10 @@ impl crate::ExSplToken2022Executor {
}
if matches!(
operation_code,
"spl_token_2022.initialize_mint_with_rent"
| "spl_token_2022.initialize_account_with_rent"
| "spl_token_2022.initialize_multisig_with_rent"
| "spl_token_2022.initialize_account2"
"spl.token_2022.initialize_mint_with_rent"
| "spl.token_2022.initialize_account_with_rent"
| "spl.token_2022.initialize_multisig_with_rent"
| "spl.token_2022.initialize_account2"
) {
return crate::ExApiExecutionCapability::unsupported(
"execution_spl_token_2022_historical_variant_decode_only",
@@ -183,10 +183,10 @@ mod tests {
);
}
for operation_code in [
"spl_token_2022.initialize_mint_with_rent",
"spl_token_2022.initialize_account_with_rent",
"spl_token_2022.initialize_multisig_with_rent",
"spl_token_2022.initialize_account2",
"spl.token_2022.initialize_mint_with_rent",
"spl.token_2022.initialize_account_with_rent",
"spl.token_2022.initialize_multisig_with_rent",
"spl.token_2022.initialize_account2",
] {
let capability = crate::ExApiTypedInstructionExecutor::capability(
&executor,
@@ -240,7 +240,7 @@ mod tests {
assert_eq!(instructions.len(), 48);
for operation_code in crate::EX_SPL_TOKEN_2022_SUPPORTED_OPERATION_CODES {
let name = operation_code
.strip_prefix("spl_token_2022.")
.strip_prefix("spl.token_2022.")
.unwrap_or_else(|| panic!("invalid operation code {operation_code}"));
let matrix_name = match name {
"initialize_interest_bearing_mint" | "update_interest_bearing_rate" => {

View File

@@ -1,258 +1,258 @@
// file: kb-lib/src/executor/spl/token_2022/intent.rs
// version: 25
// version: 26
//! Typed Token-2022 execution intents.
use ts_rs::TS; // rust-rules: derive-import
/// Stable operation code for mint initialization through `InitializeMint2`.
pub const EX_SPL_TOKEN_2022_INITIALIZE_MINT_OPERATION: &str = "spl_token_2022.initialize_mint";
pub const EX_SPL_TOKEN_2022_INITIALIZE_MINT_OPERATION: &str = "spl.token_2022.initialize_mint";
/// Stable operation code for token-account initialization through `InitializeAccount3`.
pub const EX_SPL_TOKEN_2022_INITIALIZE_ACCOUNT_OPERATION: &str =
"spl_token_2022.initialize_account";
"spl.token_2022.initialize_account";
/// Stable operation code for multisig initialization through `InitializeMultisig2`.
pub const EX_SPL_TOKEN_2022_INITIALIZE_MULTISIG_OPERATION: &str =
"spl_token_2022.initialize_multisig";
"spl.token_2022.initialize_multisig";
/// Stable operation code for an unchecked token transfer.
pub const EX_SPL_TOKEN_2022_TRANSFER_OPERATION: &str = "spl_token_2022.transfer";
pub const EX_SPL_TOKEN_2022_TRANSFER_OPERATION: &str = "spl.token_2022.transfer";
/// Stable operation code for an approval.
pub const EX_SPL_TOKEN_2022_APPROVE_OPERATION: &str = "spl_token_2022.approve";
pub const EX_SPL_TOKEN_2022_APPROVE_OPERATION: &str = "spl.token_2022.approve";
/// Stable operation code for a delegate revocation.
pub const EX_SPL_TOKEN_2022_REVOKE_OPERATION: &str = "spl_token_2022.revoke";
pub const EX_SPL_TOKEN_2022_REVOKE_OPERATION: &str = "spl.token_2022.revoke";
/// Stable operation code for an authority change.
pub const EX_SPL_TOKEN_2022_SET_AUTHORITY_OPERATION: &str = "spl_token_2022.set_authority";
pub const EX_SPL_TOKEN_2022_SET_AUTHORITY_OPERATION: &str = "spl.token_2022.set_authority";
/// Stable operation code for minting tokens.
pub const EX_SPL_TOKEN_2022_MINT_TO_OPERATION: &str = "spl_token_2022.mint_to";
pub const EX_SPL_TOKEN_2022_MINT_TO_OPERATION: &str = "spl.token_2022.mint_to";
/// Stable operation code for burning tokens.
pub const EX_SPL_TOKEN_2022_BURN_OPERATION: &str = "spl_token_2022.burn";
pub const EX_SPL_TOKEN_2022_BURN_OPERATION: &str = "spl.token_2022.burn";
/// Stable operation code for closing a token account.
pub const EX_SPL_TOKEN_2022_CLOSE_ACCOUNT_OPERATION: &str = "spl_token_2022.close_account";
pub const EX_SPL_TOKEN_2022_CLOSE_ACCOUNT_OPERATION: &str = "spl.token_2022.close_account";
/// Stable operation code for freezing a token account.
pub const EX_SPL_TOKEN_2022_FREEZE_ACCOUNT_OPERATION: &str = "spl_token_2022.freeze_account";
pub const EX_SPL_TOKEN_2022_FREEZE_ACCOUNT_OPERATION: &str = "spl.token_2022.freeze_account";
/// Stable operation code for thawing a token account.
pub const EX_SPL_TOKEN_2022_THAW_ACCOUNT_OPERATION: &str = "spl_token_2022.thaw_account";
pub const EX_SPL_TOKEN_2022_THAW_ACCOUNT_OPERATION: &str = "spl.token_2022.thaw_account";
/// Stable operation code for a checked token transfer.
pub const EX_SPL_TOKEN_2022_TRANSFER_CHECKED_OPERATION: &str = "spl_token_2022.transfer_checked";
pub const EX_SPL_TOKEN_2022_TRANSFER_CHECKED_OPERATION: &str = "spl.token_2022.transfer_checked";
/// Stable operation code for a checked approval.
pub const EX_SPL_TOKEN_2022_APPROVE_CHECKED_OPERATION: &str = "spl_token_2022.approve_checked";
pub const EX_SPL_TOKEN_2022_APPROVE_CHECKED_OPERATION: &str = "spl.token_2022.approve_checked";
/// Stable operation code for checked minting.
pub const EX_SPL_TOKEN_2022_MINT_TO_CHECKED_OPERATION: &str = "spl_token_2022.mint_to_checked";
pub const EX_SPL_TOKEN_2022_MINT_TO_CHECKED_OPERATION: &str = "spl.token_2022.mint_to_checked";
/// Stable operation code for checked burning.
pub const EX_SPL_TOKEN_2022_BURN_CHECKED_OPERATION: &str = "spl_token_2022.burn_checked";
pub const EX_SPL_TOKEN_2022_BURN_CHECKED_OPERATION: &str = "spl.token_2022.burn_checked";
/// Stable operation code for synchronizing wrapped SOL.
pub const EX_SPL_TOKEN_2022_SYNC_NATIVE_OPERATION: &str = "spl_token_2022.sync_native";
pub const EX_SPL_TOKEN_2022_SYNC_NATIVE_OPERATION: &str = "spl.token_2022.sync_native";
/// Stable operation code for querying account data size.
pub const EX_SPL_TOKEN_2022_GET_ACCOUNT_DATA_SIZE_OPERATION: &str =
"spl_token_2022.get_account_data_size";
"spl.token_2022.get_account_data_size";
/// Stable operation code for the classic compatibility no-op.
pub const EX_SPL_TOKEN_2022_INITIALIZE_IMMUTABLE_OWNER_OPERATION: &str =
"spl_token_2022.initialize_immutable_owner";
"spl.token_2022.initialize_immutable_owner";
/// Stable operation code for raw-to-UI amount conversion.
pub const EX_SPL_TOKEN_2022_AMOUNT_TO_UI_AMOUNT_OPERATION: &str =
"spl_token_2022.amount_to_ui_amount";
"spl.token_2022.amount_to_ui_amount";
/// Stable operation code for UI-to-raw amount conversion.
pub const EX_SPL_TOKEN_2022_UI_AMOUNT_TO_AMOUNT_OPERATION: &str =
"spl_token_2022.ui_amount_to_amount";
"spl.token_2022.ui_amount_to_amount";
/// Stable operation code for rescuing excess lamports.
pub const EX_SPL_TOKEN_2022_WITHDRAW_EXCESS_LAMPORTS_OPERATION: &str =
"spl_token_2022.withdraw_excess_lamports";
"spl.token_2022.withdraw_excess_lamports";
/// Stable operation code for the recent wrapped-SOL partial unwrap.
pub const EX_SPL_TOKEN_2022_UNWRAP_LAMPORTS_OPERATION: &str = "spl_token_2022.unwrap_lamports";
pub const EX_SPL_TOKEN_2022_UNWRAP_LAMPORTS_OPERATION: &str = "spl.token_2022.unwrap_lamports";
/// Stable operation code for Token-2022 account reallocation.
pub const EX_SPL_TOKEN_2022_REALLOCATE_OPERATION: &str = "spl_token_2022.reallocate";
pub const EX_SPL_TOKEN_2022_REALLOCATE_OPERATION: &str = "spl.token_2022.reallocate";
/// Stable operation code for initializing a non-transferable mint.
pub const EX_SPL_TOKEN_2022_INITIALIZE_NON_TRANSFERABLE_MINT_OPERATION: &str =
"spl_token_2022.initialize_non_transferable_mint";
"spl.token_2022.initialize_non_transferable_mint";
/// Stable operation code for initializing a permanent delegate.
pub const EX_SPL_TOKEN_2022_INITIALIZE_PERMANENT_DELEGATE_OPERATION: &str =
"spl_token_2022.initialize_permanent_delegate";
"spl.token_2022.initialize_permanent_delegate";
/// Stable operation code for initializing an interest-bearing mint.
pub const EX_SPL_TOKEN_2022_INITIALIZE_INTEREST_BEARING_MINT_OPERATION: &str =
"spl_token_2022.initialize_interest_bearing_mint";
"spl.token_2022.initialize_interest_bearing_mint";
/// Stable operation code for updating an interest-bearing mint rate.
pub const EX_SPL_TOKEN_2022_UPDATE_INTEREST_BEARING_RATE_OPERATION: &str =
"spl_token_2022.update_interest_bearing_rate";
"spl.token_2022.update_interest_bearing_rate";
/// Stable operation code for transfer-fee configuration initialization.
pub const EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_FEE_CONFIG_OPERATION: &str =
"spl_token_2022.initialize_transfer_fee_config";
"spl.token_2022.initialize_transfer_fee_config";
/// Stable operation code for updating transfer-fee parameters.
pub const EX_SPL_TOKEN_2022_SET_TRANSFER_FEE_OPERATION: &str = "spl_token_2022.set_transfer_fee";
pub const EX_SPL_TOKEN_2022_SET_TRANSFER_FEE_OPERATION: &str = "spl.token_2022.set_transfer_fee";
/// Stable operation code for a checked transfer with an expected fee.
pub const EX_SPL_TOKEN_2022_TRANSFER_CHECKED_WITH_FEE_OPERATION: &str =
"spl_token_2022.transfer_checked_with_fee";
"spl.token_2022.transfer_checked_with_fee";
/// Stable operation code for withdrawing withheld fees from a mint.
pub const EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_MINT_OPERATION: &str =
"spl_token_2022.withdraw_withheld_tokens_from_mint";
"spl.token_2022.withdraw_withheld_tokens_from_mint";
/// Stable operation code for withdrawing withheld fees from token accounts.
pub const EX_SPL_TOKEN_2022_WITHDRAW_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION: &str =
"spl_token_2022.withdraw_withheld_tokens_from_accounts";
"spl.token_2022.withdraw_withheld_tokens_from_accounts";
/// Stable operation code for harvesting withheld fees into a mint.
pub const EX_SPL_TOKEN_2022_HARVEST_WITHHELD_TOKENS_TO_MINT_OPERATION: &str =
"spl_token_2022.harvest_withheld_tokens_to_mint";
"spl.token_2022.harvest_withheld_tokens_to_mint";
/// Stable operation code for initializing a default account state.
pub const EX_SPL_TOKEN_2022_INITIALIZE_DEFAULT_ACCOUNT_STATE_OPERATION: &str =
"spl_token_2022.initialize_default_account_state";
"spl.token_2022.initialize_default_account_state";
/// Stable operation code for updating a default account state.
pub const EX_SPL_TOKEN_2022_UPDATE_DEFAULT_ACCOUNT_STATE_OPERATION: &str =
"spl_token_2022.update_default_account_state";
"spl.token_2022.update_default_account_state";
/// Stable operation code for requiring memos on incoming transfers.
pub const EX_SPL_TOKEN_2022_ENABLE_REQUIRED_TRANSFER_MEMOS_OPERATION: &str =
"spl_token_2022.enable_required_transfer_memos";
"spl.token_2022.enable_required_transfer_memos";
/// Stable operation code for disabling required incoming-transfer memos.
pub const EX_SPL_TOKEN_2022_DISABLE_REQUIRED_TRANSFER_MEMOS_OPERATION: &str =
"spl_token_2022.disable_required_transfer_memos";
"spl.token_2022.disable_required_transfer_memos";
/// Stable operation code for enabling CPI Guard on a token account.
pub const EX_SPL_TOKEN_2022_ENABLE_CPI_GUARD_OPERATION: &str = "spl_token_2022.enable_cpi_guard";
pub const EX_SPL_TOKEN_2022_ENABLE_CPI_GUARD_OPERATION: &str = "spl.token_2022.enable_cpi_guard";
/// Stable operation code for disabling CPI Guard on a token account.
pub const EX_SPL_TOKEN_2022_DISABLE_CPI_GUARD_OPERATION: &str = "spl_token_2022.disable_cpi_guard";
pub const EX_SPL_TOKEN_2022_DISABLE_CPI_GUARD_OPERATION: &str = "spl.token_2022.disable_cpi_guard";
/// Stable operation code for initializing a transfer-hook pointer.
pub const EX_SPL_TOKEN_2022_INITIALIZE_TRANSFER_HOOK_OPERATION: &str =
"spl_token_2022.initialize_transfer_hook";
"spl.token_2022.initialize_transfer_hook";
/// Stable operation code for updating or clearing a transfer-hook program id.
pub const EX_SPL_TOKEN_2022_UPDATE_TRANSFER_HOOK_OPERATION: &str =
"spl_token_2022.update_transfer_hook";
"spl.token_2022.update_transfer_hook";
/// Stable operation code for initializing a metadata pointer.
pub const EX_SPL_TOKEN_2022_INITIALIZE_METADATA_POINTER_OPERATION: &str =
"spl_token_2022.initialize_metadata_pointer";
"spl.token_2022.initialize_metadata_pointer";
/// Stable operation code for updating or clearing a metadata pointer.
pub const EX_SPL_TOKEN_2022_UPDATE_METADATA_POINTER_OPERATION: &str =
"spl_token_2022.update_metadata_pointer";
"spl.token_2022.update_metadata_pointer";
/// Stable operation code for initializing a group pointer.
pub const EX_SPL_TOKEN_2022_INITIALIZE_GROUP_POINTER_OPERATION: &str =
"spl_token_2022.initialize_group_pointer";
"spl.token_2022.initialize_group_pointer";
/// Stable operation code for updating or clearing a group pointer.
pub const EX_SPL_TOKEN_2022_UPDATE_GROUP_POINTER_OPERATION: &str =
"spl_token_2022.update_group_pointer";
"spl.token_2022.update_group_pointer";
/// Stable operation code for initializing a group-member pointer.
pub const EX_SPL_TOKEN_2022_INITIALIZE_GROUP_MEMBER_POINTER_OPERATION: &str =
"spl_token_2022.initialize_group_member_pointer";
"spl.token_2022.initialize_group_member_pointer";
/// Stable operation code for updating or clearing a group-member pointer.
pub const EX_SPL_TOKEN_2022_UPDATE_GROUP_MEMBER_POINTER_OPERATION: &str =
"spl_token_2022.update_group_member_pointer";
"spl.token_2022.update_group_member_pointer";
/// Stable operation code for initializing Token-2022 embedded metadata.
pub const EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_METADATA_OPERATION: &str =
"spl_token_2022.initialize_token_metadata";
"spl.token_2022.initialize_token_metadata";
/// Stable operation code for updating an embedded metadata field.
pub const EX_SPL_TOKEN_2022_UPDATE_TOKEN_METADATA_FIELD_OPERATION: &str =
"spl_token_2022.update_token_metadata_field";
"spl.token_2022.update_token_metadata_field";
/// Stable operation code for removing an embedded metadata key.
pub const EX_SPL_TOKEN_2022_REMOVE_TOKEN_METADATA_KEY_OPERATION: &str =
"spl_token_2022.remove_token_metadata_key";
"spl.token_2022.remove_token_metadata_key";
/// Stable operation code for initializing an embedded token group.
pub const EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_OPERATION: &str =
"spl_token_2022.initialize_token_group";
"spl.token_2022.initialize_token_group";
/// Stable operation code for updating an embedded token-group maximum size.
pub const EX_SPL_TOKEN_2022_UPDATE_TOKEN_GROUP_MAX_SIZE_OPERATION: &str =
"spl_token_2022.update_token_group_max_size";
"spl.token_2022.update_token_group_max_size";
/// Stable operation code for initializing an embedded token-group member.
pub const EX_SPL_TOKEN_2022_INITIALIZE_TOKEN_GROUP_MEMBER_OPERATION: &str =
"spl_token_2022.initialize_token_group_member";
"spl.token_2022.initialize_token_group_member";
/// Stable operation code for initializing scaled UI amounts.
pub const EX_SPL_TOKEN_2022_INITIALIZE_SCALED_UI_AMOUNT_OPERATION: &str =
"spl_token_2022.initialize_scaled_ui_amount";
"spl.token_2022.initialize_scaled_ui_amount";
/// Stable operation code for scheduling a scaled UI multiplier update.
pub const EX_SPL_TOKEN_2022_UPDATE_SCALED_UI_AMOUNT_MULTIPLIER_OPERATION: &str =
"spl_token_2022.update_scaled_ui_amount_multiplier";
"spl.token_2022.update_scaled_ui_amount_multiplier";
/// Stable operation code for initializing pausable mint state.
pub const EX_SPL_TOKEN_2022_INITIALIZE_PAUSABLE_CONFIG_OPERATION: &str =
"spl_token_2022.initialize_pausable_config";
"spl.token_2022.initialize_pausable_config";
/// Stable operation code for pausing mint activity.
pub const EX_SPL_TOKEN_2022_PAUSE_OPERATION: &str = "spl_token_2022.pause";
pub const EX_SPL_TOKEN_2022_PAUSE_OPERATION: &str = "spl.token_2022.pause";
/// Stable operation code for resuming mint activity.
pub const EX_SPL_TOKEN_2022_RESUME_OPERATION: &str = "spl_token_2022.resume";
pub const EX_SPL_TOKEN_2022_RESUME_OPERATION: &str = "spl.token_2022.resume";
/// Stable operation code for initializing permissioned burn.
pub const EX_SPL_TOKEN_2022_INITIALIZE_PERMISSIONED_BURN_OPERATION: &str =
"spl_token_2022.initialize_permissioned_burn";
"spl.token_2022.initialize_permissioned_burn";
/// Stable operation code for a permissioned burn.
pub const EX_SPL_TOKEN_2022_PERMISSIONED_BURN_OPERATION: &str = "spl_token_2022.permissioned_burn";
pub const EX_SPL_TOKEN_2022_PERMISSIONED_BURN_OPERATION: &str = "spl.token_2022.permissioned_burn";
/// Stable operation code for a checked permissioned burn.
pub const EX_SPL_TOKEN_2022_PERMISSIONED_BURN_CHECKED_OPERATION: &str =
"spl_token_2022.permissioned_burn_checked";
"spl.token_2022.permissioned_burn_checked";
/// Stable operation code for initializing Confidential Transfer mint configuration.
pub const EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_MINT_OPERATION: &str =
"spl_token_2022.initialize_confidential_transfer_mint";
"spl.token_2022.initialize_confidential_transfer_mint";
/// Stable operation code for updating Confidential Transfer mint configuration.
pub const EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_TRANSFER_MINT_OPERATION: &str =
"spl_token_2022.update_confidential_transfer_mint";
"spl.token_2022.update_confidential_transfer_mint";
/// Stable operation code for applying pending confidential balance credits.
pub const EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BALANCE_OPERATION: &str =
"spl_token_2022.apply_pending_confidential_balance";
"spl.token_2022.apply_pending_confidential_balance";
/// Stable operation code for approving a configured confidential account.
pub const EX_SPL_TOKEN_2022_APPROVE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION: &str =
"spl_token_2022.approve_confidential_transfer_account";
"spl.token_2022.approve_confidential_transfer_account";
/// Stable operation code for depositing public tokens into a confidential pending balance.
pub const EX_SPL_TOKEN_2022_DEPOSIT_CONFIDENTIAL_TOKENS_OPERATION: &str =
"spl_token_2022.deposit_confidential_tokens";
"spl.token_2022.deposit_confidential_tokens";
/// Stable operation code for enabling incoming confidential credits.
pub const EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_CREDITS_OPERATION: &str =
"spl_token_2022.enable_confidential_credits";
"spl.token_2022.enable_confidential_credits";
/// Stable operation code for disabling incoming confidential credits.
pub const EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_CREDITS_OPERATION: &str =
"spl_token_2022.disable_confidential_credits";
"spl.token_2022.disable_confidential_credits";
/// Stable operation code for enabling incoming non-confidential credits.
pub const EX_SPL_TOKEN_2022_ENABLE_NON_CONFIDENTIAL_CREDITS_OPERATION: &str =
"spl_token_2022.enable_non_confidential_credits";
"spl.token_2022.enable_non_confidential_credits";
/// Stable operation code for disabling incoming non-confidential credits.
pub const EX_SPL_TOKEN_2022_DISABLE_NON_CONFIDENTIAL_CREDITS_OPERATION: &str =
"spl_token_2022.disable_non_confidential_credits";
"spl.token_2022.disable_non_confidential_credits";
/// Stable operation code for configuring one confidential token account.
pub const EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION: &str =
"spl_token_2022.configure_confidential_transfer_account";
"spl.token_2022.configure_confidential_transfer_account";
/// Stable operation code for configuring one confidential token account through the registry.
pub const EX_SPL_TOKEN_2022_CONFIGURE_CONFIDENTIAL_TRANSFER_ACCOUNT_WITH_REGISTRY_OPERATION: &str =
"spl_token_2022.configure_confidential_transfer_account_with_registry";
"spl.token_2022.configure_confidential_transfer_account_with_registry";
/// Stable operation code for emptying a confidential available balance before close.
pub const EX_SPL_TOKEN_2022_EMPTY_CONFIDENTIAL_TRANSFER_ACCOUNT_OPERATION: &str =
"spl_token_2022.empty_confidential_transfer_account";
"spl.token_2022.empty_confidential_transfer_account";
/// Stable operation code for withdrawing confidential balance into public balance.
pub const EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_TOKENS_OPERATION: &str =
"spl_token_2022.withdraw_confidential_tokens";
"spl.token_2022.withdraw_confidential_tokens";
/// Stable operation code for transferring confidential tokens.
pub const EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_OPERATION: &str =
"spl_token_2022.transfer_confidential_tokens";
"spl.token_2022.transfer_confidential_tokens";
/// Stable operation code for confidential transfer with fee.
pub const EX_SPL_TOKEN_2022_TRANSFER_CONFIDENTIAL_TOKENS_WITH_FEE_OPERATION: &str =
"spl_token_2022.transfer_confidential_tokens_with_fee";
"spl.token_2022.transfer_confidential_tokens_with_fee";
/// Stable operation code for initializing confidential transfer fee configuration.
pub const EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_TRANSFER_FEE_CONFIG_OPERATION: &str =
"spl_token_2022.initialize_confidential_transfer_fee_config";
"spl.token_2022.initialize_confidential_transfer_fee_config";
/// Stable operation code for enabling confidential fee harvest to the mint.
pub const EX_SPL_TOKEN_2022_ENABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION: &str =
"spl_token_2022.enable_confidential_transfer_fee_harvest";
"spl.token_2022.enable_confidential_transfer_fee_harvest";
/// Stable operation code for disabling confidential fee harvest to the mint.
pub const EX_SPL_TOKEN_2022_DISABLE_CONFIDENTIAL_TRANSFER_FEE_HARVEST_OPERATION: &str =
"spl_token_2022.disable_confidential_transfer_fee_harvest";
"spl.token_2022.disable_confidential_transfer_fee_harvest";
/// Stable operation code for harvesting confidential withheld fees to the mint.
pub const EX_SPL_TOKEN_2022_HARVEST_CONFIDENTIAL_WITHHELD_TOKENS_TO_MINT_OPERATION: &str =
"spl_token_2022.harvest_confidential_withheld_tokens_to_mint";
"spl.token_2022.harvest_confidential_withheld_tokens_to_mint";
/// Stable operation code for withdrawing confidential withheld fees from the mint.
pub const EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_MINT_OPERATION: &str =
"spl_token_2022.withdraw_confidential_withheld_tokens_from_mint";
"spl.token_2022.withdraw_confidential_withheld_tokens_from_mint";
/// Stable operation code for withdrawing confidential withheld fees from token accounts.
pub const EX_SPL_TOKEN_2022_WITHDRAW_CONFIDENTIAL_WITHHELD_TOKENS_FROM_ACCOUNTS_OPERATION: &str =
"spl_token_2022.withdraw_confidential_withheld_tokens_from_accounts";
"spl.token_2022.withdraw_confidential_withheld_tokens_from_accounts";
/// Stable operation code for initializing confidential mint and burn.
pub const EX_SPL_TOKEN_2022_INITIALIZE_CONFIDENTIAL_MINT_BURN_MINT_OPERATION: &str =
"spl_token_2022.initialize_confidential_mint_burn_mint";
"spl.token_2022.initialize_confidential_mint_burn_mint";
/// Stable operation code for rotating the confidential supply ElGamal public key.
pub const EX_SPL_TOKEN_2022_ROTATE_CONFIDENTIAL_SUPPLY_ELGAMAL_PUBKEY_OPERATION: &str =
"spl_token_2022.rotate_confidential_supply_elgamal_pubkey";
"spl.token_2022.rotate_confidential_supply_elgamal_pubkey";
/// Stable operation code for updating the decryptable confidential supply.
pub const EX_SPL_TOKEN_2022_UPDATE_CONFIDENTIAL_DECRYPTABLE_SUPPLY_OPERATION: &str =
"spl_token_2022.update_confidential_decryptable_supply";
"spl.token_2022.update_confidential_decryptable_supply";
/// Stable operation code for applying pending confidential burns.
pub const EX_SPL_TOKEN_2022_APPLY_PENDING_CONFIDENTIAL_BURN_OPERATION: &str =
"spl_token_2022.apply_pending_confidential_burn";
"spl.token_2022.apply_pending_confidential_burn";
/// Stable operation code for confidential minting.
pub const EX_SPL_TOKEN_2022_CONFIDENTIAL_MINT_OPERATION: &str = "spl_token_2022.confidential_mint";
pub const EX_SPL_TOKEN_2022_CONFIDENTIAL_MINT_OPERATION: &str = "spl.token_2022.confidential_mint";
/// Stable operation code for confidential burning.
pub const EX_SPL_TOKEN_2022_CONFIDENTIAL_BURN_OPERATION: &str = "spl_token_2022.confidential_burn";
pub const EX_SPL_TOKEN_2022_CONFIDENTIAL_BURN_OPERATION: &str = "spl.token_2022.confidential_burn";
/// Stable operation code for permissioned confidential burning.
pub const EX_SPL_TOKEN_2022_PERMISSIONED_CONFIDENTIAL_BURN_OPERATION: &str =
"spl_token_2022.permissioned_confidential_burn";
"spl.token_2022.permissioned_confidential_burn";
/// Stable operation code for a recent bounded batch.
pub const EX_SPL_TOKEN_2022_BATCH_OPERATION: &str = "spl_token_2022.batch";
pub const EX_SPL_TOKEN_2022_BATCH_OPERATION: &str = "spl.token_2022.batch";
/// Operation codes constructible by this executor.
pub const EX_SPL_TOKEN_2022_SUPPORTED_OPERATION_CODES: &[&str] = &[

View File

@@ -1,11 +1,15 @@
// file: kb-lib/src/executor/staking.rs
// version: 2
// version: 3
//! `staking` executor family.
mod jito_tip_distribution;
mod kamino_farm;
mod marinade_finance;
mod solayer;
/// Exposes the reserved `staking/jito_tip_distribution` executor.
pub use self::jito_tip_distribution::ExStakingJitoTipDistributionExecutor;
/// Exposes the reserved `staking/kamino_farm` executor.
pub use self::kamino_farm::ExStakingKaminoFarmExecutor;
/// Exposes the reserved `staking/marinade_finance` executor.

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/staking/jito_tip_distribution.rs
// version: 1
//! Reserved executor for `staking_jito_tip_distribution`.
/// Reserved executor for the `staking_jito_tip_distribution` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExStakingJitoTipDistributionExecutor;
impl crate::ExApiInstructionExecutor for crate::ExStakingJitoTipDistributionExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.staking.jito_tip_distribution";
}
fn executor_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_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"staking_jito_tip_distribution"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.staking.jito_tip_distribution".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -0,0 +1,9 @@
// file: kb-lib/src/executor/storage.rs
// version: 3
//! `storage` executor family.
mod solana_record;
/// Exposes the reserved `storage/solana_record` executor.
pub use self::solana_record::ExStorageSolanaRecordExecutor;

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/storage/solana_record.rs
// version: 1
//! Reserved executor for `storage_solana_record`.
/// Reserved executor for the `storage_solana_record` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExStorageSolanaRecordExecutor;
impl crate::ExApiInstructionExecutor for crate::ExStorageSolanaRecordExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.storage.solana_record";
}
fn executor_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_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"storage_solana_record"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.storage.solana_record".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -0,0 +1,9 @@
// file: kb-lib/src/executor/strategy.rs
// version: 3
//! `strategy` executor family.
mod jupiter_dca;
/// Exposes the reserved `strategy/jupiter_dca` executor.
pub use self::jupiter_dca::ExStrategyJupiterDcaExecutor;

View File

@@ -0,0 +1,49 @@
// file: kb-lib/src/executor/strategy/jupiter_dca.rs
// version: 3
//! Reserved executor for `strategy_jupiter_dca`.
/// Reserved executor for the `strategy_jupiter_dca` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExStrategyJupiterDcaExecutor;
impl crate::ExApiInstructionExecutor for crate::ExStrategyJupiterDcaExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.strategy.jupiter_dca";
}
fn executor_version(&self) -> &'static str {
return env!("CARGO_PKG_VERSION");
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::STRATEGY_JUPITER_DCA_PROGRAM_ID];
}
fn supports_request(
&self,
request: &crate::ExApiExecutionRequest,
) -> crate::ExApiExecutionSupport {
if crate::ExApiInstructionExecutor::handles_program_id(self, &request.program_id) {
return crate::ExApiExecutionSupport::Maybe;
}
return crate::ExApiExecutionSupport::No;
}
fn build_plan(
&self,
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"strategy_jupiter_dca"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.strategy.jupiter_dca".to_string(),
instruction_count: 0,
payload_json,
});
}
}

View File

@@ -1,8 +1,12 @@
// file: kb-lib/src/executor/vesting.rs
// version: 2
// version: 3
//! `vesting` executor family.
mod jupiter_lock;
mod streamflow;
/// Exposes the reserved `vesting/jupiter_lock` executor.
pub use self::jupiter_lock::ExVestingJupiterLockExecutor;
/// Exposes the reserved `vesting/streamflow` executor.
pub use self::streamflow::ExVestingStreamflowExecutor;

View File

@@ -1,15 +1,15 @@
// file: kb-lib/src/executor/admin/jupiter_lock.rs
// file: kb-lib/src/executor/vesting/jupiter_lock.rs
// version: 3
//! Reserved executor for `admin_jupiter_lock`.
//! Reserved executor for `vesting_jupiter_lock`.
/// Reserved executor for the `admin_jupiter_lock` program surface.
/// Reserved executor for the `vesting_jupiter_lock` program surface.
#[derive(Clone, Debug, Default)]
pub struct ExAdminJupiterLockExecutor;
pub struct ExVestingJupiterLockExecutor;
impl crate::ExApiInstructionExecutor for crate::ExAdminJupiterLockExecutor {
impl crate::ExApiInstructionExecutor for crate::ExVestingJupiterLockExecutor {
fn executor_name(&self) -> &'static str {
return "kb-lib.executor.admin.jupiter_lock";
return "kb-lib.executor.vesting.jupiter_lock";
}
fn executor_version(&self) -> &'static str {
@@ -17,7 +17,7 @@ impl crate::ExApiInstructionExecutor for crate::ExAdminJupiterLockExecutor {
}
fn program_ids(&self) -> &'static [&'static str] {
return &[kb_program_ids::ADMIN_JUPITER_LOCK_PROGRAM_ID];
return &[kb_program_ids::VESTING_JUPITER_LOCK_PROGRAM_ID];
}
fn supports_request(
@@ -35,13 +35,13 @@ impl crate::ExApiInstructionExecutor for crate::ExAdminJupiterLockExecutor {
_request: &crate::ExApiExecutionRequest,
) -> kb_core::Result<crate::ExApiExecutionPlan> {
let payload_json = match crate::executor_api_serialize_payload_json(
&serde_json::json!({"status":"reserved_executor","surface":"admin_jupiter_lock"}),
&serde_json::json!({"status":"reserved_executor","surface":"vesting_jupiter_lock"}),
) {
std::result::Result::Ok(serialized) => serialized,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(crate::ExApiExecutionPlan {
executor_name: "kb-lib.executor.admin.jupiter_lock".to_string(),
executor_name: "kb-lib.executor.vesting.jupiter_lock".to_string(),
instruction_count: 0,
payload_json,
});

View File

@@ -19,10 +19,9 @@ pub use self::decoder::DC_METADATA_MTM_METADATA_ACCOUNT_LAYOUT_AUDIT;
pub use self::decoder::DC_SPL_ELGAMAL_REGISTRY_ACCOUNT_LEN;
/// Reserved `kb-lib.decoder.adapter.saber_decimal_wrapper` decoder.
pub use self::decoder::DcAdapterSaberDecimalWrapperDecoder;
/// Reserved `kb-lib.decoder.admin.jupiter_lock` decoder.
pub use self::decoder::DcAdminJupiterLockDecoder;
/// Reserved `kb-lib.decoder.admin.pump_fees` decoder.
pub use self::decoder::DcAdminPumpFeesDecoder;
/// Approve Collection Authority discriminator.
/// Exposes the reserved `DcAdapterSplTokenWrapDecoder` implementation.
pub use self::decoder::DcAdapterSplTokenWrapDecoder;
/// Reserved `kb-lib.decoder.amm.aldrin_v1` decoder.
pub use self::decoder::DcAmmAldrinV1Decoder;
/// Reserved `kb-lib.decoder.amm.aldrin_v2` decoder.
@@ -45,8 +44,6 @@ pub use self::decoder::DcAmmGoosefxV2Decoder;
pub use self::decoder::DcAmmGuacSwapDecoder;
/// Reserved `kb-lib.decoder.amm.lifinity_swap_v2` decoder.
pub use self::decoder::DcAmmLifinitySwapV2Decoder;
/// Reserved `kb-lib.decoder.amm.metadao_futarchy_amm` decoder.
pub use self::decoder::DcAmmMetadaoFutarchyAmmDecoder;
/// Reserved `kb-lib.decoder.amm.metadao_v0_5` decoder.
pub use self::decoder::DcAmmMetadaoV05Decoder;
/// Reserved `kb-lib.decoder.amm.meteora_damm_v1` decoder.
@@ -67,8 +64,6 @@ pub use self::decoder::DcAmmSolfiDecoder;
pub use self::decoder::DcAmmSolfiV2Decoder;
/// Reserved `kb-lib.decoder.amm.vertigo` decoder.
pub use self::decoder::DcAmmVertigoDecoder;
/// Reserved `kb-lib.decoder.amm.virtuals` decoder.
pub use self::decoder::DcAmmVirtualsDecoder;
/// Reserved `kb-lib.decoder.amm.woofi` decoder.
pub use self::decoder::DcAmmWoofiDecoder;
/// Reserved `kb-lib.decoder.amm.zero_fi` decoder.
@@ -135,8 +130,14 @@ pub use self::decoder::DcDlmmMeteoraDecoder;
pub use self::decoder::DcFeesBagsFeeShareV1Decoder;
/// Reserved `kb-lib.decoder.fees.bags_fee_share_v2` decoder.
pub use self::decoder::DcFeesBagsFeeShareV2Decoder;
/// Reserved `kb-lib.decoder.admin.pump_fees` decoder.
pub use self::decoder::DcFeesPumpFeesDecoder;
/// Reserved `kb-lib.decoder.governance.metadao_bid_wall` decoder.
pub use self::decoder::DcGovernanceMetadaoBidWallDecoder;
/// Reserved `kb-lib.decoder.amm.metadao_futarchy_amm` decoder.
pub use self::decoder::DcGovernanceMetadaoFutarchyDecoder;
/// Exposes the reserved `DcGovernanceSquadsMultisigDecoder` implementation.
pub use self::decoder::DcGovernanceSquadsMultisigDecoder;
/// Reserved `kb-lib.decoder.launchpad.boop_fun` decoder.
pub use self::decoder::DcLaunchpadBoopFunDecoder;
/// Reserved `kb-lib.decoder.launchpad.metadao_ico` decoder.
@@ -155,6 +156,8 @@ pub use self::decoder::DcLaunchpadPumpFunDecoder;
pub use self::decoder::DcLaunchpadPumpPumpupAiDecoder;
/// Reserved `kb-lib.decoder.launchpad.raydium_launchlab` decoder.
pub use self::decoder::DcLaunchpadRaydiumLaunchlabDecoder;
/// Reserved `kb-lib.decoder.amm.virtuals` decoder.
pub use self::decoder::DcLaunchpadVirtualsDecoder;
/// Reserved `kb-lib.decoder.lending.clone` decoder.
pub use self::decoder::DcLendingCloneDecoder;
/// Reserved `kb-lib.decoder.lending.jupiter_lend_borrow` decoder.
@@ -219,10 +222,14 @@ pub use self::decoder::DcMetadataMtmTokenOwnedEscrowAccountSnapshot;
pub use self::decoder::DcMetadataMtmTokenOwnedEscrowAuthorityKind;
/// Canonical bounded projection of one programmable Token Record account.
pub use self::decoder::DcMetadataMtmTokenRecordAccountSnapshot;
/// Exposes the reserved `DcMetadataSolanaProgramMetadataDecoder` implementation.
pub use self::decoder::DcMetadataSolanaProgramMetadataDecoder;
/// Reserved `kb-lib.decoder.metadata.spl_name_service` decoder.
pub use self::decoder::DcMetadataSplNameServiceDecoder;
/// Reserved `kb-lib.decoder.nft.metaplex_bubblegum` decoder.
pub use self::decoder::DcNftMetaplexBubblegumDecoder;
/// Exposes the reserved `DcNftTensorCnftDecoder` implementation.
pub use self::decoder::DcNftTensorCnftDecoder;
/// Reserved `kb-lib.decoder.orderbook.jupiter_limit_order` decoder.
pub use self::decoder::DcOrderbookJupiterLimitOrderDecoder;
/// Reserved `kb-lib.decoder.orderbook.jupiter_limit_order_v2` decoder.
@@ -233,6 +240,8 @@ pub use self::decoder::DcOrderbookOpenbookV2Decoder;
pub use self::decoder::DcPerpetualsDriftV2Decoder;
/// Reserved `kb-lib.decoder.perpetuals.jupiter` decoder.
pub use self::decoder::DcPerpetualsJupiterDecoder;
/// Exposes the reserved `DcPerpetualsPhoenixEternalDecoder` implementation.
pub use self::decoder::DcPerpetualsPhoenixEternalDecoder;
/// Reserved `kb-lib.decoder.perpetuals.zeta` decoder.
pub use self::decoder::DcPerpetualsZetaDecoder;
/// Reserved `kb-lib.decoder.router.dflow_aggregator_v4` decoder.
@@ -241,8 +250,6 @@ pub use self::decoder::DcRouterDflowAggregatorV4Decoder;
pub use self::decoder::DcRouterJupiterAggregatorV4Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_aggregator_v6` decoder.
pub use self::decoder::DcRouterJupiterAggregatorV6Decoder;
/// Reserved `kb-lib.decoder.router.jupiter_dca` decoder.
pub use self::decoder::DcRouterJupiterDcaDecoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v1` decoder.
pub use self::decoder::DcRouterOkxLabsV1Decoder;
/// Reserved `kb-lib.decoder.router.okx_labs_v2` decoder.
@@ -279,12 +286,18 @@ pub use self::decoder::DcStableSwapJupiterStableDecoder;
pub use self::decoder::DcStableSwapNumeraireDecoder;
/// Reserved `kb-lib.decoder.stable.swap_stabble` decoder.
pub use self::decoder::DcStableSwapStabbleDecoder;
/// Exposes the reserved `DcStakingJitoTipDistributionDecoder` implementation.
pub use self::decoder::DcStakingJitoTipDistributionDecoder;
/// Reserved `kb-lib.decoder.staking.kamino_farm` decoder.
pub use self::decoder::DcStakingKaminoFarmDecoder;
/// Reserved `kb-lib.decoder.staking.marinade_finance` decoder.
pub use self::decoder::DcStakingMarinadeFinanceDecoder;
/// Reserved `kb-lib.decoder.staking.solayer` decoder.
pub use self::decoder::DcStakingSolayerDecoder;
/// Exposes the reserved `DcStorageSolanaRecordDecoder` implementation.
pub use self::decoder::DcStorageSolanaRecordDecoder;
/// Reserved `kb-lib.decoder.router.jupiter_dca` decoder.
pub use self::decoder::DcStrategyJupiterDcaDecoder;
/// Parsed Token-2022 Mint, Account, or Multisig state.
pub use self::decoder::DcToken2022State;
/// Exact Token-2022 base account state kind.
@@ -305,6 +318,8 @@ pub use self::decoder::DcVaultKaminoV2Decoder;
pub use self::decoder::DcVaultKaminoYvaultsDecoder;
/// Reserved `kb-lib.decoder.vault.meteora` decoder.
pub use self::decoder::DcVaultMeteoraDecoder;
/// Reserved `kb-lib.decoder.admin.jupiter_lock` decoder.
pub use self::decoder::DcVestingJupiterLockDecoder;
/// Reserved `kb-lib.decoder.vesting.streamflow` decoder.
pub use self::decoder::DcVestingStreamflowDecoder;
/// Reserved `kb-lib.decoder.wallet.jupiter_apepro_smart_wallet` decoder.
@@ -833,10 +848,8 @@ pub use self::executor::EX_SPL_TOKEN_UNWRAP_LAMPORTS_OPERATION;
pub use self::executor::EX_SPL_TOKEN_WITHDRAW_EXCESS_LAMPORTS_OPERATION;
/// Exposes the reserved `ExAdapterSaberDecimalWrapperExecutor` implementation.
pub use self::executor::ExAdapterSaberDecimalWrapperExecutor;
/// Exposes the reserved `ExAdminJupiterLockExecutor` implementation.
pub use self::executor::ExAdminJupiterLockExecutor;
/// Exposes the reserved `ExAdminPumpFeesExecutor` implementation.
pub use self::executor::ExAdminPumpFeesExecutor;
/// Exposes the reserved `ExAdapterSplTokenWrapExecutor` implementation.
pub use self::executor::ExAdapterSplTokenWrapExecutor;
/// Exposes the reserved `ExAmmAldrinV1Executor` implementation.
pub use self::executor::ExAmmAldrinV1Executor;
/// Exposes the reserved `ExAmmAldrinV2Executor` implementation.
@@ -859,8 +872,6 @@ pub use self::executor::ExAmmGoosefxV2Executor;
pub use self::executor::ExAmmGuacSwapExecutor;
/// Exposes the reserved `ExAmmLifinitySwapV2Executor` implementation.
pub use self::executor::ExAmmLifinitySwapV2Executor;
/// Exposes the reserved `ExAmmMetadaoFutarchyAmmExecutor` implementation.
pub use self::executor::ExAmmMetadaoFutarchyAmmExecutor;
/// Exposes the reserved `ExAmmMetadaoV05Executor` implementation.
pub use self::executor::ExAmmMetadaoV05Executor;
/// Exposes the reserved `ExAmmMeteoraDammV1Executor` implementation.
@@ -881,8 +892,6 @@ pub use self::executor::ExAmmSolfiExecutor;
pub use self::executor::ExAmmSolfiV2Executor;
/// Exposes the reserved `ExAmmVertigoExecutor` implementation.
pub use self::executor::ExAmmVertigoExecutor;
/// Exposes the reserved `ExAmmVirtualsExecutor` implementation.
pub use self::executor::ExAmmVirtualsExecutor;
/// Exposes the reserved `ExAmmWoofiExecutor` implementation.
pub use self::executor::ExAmmWoofiExecutor;
/// Exposes the reserved `ExAmmZeroFiExecutor` implementation.
@@ -963,8 +972,14 @@ pub use self::executor::ExDlmmMeteoraExecutor;
pub use self::executor::ExFeesBagsFeeShareV1Executor;
/// Exposes the reserved `ExFeesBagsFeeShareV2Executor` implementation.
pub use self::executor::ExFeesBagsFeeShareV2Executor;
/// Exposes the reserved `ExFeesPumpFeesExecutor` implementation.
pub use self::executor::ExFeesPumpFeesExecutor;
/// Exposes the reserved `ExGovernanceMetadaoBidWallExecutor` implementation.
pub use self::executor::ExGovernanceMetadaoBidWallExecutor;
/// Exposes the reserved `ExGovernanceMetadaoFutarchyExecutor` implementation.
pub use self::executor::ExGovernanceMetadaoFutarchyExecutor;
/// Exposes the reserved `ExGovernanceSquadsMultisigExecutor` implementation.
pub use self::executor::ExGovernanceSquadsMultisigExecutor;
/// Exposes the reserved `ExLaunchpadBoopFunExecutor` implementation.
pub use self::executor::ExLaunchpadBoopFunExecutor;
/// Exposes the reserved `ExLaunchpadMetadaoIcoExecutor` implementation.
@@ -983,6 +998,8 @@ pub use self::executor::ExLaunchpadPumpFunExecutor;
pub use self::executor::ExLaunchpadPumpPumpupAiExecutor;
/// Exposes the reserved `ExLaunchpadRaydiumLaunchlabExecutor` implementation.
pub use self::executor::ExLaunchpadRaydiumLaunchlabExecutor;
/// Exposes the reserved `ExLaunchpadVirtualsExecutor` implementation.
pub use self::executor::ExLaunchpadVirtualsExecutor;
/// Exposes the reserved `ExLendingCloneExecutor` implementation.
pub use self::executor::ExLendingCloneExecutor;
/// Exposes the reserved `ExLendingJupiterLendBorrowExecutor` implementation.
@@ -1001,10 +1018,14 @@ pub use self::executor::ExLendingMarginfiV2Executor;
pub use self::executor::ExLockRaydiumLpExecutor;
/// Exposes the reserved `ExMetadataMetaplexTokenMetadataExecutor` implementation.
pub use self::executor::ExMetadataMetaplexTokenMetadataExecutor;
/// Exposes the reserved `ExMetadataSolanaProgramMetadataExecutor` implementation.
pub use self::executor::ExMetadataSolanaProgramMetadataExecutor;
/// Exposes the reserved `ExMetadataSplNameServiceExecutor` implementation.
pub use self::executor::ExMetadataSplNameServiceExecutor;
/// Exposes the reserved `ExNftMetaplexBubblegumExecutor` implementation.
pub use self::executor::ExNftMetaplexBubblegumExecutor;
/// Exposes the reserved `ExNftTensorCnftExecutor` implementation.
pub use self::executor::ExNftTensorCnftExecutor;
/// Exposes the reserved `ExOrderbookJupiterLimitOrderExecutor` implementation.
pub use self::executor::ExOrderbookJupiterLimitOrderExecutor;
/// Exposes the reserved `ExOrderbookJupiterLimitOrderV2Executor` implementation.
@@ -1015,6 +1036,8 @@ pub use self::executor::ExOrderbookOpenbookV2Executor;
pub use self::executor::ExPerpetualsDriftV2Executor;
/// Exposes the reserved `ExPerpetualsJupiterExecutor` implementation.
pub use self::executor::ExPerpetualsJupiterExecutor;
/// Exposes the reserved `ExPerpetualsPhoenixEternalExecutor` implementation.
pub use self::executor::ExPerpetualsPhoenixEternalExecutor;
/// Exposes the reserved `ExPerpetualsZetaExecutor` implementation.
pub use self::executor::ExPerpetualsZetaExecutor;
/// Exposes the reserved `ExRouterDflowAggregatorV4Executor` implementation.
@@ -1023,8 +1046,6 @@ pub use self::executor::ExRouterDflowAggregatorV4Executor;
pub use self::executor::ExRouterJupiterAggregatorV4Executor;
/// Exposes the reserved `ExRouterJupiterAggregatorV6Executor` implementation.
pub use self::executor::ExRouterJupiterAggregatorV6Executor;
/// Exposes the reserved `ExRouterJupiterDcaExecutor` implementation.
pub use self::executor::ExRouterJupiterDcaExecutor;
/// Exposes the reserved `ExRouterOkxLabsV1Executor` implementation.
pub use self::executor::ExRouterOkxLabsV1Executor;
/// Exposes the reserved `ExRouterOkxLabsV2Executor` implementation.
@@ -1169,12 +1190,18 @@ pub use self::executor::ExStableSwapJupiterStableExecutor;
pub use self::executor::ExStableSwapNumeraireExecutor;
/// Exposes the reserved `ExStableSwapStabbleExecutor` implementation.
pub use self::executor::ExStableSwapStabbleExecutor;
/// Exposes the reserved `ExStakingJitoTipDistributionExecutor` implementation.
pub use self::executor::ExStakingJitoTipDistributionExecutor;
/// Exposes the reserved `ExStakingKaminoFarmExecutor` implementation.
pub use self::executor::ExStakingKaminoFarmExecutor;
/// Exposes the reserved `ExStakingMarinadeFinanceExecutor` implementation.
pub use self::executor::ExStakingMarinadeFinanceExecutor;
/// Exposes the reserved `ExStakingSolayerExecutor` implementation.
pub use self::executor::ExStakingSolayerExecutor;
/// Exposes the reserved `ExStorageSolanaRecordExecutor` implementation.
pub use self::executor::ExStorageSolanaRecordExecutor;
/// Exposes the reserved `ExStrategyJupiterDcaExecutor` implementation.
pub use self::executor::ExStrategyJupiterDcaExecutor;
/// Exposes the reserved `ExTreasuryHeliumTreasuryManagementExecutor` implementation.
pub use self::executor::ExTreasuryHeliumTreasuryManagementExecutor;
/// Exposes the reserved `ExVaultCarrotDefiExecutor` implementation.
@@ -1189,6 +1216,8 @@ pub use self::executor::ExVaultKaminoV2Executor;
pub use self::executor::ExVaultKaminoYvaultsExecutor;
/// Exposes the reserved `ExVaultMeteoraExecutor` implementation.
pub use self::executor::ExVaultMeteoraExecutor;
/// Exposes the reserved `ExVestingJupiterLockExecutor` implementation.
pub use self::executor::ExVestingJupiterLockExecutor;
/// Exposes the reserved `ExVestingStreamflowExecutor` implementation.
pub use self::executor::ExVestingStreamflowExecutor;
/// Exposes the reserved `ExWalletJupiterApeproSmartWalletExecutor` implementation.

View File

@@ -1,9 +1,9 @@
// file: kb-lib/src/materializer/admin/constants.rs
// version: 2
// version: 3
//! Local constants for the native and SPL administration materializer.
/// Canonical processor name for this component.
pub(crate) const MT_ADMIN_PROCESSOR_NAME: &str = "solana_native_admin";
pub(crate) const MT_ADMIN_PROCESSOR_NAME: &str = "materializer.admin";
/// Canonical tracing target for this component.
pub(crate) const TRACING_TARGET_MATERIALIZER_ADMIN: &str = "kb-lib.materializer.admin";

View File

@@ -1,21 +1,21 @@
// file: kb-lib/src/materializer/admin/core.rs
// version: 19
// version: 20
//! Stable administrative projections derived from exact committed observations.
const ACCEPTED_FAMILIES: &[crate::MdEventFamily] =
&[crate::MdEventFamily::Admin, crate::MdEventFamily::TokenAccount];
const SYSTEM_SURFACE: &str = "solana_native_system";
const SYSTEM_SURFACE: &str = "solana.core.system";
const SYSTEM_ENTRIES: &[&str] = &["assign", "assign_with_seed"];
const CONFIG_SURFACE: &str = "solana_native_config";
const CONFIG_SURFACE: &str = "solana.core.config";
const CONFIG_ENTRIES: &[&str] = &["store"];
const BPF_LOADER_UPGRADEABLE_SURFACE: &str = "solana_native_bpf_loader_upgradeable";
const BPF_LOADER_UPGRADEABLE_SURFACE: &str = "solana.core.bpf_loader_upgradeable";
const BPF_LOADER_UPGRADEABLE_ENTRIES: &[&str] = &["set_authority", "set_authority_checked"];
const LOADER_V4_SURFACE: &str = "solana_native_loader_v4";
const LOADER_V4_SURFACE: &str = "solana.core.loader_v4";
const LOADER_V4_ENTRIES: &[&str] = &["transfer_authority"];
const SPL_TOKEN_SURFACE: &str = "spl_token";
const SPL_TOKEN_2022_SURFACE: &str = "spl_token_2022";
const SPL_ELGAMAL_REGISTRY_SURFACE: &str = "spl_elgamal_registry";
const SPL_TOKEN_SURFACE: &str = "spl.token";
const SPL_TOKEN_2022_SURFACE: &str = "spl.token_2022";
const SPL_ELGAMAL_REGISTRY_SURFACE: &str = "spl.elgamal_registry";
const SPL_ELGAMAL_REGISTRY_ENTRIES: &[&str] = &["create_registry", "update_registry"];
const SPL_TOKEN_AUTHORITY_ENTRIES: &[&str] = &[
"set_authority",
@@ -56,7 +56,7 @@ impl ProjectionKind {
Self::ProgramLoaderAuthority(_) => "program_loader_authority",
Self::SplTokenAuthority => "spl_token_authority",
Self::SplTokenMultisig => "spl_token_multisig",
Self::SplElgamalRegistry => "spl_elgamal_registry",
Self::SplElgamalRegistry => "spl.elgamal_registry",
Self::SplToken2022ExtensionAdmin => "spl_token_2022_extension_admin",
};
}
@@ -118,7 +118,7 @@ impl crate::MtMaterializer for crate::MtAdminMaterializer {
impl crate::MtApiEventMaterializer for crate::MtAdminMaterializer {
fn identity(&self) -> crate::MtApiMaterializerIdentity {
return crate::MtApiMaterializerIdentity {
name: "solana_native_admin".to_string(),
name: "materializer.admin".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -505,7 +505,7 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("0".to_string()),
program_id: crate::MdProgramId("program-id".to_string()),
protocol_code: crate::MdProtocolCode("solana_native".to_string()),
protocol_code: crate::MdProtocolCode("solana.core".to_string()),
surface_code: crate::MdSurfaceCode(surface_code.to_string()),
event_code: crate::MdEventCode(format!("{surface_code}.{entry_code}")),
event_name: crate::MdEventName(entry_code.to_string()),
@@ -717,7 +717,7 @@ mod tests {
#[test]
fn ata_instructions_do_not_create_admin_outputs() {
let mut observation = observation(
"spl_associated_token_account",
"spl.associated_token_account",
"create",
false,
serde_json::json!([]),

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/materializer/compliance/audit.rs
// version: 9
// version: 10
//! Stable compliance-audit projections for committed native bytecode mutations and execution profiles.
const ACCEPTED_FAMILIES: &[crate::MdEventFamily] = &[crate::MdEventFamily::Audit];
const COMPUTE_BUDGET_SURFACE: &str = "solana_native_compute_budget";
const COMPUTE_BUDGET_SURFACE: &str = "solana.core.compute_budget";
const COMPUTE_BUDGET_ENTRIES: &[&str] = &[
"request_units_deprecated",
"request_heap_frame",
@@ -12,10 +12,10 @@ const COMPUTE_BUDGET_ENTRIES: &[&str] = &[
"set_compute_unit_price",
"set_loaded_accounts_data_size_limit",
];
const BPF_LOADER_DEPRECATED_SURFACE: &str = "solana_native_bpf_loader_deprecated";
const BPF_LOADER_SURFACE: &str = "solana_native_bpf_loader";
const BPF_LOADER_UPGRADEABLE_SURFACE: &str = "solana_native_bpf_loader_upgradeable";
const LOADER_V4_SURFACE: &str = "solana_native_loader_v4";
const BPF_LOADER_DEPRECATED_SURFACE: &str = "solana.core.bpf_loader_deprecated";
const BPF_LOADER_SURFACE: &str = "solana.core.bpf_loader";
const BPF_LOADER_UPGRADEABLE_SURFACE: &str = "solana.core.bpf_loader_upgradeable";
const LOADER_V4_SURFACE: &str = "solana.core.loader_v4";
const WRITE_ENTRIES: &[&str] = &["write"];
const LOADER_V4_COPY_ENTRIES: &[&str] = &["copy"];
@@ -77,7 +77,7 @@ impl crate::MtMaterializer for crate::MtComplianceAuditMaterializer {
impl crate::MtApiEventMaterializer for crate::MtComplianceAuditMaterializer {
fn identity(&self) -> crate::MtApiMaterializerIdentity {
return crate::MtApiMaterializerIdentity {
name: "solana_native_compliance_audit".to_string(),
name: "materializer.compliance.audit".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -357,7 +357,7 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("0".to_string()),
program_id: crate::MdProgramId("program-id".to_string()),
protocol_code: crate::MdProtocolCode("solana_native".to_string()),
protocol_code: crate::MdProtocolCode("solana.core".to_string()),
surface_code: crate::MdSurfaceCode(surface_code.to_string()),
event_code: crate::MdEventCode(format!("{surface_code}.{entry_code}")),
event_name: crate::MdEventName(entry_code.to_string()),
@@ -438,7 +438,7 @@ mod tests {
let result = crate::MtApiEventMaterializer::materialize(&materializer, &observation);
assert_eq!(
result.outputs[0].output_key,
"program_loader_code:solana_native_loader_v4:copy:0"
"program_loader_code:solana.core.loader_v4:copy:0"
);
assert_eq!(
result.outputs[0].payload_json["projection"]["sourceProgramAccount"],

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/materializer/fees/core.rs
// version: 4
// version: 5
//! Stable fee projections derived from exact committed Token-2022 observations.
const ACCEPTED_FAMILIES: &[crate::MdEventFamily] = &[crate::MdEventFamily::Fee];
const SPL_TOKEN_2022_SURFACE: &str = "spl_token_2022";
const SPL_TOKEN_2022_SURFACE: &str = "spl.token_2022";
const TOKEN_2022_FEE_ENTRIES: &[&str] = &[
"initialize_transfer_fee_config",
"set_transfer_fee",
@@ -46,7 +46,7 @@ impl crate::MtMaterializer for crate::MtFeesMaterializer {
impl crate::MtApiEventMaterializer for crate::MtFeesMaterializer {
fn identity(&self) -> crate::MtApiMaterializerIdentity {
return crate::MtApiMaterializerIdentity {
name: "fees".to_string(),
name: "materializer.fees".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -218,7 +218,7 @@ pub fn materializer_fees_materialize_token_2022_state_snapshots(
"confidentialValuesDecrypted": false,
"finalAccountStateCaptured": true,
"provenance": {
"processorName": "fees",
"processorName": "materializer.fees",
"processorVersion": env!("CARGO_PKG_VERSION"),
"source": "bounded_token_2022_state_parser"
}
@@ -243,7 +243,7 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("0".to_string()),
program_id: crate::MdProgramId(program_id.to_string()),
protocol_code: crate::MdProtocolCode("spl_token_2022".to_string()),
protocol_code: crate::MdProtocolCode("spl.token_2022".to_string()),
surface_code: crate::MdSurfaceCode(surface_code.to_string()),
event_code: crate::MdEventCode(format!("{surface_code}.{entry_code}")),
event_name: crate::MdEventName(entry_code.to_string()),
@@ -304,7 +304,7 @@ mod tests {
#[test]
fn classic_token_and_program_surface_mismatches_are_ignored() {
let classic = observation(
"spl_token",
"spl.token",
kb_program_ids::SPL_TOKEN_PROGRAM_ID,
"set_transfer_fee",
false,

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/materializer/lifecycle/core.rs
// version: 15
// version: 16
//! Stable lifecycle projections derived from exact decoded observations.
@@ -8,7 +8,7 @@ const ACCEPTED_FAMILIES: &[crate::MdEventFamily] = &[
crate::MdEventFamily::Admin,
crate::MdEventFamily::Audit,
];
const ADDRESS_LOOKUP_TABLE_SURFACE: &str = "solana_native_address_lookup_table";
const ADDRESS_LOOKUP_TABLE_SURFACE: &str = "solana.core.address_lookup_table";
const ADDRESS_LOOKUP_TABLE_ENTRIES: &[&str] = &[
"create_lookup_table",
"freeze_lookup_table",
@@ -16,11 +16,11 @@ const ADDRESS_LOOKUP_TABLE_ENTRIES: &[&str] = &[
"deactivate_lookup_table",
"close_lookup_table",
];
const BPF_LOADER_DEPRECATED_SURFACE: &str = "solana_native_bpf_loader_deprecated";
const BPF_LOADER_SURFACE: &str = "solana_native_bpf_loader";
const BPF_LOADER_UPGRADEABLE_SURFACE: &str = "solana_native_bpf_loader_upgradeable";
const LOADER_V4_SURFACE: &str = "solana_native_loader_v4";
const FEATURE_SURFACE: &str = "solana_native_feature";
const BPF_LOADER_DEPRECATED_SURFACE: &str = "solana.core.bpf_loader_deprecated";
const BPF_LOADER_SURFACE: &str = "solana.core.bpf_loader";
const BPF_LOADER_UPGRADEABLE_SURFACE: &str = "solana.core.bpf_loader_upgradeable";
const LOADER_V4_SURFACE: &str = "solana.core.loader_v4";
const FEATURE_SURFACE: &str = "solana.core.feature";
const FEATURE_ENTRIES: &[&str] = &["revoke_pending_activation"];
const IMMUTABLE_LOADER_ENTRIES: &[&str] = &["finalize"];
const UPGRADEABLE_LOADER_ENTRIES: &[&str] = &[
@@ -31,9 +31,9 @@ const UPGRADEABLE_LOADER_ENTRIES: &[&str] = &[
"extend_program",
];
const LOADER_V4_ENTRIES: &[&str] = &["set_program_length", "deploy", "retract", "finalize"];
const SLASHING_SURFACE: &str = "solana_native_slashing";
const SLASHING_SURFACE: &str = "solana.core.slashing";
const SLASHING_ENTRIES: &[&str] = &["close_violation_report", "duplicate_block_proof"];
const SYSTEM_SURFACE: &str = "solana_native_system";
const SYSTEM_SURFACE: &str = "solana.core.system";
const SYSTEM_ACCOUNT_ENTRIES: &[&str] = &[
"create_account",
"create_account_with_seed",
@@ -48,7 +48,7 @@ const SYSTEM_NONCE_ENTRIES: &[&str] = &[
"authorize_nonce_account",
"upgrade_nonce_account",
];
const ZK_ELGAMAL_PROOF_SURFACE: &str = "solana_native_zk_elgamal_proof";
const ZK_ELGAMAL_PROOF_SURFACE: &str = "solana.core.zk_elgamal_proof";
const ZK_ELGAMAL_CLOSE_ENTRIES: &[&str] = &["close_context_state"];
const ZK_ELGAMAL_VERIFY_ENTRIES: &[&str] = &[
"verify_zero_ciphertext",
@@ -152,7 +152,7 @@ impl crate::MtMaterializer for crate::MtLifecycleMaterializer {
impl crate::MtApiEventMaterializer for crate::MtLifecycleMaterializer {
fn identity(&self) -> crate::MtApiMaterializerIdentity {
return crate::MtApiMaterializerIdentity {
name: "solana_native_lifecycle".to_string(),
name: "materializer.lifecycle".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -491,7 +491,7 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("0".to_string()),
program_id: crate::MdProgramId("program-id".to_string()),
protocol_code: crate::MdProtocolCode("solana_native".to_string()),
protocol_code: crate::MdProtocolCode("solana.core".to_string()),
surface_code: crate::MdSurfaceCode(surface_code.to_string()),
event_code: crate::MdEventCode(format!("{surface_code}.{entry_code}")),
event_name: crate::MdEventName(entry_code.to_string()),
@@ -656,7 +656,7 @@ mod tests {
assert_eq!(result.status, crate::MtApiMaterializerOutcomeStatus::Inserted);
assert_eq!(
result.outputs[0].output_key,
"program_loader:solana_native_bpf_loader_upgradeable:deploy_with_max_data_len:0"
"program_loader:solana.core.bpf_loader_upgradeable:deploy_with_max_data_len:0"
);
assert_eq!(result.outputs[0].payload_json["domain"], "program_loader");
assert_eq!(
@@ -879,7 +879,7 @@ mod tests {
fn historical_zk_token_proof_is_not_materialized() {
let materializer = crate::MtLifecycleMaterializer;
let observation = observation_with_payload(
"solana_native_zk_token_proof",
"solana.core.zk_token_proof",
"close_context_state",
crate::MdEventFamily::Audit,
false,
@@ -915,7 +915,7 @@ mod tests {
#[test]
fn ata_lifecycle_is_owned_by_token_accounts_materializer_only() {
let mut observation = observation("spl_associated_token_account", "create", false);
let mut observation = observation("spl.associated_token_account", "create", false);
observation.event.program_id =
crate::MdProgramId(kb_program_ids::ASSOCIATED_TOKEN_PROGRAM_ID.to_string());
assert!(!crate::MtApiEventMaterializer::accepts_observation(

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/materializer/risk/constants.rs
// version: 2
// version: 3
//! Local constants for fact-only risk projections.
/// Stable processor name persisted by the replay ledger.
pub(crate) const MT_RISK_PROCESSOR_NAME: &str = "spl_token_risk";
pub(crate) const MT_RISK_PROCESSOR_NAME: &str = "materializer.risk";
/// Stable projection payload contract version.
pub(crate) const MT_RISK_PROJECTION_VERSION: u32 = 2;
/// Canonical tracing target for this component.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/materializer/risk/core.rs
// version: 5
// version: 6
//! Stable fact-only risk projections for committed SPL Token and ATA observations.
@@ -168,9 +168,9 @@ impl crate::MtApiEventMaterializer for crate::MtRiskMaterializer {
fn accepts_event(event: &crate::MdDecodedProtocolEvent) -> bool {
let token_program = (event.program_id.0 == kb_program_ids::SPL_TOKEN_PROGRAM_ID
&& event.surface_code.0 == "spl_token")
&& event.surface_code.0 == "spl.token")
|| (event.program_id.0 == kb_program_ids::SPL_TOKEN_2022_PROGRAM_ID
&& event.surface_code.0 == "spl_token_2022");
&& event.surface_code.0 == "spl.token_2022");
let token_risk = token_program && RISK_ENTRIES.contains(&event.event_name.0.as_str());
return ACCEPTED_FAMILIES.contains(&event.event_family)
&& (token_risk || is_ata_recovery(event));
@@ -178,7 +178,7 @@ fn accepts_event(event: &crate::MdDecodedProtocolEvent) -> bool {
fn is_ata_recovery(event: &crate::MdDecodedProtocolEvent) -> bool {
return event.program_id.0 == kb_program_ids::ASSOCIATED_TOKEN_PROGRAM_ID
&& event.surface_code.0 == "spl_associated_token_account"
&& event.surface_code.0 == "spl.associated_token_account"
&& event.event_family == crate::MdEventFamily::Lifecycle
&& event.event_name.0 == "recover_nested";
}
@@ -312,9 +312,9 @@ mod tests {
slot: crate::MdSlot(1),
instruction_path: crate::MdInstructionPath("0".to_string()),
program_id: crate::MdProgramId(kb_program_ids::SPL_TOKEN_PROGRAM_ID.to_string()),
protocol_code: crate::MdProtocolCode("spl_token".to_string()),
surface_code: crate::MdSurfaceCode("spl_token".to_string()),
event_code: crate::MdEventCode(format!("spl_token.{entry}")),
protocol_code: crate::MdProtocolCode("spl.token".to_string()),
surface_code: crate::MdSurfaceCode("spl.token".to_string()),
event_code: crate::MdEventCode(format!("spl.token.{entry}")),
event_name: crate::MdEventName(entry.to_string()),
event_family: family,
source_kind: crate::MdEventSourceKind::Instruction,
@@ -341,9 +341,9 @@ mod tests {
let mut observation = observation(entry, family, parameters, failed);
observation.event.program_id =
crate::MdProgramId(kb_program_ids::SPL_TOKEN_2022_PROGRAM_ID.to_string());
observation.event.protocol_code = crate::MdProtocolCode("spl_token_2022".to_string());
observation.event.surface_code = crate::MdSurfaceCode("spl_token_2022".to_string());
observation.event.event_code = crate::MdEventCode(format!("spl_token_2022.{entry}"));
observation.event.protocol_code = crate::MdProtocolCode("spl.token_2022".to_string());
observation.event.surface_code = crate::MdSurfaceCode("spl.token_2022".to_string());
observation.event.event_code = crate::MdEventCode(format!("spl.token_2022.{entry}"));
observation.event_key = format!("token_2022:{entry}:0");
return observation;
}
@@ -358,10 +358,10 @@ mod tests {
program_id: crate::MdProgramId(
kb_program_ids::ASSOCIATED_TOKEN_PROGRAM_ID.to_string(),
),
protocol_code: crate::MdProtocolCode("spl_associated_token_account".to_string()),
surface_code: crate::MdSurfaceCode("spl_associated_token_account".to_string()),
protocol_code: crate::MdProtocolCode("spl.associated_token_account".to_string()),
surface_code: crate::MdSurfaceCode("spl.associated_token_account".to_string()),
event_code: crate::MdEventCode(
"spl_associated_token_account.recover_nested".to_string(),
"spl.associated_token_account.recover_nested".to_string(),
),
event_name: crate::MdEventName("recover_nested".to_string()),
event_family: crate::MdEventFamily::Lifecycle,

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/materializer/staking/core.rs
// version: 9
// version: 10
//! Instruction-level staking projections for native Stake and Vote observations.
@@ -9,8 +9,8 @@ const ACCEPTED_FAMILIES: &[crate::MdEventFamily] = &[
crate::MdEventFamily::Staking,
crate::MdEventFamily::Reward,
];
const STAKE_SURFACE: &str = "solana_native_stake";
const VOTE_SURFACE: &str = "solana_native_vote";
const STAKE_SURFACE: &str = "solana.core.stake";
const VOTE_SURFACE: &str = "solana.core.vote";
const STAKE_ACCOUNT_ENTRIES: &[&str] = &[
"initialize",
"initialize_checked",
@@ -126,7 +126,7 @@ impl crate::MtMaterializer for crate::MtStakingMaterializer {
impl crate::MtApiEventMaterializer for crate::MtStakingMaterializer {
fn identity(&self) -> crate::MtApiMaterializerIdentity {
return crate::MtApiMaterializerIdentity {
name: "solana_native_staking".to_string(),
name: "materializer.staking".to_string(),
version: env!("CARGO_PKG_VERSION").to_string(),
};
}
@@ -605,7 +605,7 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("0".to_string()),
program_id: crate::MdProgramId("program-id".to_string()),
protocol_code: crate::MdProtocolCode("solana_native".to_string()),
protocol_code: crate::MdProtocolCode("solana.core".to_string()),
surface_code: crate::MdSurfaceCode(surface_code.to_string()),
event_code: crate::MdEventCode(format!("{surface_code}.{entry_code}")),
event_name: crate::MdEventName(entry_code.to_string()),
@@ -821,7 +821,7 @@ mod tests {
fn unrelated_or_disabled_observations_are_ignored() {
let materializer = crate::MtStakingMaterializer;
let unrelated = observation(
"solana_native_system",
"solana.core.system",
"create_account",
crate::MdEventFamily::Lifecycle,
false,

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/materializer/token/accounts.rs
// version: 6
// version: 7
//! Stable committed SPL Token mutation and ATA lifecycle projections.
@@ -174,9 +174,9 @@ impl crate::MtApiEventMaterializer for crate::MtTokenAccountsMaterializer {
fn accepts_event(event: &crate::MdDecodedProtocolEvent) -> bool {
let token_program = (event.program_id.0 == kb_program_ids::SPL_TOKEN_PROGRAM_ID
&& event.surface_code.0 == "spl_token")
&& event.surface_code.0 == "spl.token")
|| (event.program_id.0 == kb_program_ids::SPL_TOKEN_2022_PROGRAM_ID
&& event.surface_code.0 == "spl_token_2022");
&& event.surface_code.0 == "spl.token_2022");
let token_mutation = token_program && MUTATION_ENTRIES.contains(&event.event_name.0.as_str());
let ata = is_ata_event(event);
return ACCEPTED_FAMILIES.contains(&event.event_family) && (token_mutation || ata);
@@ -184,7 +184,7 @@ fn accepts_event(event: &crate::MdDecodedProtocolEvent) -> bool {
fn is_ata_event(event: &crate::MdDecodedProtocolEvent) -> bool {
return event.program_id.0 == kb_program_ids::ASSOCIATED_TOKEN_PROGRAM_ID
&& event.surface_code.0 == "spl_associated_token_account"
&& event.surface_code.0 == "spl.associated_token_account"
&& event.event_family == crate::MdEventFamily::Lifecycle
&& ATA_LIFECYCLE_ENTRIES
.iter()
@@ -474,9 +474,9 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("1/0".to_string()),
program_id: crate::MdProgramId(kb_program_ids::SPL_TOKEN_PROGRAM_ID.to_string()),
protocol_code: crate::MdProtocolCode("spl_token".to_string()),
surface_code: crate::MdSurfaceCode("spl_token".to_string()),
event_code: crate::MdEventCode(format!("spl_token.{entry}")),
protocol_code: crate::MdProtocolCode("spl.token".to_string()),
surface_code: crate::MdSurfaceCode("spl.token".to_string()),
event_code: crate::MdEventCode(format!("spl.token.{entry}")),
event_name: crate::MdEventName(entry.to_string()),
event_family: family,
source_kind: crate::MdEventSourceKind::InnerInstruction,
@@ -510,9 +510,9 @@ mod tests {
let mut observation = observation(entry, family, failed);
observation.event.program_id =
crate::MdProgramId(kb_program_ids::SPL_TOKEN_2022_PROGRAM_ID.to_string());
observation.event.protocol_code = crate::MdProtocolCode("spl_token_2022".to_string());
observation.event.surface_code = crate::MdSurfaceCode("spl_token_2022".to_string());
observation.event.event_code = crate::MdEventCode(format!("spl_token_2022.{entry}"));
observation.event.protocol_code = crate::MdProtocolCode("spl.token_2022".to_string());
observation.event.surface_code = crate::MdSurfaceCode("spl.token_2022".to_string());
observation.event.event_code = crate::MdEventCode(format!("spl.token_2022.{entry}"));
observation.event_key = format!("token_2022:{entry}:0");
return observation;
}
@@ -554,9 +554,9 @@ mod tests {
program_id: crate::MdProgramId(
kb_program_ids::ASSOCIATED_TOKEN_PROGRAM_ID.to_string(),
),
protocol_code: crate::MdProtocolCode("spl_associated_token_account".to_string()),
surface_code: crate::MdSurfaceCode("spl_associated_token_account".to_string()),
event_code: crate::MdEventCode(format!("spl_associated_token_account.{entry}")),
protocol_code: crate::MdProtocolCode("spl.associated_token_account".to_string()),
surface_code: crate::MdSurfaceCode("spl.associated_token_account".to_string()),
event_code: crate::MdEventCode(format!("spl.associated_token_account.{entry}")),
event_name: crate::MdEventName(entry.to_string()),
event_family: crate::MdEventFamily::Lifecycle,
source_kind: crate::MdEventSourceKind::Instruction,

View File

@@ -1,10 +1,10 @@
// file: kb-lib/src/materializer/token/constants.rs
// version: 2
// version: 3
//! Local constants for classic SPL Token account projections.
/// Stable processor name persisted by the replay ledger.
pub(crate) const MT_TOKEN_ACCOUNTS_PROCESSOR_NAME: &str = "spl_token_accounts";
pub(crate) const MT_TOKEN_ACCOUNTS_PROCESSOR_NAME: &str = "materializer.token.accounts";
/// Stable projection payload contract version.
pub(crate) const MT_TOKEN_ACCOUNTS_PROJECTION_VERSION: u32 = 3;
/// Canonical tracing target for this component.

View File

@@ -1,5 +1,5 @@
// file: kb-lib/src/materializer/transaction/annotations.rs
// version: 4
// version: 5
//! Exact committed SPL Memo transaction annotation projection.
@@ -16,17 +16,17 @@ enum MemoGeneration {
impl MemoGeneration {
fn from_event(event: &crate::MdDecodedProtocolEvent) -> std::option::Option<Self> {
if event.program_id.0 == kb_program_ids::SPL_MEMO_V1_PROGRAM_ID
&& event.surface_code.0 == "spl_memo_v1"
&& event.surface_code.0 == "spl.memo.v1"
{
return std::option::Option::Some(Self::V1);
}
if event.program_id.0 == kb_program_ids::SPL_MEMO_V3_PROGRAM_ID
&& event.surface_code.0 == "spl_memo_v3"
&& event.surface_code.0 == "spl.memo.v3"
{
return std::option::Option::Some(Self::V3);
}
if event.program_id.0 == kb_program_ids::SPL_MEMO_V4_PROGRAM_ID
&& event.surface_code.0 == "spl_memo_v4"
&& event.surface_code.0 == "spl.memo.v4"
{
return std::option::Option::Some(Self::V4);
}
@@ -147,7 +147,7 @@ impl crate::MtApiEventMaterializer for crate::MtTransactionAnnotationMaterialize
payload_json: serde_json::json!({
"projectionVersion": crate::MT_TRANSACTION_ANNOTATIONS_PROJECTION_VERSION,
"domain": "transaction_annotation",
"annotationKind": "spl_memo",
"annotationKind": "spl.memo",
"idempotenceKey": idempotence_key,
"signature": observation.event.signature.0.clone(),
"slot": observation.event.slot.0,
@@ -199,7 +199,7 @@ impl crate::MtApiEventMaterializer for crate::MtTransactionAnnotationMaterialize
fn accepts_event(event: &crate::MdDecodedProtocolEvent) -> bool {
return event.event_family == crate::MdEventFamily::Audit
&& event.protocol_code.0 == "spl_memo"
&& event.protocol_code.0 == "spl.memo"
&& (event.source_kind == crate::MdEventSourceKind::Instruction
|| event.source_kind == crate::MdEventSourceKind::InnerInstruction)
&& MemoGeneration::from_event(event).is_some()
@@ -416,7 +416,7 @@ mod tests {
slot: crate::MdSlot(42),
instruction_path: crate::MdInstructionPath("1/0".to_string()),
program_id: crate::MdProgramId(program_id.to_string()),
protocol_code: crate::MdProtocolCode("spl_memo".to_string()),
protocol_code: crate::MdProtocolCode("spl.memo".to_string()),
surface_code: crate::MdSurfaceCode(surface_code.to_string()),
event_code: crate::MdEventCode(format!("{surface_code}.{event_name}")),
event_name: crate::MdEventName(event_name.to_string()),
@@ -465,7 +465,7 @@ mod tests {
fn v4() -> crate::DcApiDecodedObservation {
return observation(
kb_program_ids::SPL_MEMO_V4_PROGRAM_ID,
"spl_memo_v4",
"spl.memo.v4",
"v4",
"add_memo",
false,
@@ -498,9 +498,9 @@ mod tests {
#[test]
fn exact_v1_v3_and_v4_surfaces_are_accepted() {
for (program_id, surface, generation) in [
(kb_program_ids::SPL_MEMO_V1_PROGRAM_ID, "spl_memo_v1", "v1"),
(kb_program_ids::SPL_MEMO_V3_PROGRAM_ID, "spl_memo_v3", "v3"),
(kb_program_ids::SPL_MEMO_V4_PROGRAM_ID, "spl_memo_v4", "v4"),
(kb_program_ids::SPL_MEMO_V1_PROGRAM_ID, "spl.memo.v1", "v1"),
(kb_program_ids::SPL_MEMO_V3_PROGRAM_ID, "spl.memo.v3", "v3"),
(kb_program_ids::SPL_MEMO_V4_PROGRAM_ID, "spl.memo.v4", "v4"),
] {
let observation = observation(
program_id,
@@ -523,7 +523,7 @@ mod tests {
fn v1_observed_accounts_are_not_claimed_as_runtime_verified() {
let observation = observation(
kb_program_ids::SPL_MEMO_V1_PROGRAM_ID,
"spl_memo_v1",
"spl.memo.v1",
"v1",
"add_memo",
false,
@@ -546,7 +546,7 @@ mod tests {
fn failed_or_uncommitted_memo_is_refused_without_output() {
let observation = observation(
kb_program_ids::SPL_MEMO_V4_PROGRAM_ID,
"spl_memo_v4",
"spl.memo.v4",
"v4",
"memo_intent",
true,

View File

@@ -1,12 +1,13 @@
// file: kb-lib/src/materializer/transaction/constants.rs
// version: 2
// version: 3
//! Local constants for the transaction annotation materializer.
/// Maximum Memo payload accepted from the decoded contract.
pub(crate) const MT_TRANSACTION_ANNOTATIONS_MAX_MEMO_PAYLOAD_BYTES: u64 = 4_096;
/// Stable materializer processor name.
pub(crate) const MT_TRANSACTION_ANNOTATIONS_PROCESSOR_NAME: &str = "transaction_annotations";
pub(crate) const MT_TRANSACTION_ANNOTATIONS_PROCESSOR_NAME: &str =
"materializer.transaction.annotations";
/// Stable projection contract version.
pub(crate) const MT_TRANSACTION_ANNOTATIONS_PROJECTION_VERSION: u32 = 1;
/// Canonical tracing target for this component.

View File

@@ -0,0 +1,66 @@
// file: kb-lib/tests/operation_naming_matrix.rs
// version: 2
//! Integration guard for the persisted operation naming contract.
#[test]
fn operation_naming_matrix_is_machine_readable_and_uses_canonical_dot_hierarchy()
-> std::result::Result<(), std::string::String> {
let matrix_path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../test-fixtures/contract-matrices/OPERATION_NAMING_MATRIX.json");
let matrix_text = match std::fs::read_to_string(matrix_path) {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => {
return std::result::Result::Err(std::format!(
"operation naming matrix must be readable: {error}"
));
},
};
let matrix: serde_json::Value = match serde_json::from_str(matrix_text.as_str()) {
std::result::Result::Ok(value) => value,
std::result::Result::Err(error) => {
return std::result::Result::Err(std::format!(
"operation naming matrix must be valid JSON: {error}"
));
},
};
let entries = match matrix["entries"].as_array() {
std::option::Option::Some(value) => value,
std::option::Option::None => {
return std::result::Result::Err(std::string::String::from(
"operation naming matrix must expose entries",
));
},
};
assert!(!entries.is_empty());
let obsolete_prefixes = [
"solana_core.",
"solana_native_",
"spl_memo",
"spl_token.",
"spl_token_2022.",
"spl_associated_token_account.",
"spl_elgamal_registry.",
"metadata_metaplex_token_metadata.",
];
for entry in entries {
for field in [
"processorName",
"surfaceCode",
"operationCode",
"eventCode",
"decoderName",
"executorName",
] {
let std::option::Option::Some(value) = entry[field].as_str() else {
continue;
};
assert!(!value.is_empty());
assert!(
!obsolete_prefixes.iter().any(|prefix| return value.starts_with(prefix)),
"obsolete persisted identifier in {field}: {value}"
);
}
}
return std::result::Result::Ok(());
}