Polygon
Polygon
Polygon
الخطة المجانية تغطي المشاريع الشخصية. الدفع حسب الاستخدام يتوسع دون بطاقة.
eth_getBlockTransactionCountByHash returns just the number of transactions in the Polygon PoS block identified by a given hash — a single hex integer, no block body. When all you need is how full a Bor block is, this is far lighter than pulling the entire block. Polygon's ~2-second blocks and low MATIC fees mean transaction counts fluctuate with demand, so this is a cheap pulse on activity. Send the hash to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89).
| # | الاسم | النوع | مطلوب | الوصف |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | نعم | The hash of the block to count transactions in. |
| النوع | الوصف |
|---|---|
| string (hex) | Hex-encoded transaction count. "0x0" means the block is empty. |
Try it live in the Polygon playground.
| الكود | الرسالة | السبب |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
null, not "0x0" — null-check before running parseInt on the result.eth_getBlockTransactionCountByNumber instead.المعاملات
0x-prefixed 32-byte block hash