The buy and sell methods have added the priority_fee parameter, which can control the priority fee for each transaction

This commit is contained in:
wei
2025-09-02 09:43:53 +08:00
parent 7aa676781c
commit 6f953ffa0d
13 changed files with 107 additions and 9 deletions
+2
View File
@@ -152,6 +152,7 @@ async fn bonk_copy_trade_with_grpc(trade_info: BonkTradeEvent) -> AnyResult<()>
Box::new(BonkParams::from_trade(trade_info.clone())),
None,
true,
None,
)
.await?;
@@ -178,6 +179,7 @@ async fn bonk_copy_trade_with_grpc(trade_info: BonkTradeEvent) -> AnyResult<()>
Box::new(BonkParams::from_trade(trade_info.clone())),
None,
true,
None,
)
.await?;
+2
View File
@@ -121,6 +121,7 @@ async fn bonk_sniper_trade_with_shreds(trade_info: BonkTradeEvent) -> AnyResult<
Box::new(BonkParams::from_dev_trade(trade_info.clone())),
None,
true,
None,
)
.await?;
@@ -152,6 +153,7 @@ async fn bonk_sniper_trade_with_shreds(trade_info: BonkTradeEvent) -> AnyResult<
)),
None,
true,
None,
)
.await?;
+1
View File
@@ -103,6 +103,7 @@ async fn test_middleware() -> AnyResult<()> {
Box::new(PumpSwapParams::from_pool_address_by_rpc(&client.rpc, &pool_address).await?),
None,
true,
None,
)
.await?;
println!("tip: This transaction will not succeed because we're using a test account. You can modify the code to initialize the payer with your own private key");
@@ -146,6 +146,7 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
Box::new(PumpFunParams::from_trade(&trade_info, None)),
None,
true,
None,
)
.await?;
@@ -172,6 +173,7 @@ async fn pumpfun_copy_trade_with_grpc(trade_info: PumpFunTradeEvent) -> AnyResul
Box::new(PumpFunParams::from_trade(&trade_info, Some(true))),
None,
true,
None,
)
.await?;
@@ -114,6 +114,7 @@ async fn pumpfun_sniper_trade_with_shreds(trade_info: PumpFunTradeEvent) -> AnyR
Box::new(PumpFunParams::from_dev_trade(&trade_info, None)),
None,
true,
None,
)
.await?;
@@ -140,6 +141,7 @@ async fn pumpfun_sniper_trade_with_shreds(trade_info: PumpFunTradeEvent) -> AnyR
Box::new(PumpFunParams::immediate_sell(trade_info.creator_vault, true)),
None,
true,
None,
)
.await?;
+2
View File
@@ -188,6 +188,7 @@ async fn pumpswap_trade_with_grpc(mint_pubkey: Pubkey, params: PumpSwapParams) -
Box::new(params.clone()),
None,
true,
None,
)
.await?;
@@ -216,6 +217,7 @@ async fn pumpswap_trade_with_grpc(mint_pubkey: Pubkey, params: PumpSwapParams) -
Box::new(params.clone()),
None,
true,
None,
)
.await?;
@@ -161,6 +161,7 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
Box::new(params),
None,
true,
None,
)
.await?;
@@ -188,6 +189,7 @@ async fn raydium_amm_v4_copy_trade_with_grpc(trade_info: RaydiumAmmV4SwapEvent)
Box::new(params),
None,
true,
None,
)
.await?;
@@ -162,6 +162,7 @@ async fn raydium_cpmm_copy_trade_with_grpc(trade_info: RaydiumCpmmSwapEvent) ->
Box::new(buy_params),
None,
true,
None,
)
.await?;
@@ -191,6 +192,7 @@ async fn raydium_cpmm_copy_trade_with_grpc(trade_info: RaydiumCpmmSwapEvent) ->
Box::new(sell_params),
None,
true,
None,
)
.await?;