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

# trace_call | BNB Chain

> BNB API method trace_call allows for executing a call transaction and returns several possible traces for it. BNB Chain via Chainstack.

BNB API method `trace_call` allows for executing a call transaction and returns several possible traces for it. This method simulates transactions without broadcasting them to the network, allowing developers to test and debug their transactions in a controlled environment.

## Parameters

* `transaction` — the transaction to be executed, specified as an object with fields including:
  * `from` — the address sending the transaction.
  * `to` — the address of the transaction recipient.
  * `gas` — the amount of gas allocated for the transaction.
  * `gasPrice` — the price per unit of gas.
  * `value` — the amount of ether to send.
  * `data` — the data to be sent with the transaction.
* `traceTypes` — an array of strings specifying the types of traces to return, with options including:
  * `vmTrace` — virtual machine trace.
  * `trace` — standard execution trace.
  * `stateDiff` — state difference trace.
* `blockNumber` — the block number against which the transaction should be executed, with values:
  * `specific block number` — execute against the specified block.
  * `earliest` — the earliest block (usually genesis).
  * `latest` — the most recent block.
  * `pending` — the current pending state and transactions.

## Response

* `result` — Depending on the requested `traceTypes`, the result may include various forms of trace data such as VM operation trace, state changes, and executed transaction trace. This data is crucial for understanding how a transaction interacts with the EVM and alters the blockchain state.

## Use case

A possible use case for the `trace_call` method in BNB is for smart contract developers who must debug complex interactions with the Ethereum Virtual Machine (EVM). Developers can identify and fix issues by simulating transactions before deploying contracts or sending transactions on the live network. It can also be used to estimate gas usage more accurately or verify that a transaction will behave as expected without actually making a state change on the blockchain.


## OpenAPI

````yaml /openapi/bnb_node_api/trace_call.json POST /35848e183f3e3303c8cfeacbea831cab
openapi: 3.0.0
info:
  title: BNB Node API
  version: 1.0.0
  description: This is an API for interacting with a BNB node.
servers:
  - url: https://bsc-mainnet.core.chainstack.com
security: []
paths:
  /35848e183f3e3303c8cfeacbea831cab:
    post:
      tags:
        - trace
      summary: trace_call
      operationId: traceCall
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: trace_call
                params:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          from:
                            type: string
                            nullable: true
                          to:
                            type: string
                            default: '0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2'
                          data:
                            type: string
                            default: >-
                              0x70a082310000000000000000000000001985ea6e9c68e1c272d8209f3b478ac2fdb25c87
                      - type: array
                        items:
                          type: string
                      - type: string
                  default:
                    - from: null
                      to: '0x8965349fb649A33a30cbFDa057D8eC2C48AbE2A2'
                      data: >-
                        0x70a082310000000000000000000000001985ea6e9c68e1c272d8209f3b478ac2fdb25c87
                    - - trace
                      - vmTrace
                    - latest
      responses:
        '200':
          description: The call's trace.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: object

````