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.
- package/README.md +10 -9
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/aster.js +1532 -1072
- package/dist/cjs/src/base/Exchange.js +29 -24
- package/dist/cjs/src/bequant.js +3 -0
- package/dist/cjs/src/binance.js +36 -37
- package/dist/cjs/src/binanceusdm.js +1 -0
- package/dist/cjs/src/grvt.js +15 -8
- package/dist/cjs/src/kraken.js +6 -1
- package/dist/cjs/src/pro/aster.js +130 -138
- package/dist/cjs/src/pro/bequant.js +4 -3
- package/dist/cjs/src/pro/binance.js +3 -0
- package/dist/cjs/src/pro/binanceusdm.js +6 -1
- package/dist/cjs/src/pro/grvt.js +3 -3
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/aster.d.ts +43 -9
- package/js/src/aster.d.ts +136 -71
- package/js/src/aster.js +1532 -1072
- package/js/src/base/Exchange.d.ts +3 -4
- package/js/src/base/Exchange.js +29 -24
- package/js/src/bequant.js +3 -0
- package/js/src/binance.js +35 -32
- package/js/src/binanceusdm.js +1 -0
- package/js/src/grvt.js +15 -8
- package/js/src/kraken.js +6 -1
- package/js/src/pro/aster.d.ts +81 -45
- package/js/src/pro/aster.js +130 -138
- package/js/src/pro/bequant.js +4 -3
- package/js/src/pro/binance.js +3 -0
- package/js/src/pro/binanceusdm.js +6 -1
- package/js/src/pro/grvt.js +3 -3
- package/package.json +2 -1
|
@@ -92,8 +92,14 @@ class aster extends aster$1["default"] {
|
|
|
92
92
|
* @method
|
|
93
93
|
* @name aster#watchTicker
|
|
94
94
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
95
|
-
* @see https://github.
|
|
96
|
-
* @see https://github.
|
|
95
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#simplified-ticker-by-symbol
|
|
96
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
|
|
97
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#full-ticker-per-symbol
|
|
98
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
|
|
99
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-mini-ticker-stream
|
|
100
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
|
|
101
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-ticker-streams
|
|
102
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
|
|
97
103
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
98
104
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
99
105
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -109,8 +115,14 @@ class aster extends aster$1["default"] {
|
|
|
109
115
|
* @method
|
|
110
116
|
* @name aster#unWatchTicker
|
|
111
117
|
* @description unWatches a price ticker
|
|
112
|
-
* @see https://github.
|
|
113
|
-
* @see https://github.
|
|
118
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#simplified-ticker-by-symbol
|
|
119
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
|
|
120
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#full-ticker-per-symbol
|
|
121
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
|
|
122
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-mini-ticker-stream
|
|
123
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
|
|
124
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-ticker-streams
|
|
125
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
|
|
114
126
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
115
127
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
116
128
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -123,8 +135,10 @@ class aster extends aster$1["default"] {
|
|
|
123
135
|
* @method
|
|
124
136
|
* @name aster#watchTickers
|
|
125
137
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
126
|
-
* @see https://github.
|
|
127
|
-
* @see https://github.
|
|
138
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
|
|
139
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
|
|
140
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
|
|
141
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
|
|
128
142
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
129
143
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
130
144
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -166,8 +180,10 @@ class aster extends aster$1["default"] {
|
|
|
166
180
|
* @method
|
|
167
181
|
* @name aster#unWatchTickers
|
|
168
182
|
* @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
169
|
-
* @see https://github.
|
|
170
|
-
* @see https://github.
|
|
183
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#compact-tickers-for-all-symbols-in-the-entire-market
|
|
184
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#complete-ticker-for-all-trading-pairs-on-the-entire-market
|
|
185
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-mini-tickers-stream
|
|
186
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-market-tickers-streams
|
|
171
187
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
172
188
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
173
189
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -203,7 +219,8 @@ class aster extends aster$1["default"] {
|
|
|
203
219
|
* @method
|
|
204
220
|
* @name aster#watchMarkPrice
|
|
205
221
|
* @description watches a mark price for a specific market
|
|
206
|
-
* @see https://github.
|
|
222
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
|
|
223
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
|
|
207
224
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
208
225
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
209
226
|
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
@@ -220,7 +237,8 @@ class aster extends aster$1["default"] {
|
|
|
220
237
|
* @method
|
|
221
238
|
* @name aster#unWatchMarkPrice
|
|
222
239
|
* @description unWatches a mark price for a specific market
|
|
223
|
-
* @see https://github.
|
|
240
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
|
|
241
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
|
|
224
242
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
225
243
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
226
244
|
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
@@ -234,7 +252,8 @@ class aster extends aster$1["default"] {
|
|
|
234
252
|
* @method
|
|
235
253
|
* @name aster#watchMarkPrices
|
|
236
254
|
* @description watches the mark price for all markets
|
|
237
|
-
* @see https://github.
|
|
255
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
|
|
256
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
|
|
238
257
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
239
258
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
240
259
|
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
@@ -279,7 +298,8 @@ class aster extends aster$1["default"] {
|
|
|
279
298
|
* @method
|
|
280
299
|
* @name aster#unWatchMarkPrices
|
|
281
300
|
* @description watches the mark price for all markets
|
|
282
|
-
* @see https://github.
|
|
301
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream
|
|
302
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#mark-price-stream-for-all-market
|
|
283
303
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
284
304
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
285
305
|
* @param {boolean} [params.use1sFreq] *default is true* if set to true, the mark price will be updated every second, otherwise every 3 seconds
|
|
@@ -317,8 +337,6 @@ class aster extends aster$1["default"] {
|
|
|
317
337
|
handleTicker(client, message) {
|
|
318
338
|
//
|
|
319
339
|
// {
|
|
320
|
-
// "stream": "trumpusdt@ticker",
|
|
321
|
-
// "data": {
|
|
322
340
|
// "e": "24hrTicker",
|
|
323
341
|
// "E": 1754451187277,
|
|
324
342
|
// "s": "CAKEUSDT",
|
|
@@ -337,11 +355,8 @@ class aster extends aster$1["default"] {
|
|
|
337
355
|
// "F": 6571389,
|
|
338
356
|
// "L": 6574507,
|
|
339
357
|
// "n": 3119
|
|
340
|
-
// }
|
|
341
358
|
// }
|
|
342
359
|
// {
|
|
343
|
-
// "stream": "btcusdt@markPrice",
|
|
344
|
-
// "data": {
|
|
345
360
|
// "e": "markPriceUpdate",
|
|
346
361
|
// "E": 1754660466000,
|
|
347
362
|
// "s": "BTCUSDT",
|
|
@@ -350,11 +365,10 @@ class aster extends aster$1["default"] {
|
|
|
350
365
|
// "i": "116836.93534884",
|
|
351
366
|
// "r": "0.00010000",
|
|
352
367
|
// "T": 1754668800000
|
|
353
|
-
// }
|
|
354
368
|
// }
|
|
355
369
|
//
|
|
356
370
|
const marketType = this.getAccountTypeFromUrl(client.url);
|
|
357
|
-
const ticker =
|
|
371
|
+
const ticker = message;
|
|
358
372
|
const parsed = this.parseWsTicker(ticker, marketType);
|
|
359
373
|
const symbol = parsed['symbol'];
|
|
360
374
|
const messageHash = 'ticker:' + symbol;
|
|
@@ -406,8 +420,10 @@ class aster extends aster$1["default"] {
|
|
|
406
420
|
* @method
|
|
407
421
|
* @name aster#watchBidsAsks
|
|
408
422
|
* @description watches best bid & ask for symbols
|
|
409
|
-
* @see https://github.
|
|
410
|
-
* @see https://github.
|
|
423
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-by-symbol
|
|
424
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-across-the-entire-market
|
|
425
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-book-ticker-streams
|
|
426
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-book-tickers-stream
|
|
411
427
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
412
428
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
413
429
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -446,8 +462,10 @@ class aster extends aster$1["default"] {
|
|
|
446
462
|
* @method
|
|
447
463
|
* @name aster#unWatchBidsAsks
|
|
448
464
|
* @description unWatches best bid & ask for symbols
|
|
449
|
-
* @see https://github.
|
|
450
|
-
* @see https://github.
|
|
465
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-by-symbol
|
|
466
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#best-order-book-information-across-the-entire-market
|
|
467
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#individual-symbol-book-ticker-streams
|
|
468
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#all-book-tickers-stream
|
|
451
469
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
452
470
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
453
471
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -479,8 +497,6 @@ class aster extends aster$1["default"] {
|
|
|
479
497
|
handleBidAsk(client, message) {
|
|
480
498
|
//
|
|
481
499
|
// {
|
|
482
|
-
// "stream": "btcusdt@bookTicker",
|
|
483
|
-
// "data": {
|
|
484
500
|
// "e": "bookTicker",
|
|
485
501
|
// "u": 157240846459,
|
|
486
502
|
// "s": "BTCUSDT",
|
|
@@ -490,11 +506,10 @@ class aster extends aster$1["default"] {
|
|
|
490
506
|
// "A": "0.001",
|
|
491
507
|
// "T": 1754896692922,
|
|
492
508
|
// "E": 1754896692926
|
|
493
|
-
// }
|
|
494
509
|
// }
|
|
495
510
|
//
|
|
496
511
|
const marketType = this.getAccountTypeFromUrl(client.url);
|
|
497
|
-
const data =
|
|
512
|
+
const data = message;
|
|
498
513
|
const marketId = this.safeString(data, 's');
|
|
499
514
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
500
515
|
const ticker = this.parseWsBidAsk(data, market);
|
|
@@ -520,8 +535,9 @@ class aster extends aster$1["default"] {
|
|
|
520
535
|
* @method
|
|
521
536
|
* @name aster#watchTrades
|
|
522
537
|
* @description watches information on multiple trades made in a market
|
|
523
|
-
* @see https://github.
|
|
524
|
-
* @see https://github.
|
|
538
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#collection-transaction-flow
|
|
539
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#tick-by-tick-trades
|
|
540
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#aggregate-trade-streams
|
|
525
541
|
* @param {string} symbol unified market symbol of the market trades were made in
|
|
526
542
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
527
543
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
@@ -536,8 +552,9 @@ class aster extends aster$1["default"] {
|
|
|
536
552
|
* @method
|
|
537
553
|
* @name aster#unWatchTrades
|
|
538
554
|
* @description unsubscribe from the trades channel
|
|
539
|
-
* @see https://github.
|
|
540
|
-
* @see https://github.
|
|
555
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#collection-transaction-flow
|
|
556
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#tick-by-tick-trades
|
|
557
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#aggregate-trade-streams
|
|
541
558
|
* @param {string} symbol unified market symbol of the market trades were made in
|
|
542
559
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
543
560
|
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
@@ -550,8 +567,9 @@ class aster extends aster$1["default"] {
|
|
|
550
567
|
* @method
|
|
551
568
|
* @name aster#watchTradesForSymbols
|
|
552
569
|
* @description get the list of most recent trades for a list of symbols
|
|
553
|
-
* @see https://github.
|
|
554
|
-
* @see https://github.
|
|
570
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#collection-transaction-flow
|
|
571
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#tick-by-tick-trades
|
|
572
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#aggregate-trade-streams
|
|
555
573
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
556
574
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
557
575
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -576,12 +594,14 @@ class aster extends aster$1["default"] {
|
|
|
576
594
|
const request = {
|
|
577
595
|
'method': 'SUBSCRIBE',
|
|
578
596
|
'params': subscriptionArgs,
|
|
597
|
+
'id': 1,
|
|
579
598
|
};
|
|
580
599
|
for (let i = 0; i < symbols.length; i++) {
|
|
581
600
|
const symbol = symbols[i];
|
|
582
601
|
const market = this.market(symbol);
|
|
583
|
-
|
|
584
|
-
|
|
602
|
+
const marketId = this.safeStringLower(market, 'id');
|
|
603
|
+
subscriptionArgs.push(marketId + '@aggTrade');
|
|
604
|
+
messageHashes.push('trade::' + market['symbol']);
|
|
585
605
|
}
|
|
586
606
|
const trades = await this.watchMultiple(url, messageHashes, this.extend(request, params), messageHashes);
|
|
587
607
|
if (this.newUpdates) {
|
|
@@ -631,54 +651,35 @@ class aster extends aster$1["default"] {
|
|
|
631
651
|
handleTrade(client, message) {
|
|
632
652
|
//
|
|
633
653
|
// {
|
|
634
|
-
// "
|
|
635
|
-
// "
|
|
636
|
-
//
|
|
637
|
-
//
|
|
638
|
-
//
|
|
639
|
-
//
|
|
640
|
-
//
|
|
641
|
-
//
|
|
642
|
-
//
|
|
643
|
-
//
|
|
644
|
-
// "T": 1754551358528,
|
|
645
|
-
// "m": false
|
|
646
|
-
// }
|
|
654
|
+
// "e": "aggTrade",
|
|
655
|
+
// "E": 1754551358681,
|
|
656
|
+
// "a": 20505890,
|
|
657
|
+
// "s": "BTCUSDT",
|
|
658
|
+
// "p": "114783.7",
|
|
659
|
+
// "q": "0.020",
|
|
660
|
+
// "f": 26024678,
|
|
661
|
+
// "l": 26024682,
|
|
662
|
+
// "T": 1754551358528,
|
|
663
|
+
// "m": false
|
|
647
664
|
// }
|
|
648
665
|
//
|
|
649
666
|
const marketType = this.getAccountTypeFromUrl(client.url);
|
|
650
|
-
const trade =
|
|
667
|
+
const trade = message;
|
|
651
668
|
const marketId = this.safeString(trade, 's');
|
|
652
669
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
653
670
|
const parsed = this.parseWsTrade(trade, market);
|
|
654
671
|
const symbol = parsed['symbol'];
|
|
655
|
-
|
|
656
|
-
if (stored === undefined) {
|
|
672
|
+
if (!(symbol in this.trades)) {
|
|
657
673
|
const limit = this.safeInteger(this.options, 'tradesLimit', 1000);
|
|
658
|
-
|
|
659
|
-
this.trades[symbol] = stored;
|
|
674
|
+
this.trades[symbol] = new Cache.ArrayCache(limit);
|
|
660
675
|
}
|
|
676
|
+
const stored = this.trades[symbol];
|
|
661
677
|
stored.append(parsed);
|
|
662
|
-
|
|
663
|
-
client.resolve(stored, messageHash);
|
|
678
|
+
client.resolve(stored, 'trade::' + symbol);
|
|
664
679
|
}
|
|
665
680
|
parseWsTrade(trade, market = undefined) {
|
|
666
681
|
//
|
|
667
|
-
// public watchTrades
|
|
668
|
-
//
|
|
669
|
-
// {
|
|
670
|
-
// "e": "trade", // event type
|
|
671
|
-
// "E": 1579481530911, // event time
|
|
672
|
-
// "s": "ETHBTC", // symbol
|
|
673
|
-
// "t": 158410082, // trade id
|
|
674
|
-
// "p": "0.01914100", // price
|
|
675
|
-
// "q": "0.00700000", // quantity
|
|
676
|
-
// "b": 586187049, // buyer order id
|
|
677
|
-
// "a": 586186710, // seller order id
|
|
678
|
-
// "T": 1579481530910, // trade time
|
|
679
|
-
// "m": false, // is the buyer the market maker
|
|
680
|
-
// "M": true // binance docs say it should be ignored
|
|
681
|
-
// }
|
|
682
|
+
// public watchTrades (spot)
|
|
682
683
|
//
|
|
683
684
|
// {
|
|
684
685
|
// "e": "aggTrade", // Event type
|
|
@@ -829,8 +830,10 @@ class aster extends aster$1["default"] {
|
|
|
829
830
|
* @method
|
|
830
831
|
* @name aster#watchOrderBook
|
|
831
832
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
832
|
-
* @see https://github.
|
|
833
|
-
* @see https://github.
|
|
833
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
|
|
834
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
|
|
835
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
|
|
836
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
|
|
834
837
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
835
838
|
* @param {int} [limit] the maximum amount of order book entries to return.
|
|
836
839
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -844,8 +847,10 @@ class aster extends aster$1["default"] {
|
|
|
844
847
|
* @method
|
|
845
848
|
* @name aster#unWatchOrderBook
|
|
846
849
|
* @description unsubscribe from the orderbook channel
|
|
847
|
-
* @see https://github.
|
|
848
|
-
* @see https://github.
|
|
850
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
|
|
851
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
|
|
852
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
|
|
853
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
|
|
849
854
|
* @param {string} symbol symbol of the market to unwatch the trades for
|
|
850
855
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
851
856
|
* @param {int} [params.limit] orderbook limit, default is undefined
|
|
@@ -859,8 +864,10 @@ class aster extends aster$1["default"] {
|
|
|
859
864
|
* @method
|
|
860
865
|
* @name aster#watchOrderBookForSymbols
|
|
861
866
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
862
|
-
* @see https://github.
|
|
863
|
-
* @see https://github.
|
|
867
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
|
|
868
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
|
|
869
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
|
|
870
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
|
|
864
871
|
* @param {string[]} symbols unified array of symbols
|
|
865
872
|
* @param {int} [limit] the maximum amount of order book entries to return.
|
|
866
873
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -901,8 +908,10 @@ class aster extends aster$1["default"] {
|
|
|
901
908
|
* @method
|
|
902
909
|
* @name aster#unWatchOrderBookForSymbols
|
|
903
910
|
* @description unsubscribe from the orderbook channel
|
|
904
|
-
* @see https://github.
|
|
905
|
-
* @see https://github.
|
|
911
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#limited-depth-information
|
|
912
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#incremental-depth-information
|
|
913
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#partial-book-depth-streams
|
|
914
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#diff-book-depth-streams
|
|
906
915
|
* @param {string[]} symbols unified symbol of the market to unwatch the trades for
|
|
907
916
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
908
917
|
* @param {int} [params.limit] orderbook limit, default is undefined
|
|
@@ -943,8 +952,6 @@ class aster extends aster$1["default"] {
|
|
|
943
952
|
handleOrderBook(client, message) {
|
|
944
953
|
//
|
|
945
954
|
// {
|
|
946
|
-
// "stream": "btcusdt@depth20",
|
|
947
|
-
// "data": {
|
|
948
955
|
// "e": "depthUpdate",
|
|
949
956
|
// "E": 1754556878284,
|
|
950
957
|
// "T": 1754556878031,
|
|
@@ -964,11 +971,10 @@ class aster extends aster$1["default"] {
|
|
|
964
971
|
// "1.060"
|
|
965
972
|
// ]
|
|
966
973
|
// ]
|
|
967
|
-
// }
|
|
968
974
|
// }
|
|
969
975
|
//
|
|
970
976
|
const marketType = this.getAccountTypeFromUrl(client.url);
|
|
971
|
-
const data =
|
|
977
|
+
const data = message;
|
|
972
978
|
const marketId = this.safeString(data, 's');
|
|
973
979
|
const timestamp = this.safeInteger(data, 'T');
|
|
974
980
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
@@ -987,8 +993,8 @@ class aster extends aster$1["default"] {
|
|
|
987
993
|
* @method
|
|
988
994
|
* @name aster#watchOHLCV
|
|
989
995
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
990
|
-
* @see https://github.
|
|
991
|
-
* @see https://github.
|
|
996
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
|
|
997
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
|
|
992
998
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
993
999
|
* @param {string} timeframe the length of time each candle represents
|
|
994
1000
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
@@ -1007,8 +1013,8 @@ class aster extends aster$1["default"] {
|
|
|
1007
1013
|
* @method
|
|
1008
1014
|
* @name aster#unWatchOHLCV
|
|
1009
1015
|
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1010
|
-
* @see https://github.
|
|
1011
|
-
* @see https://github.
|
|
1016
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
|
|
1017
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
|
|
1012
1018
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1013
1019
|
* @param {string} timeframe the length of time each candle represents
|
|
1014
1020
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -1022,8 +1028,8 @@ class aster extends aster$1["default"] {
|
|
|
1022
1028
|
* @method
|
|
1023
1029
|
* @name aster#watchOHLCVForSymbols
|
|
1024
1030
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1025
|
-
* @see https://github.
|
|
1026
|
-
* @see https://github.
|
|
1031
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
|
|
1032
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
|
|
1027
1033
|
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
1028
1034
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1029
1035
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
@@ -1071,8 +1077,8 @@ class aster extends aster$1["default"] {
|
|
|
1071
1077
|
* @method
|
|
1072
1078
|
* @name aster#unWatchOHLCVForSymbols
|
|
1073
1079
|
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1074
|
-
* @see https://github.
|
|
1075
|
-
* @see https://github.
|
|
1080
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-market-streams/#k-line-streams
|
|
1081
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/websocket-market-streams/#klinecandlestick-streams
|
|
1076
1082
|
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
|
|
1077
1083
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1078
1084
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
@@ -1112,8 +1118,6 @@ class aster extends aster$1["default"] {
|
|
|
1112
1118
|
handleOHLCV(client, message) {
|
|
1113
1119
|
//
|
|
1114
1120
|
// {
|
|
1115
|
-
// "stream": "btcusdt@kline_1m",
|
|
1116
|
-
// "data": {
|
|
1117
1121
|
// "e": "kline",
|
|
1118
1122
|
// "E": 1754655777119,
|
|
1119
1123
|
// "s": "BTCUSDT",
|
|
@@ -1136,11 +1140,10 @@ class aster extends aster$1["default"] {
|
|
|
1136
1140
|
// "Q": "0.0000",
|
|
1137
1141
|
// "B": "0"
|
|
1138
1142
|
// }
|
|
1139
|
-
// }
|
|
1140
1143
|
// }
|
|
1141
1144
|
//
|
|
1142
1145
|
const marketType = this.getAccountTypeFromUrl(client.url);
|
|
1143
|
-
const data =
|
|
1146
|
+
const data = message;
|
|
1144
1147
|
const marketId = this.safeString(data, 's');
|
|
1145
1148
|
const market = this.safeMarket(marketId, undefined, undefined, marketType);
|
|
1146
1149
|
const symbol = market['symbol'];
|
|
@@ -1181,10 +1184,10 @@ class aster extends aster$1["default"] {
|
|
|
1181
1184
|
if (time - lastAuthenticatedTime > listenKeyRefreshRate) {
|
|
1182
1185
|
let response = undefined;
|
|
1183
1186
|
if (type === 'spot') {
|
|
1184
|
-
response = await this.
|
|
1187
|
+
response = await this.sapiPrivatePostV3ListenKey(params);
|
|
1185
1188
|
}
|
|
1186
1189
|
else {
|
|
1187
|
-
response = await this.
|
|
1190
|
+
response = await this.fapiPrivatePostV3ListenKey(params);
|
|
1188
1191
|
}
|
|
1189
1192
|
this.options['listenKey'][type] = this.safeString(response, 'listenKey');
|
|
1190
1193
|
this.options['lastAuthenticatedTime'][type] = time;
|
|
@@ -1200,7 +1203,7 @@ class aster extends aster$1["default"] {
|
|
|
1200
1203
|
return;
|
|
1201
1204
|
}
|
|
1202
1205
|
try {
|
|
1203
|
-
await this.
|
|
1206
|
+
await this.sapiPrivatePutV3ListenKey(); // extend the expiry
|
|
1204
1207
|
}
|
|
1205
1208
|
catch (error) {
|
|
1206
1209
|
const url = this.urls['api']['ws']['private'][type] + '/' + listenKey;
|
|
@@ -1229,8 +1232,8 @@ class aster extends aster$1["default"] {
|
|
|
1229
1232
|
* @method
|
|
1230
1233
|
* @name aster#watchBalance
|
|
1231
1234
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1232
|
-
* @see https://github.
|
|
1233
|
-
* @see https://github.
|
|
1235
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-account-info/#payload-account_update
|
|
1236
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-balance-and-position-update
|
|
1234
1237
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1235
1238
|
* @param {string} [params.type] 'spot' or 'swap', default is 'spot'
|
|
1236
1239
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
|
|
@@ -1366,7 +1369,7 @@ class aster extends aster$1["default"] {
|
|
|
1366
1369
|
* @method
|
|
1367
1370
|
* @name aster#watchPositions
|
|
1368
1371
|
* @description watch all open positions
|
|
1369
|
-
* @see https://github.
|
|
1372
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-balance-and-position-update
|
|
1370
1373
|
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1371
1374
|
* @param {number} [since] since timestamp
|
|
1372
1375
|
* @param {number} [limit] limit
|
|
@@ -1558,8 +1561,8 @@ class aster extends aster$1["default"] {
|
|
|
1558
1561
|
* @method
|
|
1559
1562
|
* @name aster#watchOrders
|
|
1560
1563
|
* @description watches information on multiple orders made by the user
|
|
1561
|
-
* @see https://github.
|
|
1562
|
-
* @see https://github.
|
|
1564
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-account-info/#payload-order-update
|
|
1565
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-order-update
|
|
1563
1566
|
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
1564
1567
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1565
1568
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1594,8 +1597,8 @@ class aster extends aster$1["default"] {
|
|
|
1594
1597
|
* @method
|
|
1595
1598
|
* @name aster#watchMyTrades
|
|
1596
1599
|
* @description watches information on multiple trades made by the user
|
|
1597
|
-
* @see https://github.
|
|
1598
|
-
* @see https://github.
|
|
1600
|
+
* @see https://asterdex.github.io/aster-api-website/spot-v3/websocket-account-info/#payload-order-update
|
|
1601
|
+
* @see https://asterdex.github.io/aster-api-website/futures-v3/user-data-streams/#event-order-update
|
|
1599
1602
|
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
1600
1603
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1601
1604
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -1869,41 +1872,30 @@ class aster extends aster$1["default"] {
|
|
|
1869
1872
|
const marketType = this.getAccountTypeFromUrl(client.url);
|
|
1870
1873
|
return this.safeMarket(marketId, undefined, undefined, marketType);
|
|
1871
1874
|
}
|
|
1875
|
+
handleBalanceAndPosition(client, message) {
|
|
1876
|
+
this.handleBalance(client, message);
|
|
1877
|
+
this.handlePositions(client, message);
|
|
1878
|
+
}
|
|
1872
1879
|
handleMessage(client, message) {
|
|
1873
|
-
const
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
}
|
|
1893
|
-
}
|
|
1894
|
-
else {
|
|
1895
|
-
// private messages
|
|
1896
|
-
const event = this.safeString(message, 'e');
|
|
1897
|
-
if (event === 'outboundAccountPosition') {
|
|
1898
|
-
this.handleBalance(client, message);
|
|
1899
|
-
}
|
|
1900
|
-
else if (event === 'ACCOUNT_UPDATE') {
|
|
1901
|
-
this.handleBalance(client, message);
|
|
1902
|
-
this.handlePositions(client, message);
|
|
1903
|
-
}
|
|
1904
|
-
else if ((event === 'ORDER_TRADE_UPDATE') || (event === 'executionReport')) {
|
|
1905
|
-
this.handleOrderUpdate(client, message);
|
|
1906
|
-
}
|
|
1880
|
+
const messageInner = this.safeDict(message, 'data', message); // can be either wrapped in 'data' or full object itself
|
|
1881
|
+
const event = this.safeString(messageInner, 'e');
|
|
1882
|
+
const methods = {
|
|
1883
|
+
'ticker': this.handleTicker,
|
|
1884
|
+
'aggTrade': this.handleTrade,
|
|
1885
|
+
'depth5': this.handleOrderBook,
|
|
1886
|
+
'depth10': this.handleOrderBook,
|
|
1887
|
+
'depth20': this.handleOrderBook,
|
|
1888
|
+
'kline': this.handleOHLCV,
|
|
1889
|
+
'markPrice': this.handleTicker,
|
|
1890
|
+
'bookTicker': this.handleBidAsk,
|
|
1891
|
+
'outboundAccountPosition': this.handleBalance,
|
|
1892
|
+
'ACCOUNT_UPDATE': this.handleBalanceAndPosition,
|
|
1893
|
+
'executionReport': this.handleOrderUpdate,
|
|
1894
|
+
'ORDER_TRADE_UPDATE': this.handleOrderUpdate,
|
|
1895
|
+
};
|
|
1896
|
+
const method = this.safeValue(methods, event);
|
|
1897
|
+
if (method !== undefined) {
|
|
1898
|
+
method.call(this, client, messageInner);
|
|
1907
1899
|
}
|
|
1908
1900
|
}
|
|
1909
1901
|
}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var hitbtc = require('./hitbtc.js');
|
|
6
|
-
var hitbtc$1 = require('../hitbtc.js');
|
|
7
6
|
var bequant$1 = require('../bequant.js');
|
|
8
7
|
|
|
9
8
|
// ---------------------------------------------------------------------------
|
|
@@ -11,8 +10,10 @@ var bequant$1 = require('../bequant.js');
|
|
|
11
10
|
class bequant extends hitbtc["default"] {
|
|
12
11
|
describe() {
|
|
13
12
|
// eslint-disable-next-line new-cap
|
|
14
|
-
const
|
|
15
|
-
|
|
13
|
+
const restInstance = new bequant$1["default"]();
|
|
14
|
+
const restDescribe = restInstance.describe();
|
|
15
|
+
const extended = this.deepExtend(super.describe(), restDescribe);
|
|
16
|
+
return this.deepExtend(extended, {
|
|
16
17
|
'id': 'bequant',
|
|
17
18
|
'name': 'Bequant',
|
|
18
19
|
'countries': ['MT'],
|
|
@@ -3516,6 +3516,9 @@ class binance extends binance$1["default"] {
|
|
|
3516
3516
|
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/?id=order-structure}
|
|
3517
3517
|
*/
|
|
3518
3518
|
async cancelAllOrdersWs(symbol = undefined, params = {}) {
|
|
3519
|
+
if (symbol === undefined) {
|
|
3520
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelAllOrdersWs() requires a symbol argument');
|
|
3521
|
+
}
|
|
3519
3522
|
await this.loadMarkets();
|
|
3520
3523
|
const market = this.market(symbol);
|
|
3521
3524
|
const type = this.getMarketType('cancelAllOrdersWs', market, params);
|