simulateTransaction RPC Method
Description
Simulate sending a transaction.
Parameters
transaction
(string) - The transaction as an encoded string. The transaction must have a valid blockhash, but is not required to be signedobject
(array) - The configuration object with the following fields:commitment
(string) - (default: finalized) The level of commitment required for the query. The options include:finalized
- The node will query the most recent block confirmed by the supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalizedconfirmed
- The node will query the most recent block that has been voted on by the supermajority of the clusterprocessed
- The node will query its most recent block. Note that the block may not be complete
sigVerify
(boolean) - (default: false) If true, the transaction signatures will be verified (conflicts with replaceRecentBlockhash)replaceRecentBlockhash
(boolean) - (default: false) If true, the transaction recent blockhash will be replaced with the most recent blockhash (conflicts with sigVerify)encoding
(string) - (default: base58) The encoding format for account data. It can be either base58 (slow, DEPRECATED) or base64minContextSlot
(integer, optional) - The minimum slot at which the request can be evaluatedinnerInstructions
(boolean) - (default: false) If true the response will include inner instructions. These inner instructions will be jsonParsed where possible, otherwise json.accounts
(object, optional) - The accounts configuration object containing the following fields:addresses
(string, optional) - An array of accounts to return, as base-58 encoded stringsencoding
(string) - The encoding format for account data. It can be one of base58 (slow), base64, base64+zstd or jsonParsed
Returns
Returns null if the account doesn't exist, otherwise an RpcResponse JSON object with the following fields:
context
- An object that contains metadata about the current state of the Solana network at the time the request was processedapiVersion
- The version numberslot
- The current slot in the Solana cluster during which the transactions are processed and new blocks are added to the blockchain
err
- Error code if the transaction failed or null if the transaction succeedslogs
- An array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)accounts
- An array of accounts with the same length as the accounts.addresses array in the requestnull
- If the account doesn't exist or if err is not nullobject
- otherwise, a JSON object containing:lamports
- The number of lamports assigned to this account as u64 (64-bit unsigned integer)owner
- The base-58 encoded Pubkey of the program this account has been assigned todata
- The data associated with the account, either as encoded binary data or JSON format{'program': 'state'}
, depending on encoding parameterexecutable
- A boolean indicating if the account contains a program (and is strictly read-only)rentEpoch
- The epoch at which this account will next owe rent, as u64 (64-bit unsigned integer)
unitsConsumed
- The number of compute budget units consumed during the processing of this transactionreturnData
- The most-recent return data generated by an instruction in the transaction, with the following fields:programId
(string) - The program that generated the return data, as base-58 encoded Pubkeydata
- The return data itself, as base-64 encoded binary data
innerInstructions
- The value is a list of inner instructions.