# sui_multiGetTransactionBlocks

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

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

Returns an ordered list of transaction block responses for the provided digests. The method throws an error if the input contains duplicates or exceeds the maximum allowed size.


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

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| digests | string[] | Yes | List of transaction digests to query. |
| options | object | Yes | Options to control which fields are returned in the response. |

## Result

**result** (object[]): List of transaction block responses.

## Example

### Request

```json
{
  "jsonrpc": "2.0",
  "method": "sui_multiGetTransactionBlocks",
  "params": [
    [
      "8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8"
    ],
    {
      "showInput": true,
      "showRawInput": false,
      "showEffects": true,
      "showEvents": true,
      "showObjectChanges": false,
      "showBalanceChanges": false
    }
  ],
  "id": 1
}
```

### Response

```json
{
  "jsonrpc": "2.0",
  "result": [
    {
      "digest": "8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8",
      "transaction": {
        "data": {
          "messageVersion": "v1",
          "transaction": {
            "kind": "ProgrammableTransaction",
            "inputs": [
              {
                "type": "object",
                "objectType": "immOrOwnedObject",
                "objectId": "0x704c8c0d8052be7b5ca7174222a8980fb2ad3cd640f4482f931deb6436902627",
                "version": "17914894",
                "digest": "EtB9hPj2sgFNvi5AmdePGWVjzTY8avMcDBbXmU8KKrav"
              }
            ],
            "transactions": [
              {
                "MergeCoins": [
                  "..."
                ]
              },
              {
                "MoveCall": {
                  "...": null
                }
              },
              {
                "TransferObjects": [
                  "..."
                ]
              }
            ]
          }
        },
        "sender": "0x8b35e67a519fffa11a9c74f169228ff1aa085f3a3d57710af08baab8c02211b9",
        "gasData": {
          "payment": [
            {
              "objectId": "0x05fa83c7371003767a1a9a204a4f788df7880bbb2d1a8813612848c0684a1508",
              "version": 17914894,
              "digest": "8QS7xEpuhpVyE5FYtAwFokGMVgEiTuwxeScmm9NKH6gL"
            }
          ],
          "owner": "0x8b35e67a519fffa11a9c74f169228ff1aa085f3a3d57710af08baab8c02211b9",
          "price": "780",
          "budget": "1560000"
        }
      },
      "txSignatures": [
        "AHwNUODZnfOCQ66fNxaFhRxcJVp8ph6YG2nDMBmHDKW+t10A2tgLOwm+ZlCfflC59Ymvx43c2PVnK4mT10/NDQgVReFJgPk3gCeodtmcp+/EUo0Iat5xJMpD5Jps73bUpA=="
      ],
      "effects": {
        "status": {
          "status": "success"
        },
        "executedEpoch": "120",
        "gasUsed": {
          "computationCost": "780000",
          "storageCost": "31000400",
          "storageRebate": "43187760",
          "nonRefundableStorageFee": "436240"
        },
        "transactionDigest": "8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8",
        "gasObject": {
          "owner": {
            "AddressOwner": "0x8b35e67a519fffa11a9c74f169228ff1aa085f3a3d57710af08baab8c02211b9"
          },
          "reference": {
            "objectId": "0x05fa83c7371003767a1a9a204a4f788df7880bbb2d1a8813612848c0684a1508",
            "version": 17917509,
            "digest": "2UgthUKMotpLrFxCfTsfzjMzxtdcFM43nJu3LLdEa3z3"
          }
        }
      },
      "events": [],
      "timestampMs": "1691758371497",
      "checkpoint": "10066505"
    }
  ],
  "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_multiGetTransactionBlocks",
  "params": [
    [
      "8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8"
    ],
    {
      "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_multiGetTransactionBlocks',
    params: [
      ['8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8'],
      {
        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_multiGetTransactionBlocks",
    "params": [
        ["8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8"],
        {
            "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_multiGetTransactionBlocks\",\n  \"params\": [\n    [\n      \"8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8\"\n    ],\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_multiGetTransactionBlocks\",\n  \"params\": [\n    [\n      \"8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8\"\n    ],\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_multiGetTransactionBlocks\",\n  \"params\": [\n    [\n      \"8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8\"\n    ],\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_multiGetTransactionBlocks
summary: Retrieve multiple transaction blocks by digest
description: |
  Returns an ordered list of transaction block responses for the provided digests. The method throws an error if the input contains duplicates or exceeds the maximum allowed size.
params:
  - name: digests
    required: true
    description: List of transaction digests to query.
    schema:
      type: array
      items:
        type: string
  - name: options
    required: true
    description: Options to control which fields are returned in the response.
    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: List of transaction block responses.
  schema:
    type: array
    items:
      type: object
examples:
  - name: Fetch a transaction block with options
    params:
      - name: digests
        value:
          - 8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8
      - name: options
        value:
          showInput: true
          showRawInput: false
          showEffects: true
          showEvents: true
          showObjectChanges: false
          showBalanceChanges: false
    result:
      name: result
      value:
        - digest: 8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8
          transaction:
            data:
              messageVersion: v1
              transaction:
                kind: ProgrammableTransaction
                inputs:
                  - type: object
                    objectType: immOrOwnedObject
                    objectId: '0x704c8c0d8052be7b5ca7174222a8980fb2ad3cd640f4482f931deb6436902627'
                    version: '17914894'
                    digest: EtB9hPj2sgFNvi5AmdePGWVjzTY8avMcDBbXmU8KKrav
                transactions:
                  - MergeCoins:
                      - ...
                  - MoveCall:
                      ...: null
                  - TransferObjects:
                      - ...
            sender: '0x8b35e67a519fffa11a9c74f169228ff1aa085f3a3d57710af08baab8c02211b9'
            gasData:
              payment:
                - objectId: '0x05fa83c7371003767a1a9a204a4f788df7880bbb2d1a8813612848c0684a1508'
                  version: 17914894
                  digest: 8QS7xEpuhpVyE5FYtAwFokGMVgEiTuwxeScmm9NKH6gL
              owner: '0x8b35e67a519fffa11a9c74f169228ff1aa085f3a3d57710af08baab8c02211b9'
              price: '780'
              budget: '1560000'
          txSignatures:
            - AHwNUODZnfOCQ66fNxaFhRxcJVp8ph6YG2nDMBmHDKW+t10A2tgLOwm+ZlCfflC59Ymvx43c2PVnK4mT10/NDQgVReFJgPk3gCeodtmcp+/EUo0Iat5xJMpD5Jps73bUpA==
          effects:
            status:
              status: success
            executedEpoch: '120'
            gasUsed:
              computationCost: '780000'
              storageCost: '31000400'
              storageRebate: '43187760'
              nonRefundableStorageFee: '436240'
            transactionDigest: 8b3byDuRojHXqmSz16PsyzfdXJEY5nZBGTM23gMsMAY8
            gasObject:
              owner:
                AddressOwner: '0x8b35e67a519fffa11a9c74f169228ff1aa085f3a3d57710af08baab8c02211b9'
              reference:
                objectId: '0x05fa83c7371003767a1a9a204a4f788df7880bbb2d1a8813612848c0684a1508'
                version: 17917509
                digest: 2UgthUKMotpLrFxCfTsfzjMzxtdcFM43nJu3LLdEa3z3
          events: []
          timestampMs: '1691758371497'
          checkpoint: '10066505'
```
