eth_chainId
Returns the chain ID of the current network, per EIP-695.
Parameters
Section titled “Parameters”None.
Returns
Section titled “Returns”| Field | Type | Description |
|---|---|---|
result | string | The chain ID as a hexadecimal string. "0x2105" (8453) for Base Mainnet and "0x14a34" (84532) for Base Sepolia. |
Example
Section titled “Example”Request
Section titled “Request”{ "jsonrpc": "2.0", "method": "eth_chainId", "params": [], "id": 1}Response
Section titled “Response”Base Mainnet:
{ "jsonrpc": "2.0", "id": 1, "result": "0x2105"}Base Sepolia:
{ "jsonrpc": "2.0", "id": 1, "result": "0x14a34"}