net_version
BNB Smart Chain / https://triport.io/rpc/bsc
Minimum tier: Free
Last updated:
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
This method takes no parameters.
Returns
| Field | Type |
|---|---|
| networkId | DecimalString |
Examples
curl https://triport.io/rpc/bsc \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"jsonrpc":"2.0","id":1,"method":"net_version","params":[]}'const res = await fetch("https://triport.io/rpc/bsc", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"jsonrpc": "2.0",
"id": 1,
"method": "net_version",
"params": []
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/rpc/bsc",
headers={"Authorization": "Bearer <api-key>"},
json={"jsonrpc":"2.0","id":1,"method":"net_version","params":[]},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Chain: BNB Smart Chain.
- Clusters: mainnet.
- Credit cost: 1 per call.
FAQ
- What does net_version do?
- Return the decimal network identifier.
- How many credits does net_version cost?
- net_version costs 1 credit(s) per call on Triport by default.
- Is net_version available over WebSocket?
- net_version is an HTTP JSON-RPC method.