debug_jstraceCall

Let you run an eth_call within the context of the given block execution using the final state of parent block as the base.

Compared with traditional debug API, this new debug PRO API supports customized tracers.

📘

Supported on BSC, ETH, and Polygon mainnet only.

Parameters

  • object[OPTIONAL] - The transaction call object
    • from- The address the transaction is sent from
    • to- The address the transaction is directed to
    • gas- The gas provided for the transaction execution
    • gasPrice- The gas price
    • data- The data sent along with the transaction
    • value- The value transferred in Wei, encoded as a hexadecimal
  • blockNumber[REQUIRED] - The block number, hex format
  • tracer[REQUIRED] - The tracer type

Returns

This returns based on callTracer. Please refer to Geth implementation for more return data fields.

  • Object- Full trace of the block.
    • result- Trace Object, which has the following fields:
      • from- The address the transaction is sent from
      • to- The address the transaction is directed to
      • gas- The gas provided for the transaction execution
      • gasUsed- The gasPrice used for each paid gas
      • input- The data sent along with the transaction
      • output- The output data
      • type- Type of the transaction
      • value- The value transferred in Wei, encoded as a hexadecimal

API Endpoint

The format of a MegaNode API endpoint is https://{chain}-{network}.nodereal.io/v1/{API-key}
Here is an example:

https://bsc-mainnet.nodereal.io/v1/4c0a1c23661a4e26bcbcwed461e34ea9

For other chains or networks, you could refer to this guidance Find API key & endpoint.

Example

Request

curl https://bsc-mainnet.nodereal.io/v1/your-api-key \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"debug_jstraceCall","params": [{"from": "0x4982085c9e2f89f2ecb8131eca71afad896e89cb","to": "0xce56d6ff4f9c8dbcacc5f848ca8c60ba5469ae70","gas": "0x7148","value": "0x11c37937e08000"},"latest",{"tracer": "callTracer"}],"id": 0 }'

Result

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "type": "CALL",
        "from": "0x4982085c9e2f89f2ecb8131eca71afad896e89cb",
        "to": "0xce56d6ff4f9c8dbcacc5f848ca8c60ba5469ae70",
        "value": "0x11c37937e08000",
        "gas": "0x1f40",
        "gasUsed": "0x0",
        "input": "0x",
        "output": "0x"
    }
}