mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat: add rpc-api trait for call bundle (#5449)
This commit is contained in:
@@ -1,15 +1,28 @@
|
||||
//! Additional `eth_` functions for bundles
|
||||
//!
|
||||
//! See also <https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint>
|
||||
use jsonrpsee::proc_macros::rpc;
|
||||
use reth_primitives::{Bytes, B256};
|
||||
use reth_rpc_types::{
|
||||
CancelBundleRequest, CancelPrivateTransactionRequest, EthBundleHash, EthCallBundleResponse,
|
||||
EthCallBundleTransactionResult, EthSendBundle, PrivateTransactionRequest,
|
||||
CancelBundleRequest, CancelPrivateTransactionRequest, EthBundleHash, EthCallBundle,
|
||||
EthCallBundleResponse, EthSendBundle, PrivateTransactionRequest,
|
||||
};
|
||||
|
||||
/// Eth bundle rpc interface.
|
||||
///
|
||||
/// See also <https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint>
|
||||
/// A subset of the [EthBundleApi] API interface that only supports `eth_callBundle`.
|
||||
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
|
||||
#[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))]
|
||||
#[async_trait::async_trait]
|
||||
pub trait EthCallBundleApi {
|
||||
/// `eth_callBundle` can be used to simulate a bundle against a specific block number,
|
||||
/// including simulating a bundle at the top of the next block.
|
||||
#[method(name = "callBundle")]
|
||||
async fn call_bundle(
|
||||
&self,
|
||||
request: EthCallBundle,
|
||||
) -> jsonrpsee::core::RpcResult<EthCallBundleResponse>;
|
||||
}
|
||||
|
||||
/// Eth bundle rpc interface.
|
||||
/// The __full__ Eth bundle rpc interface.
|
||||
///
|
||||
/// See also <https://docs.flashbots.net/flashbots-auction/searchers/advanced/rpc-endpoint>
|
||||
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
|
||||
@@ -26,8 +39,8 @@ pub trait EthBundleApi {
|
||||
#[method(name = "callBundle")]
|
||||
async fn call_bundle(
|
||||
&self,
|
||||
request: EthCallBundleResponse,
|
||||
) -> jsonrpsee::core::RpcResult<EthCallBundleTransactionResult>;
|
||||
request: EthCallBundle,
|
||||
) -> jsonrpsee::core::RpcResult<EthCallBundleResponse>;
|
||||
|
||||
/// `eth_cancelBundle` is used to prevent a submitted bundle from being included on-chain. See [bundle cancellations](https://docs.flashbots.net/flashbots-auction/searchers/advanced/bundle-cancellations) for more information.
|
||||
#[method(name = "cancelBundle")]
|
||||
|
||||
Reference in New Issue
Block a user