feat: add L2EthApiExt trait (#13539)

This commit is contained in:
Matthias Seitz
2024-12-24 14:58:52 +01:00
committed by GitHub
parent 9773b85568
commit a4410c83e8
3 changed files with 24 additions and 1 deletions

View File

@@ -53,7 +53,7 @@ pub mod servers {
};
pub use reth_rpc_eth_api::{
self as eth, EthApiServer, EthBundleApiServer, EthCallBundleApiServer, EthFilterApiServer,
EthPubSubApiServer,
EthPubSubApiServer, L2EthApiExtServer,
};
}
@@ -84,5 +84,6 @@ pub mod clients {
};
pub use reth_rpc_eth_api::{
EthApiClient, EthBundleApiClient, EthCallBundleApiClient, EthFilterApiClient,
L2EthApiExtServer,
};
}

View File

@@ -0,0 +1,18 @@
//! `eth_` Extension traits.
use alloy_primitives::{Bytes, B256};
use alloy_rpc_types_eth::erc4337::ConditionalOptions;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
/// Extension trait for `eth_` namespace for L2s.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))]
pub trait L2EthApiExt {
/// Sends signed transaction with the given condition.
#[method(name = "sendRawTransactionConditional")]
async fn send_raw_transaction_conditional(
&self,
bytes: Bytes,
condition: ConditionalOptions,
) -> RpcResult<B256>;
}

View File

@@ -14,6 +14,7 @@
pub mod bundle;
pub mod core;
pub mod ext;
pub mod filter;
pub mod helpers;
pub mod node;
@@ -22,6 +23,7 @@ pub mod types;
pub use bundle::{EthBundleApiServer, EthCallBundleApiServer};
pub use core::{EthApiServer, FullEthApiServer};
pub use ext::L2EthApiExtServer;
pub use filter::EthFilterApiServer;
pub use node::{RpcNodeCore, RpcNodeCoreExt};
pub use pubsub::EthPubSubApiServer;
@@ -36,6 +38,8 @@ pub use bundle::{EthBundleApiClient, EthCallBundleApiClient};
#[cfg(feature = "client")]
pub use core::EthApiClient;
#[cfg(feature = "client")]
pub use ext::L2EthApiExtClient;
#[cfg(feature = "client")]
pub use filter::EthFilterApiClient;
use reth_trie_common as _;