bretep / ethereum-jsonrpc

Definitions for standard Ethereum JSONRPC APIs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ethereum-jsonrpc

This crate contains definitions for various Ethereum JSONRPC APIs using jsonrpsee framework.

Client usage example

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}");
}

License

The entire code within this repository is licensed under the GNU General Public License v3 with Classpath exception

About

Definitions for standard Ethereum JSONRPC APIs

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%