Skip to main content


Submit a trial contract invocation to get back return values, expected ledger footprint, and expected costs.


  • <xdr.TransactionEnvelope> - The transaction to be simulated (serialized in base64)


  • <object>
    • cost: <object> - Information about the fees expected, instructions used, etc.
      • cpuInsns: <string> - Stringified-number of the total cpu instructions consumed by this transaction
      • memBytes: <string> - Stringified-number of the total memory bytes allocated by this transaction
    • footprint: <xdr.LedgerFootprint> -Array of ledger keys expected to be written by this transaction. (serialized in base64)
    • results: <object[]> - If error is present then results will not be in the response
      • xdr: <xdr.ScVal> - (optional) Only present on success. xdr-encoded return value of the contract call
    • latestLedger: <string> - Stringified-number of the current latest ledger observed by the node when this response was generated.
    • error: <string> - (optional) only present if the transaction failed. This field will include more details from stellar-core about why the invoke host function call failed.


The example transaction below invokes the increment function from the increment example contract.


"jsonrpc": "2.0",
"id": 8675309,
"method": "simulateTransaction",
"params": {


"jsonrpc": "2.0",
"id": 8675309,
"result": {
"results": [
"cost": {
"cpuInsns": "163642",
"memBytes": "1506"
"latestLedger": "230473"