Skip to main content

eth_chainId

Ethereum API

Returns the chain ID of the current network.

Params

(0)

Result

(Chain ID)
string
Match pattern:
^0x([1-9a-f]+[0-9a-f]*|0)$

Request

await window.ethereum.request({
"method": "eth_chainId",
"params": []
});