trace_filter - Optimism

trace_filter. Returns transaction traces that match specific filter criteria

trace_filter - optimism [Value: 75CU]
Retrieves traces of all transactions that match specific filter criteria
Use cases

Use cases

  • Filter traces for transactions from specific addresses
  • Analyze smart contract interactions in a block range
  • Debug specific account activities within block intervals
Constraints

Constraints

  • Requires valid block range and address parameters
  • Node must support the trace_filter method
  • Accurate results depend on node's data completeness
Get started
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key

Language

Request
Examples
curl https://optimism.drpc.org \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"trace_filter","params":[{"fromBlock":"0xccb943","toBlock":"0xccb943","fromAddress":["0xEdC763b3e418cD14767b3Be02b667619a6374076"]}],"id":1,"jsonrpc":"2.0"}'
Copy
Response
200
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": [
    {
      "action": {
        "callType": "call",
        "from": "0xEdC763b3e418cD14767b3Be02b667619a6374076",
        "gas": "0x15f90",
        "input": "0x",
        "to": "0x8d12a197cb00d4747a1fe03395095ce2a5cc6819",
        "value": "0x0"
      },
      "blockHash": "0x5c0b4b4d3a64311a802cd51e0dd0f656b5d4016a2cf2f3d780e8b1cfe1b6ac2e",
      "blockNumber": 13498499,
      "result": {
        "gasUsed": "0x0",
        "output": "0x"
      },
      "subtraces": 0,
      "traceAddress": [],
      "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",
      "transactionPosition": 1,
      "type": "call"
    }
  ]
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
fromBlockstring
Specifies the starting block number or tag (e.g., "latest", "earliest") from which to begin the trace.
toBlockstring
Specifies the ending block number or tag up to which to include in the trace.
fromAddressstring
An array of sender addresses to filter by.
toAddressstring
An array of receiver addresses to filter by.
afterstring
The offset number for pagination purposes.
countstring
The number of traces to retrieve starting from the offset.

Response

200
Array of trace objects matching the filter criteria, each containing details about the transaction trace

Response params

object
idinteger
jsonrpcstring
resultobject
object
actionobject
Contains details about the trace action.
object
callTypestring
The type of call.
fromstring
The sender's address.
tostring
The receiver's address.
valuestring
The value transferred in wei.
gasstring
The gas provided for the call.
inputstring
The data sent with the call.
blockHashstring
The hash of the block where the trace occurred.
blockNumberstring
The number of the block where the trace occurred.
resultstring
object
gasUsedstring
Gas used by the trace.
outputstring
Call output.
subtracesinteger
Number of subtraces created by this trace..
traceAddressarray_of_strings
Position of this trace in the call stack.
transactionHashstring
Hash of the transaction containing this trace.
transactionPositionstring
Transaction's position in the block.
typestring
The type of trace.