1
0
mirror of https://github.com/payden/libwsclient synced 2025-06-13 12:53:52 +00:00
payden_libwsclient/bot/flashbot_client.rs

20 lines
510 B
Rust
Raw Normal View History

2025-05-16 06:09:24 +00:00
use crate::utils::solana::send_transaction;
use solana_client::rpc_client::RpcClient;
use solana_sdk::transaction::Transaction;
pub struct FlashbotsClient {
rpc_client: RpcClient,
}
impl FlashbotsClient {
pub fn new(rpc_client: RpcClient) -> Self {
Self { rpc_client }
}
pub async fn send_bundle(&self, txs: &[Transaction]) -> Result<(), Box<dyn std::error::Error>> {
for tx in txs {
send_transaction(&self.rpc_client, tx).await?;
}
Ok(())
}
}