Skip to main content

WebSocket Subscriptions

Standard Solana WebSocket interface. Same JSON-RPC subscription API as any Solana node.

Endpoint

wss://rpc.vali.wtf

Subscriptions

MethodDescription
accountSubscribeAccount data changes
logsSubscribeTransaction log output
programSubscribeChanges to accounts owned by a program
slotSubscribeSlot change notifications
signatureSubscribeTransaction confirmation
rootSubscribeRoot slot changes
blockSubscribeNew blocks

Example

const ws = new WebSocket('wss://rpc.vali.wtf');

ws.on('open', () => {
  ws.send(JSON.stringify({
    jsonrpc: '2.0',
    id: 1,
    method: 'slotSubscribe'
  }));
});

ws.on('message', (data) => {
  console.log(JSON.parse(data));
});