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

curl https://rpc.testnet.soo.network/rpc \
-X POST \
-H "Content-Type: application/json" \
-d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "simulateTransaction",
  "params": [
    "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAED10jMAfX8Ue4203MSpqzrJiy6UblHKSjE2XgziZTOo9IYryKvnI8Ktte81tibEA/lHkHTZwblOqoWwCvc8dth4gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwI0timn1vUjmelkWIwKhw93lLnwOrAFFyq3LKby0SNoBAgIAAQwCAAAAAOQLVAIAAAA=",
    {
      "commitment": "finalized",
      "encoding": "base64",
      "innerInstructions": true,
      "accounts": {
        "addresses": ["FVP39NNZMKfEDzbg3BWWZEiYPH3wyFp5kmtuN3M2AZFo"],
        "encoding": "jsonParsed"
      }
    }
  ]
}'

Response

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.0.14",
      "slot": 406970
    },
    "value": {
      "accounts": [
        {
          "data": [
            "",
            "base64"
          ],
          "executable": false,
          "lamports": 20958674016,
          "owner": "11111111111111111111111111111111",
          "rentEpoch": 18446744073709551615,
          "space": 0
        }
      ],
      "err": null,
      "innerInstructions": [],
      "logs": [
        "Program 11111111111111111111111111111111 invoke [1]",
        "Program 11111111111111111111111111111111 success"
      ],
      "replacementBlockhash": null,
      "returnData": null,
      "unitsConsumed": 150
    }
  },
  "id": 1
}

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