This crate contains definitions for various Ethereum JSONRPC APIs using jsonrpsee framework.
Enable client
feature of ethereum-jsonrpc
crate.
use ethereum_jsonrpc::EthApiClient;
use jsonrpsee::http_client::HttpClientBuilder;
#[tokio::main]
async fn main() {
let client = HttpClientBuilder::default().build("http://localhost:8545").unwrap();
let block_number = client.block_number().await.unwrap();
println!("Current block number is {block_number}");
}