RPC method

eth_getTransactionCount on MegaETH

Supported on SwiftNodes

Everything below was measured on 2026-10-13 by calling eth_getTransactionCount on MegaETH through the same endpoint customers use, and is re-measured weekly.

What eth_getTransactionCount does

Returns the number of transactions an address has sent, which is the nonce its next transaction must use. With the pending tag it also counts the address's transactions waiting in the node's mempool.

eth_getTransactionCount on MegaETH: what we measured

On an address that had just sent a transaction in the latest block (0xa887dcb9d5f39ef79272801d05abdf707cfbbd1d):

"latest"268,868,028
"pending"268,868,036

Which tag to use

"pending" was 8 ahead of "latest": the address had transactions waiting. Use "pending" for the next nonce, or you will reuse a nonce and replace a queued transaction.

Example request

curl -s https://rpc.swiftnodes.io/rpc/megaeth?key=YOUR_API_KEY \
  -X POST -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_getTransactionCount","params":["0xa887dcb9d5f39ef79272801d05abdf707cfbbd1d","pending"]}'
import { createPublicClient, http } from "viem";

const client = createPublicClient({
  transport: http("https://rpc.swiftnodes.io/rpc/megaeth?key=YOUR_API_KEY"),
});

const nonce = await client.getTransactionCount({ address, blockTag: "pending" });

// Sending several transactions: let viem track nonces locally
import { nonceManager, privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(key, { nonceManager });

Other methods on MegaETH

eth_getTransactionCount on other chains

Frequently asked questions

Does MegaETH support eth_getTransactionCount?

Yes. eth_getTransactionCount answered on the SwiftNodes MegaETH endpoint when our weekly probe called it through the customer path (2026-10-13).

How do I get the next nonce on MegaETH?

eth_getTransactionCount(address, "pending"). For several transactions in a row, increment locally.

MegaETH endpoints, live block height and WebSocket status are on the MegaETH RPC page.

One key covers every chain we serve, and SwiftNodes has a free tier.