curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x564000",
"toBlock": "0x565000",
"toAddress": [
"0x20c0000000000000000000000000000000000000"
],
"count": 10
}
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": [
{}
]
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "trace_filter",
"params": [
{
"fromBlock": "0x564000",
"toBlock": "0x565000",
"toAddress": [
"0x20c0000000000000000000000000000000000000"
],
"count": 10
}
],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": [
{}
]
}filterObject — the filter object:
fromBlock — (optional) starting block number (hex)toBlock — (optional) ending block number (hex)fromAddress — (optional) array of sender addresses to filtertoAddress — (optional) array of recipient addresses to filterafter — (optional) offset for paginationcount — (optional) maximum number of traces to returnresult — array of trace objects matching the filter:
action — the action object:
from — sender addressto — recipient addresscallType — type of callgas — gas providedinput — call datavalue — value transferredblockHash — hash of the blockblockNumber — block numberresult — the result objectsubtraces — number of child tracestraceAddress — position in the trace treetransactionHash — hash of the transactiontransactionPosition — index in the blocktype — trace typetrace_filter code examplesconst ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
// pathUSD token address
const PATHUSD = "0x20c0000000000000000000000000000000000000";
const traceFilter = async () => {
const currentBlock = await provider.getBlockNumber();
const fromBlock = "0x" + (currentBlock - 1000).toString(16);
const toBlock = "0x" + currentBlock.toString(16);
const traces = await provider.send("trace_filter", [{
fromBlock: fromBlock,
toBlock: toBlock,
toAddress: [PATHUSD],
count: 20
}]);
console.log(`Found ${traces.length} traces to pathUSD`);
for (const trace of traces) {
console.log(`Block ${trace.blockNumber}: ${trace.action.from} -> ${trace.action.to}`);
console.log(` Call type: ${trace.action.callType}`);
console.log(` Tx: ${trace.transactionHash}`);
}
};
traceFilter();
Was this page helpful?