For the complete documentation index, see llms.txt. This page is also available as Markdown.

net_version - HyperEVM

Example code for the net_version JSON RPC method. Сomplete guide on how to use net_version GetBlock JSON RPC in GetBlock Web3 documentation.

This method returns the current network ID.

Parameters

  • None

Request

cURL
curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "net_version",
    "params": [],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'net_version',
    params: [],
    id: 'getblock.io'
});

console.log('Network ID:', response.data.result);
example.py
import requests

response = requests.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', json={
    'jsonrpc': '2.0',
    'method': 'net_version',
    'params': [],
    'id': 'getblock.io'
})

print(f'Network ID: {response.json()["result"]}')

Response

response.json
{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "999"
}

Response Parameters

Field
Type
Description

result

string

Network ID as decimal string.

Network IDs

Network
Network ID

HyperEVM Mainnet

999

HyperEVM Testnet

998

Use Case

The net_version method is essential for:

  • Network identification

  • Legacy compatibility (pre-EIP-155)

  • Wallet connection verification

  • Multi-network support

Error Handling

Error Code
Message
Cause

-32603

Internal error

Node issue.

Web3 Integration

Last updated

Was this helpful?