This crate provides asynchronous Ethereum JSON-RPC compliant clients.
For more documentation on the available calls, refer to the
Provider
struct.
```norun use ethersproviders::{Provider, Http, Middleware}; use std::convert::TryFrom;
let provider = Provider::
let block = provider.getblock(100u64).await?; println!("Got block: {}", serdejson::to_string(&block)?);
let code = provider.getcode("0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359", None).await?; println!("Got code: {}", serdejson::to_string(&code)?);
```
The crate has support for WebSockets via Tokio.
```
let ws = Ws::connect("ws://localhost:8545").await?;
```
The provider may also be used to resolve
Ethereum Name Service (ENS) names to addresses (and vice
versa). The default ENS address is
mainnet
and can be overriden by calling the ens
method on the provider.
```no_run
// Resolve ENS name to Address let name = "vitalik.eth"; let address = provider.resolve_name(name).await?;
// Lookup ENS name given Address let resolvedname = provider.lookupaddress(address).await?; asserteq!(name, resolvedname);
```