style: run rustfmt
This commit is contained in:
+9
-27
@@ -20,7 +20,9 @@ use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
|
||||
use crate::common::SolanaRpcClient;
|
||||
use crate::constants::swqos::{HELIUS_TIP_ACCOUNTS, SWQOS_MIN_TIP_HELIUS, SWQOS_MIN_TIP_HELIUS_SWQOS_ONLY};
|
||||
use crate::constants::swqos::{
|
||||
HELIUS_TIP_ACCOUNTS, SWQOS_MIN_TIP_HELIUS, SWQOS_MIN_TIP_HELIUS_SWQOS_ONLY,
|
||||
};
|
||||
use crate::swqos::{SwqosClientTrait, SwqosType, TradeType};
|
||||
|
||||
#[derive(Clone)]
|
||||
@@ -43,12 +45,7 @@ impl HeliusClient {
|
||||
let rpc_client = SolanaRpcClient::new(rpc_url);
|
||||
let http_client = default_http_client_builder().build().unwrap();
|
||||
let submit_url = Self::build_submit_url(&endpoint, api_key.as_deref(), swqos_only);
|
||||
Self {
|
||||
submit_url,
|
||||
rpc_client: Arc::new(rpc_client),
|
||||
http_client,
|
||||
swqos_only,
|
||||
}
|
||||
Self { submit_url, rpc_client: Arc::new(rpc_client), http_client, swqos_only }
|
||||
}
|
||||
|
||||
/// Build URL once at construction; no per-request allocation.
|
||||
@@ -132,17 +129,10 @@ impl HeliusClient {
|
||||
return Err(anyhow::anyhow!("Helius Sender error: {}", err_msg));
|
||||
}
|
||||
if response_json.get("result").is_some() && crate::common::sdk_log::sdk_log_enabled() {
|
||||
println!(
|
||||
" [helius] {} submitted: {:?}",
|
||||
trade_type,
|
||||
start_time.elapsed()
|
||||
);
|
||||
println!(" [helius] {} submitted: {:?}", trade_type, start_time.elapsed());
|
||||
}
|
||||
} else if crate::common::sdk_log::sdk_log_enabled() {
|
||||
eprintln!(
|
||||
" [helius] {} submission failed: {:?}",
|
||||
trade_type, response_text
|
||||
);
|
||||
eprintln!(" [helius] {} submission failed: {:?}", trade_type, response_text);
|
||||
}
|
||||
|
||||
match poll_transaction_confirmation(&self.rpc_client, signature, wait_confirmation).await {
|
||||
@@ -159,15 +149,8 @@ impl HeliusClient {
|
||||
}
|
||||
}
|
||||
if wait_confirmation && crate::common::sdk_log::sdk_log_enabled() {
|
||||
println!(
|
||||
" signature: {:?}",
|
||||
signature
|
||||
);
|
||||
println!(
|
||||
" [helius] {} confirmed: {:?}",
|
||||
trade_type,
|
||||
start_time.elapsed()
|
||||
);
|
||||
println!(" signature: {:?}", signature);
|
||||
println!(" [helius] {} confirmed: {:?}", trade_type, start_time.elapsed());
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
@@ -191,8 +174,7 @@ impl SwqosClientTrait for HeliusClient {
|
||||
wait_confirmation: bool,
|
||||
) -> Result<()> {
|
||||
for transaction in transactions {
|
||||
self.send_transaction(trade_type, transaction, wait_confirmation)
|
||||
.await?;
|
||||
self.send_transaction(trade_type, transaction, wait_confirmation).await?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user