curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "net_version",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "net_version",
"params": []
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}Monad API method that returns the current network ID. This method helps identify which network the node is connected to, which is important for ensuring transactions are signed for the correct network.Documentation Index
Fetch the complete documentation index at: https://chainstack-mintlify-flesh-empty-pages.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
noneresult — a string representing the current network ID.net_version code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getNetworkVersion() {
const networkVersion = await provider.send("net_version", []);
console.log(`Network ID: ${networkVersion}`);
}
getNetworkVersion();
net_version is validating that your application is connected to the expected network before sending transactions, preventing accidental transactions on the wrong network.Was this page helpful?