Skip to content
Alchemy Logo

Subscriptions

The SubscriptionService provides server-streaming RPCs for real-time data.

Streams new checkpoints as they are finalized. This is a server-streaming RPC that keeps the connection open and sends checkpoint data in real time.

Request:

FieldTypeRequiredDescription
read_maskFieldMaskNoFields to include in each checkpoint

Response (stream):

FieldTypeDescription
checkpointCheckpointThe checkpoint data
cursoruint64Cursor position for resuming the stream
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/subscription_service.proto \
  -d '{}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.SubscriptionService/SubscribeCheckpoints

This is a long-lived streaming connection. The server will continue sending checkpoints until the client disconnects.

Streams executed transactions matching the provided filter from the tip of the chain. The stream begins at the latest executed checkpoint as seen by the server and continues until the client disconnects.

Request:

FieldTypeRequiredDescription
read_maskFieldMaskNoFields to include on each transaction
filterTransactionFilterNoDNF filter over indexed transaction dimensions (sender, affected_address, affected_object, move_call, emit_module, event_type, event_stream_head, package_write). Absent means stream every transaction

Response (stream):

FieldTypeDescription
transactionExecutedTransactionOne matching transaction. Unset on progress-only frames on filtered streams
watermarkWatermarkProgress watermark for this frame. Present on every frame
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/subscription_service.proto \
  -d '{}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.SubscriptionService/SubscribeTransactions

Subscriptions do not support resumption; a new subscription always begins at the current tip. To backfill missed data, replay from the last received watermark.cursor using the paired LedgerService/ListTransactions API.

Streams events matching the provided filter from the tip of the chain. Same shape as SubscribeTransactions, one event per frame.

Request:

FieldTypeRequiredDescription
read_maskFieldMaskNoFields to include on each event
filterEventFilterNoDNF filter over indexed event dimensions (sender, emit_module, event_type, event_stream_head). Absent means stream every event

Response (stream):

FieldTypeDescription
eventEventOne matching event. Unset on progress-only frames on filtered streams
watermarkWatermarkProgress watermark for this frame
grpcurl \
  -H "Authorization: Bearer <YOUR_API_KEY>" \
  -import-path proto \
  -proto sui/rpc/v2/subscription_service.proto \
  -d '{}' \
  sui-mainnet.g.alchemy.com:443 \
  sui.rpc.v2.SubscriptionService/SubscribeEvents

To backfill missed data, replay from the last received watermark.cursor using the paired LedgerService/ListEvents API.

Was this page helpful?