JSON-RPC subscriptions over WSS
Open one socket and subscribe to slots, accounts, logs or programs. Each xSubscribe returns an integer id; the matching xUnsubscribe cancels it and frees its slot under the per-connection cap. Your plan caps connections and subscriptions per account; Free carries 5 sockets.
# WebSocketwscat -c 'wss://services.carbium.sh/?api-key=<YOUR_KEY>'> {"jsonrpc":"2.0","id":1,"method":"slotSubscribe"}< {"jsonrpc":"2.0","result":2282,"id":1}< {"jsonrpc":"2.0","method":"slotNotification","params":{ "subscription":2282, "result":{"slot":445686763,"parent":445686762,"root":445686730}}}# header form: x-api-key: <YOUR_KEY>
channels
| subscribe | notification | payload |
|---|---|---|
| accountSubscribe | accountNotification | account state on change, for streamed accounts; plain SOL wallets send nothing: use logsSubscribe mentions plus getBalance |
| programSubscribe | programNotification | account changes under a covered program; others answer -32010 |
| logsSubscribe | logsNotification | transaction logs, all or by mention |
| signatureSubscribe | signatureNotification | one confirmation, then it ends |
| slotSubscribe | slotNotification | each new processed slot |
| rootSubscribe | rootNotification | each new root |
| slotsUpdatesSubscribe | slotsUpdatesNotification | slot lifecycle updates |
| blockSubscribe | blockNotification | each new block, all or by mention; send maxSupportedTransactionVersion: 1 |
| voteSubscribe | refused (-32601) | Alpenglow takes vote transactions out of blocks |
methods
slotSubscribereturns subscription id, then notifications
slotsUpdatesSubscribereturns subscription id, then notifications
rootSubscribereturns subscription id, then notifications
accountSubscribereturns subscription id, then notifications
programSubscribereturns subscription id, then notifications
logsSubscribereturns subscription id, then notifications
signatureSubscribereturns subscription id, then notifications
blockSubscribereturns subscription id, then notifications