跳到主要内容

eth_chainId

hex format integer of the current chain id. Defaults are ETC=61, ETH=1, Morden=62.

Params

(0)

Result

(chainId)
string or null
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$

Example

Request

curl -X POST --data \
'{
"method": "eth_chainId",
"params": [],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
localhost:12539

Result

"0x47"

Endpoint

Request

curl -X POST --data \
'{
"method": "eth_chainId",
"params": [],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://evmtestnet.confluxrpc.com