debug_traceCall
https://api.triport.io/v1/ethExecutes an `eth_call` against the state of a chosen block and returns the full EVM execution trace, without broadcasting a transaction.
debug_traceCall simulates a contract call exactly as
eth_call would, but instead of returning only the call's
return data it returns a structured EVM execution trace. The call is evaluated
against the state at the supplied block — nothing is broadcast and no state is
persisted. Use it to debug why a call reverts, to inspect internal call
hierarchies and gas accounting, or to preview the effect of a transaction
before sending it.
The method is part of the debug namespace and is available on the pro and
business tiers. Because producing a trace is more expensive than a plain
eth_call, the per-second limits are lower than for standard eth_* read
methods.
By default the method uses the built-in struct/opcode logger, which emits one
entry per executed opcode. For higher-level output pass a named tracer such as
callTracer (call hierarchy) or prestateTracer (pre-execution state) in the
options object.
Parameters
The params array is positional: [callObject, blockParameter, options?].
callObjectobjectrequiredblockParameterstringrequired0x10d4f) or a tag: latest, earliest, pending, safe, finalized.optionsobjectoptionalcallObject fieldsobjecttostringrequiredfromstringoptionaldatastringoptionalvaluestringoptionalgasstringoptionalgasPricestringoptionaloptions fieldsobjecttracerstringcallTracer, prestateTracer, 4byteTracer, or a custom JS tracer.tracerConfigobject{ "onlyTopCall": true } for callTracer.timeoutstring10s).Response
Response fields
The shape of result depends on the selected tracer. The example above shows the
callTracer output (a single top-level call frame).
| Field | Type | Description |
|---|---|---|
result | object | Trace output for the simulated call. |
result.type | string | Call type: CALL, DELEGATECALL, STATICCALL, CREATE, etc. |
result.from | string | Sender address of the call frame. |
result.to | string | Recipient address of the call frame. |
result.value | string | Wei transferred with the call frame, hex-encoded. |
result.gas | string | Gas supplied to the call frame, hex-encoded. |
result.gasUsed | string | Gas consumed by the call frame, hex-encoded. |
result.input | string | Call data passed into the frame. |
result.output | string | Return data from the frame. |
result.calls | array | Nested child call frames (present with callTracer). |
result.error | string | Present only when the frame reverted; holds the revert reason. |
With the default struct logger, result instead contains gas, failed,
returnValue, and a structLogs array with one entry per executed opcode.
Errors
| Code | Meaning | When it happens |
|---|---|---|
| -32602 | Invalid params | Malformed call object, bad block parameter, unknown tracer name, or bad tracerConfig. |
| -32002 | Tier insufficient | API key is on the free tier; debug methods require pro or business. |
| -32003 | Rate limited | Per-second limit for your tier exceeded; back off and retry. |
| -32000 | Server error | Block not found, the call reverted at the EVM level, or the trace exceeded the configured timeout. |
See errors.md for the full error envelope.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/eth", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "debug_traceCall",
params: [
{
from: "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
to: "0xb5a5f22694352c15b00323844ad545abb2b11028",
data: "0xa9059cbb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc40000000000000000000000000000000000000000000000000000000000000064",
},
"latest",
{ tracer: "callTracer" },
],
}),
});
const { result } = await res.json();
console.log(result);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const trace = await triport.eth.debugTraceCall(
{
from: "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
to: "0xb5a5f22694352c15b00323844ad545abb2b11028",
data: "0xa9059cbb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc40000000000000000000000000000000000000000000000000000000000000064",
},
"latest",
{ tracer: "callTracer" },
);
console.log(trace);Python (triport-sdk)
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
trace = triport.eth.debug_trace_call(
{
"from": "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
"to": "0xb5a5f22694352c15b00323844ad545abb2b11028",
"data": "0xa9059cbb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc40000000000000000000000000000000000000000000000000000000000000064",
},
"latest",
tracer="callTracer",
)
print(trace)Notes
- Unlike
eth_call, this method does not return only the call's return data — it returns a full trace. If you only need the return value, useeth_call; it is available at the free tier and far cheaper. - The struct logger (default tracer) can produce very large responses for complex
calls. Prefer
callTracerorprestateTracerunless you need opcode-level detail. - To trace a call that has already been mined, use
debug_traceTransaction. To trace every transaction in a block, usedebug_traceBlockByNumberordebug_traceBlockByHash. - Tracer selection,
tracerConfig, andtimeoutbehave identically across alldebug_trace*methods. - A call that reverts is still a successful JSON-RPC response: the revert is
reported inside the trace (
result.errorwithcallTracer, orfailed: truewith the struct logger), not as a top-level error.