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.
Files changed (81) hide show
  1. package/README.md +9 -12
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -12
  4. package/dist/cjs/src/abstract/kucoinfutures.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +36 -3
  6. package/dist/cjs/src/base/functions/encode.js +2 -2
  7. package/dist/cjs/src/base/functions/generic.js +8 -2
  8. package/dist/cjs/src/bitrue.js +1 -1
  9. package/dist/cjs/src/bitteam.js +1 -1
  10. package/dist/cjs/src/btcbox.js +1 -1
  11. package/dist/cjs/src/cex.js +1 -0
  12. package/dist/cjs/src/gate.js +227 -168
  13. package/dist/cjs/src/grvt.js +3 -2
  14. package/dist/cjs/src/hyperliquid.js +16 -5
  15. package/dist/cjs/src/kraken.js +2 -2
  16. package/dist/cjs/src/krakenfutures.js +1 -5
  17. package/dist/cjs/src/kucoin.js +4729 -970
  18. package/dist/cjs/src/kucoinfutures.js +14 -3434
  19. package/dist/cjs/src/lbank.js +1 -1
  20. package/dist/cjs/src/poloniex.js +1 -1
  21. package/dist/cjs/src/pro/gate.js +37 -1
  22. package/dist/cjs/src/pro/kucoin.js +819 -178
  23. package/dist/cjs/src/pro/kucoinfutures.js +95 -1261
  24. package/dist/cjs/src/pro/mexc.js +10 -5
  25. package/dist/cjs/src/pro/okx.js +84 -39
  26. package/js/ccxt.d.ts +2 -14
  27. package/js/ccxt.js +2 -10
  28. package/js/src/abstract/kucoin.d.ts +46 -3
  29. package/js/src/abstract/kucoinfutures.d.ts +27 -12
  30. package/js/src/base/Exchange.d.ts +12 -1
  31. package/js/src/base/Exchange.js +36 -3
  32. package/js/src/base/functions/encode.js +2 -2
  33. package/js/src/base/functions/generic.js +9 -3
  34. package/js/src/bitrue.js +1 -1
  35. package/js/src/bitteam.js +1 -1
  36. package/js/src/btcbox.js +1 -1
  37. package/js/src/cex.js +2 -1
  38. package/js/src/gate.d.ts +125 -119
  39. package/js/src/gate.js +227 -168
  40. package/js/src/grvt.js +3 -2
  41. package/js/src/hyperliquid.d.ts +3 -1
  42. package/js/src/hyperliquid.js +16 -5
  43. package/js/src/kraken.js +2 -2
  44. package/js/src/krakenfutures.js +1 -5
  45. package/js/src/kucoin.d.ts +696 -100
  46. package/js/src/kucoin.js +4730 -971
  47. package/js/src/kucoinfutures.d.ts +4 -522
  48. package/js/src/kucoinfutures.js +14 -3434
  49. package/js/src/lbank.js +1 -1
  50. package/js/src/poloniex.js +1 -1
  51. package/js/src/pro/gate.d.ts +30 -1
  52. package/js/src/pro/gate.js +37 -1
  53. package/js/src/pro/kucoin.d.ts +70 -30
  54. package/js/src/pro/kucoin.js +821 -180
  55. package/js/src/pro/kucoinfutures.d.ts +17 -195
  56. package/js/src/pro/kucoinfutures.js +96 -1262
  57. package/js/src/pro/mexc.js +10 -5
  58. package/js/src/pro/okx.d.ts +1 -0
  59. package/js/src/pro/okx.js +84 -39
  60. package/package.json +1 -1
  61. package/dist/cjs/src/abstract/alp.js +0 -11
  62. package/dist/cjs/src/abstract/defx.js +0 -11
  63. package/dist/cjs/src/abstract/timex.js +0 -11
  64. package/dist/cjs/src/alp.js +0 -1059
  65. package/dist/cjs/src/defx.js +0 -2142
  66. package/dist/cjs/src/pro/defx.js +0 -866
  67. package/dist/cjs/src/timex.js +0 -1793
  68. package/js/src/abstract/alp.d.ts +0 -21
  69. package/js/src/abstract/alp.js +0 -5
  70. package/js/src/abstract/defx.d.ts +0 -72
  71. package/js/src/abstract/defx.js +0 -5
  72. package/js/src/abstract/timex.d.ts +0 -65
  73. package/js/src/abstract/timex.js +0 -5
  74. package/js/src/alp.d.ts +0 -209
  75. package/js/src/alp.js +0 -1052
  76. package/js/src/defx.d.ts +0 -348
  77. package/js/src/defx.js +0 -2135
  78. package/js/src/pro/defx.d.ts +0 -236
  79. package/js/src/pro/defx.js +0 -859
  80. package/js/src/timex.d.ts +0 -247
  81. package/js/src/timex.js +0 -1786
@@ -25,7 +25,6 @@ interface kucoin {
25
25
  publicGetConvertCurrencies(params?: {}): Promise<implicitReturnType>;
26
26
  publicPostBulletPublic(params?: {}): Promise<implicitReturnType>;
27
27
  privateGetUserInfo(params?: {}): Promise<implicitReturnType>;
28
- privateGetUserApiKey(params?: {}): Promise<implicitReturnType>;
29
28
  privateGetAccounts(params?: {}): Promise<implicitReturnType>;
30
29
  privateGetAccountsAccountId(params?: {}): Promise<implicitReturnType>;
31
30
  privateGetAccountsLedgers(params?: {}): Promise<implicitReturnType>;
@@ -79,6 +78,13 @@ interface kucoin {
79
78
  privateGetHfMarginOrdersOrderId(params?: {}): Promise<implicitReturnType>;
80
79
  privateGetHfMarginOrdersClientOrderClientOid(params?: {}): Promise<implicitReturnType>;
81
80
  privateGetHfMarginFills(params?: {}): Promise<implicitReturnType>;
81
+ privateGetHfMarginStopOrders(params?: {}): Promise<implicitReturnType>;
82
+ privateGetHfMarginStopOrderOrderId(params?: {}): Promise<implicitReturnType>;
83
+ privateGetHfMarginStopOrderClientOid(params?: {}): Promise<implicitReturnType>;
84
+ privateGetHfMarginOcoOrderOrderId(params?: {}): Promise<implicitReturnType>;
85
+ privateGetHfMarginOcoOrderClientOid(params?: {}): Promise<implicitReturnType>;
86
+ privateGetHfMarginOcoOrderDetailOrderId(params?: {}): Promise<implicitReturnType>;
87
+ privateGetHfMarginOcoOrders(params?: {}): Promise<implicitReturnType>;
82
88
  privateGetEtfInfo(params?: {}): Promise<implicitReturnType>;
83
89
  privateGetMarginCurrencies(params?: {}): Promise<implicitReturnType>;
84
90
  privateGetRiskLimitStrategy(params?: {}): Promise<implicitReturnType>;
@@ -104,7 +110,6 @@ interface kucoin {
104
110
  privateGetConvertLimitOrderDetail(params?: {}): Promise<implicitReturnType>;
105
111
  privateGetConvertLimitOrders(params?: {}): Promise<implicitReturnType>;
106
112
  privateGetAffiliateInviterStatistics(params?: {}): Promise<implicitReturnType>;
107
- privateGetEarnRedeemPreview(params?: {}): Promise<implicitReturnType>;
108
113
  privatePostSubUserCreated(params?: {}): Promise<implicitReturnType>;
109
114
  privatePostSubApiKey(params?: {}): Promise<implicitReturnType>;
110
115
  privatePostSubApiKeyUpdate(params?: {}): Promise<implicitReturnType>;
@@ -129,8 +134,10 @@ interface kucoin {
129
134
  privatePostOcoOrder(params?: {}): Promise<implicitReturnType>;
130
135
  privatePostHfMarginOrder(params?: {}): Promise<implicitReturnType>;
131
136
  privatePostHfMarginOrderTest(params?: {}): Promise<implicitReturnType>;
137
+ privatePostHfMarginStopOrder(params?: {}): Promise<implicitReturnType>;
132
138
  privatePostMarginOrder(params?: {}): Promise<implicitReturnType>;
133
139
  privatePostMarginOrderTest(params?: {}): Promise<implicitReturnType>;
140
+ privatePostHfMarginOcoOrder(params?: {}): Promise<implicitReturnType>;
134
141
  privatePostMarginBorrow(params?: {}): Promise<implicitReturnType>;
135
142
  privatePostMarginRepay(params?: {}): Promise<implicitReturnType>;
136
143
  privatePostPurchase(params?: {}): Promise<implicitReturnType>;
@@ -162,10 +169,17 @@ interface kucoin {
162
169
  privateDeleteHfMarginOrdersOrderId(params?: {}): Promise<implicitReturnType>;
163
170
  privateDeleteHfMarginOrdersClientOrderClientOid(params?: {}): Promise<implicitReturnType>;
164
171
  privateDeleteHfMarginOrders(params?: {}): Promise<implicitReturnType>;
172
+ privateDeleteHfMarginStopOrderCancelById(params?: {}): Promise<implicitReturnType>;
173
+ privateDeleteHfMarginStopOrderCancelByClientOid(params?: {}): Promise<implicitReturnType>;
174
+ privateDeleteHfMarginStopOrderCancel(params?: {}): Promise<implicitReturnType>;
175
+ privateDeleteHfMarginOcoOrderCancelById(params?: {}): Promise<implicitReturnType>;
176
+ privateDeleteHfMarginOcoOrderCancelByClientOid(params?: {}): Promise<implicitReturnType>;
177
+ privateDeleteHfMarginOcoOrderCancel(params?: {}): Promise<implicitReturnType>;
165
178
  privateDeleteConvertLimitOrderCancel(params?: {}): Promise<implicitReturnType>;
166
179
  futuresPublicGetContractsActive(params?: {}): Promise<implicitReturnType>;
167
180
  futuresPublicGetContractsSymbol(params?: {}): Promise<implicitReturnType>;
168
181
  futuresPublicGetTicker(params?: {}): Promise<implicitReturnType>;
182
+ futuresPublicGetAllTickers(params?: {}): Promise<implicitReturnType>;
169
183
  futuresPublicGetLevel2Snapshot(params?: {}): Promise<implicitReturnType>;
170
184
  futuresPublicGetLevel2Depth20(params?: {}): Promise<implicitReturnType>;
171
185
  futuresPublicGetLevel2Depth100(params?: {}): Promise<implicitReturnType>;
@@ -182,8 +196,6 @@ interface kucoin {
182
196
  futuresPublicGetStatus(params?: {}): Promise<implicitReturnType>;
183
197
  futuresPublicGetLevel2MessageQuery(params?: {}): Promise<implicitReturnType>;
184
198
  futuresPublicGetContractsRiskLimitSymbol(params?: {}): Promise<implicitReturnType>;
185
- futuresPublicGetAllTickers(params?: {}): Promise<implicitReturnType>;
186
- futuresPublicGetLevel2DepthLimit(params?: {}): Promise<implicitReturnType>;
187
199
  futuresPublicGetLevel3MessageQuery(params?: {}): Promise<implicitReturnType>;
188
200
  futuresPublicGetLevel3Snapshot(params?: {}): Promise<implicitReturnType>;
189
201
  futuresPublicPostBulletPublic(params?: {}): Promise<implicitReturnType>;
@@ -198,6 +210,7 @@ interface kucoin {
198
210
  futuresPrivateGetOrdersByClientOid(params?: {}): Promise<implicitReturnType>;
199
211
  futuresPrivateGetFills(params?: {}): Promise<implicitReturnType>;
200
212
  futuresPrivateGetRecentFills(params?: {}): Promise<implicitReturnType>;
213
+ futuresPrivateGetTradeFees(params?: {}): Promise<implicitReturnType>;
201
214
  futuresPrivateGetOpenOrderStatistics(params?: {}): Promise<implicitReturnType>;
202
215
  futuresPrivateGetPosition(params?: {}): Promise<implicitReturnType>;
203
216
  futuresPrivateGetPositions(params?: {}): Promise<implicitReturnType>;
@@ -206,20 +219,21 @@ interface kucoin {
206
219
  futuresPrivateGetFundingHistory(params?: {}): Promise<implicitReturnType>;
207
220
  futuresPrivateGetCopyTradeFuturesGetMaxOpenSize(params?: {}): Promise<implicitReturnType>;
208
221
  futuresPrivateGetCopyTradeFuturesPositionMarginMaxWithdrawMargin(params?: {}): Promise<implicitReturnType>;
222
+ futuresPrivateGetHistoryPositions(params?: {}): Promise<implicitReturnType>;
223
+ futuresPrivateGetPositionGetMarginMode(params?: {}): Promise<implicitReturnType>;
224
+ futuresPrivateGetPositionGetPositionMode(params?: {}): Promise<implicitReturnType>;
209
225
  futuresPrivateGetDepositAddress(params?: {}): Promise<implicitReturnType>;
210
226
  futuresPrivateGetDepositList(params?: {}): Promise<implicitReturnType>;
211
227
  futuresPrivateGetWithdrawalsQuotas(params?: {}): Promise<implicitReturnType>;
212
228
  futuresPrivateGetWithdrawalList(params?: {}): Promise<implicitReturnType>;
213
229
  futuresPrivateGetSubApiKey(params?: {}): Promise<implicitReturnType>;
214
230
  futuresPrivateGetTradeStatistics(params?: {}): Promise<implicitReturnType>;
215
- futuresPrivateGetTradeFees(params?: {}): Promise<implicitReturnType>;
216
- futuresPrivateGetHistoryPositions(params?: {}): Promise<implicitReturnType>;
217
231
  futuresPrivateGetGetMaxOpenSize(params?: {}): Promise<implicitReturnType>;
218
232
  futuresPrivateGetGetCrossUserLeverage(params?: {}): Promise<implicitReturnType>;
219
- futuresPrivateGetPositionGetMarginMode(params?: {}): Promise<implicitReturnType>;
220
233
  futuresPrivatePostTransferOut(params?: {}): Promise<implicitReturnType>;
221
234
  futuresPrivatePostTransferIn(params?: {}): Promise<implicitReturnType>;
222
235
  futuresPrivatePostOrders(params?: {}): Promise<implicitReturnType>;
236
+ futuresPrivatePostStOrders(params?: {}): Promise<implicitReturnType>;
223
237
  futuresPrivatePostOrdersTest(params?: {}): Promise<implicitReturnType>;
224
238
  futuresPrivatePostOrdersMulti(params?: {}): Promise<implicitReturnType>;
225
239
  futuresPrivatePostPositionMarginAutoDepositStatus(params?: {}): Promise<implicitReturnType>;
@@ -237,24 +251,23 @@ interface kucoin {
237
251
  futuresPrivatePostCopyTradeFuturesPositionChangeCrossUserLeverage(params?: {}): Promise<implicitReturnType>;
238
252
  futuresPrivatePostCopyTradeGetCrossModeMarginRequirement(params?: {}): Promise<implicitReturnType>;
239
253
  futuresPrivatePostCopyTradePositionSwitchPositionMode(params?: {}): Promise<implicitReturnType>;
240
- futuresPrivatePostBulletPrivate(params?: {}): Promise<implicitReturnType>;
254
+ futuresPrivatePostChangeCrossUserLeverage(params?: {}): Promise<implicitReturnType>;
241
255
  futuresPrivatePostWithdrawals(params?: {}): Promise<implicitReturnType>;
242
- futuresPrivatePostStOrders(params?: {}): Promise<implicitReturnType>;
243
256
  futuresPrivatePostSubApiKey(params?: {}): Promise<implicitReturnType>;
244
257
  futuresPrivatePostSubApiKeyUpdate(params?: {}): Promise<implicitReturnType>;
245
- futuresPrivatePostChangeCrossUserLeverage(params?: {}): Promise<implicitReturnType>;
246
258
  futuresPrivatePostPositionChangeMarginMode(params?: {}): Promise<implicitReturnType>;
247
259
  futuresPrivatePostPositionSwitchPositionMode(params?: {}): Promise<implicitReturnType>;
260
+ futuresPrivatePostBulletPrivate(params?: {}): Promise<implicitReturnType>;
248
261
  futuresPrivateDeleteOrdersOrderId(params?: {}): Promise<implicitReturnType>;
249
262
  futuresPrivateDeleteOrdersClientOrderClientOid(params?: {}): Promise<implicitReturnType>;
250
263
  futuresPrivateDeleteOrders(params?: {}): Promise<implicitReturnType>;
251
264
  futuresPrivateDeleteStopOrders(params?: {}): Promise<implicitReturnType>;
252
265
  futuresPrivateDeleteCopyTradeFuturesOrders(params?: {}): Promise<implicitReturnType>;
253
266
  futuresPrivateDeleteCopyTradeFuturesOrdersClientOrder(params?: {}): Promise<implicitReturnType>;
267
+ futuresPrivateDeleteOrdersMultiCancel(params?: {}): Promise<implicitReturnType>;
254
268
  futuresPrivateDeleteWithdrawalsWithdrawalId(params?: {}): Promise<implicitReturnType>;
255
269
  futuresPrivateDeleteCancelTransferOut(params?: {}): Promise<implicitReturnType>;
256
270
  futuresPrivateDeleteSubApiKey(params?: {}): Promise<implicitReturnType>;
257
- futuresPrivateDeleteOrdersMultiCancel(params?: {}): Promise<implicitReturnType>;
258
271
  webExchangeGetCurrencyCurrencyChainInfo(params?: {}): Promise<implicitReturnType>;
259
272
  webExchangeGetContractSymbolFundingRates(params?: {}): Promise<implicitReturnType>;
260
273
  brokerGetBrokerNdInfo(params?: {}): Promise<implicitReturnType>;
@@ -287,7 +300,7 @@ interface kucoin {
287
300
  earnDeleteEarnOrders(params?: {}): Promise<implicitReturnType>;
288
301
  utaGetMarketAnnouncement(params?: {}): Promise<implicitReturnType>;
289
302
  utaGetMarketCurrency(params?: {}): Promise<implicitReturnType>;
290
- utaGetMarketCurrencies(params?: {}): Promise<implicitReturnType>;
303
+ utaGetAssetCurrencies(params?: {}): Promise<implicitReturnType>;
291
304
  utaGetMarketInstrument(params?: {}): Promise<implicitReturnType>;
292
305
  utaGetMarketTicker(params?: {}): Promise<implicitReturnType>;
293
306
  utaGetMarketTrade(params?: {}): Promise<implicitReturnType>;
@@ -306,6 +319,7 @@ interface kucoin {
306
319
  utaPrivateGetAccountMode(params?: {}): Promise<implicitReturnType>;
307
320
  utaPrivateGetAccountLedger(params?: {}): Promise<implicitReturnType>;
308
321
  utaPrivateGetAccountInterestHistory(params?: {}): Promise<implicitReturnType>;
322
+ utaPrivateGetAssetDepositAddress(params?: {}): Promise<implicitReturnType>;
309
323
  utaPrivateGetAccountDepositAddress(params?: {}): Promise<implicitReturnType>;
310
324
  utaPrivateGetAccountModeAccountBalance(params?: {}): Promise<implicitReturnType>;
311
325
  utaPrivateGetAccountModeAccountOverview(params?: {}): Promise<implicitReturnType>;
@@ -326,6 +340,7 @@ interface kucoin {
326
340
  utaPrivatePostAccountModeOrderPlaceBatch(params?: {}): Promise<implicitReturnType>;
327
341
  utaPrivatePostAccountModeOrderCancel(params?: {}): Promise<implicitReturnType>;
328
342
  utaPrivatePostAccountModeOrderCancelBatch(params?: {}): Promise<implicitReturnType>;
343
+ utaPrivatePostAccountModeOrderCancelAll(params?: {}): Promise<implicitReturnType>;
329
344
  utaPrivatePostSubAccountCanTransferOut(params?: {}): Promise<implicitReturnType>;
330
345
  utaPrivatePostDcpSet(params?: {}): Promise<implicitReturnType>;
331
346
  }
@@ -551,7 +551,7 @@ export default class Exchange {
551
551
  parseToInt(number: any): number;
552
552
  parseToNumeric(number: any): number;
553
553
  isRoundNumber(value: number): boolean;
554
- nonEmptyString(value: any): boolean;
554
+ isEmptyString(value: any): boolean;
555
555
  safeNumberOmitZero(obj: object, key: IndexType, defaultValue?: Num): Num;
556
556
  safeIntegerOmitZero(obj: object, key: IndexType, defaultValue?: Int): Int;
557
557
  afterConstruct(): void;
@@ -632,6 +632,8 @@ export default class Exchange {
632
632
  borrowMargin(code: string, amount: number, symbol?: Str, params?: {}): Promise<{}>;
633
633
  repayMargin(code: string, amount: number, symbol?: Str, params?: {}): Promise<{}>;
634
634
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
635
+ fetchSpotOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
636
+ fetchContractOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
635
637
  fetchOHLCVWs(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
636
638
  watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
637
639
  convertTradingViewToOHLCV(ohlcvs: number[][], timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): any[];
@@ -756,6 +758,8 @@ export default class Exchange {
756
758
  fetchTickerWs(symbol: string, params?: {}): Promise<Ticker>;
757
759
  watchTicker(symbol: string, params?: {}): Promise<Ticker>;
758
760
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
761
+ fetchSpotTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
762
+ fetchContractTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
759
763
  fetchMarkPrices(symbols?: Strings, params?: {}): Promise<Tickers>;
760
764
  fetchTickersWs(symbols?: Strings, params?: {}): Promise<Tickers>;
761
765
  fetchOrderBooks(symbols?: Strings, limit?: Int, params?: {}): Promise<OrderBooks>;
@@ -804,9 +808,13 @@ export default class Exchange {
804
808
  setTakeProfitAndStopLossParams(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, takeProfit?: Num, stopLoss?: Num, params?: {}): {};
805
809
  createOrderWithTakeProfitAndStopLossWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, takeProfit?: Num, stopLoss?: Num, params?: {}): Promise<Order>;
806
810
  createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
811
+ createSpotOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
812
+ createContractOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
807
813
  editOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
808
814
  createOrderWs(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
809
815
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
816
+ cancelSpotOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
817
+ cancelContractOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
810
818
  /**
811
819
  * @method
812
820
  * @name cancelOrderWithClientOrderId
@@ -831,6 +839,8 @@ export default class Exchange {
831
839
  cancelOrdersWithClientOrderIds(clientOrderIds: string[], symbol?: Str, params?: {}): Promise<Order[]>;
832
840
  cancelOrdersWs(ids: string[], symbol?: Str, params?: {}): Promise<Order[]>;
833
841
  cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
842
+ cancelAllSpotOrders(symbol?: Str, params?: {}): Promise<Order[]>;
843
+ cancelAllContractOrders(symbol?: Str, params?: {}): Promise<Order[]>;
834
844
  cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<{}>;
835
845
  cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<Order[]>;
836
846
  cancelAllOrdersWs(symbol?: Str, params?: {}): Promise<Order[]>;
@@ -867,6 +877,7 @@ export default class Exchange {
867
877
  fetchL3OrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
868
878
  parseLastPrice(price: any, market?: Market): LastPrice;
869
879
  fetchDepositAddress(code: string, params?: {}): Promise<DepositAddress>;
880
+ fetchContractDepositAddress(code: string, params?: {}): Promise<DepositAddress>;
870
881
  account(): BalanceAccount;
871
882
  commonCurrencyCode(code: string): string;
872
883
  currency(code: string): CurrencyInterface;
@@ -2855,8 +2855,8 @@ export default class Exchange {
2855
2855
  const res = this.parseToNumeric((value % 1));
2856
2856
  return res === 0;
2857
2857
  }
2858
- nonEmptyString(value) {
2859
- return this.valueIsDefined(value) && value !== '';
2858
+ isEmptyString(value) {
2859
+ return !this.valueIsDefined(value) || value === '';
2860
2860
  }
2861
2861
  safeNumberOmitZero(obj, key, defaultValue = undefined) {
2862
2862
  const value = this.safeString(obj, key);
@@ -4264,6 +4264,12 @@ export default class Exchange {
4264
4264
  }
4265
4265
  throw new NotSupported(this.id + ' fetchOHLCV() is not supported yet' + message);
4266
4266
  }
4267
+ async fetchSpotOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
4268
+ throw new NotSupported(this.id + ' fetchSpotOHLCV() is not supported yet');
4269
+ }
4270
+ async fetchContractOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
4271
+ throw new NotSupported(this.id + ' fetchContractOHLCV() is not supported yet');
4272
+ }
4267
4273
  async fetchOHLCVWs(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
4268
4274
  let message = '';
4269
4275
  if (this.has['fetchTradesWs']) {
@@ -5598,11 +5604,17 @@ export default class Exchange {
5598
5604
  async fetchTickers(symbols = undefined, params = {}) {
5599
5605
  throw new NotSupported(this.id + ' fetchTickers() is not supported yet');
5600
5606
  }
5607
+ async fetchSpotTickers(symbols = undefined, params = {}) {
5608
+ throw new NotSupported(this.id + ' fetchSpotTickers() is not supported yet');
5609
+ }
5610
+ async fetchContractTickers(symbols = undefined, params = {}) {
5611
+ throw new NotSupported(this.id + ' fetchContractTickers() is not supported yet');
5612
+ }
5601
5613
  async fetchMarkPrices(symbols = undefined, params = {}) {
5602
5614
  throw new NotSupported(this.id + ' fetchMarkPrices() is not supported yet');
5603
5615
  }
5604
5616
  async fetchTickersWs(symbols = undefined, params = {}) {
5605
- throw new NotSupported(this.id + ' fetchTickers() is not supported yet');
5617
+ throw new NotSupported(this.id + ' fetchTickersWs() is not supported yet');
5606
5618
  }
5607
5619
  async fetchOrderBooks(symbols = undefined, limit = undefined, params = {}) {
5608
5620
  throw new NotSupported(this.id + ' fetchOrderBooks() is not supported yet');
@@ -6107,6 +6119,12 @@ export default class Exchange {
6107
6119
  async createOrders(orders, params = {}) {
6108
6120
  throw new NotSupported(this.id + ' createOrders() is not supported yet');
6109
6121
  }
6122
+ async createSpotOrders(orders, params = {}) {
6123
+ throw new NotSupported(this.id + ' createSpotOrders() is not supported yet');
6124
+ }
6125
+ async createContractOrders(orders, params = {}) {
6126
+ throw new NotSupported(this.id + ' createContractOrders() is not supported yet');
6127
+ }
6110
6128
  async editOrders(orders, params = {}) {
6111
6129
  throw new NotSupported(this.id + ' editOrders() is not supported yet');
6112
6130
  }
@@ -6116,6 +6134,12 @@ export default class Exchange {
6116
6134
  async cancelOrder(id, symbol = undefined, params = {}) {
6117
6135
  throw new NotSupported(this.id + ' cancelOrder() is not supported yet');
6118
6136
  }
6137
+ async cancelSpotOrder(id, symbol = undefined, params = {}) {
6138
+ throw new NotSupported(this.id + ' cancelSpotOrder() is not supported yet');
6139
+ }
6140
+ async cancelContractOrder(id, symbol = undefined, params = {}) {
6141
+ throw new NotSupported(this.id + ' cancelContractOrder() is not supported yet');
6142
+ }
6119
6143
  /**
6120
6144
  * @method
6121
6145
  * @name cancelOrderWithClientOrderId
@@ -6154,6 +6178,12 @@ export default class Exchange {
6154
6178
  async cancelAllOrders(symbol = undefined, params = {}) {
6155
6179
  throw new NotSupported(this.id + ' cancelAllOrders() is not supported yet');
6156
6180
  }
6181
+ async cancelAllSpotOrders(symbol = undefined, params = {}) {
6182
+ throw new NotSupported(this.id + ' cancelAllSpotOrders() is not supported yet');
6183
+ }
6184
+ async cancelAllContractOrders(symbol = undefined, params = {}) {
6185
+ throw new NotSupported(this.id + ' cancelAllContractOrders() is not supported yet');
6186
+ }
6157
6187
  async cancelAllOrdersAfter(timeout, params = {}) {
6158
6188
  throw new NotSupported(this.id + ' cancelAllOrdersAfter() is not supported yet');
6159
6189
  }
@@ -6316,6 +6346,9 @@ export default class Exchange {
6316
6346
  throw new NotSupported(this.id + ' fetchDepositAddress() is not supported yet');
6317
6347
  }
6318
6348
  }
6349
+ async fetchContractDepositAddress(code, params = {}) {
6350
+ throw new NotSupported(this.id + ' fetchContractDepositAddress() is not supported yet');
6351
+ }
6319
6352
  account() {
6320
6353
  return {
6321
6354
  'free': undefined,
@@ -6,8 +6,8 @@ import { serialize } from '../../static_dependencies/messagepack/msgpack.js';
6
6
  import qs from '../../static_dependencies/qs/index.js';
7
7
  /* ------------------------------------------------------------------------ */
8
8
  const json = (data, params = undefined) => JSON.stringify(data), isJsonEncodedObject = (object) => ((typeof object === 'string') &&
9
- (object.length >= 2) &&
10
- ((object[0] === '{') || (object[0] === '['))), binaryToString = utf8.encode, stringToBinary = utf8.decode, stringToBase64 = (string) => base64.encode(utf8.decode(string)), base64ToString = (string) => utf8.encode(base64.decode(string)), base64ToBinary = base64.decode, binaryToBase64 = base64.encode, base16ToBinary = base16.decode, binaryToBase16 = base16.encode, base58ToBinary = base58.decode, binaryToBase58 = base58.encode, binaryConcat = concatBytes, binaryConcatArray = (arr) => concatBytes(...arr), urlencode = (object, sort = false) => qs.stringify(object), urlencodeNested = (object) => qs.stringify(object) // implemented only in python
9
+ // (object.length >= 2) && // commented: https://github.com/ccxt/ccxt/pull/28193
10
+ ((object[0] === '{') || (object[0] === '['))), binaryToString = utf8.encode, stringToBinary = utf8.decode, stringToBase64 = (string) => base64.encode(utf8.decode(string)), base64ToString = (string) => utf8.encode(base64.decode(string)), base64ToBinary = base64.decode, binaryToBase64 = base64.encode, base16ToBinary = base16.decode, binaryToBase16 = base16.encode, base58ToBinary = base58.decode, binaryToBase58 = base58.encode, binaryConcat = concatBytes, binaryConcatArray = (arr) => concatBytes(...arr), urlencode = (object, sort = false) => qs.stringify(object), urlencodeNested = (object) => qs.stringify(object, { encodeValuesOnly: true }) // implemented only in python
11
11
  , urlencodeWithArrayRepeat = (object) => qs.stringify(object, { arrayFormat: 'repeat' }), rawencode = (object, sort = false) => qs.stringify(object, { encode: false }), encode = utf8.decode // lol
12
12
  , decode = utf8.encode
13
13
  // Url-safe-base64 without equals signs, with + replaced by - and slashes replaced by underscores
@@ -1,5 +1,5 @@
1
1
  // ----------------------------------------------------------------------------
2
- import { isNumber, isArray } from './type.js';
2
+ import { isNumber, isDictionary, isArray } from './type.js';
3
3
  // ----------------------------------------------------------------------------
4
4
  const keys = Object.keys; // eslint-disable-line padding-line-between-statements
5
5
  const values = (x) => ((!isArray(x)) ? Object.values(x) : x); // don't copy arrays if they're already arrays
@@ -14,10 +14,16 @@ const arrayConcat = (a, b) => a.concat(b);
14
14
  const inArray = (needle, haystack) => haystack.includes(needle);
15
15
  const toArray = (object) => Object.values(object);
16
16
  const isEmpty = (object) => {
17
- if (!object) {
17
+ if (object === null || object === undefined) {
18
18
  return true;
19
19
  }
20
- return (Array.isArray(object) ? object : Object.keys(object)).length < 1;
20
+ if (Array.isArray(object)) {
21
+ return object.length < 1;
22
+ }
23
+ if (isDictionary(object)) {
24
+ return Object.keys(object).length < 1;
25
+ }
26
+ return false;
21
27
  };
22
28
  const keysort = (x, out = {}) => {
23
29
  for (const k of keys(x).sort()) {
package/js/src/bitrue.js CHANGED
@@ -748,7 +748,7 @@ export default class bitrue extends Exchange {
748
748
  // {
749
749
  // "chain": "BEP20",
750
750
  // "enableWithdraw": true,
751
- // "enableDeposit": true,
751
+ // "enableDeposit": false,
752
752
  // "withdrawFee": "0.2000",
753
753
  // "minWithdraw": "5.0000",
754
754
  // "maxWithdraw": "1000000000000000.0000",
package/js/src/bitteam.js CHANGED
@@ -823,7 +823,7 @@ export default class bitteam extends Exchange {
823
823
  const response = await this.publicGetTradeApiCmcOrderbookPair(this.extend(request, params));
824
824
  //
825
825
  // {
826
- // "timestamp": 1701166703285,
826
+ // "timestamp": 1701166703284,
827
827
  // "bids": [
828
828
  // [
829
829
  // 2019.334988,
package/js/src/btcbox.js CHANGED
@@ -697,7 +697,7 @@ export default class btcbox extends Exchange {
697
697
  //
698
698
  // {
699
699
  // "id":11,
700
- // "datetime":"2014-10-21 10:47:20",
700
+ // "datetime":"2014-10-21 10:47:21",
701
701
  // "type":"sell",
702
702
  // "price":42000,
703
703
  // "amount_original":1.2,
package/js/src/cex.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // ---------------------------------------------------------------------------
2
2
  import Exchange from './abstract/cex.js';
3
- import { ExchangeError, ArgumentsRequired, NullResponse, PermissionDenied, InsufficientFunds, BadRequest, AuthenticationError } from './base/errors.js';
3
+ import { ExchangeError, ArgumentsRequired, NullResponse, PermissionDenied, InsufficientFunds, BadRequest, AuthenticationError, RateLimitExceeded } from './base/errors.js';
4
4
  import { Precise } from './base/Precise.js';
5
5
  import { TICK_SIZE } from './base/functions/number.js';
6
6
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
@@ -240,6 +240,7 @@ export default class cex extends Exchange {
240
240
  'Get deposit address for main account is not allowed': PermissionDenied,
241
241
  'Market Trigger orders are not allowed': BadRequest,
242
242
  'key not passed or incorrect': AuthenticationError,
243
+ 'API rate limit reached': RateLimitExceeded, // {"error":"API rate limit reached"}
243
244
  },
244
245
  },
245
246
  'timeframes': {