Pre-alphaWork in progress
Skip to content

eth_chainId ​

Returns the chain ID of the current network.

Ethereum specification · All supported methods

Parameters ​

No parameters. Send an empty params array.

Return value ​

The selected chain’s ID as a hexadecimal quantity.

Example ​

Replace <gateway-url> with your gateway base URL and <service-url> with the chain’s service path, such as service/ethereum.

sh
curl -X POST "<gateway-url>/<service-url>" \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

Illustrative response; values depend on the selected network and request:

json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x1"
}

Direct behavior ​

Returns the chain ID for the network selected by the service URL. Use this method to confirm that a request reaches a provider through your gateway.

Unstoppable Infrastructure.