From a7c94838df875d273de6d13478940c984990cb7d Mon Sep 17 00:00:00 2001 From: William Date: Sun, 16 Feb 2025 14:21:42 +0800 Subject: [PATCH] add send_transactions --- src/jito/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/jito/mod.rs b/src/jito/mod.rs index 7151c10..2ef8d93 100755 --- a/src/jito/mod.rs +++ b/src/jito/mod.rs @@ -92,4 +92,14 @@ impl JitoClient { let bundles = vec![VersionedTransaction::from(transaction.clone())]; Ok(self.client.send_bundle(&bundles).await?) } + + pub async fn send_transactions( + &self, + transactions: &Vec, + ) -> Result { + let bundles: Vec = transactions.iter() + .map(|t| VersionedTransaction::from(t.clone())) + .collect(); // 显式指定类型 + Ok(self.client.send_bundle(&bundles).await?) + } }