# ListTransactions - Stream Historical Sui Transactions

`LedgerService.ListTransactions` streams transactions from a bounded historical scan. Filters, checkpoint bounds, and opaque cursors let indexers backfill without loading complete checkpoints.

## Method Signature

- **Service:** `sui.rpc.v2.LedgerService`
- **Method:** `ListTransactions`
- **Type:** Server-streaming RPC

## Request Parameters

- `read_mask` (`FieldMask, optional`): Fields of ExecutedTransaction to return. Use paths relative to that message.
- `start_checkpoint` (`uint64, optional`): Inclusive checkpoint lower bound. Omit to start at the earliest retained checkpoint.
- `end_checkpoint` (`uint64, optional`): Exclusive checkpoint upper bound. Omit to scan up to the indexed tip.
- `filter` (`TransactionFilter, optional`): Optional server-side filter. An included filter must contain at least one term.
- `options` (`QueryOptions, optional`): Scan limit, cursor bounds, and ordering. Use options.after for ascending continuation.

## Request Example

```bash
grpcurl \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "start_checkpoint": "RECENT_CHECKPOINT",
  "options": {
    "limit": 2
  },
  "read_mask": {
    "paths": [
      "digest",
      "transaction.sender"
    ]
  }
}' \
  api-sui-mainnet-full.n.dwellir.com:443 \
  sui.rpc.v2.LedgerService/ListTransactions
```

## Response Fields

- `transaction` (`ExecutedTransaction, optional`): Executed transaction data, wrapped in the response.
- `watermark` (`Watermark, optional`): Progress and continuation cursor. Present even when a frame contains no matching item.
- `end` (`QueryEnd, optional`): Scan end reason on the final successful frame.

## Successful Response

```protobuf
message ListTransactionsResponse {
  optional ExecutedTransaction transaction = 1;
  optional Watermark watermark = 2;
  optional QueryEnd end = 3;
}
```

## Error Responses

### Range outside retained history

- Code: `OUT_OF_RANGE`
- Description: The lower bound predates retained history. Check GetServiceInfo and use an archival source for older data.

Persist the latest watermark only after downstream processing succeeds. Resume ascending scans with `options.after`, or descending scans with `options.before`.

## Related Methods

- [GetTransaction](https://www.dwellir.com/docs/sui/grpc/ledger/get-transaction)
- [BatchGetTransactions](https://www.dwellir.com/docs/sui/grpc/ledger/batch-get-transactions)
- [SubscribeTransactions](https://www.dwellir.com/docs/sui/grpc/subscription/subscribe-transactions)

See the [official Sui gRPC schema](https://github.com/MystenLabs/sui-apis/blob/main/proto/sui/rpc/v2/ledger_service.proto) for the current protobuf definition.

## Retention and filters

Replace `RECENT_CHECKPOINT` with a recent `checkpointHeight` from [GetServiceInfo](https://www.dwellir.com/docs/sui/grpc/ledger/get-service-info). A lower bound before retained history returns `OUT_OF_RANGE`.

See [filter syntax and examples](https://www.dwellir.com/docs/sui/grpc-overview#server-side-filters) before adding a `filter`. An included filter must contain at least one term.
