Movement Labs LogoMovement Docs
Node API

Simulate transaction

The output of the transaction will have the exact transaction outputs and events that running an actual signed transaction would have. However, it will not have the associated state hashes, as they are not updated in storage. This can be used to estimate the maximum gas units for a submitted transaction.

To use this, you must:

  • Create a SignedTransaction with a zero-padded signature.
  • Submit a SubmitTransactionRequest containing a UserTransactionRequest containing that signature.

To use this endpoint with BCS, you must submit a SignedTransaction encoded as BCS. See SignedTransaction in types/src/transaction/mod.rs.

POST
/transactions/simulate

Query Parameters

estimate_max_gas_amount?boolean

If set to true, the max gas value in the transaction will be ignored and the maximum possible gas will be used

estimate_gas_unit_price?boolean

If set to true, the gas unit price in the transaction will be ignored and the estimated value will be used

estimate_prioritized_gas_unit_price?boolean

If set to true, the transaction will use a higher price than the original estimate.

senderAddress

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

Formathex
sequence_numberU64

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Formatuint64
max_gas_amountU64

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Formatuint64
gas_unit_priceU64

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Formatuint64
expiration_timestamp_secsU64

A string containing a 64-bit unsigned integer.

We represent u64 values as a string to ensure compatibility with languages such as JavaScript that do not parse u64s in JSON natively.

Formatuint64
payloadTransactionPayload

An enum of the possible transaction payloads

typestring
Value in"entry_function_payload"
functionEntryFunctionId

Entry function id is string representation of a entry function defined on-chain.

Format: {address}::{module name}::{function name}

Both module name and function name are case-sensitive.

type_argumentsarray<MoveType>

Type arguments of the function

argumentsarray<unknown>

Arguments of the function

typestring
Value in"script_payload"
codeMoveScriptBytecode

Move script bytecode

type_argumentsarray<MoveType>

Type arguments of the function

argumentsarray<unknown>

Arguments of the function

typestring
Value in"module_bundle_payload"
typestring
Value in"multisig_payload"
multisig_addressAddress

A hex encoded 32 byte Aptos account address.

This is represented in a string as a 64 character hex string, sometimes shortened by stripping leading 0s, and adding a 0x.

For example, address 0x0000000000000000000000000000000000000000000000000000000000000001 is represented as 0x1.

Formathex
transaction_payload?MultisigTransactionPayload
signatureTransactionSignature

An enum representing the different transaction signatures available

typestring
Value in"ed25519_signature"
public_keyHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
signatureHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"multi_ed25519_signature"
public_keysarray<HexEncodedBytes>

The public keys for the Ed25519 signature

signaturesarray<HexEncodedBytes>

Signature associated with the public keys in the same order

thresholdinteger

The number of signatures required for a successful transaction

Formatuint8
bitmapHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"multi_agent_signature"
senderAccountSignature

Account signature scheme

The account signature scheme allows you to have two types of accounts:

  1. A single Ed25519 key account, one private key
  2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.
  3. A single Secp256k1Ecdsa key account, one private key
typestring
Value in"ed25519_signature"
public_keyHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
signatureHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"multi_ed25519_signature"
public_keysarray<HexEncodedBytes>

The public keys for the Ed25519 signature

signaturesarray<HexEncodedBytes>

Signature associated with the public keys in the same order

thresholdinteger

The number of signatures required for a successful transaction

Formatuint8
bitmapHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"single_key_signature"
public_keyPublicKey
typestring
Value in"ed25519"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"secp256k1_ecdsa"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"secp256r1_ecdsa"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"keyless"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"federated_keyless"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
signatureSignature
typestring
Value in"ed25519"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"secp256k1_ecdsa"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"web_authn"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"keyless"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"multi_key_signature"
public_keysarray<PublicKey>
signaturesarray<IndexedSignature>
signatures_requiredinteger
Formatuint8
typestring
Value in"no_account_signature"
secondary_signer_addressesarray<Address>

The other involved parties' addresses

secondary_signersarray<AccountSignature>

The associated signatures, in the same order as the secondary addresses

typestring
Value in"fee_payer_signature"
senderAccountSignature

Account signature scheme

The account signature scheme allows you to have two types of accounts:

  1. A single Ed25519 key account, one private key
  2. A k-of-n multi-Ed25519 key account, multiple private keys, such that k-of-n must sign a transaction.
  3. A single Secp256k1Ecdsa key account, one private key
typestring
Value in"ed25519_signature"
public_keyHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
signatureHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"multi_ed25519_signature"
public_keysarray<HexEncodedBytes>

The public keys for the Ed25519 signature

signaturesarray<HexEncodedBytes>

Signature associated with the public keys in the same order

thresholdinteger

The number of signatures required for a successful transaction

Formatuint8
bitmapHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"single_key_signature"
public_keyPublicKey
typestring
Value in"ed25519"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"secp256k1_ecdsa"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"secp256r1_ecdsa"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"keyless"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"federated_keyless"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
signatureSignature
typestring
Value in"ed25519"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"secp256k1_ecdsa"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"web_authn"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"keyless"
valueHexEncodedBytes

All bytes (Vec) data is represented as hex-encoded string prefixed with 0x and fulfilled with two hex digits per byte.

Unlike the Address type, HexEncodedBytes will not trim any zeros.

Formathex
typestring
Value in"multi_key_signature"
public_keysarray<PublicKey>
signaturesarray<IndexedSignature>
signatures_requiredinteger
Formatuint8
typestring
Value in"no_account_signature"
secondary_signer_addressesarray<Address>

The other involved parties' addresses

secondary_signersarray<AccountSignature>

The associated signatures, in the same order as the secondary addresses

fee_payer_addressAddress
fee_payer_signerAccountSignature

Empty Object

typestring
Value in"single_sender"

Response Body

curl -X POST "https://full.mainnet.movementinfra.xyz/v1/transactions/simulate?estimate_max_gas_amount=true&estimate_gas_unit_price=true&estimate_prioritized_gas_unit_price=true" \
  -H "Content-Type: application/json" \
  -d '{
    "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
    "sequence_number": "32425224034",
    "max_gas_amount": "32425224034",
    "gas_unit_price": "32425224034",
    "expiration_timestamp_secs": "32425224034",
    "payload": {
      "type": "entry_function_payload",
      "function": "0x1::aptos_coin::transfer",
      "type_arguments": [
        "string"
      ],
      "arguments": [
        null
      ]
    },
    "signature": {
      "type": "ed25519_signature",
      "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
      "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
    }
  }'
[
  {
    "version": "32425224034",
    "hash": "string",
    "state_change_hash": "string",
    "event_root_hash": "string",
    "state_checkpoint_hash": "string",
    "gas_used": "32425224034",
    "success": true,
    "vm_status": "string",
    "accumulator_root_hash": "string",
    "changes": [
      {
        "type": "delete_module",
        "address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
        "state_key_hash": "string",
        "module": "0x1::aptos_coin"
      }
    ],
    "sender": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
    "sequence_number": "32425224034",
    "max_gas_amount": "32425224034",
    "gas_unit_price": "32425224034",
    "expiration_timestamp_secs": "32425224034",
    "payload": {
      "type": "entry_function_payload",
      "function": "0x1::aptos_coin::transfer",
      "type_arguments": [
        "string"
      ],
      "arguments": [
        null
      ]
    },
    "signature": {
      "type": "ed25519_signature",
      "public_key": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 ",
      "signature": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
    },
    "events": [
      {
        "guid": {
          "creation_number": "32425224034",
          "account_address": "0x88fbd33f54e1126269769780feb24480428179f552e2313fbe571b72e62a1ca1 "
        },
        "sequence_number": "32425224034",
        "type": "string",
        "data": null
      }
    ],
    "timestamp": "32425224034"
  }
]
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}
{
  "message": "string",
  "error_code": "account_not_found",
  "vm_error_code": 0
}