cfx_rpc_eth_api/web3.rs
1use cfx_rpc_primitives::Bytes;
2use cfx_types::H256;
3use jsonrpsee::{core::RpcResult, proc_macros::rpc};
4
5/// Web3 rpc interface.
6#[rpc(server, 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<H256>;
15}