reth_rpc_api/
mev.rs

1use alloy_rpc_types_mev::{EthBundleHash, MevSendBundle, SimBundleOverrides, SimBundleResponse};
2use jsonrpsee::proc_macros::rpc;
3
4/// Mev rpc interface.
5#[cfg_attr(not(feature = "client"), rpc(server, namespace = "mev"))]
6#[cfg_attr(feature = "client", rpc(server, client, namespace = "mev"))]
7pub trait MevSimApi {
8    /// Similar to `mev_sendBundle` but instead of submitting a bundle to the relay, it returns
9    /// a simulation result. Only fully matched bundles can be simulated.
10    #[method(name = "simBundle")]
11    async fn sim_bundle(
12        &self,
13        bundle: MevSendBundle,
14        sim_overrides: SimBundleOverrides,
15    ) -> jsonrpsee::core::RpcResult<SimBundleResponse>;
16}
17
18/// Mev rpc interface.
19#[cfg_attr(not(feature = "client"), rpc(server, namespace = "mev"))]
20#[cfg_attr(feature = "client", rpc(server, client, namespace = "mev"))]
21pub trait MevFullApi {
22    /// Submitting bundles to the relay. It takes in a bundle and provides a bundle hash as a
23    /// return value.
24    #[method(name = "sendBundle")]
25    async fn send_bundle(
26        &self,
27        request: MevSendBundle,
28    ) -> jsonrpsee::core::RpcResult<EthBundleHash>;
29
30    /// Similar to `mev_sendBundle` but instead of submitting a bundle to the relay, it returns
31    /// a simulation result. Only fully matched bundles can be simulated.
32    #[method(name = "simBundle")]
33    async fn sim_bundle(
34        &self,
35        bundle: MevSendBundle,
36        sim_overrides: SimBundleOverrides,
37    ) -> jsonrpsee::core::RpcResult<SimBundleResponse>;
38}