|
1 | 1 | use alloy::{ |
2 | 2 | network::Network, |
3 | 3 | providers::{ext::MevBuilder, Provider}, |
4 | | - rpc::{ |
5 | | - client::RpcClient, |
6 | | - types::mev::{EthBundleHash, MevSendBundle, SimBundleOverrides, SimBundleResponse}, |
7 | | - }, |
| 4 | + rpc::types::mev::{EthBundleHash, MevSendBundle, SimBundleOverrides, SimBundleResponse}, |
8 | 5 | signers::Signer, |
9 | 6 | transports::TransportResult, |
10 | 7 | }; |
11 | 8 | use async_trait::async_trait; |
12 | 9 |
|
13 | | -use crate::mev_share::{MevShareBundleBuilder, FLASHBOTS_RELAY_RPC_URL}; |
| 10 | +use crate::{ |
| 11 | + mev_share::{MevShareBundleBuilder, FLASHBOTS_RELAY_RPC_URL}, |
| 12 | + utils::build_rpc_client, |
| 13 | +}; |
14 | 14 |
|
15 | 15 | /// Extension trait for sending and simulate MEV-Share bundles. |
16 | 16 | #[async_trait] |
|
62 | 62 | where |
63 | 63 | S: Signer + Clone + Send + Sync + 'static, |
64 | 64 | { |
65 | | - let client = RpcClient::new_http(FLASHBOTS_RELAY_RPC_URL.parse().unwrap()); |
| 65 | + let client = build_rpc_client(FLASHBOTS_RELAY_RPC_URL.parse().unwrap()); |
66 | 66 | let request = client.request("mev_sendBundle", (bundle,)); |
67 | 67 |
|
68 | 68 | MevBuilder::new_rpc(request).with_auth(signer).await |
|
77 | 77 | where |
78 | 78 | S: Signer + Clone + Send + Sync + 'static, |
79 | 79 | { |
80 | | - let client = RpcClient::new_http(FLASHBOTS_RELAY_RPC_URL.parse().unwrap()); |
| 80 | + let client = build_rpc_client(FLASHBOTS_RELAY_RPC_URL.parse().unwrap()); |
81 | 81 | let request = client.request("mev_simBundle", (bundle, sim_overrides)); |
82 | 82 |
|
83 | 83 | MevBuilder::new_rpc(request).with_auth(signer).await |
|
0 commit comments