POST
/
evm
net_version
curl --request POST \
  --url https://hyperliquid-mainnet.core.chainstack.com/4f8d8f4040bdacd1577bff8058438274/evm \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "method": "net_version",
  "params": [],
  "id": 1
}'
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "998"
}
Returns the current network ID for the Hyperliquid EVM. Use this to identify which network the client is connected to.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

This method takes no parameters.

Returns

Returns the network ID as a string. For Hyperliquid mainnet, this is "998".

JavaScript example

const getNetworkVersion = async () => {
  const response = await fetch('https://hyperliquid-mainnet.core.chainstack.com/YOUR_API_KEY/evm', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      method: 'net_version',
      params: [],
      id: 1
    })
  });
  
  const data = await response.json();
  return data.result;
};

// Usage
const networkId = await getNetworkVersion();
console.log('Network ID:', networkId); // "998"

// Verify correct network
const isHyperliquid = networkId === '998';
console.log('Connected to Hyperliquid:', isHyperliquid);

Network verification

const verifyNetwork = async () => {
  const networkId = await getNetworkVersion();
  
  if (networkId !== '998') {
    throw new Error(`Wrong network. Expected Hyperliquid (998), got ${networkId}`);
  }
  
  console.log('Connected to Hyperliquid mainnet');
  return true;
};

// Use before important operations
await verifyNetwork();
// Proceed with transactions...

Use cases

  • Network verification — Confirm connection to Hyperliquid before transactions
  • Wallet configuration — Configure wallets to recognize Hyperliquid network
  • dApp development — Build network-aware decentralized applications
  • Multi-network support — Support multiple EVM networks with proper identification

Body

application/json

Response

200 - application/json

Successful response with network ID

The response is of type object.