newMinedTransactionsTraces - EVM Data Stream
Stream the call trace of each matching mined transaction, including internal calls. Complete guide on how to use the newMinedTransactionsTraces topic in GetBlock EVM Data Stream documentation.
The newMinedTransactionsTraces topic sends one notification per matching mined transaction, carrying its full call trace: the top-level call and every internal call, delegate call, and contract creation beneath it. Use it to see value and control flow that logs don't show, such as internal ETH transfers.
Parameters
filters.transactionHash
string or array
No
One transaction hash, or an array of hashes.
filters.fromAddress
string or array
No
Match traces with any call frame from these addresses.
filters.toAddress
string or array
No
Match traces with any call frame to these addresses.
filters.callType
string or array
No
Match frames of these types: call, delegatecall, staticcall, create, or create2.
filters.status
string
No
success or failed: match traces that contain a frame with this status.
Filters match on any frame in the call tree, not only the top-level call. A transaction that touches a contract through an internal call matches toAddress for that contract, and status: "failed" matches a transaction with a failed internal call even when its top-level call succeeded. Check error on each frame to see which call failed.
Request Example
# WebSocket-only. Connect first:
wscat -c 'wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream' -H 'Authorization: Bearer <API-KEY>'
# Then send:
{"jsonrpc":"2.0","id":1,"method":"getblock_subscribe","params":[{"topic":"newMinedTransactionsTraces","filters":{"toAddress":"0xdAC17F958D2ee523a2206206994597C13D831ec7","status":"failed"}}]}// npm install ws
import WebSocket from 'ws';
const ws = new WebSocket('wss://stream.eu-central-1.getblock.io/v1/eth-mainnet/stream', {
headers: { Authorization: 'Bearer <API-KEY>' }
});
ws.on('open', () => {
ws.send(JSON.stringify({
jsonrpc: '2.0',
id: 1,
method: 'getblock_subscribe',
params: [{
topic: 'newMinedTransactionsTraces',
filters: {
toAddress: '0xdAC17F958D2ee523a2206206994597C13D831ec7',
status: 'failed'
}
}]
}));
});
ws.on('message', (raw) => {
const msg = JSON.parse(raw);
// First reply is the subscription ID (or an error)
if (msg.id !== undefined) {
console.log(msg.error ?? `Subscribed: ${msg.result}`);
return;
}
const { removed, data } = msg.params.result;
// Collect every failed frame in the call tree
const failed = [];
const walk = (frame) => { if (frame.error) failed.push(frame); (frame.calls ?? []).forEach(walk); };
walk(data.trace.result);
console.log(removed ? 'REVERTED' : 'trace', data.trace.txHash, failed.map((f) => `${f.type} ${f.to}: ${f.error}`));
});Response Example
The first reply is the subscription ID:
Every later message is an event notification (a failed transaction):
Response Parameters
The result object contains the event envelope and the payload in data.
eventId
string
Stable event identifier. A reorg correction reuses it.
removed
boolean
true when a reorg removed this previously delivered event.
revision
number
Event version. For one eventId, a greater revision is newer.
data.removed
boolean
Mirrors the envelope's removed.
data.blockHash
string
Hash of the block that contains the transaction.
data.blockNumber
string
Block number, hex-encoded.
data.trace.txHash
string
Transaction hash.
data.trace.result
object
Top-level call frame. Its fields are below.
data.trace.result.type
string
Frame type: CALL, DELEGATECALL, STATICCALL, CREATE, CREATE2, or SELFDESTRUCT.
data.trace.result.from
string
Caller address.
data.trace.result.to
string
Callee address, or the created contract.
data.trace.result.value
string
Native value sent with the call in wei, hex-encoded.
data.trace.result.gas
string
Gas available to the frame, hex-encoded.
data.trace.result.gasUsed
string
Gas used by the frame, hex-encoded.
data.trace.result.input
string
Call data.
data.trace.result.output
string
Return data, when there is any.
data.trace.result.error
string
Error message when the frame failed, for example execution reverted.
data.trace.result.revertReason
string
Decoded revert reason, when available.
data.trace.result.calls
array
Child frames, each with the same fields, recursively.
Use Cases
Detecting internal native-token transfers into your addresses
Debugging and alerting on failed transactions with their revert point
Analysing contract-to-contract interactions of a protocol
Security monitoring for unexpected
delegatecalls or contract creations
Error Handling
-32602
filters.status must be success or failed
status has an unsupported value. Note it is failed here, but failure on transactionReceipts.
-32602
unsupported filters.callType "…"
callType has an unsupported value.
-32602
invalid filters.toAddress address "…"
An address filter is not a 20-byte hex address. The same applies to fromAddress.
-32602
invalid newMinedTransactionsTraces request: json: unknown field "…"
The request has a field this topic does not accept.
-32001
subscription limit exceeded
You already have 15 active or pending subscriptions.
Last updated
Was this helpful?