@cybertools/networks
v2.1.1
Published
Cyberscope network registry: chain metadata, explorers, address validators and network icons.
Readme
@cybertools/networks
Cyberscope network registry: chain metadata, explorers, address validators and network icons.
Exports
| Import | Provides |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| @cybertools/networks | networks, networkById, isNetworkId, getNetwork, isSlitherNetwork, isWeb3IntegratedNetwork, listedNetworks, web3IntegratedNetworks, cyberscanIntegratedNetworks; types NetworkId, ViemNetworkId, SlitherNetworkId, NetworkConfig, ImageAsset |
| @cybertools/networks/icons | networksWithIcons; type NetworkWithIcon (imports the PNG/SVG assets, so your bundler must handle them) |
| @cybertools/networks/viem | viemChains, getViemChain; type ViemNetworkId (imports viem/chains, so prefer it on the server) |
| @cybertools/networks/assets/<file> | The raw network images |
The registry entry point never imports images; only /icons does.
Every network has an icon, including XDC, X_LAYER, and ROBINHOOD.
Validators
- EVM networks use viem's
isAddressin format-only mode (strict: false): any casing is accepted, but the0xprefix is required (an uppercase0Xis normalized). Addresses without a prefix are rejected. - SOL uses
isAddressfrom@solana/addresses. - A validator returns an error string, or
undefinedwhen valid (falsefor ROSE, whose validator is a stub).
Usage
import { networks, getNetwork } from "@cybertools/networks";
import { networksWithIcons } from "@cybertools/networks/icons";
import ethIcon from "@cybertools/networks/assets/eth.png";
networks.ETH.validator("0xd41c4805a9a3128f9f7a7074da25965371ba50d5"); // undefined
getNetwork("BSC")?.chainId; // 56Deprecated networks
These IDs remain readable in the registry, icon map, and chain ID lookups as deprecated: true entries. Each is listed: false, absent from the integration sets, and has no viem chain or generated Hardhat network. Pickers should filter on deprecated to hide them.
| Network ID | Chain ID |
| ------------------- | -------: |
| GOERLI | 5 |
| ROPSTEN | 3 |
| RINKEBY | 4 |
| POLYGON_MUMBAI | 80001 |
| OPTIMISTIC_GOERLI | 420 |
| ARBITRUM_GOERLI | 421613 |
| ZKSYNC_TESTNET | 280 |
Never remap a deprecated network ID to a mainnet or another chain.
