BNB Smart Chain
Pronto para usar isso em produção?
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
BNB Smart Chain
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
Chain ID 56 finalizes one canonical block per PoSA slot in roughly three seconds, paying gas in BNB, and never accumulates competing sibling blocks along the way. eth_getUncleCountByBlockNumber, issued against https://bsc.therpc.io/YOUR_API_KEY, is documented to count the ommers a block references when you address that block by height or by a tag like latest. Whether you name the block by number or by hash makes no difference to the result. PoSA forks no uncles, so this variant stays an Ethereum-compatibility shim that hands back 0x0 at every height you ask about.
eth_getUncleByBlockNumberAndIndex; a 0x0 count tells you up front there is nothing further to fetch at that height.| # | Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|---|
| 1 | blockTag | string | Sim | The block to count uncles in. |
| Tipo | Descrição |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the BNB Smart Chain playground.
| Código | Mensagem | Causa |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
0x0 for every height regardless of which block you name, so never branch on the expectation of a positive count.0x0 to a number before any numeric comparison or you risk comparing strings by accident.Parâmetros
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"