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":[]}'

Пример ответа

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "1"
}
Параметры и свой эндпоинт

Параметры

У метода нет параметров.

Возвращает

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

Когда использовать

Get the network ID as a decimal string.

Как читать ответ

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

Советы

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

Связанные методы