pub static KNOWN_NETWORKS: &[NetworkInfo]Expand description
A static array of well-known blockchain networks.
This array contains a registry of well-known blockchain networks for improved developer experience and x402 protocol v1 compatibility, organized by ecosystem (EVM networks first, then Solana networks). Each entry includes the network’s human-readable name, CAIP-2 namespace, and chain reference.
§x402 v1 Protocol Relevance
This registry represents the set of blockchain networks that were known and supported in x402 v1. For x402 v2 and beyond, the protocol is designed to work with any CAIP-2 chain ID without requiring a predefined registry.
The array is used to populate the lazy-initialized lookup hashmaps:
NAME_TO_CHAIN_IDfor name-based lookupsCHAIN_ID_TO_NAMEfor ChainId-based lookups
§Developer Experience Benefits
Despite being v1-focused, this registry continues to provide value by:
- Enabling convenient network name lookups via
ChainId::from_network_name() - Providing human-readable network names via
ChainId::as_network_name() - Serving as a reference for commonly used blockchain networks