Optimism
Bereit, das in der Produktion aufzurufen?
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
Optimism
Das Free-Tier deckt persönliche Projekte ab. Pay-as-you-go skaliert ohne Karte.
eth_getTransactionCount returns the number of transactions an address has sent on OP Mainnet — that is, its account nonce — measured at the block you specify. The nonce is what you set on the next transaction you sign, so this call is a prerequisite for building and broadcasting any send. OP Mainnet is an OP Stack optimistic rollup (Bedrock) settling to Ethereum L1, with gas paid in ETH and ~2s blocks, which means the pending nonce advances quickly when you fire transactions in sequence. Send the request to https://optimism.therpc.io/YOUR_API_KEY (chain ID 10, 0xa).
latest nonce against the pending nonce — a gap means something is queued but not yet mined.pending count.| # | Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|---|
| 1 | address | string (hex) | Ja | The account whose nonce to query. |
| 2 | blockTag | string | Nein | Use "pending" to include mempool transactions when chaining multiple sends.Standard: latest |
| Typ | Beschreibung |
|---|---|
| string (hex) | Hex-encoded nonce (number of confirmed transactions sent from the address at that block). |
Try it live in the Optimism playground.
| Code | Meldung | Ursache |
|---|---|---|
-32602 | Invalid params | Address is malformed or block tag is unrecognised. |
-32000 | Missing trie node | Historical block pruned on a non-archive node. |
pending tag when firing transactions back-to-back on OP Mainnet; latest returns the same nonce for all of them until each is mined, causing collisions.CREATE/CREATE2), not ordinary calls, so it grows differently from an EOA nonce.Parameter
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"