curl --request POST \
--url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xa54F56e8Cfff25b17105d6073aB0f0E7DA087225",
"latest"
]
}
'{
"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": "eth_getTransactionCount",
"params": [
"0xa54F56e8Cfff25b17105d6073aB0f0E7DA087225",
"latest"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}data — the 20-byte address.quantity or tag — integer block number, or the string latest, earliest, or pending.result — the number of transactions sent from the address, encoded as hexadecimal.eth_getTransactionCount code examplesconst { ethers } = require("ethers");
const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");
async function getTransactionCount() {
const address = "0xa54F56e8Cfff25b17105d6073aB0f0E7DA087225";
const nonce = await provider.getTransactionCount(address);
console.log(`Transaction count: ${nonce}`);
}
getTransactionCount();
eth_getTransactionCount is obtaining the correct nonce when manually constructing transactions, ensuring they are processed in the correct order.Was this page helpful?