TriportRPC

Simulate call with Parity trace output

POSThttps://api.triport.io/v1/polygon/trace/call

Executes a contract call against the state of a chosen Polygon block and returns the full Parity-style execution trace — without broadcasting anything.

Polygonpro tier and above — RPS per tier with a ×2 burst allowance

POST /v1/polygon/trace/call simulates an eth_call against a chosen Polygon block and returns a structured Parity-style trace of the execution instead of just the call's return data. Nothing is broadcast and no state is persisted — the call is evaluated read-only against the state at the block you name. Use it to debug why a call reverts, to inspect the internal call tree and gas accounting, or to preview a transaction's effect before sending it via POST /v1/polygon/sender/raw.

The shape of the trace is controlled by the tracers array. Each entry selects one output section: trace (the call/create tree), vmTrace (a VM-level step-by-step trace), and stateDiff (the set of state changes the call would produce). You may request any combination; sections you do not ask for are returned as null.

Exclusive availability. Parity trace_* methods are served on Polygon through a throughput-constrained, exclusively-available canal. Because tracing is far more expensive than a plain read, this endpoint is gated to the pro tier and above, and is rate-limited more tightly than standard wallet reads — keep request rates modest and batch trace work where you can.

Parameters

This endpoint takes a JSON request body. All three top-level fields are required.

txobjectrequired
The transaction-call object to simulate. All EVM call fields are optional individually — see below.
tracersarray of stringrequired
Which trace sections to produce. One or more of trace, vmTrace, stateDiff.
blockstringrequired
Block to evaluate the call against — a block number (hex or decimal) or a tag: latest, pending, safe, finalized.
tx fieldsobject
fromstringoptional
Sender address the call executes as (0x-prefixed). Defaults to the zero address.
tostringoptional
Target contract address. Omit to simulate a contract creation.
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.
tracers valuesobject

Response

A Parity-style trace envelope. Sections you did not request in tracers are returned as null. The example below requested only trace:

outputstring
Hex-encoded return data of the top-level call.
tracearray
Flat list of call/create frames. Present when trace was requested, otherwise null.
trace[].actionobject
Frame inputs: callType, from, to, value, gas, input.
trace[].resultobject
Frame outputs: gasUsed, output. Replaced by an error field if the frame reverted.
trace[].subtracesinteger
Number of direct child frames.
trace[].traceAddressarray
Position of this frame within the call tree.
trace[].typestring
Frame type: call, create, suicide, etc.
vmTraceobject
VM-level step trace. Present when vmTrace was requested, otherwise null.
stateDiffobject
Per-account state changes. Present when stateDiff was requested, otherwise null.

Errors

CodeMeaningWhen it happens
400invalid_paramsMissing tx, tracers, or block; an unknown tracer name; or a malformed call object / block tag.
401unauthorized / trial_expired / subscription_expiredNo or invalid credentials, or the key's trial / subscription has ended.
403tier_insufficient / method_unknownKey is below the pro tier, or trace is not part of the key's product.
429rate_limitedSustained RPS for your tier exceeded; honour the Retry-After header and back off.

See errors.md for the full error envelope, the per-code body shapes, and the X-RateLimit-* headers returned on 429.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/polygon/trace/call", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    tx: {
      from: "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
      to: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
      data: "0xa9059cbb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc40000000000000000000000000000000000000000000000000000000000000064",
    },
    tracers: ["trace"],
    block: "latest",
  }),
});
const envelope = await res.json();
console.log(envelope.trace);

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const envelope = await triport.polygon.trace.call({
  tx: {
    from: "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
    to: "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
    data: "0xa9059cbb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc40000000000000000000000000000000000000000000000000000000000000064",
  },
  tracers: ["trace"],
  block: "latest",
});
console.log(envelope.trace);

Python (triport-sdk)

import os
from triport import Triport


triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])


envelope = triport.polygon.trace.call(
    tx={
        "from": "0x8894e0a0c962cb723c1976a4421c95949be2d4e3",
        "to": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
        "data": "0xa9059cbb0000000000000000000000005b38da6a701c568545dcfcb03fcb875f56beddc40000000000000000000000000000000000000000000000000000000000000064",
    },
    tracers=["trace"],
    block="latest",
)
print(envelope["trace"])

Notes

  • A call that reverts is still a successful (200) response: the revert surfaces inside the trace as an error field on the offending frame, not as a top-level HTTP error.
  • Request only the tracers sections you need. vmTrace in particular can produce very large bodies for complex calls.
  • To trace a transaction that has already been mined rather than a simulated call, use POST /v1/polygon/trace/replay-tx.
  • Authentication also accepts the X-API-Key header or the legacy ?api-key= query parameter — see authentication.md. Bearer is recommended.
  • For tier thresholds and how RPS-with-burst limiting works, see rate-limits-and-tiers.md.