feat: Refactor pump.fun buy transaction creation

Removes the `dev_buy_token` and `dev_sol_cost` parameters from the buy process to simplify the interface and reduce redundancy.
This commit is contained in:
ysq
2025-06-20 18:14:26 +08:00
parent 148cce8253
commit 7024e100b9
6 changed files with 7 additions and 60 deletions
+3 -10
View File
@@ -41,17 +41,10 @@ impl InstructionBuilder for PumpFunInstructionBuilder {
return Err(anyhow!("Amount cannot be zero"));
}
// 获取或初始化bonding curve账户
let bonding_curve = if protocol_params.trade_type == SNIPER_BUY {
init_bonding_curve_account(
&params.mint,
protocol_params.dev_buy_token,
protocol_params.dev_sol_cost,
params.creator,
)
.await?
} else {
let bonding_curve = if protocol_params.bonding_curve.is_some() {
protocol_params.bonding_curve.clone().unwrap()
} else {
return Err(anyhow!("Bonding curve not found"));
};
let max_sol_cost = calculate_with_slippage_buy(