Optimism
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Optimism
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
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.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | address | string (hex) | Sí | The account whose nonce to query. |
| 2 | blockTag | string | No | Use "pending" to include mempool transactions when chaining multiple sends.Predeterminado: latest |
| Tipo | Descripción |
|---|---|
| string (hex) | Hex-encoded nonce (number of confirmed transactions sent from the address at that block). |
Try it live in the Optimism playground.
| Código | Mensaje | Causa |
|---|---|---|
-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.Parámetros
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"