Skip to main content

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