This commit is contained in:
2026-07-23 16:37:12 +02:00
parent 99c345f2f2
commit 0da75c1311
2159 changed files with 230833 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/adapter.rs
// version: 1
//! `adapter` executor family.
pub mod saber_decimal_wrapper;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/adapter/saber_decimal_wrapper.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_adapter_saber_decimal_wrapper`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_adapter_saber_decimal_wrapper";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,7 @@
// file: kb-lib/src/executor/admin.rs
// version: 1
//! `admin` executor family.
pub mod jupiter_lock;
pub mod pump_fees;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/admin/jupiter_lock.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_admin_jupiter_lock`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_admin_jupiter_lock";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/admin/pump_fees.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_admin_pump_fees`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_admin_pump_fees";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,31 @@
// file: kb-lib/src/executor/amm.rs
// version: 1
//! `amm` executor family.
pub mod aldrin_v1;
pub mod aldrin_v2;
pub mod alphaq;
pub mod believe;
pub mod bonk_swap;
pub mod fluxbeam;
pub mod goon_fi;
pub mod goosefx_gamma;
pub mod goosefx_v2;
pub mod guac_swap;
pub mod lifinity_swap_v2;
pub mod metadao_futarchy_amm;
pub mod metadao_v0_5;
pub mod meteora_damm_v1;
pub mod meteora_damm_v2;
pub mod obric_v2;
pub mod one_dex;
pub mod pump_swap;
pub mod raydium_lp_v4;
pub mod solfi;
pub mod solfi_v2;
pub mod vertigo;
pub mod virtuals;
pub mod woofi;
pub mod zero_fi;
pub mod zora;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/aldrin_v1.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_aldrin_v1`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_aldrin_v1";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/aldrin_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_aldrin_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_aldrin_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/alphaq.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_alphaq`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_alphaq";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/believe.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_believe`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_believe";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/bonk_swap.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_bonk_swap`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_bonk_swap";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/fluxbeam.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_fluxbeam`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_fluxbeam";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/goon_fi.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_goon_fi`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_goon_fi";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/goosefx_gamma.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_goosefx_gamma`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_goosefx_gamma";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/goosefx_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_goosefx_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_goosefx_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/guac_swap.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_guac_swap`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_guac_swap";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/lifinity_swap_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_lifinity_swap_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_lifinity_swap_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/metadao_futarchy_amm.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_metadao_futarchy_amm`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_metadao_futarchy_amm";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/metadao_v0_5.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_metadao_v0_5`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_metadao_v0_5";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/meteora_damm_v1.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_meteora_damm_v1`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_meteora_damm_v1";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/meteora_damm_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_meteora_damm_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_meteora_damm_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/obric_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_obric_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_obric_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/one_dex.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_one_dex`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_one_dex";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/pump_swap.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_pump_swap`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_pump_swap";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/raydium_lp_v4.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_raydium_lp_v4`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_raydium_lp_v4";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/solfi.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_solfi`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_solfi";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/solfi_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_solfi_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_solfi_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/vertigo.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_vertigo`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_vertigo";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/virtuals.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_virtuals`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_virtuals";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/woofi.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_woofi`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_woofi";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/zero_fi.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_zero_fi`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_zero_fi";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/amm/zora.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_amm_zora`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_amm_zora";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,57 @@
// file: kb-lib/src/executor/api.rs
// version: 2
//! Executor contracts consolidated from `kb_execution_api`.
pub mod execution;
pub mod executor;
/// Exposes the blockhash policy kind.
pub use crate::executor::api::execution::ExecutionBlockhashKind;
/// Exposes the blockhash policy.
pub use crate::executor::api::execution::ExecutionBlockhashPolicy;
/// Exposes the exact execution capability result.
pub use crate::executor::api::execution::ExecutionCapability;
/// Exposes supported Solana clusters.
pub use crate::executor::api::execution::ExecutionCluster;
/// Exposes cluster restrictions.
pub use crate::executor::api::execution::ExecutionClusterPolicy;
/// Exposes the result of waiting for transaction confirmation.
pub use crate::executor::api::execution::ExecutionConfirmationResult;
/// Exposes transaction confirmation states.
pub use crate::executor::api::execution::ExecutionConfirmationStatus;
/// Exposes explicit execution cost ceilings.
pub use crate::executor::api::execution::ExecutionCostLimit;
/// Exposes the complete execution policy.
pub use crate::executor::api::execution::ExecutionPolicy;
/// Exposes the result of a transaction send adapter.
pub use crate::executor::api::execution::ExecutionSendResult;
/// Exposes the simulation policy.
pub use crate::executor::api::execution::ExecutionSimulationPolicy;
/// Exposes the simulation result contract.
pub use crate::executor::api::execution::ExecutionSimulationResult;
/// Exposes one planned instruction account.
pub use crate::executor::api::execution::PlannedAccount;
/// Exposes one encoded planned instruction.
pub use crate::executor::api::execution::PlannedInstruction;
/// Exposes post-execution replay diagnostics.
pub use crate::executor::api::execution::PostExecutionDiagnostic;
/// Exposes post-execution validation requirements.
pub use crate::executor::api::execution::PostExecutionValidationPolicy;
/// Exposes a typed execution plan.
pub use crate::executor::api::execution::PreparedExecutionPlan;
/// Exposes one required signer.
pub use crate::executor::api::execution::RequiredSigner;
/// Exposes the typed executor contract.
pub use crate::executor::api::execution::TypedInstructionExecutor;
/// Exposes the legacy common execution plan type.
pub use crate::executor::api::executor::ExecutionPlan;
/// Exposes the legacy common execution request type.
pub use crate::executor::api::executor::ExecutionRequest;
/// Exposes the legacy common execution support enum.
pub use crate::executor::api::executor::ExecutionSupport;
/// Exposes the legacy common instruction executor trait.
pub use crate::executor::api::executor::InstructionExecutor;
/// Exposes the compact JSON payload serializer.
pub use crate::executor::api::executor::serialize_payload_json;
/// Exposes the pretty JSON payload serializer.
pub use crate::executor::api::executor::serialize_payload_json_pretty;

View File

@@ -0,0 +1,496 @@
// file: kb-lib/src/executor/api/execution.rs
// version: 7
//! Typed execution plans, policies and result contracts.
use ts_rs::TS; // rust-rules: derive-import
/// Exact capability returned for one program operation.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[serde(tag = "status", rename_all = "snake_case")]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionCapability.ts"
)]
pub enum ExecutionCapability {
/// The operation is implemented by the executor.
Supported {
/// Stable operation code implemented by the executor.
operation_code: std::string::String,
},
/// The operation is not implemented or is rejected by design.
Unsupported {
/// Stable reason code.
reason_code: std::string::String,
/// Human-readable reason.
reason: std::string::String,
},
}
impl crate::ExecutionCapability {
/// Creates a supported capability value.
pub fn supported(operation_code: impl std::convert::Into<std::string::String>) -> Self {
return Self::Supported { operation_code: operation_code.into() };
}
/// Creates an unsupported capability value.
pub fn unsupported(
reason_code: impl std::convert::Into<std::string::String>,
reason: impl std::convert::Into<std::string::String>,
) -> Self {
return Self::Unsupported {
reason_code: reason_code.into(),
reason: reason.into(),
};
}
/// Returns whether the capability is explicitly supported.
pub fn is_supported(&self) -> bool {
return matches!(self, Self::Supported { operation_code: _ });
}
}
/// Solana cluster expected by an execution plan.
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Serialize, TS)]
#[serde(rename_all = "snake_case")]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionCluster.ts"
)]
pub enum ExecutionCluster {
/// Local validator cluster.
Localnet,
/// Public development cluster.
Devnet,
/// Public test cluster.
Testnet,
/// Public production cluster.
///
/// RPC URLs and CLI aliases may still use `mainnet-beta`.
Mainnet,
}
#[derive(serde::Deserialize)]
#[serde(rename_all = "snake_case")]
enum ExecutionClusterWire {
Localnet,
Devnet,
Testnet,
#[serde(alias = "mainnet_beta")]
Mainnet,
}
impl<'de> serde::Deserialize<'de> for crate::ExecutionCluster {
fn deserialize<Deserializer>(
deserializer: Deserializer,
) -> std::result::Result<Self, Deserializer::Error>
where
Deserializer: serde::Deserializer<'de>,
{
let wire = match <ExecutionClusterWire as serde::Deserialize>::deserialize(deserializer) {
std::result::Result::Ok(wire) => wire,
std::result::Result::Err(error) => return std::result::Result::Err(error),
};
return std::result::Result::Ok(match wire {
ExecutionClusterWire::Localnet => Self::Localnet,
ExecutionClusterWire::Devnet => Self::Devnet,
ExecutionClusterWire::Testnet => Self::Testnet,
ExecutionClusterWire::Mainnet => Self::Mainnet,
});
}
}
/// Cluster restrictions attached to an execution plan.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionClusterPolicy.ts"
)]
pub struct ExecutionClusterPolicy {
/// Cluster that the RPC endpoint must report.
pub expected_cluster: crate::ExecutionCluster,
/// Whether production execution may proceed after all other checks.
pub allow_mainnet: bool,
/// Whether the operator explicitly confirmed this production execution.
pub mainnet_confirmation: bool,
}
impl std::default::Default for crate::ExecutionClusterPolicy {
fn default() -> Self {
return Self {
expected_cluster: crate::ExecutionCluster::Devnet,
allow_mainnet: false,
mainnet_confirmation: false,
};
}
}
/// Simulation requirement attached to an execution plan.
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[serde(rename_all = "snake_case")]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionSimulationPolicy.ts"
)]
pub enum ExecutionSimulationPolicy {
/// Simulation must succeed before signing or sending.
Required,
/// Simulation is not required. Safety policy rejects this mode by default.
Optional,
}
/// Blockhash source required when a transaction is assembled.
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[serde(rename_all = "snake_case")]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionBlockhashKind.ts"
)]
pub enum ExecutionBlockhashKind {
/// Fetch a recent blockhash and enforce a bounded age.
Latest,
/// Use a durable nonce account and authority.
DurableNonce,
}
/// Blockhash or durable nonce policy attached to an execution plan.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionBlockhashPolicy.ts"
)]
pub struct ExecutionBlockhashPolicy {
/// Selected blockhash source.
pub kind: crate::ExecutionBlockhashKind,
/// Maximum accepted age for a recent blockhash, in slots.
pub max_age_slots: std::option::Option<u64>,
/// Durable nonce account when `kind` is `DurableNonce`.
pub nonce_account: std::option::Option<crate::Pubkey>,
/// Durable nonce authority when `kind` is `DurableNonce`.
pub nonce_authority: std::option::Option<crate::Pubkey>,
}
impl std::default::Default for crate::ExecutionBlockhashPolicy {
fn default() -> Self {
return Self {
kind: crate::ExecutionBlockhashKind::Latest,
max_age_slots: std::option::Option::Some(150),
nonce_account: std::option::Option::None,
nonce_authority: std::option::Option::None,
};
}
}
/// Explicit cost ceilings attached to an execution plan.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionCostLimit.ts"
)]
pub struct ExecutionCostLimit {
/// Maximum lamports that operation instructions may transfer or lock.
pub max_spend_lamports: std::option::Option<u64>,
/// Maximum total transaction fee accepted after simulation.
pub max_fee_lamports: std::option::Option<u64>,
/// Maximum compute-unit price accepted, in micro-lamports per compute unit.
pub max_compute_unit_price_micro_lamports: std::option::Option<u64>,
}
impl std::default::Default for crate::ExecutionCostLimit {
fn default() -> Self {
return Self {
max_spend_lamports: std::option::Option::None,
max_fee_lamports: std::option::Option::None,
max_compute_unit_price_micro_lamports: std::option::Option::None,
};
}
}
/// Post-execution replay validation policy.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/PostExecutionValidationPolicy.ts"
)]
pub struct PostExecutionValidationPolicy {
/// Whether the sent signature must be inserted into canonical storage.
pub canonical_insert_required: bool,
/// Whether core extraction must complete.
pub core_extraction_required: bool,
/// Whether contextual decode replay must complete.
pub decode_replay_required: bool,
/// Whether compatible materializers must run.
pub materialization_required: bool,
}
impl std::default::Default for crate::PostExecutionValidationPolicy {
fn default() -> Self {
return Self {
canonical_insert_required: true,
core_extraction_required: true,
decode_replay_required: true,
materialization_required: false,
};
}
}
/// Conservative policy carried from intent creation to transaction assembly.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionPolicy.ts"
)]
pub struct ExecutionPolicy {
/// Cluster restrictions.
pub cluster: crate::ExecutionClusterPolicy,
/// Simulation requirement.
pub simulation: crate::ExecutionSimulationPolicy,
/// Blockhash source restrictions.
pub blockhash: crate::ExecutionBlockhashPolicy,
/// Explicit operation and fee ceilings.
pub cost_limit: crate::ExecutionCostLimit,
/// Public keys authorized to sign this plan.
pub authorized_signers: std::vec::Vec<crate::Pubkey>,
/// Whether the operation is restricted to plan construction and simulation.
pub dry_run: bool,
/// Required post-execution validation steps.
pub post_execution_validation: crate::PostExecutionValidationPolicy,
}
impl std::default::Default for crate::ExecutionPolicy {
fn default() -> Self {
return Self {
cluster: crate::ExecutionClusterPolicy::default(),
simulation: crate::ExecutionSimulationPolicy::Required,
blockhash: crate::ExecutionBlockhashPolicy::default(),
cost_limit: crate::ExecutionCostLimit::default(),
authorized_signers: std::vec::Vec::new(),
dry_run: true,
post_execution_validation: crate::PostExecutionValidationPolicy::default(),
};
}
}
/// One account required by a planned instruction.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/PlannedAccount.ts"
)]
pub struct PlannedAccount {
/// Account public key.
pub pubkey: crate::Pubkey,
/// Whether the account must sign the transaction.
pub is_signer: bool,
/// Whether the account must be writable.
pub is_writable: bool,
}
/// One fully encoded instruction in an execution plan.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/PlannedInstruction.ts"
)]
pub struct PlannedInstruction {
/// Target program id.
pub program_id: crate::ProgramId,
/// Stable operation code represented by the instruction.
pub operation_code: std::string::String,
/// Ordered account metadata.
pub accounts: std::vec::Vec<crate::PlannedAccount>,
/// Exact encoded instruction payload.
pub data: std::vec::Vec<u8>,
}
/// Signer required before transaction assembly.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/RequiredSigner.ts"
)]
pub struct RequiredSigner {
/// Signer public key.
pub pubkey: crate::Pubkey,
/// Stable signer role such as `fee_payer`, `funding_account` or `new_account`.
pub role: std::string::String,
}
/// Typed execution plan produced before transaction assembly.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/PreparedExecutionPlan.ts"
)]
pub struct PreparedExecutionPlan {
/// Stable executor crate name.
pub executor_name: std::string::String,
/// Executor package version.
pub executor_version: std::string::String,
/// Caller-provided intent identifier.
pub intent_id: std::string::String,
/// Stable operation code.
pub operation_code: std::string::String,
/// Transaction fee payer.
pub fee_payer: crate::Pubkey,
/// Ordered instructions to place in the transaction message.
pub instructions: std::vec::Vec<crate::PlannedInstruction>,
/// Deduplicated signers required by the fee payer and instruction metas.
pub required_signers: std::vec::Vec<crate::RequiredSigner>,
/// Explicit policy to evaluate before simulation, signing and sending.
pub policy: crate::ExecutionPolicy,
/// Lamports explicitly transferred or locked by planned instructions.
pub requested_spend_lamports: u64,
/// Requested compute-unit price, when present.
pub requested_compute_unit_price_micro_lamports: std::option::Option<u64>,
}
/// Result returned by a transaction simulation adapter.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionSimulationResult.ts"
)]
pub struct ExecutionSimulationResult {
/// Whether an RPC simulation call was actually performed.
pub simulated: bool,
/// Whether the simulated transaction completed successfully.
pub success: bool,
/// Cluster reported by the simulation adapter.
pub cluster: crate::ExecutionCluster,
/// Blockhash source used by the simulated transaction.
pub blockhash_kind: crate::ExecutionBlockhashKind,
/// Observed recent blockhash age, in slots.
pub blockhash_age_slots: std::option::Option<u64>,
/// Replacement blockhash returned by the node, if replacement was requested.
#[serde(default)]
pub replacement_blockhash: std::option::Option<std::string::String>,
/// Last valid block height associated with the replacement blockhash.
#[serde(default)]
pub replacement_last_valid_block_height: std::option::Option<u64>,
/// Durable nonce account used by the simulated transaction.
pub nonce_account: std::option::Option<crate::Pubkey>,
/// Durable nonce authority used by the simulated transaction.
pub nonce_authority: std::option::Option<crate::Pubkey>,
/// Compute units consumed when reported by the RPC endpoint.
pub units_consumed: std::option::Option<u64>,
/// Estimated transaction fee in lamports when available.
pub estimated_fee_lamports: std::option::Option<u64>,
/// Simulation logs in runtime order.
pub logs: std::vec::Vec<std::string::String>,
/// Stable or provider error text when simulation failed.
pub error: std::option::Option<std::string::String>,
}
/// Result returned after an adapter submits a signed transaction.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionSendResult.ts"
)]
pub struct ExecutionSendResult {
/// Cluster used for submission.
pub cluster: crate::ExecutionCluster,
/// Signature returned by the RPC endpoint.
pub signature: crate::Signature,
/// Whether submission was accepted by the RPC endpoint.
pub submitted: bool,
}
/// Confirmation state returned by an execution confirmation adapter.
#[derive(Clone, Copy, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[serde(rename_all = "snake_case")]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionConfirmationStatus.ts"
)]
pub enum ExecutionConfirmationStatus {
/// The transaction was observed at processed commitment.
Processed,
/// The transaction reached confirmed commitment.
Confirmed,
/// The transaction reached finalized commitment.
Finalized,
/// The transaction was confirmed with a runtime error.
Failed,
/// The transaction was not confirmed before its blockhash expired.
Expired,
/// The bounded confirmation poll ended before reaching the requested commitment.
TimedOut,
}
/// Result returned after waiting for transaction confirmation.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/ExecutionConfirmationResult.ts"
)]
pub struct ExecutionConfirmationResult {
/// Cluster queried for confirmation.
pub cluster: crate::ExecutionCluster,
/// Submitted transaction signature.
pub signature: crate::Signature,
/// Highest confirmation state reached.
pub status: crate::ExecutionConfirmationStatus,
/// Slot that reported the transaction when available.
pub slot: std::option::Option<u64>,
/// Number of status polling attempts performed.
pub attempts: u32,
/// Last block height observed while checking recent-blockhash expiration.
pub last_observed_block_height: std::option::Option<u64>,
/// Stable or provider error text when confirmation failed.
pub error: std::option::Option<std::string::String>,
}
/// Diagnostic produced by post-execution canonical replay validation.
#[derive(Clone, Debug, Eq, PartialEq, serde::Deserialize, serde::Serialize, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/execution/PostExecutionDiagnostic.ts"
)]
pub struct PostExecutionDiagnostic {
/// Executed transaction signature.
pub signature: crate::Signature,
/// Whether canonical insertion completed.
pub canonical_inserted: bool,
/// Whether core extraction completed.
pub core_extracted: bool,
/// Whether contextual decode replay completed.
pub decode_replayed: bool,
/// Whether requested materialization completed.
pub materialized: bool,
/// Diagnostic messages from orchestration layers.
pub diagnostics: std::vec::Vec<std::string::String>,
}
/// Contract implemented by executors that expose typed intents and exact plans.
pub trait TypedInstructionExecutor {
/// Protocol-specific typed intent.
type Intent;
/// Returns the exact capability for one program and operation code.
fn capability(
&self,
program_id: &crate::ProgramId,
operation_code: &str,
) -> crate::ExecutionCapability;
/// Builds a typed execution plan without signing, sending or performing I/O.
fn build_prepared_plan(
&self,
intent: &Self::Intent,
) -> kb_core::Result<crate::PreparedExecutionPlan>;
}
#[cfg(test)]
mod tests {
#[test]
fn mainnet_cluster_serializes_with_current_name() {
let serialized = serde_json::to_string(&crate::ExecutionCluster::Mainnet)
.unwrap_or_else(|error| panic!("unexpected serialization error: {error}"));
assert_eq!(serialized, "\"mainnet\"");
let legacy = serde_json::from_str::<crate::ExecutionCluster>("\"mainnet_beta\"")
.unwrap_or_else(|error| panic!("unexpected deserialization error: {error}"));
assert_eq!(legacy, crate::ExecutionCluster::Mainnet);
}
}

View File

@@ -0,0 +1,104 @@
// file: kb-lib/src/executor/api/executor.rs
// version: 3
//! Shared execution contract and neutral request models.
use ts_rs::TS; // rust-rules: derive-import
/// Support level returned by an executor for a requested operation.
#[derive(Clone, Copy, Debug, Eq, PartialEq, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/executor/ExecutionSupport.ts"
)]
pub enum ExecutionSupport {
/// The executor cannot handle the request.
No,
/// The executor may handle the request after account and payload validation.
Maybe,
/// The executor explicitly supports the request.
Yes,
}
/// Generic request used before protocol-specific execution models are introduced.
#[derive(Clone, Debug, Eq, PartialEq, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/executor/ExecutionRequest.ts"
)]
pub struct ExecutionRequest {
/// Target program id.
pub program_id: crate::ProgramId,
/// Stable operation code such as buy, sell, transfer or route.
pub operation_code: std::string::String,
/// Serialized JSON payload reserved for protocol-specific arguments.
pub payload_json: std::string::String,
}
/// Neutral execution plan placeholder produced by executor crates.
#[derive(Clone, Debug, Eq, PartialEq, TS)]
#[ts(
export,
export_to = "../frontend/ts/bindings/kb_execution_api/executor/ExecutionPlan.ts"
)]
pub struct ExecutionPlan {
/// Stable executor crate name.
pub executor_name: std::string::String,
/// Number of instructions that would be produced by the final implementation.
pub instruction_count: usize,
/// Serialized JSON payload reserved for future instruction data and account metadata.
pub payload_json: std::string::String,
}
/// Serializes a JSON payload to its compact string representation.
pub fn serialize_payload_json(value: &serde_json::Value) -> kb_core::Result<std::string::String> {
return match serde_json::to_string(value) {
std::result::Result::Ok(serialized) => std::result::Result::Ok(serialized),
std::result::Result::Err(error) => std::result::Result::Err(kb_core::Error::new(
"execution_payload_json_serialize_failed",
error.to_string(),
)),
};
}
/// Serializes a JSON payload to its pretty string representation.
pub fn serialize_payload_json_pretty(
value: &serde_json::Value,
) -> kb_core::Result<std::string::String> {
return match serde_json::to_string_pretty(value) {
std::result::Result::Ok(serialized) => std::result::Result::Ok(serialized),
std::result::Result::Err(error) => std::result::Result::Err(kb_core::Error::new(
"execution_payload_json_pretty_serialize_failed",
error.to_string(),
)),
};
}
/// Common contract implemented by all execution crates.
pub trait InstructionExecutor {
/// Returns the stable executor name.
fn executor_name(&self) -> &'static str;
/// Returns the executor version.
fn executor_version(&self) -> &'static str;
/// Returns the program ids handled by this executor.
fn program_ids(&self) -> &'static [&'static str];
/// Tests whether this executor owns a program id.
fn handles_program_id(&self, program_id: &crate::ProgramId) -> bool {
return self
.program_ids()
.iter()
.any(|candidate| return *candidate == program_id.0.as_str());
}
/// Tests whether this executor supports a request.
fn supports_request(&self, request: &crate::ExecutionRequest) -> crate::ExecutionSupport;
/// Builds a neutral execution plan placeholder.
fn build_plan(
&self,
request: &crate::ExecutionRequest,
) -> kb_core::Result<crate::ExecutionPlan>;
}

View File

@@ -0,0 +1,9 @@
// file: kb-lib/src/executor/bridge.rs
// version: 1
//! `bridge` executor family.
pub mod circle_cctp_token_messenger_minter;
pub mod circle_cctp_token_messenger_minter_v2;
pub mod layer_zero_endpoint;
pub mod layer_zero_executor;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_bridge_circle_cctp_token_messenger_minter`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_bridge_circle_cctp_token_messenger_minter";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/bridge/circle_cctp_token_messenger_minter_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_bridge_circle_cctp_token_messenger_minter_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_bridge_circle_cctp_token_messenger_minter_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/bridge/layer_zero_endpoint.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_bridge_layer_zero_endpoint`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_bridge_layer_zero_endpoint";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/bridge/layer_zero_executor.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_bridge_layer_zero_executor`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_bridge_layer_zero_executor";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,11 @@
// file: kb-lib/src/executor/clmm.rs
// version: 1
//! `clmm` executor family.
pub mod byreal;
pub mod fusion;
pub mod orca_whirlpool;
pub mod pancake_swap;
pub mod raydium;
pub mod stabble;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/clmm/byreal.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_clmm_byreal`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_clmm_byreal";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/clmm/fusion.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_clmm_fusion`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_clmm_fusion";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/clmm/orca_whirlpool.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_clmm_orca_whirlpool`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_clmm_orca_whirlpool";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/clmm/pancake_swap.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_clmm_pancake_swap`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_clmm_pancake_swap";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/clmm/raydium.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_clmm_raydium`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_clmm_raydium";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/clmm/stabble.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_clmm_stabble`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_clmm_stabble";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/cpmm.rs
// version: 1
//! `cpmm` executor family.
pub mod raydium;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/cpmm/raydium.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_cpmm_raydium`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_cpmm_raydium";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/dlmm.rs
// version: 1
//! `dlmm` executor family.
pub mod meteora;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/dlmm/meteora.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_dlmm_meteora`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_dlmm_meteora";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,7 @@
// file: kb-lib/src/executor/fees.rs
// version: 1
//! `fees` executor family.
pub mod bags_fee_share_v1;
pub mod bags_fee_share_v2;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/fees/bags_fee_share_v1.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_fees_bags_fee_share_v1`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_fees_bags_fee_share_v1";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/fees/bags_fee_share_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_fees_bags_fee_share_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_fees_bags_fee_share_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/governance.rs
// version: 1
//! `governance` executor family.
pub mod metadao_bid_wall;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/governance/metadao_bid_wall.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_governance_metadao_bid_wall`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_governance_metadao_bid_wall";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,14 @@
// file: kb-lib/src/executor/launchpad.rs
// version: 1
//! `launchpad` executor family.
pub mod boop_fun;
pub mod metadao_ico;
pub mod meteora_dbc;
pub mod moonit;
pub mod orca_wavebreak;
pub mod printr;
pub mod pump_fun;
pub mod pump_pumpup_ai;
pub mod raydium_launchlab;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/boop_fun.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_boop_fun`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_boop_fun";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/metadao_ico.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_metadao_ico`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_metadao_ico";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/meteora_dbc.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_meteora_dbc`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_meteora_dbc";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/moonit.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_moonit`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_moonit";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/orca_wavebreak.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_orca_wavebreak`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_orca_wavebreak";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/printr.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_printr`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_printr";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/pump_fun.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_pump_fun`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_pump_fun";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/pump_pumpup_ai.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_pump_pumpup_ai`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_pump_pumpup_ai";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/launchpad/raydium_launchlab.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_launchpad_raydium_launchlab`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_launchpad_raydium_launchlab";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,12 @@
// file: kb-lib/src/executor/lending.rs
// version: 1
//! `lending` executor family.
pub mod clone;
pub mod jupiter_lend_borrow;
pub mod jupiter_lend_earn;
pub mod jupiter_lend_flash_loan;
pub mod jupiter_lend_liquidity;
pub mod kamino;
pub mod marginfi_v2;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/clone.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_clone`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_clone";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/jupiter_lend_borrow.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_borrow`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_borrow";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/jupiter_lend_earn.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_earn`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_earn";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/jupiter_lend_flash_loan.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_flash_loan`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_flash_loan";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/jupiter_lend_liquidity.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_jupiter_lend_liquidity`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_jupiter_lend_liquidity";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/kamino.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_kamino`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_kamino";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lending/marginfi_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lending_marginfi_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lending_marginfi_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/lock.rs
// version: 1
//! `lock` executor family.
pub mod raydium_lp;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/lock/raydium_lp.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_lock_raydium_lp`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_lock_raydium_lp";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,7 @@
// file: kb-lib/src/executor/metadata.rs
// version: 1
//! `metadata` executor family.
pub mod metaplex_token_metadata;
pub mod spl_name_service;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/metadata/metaplex_token_metadata.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_metadata_metaplex_token_metadata`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_metadata_metaplex_token_metadata";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/metadata/spl_name_service.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_metadata_spl_name_service`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_metadata_spl_name_service";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/nft.rs
// version: 1
//! `nft` executor family.
pub mod metaplex_bubblegum;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/nft/metaplex_bubblegum.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_nft_metaplex_bubblegum`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_nft_metaplex_bubblegum";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,8 @@
// file: kb-lib/src/executor/orderbook.rs
// version: 1
//! `orderbook` executor family.
pub mod jupiter_limit_order;
pub mod jupiter_limit_order_v2;
pub mod openbook_v2;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/orderbook/jupiter_limit_order.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_orderbook_jupiter_limit_order`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_orderbook_jupiter_limit_order";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/orderbook/jupiter_limit_order_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_orderbook_jupiter_limit_order_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_orderbook_jupiter_limit_order_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/orderbook/openbook_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_orderbook_openbook_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_orderbook_openbook_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,8 @@
// file: kb-lib/src/executor/perpetuals.rs
// version: 1
//! `perpetuals` executor family.
pub mod drift_v2;
pub mod jupiter;
pub mod zeta;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/perpetuals/drift_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_perpetuals_drift_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_perpetuals_drift_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/perpetuals/jupiter.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_perpetuals_jupiter`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_perpetuals_jupiter";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/perpetuals/zeta.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_perpetuals_zeta`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_perpetuals_zeta";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,11 @@
// file: kb-lib/src/executor/router.rs
// version: 1
//! `router` executor family.
pub mod dflow_aggregator_v4;
pub mod jupiter_aggregator_v4;
pub mod jupiter_aggregator_v6;
pub mod jupiter_dca;
pub mod okx_labs_v1;
pub mod okx_labs_v2;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/router/dflow_aggregator_v4.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_router_dflow_aggregator_v4`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_router_dflow_aggregator_v4";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/router/jupiter_aggregator_v4.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_router_jupiter_aggregator_v4`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_router_jupiter_aggregator_v4";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/router/jupiter_aggregator_v6.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_router_jupiter_aggregator_v6`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_router_jupiter_aggregator_v6";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/router/jupiter_dca.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_router_jupiter_dca`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_router_jupiter_dca";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/router/okx_labs_v1.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_router_okx_labs_v1`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_router_okx_labs_v1";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/router/okx_labs_v2.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_router_okx_labs_v2`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_router_okx_labs_v2";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/rwa.rs
// version: 1
//! `rwa` executor family.
pub mod ondo_global_markets;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/rwa/ondo_global_markets.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_rwa_ondo_global_markets`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_rwa_ondo_global_markets";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

View File

@@ -0,0 +1,6 @@
// file: kb-lib/src/executor/solana.rs
// version: 1
//! `solana` executor family.
pub mod core;

View File

@@ -0,0 +1,10 @@
// file: kb-lib/src/executor/solana/core.rs
// version: 1
//! Migration boundary for legacy crate `kb_executor_solana_core`.
/// Legacy crate name retained for migration and compatibility tracking.
pub const LEGACY_CRATE: &str = "kb_executor_solana_core";
/// Current porting status.
pub const MIGRATION_STATUS: &str = "source-preserved-pending-port";

Some files were not shown because too many files have changed in this diff Show More