Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
eth_getTransactionByHash returns the full transaction object for a given hash on Polygon PoS (chain ID 137) — sender, recipient, value in MATIC wei, gas fields, the input calldata, and, once mined, its block number and position. It is the workhorse for tracking any transaction you have submitted or observed on Polygon, from a QuickSwap swap to a USDC transfer. Send the hash to https://polygon.therpc.io/YOUR_API_KEY and you get the transaction object back, or null while it is still pending and unknown to the node, or if it was never seen.
blockNumber is non-null (Bor blocks land in about 2 seconds, so this flips quickly).input calldata to identify which contract function was invoked — for instance distinguishing an ERC-20 transfer from an approve on a Polygon token.from address and value to verify an incoming MATIC payment before crediting it.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transactionHash | string (hex) | 是 | The hash of the transaction to retrieve. |
| 类型 | 描述 |
|---|---|
| object | null | Transaction object containing: hash, nonce, blockHash, blockNumber, transactionIndex, from, to (null for contract creation), value (hex wei), gas, gasPrice / maxFeePerGas / maxPriorityFeePerGas, input, type, accessList (type-1/2), chainId, v, r, s. Returns null if not found or still pending (blockHa |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32602 | Invalid params | Transaction hash is malformed or not 32 bytes. |
status field of eth_getTransactionReceipt for the actual outcome.blockHash, blockNumber, and transactionIndex all null; do not mistake that for confirmation.null outright, so always null-check the response before reading any field.参数
0x-prefixed 32-byte transaction hash