BNB Smart Chain
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
BNB Smart Chain
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Every outbound transaction on BNB Smart Chain must carry a strictly increasing nonce, and eth_getTransactionCount reports that nonce: the number of transactions an address has sent as of the block you specify. On a network that spends BNB for gas and finalizes blocks in roughly three seconds, getting the nonce right is what keeps your sends from colliding or stalling. Query https://bsc.therpc.io/YOUR_API_KEY on chain ID 56 with an address and a block tag, and the method hands back the count as a hex integer. That is typically the value you assign to the very next transaction you sign.
latest count against the pending count for one address.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 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 BNB Smart Chain 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. The latest tag keeps returning the same number until each transaction confirms, so you would reuse a nonce.参数
0x-prefixed 20-byte address
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"