From 86d64811ad9fc015a5606051c0d9fe8e845452da Mon Sep 17 00:00:00 2001 From: ysq Date: Sun, 12 Oct 2025 20:30:33 +0800 Subject: [PATCH] feat: require durable_nonce for multiple swqos transactions --- Cargo.toml | 2 +- README.md | 4 ++-- README_CN.md | 4 ++-- src/trading/core/async_executor.rs | 4 ++++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 22546cb..7bbf48d 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sol-trade-sdk" -version = "3.1.0" +version = "3.1.1" edition = "2021" authors = [ "William ", diff --git a/README.md b/README.md index f4c83d0..ac9d9cf 100644 --- a/README.md +++ b/README.md @@ -87,14 +87,14 @@ Add the dependency to your `Cargo.toml`: ```toml # Add to your Cargo.toml -sol-trade-sdk = { path = "./sol-trade-sdk", version = "3.1.0" } +sol-trade-sdk = { path = "./sol-trade-sdk", version = "3.1.1" } ``` ### Use crates.io ```toml # Add to your Cargo.toml -sol-trade-sdk = "3.1.0" +sol-trade-sdk = "3.1.1" ``` ## 🛠️ Usage Examples diff --git a/README_CN.md b/README_CN.md index 9283be1..191dc29 100755 --- a/README_CN.md +++ b/README_CN.md @@ -87,14 +87,14 @@ git clone https://github.com/0xfnzero/sol-trade-sdk ```toml # 添加到您的 Cargo.toml -sol-trade-sdk = { path = "./sol-trade-sdk", version = "3.1.0" } +sol-trade-sdk = { path = "./sol-trade-sdk", version = "3.1.1" } ``` ### 使用 crates.io ```toml # 添加到您的 Cargo.toml -sol-trade-sdk = "3.1.0" +sol-trade-sdk = "3.1.1" ``` ## 🛠️ 使用示例 diff --git a/src/trading/core/async_executor.rs b/src/trading/core/async_executor.rs index e9a2306..71e90f7 100644 --- a/src/trading/core/async_executor.rs +++ b/src/trading/core/async_executor.rs @@ -150,6 +150,10 @@ pub async fn execute_parallel( return Err(anyhow!("No available gas fee strategy configs")); } + if task_configs.len() > 1 && durable_nonce.is_none() { + return Err(anyhow!("Multiple swqos transactions require durable_nonce to be set.",)); + } + // Task preparation completed let collector = Arc::new(ResultCollector::new(task_configs.len()));