Skip to main content

simulateTransaction

POST

Simulate sending a transaction
param[0]
transactionstringrequired
Transaction, as an encoded string.
param[1]
configurationObjectobjectrequired
commitmentstring
The commitment describes how finalized a block is at that point in time.
  • finalized - the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
  • confirmed - the node will query the most recent block that has been voted on by supermajority of the cluster.
  • processed - the node will query its most recent block. Note that the block may still be skipped by the cluster.
encodingstring
Encoding used for the transaction data. Values: base58 (slow, DEPRECATED), or base64.
replaceRecentBlockhashboolean
If true the transaction recent blockhash will be replaced with the most recent blockhash (conflicts with sigVerify)
sigVerifyboolean
If true the transaction signatures will be verified (conflicts with replaceRecentBlockhash)
minContextSlotstring
The minimum slot that the request can be evaluated at.
innerInstructionsboolean
If true the response will include inner instructions. These inner instructions will be jsonParsed where possible, otherwise json.
accountsarray
addressesstring
An array of accounts to return, as base-58 encoded strings
encodingstring
Encoding for returned Account data. Note: jsonParsed encoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. If jsonParsed is requested but a parser cannot be found, the field falls back to base64 encoding, detectable when the returned accounts.data field is type string.
Responses
idinteger
The request ID
jsonrpcstring
The JSON-RPC version
An object containing metadata about the current state of the Solana network at the time of the request.
apiVersionstring
The API version used for the request
slotinteger
The slot number at which the request was evaluated
dataarray
Data associated with the account, either as encoded binary data or JSON format {<program>: <state>} - depending on encoding parameter
executableboolean
Boolean indicating if the account contains a program (and is strictly read-only)
lamportsinteger
Number of lamports assigned to this account
ownerstring
Base-58 encoded Pubkey of the program this account has been assigned to
rentEpochinteger
The epoch at which this account will next owe rent
spaceinteger
The data size of the account
errobject
Error if transaction failed, null if transaction succeeded.
Defined only if innerInstructions was set to true. The value is a list of inner instructions.
indexnumber
Index of the transaction instruction from which the inner instruction(s) originated
instructionsarray
Ordered list of inner program instructions that were invoked during a single transaction instruction.
programIdIndexnumber
Index into the message.accountKeys array indicating the program account that executes this instruction.
accountsarray
List of ordered indices into the message.accountKeys array indicating which accounts to pass to the program.
datastring
The program input data encoded in a base-58 string.
loadedAccountsDataSizeinteger
The number of bytes of all accounts loaded by this transaction
logsarray
Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute
blockhashstring
The blockhash of the block, as base-58 encoded string
lastValidBlockHeightinteger
The last valid block height at which the blockhash is still valid.
The most-recent return data generated by an instruction in the transaction
programIdstring
the program that generated the return data, as base-58 encoded Pubkey
datastring
the return data itself, as base-64 encoded binary data
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://solana-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "simulateTransaction",
"params": [
"AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEEjNmKiZGiOtSZ+g0//wH5kEQo3+UzictY+KlLV8hjXcs44M/Xnr+1SlZsqS6cFMQc46yj9PIsxqkycxJmXT+veJjIvefX4nhY9rY+B5qreeqTHu4mG6Xtxr5udn4MN8PnBt324e51j94YQl285GzN2rYa/E2DuQ0n/r35KNihi/zamQ6EeyeeVDvPVgUO2W3Lgt9hT+CfyqHvIa11egFPCgEDAwIBAAkDZAAAAAAAAAA=",
{
"commitment": "confirmed",
"encoding": "base64",
"replaceRecentBlockhash": true
}
]
}'