trace_transaction
https://api.triport.io/v1/ethReturns the OpenEthereum-style action traces for every call frame inside a single already-mined transaction.
trace_transaction re-executes a transaction that has already been included in a
block and returns a flat list of action traces — one entry per call frame
(the top-level call plus every internal CALL, DELEGATECALL, CREATE, and
SELFDESTRUCT it triggered). This is the OpenEthereum / Parity trace format:
instead of the nested call tree produced by
debug_traceTransaction's callTracer, each frame
is a separate array element, and its position in the call hierarchy is encoded by
the traceAddress path.
Use it when you want a compact, post-hoc accounting of value movement and internal calls — for example reconstructing internal ETH transfers, attributing gas across sub-calls, or finding exactly which frame reverted. Because the output is flat and value-oriented (rather than opcode-level), it is much smaller than a struct log and is the trace format most block explorers and accounting tools expect.
This is a trace-namespace method available on the Pro tier and above. It is
rate limited per tier (5 RPS on Pro, 15 RPS on Business) with a short burst
allowance; there is no daily quota. The transaction must already be mined — to
trace a transaction you have not yet sent, simulate it first.
Parameters
One positional parameter.
txHashstringrequired0x-prefixed 32-byte hash of the transaction to trace. The transaction must already be mined into a block.Response
The result is an array of action traces. The first entry (with an empty
traceAddress) is the top-level call; subsequent entries are internal frames,
ordered by their position in the call tree.
A frame that failed has its result replaced by an error string and omits the
result object — for example "error": "Reverted".
actionobjecttype (see below).resultobjectgasUsed (hex) and, for calls, output (hex return data); for create frames, the new contract address and deployed code. Absent when the frame failed.errorstringReverted, Out of gas). Replaces result.subtracesintegertraceAddressarray[] is the top-level call; [0] is its first child; [0,1] is the second child of that child.typestringcall, create, or suicide (self-destruct).blockHashstringblockNumberintegertransactionHashstringtransactionPositionintegerErrors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your API key's tier is below Pro; this trace-namespace method is not enabled for it. The error.data carries current_tier, required_tier, and upgrade_url. |
-32003 | rate_limited | You exceeded your tier's request rate (5 RPS on Pro, 15 RPS on Business) including burst. Honor the Retry-After header / error.data.retry_after_sec and retry after a short back-off. |
See the shared error envelope reference for the full error
object shape and handling guidance. An unknown or not-yet-mined txHash returns
an empty result array rather than an error.
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: "trace_transaction",
params: ["0x5b8d2a3c9f1e7b04c6f2a1d8e3047b9a6c1f0e2d4b8a7c5e9f3a1d2c4b6e8f0a"],
}),
});
const { result } = await res.json();
for (const t of result) {
console.log(t.traceAddress.join("."), t.type, t.action.to, t.result?.gasUsed);
}TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const traces = await triport.eth.request("trace_transaction", [
"0x5b8d2a3c9f1e7b04c6f2a1d8e3047b9a6c1f0e2d4b8a7c5e9f3a1d2c4b6e8f0a",
]);
console.log(`${traces.length} frames`);Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
traces = triport.eth.request(
"trace_transaction",
["0x5b8d2a3c9f1e7b04c6f2a1d8e3047b9a6c1f0e2d4b8a7c5e9f3a1d2c4b6e8f0a"],
)
for t in traces:
print(t["traceAddress"], t["type"], t["action"].get("to"), t.get("error"))Notes
- Flat vs. nested.
trace_transactionreturns a flat, value-oriented list; if you want a nested call tree or opcode-level detail instead, usedebug_traceTransactionwithcallTraceror the struct logger. - Reconstructing the tree. Rebuild the hierarchy from
traceAddress: an entry withtraceAddress: [0, 2]is the third child of the first child of the root.subtracestells you how many direct children to expect for each frame. - Internal ETH transfers. Sum the
action.valueof every frame to account for all ETH movement, including transfers made by internal calls thateth_getTransactionReceiptdoes not expose. - To trace every transaction in a block instead of one, use the block-level
trace methods; to filter traces across a range of blocks by address, use
trace_filter.