diff --git a/CHANGELOG.md b/CHANGELOG.md index 532a109..0c706c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,17 @@ - + # CHANGELOG +## 0.1.0-pre.014 + +- Vérification de la parité exacte des contrats publics `ExApi*` avec `kb_execution_api` de bot2. +- Extension du test aval au contrat d’exécution typé et au plan préparé. +- Remplacement des 104 marqueurs temporaires par des squelettes `Ex*Executor`. +- Rattachement des squelettes à leurs Program IDs enregistrés, sans dépendance vers les décodeurs. +- Garantie d’inactivité par support `Maybe` et plans réservés à zéro instruction. +- Extension de l’audit et ajout d’un test central sur les 104 frontières. + ## 0.1.0-pre.013 - Remplacement des 14 marqueurs temporaires de matérialisation par des squelettes `Mt*Materializer`. diff --git a/README.md b/README.md index b26030b..2812a7d 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ - + # Khadhroony Bot3 @@ -83,3 +83,5 @@ Les identités historiques des processors sont conservées pour la compatibilit Les modules de matérialisation sont privés. Tous les contrats, types concrets et helpers destinés aux consommateurs externes sont exposés exclusivement par `kb-lib/src/lib.rs`. Des tests aval distincts protègent les contrats d’extension `DcApiProtocolDecoder`, `MtApiEventMaterializer` et `ExApiInstructionExecutor`. `0.1.0-pre.013` remplace les 14 dernières frontières temporaires de matérialisation par des squelettes `Mt*Materializer`. Ils conservent le contrat historique `MtMaterializer`, implémentent également `MtApiEventMaterializer`, restent volontairement inactifs et ne produisent aucun faux événement via l’API bot3. Tous les types sont accessibles exclusivement depuis la façade `kb_lib`. + +`0.1.0-pre.014` confirme la parité de l’API publique `ExApi*` avec bot2 et remplace les 104 frontières temporaires d’exécution par des squelettes `Ex*Executor`. Chaque squelette référence uniquement ses Program IDs enregistrés, annonce `Maybe` sur sa surface et construit exclusivement un plan réservé à zéro instruction. Les exécuteurs opérationnels seront portés séparément, en commençant par Solana Core puis SPL. diff --git a/ROADMAP.md b/ROADMAP.md index bfc963e..95baacd 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,5 +1,5 @@ - + # ROADMAP — khadhroony-bot3 @@ -164,5 +164,17 @@ - [x] Exposer les 14 types uniquement depuis la façade `kb-lib/src/lib.rs`. - [x] Étendre le test aval et l’audit contre le retour des marqueurs temporaires. - [x] Aligner `RUST023` sur l’ordre naturel produit par `rustfmt`. -- [ ] Valider les deux nouveaux tests unitaires, le test aval, Clippy et le workspace avec Cargo sur la machine de développement. -- [ ] Passer à l’API des exécuteurs, à leurs squelettes puis au port des exécuteurs déjà implémentés dans bot2. +- [x] Valider les deux nouveaux tests unitaires, le test aval, Clippy et le workspace avec Cargo sur la machine de développement. +- [x] Vérifier la parité de l’API des exécuteurs avant de restaurer leurs squelettes. + +### 0.1.0-pre.014 — API et squelettes des exécuteurs + +- [x] Vérifier la parité exacte des contrats `ExApi*` avec `kb_execution_api` de bot2. +- [x] Étendre le test aval au contrat `ExApiTypedInstructionExecutor` et au plan typé public. +- [x] Remplacer les 104 frontières `LEGACY_CRATE`/`MIGRATION_STATUS` par des types `Ex*Executor` concrets. +- [x] Rattacher chaque squelette à ses Program IDs enregistrés sans dépendre des décodeurs. +- [x] Maintenir les squelettes inactifs : support `Maybe` et plan explicite à zéro instruction. +- [x] Exposer les 104 types uniquement depuis la façade `kb-lib/src/lib.rs`. +- [x] Ajouter un test central couvrant les 104 squelettes et étendre l’audit contre le retour des marqueurs temporaires. +- [ ] Valider le nouveau test unitaire, le test aval, Clippy et le workspace avec Cargo sur la machine de développement. +- [ ] Porter ensuite les exécuteurs fonctionnels déjà validés dans bot2, en commençant par Solana Core puis SPL. diff --git a/RULES.md b/RULES.md index 95d1dc4..450842a 100644 --- a/RULES.md +++ b/RULES.md @@ -1,5 +1,5 @@ - + # Règles spécifiques à `khadhroony-bot3` @@ -185,6 +185,8 @@ Aucun renommage massif de modules n'est autorisé sans étape de contrôle dédi - Une surface classifiée peut avoir un module décodeur et un module exécuteur distincts dans `kb-lib`. - Les exécuteurs ne doivent pas dépendre des décodeurs. - Les exécuteurs utilisent les contrats `ExApi*` réexportés directement par la façade `kb_lib`. +- Un squelette d’exécuteur doit exposer un type `Ex*Executor`, référencer uniquement des Program IDs de `kb-program-ids`, annoncer `Maybe` pour sa surface et construire exclusivement un plan réservé à zéro instruction. +- La migration fonctionnelle d’un exécuteur doit remplacer ce comportement réservé par des capacités exactes `Supported` ou `Unsupported(reason)` ; aucun statut temporaire `LEGACY_CRATE` ou `MIGRATION_STATUS` ne doit subsister. - Les garde-fous communs doivent être placés dans les modules de sécurité partagés de `kb-lib`. - Aucun exécuteur ne doit envoyer de transaction sans simulation et validation explicite. - Les surfaces non classifiées ne doivent pas avoir de crate exécuteur. diff --git a/kb-lib/README.md b/kb-lib/README.md index fe4455b..2c67303 100644 --- a/kb-lib/README.md +++ b/kb-lib/README.md @@ -1,5 +1,5 @@ - + # kb-lib @@ -136,4 +136,5 @@ L’appel de décodage complet utilise `DcApiInstructionDecoder::decode` après - Une transaction échouée peut produire une intention structurée, jamais une mutation commitée. - Un matérialiseur externe dépend uniquement des contrats et modèles publics de `kb-lib`, jamais d’un décodeur concret. - Les squelettes réservés répondent uniquement `Maybe` pour leur Program ID et retournent une liste vide ; ils ne prétendent pas décoder une surface avant son port fonctionnel. -- Les exécuteurs sont portés dans des tranches séparées. +- Les squelettes d’exécuteurs annoncent uniquement `Maybe` pour leurs Program IDs enregistrés et construisent un plan réservé à zéro instruction. +- Les exécuteurs fonctionnels sont portés dans des tranches séparées, sans dépendre des décodeurs. diff --git a/kb-lib/src/executor.rs b/kb-lib/src/executor.rs index b3cdff8..e4c7917 100644 --- a/kb-lib/src/executor.rs +++ b/kb-lib/src/executor.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor.rs -// version: 1 +// version: 2 //! Consolidated executor modules. @@ -31,6 +31,65 @@ mod vault; mod vesting; mod wallet; 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; +/// Exposes the reserved `amm/aldrin_v1` executor. +pub use self::amm::ExAmmAldrinV1Executor; +/// Exposes the reserved `amm/aldrin_v2` executor. +pub use self::amm::ExAmmAldrinV2Executor; +/// Exposes the reserved `amm/alphaq` executor. +pub use self::amm::ExAmmAlphaqExecutor; +/// Exposes the reserved `amm/believe` executor. +pub use self::amm::ExAmmBelieveExecutor; +/// Exposes the reserved `amm/bonk_swap` executor. +pub use self::amm::ExAmmBonkSwapExecutor; +/// Exposes the reserved `amm/fluxbeam` executor. +pub use self::amm::ExAmmFluxbeamExecutor; +/// Exposes the reserved `amm/goon_fi` executor. +pub use self::amm::ExAmmGoonFiExecutor; +/// Exposes the reserved `amm/goosefx_gamma` executor. +pub use self::amm::ExAmmGoosefxGammaExecutor; +/// Exposes the reserved `amm/goosefx_v2` executor. +pub use self::amm::ExAmmGoosefxV2Executor; +/// Exposes the reserved `amm/guac_swap` executor. +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. +pub use self::amm::ExAmmMeteoraDammV1Executor; +/// Exposes the reserved `amm/meteora_damm_v2` executor. +pub use self::amm::ExAmmMeteoraDammV2Executor; +/// Exposes the reserved `amm/obric_v2` executor. +pub use self::amm::ExAmmObricV2Executor; +/// Exposes the reserved `amm/one_dex` executor. +pub use self::amm::ExAmmOneDexExecutor; +/// Exposes the reserved `amm/pump_swap` executor. +pub use self::amm::ExAmmPumpSwapExecutor; +/// Exposes the reserved `amm/raydium_lp_v4` executor. +pub use self::amm::ExAmmRaydiumLpV4Executor; +/// Exposes the reserved `amm/solfi` executor. +pub use self::amm::ExAmmSolfiExecutor; +/// Exposes the reserved `amm/solfi_v2` executor. +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. +pub use self::amm::ExAmmZeroFiExecutor; +/// Exposes the reserved `amm/zora` executor. +pub use self::amm::ExAmmZoraExecutor; /// Exposes the blockhash policy kind. pub use self::api::ExApiExecutionBlockhashKind; /// Exposes the blockhash policy. @@ -81,3 +140,286 @@ pub use self::api::ExApiTypedInstructionExecutor; pub use self::api::executor_api_serialize_payload_json; /// Exposes the pretty JSON payload serializer. pub use self::api::executor_api_serialize_payload_json_pretty; +/// Exposes the reserved `bridge/circle_cctp_token_messenger_minter` executor. +pub use self::bridge::ExBridgeCircleCctpTokenMessengerMinterExecutor; +/// Exposes the reserved `bridge/circle_cctp_token_messenger_minter_v2` executor. +pub use self::bridge::ExBridgeCircleCctpTokenMessengerMinterV2Executor; +/// Exposes the reserved `bridge/layer_zero_endpoint` executor. +pub use self::bridge::ExBridgeLayerZeroEndpointExecutor; +/// Exposes the reserved `bridge/layer_zero_executor` executor. +pub use self::bridge::ExBridgeLayerZeroExecutorExecutor; +/// Exposes the reserved `clmm/byreal` executor. +pub use self::clmm::ExClmmByrealExecutor; +/// Exposes the reserved `clmm/fusion` executor. +pub use self::clmm::ExClmmFusionExecutor; +/// Exposes the reserved `clmm/orca_whirlpool` executor. +pub use self::clmm::ExClmmOrcaWhirlpoolExecutor; +/// Exposes the reserved `clmm/pancake_swap` executor. +pub use self::clmm::ExClmmPancakeSwapExecutor; +/// Exposes the reserved `clmm/raydium` executor. +pub use self::clmm::ExClmmRaydiumExecutor; +/// Exposes the reserved `clmm/stabble` executor. +pub use self::clmm::ExClmmStabbleExecutor; +/// Exposes the reserved `cpmm/raydium` executor. +pub use self::cpmm::ExCpmmRaydiumExecutor; +/// Exposes the reserved `dlmm/meteora` executor. +pub use self::dlmm::ExDlmmMeteoraExecutor; +/// Exposes the reserved `fees/bags_fee_share_v1` executor. +pub use self::fees::ExFeesBagsFeeShareV1Executor; +/// Exposes the reserved `fees/bags_fee_share_v2` executor. +pub use self::fees::ExFeesBagsFeeShareV2Executor; +/// Exposes the reserved `governance/metadao_bid_wall` executor. +pub use self::governance::ExGovernanceMetadaoBidWallExecutor; +/// Exposes the reserved `launchpad/boop_fun` executor. +pub use self::launchpad::ExLaunchpadBoopFunExecutor; +/// Exposes the reserved `launchpad/metadao_ico` executor. +pub use self::launchpad::ExLaunchpadMetadaoIcoExecutor; +/// Exposes the reserved `launchpad/meteora_dbc` executor. +pub use self::launchpad::ExLaunchpadMeteoraDbcExecutor; +/// Exposes the reserved `launchpad/moonit` executor. +pub use self::launchpad::ExLaunchpadMoonitExecutor; +/// Exposes the reserved `launchpad/orca_wavebreak` executor. +pub use self::launchpad::ExLaunchpadOrcaWavebreakExecutor; +/// Exposes the reserved `launchpad/printr` executor. +pub use self::launchpad::ExLaunchpadPrintrExecutor; +/// Exposes the reserved `launchpad/pump_fun` executor. +pub use self::launchpad::ExLaunchpadPumpFunExecutor; +/// Exposes the reserved `launchpad/pump_pumpup_ai` executor. +pub use self::launchpad::ExLaunchpadPumpPumpupAiExecutor; +/// Exposes the reserved `launchpad/raydium_launchlab` executor. +pub use self::launchpad::ExLaunchpadRaydiumLaunchlabExecutor; +/// Exposes the reserved `lending/clone` executor. +pub use self::lending::ExLendingCloneExecutor; +/// Exposes the reserved `lending/jupiter_lend_borrow` executor. +pub use self::lending::ExLendingJupiterLendBorrowExecutor; +/// Exposes the reserved `lending/jupiter_lend_earn` executor. +pub use self::lending::ExLendingJupiterLendEarnExecutor; +/// Exposes the reserved `lending/jupiter_lend_flash_loan` executor. +pub use self::lending::ExLendingJupiterLendFlashLoanExecutor; +/// Exposes the reserved `lending/jupiter_lend_liquidity` executor. +pub use self::lending::ExLendingJupiterLendLiquidityExecutor; +/// Exposes the reserved `lending/kamino` executor. +pub use self::lending::ExLendingKaminoExecutor; +/// Exposes the reserved `lending/marginfi_v2` executor. +pub use self::lending::ExLendingMarginfiV2Executor; +/// Exposes the reserved `lock/raydium_lp` executor. +pub use self::lock::ExLockRaydiumLpExecutor; +/// Exposes the reserved `metadata/metaplex_token_metadata` executor. +pub use self::metadata::ExMetadataMetaplexTokenMetadataExecutor; +/// 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; +/// Exposes the reserved `orderbook/jupiter_limit_order` executor. +pub use self::orderbook::ExOrderbookJupiterLimitOrderExecutor; +/// Exposes the reserved `orderbook/jupiter_limit_order_v2` executor. +pub use self::orderbook::ExOrderbookJupiterLimitOrderV2Executor; +/// Exposes the reserved `orderbook/openbook_v2` executor. +pub use self::orderbook::ExOrderbookOpenbookV2Executor; +/// Exposes the reserved `perpetuals/drift_v2` executor. +pub use self::perpetuals::ExPerpetualsDriftV2Executor; +/// Exposes the reserved `perpetuals/jupiter` executor. +pub use self::perpetuals::ExPerpetualsJupiterExecutor; +/// Exposes the reserved `perpetuals/zeta` executor. +pub use self::perpetuals::ExPerpetualsZetaExecutor; +/// Exposes the reserved `router/dflow_aggregator_v4` executor. +pub use self::router::ExRouterDflowAggregatorV4Executor; +/// Exposes the reserved `router/jupiter_aggregator_v4` executor. +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. +pub use self::router::ExRouterOkxLabsV2Executor; +/// Exposes the reserved `rwa/ondo_global_markets` executor. +pub use self::rwa::ExRwaOndoGlobalMarketsExecutor; +/// Exposes the reserved `solana/core` executor. +pub use self::solana::ExSolanaCoreExecutor; +/// Exposes the reserved `spl/account_compression` executor. +pub use self::spl::ExSplAccountCompressionExecutor; +/// Exposes the reserved `spl/associated_token_account` executor. +pub use self::spl::ExSplAssociatedTokenAccountExecutor; +/// Exposes the reserved `spl/elgamal_registry` executor. +pub use self::spl::ExSplElgamalRegistryExecutor; +/// Exposes the reserved `spl/memo` executor. +pub use self::spl::ExSplMemoExecutor; +/// Exposes the reserved `spl/noop` executor. +pub use self::spl::ExSplNoopExecutor; +/// Exposes the reserved `spl/single_pool` executor. +pub use self::spl::ExSplSinglePoolExecutor; +/// Exposes the reserved `spl/stake_pool` executor. +pub use self::spl::ExSplStakePoolExecutor; +/// Exposes the reserved `spl/token2022` executor. +pub use self::spl::ExSplToken2022Executor; +/// Exposes the reserved `spl/token` executor. +pub use self::spl::ExSplTokenExecutor; +/// Exposes the reserved `stable/swap_hylo_exchange` executor. +pub use self::stable::ExStableSwapHyloExchangeExecutor; +/// Exposes the reserved `stable/swap_jupiter_stable` executor. +pub use self::stable::ExStableSwapJupiterStableExecutor; +/// Exposes the reserved `stable/swap_numeraire` executor. +pub use self::stable::ExStableSwapNumeraireExecutor; +/// Exposes the reserved `stable/swap_stabble` executor. +pub use self::stable::ExStableSwapStabbleExecutor; +/// 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; +/// Exposes the reserved `treasury/helium_treasury_management` executor. +pub use self::treasury::ExTreasuryHeliumTreasuryManagementExecutor; +/// Exposes the reserved `vault/carrot_defi` executor. +pub use self::vault::ExVaultCarrotDefiExecutor; +/// Exposes the reserved `vault/hylo_stability_pool` executor. +pub use self::vault::ExVaultHyloStabilityPoolExecutor; +/// Exposes the reserved `vault/kamino` executor. +pub use self::vault::ExVaultKaminoExecutor; +/// Exposes the reserved `vault/kamino_v2` executor. +pub use self::vault::ExVaultKaminoV2Executor; +/// Exposes the reserved `vault/kamino_yvaults` executor. +pub use self::vault::ExVaultKaminoYvaultsExecutor; +/// Exposes the reserved `vault/meteora` executor. +pub use self::vault::ExVaultMeteoraExecutor; +/// Exposes the reserved `vesting/streamflow` executor. +pub use self::vesting::ExVestingStreamflowExecutor; +/// Exposes the reserved `wallet/jupiter_apepro_smart_wallet` executor. +pub use self::wallet::ExWalletJupiterApeproSmartWalletExecutor; +/// Exposes the reserved `weighted/swap_stabble` executor. +pub use self::weighted::ExWeightedSwapStabbleExecutor; + +#[cfg(test)] +mod reserved_executor_tests { + #[test] + fn every_reserved_executor_is_registered_and_builds_only_an_empty_plan() { + let executors: [&dyn crate::ExApiInstructionExecutor; 104] = [ + &crate::ExAdapterSaberDecimalWrapperExecutor, + &crate::ExAdminJupiterLockExecutor, + &crate::ExAdminPumpFeesExecutor, + &crate::ExAmmAldrinV1Executor, + &crate::ExAmmAldrinV2Executor, + &crate::ExAmmAlphaqExecutor, + &crate::ExAmmBelieveExecutor, + &crate::ExAmmBonkSwapExecutor, + &crate::ExAmmFluxbeamExecutor, + &crate::ExAmmGoonFiExecutor, + &crate::ExAmmGoosefxGammaExecutor, + &crate::ExAmmGoosefxV2Executor, + &crate::ExAmmGuacSwapExecutor, + &crate::ExAmmLifinitySwapV2Executor, + &crate::ExAmmMetadaoFutarchyAmmExecutor, + &crate::ExAmmMetadaoV05Executor, + &crate::ExAmmMeteoraDammV1Executor, + &crate::ExAmmMeteoraDammV2Executor, + &crate::ExAmmObricV2Executor, + &crate::ExAmmOneDexExecutor, + &crate::ExAmmPumpSwapExecutor, + &crate::ExAmmRaydiumLpV4Executor, + &crate::ExAmmSolfiExecutor, + &crate::ExAmmSolfiV2Executor, + &crate::ExAmmVertigoExecutor, + &crate::ExAmmVirtualsExecutor, + &crate::ExAmmWoofiExecutor, + &crate::ExAmmZeroFiExecutor, + &crate::ExAmmZoraExecutor, + &crate::ExBridgeCircleCctpTokenMessengerMinterExecutor, + &crate::ExBridgeCircleCctpTokenMessengerMinterV2Executor, + &crate::ExBridgeLayerZeroEndpointExecutor, + &crate::ExBridgeLayerZeroExecutorExecutor, + &crate::ExClmmByrealExecutor, + &crate::ExClmmFusionExecutor, + &crate::ExClmmOrcaWhirlpoolExecutor, + &crate::ExClmmPancakeSwapExecutor, + &crate::ExClmmRaydiumExecutor, + &crate::ExClmmStabbleExecutor, + &crate::ExCpmmRaydiumExecutor, + &crate::ExDlmmMeteoraExecutor, + &crate::ExFeesBagsFeeShareV1Executor, + &crate::ExFeesBagsFeeShareV2Executor, + &crate::ExGovernanceMetadaoBidWallExecutor, + &crate::ExLaunchpadBoopFunExecutor, + &crate::ExLaunchpadMetadaoIcoExecutor, + &crate::ExLaunchpadMeteoraDbcExecutor, + &crate::ExLaunchpadMoonitExecutor, + &crate::ExLaunchpadOrcaWavebreakExecutor, + &crate::ExLaunchpadPrintrExecutor, + &crate::ExLaunchpadPumpFunExecutor, + &crate::ExLaunchpadPumpPumpupAiExecutor, + &crate::ExLaunchpadRaydiumLaunchlabExecutor, + &crate::ExLendingCloneExecutor, + &crate::ExLendingJupiterLendBorrowExecutor, + &crate::ExLendingJupiterLendEarnExecutor, + &crate::ExLendingJupiterLendFlashLoanExecutor, + &crate::ExLendingJupiterLendLiquidityExecutor, + &crate::ExLendingKaminoExecutor, + &crate::ExLendingMarginfiV2Executor, + &crate::ExLockRaydiumLpExecutor, + &crate::ExMetadataMetaplexTokenMetadataExecutor, + &crate::ExMetadataSplNameServiceExecutor, + &crate::ExNftMetaplexBubblegumExecutor, + &crate::ExOrderbookJupiterLimitOrderExecutor, + &crate::ExOrderbookJupiterLimitOrderV2Executor, + &crate::ExOrderbookOpenbookV2Executor, + &crate::ExPerpetualsDriftV2Executor, + &crate::ExPerpetualsJupiterExecutor, + &crate::ExPerpetualsZetaExecutor, + &crate::ExRouterDflowAggregatorV4Executor, + &crate::ExRouterJupiterAggregatorV4Executor, + &crate::ExRouterJupiterAggregatorV6Executor, + &crate::ExRouterJupiterDcaExecutor, + &crate::ExRouterOkxLabsV1Executor, + &crate::ExRouterOkxLabsV2Executor, + &crate::ExRwaOndoGlobalMarketsExecutor, + &crate::ExSolanaCoreExecutor, + &crate::ExSplAccountCompressionExecutor, + &crate::ExSplAssociatedTokenAccountExecutor, + &crate::ExSplElgamalRegistryExecutor, + &crate::ExSplMemoExecutor, + &crate::ExSplNoopExecutor, + &crate::ExSplSinglePoolExecutor, + &crate::ExSplStakePoolExecutor, + &crate::ExSplTokenExecutor, + &crate::ExSplToken2022Executor, + &crate::ExStableSwapHyloExchangeExecutor, + &crate::ExStableSwapJupiterStableExecutor, + &crate::ExStableSwapNumeraireExecutor, + &crate::ExStableSwapStabbleExecutor, + &crate::ExStakingKaminoFarmExecutor, + &crate::ExStakingMarinadeFinanceExecutor, + &crate::ExStakingSolayerExecutor, + &crate::ExTreasuryHeliumTreasuryManagementExecutor, + &crate::ExVaultCarrotDefiExecutor, + &crate::ExVaultHyloStabilityPoolExecutor, + &crate::ExVaultKaminoExecutor, + &crate::ExVaultKaminoV2Executor, + &crate::ExVaultKaminoYvaultsExecutor, + &crate::ExVaultMeteoraExecutor, + &crate::ExVestingStreamflowExecutor, + &crate::ExWalletJupiterApeproSmartWalletExecutor, + &crate::ExWeightedSwapStabbleExecutor, + ]; + assert_eq!(executors.len(), 104); + for executor in executors { + assert!(!executor.program_ids().is_empty()); + for program_id in executor.program_ids() { + assert!(kb_program_ids::find_registered_program_id(program_id).is_some()); + } + let program_id = crate::MdProgramId(executor.program_ids()[0].to_string()); + let request = crate::ExApiExecutionRequest { + program_id, + operation_code: "reserved".to_string(), + payload_json: "{}".to_string(), + }; + assert_eq!(executor.supports_request(&request), crate::ExApiExecutionSupport::Maybe); + let plan = executor + .build_plan(&request) + .unwrap_or_else(|error| panic!("reserved executor failed: {error}")); + assert_eq!(plan.executor_name, executor.executor_name()); + assert_eq!(plan.instruction_count, 0); + assert!(plan.payload_json.contains("reserved_executor")); + } + } +} diff --git a/kb-lib/src/executor/adapter.rs b/kb-lib/src/executor/adapter.rs index e4794e5..92d784f 100644 --- a/kb-lib/src/executor/adapter.rs +++ b/kb-lib/src/executor/adapter.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/adapter.rs -// version: 1 +// version: 2 //! `adapter` executor family. mod saber_decimal_wrapper; +/// Exposes the reserved `adapter/saber_decimal_wrapper` executor. +pub use self::saber_decimal_wrapper::ExAdapterSaberDecimalWrapperExecutor; diff --git a/kb-lib/src/executor/adapter/saber_decimal_wrapper.rs b/kb-lib/src/executor/adapter/saber_decimal_wrapper.rs index c6e82a8..38f635a 100644 --- a/kb-lib/src/executor/adapter/saber_decimal_wrapper.rs +++ b/kb-lib/src/executor/adapter/saber_decimal_wrapper.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/adapter/saber_decimal_wrapper.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_adapter_saber_decimal_wrapper`. +//! Reserved executor for `adapter_saber_decimal_wrapper`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_adapter_saber_decimal_wrapper"; +/// Reserved executor for the `adapter_saber_decimal_wrapper` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAdapterSaberDecimalWrapperExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAdapterSaberDecimalWrapperExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_adapter_saber_decimal_wrapper"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ADAPTER_SABER_DECIMAL_WRAPPER_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"adapter_saber_decimal_wrapper"}), + ) { + 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_executor_adapter_saber_decimal_wrapper".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/admin.rs b/kb-lib/src/executor/admin.rs index 487fd2a..c361970 100644 --- a/kb-lib/src/executor/admin.rs +++ b/kb-lib/src/executor/admin.rs @@ -1,7 +1,11 @@ // file: kb-lib/src/executor/admin.rs -// version: 1 +// 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; diff --git a/kb-lib/src/executor/admin/jupiter_lock.rs b/kb-lib/src/executor/admin/jupiter_lock.rs index 77c55a9..0c7abec 100644 --- a/kb-lib/src/executor/admin/jupiter_lock.rs +++ b/kb-lib/src/executor/admin/jupiter_lock.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/admin/jupiter_lock.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_admin_jupiter_lock`. +//! Reserved executor for `admin_jupiter_lock`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_admin_jupiter_lock"; +/// Reserved executor for the `admin_jupiter_lock` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAdminJupiterLockExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAdminJupiterLockExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_admin_jupiter_lock"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ADMIN_JUPITER_LOCK_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"admin_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_executor_admin_jupiter_lock".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/admin/pump_fees.rs b/kb-lib/src/executor/admin/pump_fees.rs index 8ba9de5..e8756f4 100644 --- a/kb-lib/src/executor/admin/pump_fees.rs +++ b/kb-lib/src/executor/admin/pump_fees.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/admin/pump_fees.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_admin_pump_fees`. +//! Reserved executor for `admin_pump_fees`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_admin_pump_fees"; +/// Reserved executor for the `admin_pump_fees` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAdminPumpFeesExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAdminPumpFeesExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_admin_pump_fees"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ADMIN_PUMP_FEES_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"admin_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_executor_admin_pump_fees".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm.rs b/kb-lib/src/executor/amm.rs index c87f3e4..29dfda8 100644 --- a/kb-lib/src/executor/amm.rs +++ b/kb-lib/src/executor/amm.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/amm.rs -// version: 1 +// version: 2 //! `amm` executor family. @@ -29,3 +29,55 @@ 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. +pub use self::aldrin_v2::ExAmmAldrinV2Executor; +/// Exposes the reserved `amm/alphaq` executor. +pub use self::alphaq::ExAmmAlphaqExecutor; +/// Exposes the reserved `amm/believe` executor. +pub use self::believe::ExAmmBelieveExecutor; +/// Exposes the reserved `amm/bonk_swap` executor. +pub use self::bonk_swap::ExAmmBonkSwapExecutor; +/// Exposes the reserved `amm/fluxbeam` executor. +pub use self::fluxbeam::ExAmmFluxbeamExecutor; +/// Exposes the reserved `amm/goon_fi` executor. +pub use self::goon_fi::ExAmmGoonFiExecutor; +/// Exposes the reserved `amm/goosefx_gamma` executor. +pub use self::goosefx_gamma::ExAmmGoosefxGammaExecutor; +/// Exposes the reserved `amm/goosefx_v2` executor. +pub use self::goosefx_v2::ExAmmGoosefxV2Executor; +/// Exposes the reserved `amm/guac_swap` executor. +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. +pub use self::meteora_damm_v1::ExAmmMeteoraDammV1Executor; +/// Exposes the reserved `amm/meteora_damm_v2` executor. +pub use self::meteora_damm_v2::ExAmmMeteoraDammV2Executor; +/// Exposes the reserved `amm/obric_v2` executor. +pub use self::obric_v2::ExAmmObricV2Executor; +/// Exposes the reserved `amm/one_dex` executor. +pub use self::one_dex::ExAmmOneDexExecutor; +/// Exposes the reserved `amm/pump_swap` executor. +pub use self::pump_swap::ExAmmPumpSwapExecutor; +/// Exposes the reserved `amm/raydium_lp_v4` executor. +pub use self::raydium_lp_v4::ExAmmRaydiumLpV4Executor; +/// Exposes the reserved `amm/solfi` executor. +pub use self::solfi::ExAmmSolfiExecutor; +/// Exposes the reserved `amm/solfi_v2` executor. +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. +pub use self::zero_fi::ExAmmZeroFiExecutor; +/// Exposes the reserved `amm/zora` executor. +pub use self::zora::ExAmmZoraExecutor; diff --git a/kb-lib/src/executor/amm/aldrin_v1.rs b/kb-lib/src/executor/amm/aldrin_v1.rs index 2651535..e4c0269 100644 --- a/kb-lib/src/executor/amm/aldrin_v1.rs +++ b/kb-lib/src/executor/amm/aldrin_v1.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/aldrin_v1.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_aldrin_v1`. +//! Reserved executor for `amm_aldrin_v1`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_aldrin_v1"; +/// Reserved executor for the `amm_aldrin_v1` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmAldrinV1Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmAldrinV1Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_aldrin_v1"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_ALDRIN_V1_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_aldrin_v1"}), + ) { + 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_executor_amm_aldrin_v1".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/aldrin_v2.rs b/kb-lib/src/executor/amm/aldrin_v2.rs index 139670b..f4b604b 100644 --- a/kb-lib/src/executor/amm/aldrin_v2.rs +++ b/kb-lib/src/executor/amm/aldrin_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/aldrin_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_aldrin_v2`. +//! Reserved executor for `amm_aldrin_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_aldrin_v2"; +/// Reserved executor for the `amm_aldrin_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmAldrinV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmAldrinV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_aldrin_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_ALDRIN_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_aldrin_v2"}), + ) { + 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_executor_amm_aldrin_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/alphaq.rs b/kb-lib/src/executor/amm/alphaq.rs index d97dd38..aefc796 100644 --- a/kb-lib/src/executor/amm/alphaq.rs +++ b/kb-lib/src/executor/amm/alphaq.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/alphaq.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_alphaq`. +//! Reserved executor for `amm_alphaq`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_alphaq"; +/// Reserved executor for the `amm_alphaq` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmAlphaqExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmAlphaqExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_alphaq"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_ALPHAQ_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_alphaq"}), + ) { + 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_executor_amm_alphaq".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/believe.rs b/kb-lib/src/executor/amm/believe.rs index 4185a63..428c91e 100644 --- a/kb-lib/src/executor/amm/believe.rs +++ b/kb-lib/src/executor/amm/believe.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/believe.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_believe`. +//! Reserved executor for `amm_believe`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_believe"; +/// Reserved executor for the `amm_believe` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmBelieveExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmBelieveExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_believe"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_BELIEVE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_believe"}), + ) { + 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_executor_amm_believe".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/bonk_swap.rs b/kb-lib/src/executor/amm/bonk_swap.rs index c522505..b6defd5 100644 --- a/kb-lib/src/executor/amm/bonk_swap.rs +++ b/kb-lib/src/executor/amm/bonk_swap.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/bonk_swap.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_bonk_swap`. +//! Reserved executor for `amm_bonk_swap`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_bonk_swap"; +/// Reserved executor for the `amm_bonk_swap` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmBonkSwapExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmBonkSwapExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_bonk_swap"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_BONK_SWAP_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_bonk_swap"}), + ) { + 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_executor_amm_bonk_swap".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/fluxbeam.rs b/kb-lib/src/executor/amm/fluxbeam.rs index e3c5c3f..6fa909d 100644 --- a/kb-lib/src/executor/amm/fluxbeam.rs +++ b/kb-lib/src/executor/amm/fluxbeam.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/fluxbeam.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_fluxbeam`. +//! Reserved executor for `amm_fluxbeam`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_fluxbeam"; +/// Reserved executor for the `amm_fluxbeam` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmFluxbeamExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmFluxbeamExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_fluxbeam"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_FLUXBEAM_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_fluxbeam"}), + ) { + 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_executor_amm_fluxbeam".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/goon_fi.rs b/kb-lib/src/executor/amm/goon_fi.rs index ebda121..1556613 100644 --- a/kb-lib/src/executor/amm/goon_fi.rs +++ b/kb-lib/src/executor/amm/goon_fi.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/goon_fi.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_goon_fi`. +//! Reserved executor for `amm_goon_fi`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_goon_fi"; +/// Reserved executor for the `amm_goon_fi` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmGoonFiExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmGoonFiExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_goon_fi"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_GOON_FI_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_goon_fi"}), + ) { + 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_executor_amm_goon_fi".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/goosefx_gamma.rs b/kb-lib/src/executor/amm/goosefx_gamma.rs index 5da8682..5a36aab 100644 --- a/kb-lib/src/executor/amm/goosefx_gamma.rs +++ b/kb-lib/src/executor/amm/goosefx_gamma.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/goosefx_gamma.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_goosefx_gamma`. +//! Reserved executor for `amm_goosefx_gamma`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_goosefx_gamma"; +/// Reserved executor for the `amm_goosefx_gamma` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmGoosefxGammaExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmGoosefxGammaExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_goosefx_gamma"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_GOOSEFX_GAMMA_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_goosefx_gamma"}), + ) { + 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_executor_amm_goosefx_gamma".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/goosefx_v2.rs b/kb-lib/src/executor/amm/goosefx_v2.rs index 080377f..2d393a9 100644 --- a/kb-lib/src/executor/amm/goosefx_v2.rs +++ b/kb-lib/src/executor/amm/goosefx_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/goosefx_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_goosefx_v2`. +//! Reserved executor for `amm_goosefx_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_goosefx_v2"; +/// Reserved executor for the `amm_goosefx_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmGoosefxV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmGoosefxV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_goosefx_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_GOOSEFX_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_goosefx_v2"}), + ) { + 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_executor_amm_goosefx_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/guac_swap.rs b/kb-lib/src/executor/amm/guac_swap.rs index 2d961ba..448c6da 100644 --- a/kb-lib/src/executor/amm/guac_swap.rs +++ b/kb-lib/src/executor/amm/guac_swap.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/guac_swap.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_guac_swap`. +//! Reserved executor for `amm_guac_swap`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_guac_swap"; +/// Reserved executor for the `amm_guac_swap` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmGuacSwapExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmGuacSwapExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_guac_swap"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_GUAC_SWAP_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_guac_swap"}), + ) { + 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_executor_amm_guac_swap".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/lifinity_swap_v2.rs b/kb-lib/src/executor/amm/lifinity_swap_v2.rs index 6bbd483..e256628 100644 --- a/kb-lib/src/executor/amm/lifinity_swap_v2.rs +++ b/kb-lib/src/executor/amm/lifinity_swap_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/lifinity_swap_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_lifinity_swap_v2`. +//! Reserved executor for `amm_lifinity_swap_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_lifinity_swap_v2"; +/// Reserved executor for the `amm_lifinity_swap_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmLifinitySwapV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmLifinitySwapV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_lifinity_swap_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_LIFINITY_SWAP_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_lifinity_swap_v2"}), + ) { + 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_executor_amm_lifinity_swap_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/metadao_futarchy_amm.rs b/kb-lib/src/executor/amm/metadao_futarchy_amm.rs index 40b5148..5f27a9d 100644 --- a/kb-lib/src/executor/amm/metadao_futarchy_amm.rs +++ b/kb-lib/src/executor/amm/metadao_futarchy_amm.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/metadao_futarchy_amm.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_metadao_futarchy_amm`. +//! Reserved executor for `amm_metadao_futarchy_amm`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_metadao_futarchy_amm"; +/// Reserved executor for the `amm_metadao_futarchy_amm` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmMetadaoFutarchyAmmExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmMetadaoFutarchyAmmExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_metadao_futarchy_amm"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_METADAO_FUTARCHY_AMM_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_metadao_futarchy_amm"}), + ) { + 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_executor_amm_metadao_futarchy_amm".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/metadao_v0_5.rs b/kb-lib/src/executor/amm/metadao_v0_5.rs index d1a8ddc..3663684 100644 --- a/kb-lib/src/executor/amm/metadao_v0_5.rs +++ b/kb-lib/src/executor/amm/metadao_v0_5.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/metadao_v0_5.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_metadao_v0_5`. +//! Reserved executor for `amm_metadao_v0_5`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_metadao_v0_5"; +/// Reserved executor for the `amm_metadao_v0_5` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmMetadaoV05Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmMetadaoV05Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_metadao_v0_5"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_METADAO_V0_5_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_metadao_v0_5"}), + ) { + 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_executor_amm_metadao_v0_5".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/meteora_damm_v1.rs b/kb-lib/src/executor/amm/meteora_damm_v1.rs index b31f08d..655327c 100644 --- a/kb-lib/src/executor/amm/meteora_damm_v1.rs +++ b/kb-lib/src/executor/amm/meteora_damm_v1.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/meteora_damm_v1.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_meteora_damm_v1`. +//! Reserved executor for `amm_meteora_damm_v1`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_meteora_damm_v1"; +/// Reserved executor for the `amm_meteora_damm_v1` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmMeteoraDammV1Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmMeteoraDammV1Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_meteora_damm_v1"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_METEORA_DAMM_V1_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_meteora_damm_v1"}), + ) { + 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_executor_amm_meteora_damm_v1".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/meteora_damm_v2.rs b/kb-lib/src/executor/amm/meteora_damm_v2.rs index b00faf9..0b874f2 100644 --- a/kb-lib/src/executor/amm/meteora_damm_v2.rs +++ b/kb-lib/src/executor/amm/meteora_damm_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/meteora_damm_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_meteora_damm_v2`. +//! Reserved executor for `amm_meteora_damm_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_meteora_damm_v2"; +/// Reserved executor for the `amm_meteora_damm_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmMeteoraDammV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmMeteoraDammV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_meteora_damm_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_METEORA_DAMM_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_meteora_damm_v2"}), + ) { + 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_executor_amm_meteora_damm_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/obric_v2.rs b/kb-lib/src/executor/amm/obric_v2.rs index 752cb9a..3194ba6 100644 --- a/kb-lib/src/executor/amm/obric_v2.rs +++ b/kb-lib/src/executor/amm/obric_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/obric_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_obric_v2`. +//! Reserved executor for `amm_obric_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_obric_v2"; +/// Reserved executor for the `amm_obric_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmObricV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmObricV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_obric_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_OBRIC_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_obric_v2"}), + ) { + 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_executor_amm_obric_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/one_dex.rs b/kb-lib/src/executor/amm/one_dex.rs index 0d89e88..b8376df 100644 --- a/kb-lib/src/executor/amm/one_dex.rs +++ b/kb-lib/src/executor/amm/one_dex.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/one_dex.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_one_dex`. +//! Reserved executor for `amm_one_dex`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_one_dex"; +/// Reserved executor for the `amm_one_dex` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmOneDexExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmOneDexExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_one_dex"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_ONE_DEX_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_one_dex"}), + ) { + 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_executor_amm_one_dex".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/pump_swap.rs b/kb-lib/src/executor/amm/pump_swap.rs index 1216c8a..319be47 100644 --- a/kb-lib/src/executor/amm/pump_swap.rs +++ b/kb-lib/src/executor/amm/pump_swap.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/pump_swap.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_pump_swap`. +//! Reserved executor for `amm_pump_swap`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_pump_swap"; +/// Reserved executor for the `amm_pump_swap` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmPumpSwapExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmPumpSwapExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_pump_swap"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_PUMP_SWAP_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_pump_swap"}), + ) { + 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_executor_amm_pump_swap".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/raydium_lp_v4.rs b/kb-lib/src/executor/amm/raydium_lp_v4.rs index 1f67425..85af230 100644 --- a/kb-lib/src/executor/amm/raydium_lp_v4.rs +++ b/kb-lib/src/executor/amm/raydium_lp_v4.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/raydium_lp_v4.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_raydium_lp_v4`. +//! Reserved executor for `amm_raydium_lp_v4`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_raydium_lp_v4"; +/// Reserved executor for the `amm_raydium_lp_v4` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmRaydiumLpV4Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmRaydiumLpV4Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_raydium_lp_v4"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_RAYDIUM_LP_V4_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_raydium_lp_v4"}), + ) { + 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_executor_amm_raydium_lp_v4".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/solfi.rs b/kb-lib/src/executor/amm/solfi.rs index 79ce671..b1ba1c4 100644 --- a/kb-lib/src/executor/amm/solfi.rs +++ b/kb-lib/src/executor/amm/solfi.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/solfi.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_solfi`. +//! Reserved executor for `amm_solfi`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_solfi"; +/// Reserved executor for the `amm_solfi` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmSolfiExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmSolfiExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_solfi"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_SOLFI_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_solfi"}), + ) { + 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_executor_amm_solfi".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/solfi_v2.rs b/kb-lib/src/executor/amm/solfi_v2.rs index 373d91d..717ecc6 100644 --- a/kb-lib/src/executor/amm/solfi_v2.rs +++ b/kb-lib/src/executor/amm/solfi_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/solfi_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_solfi_v2`. +//! Reserved executor for `amm_solfi_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_solfi_v2"; +/// Reserved executor for the `amm_solfi_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmSolfiV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmSolfiV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_solfi_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_SOLFI_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_solfi_v2"}), + ) { + 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_executor_amm_solfi_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/vertigo.rs b/kb-lib/src/executor/amm/vertigo.rs index b3a1ad7..3c31417 100644 --- a/kb-lib/src/executor/amm/vertigo.rs +++ b/kb-lib/src/executor/amm/vertigo.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/vertigo.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_vertigo`. +//! Reserved executor for `amm_vertigo`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_vertigo"; +/// Reserved executor for the `amm_vertigo` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmVertigoExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmVertigoExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_vertigo"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_VERTIGO_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_vertigo"}), + ) { + 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_executor_amm_vertigo".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/virtuals.rs b/kb-lib/src/executor/amm/virtuals.rs index b5586d9..539d49a 100644 --- a/kb-lib/src/executor/amm/virtuals.rs +++ b/kb-lib/src/executor/amm/virtuals.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/virtuals.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_virtuals`. +//! Reserved executor for `amm_virtuals`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_virtuals"; +/// Reserved executor for the `amm_virtuals` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmVirtualsExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmVirtualsExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_virtuals"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_VIRTUALS_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_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_executor_amm_virtuals".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/woofi.rs b/kb-lib/src/executor/amm/woofi.rs index 45b9786..867f0c7 100644 --- a/kb-lib/src/executor/amm/woofi.rs +++ b/kb-lib/src/executor/amm/woofi.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/woofi.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_woofi`. +//! Reserved executor for `amm_woofi`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_woofi"; +/// Reserved executor for the `amm_woofi` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmWoofiExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmWoofiExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_woofi"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_WOOFI_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_woofi"}), + ) { + 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_executor_amm_woofi".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/zero_fi.rs b/kb-lib/src/executor/amm/zero_fi.rs index 09505d4..f066099 100644 --- a/kb-lib/src/executor/amm/zero_fi.rs +++ b/kb-lib/src/executor/amm/zero_fi.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/zero_fi.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_zero_fi`. +//! Reserved executor for `amm_zero_fi`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_zero_fi"; +/// Reserved executor for the `amm_zero_fi` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmZeroFiExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmZeroFiExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_zero_fi"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_ZERO_FI_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_zero_fi"}), + ) { + 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_executor_amm_zero_fi".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/amm/zora.rs b/kb-lib/src/executor/amm/zora.rs index e49fc62..e76edc1 100644 --- a/kb-lib/src/executor/amm/zora.rs +++ b/kb-lib/src/executor/amm/zora.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/amm/zora.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_amm_zora`. +//! Reserved executor for `amm_zora`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_amm_zora"; +/// Reserved executor for the `amm_zora` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExAmmZoraExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExAmmZoraExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_amm_zora"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::AMM_ZORA_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"amm_zora"}), + ) { + 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_executor_amm_zora".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/bridge.rs b/kb-lib/src/executor/bridge.rs index 08c5b84..36ac5bc 100644 --- a/kb-lib/src/executor/bridge.rs +++ b/kb-lib/src/executor/bridge.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/bridge.rs -// version: 1 +// version: 2 //! `bridge` executor family. @@ -7,3 +7,11 @@ mod circle_cctp_token_messenger_minter; mod circle_cctp_token_messenger_minter_v2; mod layer_zero_endpoint; mod layer_zero_executor; +/// Exposes the reserved `bridge/circle_cctp_token_messenger_minter` executor. +pub use self::circle_cctp_token_messenger_minter::ExBridgeCircleCctpTokenMessengerMinterExecutor; +/// Exposes the reserved `bridge/circle_cctp_token_messenger_minter_v2` executor. +pub use self::circle_cctp_token_messenger_minter_v2::ExBridgeCircleCctpTokenMessengerMinterV2Executor; +/// Exposes the reserved `bridge/layer_zero_endpoint` executor. +pub use self::layer_zero_endpoint::ExBridgeLayerZeroEndpointExecutor; +/// Exposes the reserved `bridge/layer_zero_executor` executor. +pub use self::layer_zero_executor::ExBridgeLayerZeroExecutorExecutor; diff --git a/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter.rs b/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter.rs index 2ebf2fa..ed07cf9 100644 --- a/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter.rs +++ b/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_bridge_circle_cctp_token_messenger_minter`. +//! Reserved executor for `bridge_circle_cctp_token_messenger_minter`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_bridge_circle_cctp_token_messenger_minter"; +/// Reserved executor for the `bridge_circle_cctp_token_messenger_minter` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExBridgeCircleCctpTokenMessengerMinterExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExBridgeCircleCctpTokenMessengerMinterExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_bridge_circle_cctp_token_messenger_minter"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::BRIDGE_CIRCLE_CCTP_TOKEN_MESSENGER_MINTER_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"bridge_circle_cctp_token_messenger_minter"}), + ) { + 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_executor_bridge_circle_cctp_token_messenger_minter".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter_v2.rs b/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter_v2.rs index 361c61d..9cc05d4 100644 --- a/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter_v2.rs +++ b/kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_bridge_circle_cctp_token_messenger_minter_v2`. +//! Reserved executor for `bridge_circle_cctp_token_messenger_minter_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_bridge_circle_cctp_token_messenger_minter_v2"; +/// Reserved executor for the `bridge_circle_cctp_token_messenger_minter_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExBridgeCircleCctpTokenMessengerMinterV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExBridgeCircleCctpTokenMessengerMinterV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_bridge_circle_cctp_token_messenger_minter_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::BRIDGE_CIRCLE_CCTP_TOKEN_MESSENGER_MINTER_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"bridge_circle_cctp_token_messenger_minter_v2"}), + ) { + 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_executor_bridge_circle_cctp_token_messenger_minter_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/bridge/layer_zero_endpoint.rs b/kb-lib/src/executor/bridge/layer_zero_endpoint.rs index 25cea74..d73bc47 100644 --- a/kb-lib/src/executor/bridge/layer_zero_endpoint.rs +++ b/kb-lib/src/executor/bridge/layer_zero_endpoint.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/bridge/layer_zero_endpoint.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_bridge_layer_zero_endpoint`. +//! Reserved executor for `bridge_layer_zero_endpoint`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_bridge_layer_zero_endpoint"; +/// Reserved executor for the `bridge_layer_zero_endpoint` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExBridgeLayerZeroEndpointExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExBridgeLayerZeroEndpointExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_bridge_layer_zero_endpoint"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::BRIDGE_LAYER_ZERO_ENDPOINT_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"bridge_layer_zero_endpoint"}), + ) { + 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_executor_bridge_layer_zero_endpoint".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/bridge/layer_zero_executor.rs b/kb-lib/src/executor/bridge/layer_zero_executor.rs index a13dfe1..998e0c1 100644 --- a/kb-lib/src/executor/bridge/layer_zero_executor.rs +++ b/kb-lib/src/executor/bridge/layer_zero_executor.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/bridge/layer_zero_executor.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_bridge_layer_zero_executor`. +//! Reserved executor for `bridge_layer_zero_executor`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_bridge_layer_zero_executor"; +/// Reserved executor for the `bridge_layer_zero_executor` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExBridgeLayerZeroExecutorExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExBridgeLayerZeroExecutorExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_bridge_layer_zero_executor"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::BRIDGE_LAYER_ZERO_EXECUTOR_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"bridge_layer_zero_executor"}), + ) { + 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_executor_bridge_layer_zero_executor".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/clmm.rs b/kb-lib/src/executor/clmm.rs index 9afb745..1316648 100644 --- a/kb-lib/src/executor/clmm.rs +++ b/kb-lib/src/executor/clmm.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/clmm.rs -// version: 1 +// version: 2 //! `clmm` executor family. @@ -9,3 +9,15 @@ mod orca_whirlpool; mod pancake_swap; mod raydium; mod stabble; +/// Exposes the reserved `clmm/byreal` executor. +pub use self::byreal::ExClmmByrealExecutor; +/// Exposes the reserved `clmm/fusion` executor. +pub use self::fusion::ExClmmFusionExecutor; +/// Exposes the reserved `clmm/orca_whirlpool` executor. +pub use self::orca_whirlpool::ExClmmOrcaWhirlpoolExecutor; +/// Exposes the reserved `clmm/pancake_swap` executor. +pub use self::pancake_swap::ExClmmPancakeSwapExecutor; +/// Exposes the reserved `clmm/raydium` executor. +pub use self::raydium::ExClmmRaydiumExecutor; +/// Exposes the reserved `clmm/stabble` executor. +pub use self::stabble::ExClmmStabbleExecutor; diff --git a/kb-lib/src/executor/clmm/byreal.rs b/kb-lib/src/executor/clmm/byreal.rs index a9c803a..884b4bf 100644 --- a/kb-lib/src/executor/clmm/byreal.rs +++ b/kb-lib/src/executor/clmm/byreal.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/clmm/byreal.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_clmm_byreal`. +//! Reserved executor for `clmm_byreal`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_clmm_byreal"; +/// Reserved executor for the `clmm_byreal` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExClmmByrealExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExClmmByrealExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_clmm_byreal"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CLMM_BYREAL_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"clmm_byreal"}), + ) { + 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_executor_clmm_byreal".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/clmm/fusion.rs b/kb-lib/src/executor/clmm/fusion.rs index 987f0db..fab7825 100644 --- a/kb-lib/src/executor/clmm/fusion.rs +++ b/kb-lib/src/executor/clmm/fusion.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/clmm/fusion.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_clmm_fusion`. +//! Reserved executor for `clmm_fusion`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_clmm_fusion"; +/// Reserved executor for the `clmm_fusion` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExClmmFusionExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExClmmFusionExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_clmm_fusion"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CLMM_FUSION_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"clmm_fusion"}), + ) { + 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_executor_clmm_fusion".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/clmm/orca_whirlpool.rs b/kb-lib/src/executor/clmm/orca_whirlpool.rs index 86f809c..f2a6911 100644 --- a/kb-lib/src/executor/clmm/orca_whirlpool.rs +++ b/kb-lib/src/executor/clmm/orca_whirlpool.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/clmm/orca_whirlpool.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_clmm_orca_whirlpool`. +//! Reserved executor for `clmm_orca_whirlpool`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_clmm_orca_whirlpool"; +/// Reserved executor for the `clmm_orca_whirlpool` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExClmmOrcaWhirlpoolExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExClmmOrcaWhirlpoolExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_clmm_orca_whirlpool"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CLMM_ORCA_WHIRLPOOL_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"clmm_orca_whirlpool"}), + ) { + 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_executor_clmm_orca_whirlpool".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/clmm/pancake_swap.rs b/kb-lib/src/executor/clmm/pancake_swap.rs index f998ccc..237aed5 100644 --- a/kb-lib/src/executor/clmm/pancake_swap.rs +++ b/kb-lib/src/executor/clmm/pancake_swap.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/clmm/pancake_swap.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_clmm_pancake_swap`. +//! Reserved executor for `clmm_pancake_swap`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_clmm_pancake_swap"; +/// Reserved executor for the `clmm_pancake_swap` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExClmmPancakeSwapExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExClmmPancakeSwapExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_clmm_pancake_swap"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CLMM_PANCAKE_SWAP_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"clmm_pancake_swap"}), + ) { + 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_executor_clmm_pancake_swap".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/clmm/raydium.rs b/kb-lib/src/executor/clmm/raydium.rs index 5ea34d7..bfb5493 100644 --- a/kb-lib/src/executor/clmm/raydium.rs +++ b/kb-lib/src/executor/clmm/raydium.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/clmm/raydium.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_clmm_raydium`. +//! Reserved executor for `clmm_raydium`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_clmm_raydium"; +/// Reserved executor for the `clmm_raydium` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExClmmRaydiumExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExClmmRaydiumExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_clmm_raydium"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CLMM_RAYDIUM_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"clmm_raydium"}), + ) { + 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_executor_clmm_raydium".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/clmm/stabble.rs b/kb-lib/src/executor/clmm/stabble.rs index 3640bbf..5148f5d 100644 --- a/kb-lib/src/executor/clmm/stabble.rs +++ b/kb-lib/src/executor/clmm/stabble.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/clmm/stabble.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_clmm_stabble`. +//! Reserved executor for `clmm_stabble`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_clmm_stabble"; +/// Reserved executor for the `clmm_stabble` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExClmmStabbleExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExClmmStabbleExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_clmm_stabble"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CLMM_STABBLE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"clmm_stabble"}), + ) { + 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_executor_clmm_stabble".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/cpmm.rs b/kb-lib/src/executor/cpmm.rs index d1913c8..84276f6 100644 --- a/kb-lib/src/executor/cpmm.rs +++ b/kb-lib/src/executor/cpmm.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/cpmm.rs -// version: 1 +// version: 2 //! `cpmm` executor family. mod raydium; +/// Exposes the reserved `cpmm/raydium` executor. +pub use self::raydium::ExCpmmRaydiumExecutor; diff --git a/kb-lib/src/executor/cpmm/raydium.rs b/kb-lib/src/executor/cpmm/raydium.rs index be53c43..1223bf7 100644 --- a/kb-lib/src/executor/cpmm/raydium.rs +++ b/kb-lib/src/executor/cpmm/raydium.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/cpmm/raydium.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_cpmm_raydium`. +//! Reserved executor for `cpmm_raydium`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_cpmm_raydium"; +/// Reserved executor for the `cpmm_raydium` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExCpmmRaydiumExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExCpmmRaydiumExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_cpmm_raydium"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::CPMM_RAYDIUM_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"cpmm_raydium"}), + ) { + 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_executor_cpmm_raydium".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/dlmm.rs b/kb-lib/src/executor/dlmm.rs index b32fba1..f1874e6 100644 --- a/kb-lib/src/executor/dlmm.rs +++ b/kb-lib/src/executor/dlmm.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/dlmm.rs -// version: 1 +// version: 2 //! `dlmm` executor family. mod meteora; +/// Exposes the reserved `dlmm/meteora` executor. +pub use self::meteora::ExDlmmMeteoraExecutor; diff --git a/kb-lib/src/executor/dlmm/meteora.rs b/kb-lib/src/executor/dlmm/meteora.rs index 9b7e7e4..7ee162f 100644 --- a/kb-lib/src/executor/dlmm/meteora.rs +++ b/kb-lib/src/executor/dlmm/meteora.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/dlmm/meteora.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_dlmm_meteora`. +//! Reserved executor for `dlmm_meteora`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_dlmm_meteora"; +/// Reserved executor for the `dlmm_meteora` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExDlmmMeteoraExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExDlmmMeteoraExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_dlmm_meteora"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::DLMM_METEORA_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"dlmm_meteora"}), + ) { + 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_executor_dlmm_meteora".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/fees.rs b/kb-lib/src/executor/fees.rs index ad9c4c1..458b23a 100644 --- a/kb-lib/src/executor/fees.rs +++ b/kb-lib/src/executor/fees.rs @@ -1,7 +1,11 @@ // file: kb-lib/src/executor/fees.rs -// version: 1 +// version: 2 //! `fees` executor family. mod bags_fee_share_v1; mod bags_fee_share_v2; +/// 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; diff --git a/kb-lib/src/executor/fees/bags_fee_share_v1.rs b/kb-lib/src/executor/fees/bags_fee_share_v1.rs index c8939ce..05591b2 100644 --- a/kb-lib/src/executor/fees/bags_fee_share_v1.rs +++ b/kb-lib/src/executor/fees/bags_fee_share_v1.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/fees/bags_fee_share_v1.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_fees_bags_fee_share_v1`. +//! Reserved executor for `fees_bags_fee_share_v1`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_fees_bags_fee_share_v1"; +/// Reserved executor for the `fees_bags_fee_share_v1` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExFeesBagsFeeShareV1Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExFeesBagsFeeShareV1Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_fees_bags_fee_share_v1"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::FEES_BAGS_FEE_SHARE_V1_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"fees_bags_fee_share_v1"}), + ) { + 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_executor_fees_bags_fee_share_v1".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/fees/bags_fee_share_v2.rs b/kb-lib/src/executor/fees/bags_fee_share_v2.rs index 6053f84..8adea7b 100644 --- a/kb-lib/src/executor/fees/bags_fee_share_v2.rs +++ b/kb-lib/src/executor/fees/bags_fee_share_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/fees/bags_fee_share_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_fees_bags_fee_share_v2`. +//! Reserved executor for `fees_bags_fee_share_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_fees_bags_fee_share_v2"; +/// Reserved executor for the `fees_bags_fee_share_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExFeesBagsFeeShareV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExFeesBagsFeeShareV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_fees_bags_fee_share_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::FEES_BAGS_FEE_SHARE_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"fees_bags_fee_share_v2"}), + ) { + 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_executor_fees_bags_fee_share_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/governance.rs b/kb-lib/src/executor/governance.rs index ee48869..5d12d23 100644 --- a/kb-lib/src/executor/governance.rs +++ b/kb-lib/src/executor/governance.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/governance.rs -// version: 1 +// version: 2 //! `governance` executor family. mod metadao_bid_wall; +/// Exposes the reserved `governance/metadao_bid_wall` executor. +pub use self::metadao_bid_wall::ExGovernanceMetadaoBidWallExecutor; diff --git a/kb-lib/src/executor/governance/metadao_bid_wall.rs b/kb-lib/src/executor/governance/metadao_bid_wall.rs index 420b2f8..c113a6b 100644 --- a/kb-lib/src/executor/governance/metadao_bid_wall.rs +++ b/kb-lib/src/executor/governance/metadao_bid_wall.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/governance/metadao_bid_wall.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_governance_metadao_bid_wall`. +//! Reserved executor for `governance_metadao_bid_wall`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_governance_metadao_bid_wall"; +/// Reserved executor for the `governance_metadao_bid_wall` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExGovernanceMetadaoBidWallExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExGovernanceMetadaoBidWallExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_governance_metadao_bid_wall"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::GOVERNANCE_METADAO_BID_WALL_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"governance_metadao_bid_wall"}), + ) { + 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_executor_governance_metadao_bid_wall".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad.rs b/kb-lib/src/executor/launchpad.rs index b4b5b9e..cbd7a6e 100644 --- a/kb-lib/src/executor/launchpad.rs +++ b/kb-lib/src/executor/launchpad.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/launchpad.rs -// version: 1 +// version: 2 //! `launchpad` executor family. @@ -12,3 +12,21 @@ mod printr; mod pump_fun; mod pump_pumpup_ai; mod raydium_launchlab; +/// Exposes the reserved `launchpad/boop_fun` executor. +pub use self::boop_fun::ExLaunchpadBoopFunExecutor; +/// Exposes the reserved `launchpad/metadao_ico` executor. +pub use self::metadao_ico::ExLaunchpadMetadaoIcoExecutor; +/// Exposes the reserved `launchpad/meteora_dbc` executor. +pub use self::meteora_dbc::ExLaunchpadMeteoraDbcExecutor; +/// Exposes the reserved `launchpad/moonit` executor. +pub use self::moonit::ExLaunchpadMoonitExecutor; +/// Exposes the reserved `launchpad/orca_wavebreak` executor. +pub use self::orca_wavebreak::ExLaunchpadOrcaWavebreakExecutor; +/// Exposes the reserved `launchpad/printr` executor. +pub use self::printr::ExLaunchpadPrintrExecutor; +/// Exposes the reserved `launchpad/pump_fun` executor. +pub use self::pump_fun::ExLaunchpadPumpFunExecutor; +/// Exposes the reserved `launchpad/pump_pumpup_ai` executor. +pub use self::pump_pumpup_ai::ExLaunchpadPumpPumpupAiExecutor; +/// Exposes the reserved `launchpad/raydium_launchlab` executor. +pub use self::raydium_launchlab::ExLaunchpadRaydiumLaunchlabExecutor; diff --git a/kb-lib/src/executor/launchpad/boop_fun.rs b/kb-lib/src/executor/launchpad/boop_fun.rs index 48b240a..6c5f764 100644 --- a/kb-lib/src/executor/launchpad/boop_fun.rs +++ b/kb-lib/src/executor/launchpad/boop_fun.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/boop_fun.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_boop_fun`. +//! Reserved executor for `launchpad_boop_fun`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_boop_fun"; +/// Reserved executor for the `launchpad_boop_fun` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadBoopFunExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadBoopFunExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_boop_fun"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_BOOP_FUN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_boop_fun"}), + ) { + 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_executor_launchpad_boop_fun".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/metadao_ico.rs b/kb-lib/src/executor/launchpad/metadao_ico.rs index 2dccf12..09b721b 100644 --- a/kb-lib/src/executor/launchpad/metadao_ico.rs +++ b/kb-lib/src/executor/launchpad/metadao_ico.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/metadao_ico.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_metadao_ico`. +//! Reserved executor for `launchpad_metadao_ico`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_metadao_ico"; +/// Reserved executor for the `launchpad_metadao_ico` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadMetadaoIcoExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadMetadaoIcoExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_metadao_ico"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_METADAO_ICO_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_metadao_ico"}), + ) { + 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_executor_launchpad_metadao_ico".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/meteora_dbc.rs b/kb-lib/src/executor/launchpad/meteora_dbc.rs index 417eac9..fa86860 100644 --- a/kb-lib/src/executor/launchpad/meteora_dbc.rs +++ b/kb-lib/src/executor/launchpad/meteora_dbc.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/meteora_dbc.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_meteora_dbc`. +//! Reserved executor for `launchpad_meteora_dbc`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_meteora_dbc"; +/// Reserved executor for the `launchpad_meteora_dbc` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadMeteoraDbcExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadMeteoraDbcExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_meteora_dbc"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_METEORA_DBC_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_meteora_dbc"}), + ) { + 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_executor_launchpad_meteora_dbc".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/moonit.rs b/kb-lib/src/executor/launchpad/moonit.rs index ce22f20..bb40ce3 100644 --- a/kb-lib/src/executor/launchpad/moonit.rs +++ b/kb-lib/src/executor/launchpad/moonit.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/moonit.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_moonit`. +//! Reserved executor for `launchpad_moonit`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_moonit"; +/// Reserved executor for the `launchpad_moonit` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadMoonitExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadMoonitExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_moonit"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_MOONIT_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_moonit"}), + ) { + 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_executor_launchpad_moonit".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/orca_wavebreak.rs b/kb-lib/src/executor/launchpad/orca_wavebreak.rs index b50d4f3..81ea198 100644 --- a/kb-lib/src/executor/launchpad/orca_wavebreak.rs +++ b/kb-lib/src/executor/launchpad/orca_wavebreak.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/orca_wavebreak.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_orca_wavebreak`. +//! Reserved executor for `launchpad_orca_wavebreak`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_orca_wavebreak"; +/// Reserved executor for the `launchpad_orca_wavebreak` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadOrcaWavebreakExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadOrcaWavebreakExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_orca_wavebreak"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_ORCA_WAVEBREAK_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_orca_wavebreak"}), + ) { + 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_executor_launchpad_orca_wavebreak".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/printr.rs b/kb-lib/src/executor/launchpad/printr.rs index d6ca468..740a831 100644 --- a/kb-lib/src/executor/launchpad/printr.rs +++ b/kb-lib/src/executor/launchpad/printr.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/printr.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_printr`. +//! Reserved executor for `launchpad_printr`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_printr"; +/// Reserved executor for the `launchpad_printr` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadPrintrExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadPrintrExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_printr"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_PRINTR_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_printr"}), + ) { + 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_executor_launchpad_printr".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/pump_fun.rs b/kb-lib/src/executor/launchpad/pump_fun.rs index 4337755..3c3a5e1 100644 --- a/kb-lib/src/executor/launchpad/pump_fun.rs +++ b/kb-lib/src/executor/launchpad/pump_fun.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/pump_fun.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_pump_fun`. +//! Reserved executor for `launchpad_pump_fun`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_pump_fun"; +/// Reserved executor for the `launchpad_pump_fun` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadPumpFunExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadPumpFunExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_pump_fun"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_PUMP_FUN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_pump_fun"}), + ) { + 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_executor_launchpad_pump_fun".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/pump_pumpup_ai.rs b/kb-lib/src/executor/launchpad/pump_pumpup_ai.rs index dcc20d4..a672284 100644 --- a/kb-lib/src/executor/launchpad/pump_pumpup_ai.rs +++ b/kb-lib/src/executor/launchpad/pump_pumpup_ai.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/pump_pumpup_ai.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_pump_pumpup_ai`. +//! Reserved executor for `launchpad_pump_pumpup_ai`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_pump_pumpup_ai"; +/// Reserved executor for the `launchpad_pump_pumpup_ai` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadPumpPumpupAiExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadPumpPumpupAiExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_pump_pumpup_ai"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_PUMP_PUMPUP_AI_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_pump_pumpup_ai"}), + ) { + 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_executor_launchpad_pump_pumpup_ai".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/launchpad/raydium_launchlab.rs b/kb-lib/src/executor/launchpad/raydium_launchlab.rs index 96e2c1e..492394f 100644 --- a/kb-lib/src/executor/launchpad/raydium_launchlab.rs +++ b/kb-lib/src/executor/launchpad/raydium_launchlab.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/launchpad/raydium_launchlab.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_launchpad_raydium_launchlab`. +//! Reserved executor for `launchpad_raydium_launchlab`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_launchpad_raydium_launchlab"; +/// Reserved executor for the `launchpad_raydium_launchlab` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLaunchpadRaydiumLaunchlabExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLaunchpadRaydiumLaunchlabExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_launchpad_raydium_launchlab"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LAUNCHPAD_RAYDIUM_LAUNCHLAB_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"launchpad_raydium_launchlab"}), + ) { + 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_executor_launchpad_raydium_launchlab".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending.rs b/kb-lib/src/executor/lending.rs index 14e47d0..1617482 100644 --- a/kb-lib/src/executor/lending.rs +++ b/kb-lib/src/executor/lending.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/lending.rs -// version: 1 +// version: 2 //! `lending` executor family. @@ -10,3 +10,17 @@ mod jupiter_lend_flash_loan; mod jupiter_lend_liquidity; mod kamino; mod marginfi_v2; +/// Exposes the reserved `lending/clone` executor. +pub use self::clone::ExLendingCloneExecutor; +/// Exposes the reserved `lending/jupiter_lend_borrow` executor. +pub use self::jupiter_lend_borrow::ExLendingJupiterLendBorrowExecutor; +/// Exposes the reserved `lending/jupiter_lend_earn` executor. +pub use self::jupiter_lend_earn::ExLendingJupiterLendEarnExecutor; +/// Exposes the reserved `lending/jupiter_lend_flash_loan` executor. +pub use self::jupiter_lend_flash_loan::ExLendingJupiterLendFlashLoanExecutor; +/// Exposes the reserved `lending/jupiter_lend_liquidity` executor. +pub use self::jupiter_lend_liquidity::ExLendingJupiterLendLiquidityExecutor; +/// Exposes the reserved `lending/kamino` executor. +pub use self::kamino::ExLendingKaminoExecutor; +/// Exposes the reserved `lending/marginfi_v2` executor. +pub use self::marginfi_v2::ExLendingMarginfiV2Executor; diff --git a/kb-lib/src/executor/lending/clone.rs b/kb-lib/src/executor/lending/clone.rs index aeac188..cc5158a 100644 --- a/kb-lib/src/executor/lending/clone.rs +++ b/kb-lib/src/executor/lending/clone.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/clone.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_clone`. +//! Reserved executor for `lending_clone`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_clone"; +/// Reserved executor for the `lending_clone` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingCloneExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingCloneExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_clone"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_CLONE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_clone"}), + ) { + 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_executor_lending_clone".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending/jupiter_lend_borrow.rs b/kb-lib/src/executor/lending/jupiter_lend_borrow.rs index c4ba60e..2d25f42 100644 --- a/kb-lib/src/executor/lending/jupiter_lend_borrow.rs +++ b/kb-lib/src/executor/lending/jupiter_lend_borrow.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/jupiter_lend_borrow.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_borrow`. +//! Reserved executor for `lending_jupiter_lend_borrow`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_borrow"; +/// Reserved executor for the `lending_jupiter_lend_borrow` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingJupiterLendBorrowExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingJupiterLendBorrowExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_jupiter_lend_borrow"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_JUPITER_LEND_BORROW_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_jupiter_lend_borrow"}), + ) { + 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_executor_lending_jupiter_lend_borrow".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending/jupiter_lend_earn.rs b/kb-lib/src/executor/lending/jupiter_lend_earn.rs index 18bcfbd..6ed29c4 100644 --- a/kb-lib/src/executor/lending/jupiter_lend_earn.rs +++ b/kb-lib/src/executor/lending/jupiter_lend_earn.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/jupiter_lend_earn.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_earn`. +//! Reserved executor for `lending_jupiter_lend_earn`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_earn"; +/// Reserved executor for the `lending_jupiter_lend_earn` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingJupiterLendEarnExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingJupiterLendEarnExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_jupiter_lend_earn"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_JUPITER_LEND_EARN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_jupiter_lend_earn"}), + ) { + 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_executor_lending_jupiter_lend_earn".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending/jupiter_lend_flash_loan.rs b/kb-lib/src/executor/lending/jupiter_lend_flash_loan.rs index 9481dac..f459046 100644 --- a/kb-lib/src/executor/lending/jupiter_lend_flash_loan.rs +++ b/kb-lib/src/executor/lending/jupiter_lend_flash_loan.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/jupiter_lend_flash_loan.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_flash_loan`. +//! Reserved executor for `lending_jupiter_lend_flash_loan`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_flash_loan"; +/// Reserved executor for the `lending_jupiter_lend_flash_loan` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingJupiterLendFlashLoanExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingJupiterLendFlashLoanExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_jupiter_lend_flash_loan"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_JUPITER_LEND_FLASH_LOAN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_jupiter_lend_flash_loan"}), + ) { + 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_executor_lending_jupiter_lend_flash_loan".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending/jupiter_lend_liquidity.rs b/kb-lib/src/executor/lending/jupiter_lend_liquidity.rs index 67b1cc4..8650820 100644 --- a/kb-lib/src/executor/lending/jupiter_lend_liquidity.rs +++ b/kb-lib/src/executor/lending/jupiter_lend_liquidity.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/jupiter_lend_liquidity.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_liquidity`. +//! Reserved executor for `lending_jupiter_lend_liquidity`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_liquidity"; +/// Reserved executor for the `lending_jupiter_lend_liquidity` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingJupiterLendLiquidityExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingJupiterLendLiquidityExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_jupiter_lend_liquidity"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_JUPITER_LEND_LIQUIDITY_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_jupiter_lend_liquidity"}), + ) { + 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_executor_lending_jupiter_lend_liquidity".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending/kamino.rs b/kb-lib/src/executor/lending/kamino.rs index 139d6dd..538e29f 100644 --- a/kb-lib/src/executor/lending/kamino.rs +++ b/kb-lib/src/executor/lending/kamino.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/kamino.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_kamino`. +//! Reserved executor for `lending_kamino`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_kamino"; +/// Reserved executor for the `lending_kamino` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingKaminoExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingKaminoExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_kamino"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_KAMINO_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_kamino"}), + ) { + 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_executor_lending_kamino".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lending/marginfi_v2.rs b/kb-lib/src/executor/lending/marginfi_v2.rs index 0cd1d9c..388c3a3 100644 --- a/kb-lib/src/executor/lending/marginfi_v2.rs +++ b/kb-lib/src/executor/lending/marginfi_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lending/marginfi_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lending_marginfi_v2`. +//! Reserved executor for `lending_marginfi_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lending_marginfi_v2"; +/// Reserved executor for the `lending_marginfi_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLendingMarginfiV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLendingMarginfiV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lending_marginfi_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LENDING_MARGINFI_V2_PROGRAM_ID]; + } + + fn supports_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lending_marginfi_v2"}), + ) { + 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_executor_lending_marginfi_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/lock.rs b/kb-lib/src/executor/lock.rs index 75953bd..ef57f47 100644 --- a/kb-lib/src/executor/lock.rs +++ b/kb-lib/src/executor/lock.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/lock.rs -// version: 1 +// version: 2 //! `lock` executor family. mod raydium_lp; +/// Exposes the reserved `lock/raydium_lp` executor. +pub use self::raydium_lp::ExLockRaydiumLpExecutor; diff --git a/kb-lib/src/executor/lock/raydium_lp.rs b/kb-lib/src/executor/lock/raydium_lp.rs index 07f8d88..c48c42a 100644 --- a/kb-lib/src/executor/lock/raydium_lp.rs +++ b/kb-lib/src/executor/lock/raydium_lp.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/lock/raydium_lp.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_lock_raydium_lp`. +//! Reserved executor for `lock_raydium_lp`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_lock_raydium_lp"; +/// Reserved executor for the `lock_raydium_lp` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExLockRaydiumLpExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExLockRaydiumLpExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_lock_raydium_lp"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::LOCK_RAYDIUM_LP_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"lock_raydium_lp"}), + ) { + 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_executor_lock_raydium_lp".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/metadata.rs b/kb-lib/src/executor/metadata.rs index 38df151..ce8605d 100644 --- a/kb-lib/src/executor/metadata.rs +++ b/kb-lib/src/executor/metadata.rs @@ -1,7 +1,11 @@ // file: kb-lib/src/executor/metadata.rs -// version: 1 +// version: 2 //! `metadata` executor family. mod metaplex_token_metadata; mod spl_name_service; +/// Exposes the reserved `metadata/metaplex_token_metadata` executor. +pub use self::metaplex_token_metadata::ExMetadataMetaplexTokenMetadataExecutor; +/// Exposes the reserved `metadata/spl_name_service` executor. +pub use self::spl_name_service::ExMetadataSplNameServiceExecutor; diff --git a/kb-lib/src/executor/metadata/metaplex_token_metadata.rs b/kb-lib/src/executor/metadata/metaplex_token_metadata.rs index 3f04199..d6eb580 100644 --- a/kb-lib/src/executor/metadata/metaplex_token_metadata.rs +++ b/kb-lib/src/executor/metadata/metaplex_token_metadata.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/metadata/metaplex_token_metadata.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_metadata_metaplex_token_metadata`. +//! Reserved executor for `metadata_metaplex_token_metadata`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_metadata_metaplex_token_metadata"; +/// Reserved executor for the `metadata_metaplex_token_metadata` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExMetadataMetaplexTokenMetadataExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExMetadataMetaplexTokenMetadataExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_metadata_metaplex_token_metadata"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::METADATA_METAPLEX_TOKEN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &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), + }; + return std::result::Result::Ok(crate::ExApiExecutionPlan { + executor_name: "kb_executor_metadata_metaplex_token_metadata".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/metadata/spl_name_service.rs b/kb-lib/src/executor/metadata/spl_name_service.rs index 4319563..fd107f4 100644 --- a/kb-lib/src/executor/metadata/spl_name_service.rs +++ b/kb-lib/src/executor/metadata/spl_name_service.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/metadata/spl_name_service.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_metadata_spl_name_service`. +//! Reserved executor for `metadata_spl_name_service`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_metadata_spl_name_service"; +/// Reserved executor for the `metadata_spl_name_service` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExMetadataSplNameServiceExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExMetadataSplNameServiceExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_metadata_spl_name_service"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::METADATA_SPL_NAME_SERVICE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"metadata_spl_name_service"}), + ) { + 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_executor_metadata_spl_name_service".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/nft.rs b/kb-lib/src/executor/nft.rs index 925c37e..dd60238 100644 --- a/kb-lib/src/executor/nft.rs +++ b/kb-lib/src/executor/nft.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/nft.rs -// version: 1 +// version: 2 //! `nft` executor family. mod metaplex_bubblegum; +/// Exposes the reserved `nft/metaplex_bubblegum` executor. +pub use self::metaplex_bubblegum::ExNftMetaplexBubblegumExecutor; diff --git a/kb-lib/src/executor/nft/metaplex_bubblegum.rs b/kb-lib/src/executor/nft/metaplex_bubblegum.rs index 227f334..441a2f5 100644 --- a/kb-lib/src/executor/nft/metaplex_bubblegum.rs +++ b/kb-lib/src/executor/nft/metaplex_bubblegum.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/nft/metaplex_bubblegum.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_nft_metaplex_bubblegum`. +//! Reserved executor for `nft_metaplex_bubblegum`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_nft_metaplex_bubblegum"; +/// Reserved executor for the `nft_metaplex_bubblegum` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExNftMetaplexBubblegumExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExNftMetaplexBubblegumExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_nft_metaplex_bubblegum"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::NFT_METAPLEX_BUBBLEGUM_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"nft_metaplex_bubblegum"}), + ) { + 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_executor_nft_metaplex_bubblegum".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/orderbook.rs b/kb-lib/src/executor/orderbook.rs index 248388a..322ee33 100644 --- a/kb-lib/src/executor/orderbook.rs +++ b/kb-lib/src/executor/orderbook.rs @@ -1,8 +1,14 @@ // file: kb-lib/src/executor/orderbook.rs -// version: 1 +// version: 2 //! `orderbook` executor family. mod jupiter_limit_order; mod jupiter_limit_order_v2; mod openbook_v2; +/// Exposes the reserved `orderbook/jupiter_limit_order` executor. +pub use self::jupiter_limit_order::ExOrderbookJupiterLimitOrderExecutor; +/// Exposes the reserved `orderbook/jupiter_limit_order_v2` executor. +pub use self::jupiter_limit_order_v2::ExOrderbookJupiterLimitOrderV2Executor; +/// Exposes the reserved `orderbook/openbook_v2` executor. +pub use self::openbook_v2::ExOrderbookOpenbookV2Executor; diff --git a/kb-lib/src/executor/orderbook/jupiter_limit_order.rs b/kb-lib/src/executor/orderbook/jupiter_limit_order.rs index 02eda6c..73bd3f8 100644 --- a/kb-lib/src/executor/orderbook/jupiter_limit_order.rs +++ b/kb-lib/src/executor/orderbook/jupiter_limit_order.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/orderbook/jupiter_limit_order.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_orderbook_jupiter_limit_order`. +//! Reserved executor for `orderbook_jupiter_limit_order`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_orderbook_jupiter_limit_order"; +/// Reserved executor for the `orderbook_jupiter_limit_order` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExOrderbookJupiterLimitOrderExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExOrderbookJupiterLimitOrderExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_orderbook_jupiter_limit_order"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ORDERBOOK_JUPITER_LIMIT_ORDER_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"orderbook_jupiter_limit_order"}), + ) { + 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_executor_orderbook_jupiter_limit_order".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/orderbook/jupiter_limit_order_v2.rs b/kb-lib/src/executor/orderbook/jupiter_limit_order_v2.rs index f7a7980..a9fdff6 100644 --- a/kb-lib/src/executor/orderbook/jupiter_limit_order_v2.rs +++ b/kb-lib/src/executor/orderbook/jupiter_limit_order_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/orderbook/jupiter_limit_order_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_orderbook_jupiter_limit_order_v2`. +//! Reserved executor for `orderbook_jupiter_limit_order_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_orderbook_jupiter_limit_order_v2"; +/// Reserved executor for the `orderbook_jupiter_limit_order_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExOrderbookJupiterLimitOrderV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExOrderbookJupiterLimitOrderV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_orderbook_jupiter_limit_order_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ORDERBOOK_JUPITER_LIMIT_ORDER_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"orderbook_jupiter_limit_order_v2"}), + ) { + 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_executor_orderbook_jupiter_limit_order_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/orderbook/openbook_v2.rs b/kb-lib/src/executor/orderbook/openbook_v2.rs index b56fd80..5d21607 100644 --- a/kb-lib/src/executor/orderbook/openbook_v2.rs +++ b/kb-lib/src/executor/orderbook/openbook_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/orderbook/openbook_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_orderbook_openbook_v2`. +//! Reserved executor for `orderbook_openbook_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_orderbook_openbook_v2"; +/// Reserved executor for the `orderbook_openbook_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExOrderbookOpenbookV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExOrderbookOpenbookV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_orderbook_openbook_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ORDERBOOK_OPENBOOK_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"orderbook_openbook_v2"}), + ) { + 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_executor_orderbook_openbook_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/perpetuals.rs b/kb-lib/src/executor/perpetuals.rs index f7586fa..80ee97c 100644 --- a/kb-lib/src/executor/perpetuals.rs +++ b/kb-lib/src/executor/perpetuals.rs @@ -1,8 +1,14 @@ // file: kb-lib/src/executor/perpetuals.rs -// version: 1 +// version: 2 //! `perpetuals` executor family. mod drift_v2; mod jupiter; 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/zeta` executor. +pub use self::zeta::ExPerpetualsZetaExecutor; diff --git a/kb-lib/src/executor/perpetuals/drift_v2.rs b/kb-lib/src/executor/perpetuals/drift_v2.rs index 5e533ad..b3951b2 100644 --- a/kb-lib/src/executor/perpetuals/drift_v2.rs +++ b/kb-lib/src/executor/perpetuals/drift_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/perpetuals/drift_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_perpetuals_drift_v2`. +//! Reserved executor for `perpetuals_drift_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_perpetuals_drift_v2"; +/// Reserved executor for the `perpetuals_drift_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExPerpetualsDriftV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExPerpetualsDriftV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_perpetuals_drift_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::PERPETUALS_DRIFT_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"perpetuals_drift_v2"}), + ) { + 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_executor_perpetuals_drift_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/perpetuals/jupiter.rs b/kb-lib/src/executor/perpetuals/jupiter.rs index 29c0eeb..21597c4 100644 --- a/kb-lib/src/executor/perpetuals/jupiter.rs +++ b/kb-lib/src/executor/perpetuals/jupiter.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/perpetuals/jupiter.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_perpetuals_jupiter`. +//! Reserved executor for `perpetuals_jupiter`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_perpetuals_jupiter"; +/// Reserved executor for the `perpetuals_jupiter` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExPerpetualsJupiterExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExPerpetualsJupiterExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_perpetuals_jupiter"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::PERPETUALS_JUPITER_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"perpetuals_jupiter"}), + ) { + 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_executor_perpetuals_jupiter".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/perpetuals/zeta.rs b/kb-lib/src/executor/perpetuals/zeta.rs index e877665..f9c6d70 100644 --- a/kb-lib/src/executor/perpetuals/zeta.rs +++ b/kb-lib/src/executor/perpetuals/zeta.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/perpetuals/zeta.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_perpetuals_zeta`. +//! Reserved executor for `perpetuals_zeta`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_perpetuals_zeta"; +/// Reserved executor for the `perpetuals_zeta` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExPerpetualsZetaExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExPerpetualsZetaExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_perpetuals_zeta"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::PERPETUALS_ZETA_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"perpetuals_zeta"}), + ) { + 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_executor_perpetuals_zeta".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/router.rs b/kb-lib/src/executor/router.rs index 063d3f9..60c3cf1 100644 --- a/kb-lib/src/executor/router.rs +++ b/kb-lib/src/executor/router.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/router.rs -// version: 1 +// version: 2 //! `router` executor family. @@ -9,3 +9,15 @@ 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. +pub use self::okx_labs_v2::ExRouterOkxLabsV2Executor; diff --git a/kb-lib/src/executor/router/dflow_aggregator_v4.rs b/kb-lib/src/executor/router/dflow_aggregator_v4.rs index 86c8b6e..a628d51 100644 --- a/kb-lib/src/executor/router/dflow_aggregator_v4.rs +++ b/kb-lib/src/executor/router/dflow_aggregator_v4.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/router/dflow_aggregator_v4.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_router_dflow_aggregator_v4`. +//! Reserved executor for `router_dflow_aggregator_v4`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_router_dflow_aggregator_v4"; +/// Reserved executor for the `router_dflow_aggregator_v4` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRouterDflowAggregatorV4Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRouterDflowAggregatorV4Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_router_dflow_aggregator_v4"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ROUTER_DFLOW_AGGREGATOR_V4_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"router_dflow_aggregator_v4"}), + ) { + 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_executor_router_dflow_aggregator_v4".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/router/jupiter_aggregator_v4.rs b/kb-lib/src/executor/router/jupiter_aggregator_v4.rs index ccd3013..e00431c 100644 --- a/kb-lib/src/executor/router/jupiter_aggregator_v4.rs +++ b/kb-lib/src/executor/router/jupiter_aggregator_v4.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/router/jupiter_aggregator_v4.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_router_jupiter_aggregator_v4`. +//! Reserved executor for `router_jupiter_aggregator_v4`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_router_jupiter_aggregator_v4"; +/// Reserved executor for the `router_jupiter_aggregator_v4` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRouterJupiterAggregatorV4Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRouterJupiterAggregatorV4Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_router_jupiter_aggregator_v4"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ROUTER_JUPITER_AGGREGATOR_V4_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"router_jupiter_aggregator_v4"}), + ) { + 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_executor_router_jupiter_aggregator_v4".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/router/jupiter_aggregator_v6.rs b/kb-lib/src/executor/router/jupiter_aggregator_v6.rs index 173b958..2f4ca87 100644 --- a/kb-lib/src/executor/router/jupiter_aggregator_v6.rs +++ b/kb-lib/src/executor/router/jupiter_aggregator_v6.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/router/jupiter_aggregator_v6.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_router_jupiter_aggregator_v6`. +//! Reserved executor for `router_jupiter_aggregator_v6`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_router_jupiter_aggregator_v6"; +/// Reserved executor for the `router_jupiter_aggregator_v6` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRouterJupiterAggregatorV6Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRouterJupiterAggregatorV6Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_router_jupiter_aggregator_v6"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ROUTER_JUPITER_AGGREGATOR_V6_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"router_jupiter_aggregator_v6"}), + ) { + 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_executor_router_jupiter_aggregator_v6".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/router/jupiter_dca.rs b/kb-lib/src/executor/router/jupiter_dca.rs index 6f9024d..2244fb0 100644 --- a/kb-lib/src/executor/router/jupiter_dca.rs +++ b/kb-lib/src/executor/router/jupiter_dca.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/router/jupiter_dca.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_router_jupiter_dca`. +//! Reserved executor for `router_jupiter_dca`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_router_jupiter_dca"; +/// Reserved executor for the `router_jupiter_dca` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRouterJupiterDcaExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRouterJupiterDcaExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_router_jupiter_dca"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ROUTER_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"router_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_executor_router_jupiter_dca".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/router/okx_labs_v1.rs b/kb-lib/src/executor/router/okx_labs_v1.rs index b5f07c3..698b263 100644 --- a/kb-lib/src/executor/router/okx_labs_v1.rs +++ b/kb-lib/src/executor/router/okx_labs_v1.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/router/okx_labs_v1.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_router_okx_labs_v1`. +//! Reserved executor for `router_okx_labs_v1`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_router_okx_labs_v1"; +/// Reserved executor for the `router_okx_labs_v1` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRouterOkxLabsV1Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRouterOkxLabsV1Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_router_okx_labs_v1"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ROUTER_OKX_LABS_V1_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"router_okx_labs_v1"}), + ) { + 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_executor_router_okx_labs_v1".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/router/okx_labs_v2.rs b/kb-lib/src/executor/router/okx_labs_v2.rs index 6fbd9bb..b4161e3 100644 --- a/kb-lib/src/executor/router/okx_labs_v2.rs +++ b/kb-lib/src/executor/router/okx_labs_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/router/okx_labs_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_router_okx_labs_v2`. +//! Reserved executor for `router_okx_labs_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_router_okx_labs_v2"; +/// Reserved executor for the `router_okx_labs_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRouterOkxLabsV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRouterOkxLabsV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_router_okx_labs_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ROUTER_OKX_LABS_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"router_okx_labs_v2"}), + ) { + 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_executor_router_okx_labs_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/rwa.rs b/kb-lib/src/executor/rwa.rs index 9fd3357..5e7dd99 100644 --- a/kb-lib/src/executor/rwa.rs +++ b/kb-lib/src/executor/rwa.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/rwa.rs -// version: 1 +// version: 2 //! `rwa` executor family. mod ondo_global_markets; +/// Exposes the reserved `rwa/ondo_global_markets` executor. +pub use self::ondo_global_markets::ExRwaOndoGlobalMarketsExecutor; diff --git a/kb-lib/src/executor/rwa/ondo_global_markets.rs b/kb-lib/src/executor/rwa/ondo_global_markets.rs index 504d43f..15e9e6f 100644 --- a/kb-lib/src/executor/rwa/ondo_global_markets.rs +++ b/kb-lib/src/executor/rwa/ondo_global_markets.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/rwa/ondo_global_markets.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_rwa_ondo_global_markets`. +//! Reserved executor for `rwa_ondo_global_markets`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_rwa_ondo_global_markets"; +/// Reserved executor for the `rwa_ondo_global_markets` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExRwaOndoGlobalMarketsExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExRwaOndoGlobalMarketsExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_rwa_ondo_global_markets"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::RWA_ONDO_GLOBAL_MARKETS_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"rwa_ondo_global_markets"}), + ) { + 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_executor_rwa_ondo_global_markets".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/solana.rs b/kb-lib/src/executor/solana.rs index c164ea1..ecfd9e4 100644 --- a/kb-lib/src/executor/solana.rs +++ b/kb-lib/src/executor/solana.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/solana.rs -// version: 1 +// version: 2 //! `solana` executor family. mod core; +/// Exposes the reserved `solana/core` executor. +pub use self::core::ExSolanaCoreExecutor; diff --git a/kb-lib/src/executor/solana/core.rs b/kb-lib/src/executor/solana/core.rs index 7e53f98..0000f81 100644 --- a/kb-lib/src/executor/solana/core.rs +++ b/kb-lib/src/executor/solana/core.rs @@ -1,10 +1,68 @@ // file: kb-lib/src/executor/solana/core.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_solana_core`. +//! Reserved executor for `solana_core`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_solana_core"; +/// Reserved executor for the `solana_core` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSolanaCoreExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSolanaCoreExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_solana_core"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[ + kb_program_ids::ADDRESS_LOOKUP_TABLE_PROGRAM_ID, + kb_program_ids::BPF_LOADER_DEPRECATED_PROGRAM_ID, + kb_program_ids::BPF_LOADER_PROGRAM_ID, + kb_program_ids::BPF_LOADER_UPGRADEABLE_PROGRAM_ID, + kb_program_ids::COMPUTE_BUDGET_PROGRAM_ID, + kb_program_ids::CONFIG_PROGRAM_ID, + kb_program_ids::ED25519_PROGRAM_ID, + kb_program_ids::FEATURE_PROGRAM_ID, + kb_program_ids::LOADER_V4_PROGRAM_ID, + kb_program_ids::NATIVE_LOADER_PROGRAM_ID, + kb_program_ids::SECP256K1_PROGRAM_ID, + kb_program_ids::SECP256R1_PROGRAM_ID, + kb_program_ids::SLASHING_PROGRAM_ID, + kb_program_ids::STAKE_PROGRAM_ID, + kb_program_ids::SYSTEM_PROGRAM_ID, + kb_program_ids::VOTE_PROGRAM_ID, + kb_program_ids::ZK_ELGAMAL_PROOF_PROGRAM_ID, + kb_program_ids::ZK_TOKEN_PROOF_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"solana_core"}), + ) { + 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_executor_solana_core".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl.rs b/kb-lib/src/executor/spl.rs index 2df3a8f..75a5c20 100644 --- a/kb-lib/src/executor/spl.rs +++ b/kb-lib/src/executor/spl.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/spl.rs -// version: 1 +// version: 2 //! `spl` executor family. @@ -12,3 +12,21 @@ mod single_pool; mod stake_pool; mod token; mod token2022; +/// Exposes the reserved `spl/account_compression` executor. +pub use self::account_compression::ExSplAccountCompressionExecutor; +/// Exposes the reserved `spl/associated_token_account` executor. +pub use self::associated_token_account::ExSplAssociatedTokenAccountExecutor; +/// Exposes the reserved `spl/elgamal_registry` executor. +pub use self::elgamal_registry::ExSplElgamalRegistryExecutor; +/// Exposes the reserved `spl/memo` executor. +pub use self::memo::ExSplMemoExecutor; +/// Exposes the reserved `spl/noop` executor. +pub use self::noop::ExSplNoopExecutor; +/// Exposes the reserved `spl/single_pool` executor. +pub use self::single_pool::ExSplSinglePoolExecutor; +/// Exposes the reserved `spl/stake_pool` executor. +pub use self::stake_pool::ExSplStakePoolExecutor; +/// Exposes the reserved `spl/token` executor. +pub use self::token::ExSplTokenExecutor; +/// Exposes the reserved `spl/token2022` executor. +pub use self::token2022::ExSplToken2022Executor; diff --git a/kb-lib/src/executor/spl/account_compression.rs b/kb-lib/src/executor/spl/account_compression.rs index dc12c17..d1f71d7 100644 --- a/kb-lib/src/executor/spl/account_compression.rs +++ b/kb-lib/src/executor/spl/account_compression.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/account_compression.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_account_compression`. +//! Reserved executor for `spl_account_compression`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_account_compression"; +/// Reserved executor for the `spl_account_compression` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplAccountCompressionExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplAccountCompressionExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_account_compression"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_ACCOUNT_COMPRESSION_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_account_compression"}), + ) { + 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_executor_spl_account_compression".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/associated_token_account.rs b/kb-lib/src/executor/spl/associated_token_account.rs index 193f657..3646ce1 100644 --- a/kb-lib/src/executor/spl/associated_token_account.rs +++ b/kb-lib/src/executor/spl/associated_token_account.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/associated_token_account.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_associated_token_account`. +//! Reserved executor for `spl_associated_token_account`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_associated_token_account"; +/// Reserved executor for the `spl_associated_token_account` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplAssociatedTokenAccountExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplAssociatedTokenAccountExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_associated_token_account"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::ASSOCIATED_TOKEN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_associated_token_account"}), + ) { + 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_executor_spl_associated_token_account".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/elgamal_registry.rs b/kb-lib/src/executor/spl/elgamal_registry.rs index b230fcb..ac26969 100644 --- a/kb-lib/src/executor/spl/elgamal_registry.rs +++ b/kb-lib/src/executor/spl/elgamal_registry.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/elgamal_registry.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_elgamal_registry`. +//! Reserved executor for `spl_elgamal_registry`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_elgamal_registry"; +/// Reserved executor for the `spl_elgamal_registry` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplElgamalRegistryExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplElgamalRegistryExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_elgamal_registry"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_TOKEN2022_ELGAMAL_REGISTRY_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_elgamal_registry"}), + ) { + 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_executor_spl_elgamal_registry".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/memo.rs b/kb-lib/src/executor/spl/memo.rs index a88265a..95d2436 100644 --- a/kb-lib/src/executor/spl/memo.rs +++ b/kb-lib/src/executor/spl/memo.rs @@ -1,10 +1,53 @@ // file: kb-lib/src/executor/spl/memo.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_memo`. +//! Reserved executor for `spl_memo`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_memo"; +/// Reserved executor for the `spl_memo` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplMemoExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplMemoExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_memo"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[ + kb_program_ids::SPL_MEMO_V1_PROGRAM_ID, + kb_program_ids::SPL_MEMO_V3_PROGRAM_ID, + kb_program_ids::SPL_MEMO_V4_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_memo"}), + ) { + 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_executor_spl_memo".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/noop.rs b/kb-lib/src/executor/spl/noop.rs index f3b26d8..888a5be 100644 --- a/kb-lib/src/executor/spl/noop.rs +++ b/kb-lib/src/executor/spl/noop.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/noop.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_noop`. +//! Reserved executor for `spl_noop`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_noop"; +/// Reserved executor for the `spl_noop` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplNoopExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplNoopExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_noop"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_NOOP_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_noop"}), + ) { + 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_executor_spl_noop".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/single_pool.rs b/kb-lib/src/executor/spl/single_pool.rs index 64a715a..016bd93 100644 --- a/kb-lib/src/executor/spl/single_pool.rs +++ b/kb-lib/src/executor/spl/single_pool.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/single_pool.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_single_pool`. +//! Reserved executor for `spl_single_pool`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_single_pool"; +/// Reserved executor for the `spl_single_pool` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplSinglePoolExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplSinglePoolExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_single_pool"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_SINGLE_POOL_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_single_pool"}), + ) { + 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_executor_spl_single_pool".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/stake_pool.rs b/kb-lib/src/executor/spl/stake_pool.rs index bea9030..34c7bb9 100644 --- a/kb-lib/src/executor/spl/stake_pool.rs +++ b/kb-lib/src/executor/spl/stake_pool.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/stake_pool.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_stake_pool`. +//! Reserved executor for `spl_stake_pool`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_stake_pool"; +/// Reserved executor for the `spl_stake_pool` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplStakePoolExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplStakePoolExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_stake_pool"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_STAKE_POOL_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_stake_pool"}), + ) { + 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_executor_spl_stake_pool".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/token.rs b/kb-lib/src/executor/spl/token.rs index 6bde217..7654d42 100644 --- a/kb-lib/src/executor/spl/token.rs +++ b/kb-lib/src/executor/spl/token.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/token.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_token`. +//! Reserved executor for `spl_token`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_token"; +/// Reserved executor for the `spl_token` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplTokenExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplTokenExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_token"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_TOKEN_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_token"}), + ) { + 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_executor_spl_token".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/spl/token2022.rs b/kb-lib/src/executor/spl/token2022.rs index 6fa7b37..a3b076b 100644 --- a/kb-lib/src/executor/spl/token2022.rs +++ b/kb-lib/src/executor/spl/token2022.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/spl/token2022.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_spl_token_2022`. +//! Reserved executor for `spl_token2022`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_spl_token2022"; +/// Reserved executor for the `spl_token2022` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExSplToken2022Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExSplToken2022Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_spl_token2022"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::SPL_TOKEN2022_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"spl_token2022"}), + ) { + 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_executor_spl_token2022".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/stable.rs b/kb-lib/src/executor/stable.rs index 0357764..a192c0e 100644 --- a/kb-lib/src/executor/stable.rs +++ b/kb-lib/src/executor/stable.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/stable.rs -// version: 1 +// version: 2 //! `stable` executor family. @@ -7,3 +7,11 @@ mod swap_hylo_exchange; mod swap_jupiter_stable; mod swap_numeraire; mod swap_stabble; +/// Exposes the reserved `stable/swap_hylo_exchange` executor. +pub use self::swap_hylo_exchange::ExStableSwapHyloExchangeExecutor; +/// Exposes the reserved `stable/swap_jupiter_stable` executor. +pub use self::swap_jupiter_stable::ExStableSwapJupiterStableExecutor; +/// Exposes the reserved `stable/swap_numeraire` executor. +pub use self::swap_numeraire::ExStableSwapNumeraireExecutor; +/// Exposes the reserved `stable/swap_stabble` executor. +pub use self::swap_stabble::ExStableSwapStabbleExecutor; diff --git a/kb-lib/src/executor/stable/swap_hylo_exchange.rs b/kb-lib/src/executor/stable/swap_hylo_exchange.rs index 9486fc6..23917c1 100644 --- a/kb-lib/src/executor/stable/swap_hylo_exchange.rs +++ b/kb-lib/src/executor/stable/swap_hylo_exchange.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/stable/swap_hylo_exchange.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_stable_swap_hylo_exchange`. +//! Reserved executor for `stable_swap_hylo_exchange`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_stable_swap_hylo_exchange"; +/// Reserved executor for the `stable_swap_hylo_exchange` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStableSwapHyloExchangeExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStableSwapHyloExchangeExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_stable_swap_hylo_exchange"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STABLE_SWAP_HYLO_EXCHANGE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"stable_swap_hylo_exchange"}), + ) { + 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_executor_stable_swap_hylo_exchange".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/stable/swap_jupiter_stable.rs b/kb-lib/src/executor/stable/swap_jupiter_stable.rs index 56db504..9726aa0 100644 --- a/kb-lib/src/executor/stable/swap_jupiter_stable.rs +++ b/kb-lib/src/executor/stable/swap_jupiter_stable.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/stable/swap_jupiter_stable.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_stable_swap_jupiter_stable`. +//! Reserved executor for `stable_swap_jupiter_stable`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_stable_swap_jupiter_stable"; +/// Reserved executor for the `stable_swap_jupiter_stable` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStableSwapJupiterStableExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStableSwapJupiterStableExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_stable_swap_jupiter_stable"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STABLE_SWAP_JUPITER_STABLE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"stable_swap_jupiter_stable"}), + ) { + 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_executor_stable_swap_jupiter_stable".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/stable/swap_numeraire.rs b/kb-lib/src/executor/stable/swap_numeraire.rs index 95afdc6..222536b 100644 --- a/kb-lib/src/executor/stable/swap_numeraire.rs +++ b/kb-lib/src/executor/stable/swap_numeraire.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/stable/swap_numeraire.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_stable_swap_numeraire`. +//! Reserved executor for `stable_swap_numeraire`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_stable_swap_numeraire"; +/// Reserved executor for the `stable_swap_numeraire` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStableSwapNumeraireExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStableSwapNumeraireExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_stable_swap_numeraire"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STABLE_SWAP_NUMERAIRE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"stable_swap_numeraire"}), + ) { + 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_executor_stable_swap_numeraire".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/stable/swap_stabble.rs b/kb-lib/src/executor/stable/swap_stabble.rs index cb02240..3c7e8c8 100644 --- a/kb-lib/src/executor/stable/swap_stabble.rs +++ b/kb-lib/src/executor/stable/swap_stabble.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/stable/swap_stabble.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_stable_swap_stabble`. +//! Reserved executor for `stable_swap_stabble`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_stable_swap_stabble"; +/// Reserved executor for the `stable_swap_stabble` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStableSwapStabbleExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStableSwapStabbleExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_stable_swap_stabble"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STABLE_SWAP_STABBLE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"stable_swap_stabble"}), + ) { + 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_executor_stable_swap_stabble".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/staking.rs b/kb-lib/src/executor/staking.rs index f48ac3c..92e3652 100644 --- a/kb-lib/src/executor/staking.rs +++ b/kb-lib/src/executor/staking.rs @@ -1,8 +1,14 @@ // file: kb-lib/src/executor/staking.rs -// version: 1 +// version: 2 //! `staking` executor family. mod kamino_farm; mod marinade_finance; mod solayer; +/// Exposes the reserved `staking/kamino_farm` executor. +pub use self::kamino_farm::ExStakingKaminoFarmExecutor; +/// Exposes the reserved `staking/marinade_finance` executor. +pub use self::marinade_finance::ExStakingMarinadeFinanceExecutor; +/// Exposes the reserved `staking/solayer` executor. +pub use self::solayer::ExStakingSolayerExecutor; diff --git a/kb-lib/src/executor/staking/kamino_farm.rs b/kb-lib/src/executor/staking/kamino_farm.rs index 33c53f4..7b0e05f 100644 --- a/kb-lib/src/executor/staking/kamino_farm.rs +++ b/kb-lib/src/executor/staking/kamino_farm.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/staking/kamino_farm.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_staking_kamino_farm`. +//! Reserved executor for `staking_kamino_farm`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_staking_kamino_farm"; +/// Reserved executor for the `staking_kamino_farm` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStakingKaminoFarmExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStakingKaminoFarmExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_staking_kamino_farm"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STAKING_KAMINO_FARM_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"staking_kamino_farm"}), + ) { + 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_executor_staking_kamino_farm".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/staking/marinade_finance.rs b/kb-lib/src/executor/staking/marinade_finance.rs index 930ef3c..5bdb52b 100644 --- a/kb-lib/src/executor/staking/marinade_finance.rs +++ b/kb-lib/src/executor/staking/marinade_finance.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/staking/marinade_finance.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_staking_marinade_finance`. +//! Reserved executor for `staking_marinade_finance`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_staking_marinade_finance"; +/// Reserved executor for the `staking_marinade_finance` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStakingMarinadeFinanceExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStakingMarinadeFinanceExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_staking_marinade_finance"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STAKING_MARINADE_FINANCE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"staking_marinade_finance"}), + ) { + 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_executor_staking_marinade_finance".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/staking/solayer.rs b/kb-lib/src/executor/staking/solayer.rs index 0d8823b..cd12921 100644 --- a/kb-lib/src/executor/staking/solayer.rs +++ b/kb-lib/src/executor/staking/solayer.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/staking/solayer.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_staking_solayer`. +//! Reserved executor for `staking_solayer`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_staking_solayer"; +/// Reserved executor for the `staking_solayer` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExStakingSolayerExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExStakingSolayerExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_staking_solayer"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::STAKING_SOLAYER_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"staking_solayer"}), + ) { + 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_executor_staking_solayer".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/treasury.rs b/kb-lib/src/executor/treasury.rs index 3d62acc..083f517 100644 --- a/kb-lib/src/executor/treasury.rs +++ b/kb-lib/src/executor/treasury.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/treasury.rs -// version: 1 +// version: 2 //! `treasury` executor family. mod helium_treasury_management; +/// Exposes the reserved `treasury/helium_treasury_management` executor. +pub use self::helium_treasury_management::ExTreasuryHeliumTreasuryManagementExecutor; diff --git a/kb-lib/src/executor/treasury/helium_treasury_management.rs b/kb-lib/src/executor/treasury/helium_treasury_management.rs index 38bfb25..991f0f2 100644 --- a/kb-lib/src/executor/treasury/helium_treasury_management.rs +++ b/kb-lib/src/executor/treasury/helium_treasury_management.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/treasury/helium_treasury_management.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_treasury_helium_treasury_management`. +//! Reserved executor for `treasury_helium_treasury_management`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_treasury_helium_treasury_management"; +/// Reserved executor for the `treasury_helium_treasury_management` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExTreasuryHeliumTreasuryManagementExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExTreasuryHeliumTreasuryManagementExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_treasury_helium_treasury_management"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::TREASURY_HELIUM_TREASURY_MANAGEMENT_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"treasury_helium_treasury_management"}), + ) { + 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_executor_treasury_helium_treasury_management".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vault.rs b/kb-lib/src/executor/vault.rs index 2603929..4bd0cec 100644 --- a/kb-lib/src/executor/vault.rs +++ b/kb-lib/src/executor/vault.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/executor/vault.rs -// version: 1 +// version: 2 //! `vault` executor family. @@ -9,3 +9,15 @@ mod kamino; mod kamino_v2; mod kamino_yvaults; mod meteora; +/// Exposes the reserved `vault/carrot_defi` executor. +pub use self::carrot_defi::ExVaultCarrotDefiExecutor; +/// Exposes the reserved `vault/hylo_stability_pool` executor. +pub use self::hylo_stability_pool::ExVaultHyloStabilityPoolExecutor; +/// Exposes the reserved `vault/kamino` executor. +pub use self::kamino::ExVaultKaminoExecutor; +/// Exposes the reserved `vault/kamino_v2` executor. +pub use self::kamino_v2::ExVaultKaminoV2Executor; +/// Exposes the reserved `vault/kamino_yvaults` executor. +pub use self::kamino_yvaults::ExVaultKaminoYvaultsExecutor; +/// Exposes the reserved `vault/meteora` executor. +pub use self::meteora::ExVaultMeteoraExecutor; diff --git a/kb-lib/src/executor/vault/carrot_defi.rs b/kb-lib/src/executor/vault/carrot_defi.rs index 58355af..5a0f578 100644 --- a/kb-lib/src/executor/vault/carrot_defi.rs +++ b/kb-lib/src/executor/vault/carrot_defi.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vault/carrot_defi.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vault_carrot_defi`. +//! Reserved executor for `vault_carrot_defi`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vault_carrot_defi"; +/// Reserved executor for the `vault_carrot_defi` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVaultCarrotDefiExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVaultCarrotDefiExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vault_carrot_defi"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VAULT_CARROT_DEFI_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vault_carrot_defi"}), + ) { + 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_executor_vault_carrot_defi".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vault/hylo_stability_pool.rs b/kb-lib/src/executor/vault/hylo_stability_pool.rs index e6d05f7..9f3c351 100644 --- a/kb-lib/src/executor/vault/hylo_stability_pool.rs +++ b/kb-lib/src/executor/vault/hylo_stability_pool.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vault/hylo_stability_pool.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vault_hylo_stability_pool`. +//! Reserved executor for `vault_hylo_stability_pool`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vault_hylo_stability_pool"; +/// Reserved executor for the `vault_hylo_stability_pool` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVaultHyloStabilityPoolExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVaultHyloStabilityPoolExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vault_hylo_stability_pool"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VAULT_HYLO_STABILITY_POOL_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vault_hylo_stability_pool"}), + ) { + 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_executor_vault_hylo_stability_pool".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vault/kamino.rs b/kb-lib/src/executor/vault/kamino.rs index 4e2228c..3fe17ad 100644 --- a/kb-lib/src/executor/vault/kamino.rs +++ b/kb-lib/src/executor/vault/kamino.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vault/kamino.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vault_kamino`. +//! Reserved executor for `vault_kamino`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vault_kamino"; +/// Reserved executor for the `vault_kamino` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVaultKaminoExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVaultKaminoExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vault_kamino"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VAULT_KAMINO_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vault_kamino"}), + ) { + 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_executor_vault_kamino".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vault/kamino_v2.rs b/kb-lib/src/executor/vault/kamino_v2.rs index 85c94d6..9c62e8e 100644 --- a/kb-lib/src/executor/vault/kamino_v2.rs +++ b/kb-lib/src/executor/vault/kamino_v2.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vault/kamino_v2.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vault_kamino_v2`. +//! Reserved executor for `vault_kamino_v2`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vault_kamino_v2"; +/// Reserved executor for the `vault_kamino_v2` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVaultKaminoV2Executor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVaultKaminoV2Executor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vault_kamino_v2"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VAULT_KAMINO_V2_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vault_kamino_v2"}), + ) { + 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_executor_vault_kamino_v2".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vault/kamino_yvaults.rs b/kb-lib/src/executor/vault/kamino_yvaults.rs index 05d47c2..7721403 100644 --- a/kb-lib/src/executor/vault/kamino_yvaults.rs +++ b/kb-lib/src/executor/vault/kamino_yvaults.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vault/kamino_yvaults.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vault_kamino_yvaults`. +//! Reserved executor for `vault_kamino_yvaults`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vault_kamino_yvaults"; +/// Reserved executor for the `vault_kamino_yvaults` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVaultKaminoYvaultsExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVaultKaminoYvaultsExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vault_kamino_yvaults"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VAULT_KAMINO_YVAULTS_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vault_kamino_yvaults"}), + ) { + 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_executor_vault_kamino_yvaults".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vault/meteora.rs b/kb-lib/src/executor/vault/meteora.rs index 3eec4c9..bacb39e 100644 --- a/kb-lib/src/executor/vault/meteora.rs +++ b/kb-lib/src/executor/vault/meteora.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vault/meteora.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vault_meteora`. +//! Reserved executor for `vault_meteora`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vault_meteora"; +/// Reserved executor for the `vault_meteora` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVaultMeteoraExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVaultMeteoraExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vault_meteora"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VAULT_METEORA_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vault_meteora"}), + ) { + 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_executor_vault_meteora".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/vesting.rs b/kb-lib/src/executor/vesting.rs index 2402fad..baa6648 100644 --- a/kb-lib/src/executor/vesting.rs +++ b/kb-lib/src/executor/vesting.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/vesting.rs -// version: 1 +// version: 2 //! `vesting` executor family. mod streamflow; +/// Exposes the reserved `vesting/streamflow` executor. +pub use self::streamflow::ExVestingStreamflowExecutor; diff --git a/kb-lib/src/executor/vesting/streamflow.rs b/kb-lib/src/executor/vesting/streamflow.rs index e77a21b..f421ade 100644 --- a/kb-lib/src/executor/vesting/streamflow.rs +++ b/kb-lib/src/executor/vesting/streamflow.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/vesting/streamflow.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_vesting_streamflow`. +//! Reserved executor for `vesting_streamflow`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_vesting_streamflow"; +/// Reserved executor for the `vesting_streamflow` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExVestingStreamflowExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExVestingStreamflowExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_vesting_streamflow"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::VESTING_STREAMFLOW_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"vesting_streamflow"}), + ) { + 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_executor_vesting_streamflow".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/wallet.rs b/kb-lib/src/executor/wallet.rs index d8e0955..be412cc 100644 --- a/kb-lib/src/executor/wallet.rs +++ b/kb-lib/src/executor/wallet.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/wallet.rs -// version: 1 +// version: 2 //! `wallet` executor family. mod jupiter_apepro_smart_wallet; +/// Exposes the reserved `wallet/jupiter_apepro_smart_wallet` executor. +pub use self::jupiter_apepro_smart_wallet::ExWalletJupiterApeproSmartWalletExecutor; diff --git a/kb-lib/src/executor/wallet/jupiter_apepro_smart_wallet.rs b/kb-lib/src/executor/wallet/jupiter_apepro_smart_wallet.rs index 09ea8cb..bccbe9e 100644 --- a/kb-lib/src/executor/wallet/jupiter_apepro_smart_wallet.rs +++ b/kb-lib/src/executor/wallet/jupiter_apepro_smart_wallet.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/wallet/jupiter_apepro_smart_wallet.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_wallet_jupiter_apepro_smart_wallet`. +//! Reserved executor for `wallet_jupiter_apepro_smart_wallet`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_wallet_jupiter_apepro_smart_wallet"; +/// Reserved executor for the `wallet_jupiter_apepro_smart_wallet` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExWalletJupiterApeproSmartWalletExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExWalletJupiterApeproSmartWalletExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_wallet_jupiter_apepro_smart_wallet"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::WALLET_JUPITER_APEPRO_SMART_WALLET_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"wallet_jupiter_apepro_smart_wallet"}), + ) { + 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_executor_wallet_jupiter_apepro_smart_wallet".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/executor/weighted.rs b/kb-lib/src/executor/weighted.rs index 4381539..4d9eb36 100644 --- a/kb-lib/src/executor/weighted.rs +++ b/kb-lib/src/executor/weighted.rs @@ -1,6 +1,8 @@ // file: kb-lib/src/executor/weighted.rs -// version: 1 +// version: 2 //! `weighted` executor family. mod swap_stabble; +/// Exposes the reserved `weighted/swap_stabble` executor. +pub use self::swap_stabble::ExWeightedSwapStabbleExecutor; diff --git a/kb-lib/src/executor/weighted/swap_stabble.rs b/kb-lib/src/executor/weighted/swap_stabble.rs index 976560c..faf6ac8 100644 --- a/kb-lib/src/executor/weighted/swap_stabble.rs +++ b/kb-lib/src/executor/weighted/swap_stabble.rs @@ -1,10 +1,49 @@ // file: kb-lib/src/executor/weighted/swap_stabble.rs -// version: 1 +// version: 2 -//! Migration boundary for legacy crate `kb_executor_weighted_swap_stabble`. +//! Reserved executor for `weighted_swap_stabble`. -/// Legacy crate name retained for migration and compatibility tracking. -const LEGACY_CRATE: &str = "kb_executor_weighted_swap_stabble"; +/// Reserved executor for the `weighted_swap_stabble` program surface. +#[derive(Clone, Debug, Default)] +pub struct ExWeightedSwapStabbleExecutor; -/// Current porting status. -const MIGRATION_STATUS: &str = "source-preserved-pending-port"; +impl crate::ExApiInstructionExecutor for crate::ExWeightedSwapStabbleExecutor { + fn executor_name(&self) -> &'static str { + return "kb_executor_weighted_swap_stabble"; + } + + fn executor_version(&self) -> &'static str { + return env!("CARGO_PKG_VERSION"); + } + + fn program_ids(&self) -> &'static [&'static str] { + return &[kb_program_ids::WEIGHTED_SWAP_STABBLE_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 { + let payload_json = match crate::executor_api_serialize_payload_json( + &serde_json::json!({"status":"reserved_executor","surface":"weighted_swap_stabble"}), + ) { + 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_executor_weighted_swap_stabble".to_string(), + instruction_count: 0, + payload_json, + }); + } +} diff --git a/kb-lib/src/lib.rs b/kb-lib/src/lib.rs index 7a23cea..0186c34 100644 --- a/kb-lib/src/lib.rs +++ b/kb-lib/src/lib.rs @@ -1,5 +1,5 @@ // file: kb-lib/src/lib.rs -// version: 16 +// version: 17 //! Consolidated decoder, executor, materializer and shared model library. #![warn(missing_docs)] @@ -11,6 +11,764 @@ mod executor; mod materializer; mod model; +/// Current contextual core instruction input contract version. +pub use self::decoder::DC_API_CORE_INSTRUCTION_INPUT_CONTRACT_VERSION; +/// Exhaustive published Metaplex account-key inventory. +pub use self::decoder::DC_METADATA_MTM_METADATA_ACCOUNT_LAYOUT_AUDIT; +/// Exact byte length of one SPL ElGamal registry account. +pub use self::decoder::DC_SPL_ELGAMAL_REGISTRY_ACCOUNT_LEN; +/// Reserved `kb_decoder_adapter_saber_decimal_wrapper` decoder. +pub use self::decoder::DcAdapterSaberDecimalWrapperDecoder; +/// Reserved `kb_decoder_admin_jupiter_lock` decoder. +pub use self::decoder::DcAdminJupiterLockDecoder; +/// Reserved `kb_decoder_admin_pump_fees` decoder. +pub use self::decoder::DcAdminPumpFeesDecoder; +/// Reserved `kb_decoder_amm_aldrin_v1` decoder. +pub use self::decoder::DcAmmAldrinV1Decoder; +/// Reserved `kb_decoder_amm_aldrin_v2` decoder. +pub use self::decoder::DcAmmAldrinV2Decoder; +/// Reserved `kb_decoder_amm_alphaq` decoder. +pub use self::decoder::DcAmmAlphaqDecoder; +/// Reserved `kb_decoder_amm_believe` decoder. +pub use self::decoder::DcAmmBelieveDecoder; +/// Reserved `kb_decoder_amm_bonk_swap` decoder. +pub use self::decoder::DcAmmBonkSwapDecoder; +/// Reserved `kb_decoder_amm_fluxbeam` decoder. +pub use self::decoder::DcAmmFluxbeamDecoder; +/// Reserved `kb_decoder_amm_goon_fi` decoder. +pub use self::decoder::DcAmmGoonFiDecoder; +/// Reserved `kb_decoder_amm_goosefx_gamma` decoder. +pub use self::decoder::DcAmmGoosefxGammaDecoder; +/// Reserved `kb_decoder_amm_goosefx_v2` decoder. +pub use self::decoder::DcAmmGoosefxV2Decoder; +/// Reserved `kb_decoder_amm_guac_swap` decoder. +pub use self::decoder::DcAmmGuacSwapDecoder; +/// Reserved `kb_decoder_amm_lifinity_swap_v2` decoder. +pub use self::decoder::DcAmmLifinitySwapV2Decoder; +/// Reserved `kb_decoder_amm_metadao_futarchy_amm` decoder. +pub use self::decoder::DcAmmMetadaoFutarchyAmmDecoder; +/// Reserved `kb_decoder_amm_metadao_v0_5` decoder. +pub use self::decoder::DcAmmMetadaoV05Decoder; +/// Reserved `kb_decoder_amm_meteora_damm_v1` decoder. +pub use self::decoder::DcAmmMeteoraDammV1Decoder; +/// Reserved `kb_decoder_amm_meteora_damm_v2` decoder. +pub use self::decoder::DcAmmMeteoraDammV2Decoder; +/// Reserved `kb_decoder_amm_obric_v2` decoder. +pub use self::decoder::DcAmmObricV2Decoder; +/// Reserved `kb_decoder_amm_one_dex` decoder. +pub use self::decoder::DcAmmOneDexDecoder; +/// Reserved `kb_decoder_amm_pump_swap` decoder. +pub use self::decoder::DcAmmPumpSwapDecoder; +/// Reserved `kb_decoder_amm_raydium_lp_v4` decoder. +pub use self::decoder::DcAmmRaydiumLpV4Decoder; +/// Reserved `kb_decoder_amm_solfi` decoder. +pub use self::decoder::DcAmmSolfiDecoder; +/// Reserved `kb_decoder_amm_solfi_v2` decoder. +pub use self::decoder::DcAmmSolfiV2Decoder; +/// Reserved `kb_decoder_amm_vertigo` decoder. +pub use self::decoder::DcAmmVertigoDecoder; +/// Reserved `kb_decoder_amm_virtuals` decoder. +pub use self::decoder::DcAmmVirtualsDecoder; +/// Reserved `kb_decoder_amm_woofi` decoder. +pub use self::decoder::DcAmmWoofiDecoder; +/// Reserved `kb_decoder_amm_zero_fi` decoder. +pub use self::decoder::DcAmmZeroFiDecoder; +/// Reserved `kb_decoder_amm_zora` decoder. +pub use self::decoder::DcAmmZoraDecoder; +/// Reserved `kb_decoder_anchor` decoder. +pub use self::decoder::DcAnchorDecoder; +/// Stable contextual decoded observation. +pub use self::decoder::DcApiDecodedObservation; +/// Machine-readable decoder coverage declaration. +pub use self::decoder::DcApiDecoderCoverageDeclaration; +/// Declared decoder coverage entry kind. +pub use self::decoder::DcApiDecoderCoverageEntryKind; +/// Structured decoder diagnostic. +pub use self::decoder::DcApiDecoderDiagnostic; +/// Complete decoder execution result. +pub use self::decoder::DcApiDecoderExecutionResult; +/// Stable decoder identity. +pub use self::decoder::DcApiDecoderIdentity; +/// Decoder terminal result status. +pub use self::decoder::DcApiDecoderOutcomeStatus; +/// Explicit decoding proof. +pub use self::decoder::DcApiDecoderProof; +/// Decoding proof category. +pub use self::decoder::DcApiDecoderProofKind; +/// Deterministic decoder recognition result. +pub use self::decoder::DcApiDecoderRecognition; +/// Exposes the decoder support level. +pub use self::decoder::DcApiDecoderSupport; +/// One statically declared decoder surface. +pub use self::decoder::DcApiDecoderSurface; +/// Initial decoder implementation placeholder for API-level tests. +pub use self::decoder::DcApiInitialDecoder; +/// Contextual instruction decoder contract. +pub use self::decoder::DcApiInstructionDecoder; +/// Exposes the common protocol decoder trait. +pub use self::decoder::DcApiProtocolDecoder; +/// Reserved `kb_decoder_bridge_circle_cctp_token_messenger_minter` decoder. +pub use self::decoder::DcBridgeCircleCctpTokenMessengerMinterDecoder; +/// Reserved `kb_decoder_bridge_circle_cctp_token_messenger_minter_v2` decoder. +pub use self::decoder::DcBridgeCircleCctpTokenMessengerMinterV2Decoder; +/// Reserved `kb_decoder_bridge_layer_zero_endpoint` decoder. +pub use self::decoder::DcBridgeLayerZeroEndpointDecoder; +/// Reserved `kb_decoder_bridge_layer_zero_executor` decoder. +pub use self::decoder::DcBridgeLayerZeroExecutorDecoder; +/// Reserved `kb_decoder_clmm_byreal` decoder. +pub use self::decoder::DcClmmByrealDecoder; +/// Reserved `kb_decoder_clmm_fusion` decoder. +pub use self::decoder::DcClmmFusionDecoder; +/// Reserved `kb_decoder_clmm_orca_whirlpool` decoder. +pub use self::decoder::DcClmmOrcaWhirlpoolDecoder; +/// Reserved `kb_decoder_clmm_pancake_swap` decoder. +pub use self::decoder::DcClmmPancakeSwapDecoder; +/// Reserved `kb_decoder_clmm_raydium` decoder. +pub use self::decoder::DcClmmRaydiumDecoder; +/// Reserved `kb_decoder_clmm_stabble` decoder. +pub use self::decoder::DcClmmStabbleDecoder; +/// Reserved `kb_decoder_cpmm_raydium` decoder. +pub use self::decoder::DcCpmmRaydiumDecoder; +/// Reserved `kb_decoder_dlmm_meteora` decoder. +pub use self::decoder::DcDlmmMeteoraDecoder; +/// Reserved `kb_decoder_fees_bags_fee_share_v1` decoder. +pub use self::decoder::DcFeesBagsFeeShareV1Decoder; +/// Reserved `kb_decoder_fees_bags_fee_share_v2` decoder. +pub use self::decoder::DcFeesBagsFeeShareV2Decoder; +/// Reserved `kb_decoder_governance_metadao_bid_wall` decoder. +pub use self::decoder::DcGovernanceMetadaoBidWallDecoder; +/// Reserved `kb_decoder_launchpad_boop_fun` decoder. +pub use self::decoder::DcLaunchpadBoopFunDecoder; +/// Reserved `kb_decoder_launchpad_metadao_ico` decoder. +pub use self::decoder::DcLaunchpadMetadaoIcoDecoder; +/// Reserved `kb_decoder_launchpad_meteora_dbc` decoder. +pub use self::decoder::DcLaunchpadMeteoraDbcDecoder; +/// Reserved `kb_decoder_launchpad_moonit` decoder. +pub use self::decoder::DcLaunchpadMoonitDecoder; +/// Reserved `kb_decoder_launchpad_orca_wavebreak` decoder. +pub use self::decoder::DcLaunchpadOrcaWavebreakDecoder; +/// Reserved `kb_decoder_launchpad_printr` decoder. +pub use self::decoder::DcLaunchpadPrintrDecoder; +/// Reserved `kb_decoder_launchpad_pump_fun` decoder. +pub use self::decoder::DcLaunchpadPumpFunDecoder; +/// Reserved `kb_decoder_launchpad_pump_pumpup_ai` decoder. +pub use self::decoder::DcLaunchpadPumpPumpupAiDecoder; +/// Reserved `kb_decoder_launchpad_raydium_launchlab` decoder. +pub use self::decoder::DcLaunchpadRaydiumLaunchlabDecoder; +/// Reserved `kb_decoder_lending_clone` decoder. +pub use self::decoder::DcLendingCloneDecoder; +/// Reserved `kb_decoder_lending_jupiter_lend_borrow` decoder. +pub use self::decoder::DcLendingJupiterLendBorrowDecoder; +/// Reserved `kb_decoder_lending_jupiter_lend_earn` decoder. +pub use self::decoder::DcLendingJupiterLendEarnDecoder; +/// Reserved `kb_decoder_lending_jupiter_lend_flash_loan` decoder. +pub use self::decoder::DcLendingJupiterLendFlashLoanDecoder; +/// Reserved `kb_decoder_lending_jupiter_lend_liquidity` decoder. +pub use self::decoder::DcLendingJupiterLendLiquidityDecoder; +/// Reserved `kb_decoder_lending_kamino` decoder. +pub use self::decoder::DcLendingKaminoDecoder; +/// Reserved `kb_decoder_lending_marginfi_v2` decoder. +pub use self::decoder::DcLendingMarginfiV2Decoder; +/// Reserved `kb_decoder_lock_raydium_lp` decoder. +pub use self::decoder::DcLockRaydiumLpDecoder; +/// Exact decoder for the Metaplex Token Metadata program. +/// Exact decoder for the Metaplex Token Metadata program. +pub use self::decoder::DcMetadataMetaplexTokenMetadataDecoder; +/// Canonical projection shared by Collection and Use Authority records. +pub use self::decoder::DcMetadataMtmAuthorityRecordAccountSnapshot; +/// Stable identity and policy of one canonical account snapshot. +pub use self::decoder::DcMetadataMtmCanonicalAccountIdentity; +/// Lifecycle represented by one canonical Metaplex account snapshot. +/// Lifecycle class of one canonical account layout. +pub use self::decoder::DcMetadataMtmCanonicalAccountLifecycle; +/// Provenance for one canonical Metaplex account snapshot. +/// Provenance retained for one canonical account observation. +pub use self::decoder::DcMetadataMtmCanonicalAccountProvenance; +/// Execution policy attached to one canonical Metaplex account layout. +/// Execution policy separated from historical materialization. +pub use self::decoder::DcMetadataMtmCanonicalExecutionPolicy; +/// Materialization policy attached to one canonical Metaplex account layout. +/// Materialization policy for active or historical state. +pub use self::decoder::DcMetadataMtmCanonicalMaterializationPolicy; +/// Canonical Metaplex account snapshot. +/// Canonical account envelope used by materializers and replay. +pub use self::decoder::DcMetadataMtmCanonicalMetadataAccountSnapshot; +/// Canonical state held by one Metaplex account snapshot. +/// Typed canonical Metaplex account state. +pub use self::decoder::DcMetadataMtmCanonicalMetadataAccountState; +/// Source of one canonical Metaplex account observation. +/// Origin of one canonical account observation. +pub use self::decoder::DcMetadataMtmCanonicalObservationSource; +/// Canonical projection shared by Metadata and Holder delegate records. +pub use self::decoder::DcMetadataMtmDelegateRecordAccountSnapshot; +/// Parsed Metaplex edition account kind. +/// Supported edition account layout. +pub use self::decoder::DcMetadataMtmEditionAccountKind; +/// Parsed Metaplex edition account snapshot. +/// Canonical bounded projection of one edition or master-edition account. +pub use self::decoder::DcMetadataMtmEditionAccountSnapshot; +/// Parsed Metaplex edition marker account kind. +/// Supported Edition Marker account layout. +pub use self::decoder::DcMetadataMtmEditionMarkerAccountKind; +/// Parsed Metaplex edition marker account snapshot. +/// Canonical bounded projection of one Edition Marker account. +pub use self::decoder::DcMetadataMtmEditionMarkerAccountSnapshot; +/// Bounded error returned while decoding a Metadata account. +pub use self::decoder::DcMetadataMtmMetadataAccountDecodeError; +/// One entry in the exhaustive published account-key audit. +pub use self::decoder::DcMetadataMtmMetadataAccountLayoutAuditEntry; +/// Parsed Metaplex MetadataV1 account snapshot. +/// Canonical bounded projection of one Metadata account. +pub use self::decoder::DcMetadataMtmMetadataAccountSnapshot; +/// One bounded historical reservation entry. +pub use self::decoder::DcMetadataMtmReservationEntrySnapshot; +/// Parsed Metaplex reservation-list account kind. +/// Historical Reservation List account generation. +pub use self::decoder::DcMetadataMtmReservationListAccountKind; +/// Parsed Metaplex reservation-list account snapshot. +/// Canonical decode-only projection of a historical Reservation List account. +pub use self::decoder::DcMetadataMtmReservationListAccountSnapshot; +/// Canonical projection of one Token Owned Escrow account. +pub use self::decoder::DcMetadataMtmTokenOwnedEscrowAccountSnapshot; +/// Authority form used by one Token Owned Escrow account. +pub use self::decoder::DcMetadataMtmTokenOwnedEscrowAuthorityKind; +/// Parsed Metaplex token-record account snapshot. +/// Canonical bounded projection of one programmable Token Record account. +pub use self::decoder::DcMetadataMtmTokenRecordAccountSnapshot; +/// Reserved `kb_decoder_metadata_spl_name_service` decoder. +pub use self::decoder::DcMetadataSplNameServiceDecoder; +/// Reserved `kb_decoder_nft_metaplex_bubblegum` decoder. +pub use self::decoder::DcNftMetaplexBubblegumDecoder; +/// Reserved `kb_decoder_orderbook_jupiter_limit_order` decoder. +pub use self::decoder::DcOrderbookJupiterLimitOrderDecoder; +/// Reserved `kb_decoder_orderbook_jupiter_limit_order_v2` decoder. +pub use self::decoder::DcOrderbookJupiterLimitOrderV2Decoder; +/// Reserved `kb_decoder_orderbook_openbook_v2` decoder. +pub use self::decoder::DcOrderbookOpenbookV2Decoder; +/// Reserved `kb_decoder_perpetuals_drift_v2` decoder. +pub use self::decoder::DcPerpetualsDriftV2Decoder; +/// Reserved `kb_decoder_perpetuals_jupiter` decoder. +pub use self::decoder::DcPerpetualsJupiterDecoder; +/// Reserved `kb_decoder_perpetuals_zeta` decoder. +pub use self::decoder::DcPerpetualsZetaDecoder; +/// Reserved `kb_decoder_router_dflow_aggregator_v4` decoder. +pub use self::decoder::DcRouterDflowAggregatorV4Decoder; +/// Reserved `kb_decoder_router_jupiter_aggregator_v4` decoder. +pub use self::decoder::DcRouterJupiterAggregatorV4Decoder; +/// Reserved `kb_decoder_router_jupiter_aggregator_v6` decoder. +pub use self::decoder::DcRouterJupiterAggregatorV6Decoder; +/// Reserved `kb_decoder_router_jupiter_dca` decoder. +pub use self::decoder::DcRouterJupiterDcaDecoder; +/// Reserved `kb_decoder_router_okx_labs_v1` decoder. +pub use self::decoder::DcRouterOkxLabsV1Decoder; +/// Reserved `kb_decoder_router_okx_labs_v2` decoder. +pub use self::decoder::DcRouterOkxLabsV2Decoder; +/// Reserved `kb_decoder_rwa_ondo_global_markets` decoder. +pub use self::decoder::DcRwaOndoGlobalMarketsDecoder; +/// Runtime-native Solana decoder with maximal native instruction coverage. +pub use self::decoder::DcSolanaCoreDecoder; +/// Reserved `kb_decoder_spl_account_compression` decoder. +pub use self::decoder::DcSplAccountCompressionDecoder; +/// Exact decoder for the SPL Associated Token Account program. +pub use self::decoder::DcSplAssociatedTokenAccountDecoder; +/// Parsed SPL ElGamal public-key registry account. +pub use self::decoder::DcSplElGamalRegistryState; +/// Exact decoder for the SPL ElGamal registry program. +pub use self::decoder::DcSplElgamalRegistryDecoder; +/// Exact decoder for the three registered SPL Memo generations. +pub use self::decoder::DcSplMemoDecoder; +/// Reserved `kb_decoder_spl_noop` decoder. +pub use self::decoder::DcSplNoopDecoder; +/// Reserved `kb_decoder_spl_single_pool` decoder. +pub use self::decoder::DcSplSinglePoolDecoder; +/// Reserved `kb_decoder_spl_stake_pool` decoder. +pub use self::decoder::DcSplStakePoolDecoder; +/// Exact decoder for the Token-2022 program. +pub use self::decoder::DcSplToken2022Decoder; +/// Exact decoder for the classic SPL Token program. +pub use self::decoder::DcSplTokenDecoder; +/// Reserved `kb_decoder_stable_swap_hylo_exchange` decoder. +pub use self::decoder::DcStableSwapHyloExchangeDecoder; +/// Reserved `kb_decoder_stable_swap_jupiter_stable` decoder. +pub use self::decoder::DcStableSwapJupiterStableDecoder; +/// Reserved `kb_decoder_stable_swap_numeraire` decoder. +pub use self::decoder::DcStableSwapNumeraireDecoder; +/// Reserved `kb_decoder_stable_swap_stabble` decoder. +pub use self::decoder::DcStableSwapStabbleDecoder; +/// Reserved `kb_decoder_staking_kamino_farm` decoder. +pub use self::decoder::DcStakingKaminoFarmDecoder; +/// Reserved `kb_decoder_staking_marinade_finance` decoder. +pub use self::decoder::DcStakingMarinadeFinanceDecoder; +/// Reserved `kb_decoder_staking_solayer` decoder. +pub use self::decoder::DcStakingSolayerDecoder; +/// Parsed Token-2022 Mint, Account, or Multisig state. +pub use self::decoder::DcToken2022State; +/// Exact Token-2022 base account state kind. +pub use self::decoder::DcToken2022StateKind; +/// One exact Token-2022 TLV entry. +pub use self::decoder::DcToken2022TlvEntry; +/// Reserved `kb_decoder_treasury_helium_treasury_management` decoder. +pub use self::decoder::DcTreasuryHeliumTreasuryManagementDecoder; +/// Reserved `kb_decoder_vault_carrot_defi` decoder. +pub use self::decoder::DcVaultCarrotDefiDecoder; +/// Reserved `kb_decoder_vault_hylo_stability_pool` decoder. +pub use self::decoder::DcVaultHyloStabilityPoolDecoder; +/// Reserved `kb_decoder_vault_kamino` decoder. +pub use self::decoder::DcVaultKaminoDecoder; +/// Reserved `kb_decoder_vault_kamino_v2` decoder. +pub use self::decoder::DcVaultKaminoV2Decoder; +/// Reserved `kb_decoder_vault_kamino_yvaults` decoder. +pub use self::decoder::DcVaultKaminoYvaultsDecoder; +/// Reserved `kb_decoder_vault_meteora` decoder. +pub use self::decoder::DcVaultMeteoraDecoder; +/// Reserved `kb_decoder_vesting_streamflow` decoder. +pub use self::decoder::DcVestingStreamflowDecoder; +/// Reserved `kb_decoder_wallet_jupiter_apepro_smart_wallet` decoder. +pub use self::decoder::DcWalletJupiterApeproSmartWalletDecoder; +/// Reserved `kb_decoder_weighted_swap_stabble` decoder. +pub use self::decoder::DcWeightedSwapStabbleDecoder; +/// Computes the deterministic contextual input hash. +pub use self::decoder::decoder_api_decoder_api_contextual_input_hash; +/// Returns true when a decoder declares the exact program id. +pub use self::decoder::decoder_api_decoder_handles_program_id; +/// Computes a deterministic lowercase SHA-256 hash for one JSON value. +pub use self::decoder::decoder_api_deterministic_json_hash; +/// Extracts the first eight payload bytes as hexadecimal when available. +pub use self::decoder::decoder_api_discriminator_8_hex; +/// Decodes one Collection Authority Record account. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_collection_authority_record_account; +/// Decodes and validates one edition or master-edition account snapshot. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_edition_account; +/// Decodes and validates one Edition Marker account snapshot. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_edition_marker_account; +/// Decodes one Holder Delegate Record account. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_holder_delegate_record_account; +/// Decodes and validates one canonical Metadata account snapshot. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_metadata_account; +/// Decodes one Metadata Delegate Record account. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_metadata_delegate_record_account; +/// Decodes one historical Reservation List V1 or V2 account. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_reservation_list_account; +/// Decodes one Token Owned Escrow account. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_token_owned_escrow_account; +/// Decodes and validates one programmable Token Record account snapshot. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_token_record_account; +/// Decodes one Use Authority Record account. +pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_use_authority_record_account; +/// Parses one exact SPL ElGamal registry account. +pub use self::decoder::decoder_spl_elgamal_registry_parse_elgamal_registry_state; +/// Parses one Token-2022 Mint, Account, or Multisig state. +pub use self::decoder::decoder_spl_token2022_parse_token2022_state; +/// 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 `ExAmmAldrinV1Executor` implementation. +pub use self::executor::ExAmmAldrinV1Executor; +/// Exposes the reserved `ExAmmAldrinV2Executor` implementation. +pub use self::executor::ExAmmAldrinV2Executor; +/// Exposes the reserved `ExAmmAlphaqExecutor` implementation. +pub use self::executor::ExAmmAlphaqExecutor; +/// Exposes the reserved `ExAmmBelieveExecutor` implementation. +pub use self::executor::ExAmmBelieveExecutor; +/// Exposes the reserved `ExAmmBonkSwapExecutor` implementation. +pub use self::executor::ExAmmBonkSwapExecutor; +/// Exposes the reserved `ExAmmFluxbeamExecutor` implementation. +pub use self::executor::ExAmmFluxbeamExecutor; +/// Exposes the reserved `ExAmmGoonFiExecutor` implementation. +pub use self::executor::ExAmmGoonFiExecutor; +/// Exposes the reserved `ExAmmGoosefxGammaExecutor` implementation. +pub use self::executor::ExAmmGoosefxGammaExecutor; +/// Exposes the reserved `ExAmmGoosefxV2Executor` implementation. +pub use self::executor::ExAmmGoosefxV2Executor; +/// Exposes the reserved `ExAmmGuacSwapExecutor` implementation. +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. +pub use self::executor::ExAmmMeteoraDammV1Executor; +/// Exposes the reserved `ExAmmMeteoraDammV2Executor` implementation. +pub use self::executor::ExAmmMeteoraDammV2Executor; +/// Exposes the reserved `ExAmmObricV2Executor` implementation. +pub use self::executor::ExAmmObricV2Executor; +/// Exposes the reserved `ExAmmOneDexExecutor` implementation. +pub use self::executor::ExAmmOneDexExecutor; +/// Exposes the reserved `ExAmmPumpSwapExecutor` implementation. +pub use self::executor::ExAmmPumpSwapExecutor; +/// Exposes the reserved `ExAmmRaydiumLpV4Executor` implementation. +pub use self::executor::ExAmmRaydiumLpV4Executor; +/// Exposes the reserved `ExAmmSolfiExecutor` implementation. +pub use self::executor::ExAmmSolfiExecutor; +/// Exposes the reserved `ExAmmSolfiV2Executor` implementation. +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. +pub use self::executor::ExAmmZeroFiExecutor; +/// Exposes the reserved `ExAmmZoraExecutor` implementation. +pub use self::executor::ExAmmZoraExecutor; +/// Exposes the blockhash policy kind. +pub use self::executor::ExApiExecutionBlockhashKind; +/// Exposes the blockhash policy. +pub use self::executor::ExApiExecutionBlockhashPolicy; +/// Exposes the exact execution capability result. +pub use self::executor::ExApiExecutionCapability; +/// Exposes supported Solana clusters. +pub use self::executor::ExApiExecutionCluster; +/// Exposes cluster restrictions. +pub use self::executor::ExApiExecutionClusterPolicy; +/// Exposes the result of waiting for transaction confirmation. +pub use self::executor::ExApiExecutionConfirmationResult; +/// Exposes transaction confirmation states. +pub use self::executor::ExApiExecutionConfirmationStatus; +/// Exposes explicit execution cost ceilings. +pub use self::executor::ExApiExecutionCostLimit; +/// Exposes the legacy common execution plan type. +pub use self::executor::ExApiExecutionPlan; +/// Exposes the complete execution policy. +pub use self::executor::ExApiExecutionPolicy; +/// Exposes the legacy common execution request type. +pub use self::executor::ExApiExecutionRequest; +/// Exposes the result of a transaction send adapter. +pub use self::executor::ExApiExecutionSendResult; +/// Exposes the simulation policy. +pub use self::executor::ExApiExecutionSimulationPolicy; +/// Exposes the simulation result contract. +pub use self::executor::ExApiExecutionSimulationResult; +/// Exposes the legacy common execution support enum. +pub use self::executor::ExApiExecutionSupport; +/// Exposes the legacy common instruction executor trait. +pub use self::executor::ExApiInstructionExecutor; +/// Exposes one planned instruction account. +pub use self::executor::ExApiPlannedAccount; +/// Exposes one encoded planned instruction. +pub use self::executor::ExApiPlannedInstruction; +/// Exposes post-execution replay diagnostics. +pub use self::executor::ExApiPostExecutionDiagnostic; +/// Exposes post-execution validation requirements. +pub use self::executor::ExApiPostExecutionValidationPolicy; +/// Exposes a typed execution plan. +pub use self::executor::ExApiPreparedExecutionPlan; +/// Exposes one required signer. +pub use self::executor::ExApiRequiredSigner; +/// Exposes the typed executor contract. +pub use self::executor::ExApiTypedInstructionExecutor; +/// Exposes the reserved `ExBridgeCircleCctpTokenMessengerMinterExecutor` implementation. +pub use self::executor::ExBridgeCircleCctpTokenMessengerMinterExecutor; +/// Exposes the reserved `ExBridgeCircleCctpTokenMessengerMinterV2Executor` implementation. +pub use self::executor::ExBridgeCircleCctpTokenMessengerMinterV2Executor; +/// Exposes the reserved `ExBridgeLayerZeroEndpointExecutor` implementation. +pub use self::executor::ExBridgeLayerZeroEndpointExecutor; +/// Exposes the reserved `ExBridgeLayerZeroExecutorExecutor` implementation. +pub use self::executor::ExBridgeLayerZeroExecutorExecutor; +/// Exposes the reserved `ExClmmByrealExecutor` implementation. +pub use self::executor::ExClmmByrealExecutor; +/// Exposes the reserved `ExClmmFusionExecutor` implementation. +pub use self::executor::ExClmmFusionExecutor; +/// Exposes the reserved `ExClmmOrcaWhirlpoolExecutor` implementation. +pub use self::executor::ExClmmOrcaWhirlpoolExecutor; +/// Exposes the reserved `ExClmmPancakeSwapExecutor` implementation. +pub use self::executor::ExClmmPancakeSwapExecutor; +/// Exposes the reserved `ExClmmRaydiumExecutor` implementation. +pub use self::executor::ExClmmRaydiumExecutor; +/// Exposes the reserved `ExClmmStabbleExecutor` implementation. +pub use self::executor::ExClmmStabbleExecutor; +/// Exposes the reserved `ExCpmmRaydiumExecutor` implementation. +pub use self::executor::ExCpmmRaydiumExecutor; +/// Exposes the reserved `ExDlmmMeteoraExecutor` implementation. +pub use self::executor::ExDlmmMeteoraExecutor; +/// Exposes the reserved `ExFeesBagsFeeShareV1Executor` implementation. +pub use self::executor::ExFeesBagsFeeShareV1Executor; +/// Exposes the reserved `ExFeesBagsFeeShareV2Executor` implementation. +pub use self::executor::ExFeesBagsFeeShareV2Executor; +/// Exposes the reserved `ExGovernanceMetadaoBidWallExecutor` implementation. +pub use self::executor::ExGovernanceMetadaoBidWallExecutor; +/// Exposes the reserved `ExLaunchpadBoopFunExecutor` implementation. +pub use self::executor::ExLaunchpadBoopFunExecutor; +/// Exposes the reserved `ExLaunchpadMetadaoIcoExecutor` implementation. +pub use self::executor::ExLaunchpadMetadaoIcoExecutor; +/// Exposes the reserved `ExLaunchpadMeteoraDbcExecutor` implementation. +pub use self::executor::ExLaunchpadMeteoraDbcExecutor; +/// Exposes the reserved `ExLaunchpadMoonitExecutor` implementation. +pub use self::executor::ExLaunchpadMoonitExecutor; +/// Exposes the reserved `ExLaunchpadOrcaWavebreakExecutor` implementation. +pub use self::executor::ExLaunchpadOrcaWavebreakExecutor; +/// Exposes the reserved `ExLaunchpadPrintrExecutor` implementation. +pub use self::executor::ExLaunchpadPrintrExecutor; +/// Exposes the reserved `ExLaunchpadPumpFunExecutor` implementation. +pub use self::executor::ExLaunchpadPumpFunExecutor; +/// Exposes the reserved `ExLaunchpadPumpPumpupAiExecutor` implementation. +pub use self::executor::ExLaunchpadPumpPumpupAiExecutor; +/// Exposes the reserved `ExLaunchpadRaydiumLaunchlabExecutor` implementation. +pub use self::executor::ExLaunchpadRaydiumLaunchlabExecutor; +/// Exposes the reserved `ExLendingCloneExecutor` implementation. +pub use self::executor::ExLendingCloneExecutor; +/// Exposes the reserved `ExLendingJupiterLendBorrowExecutor` implementation. +pub use self::executor::ExLendingJupiterLendBorrowExecutor; +/// Exposes the reserved `ExLendingJupiterLendEarnExecutor` implementation. +pub use self::executor::ExLendingJupiterLendEarnExecutor; +/// Exposes the reserved `ExLendingJupiterLendFlashLoanExecutor` implementation. +pub use self::executor::ExLendingJupiterLendFlashLoanExecutor; +/// Exposes the reserved `ExLendingJupiterLendLiquidityExecutor` implementation. +pub use self::executor::ExLendingJupiterLendLiquidityExecutor; +/// Exposes the reserved `ExLendingKaminoExecutor` implementation. +pub use self::executor::ExLendingKaminoExecutor; +/// Exposes the reserved `ExLendingMarginfiV2Executor` implementation. +pub use self::executor::ExLendingMarginfiV2Executor; +/// Exposes the reserved `ExLockRaydiumLpExecutor` implementation. +pub use self::executor::ExLockRaydiumLpExecutor; +/// Exposes the reserved `ExMetadataMetaplexTokenMetadataExecutor` implementation. +pub use self::executor::ExMetadataMetaplexTokenMetadataExecutor; +/// Exposes the reserved `ExMetadataSplNameServiceExecutor` implementation. +pub use self::executor::ExMetadataSplNameServiceExecutor; +/// Exposes the reserved `ExNftMetaplexBubblegumExecutor` implementation. +pub use self::executor::ExNftMetaplexBubblegumExecutor; +/// Exposes the reserved `ExOrderbookJupiterLimitOrderExecutor` implementation. +pub use self::executor::ExOrderbookJupiterLimitOrderExecutor; +/// Exposes the reserved `ExOrderbookJupiterLimitOrderV2Executor` implementation. +pub use self::executor::ExOrderbookJupiterLimitOrderV2Executor; +/// Exposes the reserved `ExOrderbookOpenbookV2Executor` implementation. +pub use self::executor::ExOrderbookOpenbookV2Executor; +/// Exposes the reserved `ExPerpetualsDriftV2Executor` implementation. +pub use self::executor::ExPerpetualsDriftV2Executor; +/// Exposes the reserved `ExPerpetualsJupiterExecutor` implementation. +pub use self::executor::ExPerpetualsJupiterExecutor; +/// Exposes the reserved `ExPerpetualsZetaExecutor` implementation. +pub use self::executor::ExPerpetualsZetaExecutor; +/// Exposes the reserved `ExRouterDflowAggregatorV4Executor` implementation. +pub use self::executor::ExRouterDflowAggregatorV4Executor; +/// Exposes the reserved `ExRouterJupiterAggregatorV4Executor` implementation. +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. +pub use self::executor::ExRouterOkxLabsV2Executor; +/// Exposes the reserved `ExRwaOndoGlobalMarketsExecutor` implementation. +pub use self::executor::ExRwaOndoGlobalMarketsExecutor; +/// Exposes the reserved `ExSolanaCoreExecutor` implementation. +pub use self::executor::ExSolanaCoreExecutor; +/// Exposes the reserved `ExSplAccountCompressionExecutor` implementation. +pub use self::executor::ExSplAccountCompressionExecutor; +/// Exposes the reserved `ExSplAssociatedTokenAccountExecutor` implementation. +pub use self::executor::ExSplAssociatedTokenAccountExecutor; +/// Exposes the reserved `ExSplElgamalRegistryExecutor` implementation. +pub use self::executor::ExSplElgamalRegistryExecutor; +/// Exposes the reserved `ExSplMemoExecutor` implementation. +pub use self::executor::ExSplMemoExecutor; +/// Exposes the reserved `ExSplNoopExecutor` implementation. +pub use self::executor::ExSplNoopExecutor; +/// Exposes the reserved `ExSplSinglePoolExecutor` implementation. +pub use self::executor::ExSplSinglePoolExecutor; +/// Exposes the reserved `ExSplStakePoolExecutor` implementation. +pub use self::executor::ExSplStakePoolExecutor; +/// Exposes the reserved `ExSplToken2022Executor` implementation. +pub use self::executor::ExSplToken2022Executor; +/// Exposes the reserved `ExSplTokenExecutor` implementation. +pub use self::executor::ExSplTokenExecutor; +/// Exposes the reserved `ExStableSwapHyloExchangeExecutor` implementation. +pub use self::executor::ExStableSwapHyloExchangeExecutor; +/// Exposes the reserved `ExStableSwapJupiterStableExecutor` implementation. +pub use self::executor::ExStableSwapJupiterStableExecutor; +/// Exposes the reserved `ExStableSwapNumeraireExecutor` implementation. +pub use self::executor::ExStableSwapNumeraireExecutor; +/// Exposes the reserved `ExStableSwapStabbleExecutor` implementation. +pub use self::executor::ExStableSwapStabbleExecutor; +/// 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 `ExTreasuryHeliumTreasuryManagementExecutor` implementation. +pub use self::executor::ExTreasuryHeliumTreasuryManagementExecutor; +/// Exposes the reserved `ExVaultCarrotDefiExecutor` implementation. +pub use self::executor::ExVaultCarrotDefiExecutor; +/// Exposes the reserved `ExVaultHyloStabilityPoolExecutor` implementation. +pub use self::executor::ExVaultHyloStabilityPoolExecutor; +/// Exposes the reserved `ExVaultKaminoExecutor` implementation. +pub use self::executor::ExVaultKaminoExecutor; +/// Exposes the reserved `ExVaultKaminoV2Executor` implementation. +pub use self::executor::ExVaultKaminoV2Executor; +/// Exposes the reserved `ExVaultKaminoYvaultsExecutor` implementation. +pub use self::executor::ExVaultKaminoYvaultsExecutor; +/// Exposes the reserved `ExVaultMeteoraExecutor` implementation. +pub use self::executor::ExVaultMeteoraExecutor; +/// Exposes the reserved `ExVestingStreamflowExecutor` implementation. +pub use self::executor::ExVestingStreamflowExecutor; +/// Exposes the reserved `ExWalletJupiterApeproSmartWalletExecutor` implementation. +pub use self::executor::ExWalletJupiterApeproSmartWalletExecutor; +/// Exposes the reserved `ExWeightedSwapStabbleExecutor` implementation. +pub use self::executor::ExWeightedSwapStabbleExecutor; +/// Exposes the compact JSON payload serializer. +pub use self::executor::executor_api_serialize_payload_json; +/// Exposes the pretty JSON payload serializer. +pub use self::executor::executor_api_serialize_payload_json_pretty; +/// Stable native and SPL administration materializer. +pub use self::materializer::MtAdminMaterializer; +/// Stable decoded observation materializer contract used by the common pipeline. +pub use self::materializer::MtApiEventMaterializer; +/// Explicit policy applied to successful and failed source transactions. +pub use self::materializer::MtApiMaterializationTransactionPolicy; +/// Stable processor-owned business output derived from one decoded observation. +pub use self::materializer::MtApiMaterializedOutput; +/// Structured materializer diagnostic without generic error wrappers. +pub use self::materializer::MtApiMaterializerDiagnostic; +/// Complete explicit result produced by one materializer invocation. +pub use self::materializer::MtApiMaterializerExecutionResult; +/// Stable identity of one decoded event materializer. +pub use self::materializer::MtApiMaterializerIdentity; +/// Terminal materializer result status. +pub use self::materializer::MtApiMaterializerOutcomeStatus; +/// Reserved bridge materializer. +pub use self::materializer::MtBridgeMaterializer; +/// Stable native compliance audit materializer. +pub use self::materializer::MtComplianceAuditMaterializer; +/// Fee materializer for committed Token-2022 fee observations. +pub use self::materializer::MtFeesMaterializer; +/// Reserved governance materializer. +pub use self::materializer::MtGovernanceMaterializer; +/// Reserved lending materializer. +pub use self::materializer::MtLendingMaterializer; +/// Stable native lifecycle materializer. +pub use self::materializer::MtLifecycleMaterializer; +/// Reserved liquidity materializer. +pub use self::materializer::MtLiquidityMaterializer; +/// Exposes the legacy common business materializer trait. +pub use self::materializer::MtMaterializer; +/// Token-2022 and Metaplex metadata snapshot materializer. +pub use self::materializer::MtMetadataMaterializer; +/// Reserved NFT materializer. +pub use self::materializer::MtNftMaterializer; +/// Reserved oracle materializer. +pub use self::materializer::MtOracleMaterializer; +/// Reserved orderbook materializer. +pub use self::materializer::MtOrderbookMaterializer; +/// Reserved perpetuals materializer. +pub use self::materializer::MtPerpetualsMaterializer; +/// Reserved pool-state materializer. +pub use self::materializer::MtPoolStateMaterializer; +/// Reserved rewards materializer. +pub use self::materializer::MtRewardsMaterializer; +/// Stable SPL Token and ATA risk materializer. +pub use self::materializer::MtRiskMaterializer; +/// Reserved routing materializer. +pub use self::materializer::MtRoutingMaterializer; +/// Stable native stake and vote materializer. +pub use self::materializer::MtStakingMaterializer; +/// Stable Token, ATA and Token-2022 account materializer. +pub use self::materializer::MtTokenAccountsMaterializer; +/// Reserved token-metadata risk materializer. +pub use self::materializer::MtTokenMetadataRiskMaterializer; +/// Reserved trades materializer. +pub use self::materializer::MtTradesMaterializer; +/// Stable committed Memo transaction annotation materializer. +pub use self::materializer::MtTransactionAnnotationMaterializer; +/// Reserved vault materializer. +pub use self::materializer::MtVaultMaterializer; +/// Materializes one exact SPL ElGamal registry account snapshot. +pub use self::materializer::materializer_admin_materialize_elgamal_registry_state_snapshot; +/// Materializes exact Token-2022 administration account snapshots. +pub use self::materializer::materializer_admin_materialize_token2022_state_snapshots; +/// Returns true when a materializer explicitly accepts one decoded family. +pub use self::materializer::materializer_api_accepts_family; +/// Returns true when a materializer accepts one exact decoded observation. +pub use self::materializer::materializer_api_accepts_observation; +/// Applies the mandatory source transaction policy before materialization. +pub use self::materializer::materializer_api_validate_materialization_policy; +/// Rejects mutable business outputs derived from failed or uncommitted observations. +pub use self::materializer::materializer_api_validate_materialized_output_policy; +/// Materializes authoritative Token-2022 fee extension snapshots. +pub use self::materializer::materializer_fees_materialize_token2022_state_snapshots; +/// Materializes one canonical non-Metadata Metaplex account snapshot. +pub use self::materializer::materializer_metadata_materialize_metaplex_account_snapshot; +/// Materializes one canonical Metaplex Metadata account snapshot. +pub use self::materializer::materializer_metadata_materialize_metaplex_metadata_snapshot; +/// Materializes Token-2022 embedded metadata and group snapshots. +pub use self::materializer::materializer_metadata_materialize_token2022_snapshot; +/// Materializes one bounded Token-2022 account state snapshot. +pub use self::materializer::materializer_token_materialize_token2022_state_snapshot; +/// Current canonical transaction document version. +pub use self::model::MD_CANONICAL_TRANSACTION_FORMAT_VERSION; +/// Source-neutral replay contracts. +/// Version of the normalized core replay contract. +pub use self::model::MD_CORE_REPLAY_INPUT_CONTRACT_VERSION; +/// Canonical address lookup table reference. +pub use self::model::MdCanonicalAddressTableLookup; +/// Canonical compiled Solana instruction. +pub use self::model::MdCanonicalCompiledInstruction; +/// Canonical group of inner instructions. +pub use self::model::MdCanonicalInnerInstructionGroup; +/// Canonical runtime-loaded addresses. +pub use self::model::MdCanonicalLoadedAddresses; +/// Canonical Solana message header. +pub use self::model::MdCanonicalMessageHeader; +/// Canonical transaction return data. +pub use self::model::MdCanonicalReturnData; +/// Canonical transaction reward. +pub use self::model::MdCanonicalReward; +/// Canonical exact token balance. +pub use self::model::MdCanonicalTokenBalance; +/// Source-independent canonical Solana transaction. +pub use self::model::MdCanonicalTransaction; +/// Canonical Solana transaction message. +pub use self::model::MdCanonicalTransactionMessage; +/// Canonical Solana transaction execution metadata. +pub use self::model::MdCanonicalTransactionMetadata; +/// Canonical Solana transaction execution status. +pub use self::model::MdCanonicalTransactionStatus; +/// Canonical Solana transaction version. +pub use self::model::MdCanonicalTransactionVersion; +/// Decoder replay input containing one instruction plus extracted transaction context. +pub use self::model::MdCoreInstructionReplayInput; +/// Protocol-level decoded event produced by a decoder. +pub use self::model::MdDecodedProtocolEvent; +/// Confidence level for a decoded event. +pub use self::model::MdDecoderConfidence; +/// Canonical event code in `.` format. +pub use self::model::MdEventCode; +/// High-level event family. +pub use self::model::MdEventFamily; +/// Event name without surface prefix. +pub use self::model::MdEventName; +/// Source from which a decoded event was derived. +pub use self::model::MdEventSourceKind; +/// Stable top-level or inner instruction path. +pub use self::model::MdInstructionPath; +/// Business-level materialized event placeholder. +pub use self::model::MdMaterializedEvent; +/// Materialized event family. +pub use self::model::MdMaterializedEventFamily; +/// Stable internal program code. +pub use self::model::MdProgramCode; +/// Solana program id. +pub use self::model::MdProgramId; +/// Generic program observation derived from a Solana instruction. +pub use self::model::MdProgramObservation; +/// Protocol family code, for example `raydium` or `meteora`. +pub use self::model::MdProtocolCode; +/// Solana public key. +pub use self::model::MdPubkey; +/// Solana transaction signature. +pub use self::model::MdSignature; +/// Solana slot. +pub use self::model::MdSlot; +/// Concrete protocol surface code, for example `raydium_amm_v4`. +pub use self::model::MdSurfaceCode; + /// Approve Collection Authority discriminator. pub(crate) use self::decoder::DC_METADATA_MTM_APPROVE_COLLECTION_AUTHORITY_DISCRIMINATOR; /// Approve Use Authority discriminator. @@ -454,553 +1212,3 @@ pub(crate) use self::materializer::MT_TRANSACTION_ANNOTATIONS_PROCESSOR_NAME; pub(crate) use self::materializer::MT_TRANSACTION_ANNOTATIONS_PROJECTION_VERSION; /// Canonical tracing target for transaction annotations. pub(crate) use self::materializer::MT_TRANSACTION_ANNOTATIONS_TRACING_TARGET; - -/// Current contextual core instruction input contract version. -pub use self::decoder::DC_API_CORE_INSTRUCTION_INPUT_CONTRACT_VERSION; -/// Exhaustive published Metaplex account-key inventory. -pub use self::decoder::DC_METADATA_MTM_METADATA_ACCOUNT_LAYOUT_AUDIT; -/// Exact byte length of one SPL ElGamal registry account. -pub use self::decoder::DC_SPL_ELGAMAL_REGISTRY_ACCOUNT_LEN; -/// Reserved `kb_decoder_adapter_saber_decimal_wrapper` decoder. -pub use self::decoder::DcAdapterSaberDecimalWrapperDecoder; -/// Reserved `kb_decoder_admin_jupiter_lock` decoder. -pub use self::decoder::DcAdminJupiterLockDecoder; -/// Reserved `kb_decoder_admin_pump_fees` decoder. -pub use self::decoder::DcAdminPumpFeesDecoder; -/// Reserved `kb_decoder_amm_aldrin_v1` decoder. -pub use self::decoder::DcAmmAldrinV1Decoder; -/// Reserved `kb_decoder_amm_aldrin_v2` decoder. -pub use self::decoder::DcAmmAldrinV2Decoder; -/// Reserved `kb_decoder_amm_alphaq` decoder. -pub use self::decoder::DcAmmAlphaqDecoder; -/// Reserved `kb_decoder_amm_believe` decoder. -pub use self::decoder::DcAmmBelieveDecoder; -/// Reserved `kb_decoder_amm_bonk_swap` decoder. -pub use self::decoder::DcAmmBonkSwapDecoder; -/// Reserved `kb_decoder_amm_fluxbeam` decoder. -pub use self::decoder::DcAmmFluxbeamDecoder; -/// Reserved `kb_decoder_amm_goon_fi` decoder. -pub use self::decoder::DcAmmGoonFiDecoder; -/// Reserved `kb_decoder_amm_goosefx_gamma` decoder. -pub use self::decoder::DcAmmGoosefxGammaDecoder; -/// Reserved `kb_decoder_amm_goosefx_v2` decoder. -pub use self::decoder::DcAmmGoosefxV2Decoder; -/// Reserved `kb_decoder_amm_guac_swap` decoder. -pub use self::decoder::DcAmmGuacSwapDecoder; -/// Reserved `kb_decoder_amm_lifinity_swap_v2` decoder. -pub use self::decoder::DcAmmLifinitySwapV2Decoder; -/// Reserved `kb_decoder_amm_metadao_futarchy_amm` decoder. -pub use self::decoder::DcAmmMetadaoFutarchyAmmDecoder; -/// Reserved `kb_decoder_amm_metadao_v0_5` decoder. -pub use self::decoder::DcAmmMetadaoV05Decoder; -/// Reserved `kb_decoder_amm_meteora_damm_v1` decoder. -pub use self::decoder::DcAmmMeteoraDammV1Decoder; -/// Reserved `kb_decoder_amm_meteora_damm_v2` decoder. -pub use self::decoder::DcAmmMeteoraDammV2Decoder; -/// Reserved `kb_decoder_amm_obric_v2` decoder. -pub use self::decoder::DcAmmObricV2Decoder; -/// Reserved `kb_decoder_amm_one_dex` decoder. -pub use self::decoder::DcAmmOneDexDecoder; -/// Reserved `kb_decoder_amm_pump_swap` decoder. -pub use self::decoder::DcAmmPumpSwapDecoder; -/// Reserved `kb_decoder_amm_raydium_lp_v4` decoder. -pub use self::decoder::DcAmmRaydiumLpV4Decoder; -/// Reserved `kb_decoder_amm_solfi` decoder. -pub use self::decoder::DcAmmSolfiDecoder; -/// Reserved `kb_decoder_amm_solfi_v2` decoder. -pub use self::decoder::DcAmmSolfiV2Decoder; -/// Reserved `kb_decoder_amm_vertigo` decoder. -pub use self::decoder::DcAmmVertigoDecoder; -/// Reserved `kb_decoder_amm_virtuals` decoder. -pub use self::decoder::DcAmmVirtualsDecoder; -/// Reserved `kb_decoder_amm_woofi` decoder. -pub use self::decoder::DcAmmWoofiDecoder; -/// Reserved `kb_decoder_amm_zero_fi` decoder. -pub use self::decoder::DcAmmZeroFiDecoder; -/// Reserved `kb_decoder_amm_zora` decoder. -pub use self::decoder::DcAmmZoraDecoder; -/// Reserved `kb_decoder_anchor` decoder. -pub use self::decoder::DcAnchorDecoder; -/// Stable contextual decoded observation. -pub use self::decoder::DcApiDecodedObservation; -/// Machine-readable decoder coverage declaration. -pub use self::decoder::DcApiDecoderCoverageDeclaration; -/// Declared decoder coverage entry kind. -pub use self::decoder::DcApiDecoderCoverageEntryKind; -/// Structured decoder diagnostic. -pub use self::decoder::DcApiDecoderDiagnostic; -/// Complete decoder execution result. -pub use self::decoder::DcApiDecoderExecutionResult; -/// Stable decoder identity. -pub use self::decoder::DcApiDecoderIdentity; -/// Decoder terminal result status. -pub use self::decoder::DcApiDecoderOutcomeStatus; -/// Explicit decoding proof. -pub use self::decoder::DcApiDecoderProof; -/// Decoding proof category. -pub use self::decoder::DcApiDecoderProofKind; -/// Deterministic decoder recognition result. -pub use self::decoder::DcApiDecoderRecognition; -/// Exposes the decoder support level. -pub use self::decoder::DcApiDecoderSupport; -/// One statically declared decoder surface. -pub use self::decoder::DcApiDecoderSurface; -/// Initial decoder implementation placeholder for API-level tests. -pub use self::decoder::DcApiInitialDecoder; -/// Contextual instruction decoder contract. -pub use self::decoder::DcApiInstructionDecoder; -/// Exposes the common protocol decoder trait. -pub use self::decoder::DcApiProtocolDecoder; -/// Reserved `kb_decoder_bridge_circle_cctp_token_messenger_minter` decoder. -pub use self::decoder::DcBridgeCircleCctpTokenMessengerMinterDecoder; -/// Reserved `kb_decoder_bridge_circle_cctp_token_messenger_minter_v2` decoder. -pub use self::decoder::DcBridgeCircleCctpTokenMessengerMinterV2Decoder; -/// Reserved `kb_decoder_bridge_layer_zero_endpoint` decoder. -pub use self::decoder::DcBridgeLayerZeroEndpointDecoder; -/// Reserved `kb_decoder_bridge_layer_zero_executor` decoder. -pub use self::decoder::DcBridgeLayerZeroExecutorDecoder; -/// Reserved `kb_decoder_clmm_byreal` decoder. -pub use self::decoder::DcClmmByrealDecoder; -/// Reserved `kb_decoder_clmm_fusion` decoder. -pub use self::decoder::DcClmmFusionDecoder; -/// Reserved `kb_decoder_clmm_orca_whirlpool` decoder. -pub use self::decoder::DcClmmOrcaWhirlpoolDecoder; -/// Reserved `kb_decoder_clmm_pancake_swap` decoder. -pub use self::decoder::DcClmmPancakeSwapDecoder; -/// Reserved `kb_decoder_clmm_raydium` decoder. -pub use self::decoder::DcClmmRaydiumDecoder; -/// Reserved `kb_decoder_clmm_stabble` decoder. -pub use self::decoder::DcClmmStabbleDecoder; -/// Reserved `kb_decoder_cpmm_raydium` decoder. -pub use self::decoder::DcCpmmRaydiumDecoder; -/// Reserved `kb_decoder_dlmm_meteora` decoder. -pub use self::decoder::DcDlmmMeteoraDecoder; -/// Reserved `kb_decoder_fees_bags_fee_share_v1` decoder. -pub use self::decoder::DcFeesBagsFeeShareV1Decoder; -/// Reserved `kb_decoder_fees_bags_fee_share_v2` decoder. -pub use self::decoder::DcFeesBagsFeeShareV2Decoder; -/// Reserved `kb_decoder_governance_metadao_bid_wall` decoder. -pub use self::decoder::DcGovernanceMetadaoBidWallDecoder; -/// Reserved `kb_decoder_launchpad_boop_fun` decoder. -pub use self::decoder::DcLaunchpadBoopFunDecoder; -/// Reserved `kb_decoder_launchpad_metadao_ico` decoder. -pub use self::decoder::DcLaunchpadMetadaoIcoDecoder; -/// Reserved `kb_decoder_launchpad_meteora_dbc` decoder. -pub use self::decoder::DcLaunchpadMeteoraDbcDecoder; -/// Reserved `kb_decoder_launchpad_moonit` decoder. -pub use self::decoder::DcLaunchpadMoonitDecoder; -/// Reserved `kb_decoder_launchpad_orca_wavebreak` decoder. -pub use self::decoder::DcLaunchpadOrcaWavebreakDecoder; -/// Reserved `kb_decoder_launchpad_printr` decoder. -pub use self::decoder::DcLaunchpadPrintrDecoder; -/// Reserved `kb_decoder_launchpad_pump_fun` decoder. -pub use self::decoder::DcLaunchpadPumpFunDecoder; -/// Reserved `kb_decoder_launchpad_pump_pumpup_ai` decoder. -pub use self::decoder::DcLaunchpadPumpPumpupAiDecoder; -/// Reserved `kb_decoder_launchpad_raydium_launchlab` decoder. -pub use self::decoder::DcLaunchpadRaydiumLaunchlabDecoder; -/// Reserved `kb_decoder_lending_clone` decoder. -pub use self::decoder::DcLendingCloneDecoder; -/// Reserved `kb_decoder_lending_jupiter_lend_borrow` decoder. -pub use self::decoder::DcLendingJupiterLendBorrowDecoder; -/// Reserved `kb_decoder_lending_jupiter_lend_earn` decoder. -pub use self::decoder::DcLendingJupiterLendEarnDecoder; -/// Reserved `kb_decoder_lending_jupiter_lend_flash_loan` decoder. -pub use self::decoder::DcLendingJupiterLendFlashLoanDecoder; -/// Reserved `kb_decoder_lending_jupiter_lend_liquidity` decoder. -pub use self::decoder::DcLendingJupiterLendLiquidityDecoder; -/// Reserved `kb_decoder_lending_kamino` decoder. -pub use self::decoder::DcLendingKaminoDecoder; -/// Reserved `kb_decoder_lending_marginfi_v2` decoder. -pub use self::decoder::DcLendingMarginfiV2Decoder; -/// Reserved `kb_decoder_lock_raydium_lp` decoder. -pub use self::decoder::DcLockRaydiumLpDecoder; -/// Exact decoder for the Metaplex Token Metadata program. -/// Exact decoder for the Metaplex Token Metadata program. -pub use self::decoder::DcMetadataMetaplexTokenMetadataDecoder; -/// Canonical projection shared by Collection and Use Authority records. -pub use self::decoder::DcMetadataMtmAuthorityRecordAccountSnapshot; -/// Stable identity and policy of one canonical account snapshot. -pub use self::decoder::DcMetadataMtmCanonicalAccountIdentity; -/// Lifecycle represented by one canonical Metaplex account snapshot. -/// Lifecycle class of one canonical account layout. -pub use self::decoder::DcMetadataMtmCanonicalAccountLifecycle; -/// Provenance for one canonical Metaplex account snapshot. -/// Provenance retained for one canonical account observation. -pub use self::decoder::DcMetadataMtmCanonicalAccountProvenance; -/// Execution policy attached to one canonical Metaplex account layout. -/// Execution policy separated from historical materialization. -pub use self::decoder::DcMetadataMtmCanonicalExecutionPolicy; -/// Materialization policy attached to one canonical Metaplex account layout. -/// Materialization policy for active or historical state. -pub use self::decoder::DcMetadataMtmCanonicalMaterializationPolicy; -/// Canonical Metaplex account snapshot. -/// Canonical account envelope used by materializers and replay. -pub use self::decoder::DcMetadataMtmCanonicalMetadataAccountSnapshot; -/// Canonical state held by one Metaplex account snapshot. -/// Typed canonical Metaplex account state. -pub use self::decoder::DcMetadataMtmCanonicalMetadataAccountState; -/// Source of one canonical Metaplex account observation. -/// Origin of one canonical account observation. -pub use self::decoder::DcMetadataMtmCanonicalObservationSource; -/// Canonical projection shared by Metadata and Holder delegate records. -pub use self::decoder::DcMetadataMtmDelegateRecordAccountSnapshot; -/// Parsed Metaplex edition account kind. -/// Supported edition account layout. -pub use self::decoder::DcMetadataMtmEditionAccountKind; -/// Parsed Metaplex edition account snapshot. -/// Canonical bounded projection of one edition or master-edition account. -pub use self::decoder::DcMetadataMtmEditionAccountSnapshot; -/// Parsed Metaplex edition marker account kind. -/// Supported Edition Marker account layout. -pub use self::decoder::DcMetadataMtmEditionMarkerAccountKind; -/// Parsed Metaplex edition marker account snapshot. -/// Canonical bounded projection of one Edition Marker account. -pub use self::decoder::DcMetadataMtmEditionMarkerAccountSnapshot; -/// Bounded error returned while decoding a Metadata account. -pub use self::decoder::DcMetadataMtmMetadataAccountDecodeError; -/// One entry in the exhaustive published account-key audit. -pub use self::decoder::DcMetadataMtmMetadataAccountLayoutAuditEntry; -/// Parsed Metaplex MetadataV1 account snapshot. -/// Canonical bounded projection of one Metadata account. -pub use self::decoder::DcMetadataMtmMetadataAccountSnapshot; -/// One bounded historical reservation entry. -pub use self::decoder::DcMetadataMtmReservationEntrySnapshot; -/// Parsed Metaplex reservation-list account kind. -/// Historical Reservation List account generation. -pub use self::decoder::DcMetadataMtmReservationListAccountKind; -/// Parsed Metaplex reservation-list account snapshot. -/// Canonical decode-only projection of a historical Reservation List account. -pub use self::decoder::DcMetadataMtmReservationListAccountSnapshot; -/// Canonical projection of one Token Owned Escrow account. -pub use self::decoder::DcMetadataMtmTokenOwnedEscrowAccountSnapshot; -/// Authority form used by one Token Owned Escrow account. -pub use self::decoder::DcMetadataMtmTokenOwnedEscrowAuthorityKind; -/// Parsed Metaplex token-record account snapshot. -/// Canonical bounded projection of one programmable Token Record account. -pub use self::decoder::DcMetadataMtmTokenRecordAccountSnapshot; -/// Reserved `kb_decoder_metadata_spl_name_service` decoder. -pub use self::decoder::DcMetadataSplNameServiceDecoder; -/// Reserved `kb_decoder_nft_metaplex_bubblegum` decoder. -pub use self::decoder::DcNftMetaplexBubblegumDecoder; -/// Reserved `kb_decoder_orderbook_jupiter_limit_order` decoder. -pub use self::decoder::DcOrderbookJupiterLimitOrderDecoder; -/// Reserved `kb_decoder_orderbook_jupiter_limit_order_v2` decoder. -pub use self::decoder::DcOrderbookJupiterLimitOrderV2Decoder; -/// Reserved `kb_decoder_orderbook_openbook_v2` decoder. -pub use self::decoder::DcOrderbookOpenbookV2Decoder; -/// Reserved `kb_decoder_perpetuals_drift_v2` decoder. -pub use self::decoder::DcPerpetualsDriftV2Decoder; -/// Reserved `kb_decoder_perpetuals_jupiter` decoder. -pub use self::decoder::DcPerpetualsJupiterDecoder; -/// Reserved `kb_decoder_perpetuals_zeta` decoder. -pub use self::decoder::DcPerpetualsZetaDecoder; -/// Reserved `kb_decoder_router_dflow_aggregator_v4` decoder. -pub use self::decoder::DcRouterDflowAggregatorV4Decoder; -/// Reserved `kb_decoder_router_jupiter_aggregator_v4` decoder. -pub use self::decoder::DcRouterJupiterAggregatorV4Decoder; -/// Reserved `kb_decoder_router_jupiter_aggregator_v6` decoder. -pub use self::decoder::DcRouterJupiterAggregatorV6Decoder; -/// Reserved `kb_decoder_router_jupiter_dca` decoder. -pub use self::decoder::DcRouterJupiterDcaDecoder; -/// Reserved `kb_decoder_router_okx_labs_v1` decoder. -pub use self::decoder::DcRouterOkxLabsV1Decoder; -/// Reserved `kb_decoder_router_okx_labs_v2` decoder. -pub use self::decoder::DcRouterOkxLabsV2Decoder; -/// Reserved `kb_decoder_rwa_ondo_global_markets` decoder. -pub use self::decoder::DcRwaOndoGlobalMarketsDecoder; -/// Runtime-native Solana decoder with maximal native instruction coverage. -pub use self::decoder::DcSolanaCoreDecoder; -/// Reserved `kb_decoder_spl_account_compression` decoder. -pub use self::decoder::DcSplAccountCompressionDecoder; -/// Exact decoder for the SPL Associated Token Account program. -pub use self::decoder::DcSplAssociatedTokenAccountDecoder; -/// Parsed SPL ElGamal public-key registry account. -pub use self::decoder::DcSplElGamalRegistryState; -/// Exact decoder for the SPL ElGamal registry program. -pub use self::decoder::DcSplElgamalRegistryDecoder; -/// Exact decoder for the three registered SPL Memo generations. -pub use self::decoder::DcSplMemoDecoder; -/// Reserved `kb_decoder_spl_noop` decoder. -pub use self::decoder::DcSplNoopDecoder; -/// Reserved `kb_decoder_spl_single_pool` decoder. -pub use self::decoder::DcSplSinglePoolDecoder; -/// Reserved `kb_decoder_spl_stake_pool` decoder. -pub use self::decoder::DcSplStakePoolDecoder; -/// Exact decoder for the Token-2022 program. -pub use self::decoder::DcSplToken2022Decoder; -/// Exact decoder for the classic SPL Token program. -pub use self::decoder::DcSplTokenDecoder; -/// Reserved `kb_decoder_stable_swap_hylo_exchange` decoder. -pub use self::decoder::DcStableSwapHyloExchangeDecoder; -/// Reserved `kb_decoder_stable_swap_jupiter_stable` decoder. -pub use self::decoder::DcStableSwapJupiterStableDecoder; -/// Reserved `kb_decoder_stable_swap_numeraire` decoder. -pub use self::decoder::DcStableSwapNumeraireDecoder; -/// Reserved `kb_decoder_stable_swap_stabble` decoder. -pub use self::decoder::DcStableSwapStabbleDecoder; -/// Reserved `kb_decoder_staking_kamino_farm` decoder. -pub use self::decoder::DcStakingKaminoFarmDecoder; -/// Reserved `kb_decoder_staking_marinade_finance` decoder. -pub use self::decoder::DcStakingMarinadeFinanceDecoder; -/// Reserved `kb_decoder_staking_solayer` decoder. -pub use self::decoder::DcStakingSolayerDecoder; -/// Parsed Token-2022 Mint, Account, or Multisig state. -pub use self::decoder::DcToken2022State; -/// Exact Token-2022 base account state kind. -pub use self::decoder::DcToken2022StateKind; -/// One exact Token-2022 TLV entry. -pub use self::decoder::DcToken2022TlvEntry; -/// Reserved `kb_decoder_treasury_helium_treasury_management` decoder. -pub use self::decoder::DcTreasuryHeliumTreasuryManagementDecoder; -/// Reserved `kb_decoder_vault_carrot_defi` decoder. -pub use self::decoder::DcVaultCarrotDefiDecoder; -/// Reserved `kb_decoder_vault_hylo_stability_pool` decoder. -pub use self::decoder::DcVaultHyloStabilityPoolDecoder; -/// Reserved `kb_decoder_vault_kamino` decoder. -pub use self::decoder::DcVaultKaminoDecoder; -/// Reserved `kb_decoder_vault_kamino_v2` decoder. -pub use self::decoder::DcVaultKaminoV2Decoder; -/// Reserved `kb_decoder_vault_kamino_yvaults` decoder. -pub use self::decoder::DcVaultKaminoYvaultsDecoder; -/// Reserved `kb_decoder_vault_meteora` decoder. -pub use self::decoder::DcVaultMeteoraDecoder; -/// Reserved `kb_decoder_vesting_streamflow` decoder. -pub use self::decoder::DcVestingStreamflowDecoder; -/// Reserved `kb_decoder_wallet_jupiter_apepro_smart_wallet` decoder. -pub use self::decoder::DcWalletJupiterApeproSmartWalletDecoder; -/// Reserved `kb_decoder_weighted_swap_stabble` decoder. -pub use self::decoder::DcWeightedSwapStabbleDecoder; -/// Computes the deterministic contextual input hash. -pub use self::decoder::decoder_api_decoder_api_contextual_input_hash; -/// Returns true when a decoder declares the exact program id. -pub use self::decoder::decoder_api_decoder_handles_program_id; -/// Computes a deterministic lowercase SHA-256 hash for one JSON value. -pub use self::decoder::decoder_api_deterministic_json_hash; -/// Extracts the first eight payload bytes as hexadecimal when available. -pub use self::decoder::decoder_api_discriminator_8_hex; -/// Decodes one Collection Authority Record account. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_collection_authority_record_account; -/// Decodes and validates one edition or master-edition account snapshot. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_edition_account; -/// Decodes and validates one Edition Marker account snapshot. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_edition_marker_account; -/// Decodes one Holder Delegate Record account. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_holder_delegate_record_account; -/// Decodes and validates one canonical Metadata account snapshot. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_metadata_account; -/// Decodes one Metadata Delegate Record account. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_metadata_delegate_record_account; -/// Decodes one historical Reservation List V1 or V2 account. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_reservation_list_account; -/// Decodes one Token Owned Escrow account. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_token_owned_escrow_account; -/// Decodes and validates one programmable Token Record account snapshot. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_token_record_account; -/// Decodes one Use Authority Record account. -pub use self::decoder::decoder_metadata_metaplex_token_metadata_decode_use_authority_record_account; -/// Parses one exact SPL ElGamal registry account. -pub use self::decoder::decoder_spl_elgamal_registry_parse_elgamal_registry_state; -/// Parses one Token-2022 Mint, Account, or Multisig state. -pub use self::decoder::decoder_spl_token2022_parse_token2022_state; -/// Exposes the blockhash policy kind. -pub use self::executor::ExApiExecutionBlockhashKind; -/// Exposes the blockhash policy. -pub use self::executor::ExApiExecutionBlockhashPolicy; -/// Exposes the exact execution capability result. -pub use self::executor::ExApiExecutionCapability; -/// Exposes supported Solana clusters. -pub use self::executor::ExApiExecutionCluster; -/// Exposes cluster restrictions. -pub use self::executor::ExApiExecutionClusterPolicy; -/// Exposes the result of waiting for transaction confirmation. -pub use self::executor::ExApiExecutionConfirmationResult; -/// Exposes transaction confirmation states. -pub use self::executor::ExApiExecutionConfirmationStatus; -/// Exposes explicit execution cost ceilings. -pub use self::executor::ExApiExecutionCostLimit; -/// Exposes the legacy common execution plan type. -pub use self::executor::ExApiExecutionPlan; -/// Exposes the complete execution policy. -pub use self::executor::ExApiExecutionPolicy; -/// Exposes the legacy common execution request type. -pub use self::executor::ExApiExecutionRequest; -/// Exposes the result of a transaction send adapter. -pub use self::executor::ExApiExecutionSendResult; -/// Exposes the simulation policy. -pub use self::executor::ExApiExecutionSimulationPolicy; -/// Exposes the simulation result contract. -pub use self::executor::ExApiExecutionSimulationResult; -/// Exposes the legacy common execution support enum. -pub use self::executor::ExApiExecutionSupport; -/// Exposes the legacy common instruction executor trait. -pub use self::executor::ExApiInstructionExecutor; -/// Exposes one planned instruction account. -pub use self::executor::ExApiPlannedAccount; -/// Exposes one encoded planned instruction. -pub use self::executor::ExApiPlannedInstruction; -/// Exposes post-execution replay diagnostics. -pub use self::executor::ExApiPostExecutionDiagnostic; -/// Exposes post-execution validation requirements. -pub use self::executor::ExApiPostExecutionValidationPolicy; -/// Exposes a typed execution plan. -pub use self::executor::ExApiPreparedExecutionPlan; -/// Exposes one required signer. -pub use self::executor::ExApiRequiredSigner; -/// Exposes the typed executor contract. -pub use self::executor::ExApiTypedInstructionExecutor; -/// Exposes the compact JSON payload serializer. -pub use self::executor::executor_api_serialize_payload_json; -/// Exposes the pretty JSON payload serializer. -pub use self::executor::executor_api_serialize_payload_json_pretty; -/// Stable native and SPL administration materializer. -pub use self::materializer::MtAdminMaterializer; -/// Stable decoded observation materializer contract used by the common pipeline. -pub use self::materializer::MtApiEventMaterializer; -/// Explicit policy applied to successful and failed source transactions. -pub use self::materializer::MtApiMaterializationTransactionPolicy; -/// Stable processor-owned business output derived from one decoded observation. -pub use self::materializer::MtApiMaterializedOutput; -/// Structured materializer diagnostic without generic error wrappers. -pub use self::materializer::MtApiMaterializerDiagnostic; -/// Complete explicit result produced by one materializer invocation. -pub use self::materializer::MtApiMaterializerExecutionResult; -/// Stable identity of one decoded event materializer. -pub use self::materializer::MtApiMaterializerIdentity; -/// Terminal materializer result status. -pub use self::materializer::MtApiMaterializerOutcomeStatus; -/// Reserved bridge materializer. -pub use self::materializer::MtBridgeMaterializer; -/// Stable native compliance audit materializer. -pub use self::materializer::MtComplianceAuditMaterializer; -/// Fee materializer for committed Token-2022 fee observations. -pub use self::materializer::MtFeesMaterializer; -/// Reserved governance materializer. -pub use self::materializer::MtGovernanceMaterializer; -/// Reserved lending materializer. -pub use self::materializer::MtLendingMaterializer; -/// Stable native lifecycle materializer. -pub use self::materializer::MtLifecycleMaterializer; -/// Reserved liquidity materializer. -pub use self::materializer::MtLiquidityMaterializer; -/// Exposes the legacy common business materializer trait. -pub use self::materializer::MtMaterializer; -/// Token-2022 and Metaplex metadata snapshot materializer. -pub use self::materializer::MtMetadataMaterializer; -/// Reserved NFT materializer. -pub use self::materializer::MtNftMaterializer; -/// Reserved oracle materializer. -pub use self::materializer::MtOracleMaterializer; -/// Reserved orderbook materializer. -pub use self::materializer::MtOrderbookMaterializer; -/// Reserved perpetuals materializer. -pub use self::materializer::MtPerpetualsMaterializer; -/// Reserved pool-state materializer. -pub use self::materializer::MtPoolStateMaterializer; -/// Reserved rewards materializer. -pub use self::materializer::MtRewardsMaterializer; -/// Stable SPL Token and ATA risk materializer. -pub use self::materializer::MtRiskMaterializer; -/// Reserved routing materializer. -pub use self::materializer::MtRoutingMaterializer; -/// Stable native stake and vote materializer. -pub use self::materializer::MtStakingMaterializer; -/// Stable Token, ATA and Token-2022 account materializer. -pub use self::materializer::MtTokenAccountsMaterializer; -/// Reserved token-metadata risk materializer. -pub use self::materializer::MtTokenMetadataRiskMaterializer; -/// Reserved trades materializer. -pub use self::materializer::MtTradesMaterializer; -/// Stable committed Memo transaction annotation materializer. -pub use self::materializer::MtTransactionAnnotationMaterializer; -/// Reserved vault materializer. -pub use self::materializer::MtVaultMaterializer; -/// Materializes one exact SPL ElGamal registry account snapshot. -pub use self::materializer::materializer_admin_materialize_elgamal_registry_state_snapshot; -/// Materializes exact Token-2022 administration account snapshots. -pub use self::materializer::materializer_admin_materialize_token2022_state_snapshots; -/// Returns true when a materializer explicitly accepts one decoded family. -pub use self::materializer::materializer_api_accepts_family; -/// Returns true when a materializer accepts one exact decoded observation. -pub use self::materializer::materializer_api_accepts_observation; -/// Applies the mandatory source transaction policy before materialization. -pub use self::materializer::materializer_api_validate_materialization_policy; -/// Rejects mutable business outputs derived from failed or uncommitted observations. -pub use self::materializer::materializer_api_validate_materialized_output_policy; -/// Materializes authoritative Token-2022 fee extension snapshots. -pub use self::materializer::materializer_fees_materialize_token2022_state_snapshots; -/// Materializes one canonical non-Metadata Metaplex account snapshot. -pub use self::materializer::materializer_metadata_materialize_metaplex_account_snapshot; -/// Materializes one canonical Metaplex Metadata account snapshot. -pub use self::materializer::materializer_metadata_materialize_metaplex_metadata_snapshot; -/// Materializes Token-2022 embedded metadata and group snapshots. -pub use self::materializer::materializer_metadata_materialize_token2022_snapshot; -/// Materializes one bounded Token-2022 account state snapshot. -pub use self::materializer::materializer_token_materialize_token2022_state_snapshot; -/// Current canonical transaction document version. -pub use self::model::MD_CANONICAL_TRANSACTION_FORMAT_VERSION; -/// Source-neutral replay contracts. -/// Version of the normalized core replay contract. -pub use self::model::MD_CORE_REPLAY_INPUT_CONTRACT_VERSION; -/// Canonical address lookup table reference. -pub use self::model::MdCanonicalAddressTableLookup; -/// Canonical compiled Solana instruction. -pub use self::model::MdCanonicalCompiledInstruction; -/// Canonical group of inner instructions. -pub use self::model::MdCanonicalInnerInstructionGroup; -/// Canonical runtime-loaded addresses. -pub use self::model::MdCanonicalLoadedAddresses; -/// Canonical Solana message header. -pub use self::model::MdCanonicalMessageHeader; -/// Canonical transaction return data. -pub use self::model::MdCanonicalReturnData; -/// Canonical transaction reward. -pub use self::model::MdCanonicalReward; -/// Canonical exact token balance. -pub use self::model::MdCanonicalTokenBalance; -/// Source-independent canonical Solana transaction. -pub use self::model::MdCanonicalTransaction; -/// Canonical Solana transaction message. -pub use self::model::MdCanonicalTransactionMessage; -/// Canonical Solana transaction execution metadata. -pub use self::model::MdCanonicalTransactionMetadata; -/// Canonical Solana transaction execution status. -pub use self::model::MdCanonicalTransactionStatus; -/// Canonical Solana transaction version. -pub use self::model::MdCanonicalTransactionVersion; -/// Decoder replay input containing one instruction plus extracted transaction context. -pub use self::model::MdCoreInstructionReplayInput; -/// Protocol-level decoded event produced by a decoder. -pub use self::model::MdDecodedProtocolEvent; -/// Confidence level for a decoded event. -pub use self::model::MdDecoderConfidence; -/// Canonical event code in `.` format. -pub use self::model::MdEventCode; -/// High-level event family. -pub use self::model::MdEventFamily; -/// Event name without surface prefix. -pub use self::model::MdEventName; -/// Source from which a decoded event was derived. -pub use self::model::MdEventSourceKind; -/// Stable top-level or inner instruction path. -pub use self::model::MdInstructionPath; -/// Business-level materialized event placeholder. -pub use self::model::MdMaterializedEvent; -/// Materialized event family. -pub use self::model::MdMaterializedEventFamily; -/// Stable internal program code. -pub use self::model::MdProgramCode; -/// Solana program id. -pub use self::model::MdProgramId; -/// Generic program observation derived from a Solana instruction. -pub use self::model::MdProgramObservation; -/// Protocol family code, for example `raydium` or `meteora`. -pub use self::model::MdProtocolCode; -/// Solana public key. -pub use self::model::MdPubkey; -/// Solana transaction signature. -pub use self::model::MdSignature; -/// Solana slot. -pub use self::model::MdSlot; -/// Concrete protocol surface code, for example `raydium_amm_v4`. -pub use self::model::MdSurfaceCode; diff --git a/kb-lib/tests/external_executor_api.rs b/kb-lib/tests/external_executor_api.rs index ebf2cfd..5da1281 100644 --- a/kb-lib/tests/external_executor_api.rs +++ b/kb-lib/tests/external_executor_api.rs @@ -1,10 +1,12 @@ // file: kb-lib/tests/external_executor_api.rs -// version: 1 +// version: 2 //! Downstream-style compilation contract for externally implemented executors. struct ExternalExecutor; +struct ExternalTypedExecutor; + impl kb_lib::ExApiInstructionExecutor for ExternalExecutor { fn executor_name(&self) -> &'static str { return "external_executor"; @@ -37,10 +39,57 @@ impl kb_lib::ExApiInstructionExecutor for ExternalExecutor { } } +impl kb_lib::ExApiTypedInstructionExecutor for ExternalTypedExecutor { + type Intent = kb_lib::MdPubkey; + + fn capability( + &self, + _program_id: &kb_lib::MdProgramId, + operation_code: &str, + ) -> kb_lib::ExApiExecutionCapability { + return kb_lib::ExApiExecutionCapability::unsupported("external_executor", operation_code); + } + + fn build_prepared_plan( + &self, + intent: &Self::Intent, + ) -> kb_core::Result { + return std::result::Result::Ok(kb_lib::ExApiPreparedExecutionPlan { + executor_name: "external_typed_executor".to_string(), + executor_version: "1".to_string(), + intent_id: "external-intent".to_string(), + operation_code: "external-operation".to_string(), + fee_payer: intent.clone(), + instructions: std::vec::Vec::new(), + required_signers: std::vec::Vec::new(), + policy: kb_lib::ExApiExecutionPolicy::default(), + requested_spend_lamports: 0, + requested_compute_unit_price_micro_lamports: std::option::Option::None, + }); + } +} + #[test] fn external_executor_uses_only_the_public_kb_lib_contract() { let executor: &dyn kb_lib::ExApiInstructionExecutor = &ExternalExecutor; assert_eq!(executor.executor_name(), "external_executor"); assert_eq!(executor.executor_version(), "1"); assert!(executor.program_ids().is_empty()); + let typed_executor = ExternalTypedExecutor; + let program_id = kb_lib::MdProgramId("external-program".to_string()); + let capability = kb_lib::ExApiTypedInstructionExecutor::capability( + &typed_executor, + &program_id, + "external-operation", + ); + assert!(!capability.is_supported()); + let fee_payer = kb_lib::MdPubkey("external-fee-payer".to_string()); + let plan = + kb_lib::ExApiTypedInstructionExecutor::build_prepared_plan(&typed_executor, &fee_payer) + .unwrap_or_else(|error| panic!("external typed executor failed: {error}")); + assert_eq!(plan.fee_payer, fee_payer); + assert!(plan.instructions.is_empty()); + assert!(plan.required_signers.is_empty()); + assert_eq!(plan.policy.simulation, kb_lib::ExApiExecutionSimulationPolicy::Required); + assert!(plan.policy.dry_run); } diff --git a/scripts/audit_khadhroony_workspace_rules.py b/scripts/audit_khadhroony_workspace_rules.py index 9f7a65c..0b56c26 100755 --- a/scripts/audit_khadhroony_workspace_rules.py +++ b/scripts/audit_khadhroony_workspace_rules.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # file: scripts/audit_khadhroony_workspace_rules.py -# version: 7 +# version: 8 """Audit mechanically verifiable rules specific to khadhroony-bot3.""" @@ -359,6 +359,97 @@ def audit_reserved_materializer_scaffolds(root: pathlib.Path) -> list[Violation] return violations +def audit_reserved_executor_scaffolds(root: pathlib.Path) -> list[Violation]: + """Reject temporary executor markers and incomplete reserved executors.""" + + violations: list[Violation] = [] + executor_root = root / "kb-lib/src/executor" + forbidden = ( + "MIGRATION_BOUNDARIES", + "LEGACY_CRATE", + "MIGRATION_STATUS", + "source-preserved-pending-port", + ) + struct_pattern = re.compile(r"^pub struct (Ex[A-Za-z0-9]+Executor);$", re.MULTILINE) + reserved_count = 0 + for path in sorted(executor_root.rglob("*.rs")): + relative = path.relative_to(root).as_posix() + text = path.read_text(encoding="utf-8") + for marker in forbidden: + offset = text.find(marker) + if offset >= 0: + violations.append( + Violation( + "KH_EX001", + relative, + text[:offset].count("\n") + 1, + f"temporary executor migration marker `{marker}` is forbidden", + ) + ) + if "\n//! Reserved executor for `" not in text: + continue + reserved_count += 1 + struct_match = struct_pattern.search(text) + if struct_match is None: + violations.append( + Violation( + "KH_EX002", + relative, + 1, + "reserved executor must expose one `Ex*Executor` unit struct", + ) + ) + continue + type_name = struct_match.group(1) + implementation = f"impl crate::ExApiInstructionExecutor for crate::{type_name} {{" + if implementation not in text: + violations.append( + Violation( + "KH_EX003", + relative, + text[: struct_match.start()].count("\n") + 1, + f"`{type_name}` must implement `ExApiInstructionExecutor`", + ) + ) + if "fn program_ids(&self) -> &'static [&'static str]" not in text: + violations.append( + Violation( + "KH_EX004", + relative, + 1, + "reserved executor must declare its exact Program ID boundary", + ) + ) + if "crate::ExApiExecutionSupport::Maybe" not in text: + violations.append( + Violation( + "KH_EX005", + relative, + 1, + "reserved executor must remain explicitly `Maybe` until implemented", + ) + ) + if '"status":"reserved_executor"' not in text or "instruction_count: 0" not in text: + violations.append( + Violation( + "KH_EX006", + relative, + 1, + "reserved executor must build only an explicit zero-instruction plan", + ) + ) + if reserved_count != 104: + violations.append( + Violation( + "KH_EX007", + "kb-lib/src/executor", + 1, + f"expected 104 reserved executor boundaries, found {reserved_count}", + ) + ) + return violations + + def audit_token2022_naming(root: pathlib.Path) -> list[Violation]: """Reject obsolete internal Token2022 spellings while preserving legacy evidence.""" @@ -503,6 +594,7 @@ def main() -> int: + audit_kb_lib_symbol_prefixes(root) + audit_reserved_decoder_scaffolds(root) + audit_reserved_materializer_scaffolds(root) + + audit_reserved_executor_scaffolds(root) + audit_token2022_naming(root) + audit_private_kb_lib_paths_in_active_docs(root) + audit_solana_types(root)