Files
reth/crates/net/rpc-api/src/web3.rs
Matthias Seitz 8eb2ea4152 feat(rpc): add rpc-api client feature (#33)
* feat(rpc): add rpc-api client feature

* refactor: combine proc macro

* feat: add missing deserialize functions

* add missing derive
2022-10-11 11:56:12 +02:00

16 lines
504 B
Rust

use jsonrpsee::{core::RpcResult as Result, proc_macros::rpc};
use reth_primitives::{Bytes, H256};
/// Web3 rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server))]
#[cfg_attr(feature = "client", rpc(server, client))]
pub trait Web3Api {
/// Returns current client version.
#[method(name = "web3_clientVersion")]
fn client_version(&self) -> Result<String>;
/// Returns sha3 of the given data.
#[method(name = "web3_sha3")]
fn sha3(&self, input: Bytes) -> Result<H256>;
}