v0.1.0-pre.014

This commit is contained in:
2026-07-24 17:14:02 +02:00
parent 5f6f7df509
commit 60a75c4434
140 changed files with 6217 additions and 1213 deletions

View File

@@ -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"));
}
}
}