> ## Documentation Index
> Fetch the complete documentation index at: https://docs.validationcloud.io/llms.txt
> Use this file to discover all available pages before exploring further.

# debug_traceTransaction

Returns all traces of a given transaction.

This method will use `80` [Compute Units](/nodeapi/about/billing).

***

<Info>
  Traces need the state of the traced block, so Unichain Mainnet can trace roughly the last 10,000 blocks, about 2.8 hours at Unichain's 1-second block time. Older blocks return JSON-RPC error `-32603` with a message that contains `state at block #<number> is pruned`.
</Info>

## **Parameters**

`transactionHash` - String - <span style={{color: "red"}}>Required</span> - The transaction hash to be traced.

`object` - Object - <span style={{color: "red"}}>Required</span> - The tracer object with the following fields:

* `tracer` - String - The type of tracer, options are: `callTracer` or `prestateTracer`.
  * `callTracer` - String - The callTracer keeps track of all call frames, including depth - calls, that are made during a transaction.
  * `prestateTracer` - String - The prestateTracer replays the transaction and tracks every part of state that occurred during the transaction.
* `tracerConfig` - Object (Optional) - The object to specify the configurations of the tracer.
  * `onlyTopCall` - Boolean - When set to true, this will only trace the primary (top-level) call and not any sub-calls. It eliminates the additional processing for each call frame.
* `timeout` - String (Optional) - A string of decimal integers that overrides the JavaScript-based tracing calls default timeout of 5 seconds. Example: `10s` for 10 seconds.

## **Returns**

`result` - With `callTracer`, an object with the result of the trace, containing:

* `from` - The address the transaction is sent from.
* `gas` - The integer of the gas provided for the transaction execution.
* `gasUsed` - The integer of the gas used.
* `to` - The address the transaction is directed to.
* `input` - The data given at the time of input.
* `value` - The integer of the value sent with this transaction.
* `type` - The type of call.

With `prestateTracer`, the result is instead a map keyed by account address, holding the state the transaction touched (such as `balance`, `nonce`, `code` and `storage`).

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
// Result
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "from": "0xcabba9e7f4b3a885c5aa069f88469ac711dd4acc",
    "gas": "0x5578",
    "gasUsed": "0x5578",
    "to": "0x0000000000000000000000000000000000000000",
    "input": "0x426c6f636b204e756d6265723a203631323237383132",
    "value": "0x0",
    "type": "CALL"
  }
}
```

<CodeGroup>
  ```bash title="mainnet" theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
  curl https://mainnet.unichain.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
      -X POST \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","method":"debug_traceTransaction","params":["0xbefd965068aaabb9b8ebdc9d3ed81f5b3b2bc7d2c7c28d34da6bcbab2b4748f5",{"tracer":"callTracer"}],"id":1}'
  ```
</CodeGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.