Crate chainlist_rs

Crate chainlist_rs 

Source
Expand description

Chain metadata and helpers

Access chain IDs, names, native currency, RPC URLs and convenience helpers.

§Build-time data

By default the build script downloads chains.json from https://chainid.network/chains.json. This requires network access during compilation. Override with:

  • CHAINS_JSON_URL to point to another source.
  • CHAINS_JSON_PATH to supply a local file and skip the download.

§Examples

use chainlist_rs::Chain;

let mainnet = Chain::Mainnet;
assert_eq!(mainnet.id(), 1);
println!("{} -> native {}", mainnet.name(), mainnet.native_currency().1);

Modules§

eip
EIP-compatible structures and conversions.
schema
Serde bindings for the chainid.network / ethereum-lists chains schema.

Structs§

ChainIdNotSupported
Error indicating that a particular chain ID is not supported.
ChainInfo
Chain metadata derived from chainid.network
ChainIter
An iterator over the variants of Chain

Enums§

Chain
The Chain enum represents various blockchain networks.

Functions§

all_chains
Full chain list deserialized from the bundled chains.json.