Submit a trial contract invocation to simulate how it would be executed by the network. This endpoint calculates the effective transaction data, required authorizations, and minimal resource fee. It provides a way to test and analyze the potential outcomes of a transaction without actually submitting it to the network.

This method will use 10 Compute Units.

Reference: Here


  • transaction (string)(required) The transaction to be simulated (serialized in base64)


  • minResourceFee string (optional) - Stringified number - Recommended minimum resource fee to add when submitting the transaction. This fee is to be added on top of the Stellar network fee. Not present in case of error.

  • cost object (optional) - Information about instructions used, etc. Not present in case of error.

  • results array[object] (optional) - This array will only have one element: the result for the Host Function invocation. Only present on successful simulation (i.e. no error) of InvokeHostFunction operations.

  • transactionData string (optional) - Serialized base64 string - The recommended Soroban Transaction Data to use when submitting the simulated transaction. This data contains the refundable fee and resource usage information such as the ledger footprint and IO access data (serialized in a base64 string). Not present in case of error.

  • events array (optional) - Array of serialized base64 strings - Array of the events emitted during the contract invocation. The events are ordered by their emission time. (an array of serialized base64 strings). Only present when simulating of InvokeHostFunction operations, note that it can be present on error, providing extra context about what failed.

  • restorePreamble (object) (optional) - It can only be present on sucessful simulation (i.e. no error) of InvokeHostFunction operations. If present, it indicates that the simulation detected expired ledger entries which need to be restored before the submission of the InvokeHostFunction operation. The minResourceFee and transactionData fields should be used to submit a transaction containing a RestoreFootprint operation

  • latestLedger (string) - A Stringified number - Current latest closed ledger (LCL) observed by the node when this response was generated. Always present.

  • error string (optional) - This field will include details about why the invoke host function call failed. Only present if the transaction simulation failed.

// Result
  "jsonrpc": "2.0",
  "id": 1102,
  "result": {
    "events": [
    "minResourceFee": "79488",
    "results": [
        "auth": [
        "xdr": "AAAAEwAAAAAAAAAAYvwdC9CRsrYcDdZWNGsqaNfTR8bywsjubQRHAlb8Bfc="
    "cost": {
      "cpuInsns": "2222468",
      "memBytes": "2204681"
    "latestLedger": "23456"
    -X POST \
    -H "Content-Type: application/json" \
    -d '{
  "jsonrpc": "2.0",
  "id": 8675309,
  "method": "simulateTransaction",
  "params": {

Last updated