Revert "refactor: split seed optimization config into wsol_use_seed and mint_use_seed"
This reverts commit eb8de36f50.
This commit is contained in:
+17
-10
@@ -9,10 +9,8 @@ pub struct TradeConfig {
|
||||
/// Whether to create WSOL ATA on startup (default: true)
|
||||
/// If true, SDK will check WSOL ATA on initialization and create if not exists
|
||||
pub create_wsol_ata_on_startup: bool,
|
||||
/// Whether to use seed optimization for WSOL ATA operations (default: false)
|
||||
pub wsol_use_seed: bool,
|
||||
/// Whether to use seed optimization for other mint ATA operations (default: true)
|
||||
pub mint_use_seed: bool,
|
||||
/// Whether to use seed optimization for all ATA operations (default: true)
|
||||
pub use_seed_optimize: bool,
|
||||
}
|
||||
|
||||
impl TradeConfig {
|
||||
@@ -20,19 +18,28 @@ impl TradeConfig {
|
||||
rpc_url: String,
|
||||
swqos_configs: Vec<SwqosConfig>,
|
||||
commitment: CommitmentConfig,
|
||||
create_wsol_ata_on_startup: bool,
|
||||
wsol_use_seed: bool,
|
||||
mint_use_seed: bool,
|
||||
) -> Self {
|
||||
println!("🔧 TradeConfig create_wsol_ata_on_startup default value: true");
|
||||
println!("🔧 TradeConfig use_seed_optimize default value: true");
|
||||
Self {
|
||||
rpc_url,
|
||||
swqos_configs,
|
||||
commitment,
|
||||
create_wsol_ata_on_startup,
|
||||
wsol_use_seed,
|
||||
mint_use_seed,
|
||||
create_wsol_ata_on_startup: true, // 默认:启动时检查并创建
|
||||
use_seed_optimize: true, // 默认:使用seed优化
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a TradeConfig with custom WSOL ATA settings
|
||||
pub fn with_wsol_ata_config(
|
||||
mut self,
|
||||
create_wsol_ata_on_startup: bool,
|
||||
use_seed_optimize: bool,
|
||||
) -> Self {
|
||||
self.create_wsol_ata_on_startup = create_wsol_ata_on_startup;
|
||||
self.use_seed_optimize = use_seed_optimize;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
pub type SolanaRpcClient = solana_client::nonblocking::rpc_client::RpcClient;
|
||||
|
||||
Reference in New Issue
Block a user