feat: refactor trade API to return execution status with signature

- Bump version from 1.2.0 to 1.2.1
- Change trade methods return type from Signature to (bool, Signature)
- Improve parallel execution error handling and status tracking
- Update CLI examples to match new API interface
- Enhance transaction success/failure reporting capabilities

Breaking Change: Trade API now returns tuple (success_status, signature)
This commit is contained in:
ysq
2025-09-25 21:39:14 +08:00
parent ce5243702c
commit 3962a278b9
8 changed files with 61 additions and 45 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ impl GenericTradeExecutor {
#[async_trait::async_trait]
impl TradeExecutor for GenericTradeExecutor {
async fn swap(&self, params: SwapParams) -> Result<Signature> {
async fn swap(&self, params: SwapParams) -> Result<(bool, Signature)> {
let start = Instant::now();
// 暂时支持这三种。后续重构扩展builder 支持所有的 swap
let is_buy = params.input_mint == crate::constants::SOL_TOKEN_ACCOUNT