ccxt 4.5.51 → 4.5.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87,8 +87,14 @@ export default class aster extends asterRest {
87
87
  * @method
88
88
  * @name aster#watchTicker
89
89
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
90
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
91
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
90
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#simplified-ticker-by-symbol
91
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
92
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#full-ticker-per-symbol
93
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
94
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-mini-ticker-stream
95
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
96
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-ticker-streams
97
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
92
98
  * @param {string} symbol unified symbol of the market to fetch the ticker for
93
99
  * @param {object} [params] extra parameters specific to the exchange API endpoint
94
100
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -104,8 +110,14 @@ export default class aster extends asterRest {
104
110
  * @method
105
111
  * @name aster#unWatchTicker
106
112
  * @description unWatches a price ticker
107
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
108
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
113
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#simplified-ticker-by-symbol
114
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
115
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#full-ticker-per-symbol
116
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
117
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-mini-ticker-stream
118
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
119
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-ticker-streams
120
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
109
121
  * @param {string} symbol unified symbol of the market to fetch the ticker for
110
122
  * @param {object} [params] extra parameters specific to the exchange API endpoint
111
123
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -118,8 +130,10 @@ export default class aster extends asterRest {
118
130
  * @method
119
131
  * @name aster#watchTickers
120
132
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
121
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
122
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
133
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
134
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
135
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
136
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
123
137
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
124
138
  * @param {object} [params] extra parameters specific to the exchange API endpoint
125
139
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -161,8 +175,10 @@ export default class aster extends asterRest {
161
175
  * @method
162
176
  * @name aster#unWatchTickers
163
177
  * @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
164
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#full-ticker-per-symbol
165
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-ticker-streams
178
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
179
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
180
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
181
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
166
182
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
167
183
  * @param {object} [params] extra parameters specific to the exchange API endpoint
168
184
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -198,7 +214,8 @@ export default class aster extends asterRest {
198
214
  * @method
199
215
  * @name aster#watchMarkPrice
200
216
  * @description watches a mark price for a specific market
201
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
217
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
218
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
202
219
  * @param {string} symbol unified symbol of the market to fetch the ticker for
203
220
  * @param {object} [params] extra parameters specific to the exchange API endpoint
204
221
  * @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
@@ -215,7 +232,8 @@ export default class aster extends asterRest {
215
232
  * @method
216
233
  * @name aster#unWatchMarkPrice
217
234
  * @description unWatches a mark price for a specific market
218
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
235
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
236
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
219
237
  * @param {string} symbol unified symbol of the market to fetch the ticker for
220
238
  * @param {object} [params] extra parameters specific to the exchange API endpoint
221
239
  * @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
@@ -229,7 +247,8 @@ export default class aster extends asterRest {
229
247
  * @method
230
248
  * @name aster#watchMarkPrices
231
249
  * @description watches the mark price for all markets
232
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
250
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
251
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
233
252
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
234
253
  * @param {object} [params] extra parameters specific to the exchange API endpoint
235
254
  * @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
@@ -274,7 +293,8 @@ export default class aster extends asterRest {
274
293
  * @method
275
294
  * @name aster#unWatchMarkPrices
276
295
  * @description watches the mark price for all markets
277
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#mark-price-stream
296
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
297
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
278
298
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
279
299
  * @param {object} [params] extra parameters specific to the exchange API endpoint
280
300
  * @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
@@ -312,8 +332,6 @@ export default class aster extends asterRest {
312
332
  handleTicker(client, message) {
313
333
  //
314
334
  // {
315
- // "stream": "trumpusdt@ticker",
316
- // "data": {
317
335
  // "e": "24hrTicker",
318
336
  // "E": 1754451187277,
319
337
  // "s": "CAKEUSDT",
@@ -332,11 +350,8 @@ export default class aster extends asterRest {
332
350
  // "F": 6571389,
333
351
  // "L": 6574507,
334
352
  // "n": 3119
335
- // }
336
353
  // }
337
354
  // {
338
- // "stream": "btcusdt@markPrice",
339
- // "data": {
340
355
  // "e": "markPriceUpdate",
341
356
  // "E": 1754660466000,
342
357
  // "s": "BTCUSDT",
@@ -345,11 +360,10 @@ export default class aster extends asterRest {
345
360
  // "i": "116836.93534884",
346
361
  // "r": "0.00010000",
347
362
  // "T": 1754668800000
348
- // }
349
363
  // }
350
364
  //
351
365
  const marketType = this.getAccountTypeFromUrl(client.url);
352
- const ticker = this.safeDict(message, 'data');
366
+ const ticker = message;
353
367
  const parsed = this.parseWsTicker(ticker, marketType);
354
368
  const symbol = parsed['symbol'];
355
369
  const messageHash = 'ticker:' + symbol;
@@ -401,8 +415,10 @@ export default class aster extends asterRest {
401
415
  * @method
402
416
  * @name aster#watchBidsAsks
403
417
  * @description watches best bid & ask for symbols
404
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#best-order-book-information-by-symbol
405
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-book-ticker-streams
418
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-by-symbol
419
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-across-the-entire-market
420
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-book-ticker-streams
421
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-book-tickers-stream
406
422
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
407
423
  * @param {object} [params] extra parameters specific to the exchange API endpoint
408
424
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -441,8 +457,10 @@ export default class aster extends asterRest {
441
457
  * @method
442
458
  * @name aster#unWatchBidsAsks
443
459
  * @description unWatches best bid & ask for symbols
444
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#best-order-book-information-by-symbol
445
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#individual-symbol-book-ticker-streams
460
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-by-symbol
461
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-across-the-entire-market
462
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-book-ticker-streams
463
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-book-tickers-stream
446
464
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
447
465
  * @param {object} [params] extra parameters specific to the exchange API endpoint
448
466
  * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
@@ -474,8 +492,6 @@ export default class aster extends asterRest {
474
492
  handleBidAsk(client, message) {
475
493
  //
476
494
  // {
477
- // "stream": "btcusdt@bookTicker",
478
- // "data": {
479
495
  // "e": "bookTicker",
480
496
  // "u": 157240846459,
481
497
  // "s": "BTCUSDT",
@@ -485,11 +501,10 @@ export default class aster extends asterRest {
485
501
  // "A": "0.001",
486
502
  // "T": 1754896692922,
487
503
  // "E": 1754896692926
488
- // }
489
504
  // }
490
505
  //
491
506
  const marketType = this.getAccountTypeFromUrl(client.url);
492
- const data = this.safeDict(message, 'data', {});
507
+ const data = message;
493
508
  const marketId = this.safeString(data, 's');
494
509
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
495
510
  const ticker = this.parseWsBidAsk(data, market);
@@ -515,8 +530,9 @@ export default class aster extends asterRest {
515
530
  * @method
516
531
  * @name aster#watchTrades
517
532
  * @description watches information on multiple trades made in a market
518
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
519
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
533
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#collection-transaction-flow
534
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#tick-by-tick-trades
535
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#aggregate-trade-streams
520
536
  * @param {string} symbol unified market symbol of the market trades were made in
521
537
  * @param {int} [since] the earliest time in ms to fetch trades for
522
538
  * @param {int} [limit] the maximum number of trade structures to retrieve
@@ -531,8 +547,9 @@ export default class aster extends asterRest {
531
547
  * @method
532
548
  * @name aster#unWatchTrades
533
549
  * @description unsubscribe from the trades channel
534
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
535
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
550
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#collection-transaction-flow
551
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#tick-by-tick-trades
552
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#aggregate-trade-streams
536
553
  * @param {string} symbol unified market symbol of the market trades were made in
537
554
  * @param {object} [params] extra parameters specific to the exchange API endpoint
538
555
  * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
@@ -545,8 +562,9 @@ export default class aster extends asterRest {
545
562
  * @method
546
563
  * @name aster#watchTradesForSymbols
547
564
  * @description get the list of most recent trades for a list of symbols
548
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#collection-transaction-flow
549
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#aggregate-trade-streams
565
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#collection-transaction-flow
566
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#tick-by-tick-trades
567
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#aggregate-trade-streams
550
568
  * @param {string[]} symbols unified symbol of the market to fetch trades for
551
569
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
552
570
  * @param {int} [limit] the maximum amount of trades to fetch
@@ -571,12 +589,14 @@ export default class aster extends asterRest {
571
589
  const request = {
572
590
  'method': 'SUBSCRIBE',
573
591
  'params': subscriptionArgs,
592
+ 'id': 1,
574
593
  };
575
594
  for (let i = 0; i < symbols.length; i++) {
576
595
  const symbol = symbols[i];
577
596
  const market = this.market(symbol);
578
- subscriptionArgs.push(this.safeStringLower(market, 'id') + '@aggTrade');
579
- messageHashes.push('trade:' + market['symbol']);
597
+ const marketId = this.safeStringLower(market, 'id');
598
+ subscriptionArgs.push(marketId + '@aggTrade');
599
+ messageHashes.push('trade::' + market['symbol']);
580
600
  }
581
601
  const trades = await this.watchMultiple(url, messageHashes, this.extend(request, params), messageHashes);
582
602
  if (this.newUpdates) {
@@ -626,54 +646,35 @@ export default class aster extends asterRest {
626
646
  handleTrade(client, message) {
627
647
  //
628
648
  // {
629
- // "stream": "btcusdt@aggTrade",
630
- // "data": {
631
- // "e": "aggTrade",
632
- // "E": 1754551358681,
633
- // "a": 20505890,
634
- // "s": "BTCUSDT",
635
- // "p": "114783.7",
636
- // "q": "0.020",
637
- // "f": 26024678,
638
- // "l": 26024682,
639
- // "T": 1754551358528,
640
- // "m": false
641
- // }
649
+ // "e": "aggTrade",
650
+ // "E": 1754551358681,
651
+ // "a": 20505890,
652
+ // "s": "BTCUSDT",
653
+ // "p": "114783.7",
654
+ // "q": "0.020",
655
+ // "f": 26024678,
656
+ // "l": 26024682,
657
+ // "T": 1754551358528,
658
+ // "m": false
642
659
  // }
643
660
  //
644
661
  const marketType = this.getAccountTypeFromUrl(client.url);
645
- const trade = this.safeDict(message, 'data');
662
+ const trade = message;
646
663
  const marketId = this.safeString(trade, 's');
647
664
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
648
665
  const parsed = this.parseWsTrade(trade, market);
649
666
  const symbol = parsed['symbol'];
650
- let stored = this.safeValue(this.trades, symbol);
651
- if (stored === undefined) {
667
+ if (!(symbol in this.trades)) {
652
668
  const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
653
- stored = new ArrayCache(limit);
654
- this.trades[symbol] = stored;
669
+ this.trades[symbol] = new ArrayCache(limit);
655
670
  }
671
+ const stored = this.trades[symbol];
656
672
  stored.append(parsed);
657
- const messageHash = 'trade' + ':' + symbol;
658
- client.resolve(stored, messageHash);
673
+ client.resolve(stored, 'trade::' + symbol);
659
674
  }
660
675
  parseWsTrade(trade, market = undefined) {
661
676
  //
662
- // public watchTrades
663
- //
664
- // {
665
- // "e": "trade", // event type
666
- // "E": 1579481530911, // event time
667
- // "s": "ETHBTC", // symbol
668
- // "t": 158410082, // trade id
669
- // "p": "0.01914100", // price
670
- // "q": "0.00700000", // quantity
671
- // "b": 586187049, // buyer order id
672
- // "a": 586186710, // seller order id
673
- // "T": 1579481530910, // trade time
674
- // "m": false, // is the buyer the market maker
675
- // "M": true // binance docs say it should be ignored
676
- // }
677
+ // public watchTrades (spot)
677
678
  //
678
679
  // {
679
680
  // "e": "aggTrade", // Event type
@@ -824,8 +825,10 @@ export default class aster extends asterRest {
824
825
  * @method
825
826
  * @name aster#watchOrderBook
826
827
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
827
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
828
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
828
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
829
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
830
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
831
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
829
832
  * @param {string} symbol unified symbol of the market to fetch the order book for
830
833
  * @param {int} [limit] the maximum amount of order book entries to return.
831
834
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -839,8 +842,10 @@ export default class aster extends asterRest {
839
842
  * @method
840
843
  * @name aster#unWatchOrderBook
841
844
  * @description unsubscribe from the orderbook channel
842
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
843
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
845
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
846
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
847
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
848
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
844
849
  * @param {string} symbol symbol of the market to unwatch the trades for
845
850
  * @param {object} [params] extra parameters specific to the exchange API endpoint
846
851
  * @param {int} [params.limit] orderbook limit, default is undefined
@@ -854,8 +859,10 @@ export default class aster extends asterRest {
854
859
  * @method
855
860
  * @name aster#watchOrderBookForSymbols
856
861
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
857
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
858
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
862
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
863
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
864
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
865
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
859
866
  * @param {string[]} symbols unified array of symbols
860
867
  * @param {int} [limit] the maximum amount of order book entries to return.
861
868
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -896,8 +903,10 @@ export default class aster extends asterRest {
896
903
  * @method
897
904
  * @name aster#unWatchOrderBookForSymbols
898
905
  * @description unsubscribe from the orderbook channel
899
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#limited-depth-information
900
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#partial-book-depth-streams
906
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
907
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
908
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
909
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
901
910
  * @param {string[]} symbols unified symbol of the market to unwatch the trades for
902
911
  * @param {object} [params] extra parameters specific to the exchange API endpoint
903
912
  * @param {int} [params.limit] orderbook limit, default is undefined
@@ -938,8 +947,6 @@ export default class aster extends asterRest {
938
947
  handleOrderBook(client, message) {
939
948
  //
940
949
  // {
941
- // "stream": "btcusdt@depth20",
942
- // "data": {
943
950
  // "e": "depthUpdate",
944
951
  // "E": 1754556878284,
945
952
  // "T": 1754556878031,
@@ -959,11 +966,10 @@ export default class aster extends asterRest {
959
966
  // "1.060"
960
967
  // ]
961
968
  // ]
962
- // }
963
969
  // }
964
970
  //
965
971
  const marketType = this.getAccountTypeFromUrl(client.url);
966
- const data = this.safeDict(message, 'data');
972
+ const data = message;
967
973
  const marketId = this.safeString(data, 's');
968
974
  const timestamp = this.safeInteger(data, 'T');
969
975
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
@@ -982,8 +988,8 @@ export default class aster extends asterRest {
982
988
  * @method
983
989
  * @name aster#watchOHLCV
984
990
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
985
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
986
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
991
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
992
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
987
993
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
988
994
  * @param {string} timeframe the length of time each candle represents
989
995
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
@@ -1002,8 +1008,8 @@ export default class aster extends asterRest {
1002
1008
  * @method
1003
1009
  * @name aster#unWatchOHLCV
1004
1010
  * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1005
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
1006
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
1011
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
1012
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
1007
1013
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
1008
1014
  * @param {string} timeframe the length of time each candle represents
1009
1015
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1017,8 +1023,8 @@ export default class aster extends asterRest {
1017
1023
  * @method
1018
1024
  * @name aster#watchOHLCVForSymbols
1019
1025
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1020
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
1021
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
1026
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
1027
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
1022
1028
  * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
1023
1029
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
1024
1030
  * @param {int} [limit] the maximum amount of candles to fetch
@@ -1066,8 +1072,8 @@ export default class aster extends asterRest {
1066
1072
  * @method
1067
1073
  * @name aster#unWatchOHLCVForSymbols
1068
1074
  * @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
1069
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#k-line-streams
1070
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#klinecandlestick-streams
1075
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
1076
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
1071
1077
  * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
1072
1078
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1073
1079
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
@@ -1107,8 +1113,6 @@ export default class aster extends asterRest {
1107
1113
  handleOHLCV(client, message) {
1108
1114
  //
1109
1115
  // {
1110
- // "stream": "btcusdt@kline_1m",
1111
- // "data": {
1112
1116
  // "e": "kline",
1113
1117
  // "E": 1754655777119,
1114
1118
  // "s": "BTCUSDT",
@@ -1131,11 +1135,10 @@ export default class aster extends asterRest {
1131
1135
  // "Q": "0.0000",
1132
1136
  // "B": "0"
1133
1137
  // }
1134
- // }
1135
1138
  // }
1136
1139
  //
1137
1140
  const marketType = this.getAccountTypeFromUrl(client.url);
1138
- const data = this.safeDict(message, 'data');
1141
+ const data = message;
1139
1142
  const marketId = this.safeString(data, 's');
1140
1143
  const market = this.safeMarket(marketId, undefined, undefined, marketType);
1141
1144
  const symbol = market['symbol'];
@@ -1176,10 +1179,10 @@ export default class aster extends asterRest {
1176
1179
  if (time - lastAuthenticatedTime > listenKeyRefreshRate) {
1177
1180
  let response = undefined;
1178
1181
  if (type === 'spot') {
1179
- response = await this.sapiPrivatePostV1ListenKey(params);
1182
+ response = await this.sapiPrivatePostV3ListenKey(params);
1180
1183
  }
1181
1184
  else {
1182
- response = await this.fapiPrivatePostV1ListenKey(params);
1185
+ response = await this.fapiPrivatePostV3ListenKey(params);
1183
1186
  }
1184
1187
  this.options['listenKey'][type] = this.safeString(response, 'listenKey');
1185
1188
  this.options['lastAuthenticatedTime'][type] = time;
@@ -1195,7 +1198,7 @@ export default class aster extends asterRest {
1195
1198
  return;
1196
1199
  }
1197
1200
  try {
1198
- await this.sapiPrivatePutV1ListenKey(); // extend the expiry
1201
+ await this.sapiPrivatePutV3ListenKey(); // extend the expiry
1199
1202
  }
1200
1203
  catch (error) {
1201
1204
  const url = this.urls['api']['ws']['private'][type] + '/' + listenKey;
@@ -1224,8 +1227,8 @@ export default class aster extends asterRest {
1224
1227
  * @method
1225
1228
  * @name aster#watchBalance
1226
1229
  * @description query for balance and get the amount of funds available for trading or funds locked in orders
1227
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#payload-account_update
1228
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#event-balance-and-position-update
1230
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-account-info/#payload-account_update
1231
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-balance-and-position-update
1229
1232
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1230
1233
  * @param {string} [params.type] 'spot' or 'swap', default is 'spot'
1231
1234
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
@@ -1361,7 +1364,7 @@ export default class aster extends asterRest {
1361
1364
  * @method
1362
1365
  * @name aster#watchPositions
1363
1366
  * @description watch all open positions
1364
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#event-balance-and-position-update
1367
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-balance-and-position-update
1365
1368
  * @param {string[]|undefined} symbols list of unified market symbols
1366
1369
  * @param {number} [since] since timestamp
1367
1370
  * @param {number} [limit] limit
@@ -1553,8 +1556,8 @@ export default class aster extends asterRest {
1553
1556
  * @method
1554
1557
  * @name aster#watchOrders
1555
1558
  * @description watches information on multiple orders made by the user
1556
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#payload-order-update
1557
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#event-order-update
1559
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-account-info/#payload-order-update
1560
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-order-update
1558
1561
  * @param {string} [symbol] unified market symbol of the market orders were made in
1559
1562
  * @param {int} [since] the earliest time in ms to fetch orders for
1560
1563
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1589,8 +1592,8 @@ export default class aster extends asterRest {
1589
1592
  * @method
1590
1593
  * @name aster#watchMyTrades
1591
1594
  * @description watches information on multiple trades made by the user
1592
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-spot-api.md#payload-order-update
1593
- * @see https://github.com/asterdex/api-docs/blob/master/aster-finance-futures-api.md#event-order-update
1595
+ * @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-account-info/#payload-order-update
1596
+ * @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-order-update
1594
1597
  * @param {string} [symbol] unified market symbol of the market orders were made in
1595
1598
  * @param {int} [since] the earliest time in ms to fetch orders for
1596
1599
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -1864,41 +1867,30 @@ export default class aster extends asterRest {
1864
1867
  const marketType = this.getAccountTypeFromUrl(client.url);
1865
1868
  return this.safeMarket(marketId, undefined, undefined, marketType);
1866
1869
  }
1870
+ handleBalanceAndPosition(client, message) {
1871
+ this.handleBalance(client, message);
1872
+ this.handlePositions(client, message);
1873
+ }
1867
1874
  handleMessage(client, message) {
1868
- const stream = this.safeString(message, 'stream');
1869
- if (stream !== undefined) {
1870
- const part = stream.split('@');
1871
- let topic = this.safeString(part, 1, '');
1872
- const part2 = topic.split('_');
1873
- topic = this.safeString(part2, 0, '');
1874
- const methods = {
1875
- 'ticker': this.handleTicker,
1876
- 'aggTrade': this.handleTrade,
1877
- 'depth5': this.handleOrderBook,
1878
- 'depth10': this.handleOrderBook,
1879
- 'depth20': this.handleOrderBook,
1880
- 'kline': this.handleOHLCV,
1881
- 'markPrice': this.handleTicker,
1882
- 'bookTicker': this.handleBidAsk,
1883
- };
1884
- const method = this.safeValue(methods, topic);
1885
- if (method !== undefined) {
1886
- method.call(this, client, message);
1887
- }
1888
- }
1889
- else {
1890
- // private messages
1891
- const event = this.safeString(message, 'e');
1892
- if (event === 'outboundAccountPosition') {
1893
- this.handleBalance(client, message);
1894
- }
1895
- else if (event === 'ACCOUNT_UPDATE') {
1896
- this.handleBalance(client, message);
1897
- this.handlePositions(client, message);
1898
- }
1899
- else if ((event === 'ORDER_TRADE_UPDATE') || (event === 'executionReport')) {
1900
- this.handleOrderUpdate(client, message);
1901
- }
1875
+ const messageInner = this.safeDict(message, 'data', message); // can be either wrapped in 'data' or full object itself
1876
+ const event = this.safeString(messageInner, 'e');
1877
+ const methods = {
1878
+ 'ticker': this.handleTicker,
1879
+ 'aggTrade': this.handleTrade,
1880
+ 'depth5': this.handleOrderBook,
1881
+ 'depth10': this.handleOrderBook,
1882
+ 'depth20': this.handleOrderBook,
1883
+ 'kline': this.handleOHLCV,
1884
+ 'markPrice': this.handleTicker,
1885
+ 'bookTicker': this.handleBidAsk,
1886
+ 'outboundAccountPosition': this.handleBalance,
1887
+ 'ACCOUNT_UPDATE': this.handleBalanceAndPosition,
1888
+ 'executionReport': this.handleOrderUpdate,
1889
+ 'ORDER_TRADE_UPDATE': this.handleOrderUpdate,
1890
+ };
1891
+ const method = this.safeValue(methods, event);
1892
+ if (method !== undefined) {
1893
+ method.call(this, client, messageInner);
1902
1894
  }
1903
1895
  }
1904
1896
  }
@@ -1,13 +1,14 @@
1
1
  // ---------------------------------------------------------------------------
2
2
  import hitbtc from './hitbtc.js';
3
- import hitbtcRest from '../hitbtc.js';
4
3
  import bequantRest from '../bequant.js';
5
4
  // ---------------------------------------------------------------------------
6
5
  export default class bequant extends hitbtc {
7
6
  describe() {
8
7
  // eslint-disable-next-line new-cap
9
- const describeExtended = this.getDescribeForExtendedWsExchange(new bequantRest(), new hitbtcRest(), super.describe());
10
- return this.deepExtend(describeExtended, {
8
+ const restInstance = new bequantRest();
9
+ const restDescribe = restInstance.describe();
10
+ const extended = this.deepExtend(super.describe(), restDescribe);
11
+ return this.deepExtend(extended, {
11
12
  'id': 'bequant',
12
13
  'name': 'Bequant',
13
14
  'countries': ['MT'],
@@ -3511,6 +3511,9 @@ export default class binance extends binanceRest {
3511
3511
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
3512
3512
  */
3513
3513
  async cancelAllOrdersWs(symbol = undefined, params = {}) {
3514
+ if (symbol === undefined) {
3515
+ throw new ArgumentsRequired(this.id + ' cancelAllOrdersWs() requires a symbol argument');
3516
+ }
3514
3517
  await this.loadMarkets();
3515
3518
  const market = this.market(symbol);
3516
3519
  const type = this.getMarketType('cancelAllOrdersWs', market, params);