Optimism
Optimism
Optimism
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
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.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | address | string (hex) | 是 | The account whose nonce to query. |
| 2 | blockTag | string | 否 | Use "pending" to include mempool transactions when chaining multiple sends.默认值: latest |
| 类型 | 描述 |
|---|---|
| string (hex) | Hex-encoded nonce (number of confirmed transactions sent from the address at that block). |
Try it live in the Optimism playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-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.参数
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"