SimulateTransaction
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
required
Transaction, as an encoded string
object
optional
Configuration object containing the following fields:
commitment string
optional\
- Default:
finalized
- Commitment level to simulate the transaction at
sigVerify bool
optional\
- If
true
, transaction signatures will be verified - Conflicts with
replaceRecentBlockhash
replaceRecentBlockhash bool
optional\
- If
true
, replaces the transaction’s recent blockhash with the most recent blockhash - Conflicts with
sigVerify
minContextSlot number
optional\
- Minimum slot that the request can be evaluated at
encoding string
optional\
- Default:
base58
- Encoding used for transaction data
Allowed Encoding Values:
base58
(slow, DEPRECATED)base64
innerInstructions bool
optional\
- If
true
, response will include inner instructions - Inner instructions will be
jsonParsed
where possible
accounts 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:
Code Sample
Response
Result Details
The result is an RpcResponse JSON object with value
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