Skip to main content

trace_filter

Returns traces matching the specified filter. The block range is limited to 100 blocks per query (the difference between fromBlock and toBlock). This method uses 300 credits from your daily balance.

Parameters

  • filter object [Required] with the following keys and their values:
    • fromBlock: [optional] Trace starts at this block.
    • toBlock: [optional] Trace stops at this block.
    • fromAddress: [optional] Include only traces sent from this address.
    • toAddress: [optional] Include only traces with this destination address.
    • after: [optional] The offset trace number.
    • count: [optional] Number of traces to display in a batch.

Returns

A trace list that matches the supplied filter.

Example

Replace <YOUR-API-KEY> with an API key from your MetaMask Developer dashboard.

Request

curl https://mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_filter", "params": [{"fromBlock": "0x1", "toBlock": "0x21", "after": 2, "count": 2, "fromAddress": ["0xfe3b557e8fb62b89f4916b721be55ceb828dbd73"]}], "id": 415}'

Response

{
"jsonrpc": "2.0",
"result": [
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0xffad82",
"input": "0x0000000000000000000000000000000000000999",
"to": "0x0020000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0xcd5d9c7acdcbd3fb4b24a39e05a38e32235751bb0c9e4f1aa16dc598a2c2a9e4",
"blockNumber": 6,
"result": {
"gasUsed": "0x7536",
"output": "0x"
},
"subtraces": 1,
"traceAddress": [],
"transactionHash": "0x91eeabc671e2dd2b1c8ddebb46ba59e8cb3e7d189f80bcc868a9787728c6e59e",
"transactionPosition": 0,
"type": "call"
},
{
"action": {
"callType": "call",
"from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73",
"gas": "0xffad52",
"input": "0xf000000000000000000000000000000000000000000000000000000000000001",
"to": "0x0030000000000000000000000000000000000000",
"value": "0x0"
},
"blockHash": "0xeed85fe57db751442c826cfe4fdf43b10a5c2bc8b6fd3a8ccced48eb3fb35885",
"blockNumber": 7,
"result": {
"gasUsed": "0x1b",
"output": "0xf000000000000000000000000000000000000000000000000000000000000002"
},
"subtraces": 0,
"traceAddress": [],
"transactionHash": "0x47f4d445ea1812cb1ddd3464ab23d2bfc6ed408a8a9db1c497f94e8e06e85286",
"transactionPosition": 0,
"type": "call"
}
],
"id": 415
}