trace_block
https://api.triport.io/v1/ethReturns OpenEthereum-style action traces for every transaction in a single Ethereum block.
trace_block replays a block and returns the full set of OpenEthereum-style
action traces for all transactions it contains. Each trace describes a
single step of execution — a top-level call, an internal (nested) call, a
contract create, or a suicide/selfdestruct — along with the value moved,
gas used, and the trace's position in the call tree.
Use it when you need a block-wide view of internal value flow that is not
visible from receipts alone: indexing internal ETH transfers, reconstructing
contract-creation events, attributing gas across nested calls, or auditing MEV
activity. For a single transaction, prefer trace_transaction; to query traces
across a range with filters, use trace_filter.
This is a Pro-tier method in the eth_trace category. Tracing is
compute-heavy, so rate limits are lower than for plain reads — 5 RPS on Pro and
15 RPS on Business.
Parameters
A single positional parameter.
blockstringrequired"0x118b3c5") or a block tag ("latest", "earliest", "pending", "safe", "finalized").Response
Response fields
result is an array of trace objects, ordered by transaction position and then
by execution order within each transaction.
| Field | Type | Description |
|---|---|---|
action | object | The operation performed. Shape depends on type. |
action.callType | string | For call traces: call, delegatecall, staticcall, or callcode. |
action.from | string | Sender address of this action. |
action.to | string | Recipient address (calls only). |
action.value | string | Wei transferred, hex-encoded. |
action.gas | string | Gas provided to this action, hex-encoded. |
action.input | string | Call data, hex-encoded (calls only). |
action.init | string | Contract init bytecode (create traces only). |
result | object | null | Outcome of the action; null when the action errored. |
result.gasUsed | string | Gas consumed by this action, hex-encoded. |
result.output | string | Returned data, hex-encoded (calls only). |
result.address | string | Address of the newly deployed contract (create traces only). |
error | string | Present instead of result when the action reverted or failed (e.g. "Reverted", "out of gas"). |
subtraces | number | Number of direct child actions. |
traceAddress | number[] | Path of this trace within the call tree (empty for the top-level call). |
type | string | call, create, or suicide. |
blockHash | string | Hash of the traced block. |
blockNumber | number | Number of the traced block. |
transactionHash | string | Hash of the transaction this trace belongs to. |
transactionPosition | number | Index of the transaction within the block. |
Errors
| Code | Meaning | When it happens |
|---|---|---|
-32002 | tier_insufficient | Your plan does not include the eth_trace category. Upgrade to Pro or Business. |
-32003 | rate_limited | You exceeded your tier's RPS for this method (5 RPS Pro, 15 RPS Business). Back off and retry. |
-32602 | Invalid params | The block argument is missing or not a valid hex number / block tag. |
-32000 | Block not found | The requested block does not exist on the canonical chain. |
See the shared error envelope reference for the full error object shape and retry guidance.
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_block",
params: ["0x118b3c5"],
}),
});
const { result } = await res.json();
const internalTransfers = result.filter(
(t) => t.type === "call" && t.action.value !== "0x0"
);
console.log(`${internalTransfers.length} value-bearing calls in block`);TypeScript SDK (@triport/sdk)
import { Triport } from "@triport/sdk";
const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });
const traces = await triport.eth.traceBlock("0x118b3c5");
for (const trace of traces) {
if (trace.type === "create") {
console.log("deployed:", trace.result?.address);
}
}Python (triport-sdk)
import os
from triport import Triport
triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])
traces = triport.eth.trace_block("0x118b3c5")
creates = [t for t in traces if t["type"] == "create"]
print(f"{len(creates)} contract deployments in block")Notes
traceAddressreconstructs the call tree. An empty array is the transaction's top-level call;[0]is its first child,[0, 1]is the second child of that child, and so on. Combined withtransactionPositionyou can rebuild each transaction's full execution graph.- Failed actions carry an
errorfield instead ofresult. A reverted top-level call still appears, along with whatever sub-traces ran before the revert. - The result can be large for busy blocks (hundreds to thousands of traces); size your client buffers accordingly.
- Related methods:
trace_transactionfor a single transaction,trace_filterto query traces by address and block range, andtrace_replayBlockTransactionsfor traces plus state diffs and VM output.