simulateTransaction RPC Method
Simulate sending a transaction.Method Information
- The transaction must have a valid blockhash
- Not required to be signed
- Allows testing transaction execution without actually sending it to the network
Parameters
string requiredTransaction, as an encoded string
object optionalConfiguration object containing the following fields:commitment
string optional\- Default:
finalized - Commitment level to simulate the transaction at
bool optional\- If
true, transaction signatures will be verified - Conflicts with
replaceRecentBlockhash
bool optional\- If
true, replaces the transaction’s recent blockhash with the most recent blockhash - Conflicts with
sigVerify
number optional\- Minimum slot that the request can be evaluated at
string optional\- Default:
base58 - Encoding used for transaction data
base58(slow, DEPRECATED)base64
bool optional\- If
true, response will include inner instructions - Inner instructions will be
jsonParsedwhere possible
object optional\- Accounts configuration object
addresses: Array of accounts to return (base-58 encoded strings)encoding: Encoding for returned account data- Default:
base64 - Values:
base64,base58,base64+zstd,jsonParsed
- Default:
Result Details
The result is an RpcResponse JSON object withvalue containing:
-
context: <object>apiVersion: <string>- Version of the APIslot: <u64>- Slot at which the simulation was performed
-
value: <object>-
accounts: <array>- Requested account information- Each account contains:
data: Account dataexecutable: Whether account is executablelamports: Account balanceowner: Program owning the accountrentEpoch: Epoch for next rent paymentspace: Account data size
- Each account contains:
-
err: <object|null>- Transaction error details -
innerInstructions: <array>- Inner instructions (if any) -
logs: <array>- Program execution log messages -
replacementBlockhash: <string|null>- Replacement blockhash if applicable -
returnData: <object|null>- Return data from instructions -
unitsConsumed: <u64>- Compute units consumed
-
Important Notes
- Allows testing transaction execution without network submission
- Provides detailed insights into potential transaction outcomes
- Helpful for debugging and validating transactions before sending