Docs
Docs
Home
Getting Started
Agent Tooling
CLI
Supported Chains
Acala
Aptos
Arbitrum
Arc
Asset Hub
Astar
Avalanche
Base
Berachain
Bifrost
Binance Smart Chain
Bittensor
Blast
Boba Network
Bridge Hub
Celo
Centrifuge
Chiliz
Cronos
Enjin
Ethereum
Etherlink
Flow EVM Gateway
Gnosis
Hydration
Hyperliquid
Immutable
Ink
IoTeX
Kusama
Linea
LISK
Manta Atlantic
Manta Pacific
Mantle
MegaETH
Monad
Movement
Neuroweb
opBNB
Optimism
Plasma
Polkadot
Polygon
Pulsechain
Robinhood
Ronin
Scroll
Sonic
Starknet
Taiko
Tempo
Sui
TRON
Unichain
Viction
World Chain
XDC Network
XX Network
Zetachain
zkSync Era
Zora
Supported ChainsTRONEthereum JSON-RPC APIAccount Methods

eth_getTransactionCount - TRON RPC Method

Get the number of transactions sent from an address (nonce) on TRON. Essential for nonce management, transaction signing, and detecting stuck transactions.

TRON RPC endpoint: endpoint URLs, plans and pricing.

Returns the number of transactions sent from an address on TRON, commonly known as the nonce. The nonce is required for every outbound transaction to ensure correct ordering and prevent replay attacks.

Why TRON? Build on the TVM-compatible Layer 1 for TRC-20 payments, wallet APIs, and low-cost smart contract execution with TVM compatibility paired with native TRON wallet APIs, DPoS block production, and low-cost transaction flows.

When to Use This Method

eth_getTransactionCount is essential for TRON developers building payment rails, exchanges, and consumer crypto applications:

  • Transaction Signing - Get the correct nonce before building and signing a new transaction on TRON
  • Nonce Gap Detection - Compare latest and pending nonces to identify stuck or dropped transactions in the mempool
  • Account Activity Analysis - Track the total number of outgoing transactions from any address on TRC-20 transfers, wallet operations, and EVM-compatible smart contract integrations
  • Batch Transaction Sequencing - Assign sequential nonces when submitting multiple transactions from the same address

Current Shared Endpoint Behavior

Dwellir's shared TRON JSON-RPC endpoint currently returns -32601 for eth_getTransactionCount. Keep this page as a compatibility reference for TRON clients that expose the EVM nonce surface, but feature-detect the method before you depend on it in production code.

If you are building against the shared public endpoint, plan around the native TRON wallet APIs for transaction construction instead of assuming Ethereum-style nonce reads are available everywhere.

JSON-RPC request
{
  "jsonrpc": "2.0",
  "method": "eth_getTransactionCount",
  "params": [
    "0xc7885b2334355ba766f54a3ad14d5a5339934bb3",
    "latest"
  ],
  "id": 1
}

Code Examples

Common Use Cases

1. Feature-detect nonce support during startup

JavaScript
async function supportsTronNonceReads(provider, address) {
  try {
    await provider.send('eth_getTransactionCount', [address, 'latest']);
    return true;
  } catch (error) {
    return !String(error.message).includes('does not exist');
  }
}

2. Fallback to the native TRON wallet flow

JavaScript
async function prepareTronSubmission({ provider, address }) {
  const hasNonceSurface = await supportsTronNonceReads(provider, address);

  if (!hasNonceSurface) {
    return {
      mode: 'tron-wallet-api',
      note: 'Use wallet/createtransaction or wallet/triggersmartcontract on this endpoint.',
    };
  }

  return {
    mode: 'evm-compatible',
    nonce: await provider.send('eth_getTransactionCount', [address, 'latest']),
  };
}

3. Keep compatibility logic explicit

Python
def classify_tron_nonce_support(payload: dict) -> str:
    if payload.get('error', {}).get('code') == -32601:
        return 'shared-endpoint-without-eth_getTransactionCount'

    return 'endpoint-exposes-evm-nonce-surface'

Best Practices

  • Always use pending block tag when fetching the nonce for a new transaction to avoid nonce collisions
  • Track nonces locally with a monotonic counter that syncs with the pending nonce from the network on reset
  • If pending nonce equals latest nonce, no stuck transactions exist -- the account is clean
  • For high-throughput applications (multiple transactions per second), implement a local nonce manager with retry logic
  • The nonce starts at 0 for new accounts and increments by 1 for each confirmed outbound transaction

Error Handling

Error CodeDescriptionSolution
-32601Method not found on the shared TRON JSON-RPC surfaceFeature-detect the method and fall back to native TRON wallet flows on endpoints that do not expose it
-32602Invalid paramsVerify the address is a valid 20-byte hex string and the block parameter is valid
-32005Rate limit exceededBack off and retry after reducing request frequency
JavaScript
async function classifyTronNonceError(provider, address) {
  try {
    return await provider.send('eth_getTransactionCount', [address, 'latest']);
  } catch (error) {
    if (String(error.message).includes('does not exist')) {
      return null;
    }

    throw error;
  }
}

Related Methods

  • eth_sendRawTransaction - Send a signed transaction to the network
  • eth_getBalance - Get the ETH balance of an address
  • eth_getTransactionByHash - Get transaction details by hash
  • eth_getTransactionReceipt - Get the receipt of a confirmed transaction

eth_getStorageAt

Read the value from a storage slot at a given contract address on TRON. Essential for reading contract state directly, proxy implementation verification, and storage layout analysis.

eth_accounts

Returns a list of addresses owned by the client on TRON. Typically returns an empty array on public RPC endpoints.

On this page

When to Use This MethodCurrent Shared Endpoint BehaviorCode ExamplesCommon Use Cases1. Feature-detect nonce support during startup2. Fallback to the native TRON wallet flow3. Keep compatibility logic explicitBest PracticesError HandlingRelated Methods