Connect to the Kuest WebSocket gateway and subscribe to market or user updates.
npm install ws
import WebSocket from "ws"; const socket = new WebSocket("wss://ws-subscriptions-clob.kuest.com/ws/market"); socket.on("open", () => { socket.send( JSON.stringify({ type: "market", assets_ids: ["<token_id>"], custom_feature_enabled: true }) ); }); socket.on("message", (data) => { console.log(JSON.parse(data.toString())); });
import WebSocket from "ws"; const socket = new WebSocket("wss://ws-subscriptions-clob.kuest.com/ws/user"); socket.on("open", () => { socket.send( JSON.stringify({ type: "user", markets: ["<condition_id>"], auth: { apikey: "<uuid>", secret: "<base64-secret>", passphrase: "<hex-passphrase>" } }) ); }); socket.on("message", (data) => { console.log(JSON.parse(data.toString())); });
{ "operation": "unsubscribe", "assets_ids": ["<token_id>"], "markets": ["<condition_id>"] }
Was this page helpful?