Polygon
Polygon
Polygon
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
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.هذا الأسلوب لا يأخذ أي معاملات. مرر مصفوفة فارغة [].
| النوع | الوصف |
|---|---|
| string (hex) | Hex-encoded integer block number. Parse with parseInt(value, 16) or BigInt(value). |
Try it live in the Polygon playground.
| الكود | الرسالة | السبب |
|---|---|---|
-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.