net_version — BNB Smart Chain JSON-RPC

Status: Available

Return the decimal network identifier.

POSThttps://triport.io/rpc/bsc
Network
BNB Smart Chain
Scope
bsc:rpc
Auth
x-token: $TRIPORT_API_KEY
Rate limit
bsc_read_rpc - 15 / 20 / 100 / 250 RPS sustained · short burst 30 / 40 / 200 / 500 (free / basic / pro / business) (plan policy); enterprise unlimited; Burst capacity

Endpoint and plans: BNB Smart Chain RPC endpoint. Chain check: expected BNB Smart Chain value and how to check it.

net_version returns the BNB Smart Chain network identifier as an unprefixed decimal string.

Use it for compatibility with clients that still consume the net namespace. The example returns 56 for BNB Smart Chain mainnet.

Unlike eth_chainId, the value is not an EVM hex quantity. New chain-selection logic should generally prefer eth_chainId.

Parameters

JSON-RPC params must be an empty array: [].

Response

The response below is the checked fixture for this method; it is reproduced without changing its fields or values.

resultstring (decimal integer)
Network identifier as a decimal string.

Errors

Errors use the standard JSON-RPC error envelope. See BSC errors for network-specific classification and the linked shared reference.

CodeMeaningWhen it happens
-32602Invalid paramsA required positional parameter is missing or a value does not match the OpenRPC schema.
401UnauthorizedThe x-token API key is missing or invalid.
429Rate limitedThe request exceeds the configured category RPS for the caller's tier.

Examples

JavaScript (fetch)

const response = await fetch("https://triport.io/rpc/bsc", {
  method: "POST",
  headers: {
    "x-token": process.env.TRIPORT_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "jsonrpc": "2.0",
    "id": 1,
    "method": "net_version",
    "params": []
  }),
});


const payload = await response.json();
console.log(payload.result);

Notes

  • The BSC categories use configured defaults of 15 / 20 / 100 / 250 RPS; they are marked unmeasured in the tier matrix.
  • Related methods: eth_chainId, web3_clientVersion.