File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ version = "0.2.3"
88edition = " 2024"
99license = " MIT OR Apache-2.0"
1010repository = " https://github.com/qntx/erc8004"
11+ description = " ERC-8004 Trustless Agents Rust SDK."
1112
1213[workspace .dependencies ]
1314erc8004 = { path = " erc8004" }
Original file line number Diff line number Diff line change @@ -122,6 +122,36 @@ impl Network {
122122 }
123123 }
124124
125+ /// All known ERC-8004 network variants.
126+ pub const ALL : & [ Self ] = & [
127+ Self :: EthereumMainnet ,
128+ Self :: EthereumSepolia ,
129+ Self :: BaseMainnet ,
130+ Self :: BaseSepolia ,
131+ Self :: PolygonMainnet ,
132+ Self :: PolygonAmoy ,
133+ Self :: ArbitrumMainnet ,
134+ Self :: ArbitrumSepolia ,
135+ Self :: CeloMainnet ,
136+ Self :: CeloAlfajores ,
137+ Self :: GnosisMainnet ,
138+ Self :: ScrollMainnet ,
139+ Self :: ScrollSepolia ,
140+ Self :: TaikoMainnet ,
141+ Self :: MonadMainnet ,
142+ Self :: MonadTestnet ,
143+ Self :: BscMainnet ,
144+ Self :: BscTestnet ,
145+ ] ;
146+
147+ /// Look up a [`Network`] by its EIP-155 chain ID.
148+ ///
149+ /// Returns [`None`] if the chain ID is not a known ERC-8004 deployment.
150+ #[ must_use]
151+ pub fn from_chain_id ( chain_id : u64 ) -> Option < Self > {
152+ Self :: ALL . iter ( ) . find ( |n| n. chain_id ( ) == chain_id) . copied ( )
153+ }
154+
125155 /// Returns the `eip155:{chainId}` namespace prefix for agent registry identifiers.
126156 #[ must_use]
127157 pub fn agent_registry_prefix ( self ) -> String {
You can’t perform that action at this time.
0 commit comments