ccxt 4.5.44 → 4.5.45
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 +9 -12
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -12
- package/dist/cjs/src/abstract/kucoinfutures.js +1 -1
- package/dist/cjs/src/base/Exchange.js +36 -3
- package/dist/cjs/src/base/functions/encode.js +2 -2
- package/dist/cjs/src/base/functions/generic.js +8 -2
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/btcbox.js +1 -1
- package/dist/cjs/src/cex.js +1 -0
- package/dist/cjs/src/gate.js +227 -168
- package/dist/cjs/src/grvt.js +3 -2
- package/dist/cjs/src/hyperliquid.js +16 -5
- package/dist/cjs/src/kraken.js +2 -2
- package/dist/cjs/src/krakenfutures.js +1 -5
- package/dist/cjs/src/kucoin.js +4729 -970
- package/dist/cjs/src/kucoinfutures.js +14 -3434
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/pro/gate.js +37 -1
- package/dist/cjs/src/pro/kucoin.js +819 -178
- package/dist/cjs/src/pro/kucoinfutures.js +95 -1261
- package/dist/cjs/src/pro/mexc.js +10 -5
- package/dist/cjs/src/pro/okx.js +84 -39
- package/js/ccxt.d.ts +2 -14
- package/js/ccxt.js +2 -10
- package/js/src/abstract/kucoin.d.ts +46 -3
- package/js/src/abstract/kucoinfutures.d.ts +27 -12
- package/js/src/base/Exchange.d.ts +12 -1
- package/js/src/base/Exchange.js +36 -3
- package/js/src/base/functions/encode.js +2 -2
- package/js/src/base/functions/generic.js +9 -3
- package/js/src/bitrue.js +1 -1
- package/js/src/bitteam.js +1 -1
- package/js/src/btcbox.js +1 -1
- package/js/src/cex.js +2 -1
- package/js/src/gate.d.ts +125 -119
- package/js/src/gate.js +227 -168
- package/js/src/grvt.js +3 -2
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +16 -5
- package/js/src/kraken.js +2 -2
- package/js/src/krakenfutures.js +1 -5
- package/js/src/kucoin.d.ts +696 -100
- package/js/src/kucoin.js +4730 -971
- package/js/src/kucoinfutures.d.ts +4 -522
- package/js/src/kucoinfutures.js +14 -3434
- package/js/src/lbank.js +1 -1
- package/js/src/poloniex.js +1 -1
- package/js/src/pro/gate.d.ts +30 -1
- package/js/src/pro/gate.js +37 -1
- package/js/src/pro/kucoin.d.ts +70 -30
- package/js/src/pro/kucoin.js +821 -180
- package/js/src/pro/kucoinfutures.d.ts +17 -195
- package/js/src/pro/kucoinfutures.js +96 -1262
- package/js/src/pro/mexc.js +10 -5
- package/js/src/pro/okx.d.ts +1 -0
- package/js/src/pro/okx.js +84 -39
- package/package.json +1 -1
- package/dist/cjs/src/abstract/alp.js +0 -11
- package/dist/cjs/src/abstract/defx.js +0 -11
- package/dist/cjs/src/abstract/timex.js +0 -11
- package/dist/cjs/src/alp.js +0 -1059
- package/dist/cjs/src/defx.js +0 -2142
- package/dist/cjs/src/pro/defx.js +0 -866
- package/dist/cjs/src/timex.js +0 -1793
- package/js/src/abstract/alp.d.ts +0 -21
- package/js/src/abstract/alp.js +0 -5
- package/js/src/abstract/defx.d.ts +0 -72
- package/js/src/abstract/defx.js +0 -5
- package/js/src/abstract/timex.d.ts +0 -65
- package/js/src/abstract/timex.js +0 -5
- package/js/src/alp.d.ts +0 -209
- package/js/src/alp.js +0 -1052
- package/js/src/defx.d.ts +0 -348
- package/js/src/defx.js +0 -2135
- package/js/src/pro/defx.d.ts +0 -236
- package/js/src/pro/defx.js +0 -859
- package/js/src/timex.d.ts +0 -247
- package/js/src/timex.js +0 -1786
package/dist/cjs/src/lbank.js
CHANGED
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -3621,7 +3621,7 @@ class poloniex extends poloniex$1["default"] {
|
|
|
3621
3621
|
if (this.inArray(api, ['swapPublic', 'swapPrivate'])) {
|
|
3622
3622
|
url = this.urls['api']['swap'];
|
|
3623
3623
|
}
|
|
3624
|
-
if ('symbol' in params) {
|
|
3624
|
+
if (method === 'GET' && ('symbol' in params)) {
|
|
3625
3625
|
params['symbol'] = this.encodeURIComponent(params['symbol']); // handle symbols like 索拉拉/USDT'
|
|
3626
3626
|
}
|
|
3627
3627
|
const query = this.omit(params, this.extractParams(path));
|
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -182,6 +182,7 @@ class gate extends gate$1["default"] {
|
|
|
182
182
|
if (market['swap'] !== true) {
|
|
183
183
|
throw new errors.NotSupported(this.id + ' createOrdersWs is not supported for swap markets');
|
|
184
184
|
}
|
|
185
|
+
// todo add swap support
|
|
185
186
|
const messageType = this.getTypeByMarket(market);
|
|
186
187
|
const channel = messageType + '.order_batch_place';
|
|
187
188
|
const url = this.getUrlByMarket(market);
|
|
@@ -193,7 +194,7 @@ class gate extends gate$1["default"] {
|
|
|
193
194
|
* @method
|
|
194
195
|
* @name gate#cancelAllOrdersWs
|
|
195
196
|
* @description cancel all open orders
|
|
196
|
-
* @see https://www.gate.
|
|
197
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#cancel-matched-open-orders
|
|
197
198
|
* @see https://www.gate.io/docs/developers/apiv4/ws/en/#order-cancel-all-with-specified-currency-pair
|
|
198
199
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
199
200
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -365,6 +366,7 @@ class gate extends gate$1["default"] {
|
|
|
365
366
|
* @see https://www.gate.com/docs/developers/futures/ws/en/#order-book-api
|
|
366
367
|
* @see https://www.gate.com/docs/developers/futures/ws/en/#order-book-v2-api
|
|
367
368
|
* @see https://www.gate.com/docs/developers/delivery/ws/en/#order-book-api
|
|
369
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#order-book-channel
|
|
368
370
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
369
371
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
370
372
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -383,6 +385,9 @@ class gate extends gate$1["default"] {
|
|
|
383
385
|
const payload = [marketId, interval];
|
|
384
386
|
if (limit === undefined) {
|
|
385
387
|
limit = 100; // max 100 atm
|
|
388
|
+
if (messageType === 'options') {
|
|
389
|
+
limit = 50; // max 50 for options
|
|
390
|
+
}
|
|
386
391
|
}
|
|
387
392
|
if (market['contract']) {
|
|
388
393
|
const stringLimit = limit.toString();
|
|
@@ -574,6 +579,8 @@ class gate extends gate$1["default"] {
|
|
|
574
579
|
* @method
|
|
575
580
|
* @name gate#watchTicker
|
|
576
581
|
* @see https://www.gate.io/docs/developers/apiv4/ws/en/#tickers-channel
|
|
582
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#tickers-api
|
|
583
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#tickers-api
|
|
577
584
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
578
585
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
579
586
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -591,6 +598,8 @@ class gate extends gate$1["default"] {
|
|
|
591
598
|
* @method
|
|
592
599
|
* @name gate#watchTickers
|
|
593
600
|
* @see https://www.gate.io/docs/developers/apiv4/ws/en/#tickers-channel
|
|
601
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#tickers-api
|
|
602
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#tickers-api
|
|
594
603
|
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
|
|
595
604
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
596
605
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -625,6 +634,7 @@ class gate extends gate$1["default"] {
|
|
|
625
634
|
* @name gate#watchBidsAsks
|
|
626
635
|
* @see https://www.gate.io/docs/developers/apiv4/ws/en/#best-bid-or-ask-price
|
|
627
636
|
* @see https://www.gate.io/docs/developers/apiv4/ws/en/#order-book-channel
|
|
637
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#best-bid-or-ask-price
|
|
628
638
|
* @description watches best bid & ask for symbols
|
|
629
639
|
* @param {string[]} symbols unified symbol of the market to fetch the ticker for
|
|
630
640
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -714,6 +724,10 @@ class gate extends gate$1["default"] {
|
|
|
714
724
|
/**
|
|
715
725
|
* @method
|
|
716
726
|
* @name gate#watchTrades
|
|
727
|
+
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#public-trades-channel
|
|
728
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#trades-api
|
|
729
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#trades-api
|
|
730
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#public-contract-trades-channel
|
|
717
731
|
* @description get the list of most recent trades for a particular symbol
|
|
718
732
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
719
733
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -727,6 +741,10 @@ class gate extends gate$1["default"] {
|
|
|
727
741
|
/**
|
|
728
742
|
* @method
|
|
729
743
|
* @name gate#watchTradesForSymbols
|
|
744
|
+
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#public-trades-channel
|
|
745
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#trades-api
|
|
746
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#trades-api
|
|
747
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#public-contract-trades-channel
|
|
730
748
|
* @description get the list of most recent trades for a particular symbol
|
|
731
749
|
* @param {string[]} symbols unified symbol of the market to fetch trades for
|
|
732
750
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
@@ -830,6 +848,9 @@ class gate extends gate$1["default"] {
|
|
|
830
848
|
/**
|
|
831
849
|
* @method
|
|
832
850
|
* @name gate#watchOHLCV
|
|
851
|
+
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#candlesticks-channel
|
|
852
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#candlesticks-api
|
|
853
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#candlesticks-api
|
|
833
854
|
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
834
855
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
835
856
|
* @param {string} timeframe the length of time each candle represents
|
|
@@ -840,6 +861,7 @@ class gate extends gate$1["default"] {
|
|
|
840
861
|
*/
|
|
841
862
|
async watchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
842
863
|
await this.loadMarkets();
|
|
864
|
+
// todo add options support
|
|
843
865
|
const market = this.market(symbol);
|
|
844
866
|
symbol = market['symbol'];
|
|
845
867
|
const marketId = market['id'];
|
|
@@ -914,6 +936,10 @@ class gate extends gate$1["default"] {
|
|
|
914
936
|
/**
|
|
915
937
|
* @method
|
|
916
938
|
* @name gate#watchMyTrades
|
|
939
|
+
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#user-trades-channel
|
|
940
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#user-trades-api
|
|
941
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#user-trades-api
|
|
942
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#user-trades-channel
|
|
917
943
|
* @description watches information on multiple trades made by the user
|
|
918
944
|
* @param {string} symbol unified market symbol of the market trades were made in
|
|
919
945
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
@@ -1007,6 +1033,10 @@ class gate extends gate$1["default"] {
|
|
|
1007
1033
|
/**
|
|
1008
1034
|
* @method
|
|
1009
1035
|
* @name gate#watchBalance
|
|
1036
|
+
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#spot-balance-channel
|
|
1037
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#balances-api
|
|
1038
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#balances-api
|
|
1039
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#balances-channel
|
|
1010
1040
|
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
1011
1041
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1012
1042
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
|
|
@@ -1027,6 +1057,7 @@ class gate extends gate$1["default"] {
|
|
|
1027
1057
|
'swap': 'futures',
|
|
1028
1058
|
'option': 'options',
|
|
1029
1059
|
});
|
|
1060
|
+
// todo: add correct margin support
|
|
1030
1061
|
const channel = channelType + '.balances';
|
|
1031
1062
|
const messageHash = type + '.balance';
|
|
1032
1063
|
return await this.subscribePrivate(url, messageHash, undefined, channel, params, requiresUid);
|
|
@@ -1292,6 +1323,10 @@ class gate extends gate$1["default"] {
|
|
|
1292
1323
|
/**
|
|
1293
1324
|
* @method
|
|
1294
1325
|
* @name gate#watchOrders
|
|
1326
|
+
* @see https://www.gate.com/docs/developers/apiv4/ws/en/#orders-channel
|
|
1327
|
+
* @see https://www.gate.com/docs/developers/futures/ws/en/#orders-api
|
|
1328
|
+
* @see https://www.gate.com/docs/developers/delivery/ws/en/#orders-api
|
|
1329
|
+
* @see https://www.gate.com/docs/developers/options/ws/en/#orders-channel
|
|
1295
1330
|
* @description watches information on multiple orders made by the user
|
|
1296
1331
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1297
1332
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
@@ -1687,6 +1722,7 @@ class gate extends gate$1["default"] {
|
|
|
1687
1722
|
'balance': this.handleBalanceSubscription,
|
|
1688
1723
|
'spot.order_book_update': this.handleOrderBookSubscription,
|
|
1689
1724
|
'futures.order_book_update': this.handleOrderBookSubscription,
|
|
1725
|
+
'options.order_book_update': this.handleOrderBookSubscription,
|
|
1690
1726
|
};
|
|
1691
1727
|
const id = this.safeString(message, 'id');
|
|
1692
1728
|
if (channel in methods) {
|