diff --git a/crates/rpc/rpc-eth-api/src/ext.rs b/crates/rpc/rpc-eth-api/src/ext.rs index 4589982912fa..2ceeb02a0d12 100644 --- a/crates/rpc/rpc-eth-api/src/ext.rs +++ b/crates/rpc/rpc-eth-api/src/ext.rs @@ -3,6 +3,9 @@ use alloy_primitives::{Bytes, B256}; use alloy_rpc_types_eth::erc4337::ConditionalOptions; use jsonrpsee::{core::RpcResult, proc_macros::rpc}; +use tracing::trace; + +use crate::helpers::{EthTransactions, FullEthApi}; /// Extension trait for `eth_` namespace for L2s. #[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))] @@ -16,3 +19,20 @@ pub trait L2EthApiExt { condition: ConditionalOptions, ) -> RpcResult; } + +#[async_trait::async_trait] +impl L2EthApiExtServer for T +where + T: FullEthApi, + jsonrpsee_types::error::ErrorObject<'static>: From, +{ + /// Handler for: `eth_sendRawTransactionConditional` + async fn send_raw_transaction_conditional( + &self, + bytes: Bytes, + _condition: ConditionalOptions, + ) -> RpcResult { + trace!(target: "rpc::eth", ?bytes, "Serving eth_sendRawTransactionConditional"); + Ok(EthTransactions::send_raw_transaction(self, bytes).await?) + } +}