refactor: update API with DexParamEnum and simplify TradeConfig

- Introduce DexParamEnum to replace Dex enum for protocol parameters
- Simplify TradeConfig::new() to accept only 3 essential parameters
- Update all examples to use new DexParamEnum API
- Optimize executor and params modules
- Remove deprecated wsol_use_seed and mint_use_seed parameters
- Fix fast_fn module exports
This commit is contained in:
Wood
2025-12-08 01:35:40 +08:00
parent de8c55e599
commit 80ad2e052e
24 changed files with 240 additions and 226 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ use sol_trade_sdk::{
common::{AnyResult, TradeConfig},
swqos::{SwqosConfig, SwqosRegion},
trading::{
core::params::PumpSwapParams, factory::DexType, middleware::builtin::LoggingMiddleware,
core::params::{PumpSwapParams, DexParamEnum}, factory::DexType, middleware::builtin::LoggingMiddleware,
InstructionMiddleware, MiddlewareManager,
},
SolanaTrade, TradeTokenType,
@@ -90,7 +90,7 @@ async fn test_middleware() -> AnyResult<()> {
input_token_amount: buy_sol_cost,
slippage_basis_points: slippage_basis_points,
recent_blockhash: Some(recent_blockhash),
extension_params: Box::new(
extension_params: DexParamEnum::PumpSwap(
PumpSwapParams::from_pool_address_by_rpc(&client.rpc, &pool_address).await?,
),
address_lookup_table_account: None,