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_getUncleCountByBlockNumber returns the number of uncle blocks referenced by the block at a given height or block tag. On OP Mainnet — the ETH-gas OP Stack rollup at chain ID 10 (0xa) that settles to Ethereum L1 — that count is always 0x0. The chain is built by a single sequencer with no proof-of-work competition, so no orphaned sibling blocks ever become uncles. Point the call at https://optimism.therpc.io/YOUR_API_KEY with any height or tag such as latest, and it returns zero uncles; the method is retained purely for Ethereum JSON-RPC compatibility.
0x0, so the resulting rate is flat zero.eth_getUncleByBlockNumberAndIndex — though on OP Mainnet the 0x0 answer tells you upfront there are no uncle details to fetch.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | blockTag | string | Sí | The block to count uncles in. |
| Tipo | Descripción |
|---|---|
| string (hex) | Hex-encoded uncle count. |
Try it live in the Optimism playground.
| Código | Mensaje | Causa |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
0x0 regardless of which block or tag you query — its OP Stack consensus produces no uncles, so never branch on a non-zero count here."0x0"), not a number — parse it (for example parseInt(result, 16)) before doing any numeric comparison.Parámetros
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"