reth_rpc_api/
mev.rs

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