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"