Skip to content

Commit

Permalink
feat: add L2EthApiExt trait
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Dec 24, 2024
1 parent 0da7e9e commit 35917d8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions crates/rpc/rpc-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub mod servers {
};
pub use reth_rpc_eth_api::{
self as eth, EthApiServer, EthBundleApiServer, EthCallBundleApiServer, EthFilterApiServer,
EthPubSubApiServer, L2EthApiExtServer
EthPubSubApiServer, L2EthApiExtServer,
};
}

Expand Down Expand Up @@ -83,6 +83,7 @@ pub mod clients {
web3::Web3ApiClient,
};
pub use reth_rpc_eth_api::{
EthApiClient, EthBundleApiClient, EthCallBundleApiClient, EthFilterApiClient, L2EthApiExtServer
EthApiClient, EthBundleApiClient, EthCallBundleApiClient, EthFilterApiClient,
L2EthApiExtServer,
};
}
7 changes: 5 additions & 2 deletions crates/rpc/rpc-eth-api/src/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ use jsonrpsee::{core::RpcResult, proc_macros::rpc};
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "eth"))]
#[cfg_attr(feature = "client", rpc(server, client, namespace = "eth"))]
pub trait L2EthApiExt<T: RpcObject> {

/// Sends signed transaction with the given condition.
#[method(name = "sendRawTransactionConditional")]
async fn send_raw_transaction(&self, bytes: Bytes, condtion: ConditionalOptions) -> RpcResult<B256>;
async fn send_raw_transaction_conditional(
&self,
bytes: Bytes,
condition: ConditionalOptions,
) -> RpcResult<B256>;
}
8 changes: 4 additions & 4 deletions crates/rpc/rpc-eth-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@

pub mod bundle;
pub mod core;
pub mod ext;
pub mod filter;
pub mod helpers;
pub mod node;
pub mod pubsub;
pub mod types;
pub mod ext;

pub use bundle::{EthBundleApiServer, EthCallBundleApiServer};
pub use core::{EthApiServer, FullEthApiServer};
pub use filter::EthFilterApiServer;
pub use ext::L2EthApiExtServer;
pub use filter::EthFilterApiServer;
pub use node::{RpcNodeCore, RpcNodeCoreExt};
pub use pubsub::EthPubSubApiServer;
pub use reth_rpc_eth_types::error::{
Expand All @@ -38,8 +38,8 @@ pub use bundle::{EthBundleApiClient, EthCallBundleApiClient};
#[cfg(feature = "client")]
pub use core::EthApiClient;
#[cfg(feature = "client")]
pub use filter::EthFilterApiClient;
#[cfg(feature = "client")]
pub use ext::L2EthApiExtClient;
#[cfg(feature = "client")]
pub use filter::EthFilterApiClient;

use reth_trie_common as _;

0 comments on commit 35917d8

Please sign in to comment.