Optimism
Prêt à utiliser cela en production ?
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
Optimism
Le niveau gratuit couvre les projets personnels. Le paiement à l'usage évolue sans carte bancaire.
trace_call simulates a call against a chosen OP Mainnet block state and returns an OpenEthereum-style call-tree trace, plus an optional opcode-level VM trace and an optional state diff — all without creating a transaction or spending any ETH. You pick which outputs you want via the traceTypes array (trace, vmTrace, stateDiff), so it doubles as a preview tool and a storage-impact analyzer. OP Mainnet is the OP Stack rollup with ETH gas, chain ID 10 (0xa); send the request to https://optimism.therpc.io/YOUR_API_KEY to see a call's full effect before committing.
stateDiff to validate the exact balance and storage changes a transaction would make against what you expect.| # | Nom | Type | Obligatoire | Description |
|---|---|---|---|---|
| 1 | transaction | object | Oui | Call object: `from?`, `to`, `gas?`, `gasPrice?`, `value?`, `data?`. |
| 2 | traceTypes | array | Oui | Array of trace types to include: `"trace"` (call tree), `"vmTrace"` (opcode-level), `"stateDiff"` (storage/balance diffs). |
| 3 | blockParameter | string | Non | Block state against which to simulate the call.Défaut : latest |
| Type | Description |
|---|---|
| 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 Optimism playground.
| Code | Message | Cause |
|---|---|---|
-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) can produce very large responses; ask only for the outputs you actually need.vmTrace format is Parity-specific and differs from the Geth debug_traceCall struct-log format — do not parse one as the other.Paramètres
Call object: `from?`, `to`, `gas?`, `gasPrice?`, `value?`, `data?`.
["trace"] | ["trace","vmTrace","stateDiff"] — at least one required
hex block number or "latest" | "earliest" | "pending"