Skip to main content

/v1/transactions/simulate REST API Endpoint

Allows users to simulate a transaction on the FullNode DevNet platform, providing transaction details in the request body and receiving a response with the simulation result, offering insights into the potential outcome of the transaction.

Updated on
Oct 4, 2023

/v1/transactions/simulate REST API Endpoint

Query Parameters

estimate_gas_unit_price
boolean
If true, the estimated gas unit price will be used instead of the value specified in the transaction
estimate_max_gas_amount
boolean
If true, the maximum gas value specified in the transaction will be ignored, and the maximum possible gas will be used instead
estimate_prioritized_gas_unit_price
boolean
If true, the transaction will use a higher price than the original estimate
sender
string
REQUIRED
The account from which the transaction was sent
sequence_number
string
REQUIRED
The sequence of a transaction sent by the specific sender
max_gas_amount
string
REQUIRED
The maximum amount of gas allocated for the execution of a transaction
gas_unit_price
string
REQUIRED
The cost per unit of gas, determining the transaction fee paid by the sender for each unit of computational resource consumed
expiration_timestamp_secs
string
REQUIRED
The timestamp indicating the expiration period of a transaction, specifying the time until which the transaction can be included in a block
payload
object
REQUIRED
The data that is being carried by a transaction. It contains the following fields:
type
string
The type of payload indicating the purpose of the data contained
function
string
The function associated with the payload
type_arguments
array
An array specifying the types of arguments provided to the function
arguments
array
An array containing the actual arguments passed to the function
signature
object
REQUIRED
An array with the following fields:
type
string
The type of signature used to verify the authenticity of the function
public_key
string
The public key associated with the account that generated the signature, used for verifying the signature's validity
signature
string
The actual signature generated using the private key corresponding to the public key provided

Returns

version
The version of the simulated transaction
hash
The hash value associated with the simulated transaction
state_change_hash
The hash value of the state change resulting from the simulated transaction
event_root_hash
The hash value of the event root generated by the simulated transaction
state_checkpoint_hash
The hash value of the state checkpoint associated with the simulated transaction
gas_used
The amount of gas used by the simulated transaction
success
It indicated whether the simulated transaction was success or not
vm_status
The virtual machine status of the simulated transaction
accumulator_root_hash
The hash value of the accumulator root associated with the simulated transaction
changes
An array that contains information about the state changes caused by the simulated transaction:
type
The type of change
address
The address associated with the change
state_key_hash
The hash value of the state key
module
The module associated with the change
sender
The sender's address for the simulated transaction
sequence_number
The sequence number of the simulated transaction
max_gas_amount
The maximum amount of gas allowed for the simulated transaction
gas_unit_price
The price per unit of gas for the simulated transaction
expiration_timestamp_secs
The expiration timestamp in seconds for the simulated transaction
payload
An array that contains information about the payload of the simulated transaction:
type
The type of payload
function
The function to be executed as part of the simulated transaction
type_arguments
An array that contains the type arguments associated with the function
arguments
An array that contains the arguments for the function, which may include null or actual values
signature
The signature details for the simulated transaction with the following fields:
type
The type of signature, such as an ed25519 signature
public_key
The public key associated with the simulated transaction
signature
The actual signature value
events
An array that contains information about the events generated by the simulated transaction:
guid
The GUID details for the event
creation_number
The creation number of the event
account_address
The account address associated with the event
sequence_number
The sequence number of the event
type
The type of event
data
The data associated with the event
timestamp
The timestamp associated with the simulated transaction
Request
1
curl --request POST \
2
--url https://docs-demo.aptos-mainnet.quiknode.pro/v1/transactions/simulate \
3
--header 'Accept: application/json, application/x-bcs' \
4
--header 'Content-Type: application/json' \
5
--data '{
6
"sender": "SENDER_ADDRESS",
7
"sequence_number": "SEQUENCE_NUMBER",
8
"max_gas_amount": "MAX_GAS_AMOUNT",
9
"gas_unit_price": "GAS_UNIT_PRICE",
10
"expiration_timestamp_secs": "EXPIRATION_TIMESTAMP_SECS",
11
"payload": {
12
"type": "PAYLOAD_TYPE",
13
"function": "FUNCTION",
14
"type_arguments": [
15
"string"
16
],
17
"arguments": [
18
null
19
]
20
},
21
"signature": {
22
"type": "SIGNATURE_TYPE",
23
"public_key": "PUBLIC_KEY",
24
"signature": "SIGNATURE"
25
}
26
}'
Don't have an account yet?
Create your QuickNode endpoint in seconds and start building
Get started for free