Skip to main content
Simulates a transaction against the current cluster state and returns the result, including any program logs. The transaction is never submitted to the network.

Request

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "simulateTransaction",
  "params": [
    "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEEjNmKi...",
    { "encoding": "base64", "replaceRecentBlockhash": true }
  ]
}

Parameters

transaction
string
required
Signed or unsigned transaction, encoded as a base-58 or base-64 string.
encoding
string
Encoding of the transaction parameter. base58 or base64. Defaults to base58.
sigVerify
boolean
Whether to verify transaction signatures before simulating. Defaults to false. Cannot be used together with replaceRecentBlockhash.
commitment
string
Commitment level to use for the simulation. One of processed, confirmed, or finalized.
replaceRecentBlockhash
boolean
Replace the transaction’s recentBlockhash with the latest blockhash before simulating. Useful for simulating transactions without having to fetch a fresh blockhash first.

Response

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "context": { "slot": 393226680 },
    "value": {
      "err": null,
      "logs": [
        "Program 11111111111111111111111111111111 invoke [1]",
        "Program 11111111111111111111111111111111 success"
      ],
      "unitsConsumed": 1714,
      "returnData": null
    }
  }
}
value.err
object | null
null if the simulation succeeded. Contains the transaction error object if the simulation failed.
value.logs
string[]
Array of log messages produced by the programs invoked during the simulation.
value.unitsConsumed
number
Number of compute units consumed by the transaction.
value.returnData
object | null
Return data from the last program that set return data, or null.
value.accounts
array | null
Post-simulation account state, if requested via the accounts config option.

Example

curl "https://rpc.solami.fast/sol?api_key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "simulateTransaction",
    "params": [
      "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEEjNmKi...",
      { "encoding": "base64", "replaceRecentBlockhash": true }
    ]
  }'