Polygon
Polygon
Polygon
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
trace_transaction returns the flattened call tree of a single historical Polygon PoS transaction in the OpenEthereum/Nethermind format. Each entry's traceAddress encodes its path through the tree, so you can reconstruct exactly how a MATIC-fee transaction fanned out across contracts — without the opcode-by-opcode weight of the debug_* tracers. Send the request to https://polygon.therpc.io/YOUR_API_KEY (chain ID 137, 0x89) with the transaction hash. It returns the OpenEthereum/Nethermind-style call tree for the historical transaction, showing every internal call, create, and self-destruct action.
traceAddress.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transactionHash | string | 是 | Hash of the transaction to retrieve traces for. |
| 类型 | 描述 |
|---|---|
| array | Flat array of trace objects, each with `{action, result, subtraces, traceAddress, transactionHash, transactionPosition, blockHash, blockNumber, type}`. `traceAddress` encodes the path through the call tree. |
Try it live in the Polygon playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32601 | Method not found | trace namespace not enabled; node requires --gcmode=archive and trace API enabled (Geth), or equivalent flag on Nethermind/Erigon. |
-32602 | Invalid params | Transaction hash is missing or malformed. |
-32000 | transaction not found | Transaction does not exist or archive trace data is unavailable for that block. |
debug_traceTransaction: there is no opcode-level data, only call, create, and self-destruct actions, so use the debug_* tracers when you need stack or storage detail.参数
0x-prefixed 32-byte hash