Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getBlockByHash returns the full block data for the Polygon PoS block identified by a given hash — header fields, gas metrics, and either transaction hashes or full transaction objects. It is the hash-keyed counterpart to eth_getBlockByNumber, and because a hash pins one exact block, it is the reliable way to detect reorgs of Bor blocks before their Heimdall checkpoint settles on Ethereum. Fees in any contained transactions are denominated in MATIC. Send the request to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89).
baseFeePerGas, the producer, and other header fields for a specific canonical Polygon block.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | blockHash | string (hex) | 是 | The hash of the block to retrieve. |
| 2 | includeTransactions | boolean | 是 | When true, transactions[] contains full transaction objects. When false, only hashes. |
| 类型 | 描述 |
|---|---|
| object | null | Block object with fields: number, hash, parentHash, timestamp, miner, gasUsed, gasLimit, baseFeePerGas, transactions, uncles, withdrawals, stateRoot, receiptsRoot, transactionsRoot, logsBloom, extraData, size, difficulty, totalDifficulty, mixHash, nonce, sha3Uncles. Returns null if no block was foun |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Block hash is malformed or not 32 bytes. |
includeTransactions, not the string "true" — JSON-RPC requires the boolean type or the node rejects the request.includeTransactions=true, a busy Polygon block packed with DeFi and stablecoin transfers can push the response past 1 MB; stream or paginate when bandwidth is tight.null, not an error — always null-check before reading fields.参数
0x-prefixed 32-byte block hash
true = full tx objects, false = tx hashes only