update jito and nextblock

This commit is contained in:
wood
2025-07-07 01:01:38 +08:00
parent badc8e77d8
commit 38a8e2dae4
9 changed files with 204 additions and 182 deletions
+7 -9
View File
@@ -28,11 +28,11 @@ pub struct TemporalClient {
#[async_trait::async_trait]
impl SwqosClientTrait for TemporalClient {
async fn send_transaction(&self, trade_type: TradeType, transaction: &VersionedTransaction) -> Result<Signature> {
async fn send_transaction(&self, trade_type: TradeType, transaction: &VersionedTransaction) -> Result<()> {
self.send_transaction(trade_type, transaction).await
}
async fn send_transactions(&self, trade_type: TradeType, transactions: &Vec<VersionedTransaction>) -> Result<Vec<Signature>> {
async fn send_transactions(&self, trade_type: TradeType, transactions: &Vec<VersionedTransaction>) -> Result<()> {
self.send_transactions(trade_type, transactions).await
}
@@ -61,7 +61,7 @@ impl TemporalClient {
Self { rpc_client: Arc::new(rpc_client), endpoint, auth_token, http_client }
}
pub async fn send_transaction(&self, trade_type: TradeType, transaction: &VersionedTransaction) -> Result<Signature> {
pub async fn send_transaction(&self, trade_type: TradeType, transaction: &VersionedTransaction) -> Result<()> {
let start_time = Instant::now();
let (content, signature) = serialize_transaction_and_encode(transaction, UiTransactionEncoding::Base64).await?;
println!(" 交易编码base64: {:?}", start_time.elapsed());
@@ -106,15 +106,13 @@ impl TemporalClient {
println!(" nozomi{}确认: {:?}", trade_type, start_time.elapsed());
Ok(signature)
Ok(())
}
pub async fn send_transactions(&self, trade_type: TradeType, transactions: &Vec<VersionedTransaction>) -> Result<Vec<Signature>> {
let mut signatures = Vec::new();
pub async fn send_transactions(&self, trade_type: TradeType, transactions: &Vec<VersionedTransaction>) -> Result<()> {
for transaction in transactions {
let signature = self.send_transaction(trade_type, transaction).await?;
signatures.push(signature);
self.send_transaction(trade_type, transaction).await?;
}
Ok(signatures)
Ok(())
}
}