{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": []
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x1"
}

Defined in EIP-695

Returns the currently configured chain ID, a value used in replay-protected transaction signing as introduced by EIP-155.

Parameters

This method does not accept any parameters.

Returns

result
string

A hexadecimal string representing the chain ID.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_chainId",
  "params": []
}
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x1"
}

Error Handling

CodeMessageDescription
4100Requested method not supportedThe method is not supported by the wallet

Common chain IDs: Ethereum Mainnet (0x1), Base Mainnet (0x2105), Base Sepolia (0x14a34).