mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-01-28 00:28:20 -05:00
feat: add L2EthApiExt trait (#13539)
This commit is contained in:
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
18
crates/rpc/rpc-eth-api/src/ext.rs
Normal file
18
crates/rpc/rpc-eth-api/src/ext.rs
Normal 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>;
|
||||
}
|
||||
@@ -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 _;
|
||||
|
||||
Reference in New Issue
Block a user