LedgerService.BatchGetTransactions
Batch get transactions through sui.rpc.v2.LedgerService/BatchGetTransactions on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.LedgerService/BatchGetTransactions. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: BatchGetTransactionsRequest
| Field | Type | Description |
|---|---|---|
digests | repeated string | Required. The digests of the requested transactions. |
read_mask | google.protobuf.FieldMask | Mask specifying which fields to read. If no mask is specified, defaults to digest. |
Response: BatchGetTransactionsResponse
| Field | Type | Description |
|---|---|---|
transactions | repeated GetTransactionResult |
GetTransactionResult
| Field | Type | Description |
|---|---|---|
transaction | ExecutedTransaction (one of result) | |
error | google.rpc.Status (one of result) |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"digests": [
"Dt6oY3qKzLm1aB4S9v8cXwPn2R5J7hFgT1kEqU3yWzA"
],
"read_mask": {
"paths": [
"digest"
]
}
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.LedgerService/BatchGetTransactionsServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
The body is a template: replace the made-up digest with your own values before the call succeeds.
TypeScript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const { response } = await client.ledgerService.batchGetTransactions({
digests: ['Dt6oY3qKzLm1aB4S9v8cXwPn2R5J7hFgT1kEqU3yWzA'],
readMask: { paths: ['digest', 'effects.status'] }
})
console.log(response.transactions)@mysten/sui v2 has no typed method for this RPC, so the sample calls the generated client.ledgerService service client. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
1 credit per key in the batch. Reads served from the archival tier cost 2x; the response metadata carries x-inodra-backend naming the tier that answered. See credits and billing for the full table.
JSON-RPC equivalent
Replaces sui_multiGetTransactionBlocks. The JSON-RPC to gRPC migration guide has before and after code for the common calls.
Related
- LedgerService overview and the gRPC gateway
- LedgerService.GetServiceInfo
- LedgerService.GetObject
- LedgerService.BatchGetObjects
- LedgerService.GetTransaction
- LedgerService.GetCheckpoint
- LedgerService.GetEpoch
- LedgerService.ListCheckpoints
- LedgerService.ListTransactions
- LedgerService.ListEvents
- Proto definition on GitHub