Polygon
¿Listo para usar esto en producción?
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
Polygon
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
eth_getUncleCountByBlockNumber returns, as a hex string, the number of uncle blocks referenced by the block at a given height or block tag (latest, earliest, safe, finalized, and so on). On Polygon — the PoS network whose gas token is MATIC, served at https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) — the answer is always "0x0", since its Bor/Heimdall consensus with L1 checkpoints does not fork into uncles. The method is the height-addressed counterpart of eth_getUncleCountByBlockHash and is kept for Ethereum JSON-RPC compatibility.
"0x0", so the computed rate is zero — a direct reflection of its forkless PoS design.eth_getUncleByBlockNumberAndIndex; since Polygon's count is always "0x0", you can skip that follow-up entirely.| # | 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 Polygon playground.
| Código | Mensaje | Causa |
|---|---|---|
-32602 | Invalid params | Block tag is malformed or unrecognised. |
"0x0" regardless of which block or tag you pass, so do not write branching logic that assumes a height could ever carry uncles here."0x0"), not a number — convert it (e.g. parseInt(result, 16)) before doing any numeric comparison or arithmetic.Parámetros
hex block number or "latest"/"earliest"/"pending"/"safe"/"finalized"