Skip to main content
Bespoke

net_version

Summary: Get chainId

This request returns the chainId as a decimal where eth_chainId returns a hexadecimal.

Parameters

This method doesn't accept any parameters.

Returns

net_versionResponse
string

String representation of the chain ID.

Customize request
Parameter
Value

Request

curl https://linea-mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "net_version",
"params": [],
"id": 1
}'

Example response

{
"id": 1,
"jsonrpc": "2.0",
"result": "59144"
}