For the complete documentation index, see llms.txt. This page is also available as Markdown.

LedgerService/BatchGetTransactions - SUI

Example code for the LedgerService/BatchGetTransactions gRPC method. Complete guide on how to use LedgerService/BatchGetTransactions gRPC method in GetBlock Web3 documentation.

Returns multiple transactions by digest in a single call. More efficient than calling GetTransaction repeatedly when reconstructing transaction history.

Service: sui.rpc.v2.LedgerService Proto file: sui/rpc/v2/ledger_service.proto Full method path: sui.rpc.v2.LedgerService/BatchGetTransactions

Request Fields

Field
Type
Required
Description

requests

repeated GetTransactionRequest

Yes

Array of GetTransactionRequest entries, each with digest and optional read_mask

Request Example

# Clone the official proto files first (one-time setup):
#   git clone https://github.com/MystenLabs/sui-apis.git && cd sui-apis

grpcurl \
  -import-path proto \
  -proto sui/rpc/v2/ledger_service.proto \
  -H "x-grpc-web: 1" \
  -d '{
    "requests": [
        {
            "digest": "8WmKqcRkV5JZw8gEjGyzVxRYHnDvKmJsxLBp7t6vNqrA",
            "read_mask": {
                "paths": [
                    "digest",
                    "effects.status",
                    "timestamp_ms"
                ]
            }
        },
        {
            "digest": "Q9LkBpZHvJxMsnNzVxRYHnDvKmJsxLBp7t6vNqRAmK",
            "read_mask": {
                "paths": [
                    "digest",
                    "effects.status",
                    "timestamp_ms"
                ]
            }
        }
    ]
}' \
  go.getblock.io:443/<ACCESS-TOKEN> \
  sui.rpc.v2.LedgerService/BatchGetTransactions

Response Example

Responses are encoded in Protocol Buffers binary format on the wire. The example below shows the protobuf JSON encoding for readability.

Response Fields

Field
Type
Description

transactions

repeated ExecutedTransaction

Array of transactions in the same order as the request

transactions[].digest

string

Transaction digest

transactions[].effects.status

ExecutionStatus

Execution outcome

transactions[].timestamp_ms

string

Block timestamp in milliseconds

Use Cases

  • Bulk history reconstruction for indexers

  • Wallet transaction history pages

  • Cross-referencing multiple transactions in analytics

Error Handling

gRPC uses status codes rather than JSON-RPC numeric error codes. The most relevant for this method:

Status Code
Numeric
Cause

UNAUTHENTICATED

16

Missing or invalid <ACCESS-TOKEN> in the URL path

INVALID_ARGUMENT

3

Request fields are missing, malformed, or fail validation

UNAVAILABLE

14

Node is overloaded or temporarily unable to handle the request — retry with backoff

DEADLINE_EXCEEDED

4

Request did not complete within the timeout window

RESOURCE_EXHAUSTED

8

Rate limit exceeded for your plan

INVALID_ARGUMENT

3

Empty requests list or too many requests in a single batch

SDK Integration

Was this helpful?