reth_rpc_eth_types/tx_forward.rs
1//! Consist of types adjacent to the fee history cache and its configs
2
3use alloy_rpc_client::RpcClient;
4use reqwest::Url;
5use serde::{Deserialize, Serialize};
6use std::fmt::Debug;
7
8/// Configuration for the transaction forwarder.
9#[derive(Debug, PartialEq, Eq, Clone, Default, Serialize, Deserialize)]
10pub struct ForwardConfig {
11 /// The raw transaction forwarder.
12 ///
13 /// Default is `None`
14 pub tx_forwarder: Option<Url>,
15}
16
17impl ForwardConfig {
18 /// Builds an [`RpcClient`] from the forwarder URL, if configured.
19 pub fn forwarder_client(&self) -> Option<RpcClient> {
20 self.tx_forwarder.clone().map(RpcClient::new_http)
21 }
22}