Skip to main content

Simulate transaction

POST

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:
    To use this endpoint in BCS format, you must submit a signed transaction encoded in BCS.
    Path Parameters
    chainstringrequired
    Parameter specifying the target chain to query.
    networkstringrequired
    Parameter specifying the network of the target chain.
    Query Parameters
    estimate_gas_priceboolean
    When set to True, the transaction's gas unit price is ignored and the estimated value is used.
    estimate_max_gasboolean
    When set to True, the transaction's max gas amount is ignored and the estimated value is used.
    estimate_prioritized_gas_uint_priceboolean
    When set to True, the transaction is executed at a higher price than the estimate.
    Responses
    typestringrequired
    The type of the transaction
    hashstringrequired
    A field representing the unique identifier of the transaction, provided as a 64-character hexadecimal string starting with 0x.
    senderstringrequired
    A field representing the address of the account that sent the transaction.When expressed as a string, it is displayed as a 64-character hexadecimal string, and may be abbreviated by omitting leading zeros and adding 0x.
    sequence_numberstringrequired
    A field representing the transaction occurrence order.Represents a 64-bit unsigned integer as a string.
    max_gas_amountstringrequired
    A field representing the maximum amount of gas to use when the transaction occurs.Represents a 64-bit unsigned integer as a string.
    gas_unit_pricestringrequired
    A field representing the gas price to use when the transaction occurs.Represents a 64-bit unsigned integer as a string.
    expiration_timestamp_secsstringrequired
    A field representing the transaction expiration time.Represents a 64-bit unsigned integer as a string.
    payloadoneOfrequired
    Payload that executes a single Entry Function
    typestringrequired
    The type of the payload
    functionstringrequired
    String representation of the Entry Function identifier defined on-chain.
    type_argumentsarrayrequired
    Field representing the generic type arguments of the Entry function.
    argumentsarrayrequired
    Field representing the arguments of the Entry function.
    signatureoneOf
    Represents a single Ed25519 signature.
    typestringrequired
    The type of the signature
    public_keystringrequired
    All byte (Vec) data is expressed as a hex-encoded string starting with 0x, with two hex digits per byte.Unlike the Address type, HexEncodedBytes does not omit any zeros.
    signaturestringrequired
    All byte (Vec) data is expressed as a hex-encoded string starting with 0x, with two hex digits per byte.Unlike the Address type, HexEncodedBytes does not omit any zeros.
    replay_protection_noncestring
    A field representing the nonce used to prevent transaction replay attacks.Represents a 64-bit unsigned integer as a string.
    codestringrequired
    Code identifying the cause of the failed request.
    messagestringrequired
    Detailed message including the name and value of the invalid parameter.
    {
    "code": "ERROR_CODE",
    "message": "Bad Request"
    }
    cURL
    curl -X POST 'https://aptos-mainnet.nodit.io/v1/transactions/simulate' \
    -H 'Content-Type: application/json' \
    -H 'X-API-KEY: nodit-demo' \
    -d '{}'