# sui_dryRunTransactionBlock

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://sui-mainnet.g.alchemy.com/v2/{apiKey}

Executes a transaction in dry-run mode, which simulates transaction execution and returns expected effects, gas cost summary, object changes, and events — without actually committing to chain.


Reference: https://www.alchemy.com/docs/chains/sui/sui-api-endpoints/sui-dry-run-transaction-block

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| tx_bytes | string | Yes | Base64-encoded BCS `TransactionKind`. |

## Result

**result** (object): Simulated result of executing the transaction.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "sui_dryRunTransactionBlock",
  "params": [
    "AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA="
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "digest": "DNtx7EmGqSywGbnSC1CKoqmBFEXGvApXpRVt6bU855xP",
    "effects": {
      "messageVersion": "v1",
      "status": {
        "status": "success"
      },
      "executedEpoch": "0",
      "gasUsed": {
        "computationCost": "100",
        "storageCost": "100",
        "storageRebate": "10",
        "nonRefundableStorageFee": "0"
      },
      "transactionDigest": "8UExPV121BEfWkbymSPDYhh23rVNh3MSWtC5juJ9JGMJ",
      "mutated": [
        {
          "owner": {
            "AddressOwner": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576"
          },
          "reference": {
            "objectId": "0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84",
            "version": 2,
            "digest": "EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt"
          }
        },
        {
          "owner": {
            "AddressOwner": "0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80"
          },
          "reference": {
            "objectId": "0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc",
            "version": 2,
            "digest": "Cv7n2YaM7Am1ssZGu4khsFkcKHnpgVhwFCSs4kLjrtLW"
          }
        }
      ],
      "gasObject": {
        "owner": {
          "ObjectOwner": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576"
        },
        "reference": {
          "objectId": "0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84",
          "version": 2,
          "digest": "EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt"
        }
      },
      "eventsDigest": "55TNn3v5vpuXjQfjqamw76P9GZD522pumo4NuT7RYeFB"
    },
    "objectChanges": [
      {
        "type": "transferred",
        "sender": "0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576",
        "recipient": {
          "AddressOwner": "0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80"
        },
        "objectType": "0x2::example::Object",
        "objectId": "0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc",
        "version": "2",
        "digest": "B3xLC8EbyvTxy5pgiwTNUzHLa6kS7uwD6sZdErKB8F8f"
      }
    ],
    "events": []
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://sui-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "sui_dryRunTransactionBlock",
  "params": [
    "AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA="
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'sui_dryRunTransactionBlock',
    params: [
      'AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA='
    ]
  })
};

fetch('https://sui-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "sui_dryRunTransactionBlock",
    "params": ["AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA="]
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://sui-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"sui_dryRunTransactionBlock\",\n  \"params\": [\n    \"AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA=\"\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://sui-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"sui_dryRunTransactionBlock\",\n  \"params\": [\n    \"AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA=\"\n  ]\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://sui-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"sui_dryRunTransactionBlock\",\n  \"params\": [\n    \"AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA=\"\n  ]\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: sui_dryRunTransactionBlock
summary: Simulate execution of a transaction without committing it
description: |
  Executes a transaction in dry-run mode, which simulates transaction execution and returns expected effects, gas cost summary, object changes, and events — without actually committing to chain.
params:
  - name: tx_bytes
    required: true
    description: Base64-encoded BCS `TransactionKind`.
    schema:
      type: string
result:
  name: result
  description: Simulated result of executing the transaction.
  schema:
    type: object
    properties:
      digest:
        type: string
        description: The digest of the simulated transaction.
      transaction:
        type: object
        description: Full transaction object with data and signatures.
      rawTransaction:
        type: string
        description: Base64-encoded raw transaction blob.
      effects:
        type: object
        description: The transaction effects as they would occur on-chain.
        properties:
          messageVersion:
            type: string
          status:
            type: object
            properties:
              status:
                type: string
          executedEpoch:
            type: string
          gasUsed:
            type: object
            properties:
              computationCost:
                type: string
              storageCost:
                type: string
              storageRebate:
                type: string
              nonRefundableStorageFee:
                type: string
          transactionDigest:
            type: string
          mutated:
            type: array
            items:
              type: object
              properties:
                owner:
                  type: object
                  properties:
                    AddressOwner:
                      type: string
                reference:
                  type: object
                  properties:
                    objectId:
                      type: string
                    version:
                      type: integer
                    digest:
                      type: string
          gasObject:
            type: object
            properties:
              owner:
                type: object
                properties:
                  ObjectOwner:
                    type: string
              reference:
                type: object
                properties:
                  objectId:
                    type: string
                  version:
                    type: integer
                  digest:
                    type: string
          eventsDigest:
            type: string
      balanceChanges:
        type: array
        description: List of balance changes resulting from the simulation.
        items:
          type: object
      objectChanges:
        type: array
        description: List of object-level changes that would occur.
        items:
          type: object
      events:
        type: array
        description: Events that would be emitted during execution.
        items:
          type: object
examples:
  - name: Dry run example transaction
    params:
      - name: tx_bytes
        value: AAPDdSGd1K6HApnQ1UMmEIOXvtBFDAEFAAAAAAAAADDat41YRxp4SW63HCxud7omjwOQOg6huYDqcvdFeE95OGaVEnTPlWWtjAYAAAAAACBCRYDRhl1WPPDl5P0n7fK6uWgf/Leb4oRS1KAESZ/KmwEAAAAAAAAAAQAAAAAAAAA=
    result:
      name: result
      value:
        digest: DNtx7EmGqSywGbnSC1CKoqmBFEXGvApXpRVt6bU855xP
        effects:
          messageVersion: v1
          status:
            status: success
          executedEpoch: '0'
          gasUsed:
            computationCost: '100'
            storageCost: '100'
            storageRebate: '10'
            nonRefundableStorageFee: '0'
          transactionDigest: 8UExPV121BEfWkbymSPDYhh23rVNh3MSWtC5juJ9JGMJ
          mutated:
            - owner:
                AddressOwner: '0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576'
              reference:
                objectId: '0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84'
                version: 2
                digest: EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt
            - owner:
                AddressOwner: '0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80'
              reference:
                objectId: '0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc'
                version: 2
                digest: Cv7n2YaM7Am1ssZGu4khsFkcKHnpgVhwFCSs4kLjrtLW
          gasObject:
            owner:
              ObjectOwner: '0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576'
            reference:
              objectId: '0xe8d8c7ce863f313da3dbd92a83ef26d128b88fe66bf26e0e0d09cdaf727d1d84'
              version: 2
              digest: EnRQXe1hDGAJCFyF2ds2GmPHdvf9V6yxf24LisEsDkYt
          eventsDigest: 55TNn3v5vpuXjQfjqamw76P9GZD522pumo4NuT7RYeFB
        objectChanges:
          - type: transferred
            sender: '0x61fbb5b4f342a40bdbf87fe4a946b9e38d18cf8ffc7b0000b975175c7b6a9576'
            recipient:
              AddressOwner: '0x7ba91ddc7e717cf708c937060f04048736ec33fb1746d999a5e58cd5c677ed80'
            objectType: 0x2::example::Object
            objectId: '0x4f82f1c8587b98d64c00bfb46c3843bd8bf6ccfa7c65a86138698cd1fdcac3dc'
            version: '2'
            digest: B3xLC8EbyvTxy5pgiwTNUzHLa6kS7uwD6sZdErKB8F8f
        events: []
```
