TriportRPC

debug_traceCall

POSThttps://api.triport.io/v1/eth

Executes an `eth_call` against the state of a chosen block and returns the full EVM execution trace, without broadcasting a transaction.

Ethereumeth_debugpro — 5 RPS · business — 15 RPS

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?].

callObjectobjectrequired
The transaction-call object to simulate. See fields below.
blockParameterstringrequired
Block to evaluate the call against — a hex-encoded block number (e.g. 0x10d4f) or a tag: latest, earliest, pending, safe, finalized.
optionsobjectoptional
Tracer configuration object. See fields below.
callObject fieldsobject
tostringrequired
Address of the contract being called.
fromstringoptional
Sender address the call executes as. Defaults to the zero address.
datastringoptional
Hex-encoded ABI call data (method selector + arguments).
valuestringoptional
Hex-encoded wei value to send with the call.
gasstringoptional
Hex-encoded gas limit for the call.
gasPricestringoptional
Hex-encoded gas price in wei.
options fieldsobject
tracerstring
Named tracer: callTracer, prestateTracer, 4byteTracer, or a custom JS tracer.
tracerConfigobject
Tracer-specific options, e.g. { "onlyTopCall": true } for callTracer.
timeoutstring
Max trace duration, Go duration string (e.g. 10s).

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).

FieldTypeDescription
resultobjectTrace output for the simulated call.
result.typestringCall type: CALL, DELEGATECALL, STATICCALL, CREATE, etc.
result.fromstringSender address of the call frame.
result.tostringRecipient address of the call frame.
result.valuestringWei transferred with the call frame, hex-encoded.
result.gasstringGas supplied to the call frame, hex-encoded.
result.gasUsedstringGas consumed by the call frame, hex-encoded.
result.inputstringCall data passed into the frame.
result.outputstringReturn data from the frame.
result.callsarrayNested child call frames (present with callTracer).
result.errorstringPresent 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

CodeMeaningWhen it happens
-32602Invalid paramsMalformed call object, bad block parameter, unknown tracer name, or bad tracerConfig.
-32002Tier insufficientAPI key is on the free tier; debug methods require pro or business.
-32003Rate limitedPer-second limit for your tier exceeded; back off and retry.
-32000Server errorBlock 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, use eth_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 callTracer or prestateTracer unless you need opcode-level detail.
  • To trace a call that has already been mined, use debug_traceTransaction. To trace every transaction in a block, use debug_traceBlockByNumber or debug_traceBlockByHash.
  • Tracer selection, tracerConfig, and timeout behave identically across all debug_trace* methods.
  • A call that reverts is still a successful JSON-RPC response: the revert is reported inside the trace (result.error with callTracer, or failed: true with the struct logger), not as a top-level error.