You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebSocket API support for Coinglass's real-time streams, under the new websocket subpackage:
websocket.Client / Client.Connect — connects to wss://open-ws.coinglass.com/ws-api, authenticated with your
API key. Accessible from the main SDK via client.WSClient().
Stream.Subscribe / Stream.Unsubscribe — subscribe to any number of channels over a single connection, with
the "ping"/"pong" heartbeat (every 20s) handled automatically.
Stream.Messages() / Stream.Errors() — channels for consuming incoming data and connection/parse errors.
Channel helpers and typed decoders for every documented stream:
ChannelLiquidationOrders() + DecodeLiquidationOrders — Liquidation Order
ChannelSpotTrades(exchange, symbol, minVolumeUSD) + DecodeTrades — Spot Trade Order
ChannelFuturesTrades(exchange, symbol, minVolumeUSD) + DecodeTrades — Futures Trade Order
The WebSocket client is implemented entirely on the standard library (net, crypto/tls, bufio) — no
third-party dependency (e.g. gorilla/websocket) was introduced, keeping the SDK dependency-free.