|
2 | 2 | import { |
3 | 3 | DefaultLogger, |
4 | 4 | isWsAggTradeFormatted, |
| 5 | + isWsFormatted24hrTicker, |
| 6 | + isWsFormatted24hrTickerArray, |
| 7 | + isWsFormattedForceOrder, |
5 | 8 | isWsFormattedKline, |
6 | 9 | isWsFormattedMarkPriceUpdateArray, |
7 | 10 | isWsFormattedMarkPriceUpdateEvent, |
| 11 | + isWsFormattedRollingWindowTickerArray, |
| 12 | + isWsFormattedTrade, |
| 13 | + isWsPartialBookDepthEventFormatted, |
8 | 14 | WebsocketClient, |
9 | 15 | } from '../../src'; |
10 | 16 |
|
@@ -72,6 +78,30 @@ import { |
72 | 78 | return; |
73 | 79 | } |
74 | 80 |
|
| 81 | + if (isWsFormattedTrade(data)) { |
| 82 | + return console.log('log trade: ', data); |
| 83 | + } |
| 84 | + |
| 85 | + if (isWsFormattedForceOrder(data)) { |
| 86 | + return console.log('log force order: ', data); |
| 87 | + } |
| 88 | + |
| 89 | + if (isWsFormatted24hrTickerArray(data)) { |
| 90 | + return console.log('log 24hr ticker array: ', data); |
| 91 | + } |
| 92 | + |
| 93 | + if (isWsFormattedRollingWindowTickerArray(data)) { |
| 94 | + return console.log('log rolling window ticker array: ', data); |
| 95 | + } |
| 96 | + |
| 97 | + if (isWsFormatted24hrTicker(data)) { |
| 98 | + return console.log('log 24hr ticker: ', data); |
| 99 | + } |
| 100 | + |
| 101 | + if (isWsPartialBookDepthEventFormatted(data)) { |
| 102 | + return console.log('log partial book depth event: ', data); |
| 103 | + } |
| 104 | + |
75 | 105 | console.log('log unhandled formattedMessage: ', data); |
76 | 106 | }); |
77 | 107 |
|
@@ -194,7 +224,54 @@ import { |
194 | 224 | '!markPrice@arr', |
195 | 225 | // Kline/Candlestick Streams |
196 | 226 | // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Kline-Candlestick-Streams |
197 | | - 'btcusdt@kline_1m', |
| 227 | + // 'btcusdt@kline_1m', |
| 228 | + // Continuous Contract Kline/Candlestick Streams |
| 229 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Continuous-Contract-Kline-Candlestick-Streams |
| 230 | + // 'btcusdt_perpetual@continuousKline_1m', // DOESNT EXIST AS TYPE GUARD, ONLY IN BEAUTIFIER |
| 231 | + // Individual Symbol Mini Ticker Stream |
| 232 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Mini-Ticker-Stream |
| 233 | + // 'btcusdt@miniTicker', // DOESNT EXIST AS TYPE GUARD, ONLY FOR RAW MESSAGE |
| 234 | + // All Market Mini Tickers Stream |
| 235 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Mini-Tickers-Stream |
| 236 | + // '!miniTicker@arr', // DOESNT EXIST AS TYPE GUARD |
| 237 | + // Individual Symbol Ticker Streams |
| 238 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Ticker-Streams |
| 239 | + //'btcusdt@ticker', |
| 240 | + // All Market Tickers Stream |
| 241 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Tickers-Stream |
| 242 | + // '!ticker@arr', // DOESNT EXIST AS TYPE GUARD |
| 243 | + // Individual Symbol Book Ticker Streams |
| 244 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Individual-Symbol-Book-Ticker-Streams |
| 245 | + //'btcusdt@bookTicker', // DOESNT EXIST AS TYPE GUARD |
| 246 | + // All Book Tickers Stream |
| 247 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Book-Tickers-Stream |
| 248 | + // '!bookTicker', // DOESNT EXIST AS TYPE GUARD |
| 249 | + // Liquidation Order Stream |
| 250 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Liquidation-Order-Streams |
| 251 | + // 'btcusdt@forceOrder', |
| 252 | + // Liquidation Order Stream for All market |
| 253 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/All-Market-Liquidation-Order-Streams |
| 254 | + //'!forceOrder@arr', |
| 255 | + // Partial Book Depth Streams |
| 256 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Partial-Book-Depth-Streams |
| 257 | + //'btcusdt@depth5', |
| 258 | + // 'btcusdt@depth10@100ms' |
| 259 | + // Diff. Book Depth Stream |
| 260 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Diff-Book-Depth-Streams |
| 261 | + // 'btcusdt@depth', |
| 262 | + // 'btcusdt@depth@100ms', |
| 263 | + // 'btcusdt@depth@500ms', |
| 264 | + // 'btcusdt@depth@1000ms' |
| 265 | + // Composite Index Symbol Information Streams |
| 266 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Composite-Index-Symbol-Information-Streams |
| 267 | + // 'btcusdt@compositeIndex' // DOESNT EXIST AS TYPE GUARD |
| 268 | + // Contract Info Stream |
| 269 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Contract-Info-Stream |
| 270 | + // '!contractInfo' // DOESNT EXIST AS TYPE GUARD |
| 271 | + // Multi-Assets Mode Asset Index Stream |
| 272 | + // https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Multi-Assets-Mode-Asset-Index |
| 273 | + // '!assetIndex@arr' // DOESNT EXIST AS TYPE GUARD |
| 274 | + // 'btcusdt@assetIndex' |
198 | 275 | ], |
199 | 276 | 'usdm', |
200 | 277 | ); |
|
0 commit comments