feat: upgrade to v0.6.6 with improved tip transfer logic
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "sol-trade-sdk"
|
name = "sol-trade-sdk"
|
||||||
version = "0.6.5"
|
version = "0.6.6"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = [
|
authors = [
|
||||||
"William <byteblock6@gmail.com>",
|
"William <byteblock6@gmail.com>",
|
||||||
|
|||||||
@@ -89,14 +89,14 @@ Add the dependency to your `Cargo.toml`:
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.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
|
### Use crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# Add to your Cargo.toml
|
# Add to your Cargo.toml
|
||||||
sol-trade-sdk = "0.6.5"
|
sol-trade-sdk = "0.6.6"
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🛠️ Usage Examples
|
## 🛠️ Usage Examples
|
||||||
|
|||||||
+2
-2
@@ -89,14 +89,14 @@ git clone https://github.com/0xfnzero/sol-trade-sdk
|
|||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.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
|
### 使用 crates.io
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
# 添加到您的 Cargo.toml
|
# 添加到您的 Cargo.toml
|
||||||
sol-trade-sdk = "0.6.5"
|
sol-trade-sdk = "0.6.6"
|
||||||
```
|
```
|
||||||
|
|
||||||
## 🛠️ 使用示例
|
## 🛠️ 使用示例
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ pub async fn build_transaction(
|
|||||||
instructions.extend(business_instructions);
|
instructions.extend(business_instructions);
|
||||||
|
|
||||||
// Add tip transfer instruction
|
// Add tip transfer instruction
|
||||||
if with_tip {
|
if with_tip && tip_amount > 0.0 {
|
||||||
instructions.push(transfer(
|
instructions.push(transfer(
|
||||||
&payer.pubkey(),
|
&payer.pubkey(),
|
||||||
tip_account,
|
tip_account,
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ async fn parallel_execute(
|
|||||||
|
|
||||||
let tip_account_str = swqos_client.get_tip_account()?;
|
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_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(
|
let transaction = build_transaction(
|
||||||
payer,
|
payer,
|
||||||
|
|||||||
Reference in New Issue
Block a user