reth_rpc_api/
web3.rs

1use alloy_primitives::{Bytes, B256};
2use jsonrpsee::{core::RpcResult, proc_macros::rpc};
3
4/// Web3 rpc interface.
5#[cfg_attr(not(feature = "client"), rpc(server, namespace = "web3"))]
6#[cfg_attr(feature = "client", rpc(server, client, namespace = "web3"))]
7pub trait Web3Api {
8    /// Returns current client version.
9    #[method(name = "clientVersion")]
10    async fn client_version(&self) -> RpcResult<String>;
11
12    /// Returns sha3 of the given data.
13    #[method(name = "sha3")]
14    fn sha3(&self, input: Bytes) -> RpcResult<B256>;
15}