MCPcopy Create free account
hub / github.com/ccxt/node-binance-api / classifyFuturesStream

Method classifyFuturesStream

src/node-binance-api.ts:302–314  ·  view source on GitHub ↗

* Classify a futures stream endpoint into public, market, or private category * per Binance USDⓈ-M Futures WebSocket URL split (2026-03-06)

(endpoint: string)

Source from the content-addressed store, hash-verified

300 * per Binance USDⓈ-M Futures WebSocket URL split (2026-03-06)
301 */
302 classifyFuturesStream(endpoint: string): 'public' | 'market' | 'private' {
303 // Public: bookTicker and depth streams (high-frequency)
304 if (endpoint.includes('@bookTicker') || endpoint === '!bookTicker'
305 || endpoint.includes('@depth')) {
306 return 'public';
307 }
308 // Private: listenKey is a long alphanumeric string (60+ chars, no @ or !)
309 if (/^[A-Za-z0-9]{20,}$/.test(endpoint)) {
310 return 'private';
311 }
312 // Market: aggTrade, markPrice, kline, ticker, miniTicker, forceOrder, etc.
313 return 'market';
314 }
315
316 getFStreamSingleUrl(category?: 'public' | 'market' | 'private') {
317 if (category) {

Callers 3

futuresSubscribeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected