const SUPPORTED_NETWORKS = { 1: "mainnet", 11155111: "sepolia", 31337: "hardhat", 31611: "mezo-testnet", 31612: "mezo-mainnet", } export type EthereumChainId = keyof typeof SUPPORTED_NETWORKS export type EthereumNetwork = (typeof SUPPORTED_NETWORKS)[EthereumChainId] export function toNetwork(chainId: number): EthereumNetwork | undefined { if (!Object.hasOwn(SUPPORTED_NETWORKS, chainId)) return undefined return SUPPORTED_NETWORKS[chainId as EthereumChainId] }