> ## Documentation Index
> Fetch the complete documentation index at: https://docs.uniblock.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# simulateTransaction

> Simulate sending a transaction.

### Parameters

<ParamField query="chainId" type="string" default="solana-devnet" required>
  Unique identifier for a blockchain network.
</ParamField>

<ParamField body="id" type="number" default={1} required>
  Request identifier used to match responses.
</ParamField>

<ParamField body="jsonrpc" type="string" default="2.0" required>
  JSON-RPC version.
</ParamField>

<ParamField body="method" type="string" default="simulateTransaction" required>
  JSON-RPC method name.
</ParamField>

<ParamField body="params" type="object" default={["AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=",{"encoding":"base64"}]} placeholder="[&#x22;AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=&#x22;,{&#x22;encoding&#x22;:&#x22;base64&#x22;}]" required>
  Parameters for method simulateTransaction: \[transaction, config]

  Positional parameters for <code>simulateTransaction</code>:

  <ul>
    <li><code>params\[0]</code>: Transaction as an encoded string (base58 or base64 depending on config). The transaction must have a valid blockhash but is not required to be signed.</li>
    <li><code>params\[1]</code>: Optional configuration object.</li>
  </ul>
</ParamField>

### Returns

<ResponseField name="result" type="object">
  Simulated transaction execution result.

  <Expandable title="properties">
    <ResponseField name="err" type="oneOf">
      Error if transaction failed, null if transaction succeeded.

      <Expandable title="variants">
        <ResponseField name="variant1" type="string" />

        <ResponseField name="variant2" type="object" />

        <ResponseField name="variant3" type="object" />
      </Expandable>
    </ResponseField>

    <ResponseField name="logs" type="array">
      Array of log messages output during execution or null if simulation failed before execution.

      <Expandable title="items">
        <ResponseField name="items[]" type="string" />
      </Expandable>
    </ResponseField>

    <ResponseField name="accounts" type="array">
      Array of accounts corresponding to the requested addresses.

      <Expandable title="items">
        <ResponseField name="items[]" type="oneOf">
          <Expandable title="variants">
            <ResponseField name="variant1" type="object" />

            <ResponseField name="variant2" type="object">
              <Expandable title="properties">
                <ResponseField name="lamports" type="integer" />

                <ResponseField name="owner" type="string" />

                <ResponseField name="data" type="oneOf">
                  \[data, encoding]

                  <Expandable title="variants">
                    <ResponseField name="variant1" type="array">
                      \[data, encoding]

                      <Expandable title="items">
                        <ResponseField name="items[]" type="string" />
                      </Expandable>
                    </ResponseField>

                    <ResponseField name="variant2" type="object" />
                  </Expandable>
                </ResponseField>

                <ResponseField name="executable" type="boolean" />

                <ResponseField name="rentEpoch" type="integer" />
              </Expandable>
            </ResponseField>
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="unitsConsumed" type="integer">
      The number of compute units consumed during transaction processing.
    </ResponseField>

    <ResponseField name="returnData" type="object">
      The most recent return data generated by an instruction in the transaction.

      <Expandable title="properties">
        <ResponseField name="programId" type="string">
          Pubkey of the program that generated the return data.
        </ResponseField>

        <ResponseField name="data" type="array">
          \[data, encoding] pair.

          <Expandable title="items">
            <ResponseField name="items[]" type="string" />
          </Expandable>
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="innerInstructions" type="object">
      Inner instructions from the transaction if innerInstructions option was enabled.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Curl theme={null}
  curl --request POST \
    --url https://api.uniblock.dev/uni/v1/json-rpc?chainId=solana-devnet \
    --header 'content-type: application/json' \
    --data '{
      "id": 1,
      "jsonrpc": "2.0",
      "method": "simulateTransaction",
      "params": [
        "AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEDArczbMia1tLmq7zz4DinMNN0pJ1JtLdqIJPUw3YrGCzYAMHBsgN27lcgB6H2WQvFgyZuJYHa46puOQo9yQ8CVQbd9uHXZaGT2cvhRs7reawctIXtX1s3kTqM9YV+/wCp20C7Wj2aiuk5TReAXo+VTVg8QTHjs0UjNMMKCvpzZ+ABAgEBARU=",
        {
          "encoding": "base64"
        }
      ]
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
      "context": {
        "slot": 218
      },
      "value": {
        "err": null,
        "accounts": null,
        "logs": [
          "Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri invoke [1]",
          "Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri consumed 2366 of 1400000 compute units",
          "Program return: 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri KgAAAAAAAAA=",
          "Program 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri success"
        ],
        "returnData": {
          "data": [
            "..."
          ],
          "programId": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
        },
        "unitsConsumed": 2366
      }
    }
  }
  ```
</ResponseExample>
