Skip to main content

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

Code Sample

Response

Result Details

The result is an RpcResponse JSON object with value containing:
  • context: <object>
    • apiVersion: <string> - Version of the API
    • slot: <u64> - Slot at which the simulation was performed
  • value: <object>
    • accounts: <array> - Requested account information
      • Each account contains:
        • data: Account data
        • executable: Whether account is executable
        • lamports: Account balance
        • owner: Program owning the account
        • rentEpoch: Epoch for next rent payment
        • space: Account data size
    • 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