1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//! # chainlist
//!
//! `no_std` bindings to access [Chainlist.org](https://chainlist.org/) RPC config data, programmatically.
//!
//! This library provides a simple interface to access the RPC configurations available on [Chainlist.org](https://chainlist.org/).
//!
//! ## Getting Started
//!
//! Add `chainlist` using [cargo add][add].
//!
//! ```ignore
//! cargo add chainlist --features=std,online
//! ```
//!
//! [add]: https://doc.rust-lang.org/cargo/commands/cargo-add.html
//!
//! ## Usage
//!
//! ```rust
//! use chainlist::{CHAINS, Chain, rpc};
//!
//! // Get the RPC configuration for Ethereum Mainnet.
//! let mainnet: &Chain = CHAINS.iter().find(|chain| chain.chain_id == Some(1)).unwrap();
//! assert_eq!(mainnet.name, "Ethereum Mainnet");
//!
//! // Use the `rpc!` macro to get the RPC config for Ethereum Mainnet.
//! let mainnet_rpc = rpc!(1);
//!
//! // Get the `Chain` RPC configuration from an alloy "NamedChain".
//! // Note, this will panic if an RPC configuration doesn't exist
//! // in the chain list for the given chain id.
//! let mainnet: Chain = alloy_chains::NamedChain::Mainnet.into();
//! assert_eq!(mainnet.chain_id, Some(alloy_chains::NamedChain::Mainnet as u64));
//! ```
//!
//! ## Features
//!
//! - `std`: Enables the use of the standard library.
//! - `online`: Provides a way to fetch the latest RPC configurations from Chainlist.org.
extern crate alloc;
pub use ;
pub use ChainList;
lazy_static!