Skip to main content

Simulate transaction

POST 

/transactions/simulate

API that simulates a transaction without actually executing it.

The simulation result includes the same transaction output and events as when executing an actual signed transaction. However, the state hash is not included because storage is not updated. You can use this API to estimate the maximum gas amount required when submitting a transaction.

How to use:

  • Create a transaction with zero-padded signatures.
  • Submit the created transaction to this API.

To use this endpoint in BCS format, you must submit a signed transaction encoded in BCS.

Request

Responses

Successful Response

Response Headers
    X-APTOS-BLOCK-HEIGHT

    Current block height of the chain

    X-APTOS-CHAIN-ID

    Chain ID of the current chain

    X-APTOS-EPOCH

    Current epoch of the chain

    X-APTOS-LEDGER-OLDEST-VERSION

    Oldest unpruned ledger version of the chain

    X-APTOS-LEDGER-TIMESTAMPUSEC

    Current timestamp of the chain

    X-APTOS-LEDGER-VERSION

    Current ledger version of the chain

    X-APTOS-OLDEST-BLOCK-HEIGHT

    Oldest unpruned block height of the chain

    X-APTOS-CURSOR

    Cursor for the next page

    X-APTOS-GAS-USED

    Amount of gas actually used for transaction execution