Skip to Content

programSubscribe

Subscribe to program-owned account changes on the Solana route (Beta).

Available under Solana WebSocket API (Beta). Use the chain-family pages for handle discovery and this page for exact subscription semantics.

Stage: Beta

Access

  • Surfaces: raw_rpc_ws
  • Metering: raw_rpc_ws_target_minute
  • Scope: Solana program subscription

Handles

SurfaceLabelValue
raw_rpc_wsEndpointwss://gw-aql.tomo.services/rpc/solana/wss
raw_rpc_wsAuth headerBearer <api_key>
raw_rpc_wsSubscribe methodprogramSubscribe
raw_rpc_wsNotification methodprogramNotification

Use `programSubscribe` when the runtime needs updates for accounts owned by one program with the current reviewed filter shape.

This beta example uses `/rpc/solana/wss` and the reviewed `programSubscribe` request shape.

Examples

Connect with wscat
wscat -c "wss://gw-aql.tomo.services/rpc/solana/wss" \ -H "Authorization: Bearer <api_key>"> {> "jsonrpc": "2.0",> "id": 1,> "method": "programSubscribe",> "params": [> "11111111111111111111111111111111",> {> "encoding": "base64"> }> ]> }

Request fields

Subscription request

FieldTypeRequiredNotes
jsonrpcstringRequiredJSON-RPC version. Use `2.0`.
idstring | numberRequiredCaller request id.
methodstringRequiredAllowlisted subscription method.
paramsarrayRequiredSubscription topic or filter arguments.

Response fields

Subscribe result

FieldTypeNotes
jsonrpcstringJSON-RPC version.
idstring | numberEchoed caller request id.
resultstring | numberSubscription id returned by the hosted route.

Notification shape

FieldTypeNotes
methodstringNotification method such as `eth_subscription` or `slotNotification`.
params.subscriptionstring | numberSubscription id tied to the current stream.
params.resultobjectUpstream chain payload for the current notification.