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_URLto point to another source.CHAINS_JSON_PATHto 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§
- Chain
IdNot Supported - Error indicating that a particular chain ID is not supported.
- Chain
Info - Chain metadata derived from chainid.network
- Chain
Iter - 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.