L0vdL0vd

net_version

Returns the network ID as a decimal string.

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

Example response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "1"
}
Params and your endpoint

Parameters

This method takes no parameters.

Returns

string Network ID, e.g. "1" for Ethereum mainnet.

When to use it

Get the network ID as a decimal string.

How to read the result

"1" on Ethereum mainnet. On most chains it equals the chain ID in decimal.

Tips

  • Prefer eth_chainId for signing; it is the value EIP-155 uses.

Related methods