etherscan-api
    Preparing search index...

    Function resolveChainId

    • Resolve a chain name or numeric chainid to a numeric chainid.

      • null / undefined / '' defaults to Ethereum mainnet (1).
      • A number, or an all-digit string, is passed through unchanged.
      • A known name is mapped to its chainid.
      • A retired or unknown name throws — silently switching networks on a blockchain client is dangerous (wrong-chain reads look successful).

      Parameters

      • Optionalchain: string | number | null

      Returns number

      If the chain is retired or unknown.