Solana RPC · WebSocket subscriptions

WS signatureSubscribe

Fire once when a transaction reaches the chosen commitment.

Endpoint

WebSocket  wss://solrpc.infinityblocks.io/<API_KEY>

Open the socket, then send a JSON-RPC signatureSubscribe message. The server replies with a subscription id, then pushes notifications until you unsubscribe.

Parameters

ParamTypeRequiredDescription
signaturestringyesBase-58 transaction signature.
configobjectnocommitment, enableReceivedNotification.

Subscribe message

{"jsonrpc":"2.0","id":1,"method":"signatureSubscribe","params":["<SIGNATURE>",{"commitment":"confirmed"}]}

With @solana/web3.js

const id = rpc.onSignature("<SIGNATURE>", (res, ctx) => console.log(ctx.slot, res.err), "confirmed");

Reply

{ "jsonrpc": "2.0", "id": 1, "result": 0   // subscription id }

Notification

{ "jsonrpc": "2.0", "method": "signatureNotification",
  "params": { "subscription": 0,
    "result": { "context": { "slot": 423214981 }, "value": { "err": null } } } }
Auto-cancels after it fires once (per the chosen commitment).

Try it

The interactive runner covers HTTP methods. WebSocket subscriptions use a persistent socket — use the subscribe message and the @solana/web3.js example above.