Avalanche
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
trace_transaction returns the OpenEthereum/Nethermind-style call tree for a confirmed Avalanche C-Chain transaction, exposing every internal call, contract creation, and self-destruct (suicide) action it performed. The C-Chain is Avalanche's EVM chain, where AVAX is the gas token and Snowman consensus finalizes blocks in roughly one to two seconds. Unlike the opcode-level debug tracers, this gives you a clean, flat list of actions — perfect for following AVAX value as it moves through nested contract calls. Send the request to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, hex 0xa86a) with the transaction hash, and each returned trace's traceAddress encodes its exact position in the call tree.
| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 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 Avalanche 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. |
--gcmode=archive plus the trace API, or Erigon/Nethermind with the trace API); most public Avalanche light nodes do not expose it.debug_traceTransaction — there is no opcode-level data, only call, create, and suicide actions — so pick the method that matches the granularity you need.参数
0x-prefixed 32-byte hash