diff --git a/Cargo.toml b/Cargo.toml index c45ce52..6b6f98c 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sol-trade-sdk" -version = "0.6.5" +version = "0.6.6" edition = "2021" authors = [ "William ", diff --git a/README.md b/README.md index 49eb5dd..d723a96 100644 --- a/README.md +++ b/README.md @@ -89,14 +89,14 @@ Add the dependency to your `Cargo.toml`: ```toml # Add to your Cargo.toml -sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.6.5" } +sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.6.6" } ``` ### Use crates.io ```toml # Add to your Cargo.toml -sol-trade-sdk = "0.6.5" +sol-trade-sdk = "0.6.6" ``` ## 🛠️ Usage Examples diff --git a/README_CN.md b/README_CN.md index 8517ace..99b0433 100755 --- a/README_CN.md +++ b/README_CN.md @@ -89,14 +89,14 @@ git clone https://github.com/0xfnzero/sol-trade-sdk ```toml # 添加到您的 Cargo.toml -sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.6.5" } +sol-trade-sdk = { path = "./sol-trade-sdk", version = "0.6.6" } ``` ### 使用 crates.io ```toml # 添加到您的 Cargo.toml -sol-trade-sdk = "0.6.5" +sol-trade-sdk = "0.6.6" ``` ## 🛠️ 使用示例 diff --git a/src/trading/common/transaction_builder.rs b/src/trading/common/transaction_builder.rs index dfbaa5d..a39cc55 100755 --- a/src/trading/common/transaction_builder.rs +++ b/src/trading/common/transaction_builder.rs @@ -54,7 +54,7 @@ pub async fn build_transaction( instructions.extend(business_instructions); // Add tip transfer instruction - if with_tip { + if with_tip && tip_amount > 0.0 { instructions.push(transfer( &payer.pubkey(), tip_account, diff --git a/src/trading/core/parallel.rs b/src/trading/core/parallel.rs index 07b10b0..a023c5e 100755 --- a/src/trading/core/parallel.rs +++ b/src/trading/core/parallel.rs @@ -110,7 +110,7 @@ async fn parallel_execute( let tip_account_str = swqos_client.get_tip_account()?; let tip_account = Arc::new(Pubkey::from_str(&tip_account_str).unwrap_or_default()); - let tip_amount = priority_fee.buy_tip_fees[i]; + let tip_amount = if with_tip { priority_fee.buy_tip_fees[i] } else { 0.0 }; let transaction = build_transaction( payer,