Polygon
Polygon
Polygon
O plano gratuito cobre projetos pessoais. O pay-as-you-go escala sem cartão de crédito.
eth_blockNumber returns the height of the most recently accepted block on Polygon PoS — the latest block sealed by a Bor producer. Because Polygon mines a new block roughly every 2 seconds, this value moves fast and is the simplest way to confirm your node is keeping up with the head of the chain. Gas on Polygon is paid in MATIC, but this call costs nothing on-chain: it is a pure read. Send it to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) and you get back the current block height as a hex string.
polygon.therpc.io is up and synced to the Polygon head.eth_getLogs over a historical range.Este método não aceita parâmetros. Passe um array vazio [].
| Tipo | Descrição |
|---|---|
| string (hex) | Hex-encoded integer block number. Parse with parseInt(value, 16) or BigInt(value). |
Try it live in the Polygon playground.
| Código | Mensagem | Causa |
|---|---|---|
-32603 | Internal error | Node is not reachable or has not yet produced any block. |
0x3a1f2c, not a number — run parseInt(value, 16) or BigInt(value) before any arithmetic.