diff --git a/src/lib.rs b/src/lib.rs index 1fcc1c2..c5d48c8 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -470,6 +470,7 @@ impl PumpFun { ) -> Result<(), anyhow::Error> { if trade_platform == PUMPFUN { pumpfun::sell::sell_by_percent_with_tip( + self.rpc.clone(), self.fee_clients.clone(), self.payer.clone(), mint, @@ -513,6 +514,7 @@ impl PumpFun { ) -> Result<(), anyhow::Error> { if trade_platform == PUMPFUN { pumpfun::sell::sell_by_amount_with_tip( + self.rpc.clone(), self.fee_clients.clone(), self.payer.clone(), mint, @@ -554,6 +556,7 @@ impl PumpFun { recent_blockhash: Hash, ) -> Result<(), anyhow::Error> { pumpfun::sell::sell_with_tip( + self.rpc.clone(), self.fee_clients.clone(), self.payer.clone(), mint, diff --git a/src/pumpfun/sell.rs b/src/pumpfun/sell.rs index 6836db3..546e4e8 100755 --- a/src/pumpfun/sell.rs +++ b/src/pumpfun/sell.rs @@ -98,6 +98,7 @@ pub async fn sell_by_amount( } pub async fn sell_by_percent_with_tip( + rpc: Arc, fee_clients: Vec>, payer: Arc, mint: Pubkey, @@ -113,6 +114,7 @@ pub async fn sell_by_percent_with_tip( } let amount = amount_token * percent / 100; sell_with_tip( + rpc, fee_clients, payer, mint, @@ -126,6 +128,7 @@ pub async fn sell_by_percent_with_tip( } pub async fn sell_by_amount_with_tip( + rpc: Arc, fee_clients: Vec>, payer: Arc, mint: Pubkey, @@ -139,6 +142,7 @@ pub async fn sell_by_amount_with_tip( return Err(anyhow!("Amount must be greater than 0")); } sell_with_tip( + rpc, fee_clients, payer, mint, @@ -153,6 +157,7 @@ pub async fn sell_by_amount_with_tip( /// Sell tokens using Jito pub async fn sell_with_tip( + rpc: Arc, fee_clients: Vec>, payer: Arc, mint: Pubkey, @@ -167,7 +172,7 @@ pub async fn sell_with_tip( let protocol_params = Box::new(PumpFunSellParams {}); // 创建卖出参数 let sell_params = SellParams { - rpc: None, + rpc: Some(rpc.clone()), payer: payer.clone(), mint, creator,