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

# Transaction Simulation

> Simulate one or more transactions before they are broadcast. Returns balance changes, approvals, the internal call graph, emitted logs, and HashDit risk levels for every address involved. Covers EVM chains and TRON.

<Note>
  Request fields accept both `camelCase` and `snake_case`. See [Request Field Names](/#request-field-names).
</Note>

Works on EVM chains and [TRON Simulation](/api-reference/endpoint/emulate/tron-simulation). For Solana, use [Solana Transaction Simulation](/api-reference/endpoint/solana-emulate).

`chain_id` is set on each transaction, not at the top level. Send an **integer or a string** — `56` and `"56"` are both valid.

`value`, `gas`, `gas_price`, and `block_height` each accept several encodings of the same number:

| Field          | `int`       | Decimal string | `0x` hex      | Other                |
| -------------- | ----------- | -------------- | ------------- | -------------------- |
| `value`        | `0`         | `"0"`          | `"0x0"`       | —                    |
| `gas`          | `83000`     | `"83000"`      | `"0x14438"`   | —                    |
| `gas_price`    | `70000`     | `"70000"`      | `"0x11170"`   | —                    |
| `block_height` | `105010668` | `"105010668"`  | `"0x64255ec"` | `"latest"` (default) |

<Note>
  `requested_items` is required in practice. Omitting the key is rejected with `400 invalid request`. Any object works — `{"balance_changes": true}` is the normal minimum, and even `{}` is accepted.
</Note>

<Note>
  Fields that belong to a *signed* transaction — `nonce`, `type`, `maxFeePerGas`, `maxPriorityFeePerGas`, `accessList`, `v`, `r`, `s`, `hash`, `blockNumber` — are accepted and ignored. You can POST a wallet's fully populated transaction object as-is.
</Note>

<Note>
  The legacy page listed `invocation_tree`. That field does not exist — use `call_graph`.
</Note>

## Chain Coverage

Chain coverage for this endpoint is broader than the list used by the analysis endpoints and expands over time. Commonly used values: `1` (Ethereum), `56` (BSC), `137` (Polygon), `42161` (Arbitrum), `728126428` (TRON). An unsupported chain is rejected with `400 invalid request`. Contact support to confirm a chain not listed here.

## `risk_level` Scale

Used in `involved_addresses_risks`.

| Value   | Meaning                                                    |
| ------- | ---------------------------------------------------------- |
| `0`     | No known risk.                                             |
| `1`     | Low risk.                                                  |
| `2`–`5` | Increasing risk.                                           |
| `-1`    | Not present in HashDit's database — *unknown*, not *safe*. |

<Note>
  A reverted transaction is a successful API call. The envelope stays `code: "0"`, `status: "ok"`. Read `exec_summary.result_code` and `results[i].revert` to detect the revert. Only infrastructure failures produce non-`"0"` codes.
</Note>


## OpenAPI

````yaml POST /v2/hashdit/emulate
openapi: 3.1.0
info:
  title: HashDit API
  description: >-
    HashDit threat intelligence API for domain security analysis, blockchain
    address classification, address poisoning detection, address security
    assessment, transaction simulation, transaction security, token security,
    Solana token security, token approval security, and EIP-712 signature
    security
  version: 2.0.0
servers:
  - url: https://service.hashdit.io
security: []
paths:
  /v2/hashdit/emulate:
    post:
      summary: Transaction Simulation
      description: >-
        Simulate one or more transactions before they are broadcast. Returns
        balance changes, approvals, the internal call graph, emitted logs, and
        HashDit risk levels for every address involved. Covers EVM chains and
        TRON.
      operationId: emulate
      parameters:
        - name: X-API-KEY
          in: header
          description: Your HashDit API key
          required: true
          schema:
            type: string
      requestBody:
        description: Transactions to simulate and which result sections to return
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmulateRequest'
            examples:
              ERC-20 transfer:
                summary: BSC ERC-20 transfer
                value:
                  evm_transactions:
                    - chain_id: '56'
                      from: '0x18e226459CCf0Eec276514a4fd3b226D8961e4d1'
                      to: '0x55d398326f99059fF775485246999027B3197955'
                      value: '0x0'
                      data: >-
                        0xa9059cbb000000000000000000000000cde5d48fca07f9c52300d2e65632dd71ed169b9000000000000000000000000000000000000000000003d4ff765e3ef19e953000
                      block_height: latest
                      gas: '83000'
                      gas_price: '70000'
                  requested_items:
                    balance_changes: true
                    approve_changes: true
                    logs: true
                    involved_address_risks: true
              Approval:
                summary: BSC ERC-20 unlimited approve
                value:
                  evm_transactions:
                    - name: ERC20 Approve Unlimited (crUSDC)
                      chain_id: '56'
                      from: '0xD920d10d29Ea69F91859Af3C495F25F7E7acD953'
                      to: '0xd83c88db3a6ca4a32fff1603b0f7ddce01f5f727'
                      value: '0x0'
                      force: true
                      block_height: '79151135'
                      data: >-
                        0x095ea7b300000000000000000000000025838042b96ab88ef3f6d9d6431a268550d5c78fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
                      gas: '55000'
                  requested_items:
                    balance_changes: true
                    approve_changes: true
                    balance_table: false
                    call_graph: false
                    logs: false
                    involved_address_risks: true
      responses:
        '200':
          description: >-
            Successful API call. A reverted transaction still returns `code:
            "0"` and `status: "ok"` — read `exec_summary.result_code` and
            `results[i].revert`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmulateResponse'
              examples:
                ERC-20 transfer:
                  summary: Successful simulation
                  value:
                    code: '0'
                    status: ok
                    data:
                      exec_summary:
                        result_code: '000000000'
                        result_description: Successful simulation.
                        error_data: null
                      results:
                        - revert: false
                          platform: bsc
                          tx_gas_used: 51639
                          tx_gas_price: 70000
                          sender_on_chain_balance: '167542475823978515562063'
                          balance_changes:
                            - token_address: '0x55d398326f99059ff775485246999027b3197955'
                              tokenName: Binance-Peg BSC-USD
                              symbol: BSC-USD
                              divisor: '18'
                              tokenPriceUSD: '1.0001371158460857'
                              change_list:
                                - address: '0x18e226459ccf0eec276514a4fd3b226d8961e4d1'
                                  amount_change: '-4632631.602275'
                                  begin_value: '50161676360924969337958879'
                                  delta_value: '-4632631602275000000000000'
                                  end_value: '45529044758649969337958879'
                                  value_usd: '-4633266.81'
                          approve_changes: []
                          called_addresses:
                            - '0x55d398326f99059ff775485246999027b3197955'
                          involved_addresses:
                            - '0x18e226459ccf0eec276514a4fd3b226d8961e4d1'
                            - '0x55d398326f99059ff775485246999027b3197955'
                            - '0xcde5d48fca07f9c52300d2e65632dd71ed169b90'
                          involved_addresses_risks:
                            - address: '0x18e226459ccf0eec276514a4fd3b226d8961e4d1'
                              risk_level: 1
                            - address: '0x55d398326f99059ff775485246999027b3197955'
                              risk_level: 0
                            - address: '0xcde5d48fca07f9c52300d2e65632dd71ed169b90'
                              risk_level: 1
                          logs: []
                          block_height: 105010668
                          request_id: 4b1ebfe9-0274-422e-950b-59f01f7a7510
                Approval:
                  summary: BSC ERC-20 unlimited approve
                  value:
                    code: '0'
                    status: ok
                    data:
                      exec_summary:
                        result_code: '000000000'
                        result_description: Successful simulation.
                        error_data: null
                      results:
                        - approve_changes:
                            - approve_list:
                                - approve_amount: >-
                                    1157920892373161954235709850000000000000000000000000000000000000000000
                                  approver_address: '0xd920d10d29ea69f91859af3c495f25f7e7acd953'
                                  begin_value: '0'
                                  delta_value: >-
                                    115792089237316195423570985008687907853269984665640564039457584007913129639935
                                  end_value: >-
                                    115792089237316195423570985008687907853269984665640564039457584007913129639935
                                  spender_address: '0x25838042b96ab88ef3f6d9d6431a268550d5c78f'
                                  value_usd: '0'
                              divisor: '8'
                              symbol: null
                              tokenName: null
                              tokenPriceUSD: '0'
                              token_address: '0xd83c88db3a6ca4a32fff1603b0f7ddce01f5f727'
                          balance_changes: []
                          block_height: 79151135
                          called_addresses:
                            - '0xd83c88db3a6ca4a32fff1603b0f7ddce01f5f727'
                            - '0xee0c0a840cbfc2145580c517b10afabd0b788328'
                          involved_addresses:
                            - '0x25838042b96ab88ef3f6d9d6431a268550d5c78f'
                            - '0xd83c88db3a6ca4a32fff1603b0f7ddce01f5f727'
                            - '0xd920d10d29ea69f91859af3c495f25f7e7acd953'
                            - '0xee0c0a840cbfc2145580c517b10afabd0b788328'
                          involved_addresses_risks:
                            - address: '0x25838042b96ab88ef3f6d9d6431a268550d5c78f'
                              risk_level: 2
                            - address: '0xd83c88db3a6ca4a32fff1603b0f7ddce01f5f727'
                              risk_level: 0
                            - address: '0xd920d10d29ea69f91859af3c495f25f7e7acd953'
                              risk_level: 0
                            - address: '0xee0c0a840cbfc2145580c517b10afabd0b788328'
                              risk_level: 0
                          name: ERC20 Approve Unlimited (crUSDC)
                          platform: bsc
                          request_id: 08baa3ea-cec3-49f8-b065-af2c4595e231
                          revert: false
                          sender_on_chain_balance: '4779161409962589'
                          tx_gas_price: 108851654582
                          tx_gas_used: 51791
                Reverted transaction:
                  summary: >-
                    Simulation completed; the transaction reverted. Still `code:
                    "0"`.
                  value:
                    code: '0'
                    status: ok
                    data:
                      exec_summary:
                        result_code: <non-zero>
                        result_description: Transaction reverted with a reason.
                        error_data: the message sender must be the block producer
                      results:
                        - revert: true
                          revert_reason: the message sender must be the block producer
                          platform: bsc
                          balance_changes: []
                          approve_changes: []
                          called_addresses:
                            - '0x0000000000000000000000000000000000001000'
                          sender_on_chain_balance: '1572335614337357699'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
        '429':
          $ref: '#/components/responses/RateLimitExceeded'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '502':
          $ref: '#/components/responses/BadGateway'
        '504':
          $ref: '#/components/responses/GatewayTimeout'
components:
  schemas:
    EmulateRequest:
      type: object
      required:
        - evm_transactions
        - requested_items
      properties:
        evm_transactions:
          type: array
          minItems: 1
          description: >-
            Transactions to simulate, executed in order. Minimum 1. Alias
            `transactions` also accepted.
          items:
            $ref: '#/components/schemas/EmulateEvmTransaction'
        requested_items:
          $ref: '#/components/schemas/EmulateRequestedItems'
          description: >-
            Selects which sections appear in each result. Effectively required:
            omitting the key is rejected with `400 invalid request`. Any object
            is accepted, including `{}`. `{"balance_changes": true}` is the
            normal minimum. Unset flags are off.
    EmulateResponse:
      type: object
      properties:
        code:
          type: string
          description: >-
            API status code. `"0"` indicates the API call succeeded, including
            when a transaction reverted.
          example: '0'
        status:
          type: string
          description: Request status.
          example: ok
        data:
          $ref: '#/components/schemas/EmulateData'
    EmulateEvmTransaction:
      type: object
      required:
        - chain_id
        - from
        - to
      properties:
        chain_id:
          type: string
          description: >-
            `int` or `string` (e.g. `56` or `"56"`). Per transaction, not a
            top-level field. `728126428` for TRON.
          example: '56'
        from:
          type: string
          description: Sender address. `0x` hex on EVM; base58 (`T…`) on TRON.
          example: '0x18e226459CCf0Eec276514a4fd3b226D8961e4d1'
        to:
          type: string
          description: >-
            Target contract or recipient. `0x` hex on EVM; base58 (`T…`) on
            TRON.
          example: '0x55d398326f99059fF775485246999027B3197955'
        data:
          type: string
          description: Calldata (hex). Alias `input` — send one, not both.
          example: >-
            0xa9059cbb000000000000000000000000cde5d48fca07f9c52300d2e65632dd71ed169b9000000000000000000000000000000000000000000003d4ff765e3ef19e953000
        value:
          type: string
          description: >-
            `int`, decimal string, or `0x` hex — e.g. `0`, `"0"`, `"0x0"`.
            Native value in wei. Defaults to `0`.
          example: '0x0'
          examples:
            - 0
            - '0'
            - '0x0'
        gas:
          type: string
          description: >-
            `int`, decimal string, or `0x` hex — e.g. `83000`, `"83000"`,
            `"0x14438"`. Gas limit. Alias `gasLimit`.
          example: '83000'
          examples:
            - 83000
            - '83000'
            - '0x14438'
        gas_price:
          type: string
          description: >-
            `int`, decimal string, or `0x` hex — e.g. `70000`, `"70000"`,
            `"0x11170"`. Gas price. Alias `gasPrice`.
          example: '70000'
          examples:
            - 70000
            - '70000'
            - '0x11170'
        block_height:
          type: string
          description: >-
            `"latest"` (default), `int`, decimal string, or `0x` hex — e.g.
            `"latest"`, `105010668`, `"105010668"`, `"0x64255ec"`. Block to
            simulate against. Has no effect on TRON.
          example: latest
          examples:
            - latest
            - 105010668
            - '105010668'
            - '0x64255ec'
        force:
          type: boolean
          description: >-
            Simulate even when pre-checks (balance, nonce) would reject the
            call. Use sparingly — the result no longer reflects what the chain
            would do.
        name:
          type: string
          description: Label echoed back in the matching result, for correlating batches.
        token_id:
          type: string
          description: >-
            TRON only. TRC-10 asset id. `int` or `string`. Must be > 1,000,000
            and sent together with `token_value`.
        token_value:
          type: string
          description: >-
            TRON only. TRC-10 amount. `int` or `string`. Alias
            `call_token_value`.
        freeze_balance:
          $ref: '#/components/schemas/EmulateTronFreezeBalance'
          description: >-
            TRON only. Stake 2.0 freeze / unfreeze. Owner is `from`. At most one
            stake input per transaction, and every stake input requires empty
            calldata (`"0x"` or omitted).
        delegate_resource:
          $ref: '#/components/schemas/EmulateTronDelegateResource'
          description: >-
            TRON only. Stake 2.0 delegate / undelegate. Owner is `from`,
            receiver is `to`; the two must differ. At most one stake input per
            transaction; requires empty calldata (`"0x"` or omitted).
        withdraw_expire_unfreeze:
          type: boolean
          description: >-
            TRON only. `true` claims every matured unfreeze-queue entry for
            `from`. Strict boolean — `"true"` and `1` are rejected.
    EmulateRequestedItems:
      type: object
      description: >-
        Each flag turns on one section of the per-transaction output. Unset
        flags are off.
      properties:
        balance_changes:
          type: boolean
          description: Net token balance change per holder. The most commonly used section.
        approve_changes:
          type: boolean
          description: ERC-20/721/1155 approvals granted during execution.
        ownership_changes:
          type: boolean
          description: Ownership / role transitions.
        involved_address_risks:
          type: boolean
          description: HashDit risk level for every address in the trace.
        call_graph:
          type: boolean
          description: Tree of internal calls with selectors, arguments and return values.
        logs:
          type: boolean
          description: Emitted EVM events.
        balance_table:
          type: boolean
          description: Raw storage-slot balances — lower level than `balance_changes`.
        execution_trace:
          type: boolean
          description: Opcode-level trace. Expensive.
    EmulateData:
      type: object
      properties:
        exec_summary:
          $ref: '#/components/schemas/EmulateExecSummary'
        results:
          type: array
          description: One entry per input transaction, in submission order.
          items:
            $ref: '#/components/schemas/EmulateResult'
    CurrentServiceError:
      type: object
      properties:
        code:
          type: string
          description: >-
            Error code. Typically `-1` for client errors, `-2` for server
            errors, or `401` / `429` for auth and rate limits.
        status:
          type: string
          description: Short error status string.
        detail:
          type: string
          description: Human-readable explanation of the error.
      required:
        - code
        - status
    MissingAPIKeyErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: '`401`'
          example: '401'
        status:
          type: string
          description: Missing API key
          example: Missing API key
        detail:
          type: string
          description: Missing API key
          example: Missing API key
      required:
        - code
        - status
        - detail
    RateLimitExceededErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: '`429`'
          example: '429'
        status:
          type: string
          description: '`error`'
          example: error
        message:
          type: string
          description: Rate limit exceeded
          example: Rate limit exceeded
    EmulateTronFreezeBalance:
      type: object
      description: TRON only. Stake 2.0 freeze / unfreeze. Owner is `from`.
      properties:
        action:
          type: string
          description: '`"freeze"` or `"unfreeze"`.'
          enum:
            - freeze
            - unfreeze
        resource:
          type: string
          description: '`"BANDWIDTH"`, `"ENERGY"`, or `"TRON_POWER"`.'
          enum:
            - BANDWIDTH
            - ENERGY
            - TRON_POWER
        amount:
          type: string
          description: Amount in sun. `int` or `string`.
    EmulateTronDelegateResource:
      type: object
      description: >-
        TRON only. Stake 2.0 delegate / undelegate. Owner is `from`, receiver is
        `to`; the two must differ.
      properties:
        action:
          type: string
          description: '`"delegate"` or `"undelegate"`.'
          enum:
            - delegate
            - undelegate
        resource:
          type: string
          description: '`"BANDWIDTH"` or `"ENERGY"`.'
          enum:
            - BANDWIDTH
            - ENERGY
        amount:
          type: string
          description: Amount in sun. `int` or `string`.
    EmulateExecSummary:
      type: object
      properties:
        result_code:
          type: string
          description: >-
            `"000000000"` when every transaction simulated normally. Any other
            value means the simulation did not complete normally — read
            `result_description` and `error_data`.
          example: '000000000'
        result_description:
          type: string
          description: Human-readable explanation of `result_code`.
          example: Successful simulation.
        error_data:
          type:
            - string
            - 'null'
          description: '`null` on success. On a revert, the decoded revert reason.'
          example: null
    EmulateResult:
      type: object
      properties:
        revert:
          type: boolean
          description: Whether this transaction reverted.
        revert_reason:
          type: string
          description: Decoded reason. Present only when `revert` is `true`.
        platform:
          type: string
          description: Chain key — `"bsc"`, `"eth"`, `"tron"`, …
          example: bsc
        tx_gas_used:
          type: integer
          description: Gas consumed.
        tx_gas_price:
          type: integer
          description: Gas price used.
        sender_on_chain_balance:
          type: string
          description: Sender's native balance in wei at the simulated block.
        balance_changes:
          type: array
          description: >-
            `begin_value` / `end_value` / `delta_value` are raw smallest-unit
            decimal strings. `amount_change` is that change divided by
            `10^divisor` (token units). `value_usd` is `amount_change ×
            tokenPriceUSD`.
          items:
            $ref: '#/components/schemas/EmulateBalanceChange'
        approve_changes:
          type: array
          description: >-
            Token-centric, like `balance_changes`, but each token's rows are in
            `approve_list` (not `change_list`). Amounts are raw smallest units —
            not divided by decimals. One bucket per token; one `approve_list`
            row per approver/spender pair.
          items:
            $ref: '#/components/schemas/EmulateApproveChange'
        ownership_changes:
          type: array
          description: Owner / role transitions.
          items:
            type: object
        call_graph:
          $ref: '#/components/schemas/EmulateCallGraph'
        logs:
          type: array
          description: Emitted events.
          items:
            type: object
        balance_table:
          type: array
          description: Raw storage-slot balances.
          items:
            type: object
        called_addresses:
          type: array
          description: Contracts whose code executed.
          items:
            type: string
        involved_addresses:
          type: array
          description: Every address in the trace, including EOAs.
          items:
            type: string
        involved_addresses_risks:
          type: array
          description: >-
            `{address, risk_level}` per address. Only when
            `involved_address_risks` was requested.
          items:
            $ref: '#/components/schemas/EmulateAddressRisk'
        block_height:
          type: integer
          description: Block actually simulated against.
        name:
          type: string
          description: Echoed from the input, if supplied.
        request_id:
          type: string
          description: Per-request UUID — quote this in support requests.
        execution_trace:
          description: Opcode-level trace. Present when `execution_trace` was requested.
        tron_fee:
          $ref: '#/components/schemas/EmulateTronFee'
          description: >-
            TRON only. Estimated TRX burned, split across bandwidth and energy
            meters. Reporting only — never reflected in `balance_changes`. No
            `requested_items` flag needed. When the fee meters cannot be read,
            this object is omitted. Absence means the fee is unknown, not 0 — do
            not default a missing `tron_fee` to a zero fee.
        stake_ledger_changes:
          type: array
          description: >-
            TRON only. Before/after diffs of Stake 2.0 scalar fields, in sun. No
            `requested_items` flag needed. Empty collections are omitted rather
            than returned as `[]`.
          items:
            $ref: '#/components/schemas/EmulateTronStakeLedgerChange'
          example:
            - address: TUAEpR16Th4pLbjECPVYTgvPyStNKyB54h
              begin_value: '784127000000'
              delta_value: '1'
              end_value: '784127000001'
              field: delegated_energy
            - address: TUAEpR16Th4pLbjECPVYTgvPyStNKyB54h
              begin_value: '136046278017815'
              delta_value: '-1'
              end_value: '136046278017814'
              field: frozen_v2_energy
            - address: THSt2MxFt7hs68dbxiffcAiySjHbW8Hnqx
              begin_value: '13713000000'
              delta_value: '1'
              end_value: '13713000001'
              field: acquired_energy
        resource_capacity_changes:
          type: array
          description: >-
            TRON only. How each address's usable ENERGY / BANDWIDTH limit moved.
            No `requested_items` flag needed. Empty collections are omitted
            rather than returned as `[]`.
          items:
            $ref: '#/components/schemas/EmulateTronResourceCapacityChange'
          example:
            - address: THSt2MxFt7hs68dbxiffcAiySjHbW8Hnqx
              begin_capacity: '131016'
              begin_staked_sun: '13713000000'
              delta_capacity: '0'
              delta_staked_sun: '1'
              end_capacity: '131016'
              end_staked_sun: '13713000001'
              resource: ENERGY
            - address: TUAEpR16Th4pLbjECPVYTgvPyStNKyB54h
              begin_capacity: '1299812911'
              begin_staked_sun: '136046278017815'
              delta_capacity: '0'
              delta_staked_sun: '-1'
              end_capacity: '1299812911'
              end_staked_sun: '136046278017814'
              resource: ENERGY
        resource_capacity_conversion:
          $ref: '#/components/schemas/EmulateTronResourceCapacityConversion'
          description: >-
            TRON only. Network totals used for the sun → capacity conversion. No
            `requested_items` flag needed. Omitted when empty.
    EmulateBalanceChange:
      type: object
      properties:
        token_address:
          type: string
          description: >-
            Token contract. Native SOL uses `"native"`. TRC-10 transfers use
            `"trc10:<id>"`.
          example: '0x55d398326f99059ff775485246999027b3197955'
        tokenName:
          type: string
          example: Binance-Peg BSC-USD
        symbol:
          type: string
          example: BSC-USD
        divisor:
          type: string
          description: Token decimals, as a decimal string.
          example: '18'
        tokenPriceUSD:
          type: string
          description: USD unit price used for `value_usd`.
        change_list:
          type: array
          items:
            $ref: '#/components/schemas/EmulateBalanceChangeItem'
    EmulateApproveChange:
      type: object
      description: >-
        Per-token approval bucket. Same metadata as `balance_changes`; the row
        list is `approve_list`.
      properties:
        token_address:
          type: string
          description: Token contract. TRC-10 transfers use `"trc10:<id>"`.
          example: '0x55d398326f99059ff775485246999027b3197955'
        tokenName:
          type: string
          example: Binance-Peg BSC-USD
        symbol:
          type: string
          example: BSC-USD
        divisor:
          type: string
          description: >-
            Token decimals, as a decimal string. Used to compute `value_usd`;
            list amounts themselves are not divided by this.
          example: '18'
        tokenPriceUSD:
          type: string
          description: USD unit price used for `value_usd`.
        approve_list:
          type: array
          description: >-
            One row per approver/spender pair for this token. Not named
            `change_list`.
          items:
            $ref: '#/components/schemas/EmulateApproveChangeItem'
    EmulateCallGraph:
      type: object
      description: Nested call tree.
      properties:
        opcode:
          type: string
        msg_sender:
          type: string
        input_info:
          type: object
        output_info:
          type: object
        calls:
          type: array
          items:
            $ref: '#/components/schemas/EmulateCallGraph'
    EmulateAddressRisk:
      type: object
      properties:
        address:
          type: string
        risk_level:
          type: integer
          description: >-
            `0` no known risk; `1` low risk; `2`–`5` increasing risk; `-1` not
            in HashDit's database — unknown, not safe.
    EmulateTronFee:
      type: object
      description: >-
        TRON only. Estimated TRX burned, split across bandwidth and energy
        meters. Reporting only — never reflected in `balance_changes`. Amounts
        are in sun unless noted. When the fee meters cannot be read, this object
        is omitted. Absence means the fee is unknown, not 0 — do not default a
        missing `tron_fee` to a zero fee.
      example:
        bandwidth_consumed: 345
        bandwidth_covered_by: burn
        bandwidth_fee_sun: 345000
        bandwidth_price_sun: 1000
        energy_burned: 64285
        energy_consumed: 64285
        energy_fee_sun: 6428500
        total_fee_sun: 6773500
      properties:
        bandwidth_consumed:
          type: integer
          description: Bandwidth consumed, in bytes.
          example: 345
        bandwidth_price_sun:
          type: integer
          description: Sun per byte of bandwidth.
          example: 1000
        bandwidth_covered_by:
          type: string
          description: How bandwidth was paid.
          enum:
            - stake
            - free
            - burn
          example: burn
        bandwidth_fee_sun:
          type: integer
          description: >-
            TRX burned for bandwidth, in sun. `0` when stake or free quota
            covers it.
          example: 345000
        energy_consumed:
          type: integer
          description: Energy consumed.
          example: 64285
        energy_burned:
          type: integer
          description: Energy paid by burning TRX.
          example: 64285
        energy_fee_sun:
          type: integer
          description: Energy fee, in sun.
          example: 6428500
        total_fee_sun:
          type: integer
          description: Total estimated TRX burned, in sun.
          example: 6773500
    EmulateTronStakeLedgerChange:
      type: object
      description: Before/after diff of one Stake 2.0 scalar field, in sun.
      properties:
        address:
          type: string
          description: TRON base58 address.
          example: TUAEpR16Th4pLbjECPVYTgvPyStNKyB54h
        field:
          type: string
          description: >-
            Stake 2.0 scalar that changed. Examples: `"delegated_energy"`,
            `"frozen_v2_energy"`, `"acquired_energy"`.
          example: delegated_energy
        begin_value:
          type: string
          description: Value before, in sun.
          example: '784127000000'
        delta_value:
          type: string
          description: Change, in sun.
          example: '1'
        end_value:
          type: string
          description: Value after, in sun.
          example: '784127000001'
    EmulateTronResourceCapacityChange:
      type: object
      description: How one address's usable ENERGY or BANDWIDTH limit moved.
      properties:
        address:
          type: string
          description: TRON base58 address.
          example: THSt2MxFt7hs68dbxiffcAiySjHbW8Hnqx
        resource:
          type: string
          description: '`"ENERGY"` or `"BANDWIDTH"`.'
          enum:
            - ENERGY
            - BANDWIDTH
          example: ENERGY
        begin_capacity:
          type: string
          description: Usable resource limit before.
          example: '131016'
        end_capacity:
          type: string
          description: Usable resource limit after.
          example: '131016'
        delta_capacity:
          type: string
          description: Change in usable resource limit.
          example: '0'
        begin_staked_sun:
          type: string
          description: Sun staked for this resource before.
          example: '13713000000'
        end_staked_sun:
          type: string
          description: Sun staked for this resource after.
          example: '13713000001'
        delta_staked_sun:
          type: string
          description: Change in sun staked for this resource.
          example: '1'
    EmulateTronResourceCapacityConversion:
      type: object
      description: >-
        Network totals used to convert staked sun into ENERGY / BANDWIDTH
        capacity.
      example:
        total_energy_limit: '180000000000'
        total_energy_weight: '18839888284'
        total_net_limit: '43200000000'
        total_net_weight: '26895688125'
      properties:
        total_energy_limit:
          type: string
          description: Network ENERGY capacity pool.
          example: '180000000000'
        total_energy_weight:
          type: string
          description: Network ENERGY stake weight, in sun.
          example: '18839888284'
        total_net_limit:
          type: string
          description: Network BANDWIDTH (net) capacity pool.
          example: '43200000000'
        total_net_weight:
          type: string
          description: Network BANDWIDTH stake weight, in sun.
          example: '26895688125'
    EmulateBalanceChangeItem:
      type: object
      properties:
        address:
          type: string
        amount_change:
          type: string
          description: >-
            Balance change in token units, normalized by the token's decimals
            (`divisor`). For an 18-decimal token, `delta_value`
            `"1000000000000000000"` is the equivalent of `amount_change` `"1"`.
            Negative means the address sent tokens. Use this for display;
            `delta_value` is the same change in raw smallest units.
        begin_value:
          type: string
          description: Balance before, raw smallest-unit decimal string.
        delta_value:
          type: string
          description: Change, raw smallest-unit decimal string.
        end_value:
          type: string
          description: Balance after, raw smallest-unit decimal string.
        value_usd:
          type: string
          description: >-
            The dollar amount changed, calculated as `amount_change ×
            tokenPriceUSD`.
    EmulateApproveChangeItem:
      type: object
      properties:
        approver_address:
          type: string
          description: Token owner who granted the allowance.
          example: '0xd920d10d29ea69f91859af3c495f25f7e7acd953'
        spender_address:
          type: string
          description: Address allowed to spend.
          example: '0x25838042b96ab88ef3f6d9d6431a268550d5c78f'
        approve_amount:
          type: string
          description: >-
            Amount in the `approve()` calldata, raw smallest units. Not divided
            by decimals. May differ from `end_value` (the on-chain allowance
            after the tx).
          example: >-
            1157920892373161954235709850000000000000000000000000000000000000000000
        begin_value:
          type: string
          description: Allowance before the transaction, raw smallest units.
          example: '0'
        end_value:
          type: string
          description: Allowance after the transaction, raw smallest units.
          example: >-
            115792089237316195423570985008687907853269984665640564039457584007913129639935
        delta_value:
          type: string
          description: '`end_value − begin_value`, raw smallest units.'
          example: >-
            115792089237316195423570985008687907853269984665640564039457584007913129639935
        value_usd:
          type: string
          description: >-
            USD value of the post-approval allowance: `(end_value / 10^divisor ×
            tokenPriceUSD)`. `"0"` when no price is available. Not the USD value
            of `delta_value`.
          example: '0'
  responses:
    BadRequest:
      description: >-
        Bad request — malformed or missing field, unsupported chain, or invalid
        address.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CurrentServiceError'
          examples:
            Invalid request:
              summary: Malformed or missing field
              value:
                code: '-1'
                status: invalid request
                detail: …
            Unsupported chain:
              summary: Chain not enabled for this endpoint
              value:
                code: '-1'
                status: unsupported chain
                detail: 'unsupported chainId: 137'
            Invalid address:
              summary: Address fails the format check for that chain
              value:
                code: '-1'
                status: invalid address
                detail: …
    Unauthorized:
      description: >-
        Missing or invalid `X-API-KEY`. This is the response customers see on
        current-service endpoints.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/MissingAPIKeyErrorResponse'
          examples:
            Missing API key:
              summary: Missing or invalid API key
              value:
                code: '401'
                status: Missing API key
                detail: Missing API key
    UnprocessableEntity:
      description: Schema validation failed. `detail` names the failing field path.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CurrentServiceError'
          examples:
            Field required:
              summary: Schema validation
              value:
                code: '-1'
                status: invalid request
                detail: 'chainId: field required'
            Field path:
              summary: detail names the failing field path
              value:
                code: '-1'
                status: invalid request
                detail: evm_transactions[0].from
    RateLimitExceeded:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/RateLimitExceededErrorResponse'
          examples:
            Rate limit exceeded:
              summary: Rate limit exceeded error
              value:
                code: '429'
                status: error
                message: Rate limit exceeded
    InternalServerError:
      description: Server-side failure
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CurrentServiceError'
          examples:
            Internal server error:
              summary: Internal server error
              value:
                code: '-2'
                status: internal server error
                detail: internal server error
    BadGateway:
      description: Upstream analysis service failed. Simulation endpoints only.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CurrentServiceError'
          examples:
            Bad gateway:
              summary: Upstream failure
              value:
                code: '-2'
                status: bad gateway
                detail: …
    GatewayTimeout:
      description: Upstream timed out. Simulation endpoints only.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/CurrentServiceError'
          examples:
            Gateway timeout:
              summary: Upstream timeout
              value:
                code: '-2'
                status: gateway timeout
                detail: upstream service timed out

````