Skip to main content

ChainId

Enum of the default chain IDs.

Usage

Use the ChainId enum to get the chainId of a supported chain.

import { ChainId } from "@thirdweb-dev/sdk";

const chainId = ChainId.Mainnet;

Return Value

Returns a ChainId (number) corresponding to the given chain name.

The available values are:

  • Mainnet (1)
  • Goerli (5)
  • Polygon (137)
  • Mumbai (80001)
  • Localhost (1337)
  • Hardhat (31337)
  • Fantom (250)
  • FantomTestnet (4002)
  • Avalanche (43114)
  • AvalancheFujiTestnet (43113)
  • Optimism (10)
  • OptimismGoerli (420)
  • Arbitrum (42161)
  • ArbitrumGoerli (421613)
  • BinanceSmartChainMainnet (56)
  • BinanceSmartChainTestnet (97)