eth_chainId

Provides the current network or chain ID, essential for signing replay-protected transactions as defined in EIP-155

Request
Examples
curl --request POST \
    --url https://rpc.xone.org \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --data '
{
 "id": 1,
 "jsonrpc": "2.0",
 "method": "eth_chainId"
}
'
Response
200 OK
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}

Request params

NameTypeDescription
idintegerRequest identifier
jsonrpcstringJSON-RPC version
methodstringAPI method name
ParametersThis method does not accept any parameters. 

Response

200
Returns the current chain ID as an integer.
NameTypeDescription
Parametersobject 
idinteger
jsonrpcstring
resultstringHexadecimal string that represents the current chain or network ID.