trace_get - Optimism

trace_get. Retrieves detailed information about a specific transaction trace

trace_get - optimism [Value: 20CU]
Retrieves a specific transaction trace by transaction hash and index
Use cases

Use cases

  • Analyze internal transactions for a specific transaction
  • Trace smart contract execution paths and outcomes
  • Debug complex transaction behavior within blockchain
Constraints

Constraints

  • Requires valid transaction hash and trace index
  • Node must support the trace_get method
  • Trace data accuracy depends on node synchronization
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" \
-d '{"method":"trace_get","params":["0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",["0x0"]],"id":1,"jsonrpc":"2.0"}'
Copy
Response
200
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
    "action": {
      "callType": "call",
      "from": "0x1c39ba39e4735cb65978d4db400ddd70a72dc750",
      "gas": "0x13e99",
      "input": "0x16c72721",
      "to": "0x2bd2326c993dfaef84f696526064ff22eba5b362",
      "value": "0x0"
    },
    "blockHash": "0x7eb25504e4c202cf3d62fd585d3e238f592c780cca82dacb2ed3cb5b38883add",
    "blockNumber": 3068185,
    "result": {
      "gasUsed": "0x183",
      "output": "0x0000000000000000000000000000000000000000000000000000000000000001"
    },
    "subtraces": 0,
    "traceAddress": [
      0
    ],
    "transactionHash": "0x17104ac9d3312d8c136b7f44d4b8b47852618065ebfa534bd2d3b5ef218ca1f3",
    "transactionPosition": 2,
    "type": "call"
  }
}
Copy

Request params

idinteger
jsonrpcstring
methodstring
Parametersarray
array
blockHashstring
The hash of the transaction to retrieve the trace for.
indexarray
An array specifying the trace indexes within the transaction to be retrieved.

Response

200
The trace object for the specified transaction, containing detailed information about the execution

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.