Skip to main content
Immutable LogoImmutable Logo
DocsGuides
SDKs
  • Overview
  • TypeScript
  • Unity
  • Unreal
API
  • Overview
  • Keys
  • Changelog
  • Reference
Tools
  • Overview
  • Immutable zkEVM Faucet
  • Network Status
Blog
v2
  • v2
  • v1
Immutable Hub
Docs
  • Flagship Products
    • Passport
      • FAQ
      • Setup
      • Identity
      • Wallet
        • Connecting wallet
        • Sending transactions
        • Signing messages
        • Pre-approved transactions
        • Key management
        • Link external wallets
        • JSON-RPC API
          • eth_requestAccounts
          • eth_sendTransaction
          • eth_accounts
          • eth_gasPrice
          • eth_getBalance
          • eth_getStorageAt
          • eth_estimateGas
          • eth_call
          • eth_blockNumber
          • eth_chainId
          • eth_getBlockByHash
          • eth_getBlockByNumber
          • eth_getTransactionByHash
          • eth_getTransactionReceipt
          • eth_getTransactionCount
          • eth_getCode
          • eth_signTypedData_v4
          • personal_sign
      • Telegram Integration
    • Immutable zkEVM
  • About Our Chain
  • How to Add Web3 to Your Game
  • Advanced Products
    • Immutable Hub
    • Checkout
    • Minting
    • Orderbook
    • Blockchain Data APIs
    • Contracts
  • Cheat Sheet
  • Flagship Products
  • Passport
  • Wallet
  • JSON-RPC API
  • eth_chainId
Version: v2

eth_chainId

Returns the current chain id.

Params​

This method does not accept any parameters.

Result​

Returns a Promise that resolves with a string that represents the current chain id.

Example​

const chainId = await provider.request({ method: 'eth_chainId' });
console.log(chainId); // ['0xaa36a7']
Previous
eth_blockNumber
Next
eth_getBlockByHash

IMX Whitepaper • IMX Tokenomics • Block Explorer • Careers • Contact Us