eth_getTransactionCount - Ethereum RPC Method
Get account nonce on Ethereum. Essential for transaction ordering for DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps.
Returns the number of transactions sent from an address on Ethereum (the nonce).
Use Cases
- Transaction building - Get correct nonce for new transactions
- Account analysis - Count total outgoing transactions
- Nonce management - Handle pending transaction queues
- Wallet operations - Prepare transactions for DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps
Request Parameters
20-byte address
Block number or tag (pending for next nonce)
Response Body
Code Examples
curl -X POST https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_getTransactionCount",
"params": [
"0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
"latest"
],
"id": 1
}'import { JsonRpcProvider } from 'ethers';
const provider = new JsonRpcProvider('https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY');
const address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045';
const nonce = await provider.getTransactionCount(address);
console.log('Nonce:', nonce);
// Get pending nonce for new transaction
const pendingNonce = await provider.getTransactionCount(address, 'pending');
console.log('Next nonce:', pendingNonce);from web3 import Web3
w3 = Web3(Web3.HTTPProvider('https://api-ethereum-mainnet.n.dwellir.com/YOUR_API_KEY'))
address = '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
nonce = w3.eth.get_transaction_count(address)
print(f'Nonce: {nonce}')
# Get pending nonce
pending_nonce = w3.eth.get_transaction_count(address, 'pending')
print(f'Next nonce: {pending_nonce}')Related Methods
eth_getBalance- Get account balanceeth_sendRawTransaction- Send transaction
eth_getStorageAt - Ethereum RPC Method
Read contract storage on Ethereum. Essential for analyzing contract state for DeFi protocols (60% market share), NFT marketplaces, DAOs, and enterprise dApps.
eth_accounts - Ethereum RPC Method
Returns a list of addresses owned by the client on Ethereum. Typically returns an empty array on public RPC endpoints.