# sui_getTransactionBlock

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

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

Returns detailed information about a transaction block by digest, including input, effects, events, and timestamp.


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

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| digest | string | Yes | The digest of the queried transaction. |
| options | object | Yes | Options to control which fields are returned. |

## Result

**result** (object): The transaction block response.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "sui_getTransactionBlock",
  "params": [
    "2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG",
    {
      "showInput": true,
      "showRawInput": false,
      "showEffects": true,
      "showEvents": true,
      "showObjectChanges": false,
      "showBalanceChanges": false
    }
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "digest": "2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG",
    "transaction": {
      "data": {
        "messageVersion": "v1",
        "transaction": {
          "kind": "ProgrammableTransaction",
          "inputs": [
            {
              "type": "object",
              "objectType": "immOrOwnedObject",
              "objectId": "0xd9f6db5103a374a81a161549ac2e0f044e67df0c2d3f5a551069c272c592ca1f",
              "version": "541127851",
              "digest": "6AEizdtWki8Zsukh1fkMQNZcLAeYnB7xqUegvuhXTrFZ"
            },
            {
              "type": "pure",
              "valueType": "u64",
              "value": "4000000000000000"
            },
            {
              "type": "pure",
              "valueType": "address",
              "value": "0x935029ca5219502a47ac9b69f556ccf6e2198b5e7815cf50f68846f723739cbd"
            }
          ],
          "transactions": [
            {
              "SplitCoins": [
                {
                  "Input": 0
                },
                [
                  {
                    "Input": 1
                  }
                ]
              ]
            },
            {
              "TransferObjects": [
                [
                  {
                    "Result": 0
                  },
                  {
                    "Input": 2
                  }
                ]
              ]
            }
          ]
        },
        "sender": "0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c",
        "gasData": {
          "payment": [
            {
              "objectId": "0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30",
              "version": 541127851,
              "digest": "4zPZiohyjWYFtUDnvGCqFxrjV8K8rVaR6r2dZwsm2L2k"
            },
            {
              "objectId": "0x1cc196b6cf0618880961593cea61043bf211312faff296dd3e6417fd130692c8",
              "version": 546760283,
              "digest": "9venMS9EFSATK4adgcgrLLZkGNzdg3YHgmTfxtr7cKAQ"
            }
          ],
          "owner": "0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c",
          "price": "740",
          "budget": "3818976"
        }
      },
      "txSignatures": [
        "AMpIvSOCvmDhxtfRmUIP1+wHS1P7uNjG/nbbXKgBO9lQ9TxSDexchRpp6gj1nkIu0mdrW1c5yT+1VFH78nHvXgiT5a1NeBxNOvDF96KyiveJ7afzY9L9GdrGlIwUCJLiDA=="
      ]
    },
    "effects": {
      "status": {
        "status": "success"
      },
      "executedEpoch": "757",
      "gasUsed": {
        "computationCost": "740000",
        "storageCost": "3663200",
        "storageRebate": "3280464",
        "nonRefundableStorageFee": "33136"
      },
      "modifiedAtVersions": [
        {
          "objectId": "0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30",
          "sequenceNumber": "541127851"
        },
        {
          "objectId": "0x1cc196b6cf0618880961593cea61043bf211312faff296dd3e6417fd130692c8",
          "sequenceNumber": "546760283"
        },
        {
          "objectId": "0xd9f6db5103a374a81a161549ac2e0f044e67df0c2d3f5a551069c272c592ca1f",
          "sequenceNumber": "541127851"
        }
      ],
      "created": [
        {
          "owner": {
            "AddressOwner": "0x935029ca5219502a47ac9b69f556ccf6e2198b5e7815cf50f68846f723739cbd"
          },
          "reference": {
            "objectId": "0x6f0a2c043864007581261b041d4bf68ae6da5a821f6c500f86f0c49555fa5253",
            "version": 546760284,
            "digest": "HQSEjogwi8yhLm9yfABqXYXni3Z2xYBs8NM5PDVqxS3j"
          }
        }
      ],
      "mutated": [
        {
          "owner": {
            "AddressOwner": "0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c"
          },
          "reference": {
            "objectId": "0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30",
            "version": 546760284,
            "digest": "CiJgoU28EjjE31XCbwCn1EhjDr7PABKu4FeRwKTkR8ax"
          }
        },
        {
          "owner": {
            "AddressOwner": "0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c"
          },
          "reference": {
            "objectId": "0xd9f6db5103a374a81a161549ac2e0f044e67df0c2d3f5a551069c272c592ca1f",
            "version": 546760284,
            "digest": "6UX8kadeV2g8BEJHHCxviqeQyejaPoJa1sVKDBCgz2kz"
          }
        }
      ],
      "deleted": [
        {
          "objectId": "0x1cc196b6cf0618880961593cea61043bf211312faff296dd3e6417fd130692c8",
          "version": 546760284,
          "digest": "7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz"
        }
      ],
      "gasObject": {
        "owner": {
          "AddressOwner": "0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c"
        },
        "reference": {
          "objectId": "0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30",
          "version": 546760284,
          "digest": "CiJgoU28EjjE31XCbwCn1EhjDr7PABKu4FeRwKTkR8ax"
        }
      },
      "dependencies": [
        "3ouqWx1G3NgVmDewUmp2VNXuoHUgFSCtX7o2ok7DELiK",
        "4Dre3aB1q4Y8ofehS76bCmPDTCcymdeVQuw9HMgg6bVQ"
      ]
    },
    "events": [],
    "timestampMs": "1746765615941",
    "checkpoint": "143012710"
  },
  "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_getTransactionBlock",
  "params": [
    "2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG",
    {
      "showInput": true,
      "showRawInput": false,
      "showEffects": true,
      "showEvents": true,
      "showObjectChanges": false,
      "showBalanceChanges": false
    }
  ]
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'sui_getTransactionBlock',
    params: [
      '2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG',
      {
        showInput: true,
        showRawInput: false,
        showEffects: true,
        showEvents: true,
        showObjectChanges: false,
        showBalanceChanges: false
      }
    ]
  })
};

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_getTransactionBlock",
    "params": [
        "2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG",
        {
            "showInput": True,
            "showRawInput": False,
            "showEffects": True,
            "showEvents": True,
            "showObjectChanges": False,
            "showBalanceChanges": False
        }
    ]
}
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_getTransactionBlock\",\n  \"params\": [\n    \"2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG\",\n    {\n      \"showInput\": true,\n      \"showRawInput\": false,\n      \"showEffects\": true,\n      \"showEvents\": true,\n      \"showObjectChanges\": false,\n      \"showBalanceChanges\": false\n    }\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_getTransactionBlock\",\n  \"params\": [\n    \"2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG\",\n    {\n      \"showInput\": true,\n      \"showRawInput\": false,\n      \"showEffects\": true,\n      \"showEvents\": true,\n      \"showObjectChanges\": false,\n      \"showBalanceChanges\": false\n    }\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_getTransactionBlock\",\n  \"params\": [\n    \"2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG\",\n    {\n      \"showInput\": true,\n      \"showRawInput\": false,\n      \"showEffects\": true,\n      \"showEvents\": true,\n      \"showObjectChanges\": false,\n      \"showBalanceChanges\": false\n    }\n  ]\n}", false);
var response = await client.PostAsync(request);

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

```


## OpenRPC Method Specification

```yaml
name: sui_getTransactionBlock
summary: Return the transaction response object.
description: |
  Returns detailed information about a transaction block by digest, including input, effects, events, and timestamp.
params:
  - name: digest
    required: true
    description: The digest of the queried transaction.
    schema:
      type: string
  - name: options
    required: true
    description: Options to control which fields are returned.
    schema:
      type: object
      properties:
        showInput:
          type: boolean
        showRawInput:
          type: boolean
        showEffects:
          type: boolean
        showEvents:
          type: boolean
        showObjectChanges:
          type: boolean
        showBalanceChanges:
          type: boolean
result:
  name: result
  description: The transaction block response.
  schema:
    type: object
examples:
  - name: Get transaction block example
    params:
      - name: digest
        value: 2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG
      - name: options
        value:
          showInput: true
          showRawInput: false
          showEffects: true
          showEvents: true
          showObjectChanges: false
          showBalanceChanges: false
    result:
      name: result
      value:
        digest: 2pDaMQ1uTz1EEbfiZcTUoyRUP22vVqUpZowgZxLXdGUG
        transaction:
          data:
            messageVersion: v1
            transaction:
              kind: ProgrammableTransaction
              inputs:
                - type: object
                  objectType: immOrOwnedObject
                  objectId: '0xd9f6db5103a374a81a161549ac2e0f044e67df0c2d3f5a551069c272c592ca1f'
                  version: '541127851'
                  digest: 6AEizdtWki8Zsukh1fkMQNZcLAeYnB7xqUegvuhXTrFZ
                - type: pure
                  valueType: u64
                  value: '4000000000000000'
                - type: pure
                  valueType: address
                  value: '0x935029ca5219502a47ac9b69f556ccf6e2198b5e7815cf50f68846f723739cbd'
              transactions:
                - SplitCoins:
                    - Input: 0
                    - - Input: 1
                - TransferObjects:
                    - - Result: 0
                      - Input: 2
            sender: '0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c'
            gasData:
              payment:
                - objectId: '0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30'
                  version: 541127851
                  digest: 4zPZiohyjWYFtUDnvGCqFxrjV8K8rVaR6r2dZwsm2L2k
                - objectId: '0x1cc196b6cf0618880961593cea61043bf211312faff296dd3e6417fd130692c8'
                  version: 546760283
                  digest: 9venMS9EFSATK4adgcgrLLZkGNzdg3YHgmTfxtr7cKAQ
              owner: '0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c'
              price: '740'
              budget: '3818976'
          txSignatures:
            - AMpIvSOCvmDhxtfRmUIP1+wHS1P7uNjG/nbbXKgBO9lQ9TxSDexchRpp6gj1nkIu0mdrW1c5yT+1VFH78nHvXgiT5a1NeBxNOvDF96KyiveJ7afzY9L9GdrGlIwUCJLiDA==
        effects:
          status:
            status: success
          executedEpoch: '757'
          gasUsed:
            computationCost: '740000'
            storageCost: '3663200'
            storageRebate: '3280464'
            nonRefundableStorageFee: '33136'
          modifiedAtVersions:
            - objectId: '0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30'
              sequenceNumber: '541127851'
            - objectId: '0x1cc196b6cf0618880961593cea61043bf211312faff296dd3e6417fd130692c8'
              sequenceNumber: '546760283'
            - objectId: '0xd9f6db5103a374a81a161549ac2e0f044e67df0c2d3f5a551069c272c592ca1f'
              sequenceNumber: '541127851'
          created:
            - owner:
                AddressOwner: '0x935029ca5219502a47ac9b69f556ccf6e2198b5e7815cf50f68846f723739cbd'
              reference:
                objectId: '0x6f0a2c043864007581261b041d4bf68ae6da5a821f6c500f86f0c49555fa5253'
                version: 546760284
                digest: HQSEjogwi8yhLm9yfABqXYXni3Z2xYBs8NM5PDVqxS3j
          mutated:
            - owner:
                AddressOwner: '0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c'
              reference:
                objectId: '0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30'
                version: 546760284
                digest: CiJgoU28EjjE31XCbwCn1EhjDr7PABKu4FeRwKTkR8ax
            - owner:
                AddressOwner: '0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c'
              reference:
                objectId: '0xd9f6db5103a374a81a161549ac2e0f044e67df0c2d3f5a551069c272c592ca1f'
                version: 546760284
                digest: 6UX8kadeV2g8BEJHHCxviqeQyejaPoJa1sVKDBCgz2kz
          deleted:
            - objectId: '0x1cc196b6cf0618880961593cea61043bf211312faff296dd3e6417fd130692c8'
              version: 546760284
              digest: 7gyGAp71YXQRoxmFBaHxofQXAipvgHyBKPyxmdSJxyvz
          gasObject:
            owner:
              AddressOwner: '0xac5bceec1b789ff840d7d4e6ce4ce61c90d190a7f8c4f4ddf0bff6ee2413c33c'
            reference:
              objectId: '0x0466a9a57add505b7b85ac485054f9b71f574f4504d9c70acd8f73ef11e0dc30'
              version: 546760284
              digest: CiJgoU28EjjE31XCbwCn1EhjDr7PABKu4FeRwKTkR8ax
          dependencies:
            - 3ouqWx1G3NgVmDewUmp2VNXuoHUgFSCtX7o2ok7DELiK
            - 4Dre3aB1q4Y8ofehS76bCmPDTCcymdeVQuw9HMgg6bVQ
        events: []
        timestampMs: '1746765615941'
        checkpoint: '143012710'
```
