Avalanche
准备好在生产环境中调用了吗?
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
Avalanche
免费套餐涵盖个人项目。按量付费,无需绑卡即可扩展。
trace_call simulates a call against a chosen block's state on the Avalanche C-Chain and returns an OpenEthereum-style call-tree trace, plus an optional opcode-level VM trace and an optional state diff — without ever creating a transaction or spending AVAX. The C-Chain is Avalanche's EVM chain, where gas is paid in AVAX and Snowman consensus settles blocks in roughly one to two seconds. You pick exactly which artifacts you want via the traceTypes array ("trace", "vmTrace", "stateDiff"). Send the request to https://avalanche.therpc.io/YOUR_API_KEY (chain ID 43114, hex 0xa86a), and the response bundles the call output together with whichever trace types you requested.
stateDiff to validate the exact storage and balance changes a prospective transaction would make on a DeFi contract like Aave or Trader Joe.| # | 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|---|
| 1 | transaction | object | 是 | Call object: `from?`, `to`, `gas?`, `gasPrice?`, `value?`, `data?`. |
| 2 | traceTypes | array | 是 | Array of trace types to include: `"trace"` (call tree), `"vmTrace"` (opcode-level), `"stateDiff"` (storage/balance diffs). |
| 3 | blockParameter | string | 否 | Block state against which to simulate the call.默认值: latest |
| 类型 | 描述 |
|---|---|
| object | `{output, trace?, stateDiff?, vmTrace?}` — `trace` is a flat call-tree array, `stateDiff` maps each touched address to its balance/nonce/code/storage diffs, `vmTrace` provides opcode-level detail (Parity-format). |
Try it live in the Avalanche playground.
| 错误码 | 错误信息 | 原因 |
|---|---|---|
-32601 | Method not found | trace namespace not enabled or client does not support trace_call. |
-32602 | Invalid params | Transaction object missing required fields, traceTypes array is empty or contains unrecognized values, or blockParameter is invalid. |
-32000 | execution reverted | Simulated call reverted; partial trace is still returned. |
trace + vmTrace + stateDiff) at once can produce a very large response; ask only for what you actually need.vmTrace format is Parity-specific and differs from Geth's debug_traceCall structLog — do not feed one into tooling built for the other.参数
Call object: `from?`, `to`, `gas?`, `gasPrice?`, `value?`, `data?`.
["trace"] | ["trace","vmTrace","stateDiff"] — at least one required
hex block number or "latest" | "earliest" | "pending"