Transactions

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_amountboolean

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_priceboolean

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_priceboolean

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

Request body

senderstring hex required

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.

sequence_numberstring uint64 required

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.

max_gas_amountstring uint64 required

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.

gas_unit_pricestring uint64 required

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.

expiration_timestamp_secsstring uint64 required

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.

signatureTransactionSignature required— unresolved $ref

Response

versionstring uint64 required

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.

hashstring required
state_change_hashstring required
event_root_hashstring required
state_checkpoint_hashstring
gas_usedstring uint64 required

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.

successboolean required

Whether the transaction was successful

vm_statusstring required

The VM status of the transaction, can tell useful information in a failure

accumulator_root_hashstring required
senderstring hex required

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.

sequence_numberstring uint64 required

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.

max_gas_amountstring uint64 required

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.

gas_unit_pricestring uint64 required

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.

expiration_timestamp_secsstring uint64 required

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.

signatureTransactionSignature — unresolved $ref
timestampstring uint64 required

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.

Changes