ccxt 4.4.49 → 4.4.53

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 (158) hide show
  1. package/README.md +6 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +65 -2
  5. package/dist/cjs/src/base/Exchange.js +112 -3
  6. package/dist/cjs/src/binance.js +42 -19
  7. package/dist/cjs/src/bitfinex1.js +22 -22
  8. package/dist/cjs/src/blofin.js +6 -2
  9. package/dist/cjs/src/bybit.js +2 -2
  10. package/dist/cjs/src/coinex.js +5 -5
  11. package/dist/cjs/src/coinmetro.js +21 -4
  12. package/dist/cjs/src/defx.js +1 -1
  13. package/dist/cjs/src/deribit.js +23 -4
  14. package/dist/cjs/src/ellipx.js +1 -0
  15. package/dist/cjs/src/gate.js +2 -2
  16. package/dist/cjs/src/hollaex.js +15 -20
  17. package/dist/cjs/src/htx.js +6 -4
  18. package/dist/cjs/src/hyperliquid.js +4 -4
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/kucoin.js +52 -74
  21. package/dist/cjs/src/kuna.js +1 -1
  22. package/dist/cjs/src/mexc.js +29 -8
  23. package/dist/cjs/src/okcoin.js +13 -5
  24. package/dist/cjs/src/okx.js +1 -1
  25. package/dist/cjs/src/onetrading.js +1 -1
  26. package/dist/cjs/src/paradex.js +2 -2
  27. package/dist/cjs/src/paymium.js +42 -0
  28. package/dist/cjs/src/pro/binance.js +2 -0
  29. package/dist/cjs/src/pro/bitfinex1.js +4 -4
  30. package/dist/cjs/src/pro/bitvavo.js +1 -1
  31. package/dist/cjs/src/pro/blofin.js +9 -1
  32. package/dist/cjs/src/pro/bybit.js +1 -1
  33. package/dist/cjs/src/pro/coincatch.js +2 -2
  34. package/dist/cjs/src/pro/coinex.js +4 -1
  35. package/dist/cjs/src/pro/cryptocom.js +2 -2
  36. package/dist/cjs/src/pro/defx.js +1 -1
  37. package/dist/cjs/src/pro/exmo.js +1 -1
  38. package/dist/cjs/src/pro/gemini.js +1 -1
  39. package/dist/cjs/src/pro/hashkey.js +2 -2
  40. package/dist/cjs/src/pro/htx.js +8 -8
  41. package/dist/cjs/src/pro/hyperliquid.js +2 -2
  42. package/dist/cjs/src/pro/kucoin.js +1 -1
  43. package/dist/cjs/src/pro/okx.js +1 -1
  44. package/dist/cjs/src/pro/oxfun.js +1 -1
  45. package/dist/cjs/src/probit.js +77 -9
  46. package/dist/cjs/src/timex.js +67 -0
  47. package/dist/cjs/src/tokocrypto.js +82 -5
  48. package/dist/cjs/src/tradeogre.js +55 -2
  49. package/dist/cjs/src/vertex.js +65 -2
  50. package/dist/cjs/src/wavesexchange.js +73 -0
  51. package/dist/cjs/src/wazirx.js +59 -3
  52. package/dist/cjs/src/whitebit.js +80 -4
  53. package/dist/cjs/src/xt.js +112 -0
  54. package/dist/cjs/src/yobit.js +56 -0
  55. package/dist/cjs/src/zaif.js +55 -0
  56. package/dist/cjs/src/zonda.js +56 -0
  57. package/examples/README.md +6 -0
  58. package/js/ccxt.d.ts +1 -1
  59. package/js/ccxt.js +1 -1
  60. package/js/src/abstract/binance.d.ts +1 -0
  61. package/js/src/abstract/binancecoinm.d.ts +1 -0
  62. package/js/src/abstract/binanceus.d.ts +1 -0
  63. package/js/src/abstract/binanceusdm.d.ts +1 -0
  64. package/js/src/alpaca.d.ts +35 -0
  65. package/js/src/alpaca.js +65 -2
  66. package/js/src/base/Exchange.d.ts +2 -0
  67. package/js/src/base/Exchange.js +112 -3
  68. package/js/src/binance.d.ts +4 -1
  69. package/js/src/binance.js +42 -19
  70. package/js/src/bitfinex1.d.ts +22 -22
  71. package/js/src/bitfinex1.js +22 -22
  72. package/js/src/blofin.d.ts +1 -1
  73. package/js/src/blofin.js +6 -2
  74. package/js/src/bybit.d.ts +2 -2
  75. package/js/src/bybit.js +2 -2
  76. package/js/src/coinex.js +5 -5
  77. package/js/src/coinmetro.d.ts +1 -1
  78. package/js/src/coinmetro.js +21 -4
  79. package/js/src/defx.d.ts +1 -1
  80. package/js/src/defx.js +1 -1
  81. package/js/src/deribit.d.ts +1 -1
  82. package/js/src/deribit.js +23 -4
  83. package/js/src/ellipx.d.ts +1 -0
  84. package/js/src/ellipx.js +1 -0
  85. package/js/src/gate.d.ts +1 -1
  86. package/js/src/gate.js +2 -2
  87. package/js/src/hollaex.d.ts +2 -1
  88. package/js/src/hollaex.js +15 -20
  89. package/js/src/htx.d.ts +1 -1
  90. package/js/src/htx.js +6 -4
  91. package/js/src/hyperliquid.d.ts +3 -3
  92. package/js/src/hyperliquid.js +4 -4
  93. package/js/src/krakenfutures.d.ts +1 -1
  94. package/js/src/krakenfutures.js +1 -1
  95. package/js/src/kucoin.js +52 -74
  96. package/js/src/kuna.d.ts +1 -1
  97. package/js/src/kuna.js +1 -1
  98. package/js/src/mexc.d.ts +1 -1
  99. package/js/src/mexc.js +29 -8
  100. package/js/src/okcoin.js +13 -5
  101. package/js/src/okx.d.ts +1 -1
  102. package/js/src/okx.js +1 -1
  103. package/js/src/onetrading.d.ts +1 -1
  104. package/js/src/onetrading.js +1 -1
  105. package/js/src/paradex.d.ts +1 -1
  106. package/js/src/paradex.js +2 -2
  107. package/js/src/paymium.js +42 -0
  108. package/js/src/pro/binance.js +2 -0
  109. package/js/src/pro/bitfinex1.d.ts +4 -4
  110. package/js/src/pro/bitfinex1.js +4 -4
  111. package/js/src/pro/bitvavo.d.ts +1 -1
  112. package/js/src/pro/bitvavo.js +1 -1
  113. package/js/src/pro/blofin.d.ts +1 -1
  114. package/js/src/pro/blofin.js +9 -1
  115. package/js/src/pro/bybit.d.ts +1 -1
  116. package/js/src/pro/bybit.js +1 -1
  117. package/js/src/pro/coincatch.d.ts +2 -2
  118. package/js/src/pro/coincatch.js +2 -2
  119. package/js/src/pro/coinex.js +4 -1
  120. package/js/src/pro/cryptocom.d.ts +2 -2
  121. package/js/src/pro/cryptocom.js +2 -2
  122. package/js/src/pro/defx.d.ts +1 -1
  123. package/js/src/pro/defx.js +1 -1
  124. package/js/src/pro/exmo.d.ts +1 -1
  125. package/js/src/pro/exmo.js +1 -1
  126. package/js/src/pro/gemini.d.ts +1 -1
  127. package/js/src/pro/gemini.js +1 -1
  128. package/js/src/pro/hashkey.d.ts +2 -2
  129. package/js/src/pro/hashkey.js +2 -2
  130. package/js/src/pro/htx.d.ts +8 -8
  131. package/js/src/pro/htx.js +8 -8
  132. package/js/src/pro/hyperliquid.d.ts +2 -2
  133. package/js/src/pro/hyperliquid.js +2 -2
  134. package/js/src/pro/kucoin.d.ts +1 -1
  135. package/js/src/pro/kucoin.js +1 -1
  136. package/js/src/pro/okx.d.ts +1 -1
  137. package/js/src/pro/okx.js +1 -1
  138. package/js/src/pro/oxfun.d.ts +1 -1
  139. package/js/src/pro/oxfun.js +1 -1
  140. package/js/src/probit.d.ts +1 -0
  141. package/js/src/probit.js +77 -9
  142. package/js/src/timex.js +67 -0
  143. package/js/src/tokocrypto.d.ts +2 -3
  144. package/js/src/tokocrypto.js +82 -5
  145. package/js/src/tradeogre.d.ts +4 -2
  146. package/js/src/tradeogre.js +55 -2
  147. package/js/src/vertex.js +65 -2
  148. package/js/src/wavesexchange.js +73 -0
  149. package/js/src/wazirx.js +59 -3
  150. package/js/src/whitebit.js +80 -4
  151. package/js/src/xt.js +112 -0
  152. package/js/src/yobit.js +56 -0
  153. package/js/src/zaif.js +55 -0
  154. package/js/src/zonda.d.ts +1 -0
  155. package/js/src/zonda.js +56 -0
  156. package/package.json +2 -2
  157. package/js/src/hitbtc3.d.ts +0 -8
  158. package/js/src/hitbtc3.js +0 -20
@@ -688,12 +688,20 @@ class okcoin extends okcoin$1 {
688
688
  async fetchTime(params = {}) {
689
689
  const response = await this.publicGetPublicTime(params);
690
690
  //
691
- // {
692
- // "iso": "2015-01-07T23:47:25.201Z",
693
- // "epoch": 1420674445.201
694
- // }
691
+ // {
692
+ // "code": "0",
693
+ // "data":
694
+ // [
695
+ // {
696
+ // "ts": "1737379360033"
697
+ // }
698
+ // ],
699
+ // "msg": ""
700
+ // }
695
701
  //
696
- return this.parse8601(this.safeString(response, 'iso'));
702
+ const data = this.safeList(response, 'data');
703
+ const timestamp = this.safeDict(data, 0);
704
+ return this.safeInteger(timestamp, 'ts');
697
705
  }
698
706
  /**
699
707
  * @method
@@ -5730,7 +5730,7 @@ class okx extends okx$1 {
5730
5730
  }
5731
5731
  /**
5732
5732
  * @method
5733
- * @name okx#fetchPositions
5733
+ * @name okx#fetchPositionsForSymbol
5734
5734
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
5735
5735
  * @description fetch all open positions for specific symbol
5736
5736
  * @param {string} symbol unified market symbol
@@ -1202,7 +1202,7 @@ class onetrading extends onetrading$1 {
1202
1202
  * @description create a trade order
1203
1203
  * @see https://docs.onetrading.com/#create-order
1204
1204
  * @param {string} symbol unified symbol of the market to create an order in
1205
- * @param {string} type 'market' or 'limit'
1205
+ * @param {string} type 'limit'
1206
1206
  * @param {string} side 'buy' or 'sell'
1207
1207
  * @param {float} amount how much of currency you want to trade in units of base currency
1208
1208
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
@@ -956,7 +956,7 @@ class paradex extends paradex$1 {
956
956
  //
957
957
  // {
958
958
  // "symbol": "BTC-USD-PERP",
959
- // "oracle_price": "68465.17449906",
959
+ // "oracle_price": "68465.17449904",
960
960
  // "mark_price": "68465.17449906",
961
961
  // "last_traded_price": "68495.1",
962
962
  // "bid": "68477.6",
@@ -1719,7 +1719,7 @@ class paradex extends paradex$1 {
1719
1719
  }
1720
1720
  /**
1721
1721
  * @method
1722
- * @name paradex#fetchPositions
1722
+ * @name paradex#fetchPosition
1723
1723
  * @description fetch data on an open position
1724
1724
  * @see https://docs.api.prod.paradex.trade/#list-open-positions
1725
1725
  * @param {string} symbol unified market symbol of the market the position is held in
@@ -111,6 +111,48 @@ class paymium extends paymium$1 {
111
111
  },
112
112
  },
113
113
  'precisionMode': number.TICK_SIZE,
114
+ 'features': {
115
+ 'spot': {
116
+ 'sandbox': false,
117
+ 'createOrder': {
118
+ 'marginMode': false,
119
+ 'triggerPrice': false,
120
+ 'triggerDirection': false,
121
+ 'triggerPriceType': undefined,
122
+ 'stopLossPrice': false,
123
+ 'takeProfitPrice': false,
124
+ 'attachedStopLossTakeProfit': undefined,
125
+ 'timeInForce': {
126
+ 'IOC': false,
127
+ 'FOK': false,
128
+ 'PO': false,
129
+ 'GTD': false,
130
+ },
131
+ 'hedged': false,
132
+ 'trailing': false,
133
+ 'leverage': false,
134
+ 'marketBuyByCost': true,
135
+ 'marketBuyRequiresPrice': false,
136
+ 'selfTradePrevention': false,
137
+ 'iceberg': false,
138
+ },
139
+ 'createOrders': undefined,
140
+ 'fetchMyTrades': undefined,
141
+ 'fetchOrder': undefined,
142
+ 'fetchOpenOrders': undefined,
143
+ 'fetchOrders': undefined,
144
+ 'fetchClosedOrders': undefined,
145
+ 'fetchOHLCV': undefined, // todo
146
+ },
147
+ 'swap': {
148
+ 'linear': undefined,
149
+ 'inverse': undefined,
150
+ },
151
+ 'future': {
152
+ 'linear': undefined,
153
+ 'inverse': undefined,
154
+ },
155
+ },
114
156
  });
115
157
  }
116
158
  parseBalance(response) {
@@ -2355,6 +2355,7 @@ class binance extends binance$1 {
2355
2355
  let response = undefined;
2356
2356
  if (isPortfolioMargin) {
2357
2357
  response = await this.papiPostListenKey(params);
2358
+ params = this.extend(params, { 'portfolioMargin': true });
2358
2359
  }
2359
2360
  else if (type === 'future') {
2360
2361
  response = await this.fapiPrivatePostListenKey(params);
@@ -2410,6 +2411,7 @@ class binance extends binance$1 {
2410
2411
  try {
2411
2412
  if (isPortfolioMargin) {
2412
2413
  await this.papiPutListenKey(this.extend(request, params));
2414
+ params = this.extend(params, { 'portfolioMargin': true });
2413
2415
  }
2414
2416
  else if (type === 'future') {
2415
2417
  await this.fapiPrivatePutListenKey(this.extend(request, params));
@@ -55,7 +55,7 @@ class bitfinex1 extends bitfinex1$1 {
55
55
  }
56
56
  /**
57
57
  * @method
58
- * @name bitfinex#watchTrades
58
+ * @name bitfinex1#watchTrades
59
59
  * @description get the list of most recent trades for a particular symbol
60
60
  * @see https://docs.bitfinex.com/v1/reference/ws-public-trades
61
61
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -75,7 +75,7 @@ class bitfinex1 extends bitfinex1$1 {
75
75
  }
76
76
  /**
77
77
  * @method
78
- * @name bitfinex#watchTicker
78
+ * @name bitfinex1#watchTicker
79
79
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
80
80
  * @see https://docs.bitfinex.com/v1/reference/ws-public-ticker
81
81
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -248,7 +248,7 @@ class bitfinex1 extends bitfinex1$1 {
248
248
  }
249
249
  /**
250
250
  * @method
251
- * @name bitfinex#watchOrderBook
251
+ * @name bitfinex1#watchOrderBook
252
252
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
253
253
  * @see https://docs.bitfinex.com/v1/reference/ws-public-order-books
254
254
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -459,7 +459,7 @@ class bitfinex1 extends bitfinex1$1 {
459
459
  }
460
460
  /**
461
461
  * @method
462
- * @name bitfinex#watchOrders
462
+ * @name bitfinex1#watchOrders
463
463
  * @description watches information on multiple orders made by the user
464
464
  * @see https://docs.bitfinex.com/v1/reference/ws-auth-order-updates
465
465
  * @see https://docs.bitfinex.com/v1/reference/ws-auth-order-snapshots
@@ -170,7 +170,7 @@ class bitvavo extends bitvavo$1 {
170
170
  }
171
171
  /**
172
172
  * @method
173
- * @name mexc#watchBidsAsks
173
+ * @name bitvavo#watchBidsAsks
174
174
  * @description watches best bid & ask for symbols
175
175
  * @see https://docs.bitvavo.com/#tag/Market-data-subscription-WebSocket/paths/~1subscribeTicker24h/post
176
176
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for
@@ -34,6 +34,14 @@ class blofin extends blofin$1 {
34
34
  },
35
35
  },
36
36
  },
37
+ 'test': {
38
+ 'ws': {
39
+ 'swap': {
40
+ 'public': 'wss://demo-trading-openapi.blofin.com/ws/public',
41
+ 'private': 'wss://demo-trading-openapi.blofin.com/ws/private',
42
+ },
43
+ },
44
+ },
37
45
  },
38
46
  'options': {
39
47
  'defaultType': 'swap',
@@ -472,7 +480,7 @@ class blofin extends blofin$1 {
472
480
  }
473
481
  /**
474
482
  * @method
475
- * @name alpaca#watchOrders
483
+ * @name biofin#watchOrders
476
484
  * @description watches information on multiple orders made by the user
477
485
  * @param {string} symbol unified market symbol of the market orders were made in
478
486
  * @param {int} [since] the earliest time in ms to fetch orders for
@@ -827,7 +827,7 @@ class bybit extends bybit$1 {
827
827
  }
828
828
  /**
829
829
  * @method
830
- * @name bybit#watchOrderBook
830
+ * @name bybit#watchOrderBookForSymbols
831
831
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
832
832
  * @see https://bybit-exchange.github.io/docs/v5/websocket/public/orderbook
833
833
  * @param {string[]} symbols unified array of symbols
@@ -558,7 +558,7 @@ class coincatch extends coincatch$1 {
558
558
  }
559
559
  /**
560
560
  * @method
561
- * @name coincatch#watchOrderBook
561
+ * @name coincatch#watchOrderBookForSymbols
562
562
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
563
563
  * @see https://coincatch.github.io/github.io/en/spot/#depth-channel
564
564
  * @param symbols
@@ -696,7 +696,7 @@ class coincatch extends coincatch$1 {
696
696
  }
697
697
  /**
698
698
  * @method
699
- * @name coincatch#watchTrades
699
+ * @name coincatch#watchTradesForSymbols
700
700
  * @description watches information on multiple trades made in a market
701
701
  * @see https://coincatch.github.io/github.io/en/spot/#trades-channel
702
702
  * @param symbols
@@ -253,7 +253,10 @@ class coinex extends coinex$1 {
253
253
  [type, params] = this.handleMarketTypeAndParams('watchBalance', undefined, params, 'spot');
254
254
  await this.authenticate(type);
255
255
  const url = this.urls['api']['ws'][type];
256
- let currencies = Object.keys(this.currencies_by_id);
256
+ // coinex throws a closes the websocket when subscribing over 1422 currencies, therefore we filter out inactive currencies
257
+ const activeCurrencies = this.filterBy(this.currencies_by_id, 'active', true);
258
+ const activeCurrenciesById = this.indexBy(activeCurrencies, 'id');
259
+ let currencies = Object.keys(activeCurrenciesById);
257
260
  if (currencies === undefined) {
258
261
  currencies = [];
259
262
  }
@@ -97,7 +97,7 @@ class cryptocom extends cryptocom$1 {
97
97
  }
98
98
  /**
99
99
  * @method
100
- * @name cryptocom#watchOrderBook
100
+ * @name cryptocom#watchOrderBookForSymbols
101
101
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
102
102
  * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#book-instrument_name
103
103
  * @param {string[]} symbols unified array of symbols
@@ -1078,7 +1078,7 @@ class cryptocom extends cryptocom$1 {
1078
1078
  }
1079
1079
  /**
1080
1080
  * @method
1081
- * @name cryptocom#cancelOrder
1081
+ * @name cryptocom#cancelOrderWs
1082
1082
  * @description cancels an open order
1083
1083
  * @see https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-cancel-order
1084
1084
  * @param {string} id the order id of the order to cancel
@@ -396,7 +396,7 @@ class defx extends defx$1 {
396
396
  }
397
397
  /**
398
398
  * @method
399
- * @name defx#unWatchTradesForSymbols
399
+ * @name defx#unWatchTrades
400
400
  * @description unWatches from the stream channel
401
401
  * @see https://www.postman.com/defxcode/defx-public-apis/collection/667939a1b5d8069c13d614e9
402
402
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -346,7 +346,7 @@ class exmo extends exmo$1 {
346
346
  }
347
347
  /**
348
348
  * @method
349
- * @name exmo#watchTrades
349
+ * @name exmo#watchMyTrades
350
350
  * @description get the list of trades associated with the user
351
351
  * @param {string} symbol unified symbol of the market to fetch trades for
352
352
  * @param {int} [since] timestamp in ms of the earliest trade to fetch
@@ -259,7 +259,7 @@ class gemini extends gemini$1 {
259
259
  }
260
260
  /**
261
261
  * @method
262
- * @name gemini#fetchOHLCV
262
+ * @name gemini#watchOHLCV
263
263
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
264
264
  * @see https://docs.gemini.com/websocket-api/#candles-data-feed
265
265
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -287,7 +287,7 @@ class hashkey extends hashkey$1 {
287
287
  }
288
288
  /**
289
289
  * @method
290
- * @name alpaca#watchOrderBook
290
+ * @name hashkey#watchOrderBook
291
291
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
292
292
  * @see https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#public-stream
293
293
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -683,7 +683,7 @@ class hashkey extends hashkey$1 {
683
683
  }
684
684
  /**
685
685
  * @method
686
- * @name bitmart#watchBalance
686
+ * @name hashkey#watchBalance
687
687
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
688
688
  * @see https://hashkeyglobal-apidoc.readme.io/reference/websocket-api#private-stream
689
689
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -129,7 +129,7 @@ class htx extends htx$1 {
129
129
  }
130
130
  /**
131
131
  * @method
132
- * @name huobi#watchTicker
132
+ * @name htx#watchTicker
133
133
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
134
134
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
135
135
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
@@ -199,7 +199,7 @@ class htx extends htx$1 {
199
199
  }
200
200
  /**
201
201
  * @method
202
- * @name huobi#watchTrades
202
+ * @name htx#watchTrades
203
203
  * @description get the list of most recent trades for a particular symbol
204
204
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
205
205
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
@@ -265,7 +265,7 @@ class htx extends htx$1 {
265
265
  }
266
266
  /**
267
267
  * @method
268
- * @name huobi#watchOHLCV
268
+ * @name htx#watchOHLCV
269
269
  * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
270
270
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
271
271
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
@@ -328,7 +328,7 @@ class htx extends htx$1 {
328
328
  }
329
329
  /**
330
330
  * @method
331
- * @name huobi#watchOrderBook
331
+ * @name htx#watchOrderBook
332
332
  * @see https://huobiapi.github.io/docs/dm/v1/en/#subscribe-market-depth-data
333
333
  * @see https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#subscribe-incremental-market-depth-data
334
334
  * @see https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-subscribe-incremental-market-depth-data
@@ -674,7 +674,7 @@ class htx extends htx$1 {
674
674
  }
675
675
  /**
676
676
  * @method
677
- * @name huobi#watchMyTrades
677
+ * @name htx#watchMyTrades
678
678
  * @description watches information on multiple trades made by the user
679
679
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53dd5-7773-11ed-9966-0242ac110003
680
680
  * @param {string} symbol unified market symbol of the market trades were made in
@@ -778,7 +778,7 @@ class htx extends htx$1 {
778
778
  }
779
779
  /**
780
780
  * @method
781
- * @name huobi#watchOrders
781
+ * @name htx#watchOrders
782
782
  * @description watches information on multiple orders made by the user
783
783
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec53c8f-7773-11ed-9966-0242ac110003
784
784
  * @param {string} symbol unified market symbol of the market orders were made in
@@ -1232,7 +1232,7 @@ class htx extends htx$1 {
1232
1232
  }
1233
1233
  /**
1234
1234
  * @method
1235
- * @name huobi#watchPositions
1235
+ * @name htx#watchPositions
1236
1236
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7de1c-77b5-11ed-9966-0242ac110003
1237
1237
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7df0f-77b5-11ed-9966-0242ac110003
1238
1238
  * @see https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
@@ -1355,7 +1355,7 @@ class htx extends htx$1 {
1355
1355
  }
1356
1356
  /**
1357
1357
  * @method
1358
- * @name huobi#watchBalance
1358
+ * @name htx#watchBalance
1359
1359
  * @description watch balance and get the amount of funds available for trading or funds locked in orders
1360
1360
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=7ec52e28-7773-11ed-9966-0242ac110003
1361
1361
  * @see https://www.htx.com/en-us/opend/newApiPages/?id=10000084-77b7-11ed-9966-0242ac110003
@@ -73,7 +73,7 @@ class hyperliquid extends hyperliquid$1 {
73
73
  }
74
74
  /**
75
75
  * @method
76
- * @name hyperliquid#createOrder
76
+ * @name hyperliquid#createOrderWs
77
77
  * @description create a trade order using WebSocket post request
78
78
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
79
79
  * @param {string} symbol unified symbol of the market to create an order in
@@ -99,7 +99,7 @@ class hyperliquid extends hyperliquid$1 {
99
99
  }
100
100
  /**
101
101
  * @method
102
- * @name hyperliquid#editOrder
102
+ * @name hyperliquid#editOrderWs
103
103
  * @description edit a trade order
104
104
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
105
105
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
@@ -493,7 +493,7 @@ class kucoin extends kucoin$1 {
493
493
  }
494
494
  /**
495
495
  * @method
496
- * @name kucoin#watchTrades
496
+ * @name kucoin#watchTradesForSymbols
497
497
  * @description get the list of most recent trades for a particular symbol
498
498
  * @see https://www.kucoin.com/docs/websocket/spot-trading/public-channels/match-execution-data
499
499
  * @param {string[]} symbols
@@ -253,7 +253,7 @@ class okx extends okx$1 {
253
253
  }
254
254
  /**
255
255
  * @method
256
- * @name okx#unWatchTradesForSymbols
256
+ * @name okx#unWatchTrades
257
257
  * @description unWatches from the stream channel
258
258
  * @param {string} symbol unified symbol of the market to fetch trades for
259
259
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -980,7 +980,7 @@ class oxfun extends oxfun$1 {
980
980
  }
981
981
  /**
982
982
  * @method
983
- * @name okx#cancelOrdersWs
983
+ * @name oxfun#cancelOrdersWs
984
984
  * @see https://www.okx.com/docs-v5/en/#order-book-trading-trade-ws-mass-cancel-order
985
985
  * @description cancel multiple orders
986
986
  * @param {string[]} ids order ids
@@ -87,7 +87,7 @@ class probit extends probit$1 {
87
87
  'fetchWithdrawal': false,
88
88
  'fetchWithdrawals': true,
89
89
  'reduceMargin': false,
90
- 'sandbox': true,
90
+ 'sandbox': false,
91
91
  'setLeverage': false,
92
92
  'setMarginMode': false,
93
93
  'setPositionMode': false,
@@ -169,6 +169,73 @@ class probit extends probit$1 {
169
169
  'taker': this.parseNumber('0.002'),
170
170
  },
171
171
  },
172
+ 'features': {
173
+ 'spot': {
174
+ 'sandbox': false,
175
+ 'createOrder': {
176
+ 'marginMode': false,
177
+ 'triggerPrice': false,
178
+ 'triggerDirection': false,
179
+ 'triggerPriceType': undefined,
180
+ 'stopLossPrice': false,
181
+ 'takeProfitPrice': false,
182
+ 'attachedStopLossTakeProfit': undefined,
183
+ // todo
184
+ 'timeInForce': {
185
+ 'IOC': true,
186
+ 'FOK': true,
187
+ 'PO': false,
188
+ 'GTD': false,
189
+ },
190
+ 'hedged': false,
191
+ 'trailing': false,
192
+ 'leverage': false,
193
+ 'marketBuyByCost': true,
194
+ 'marketBuyRequiresPrice': false,
195
+ 'selfTradePrevention': false,
196
+ 'iceberg': false,
197
+ },
198
+ 'createOrders': undefined,
199
+ 'fetchMyTrades': {
200
+ 'marginMode': false,
201
+ 'limit': 1000,
202
+ 'daysBack': 100000,
203
+ 'untilDays': 100000, // todo
204
+ },
205
+ 'fetchOrder': {
206
+ 'marginMode': false,
207
+ 'trigger': false,
208
+ 'trailing': false,
209
+ },
210
+ 'fetchOpenOrders': {
211
+ 'marginMode': false,
212
+ 'limit': undefined,
213
+ 'trigger': false,
214
+ 'trailing': false,
215
+ },
216
+ 'fetchOrders': undefined,
217
+ 'fetchClosedOrders': {
218
+ 'marginMode': false,
219
+ 'limit': 1000,
220
+ 'daysBack': 100000,
221
+ 'daysBackCanceled': 1,
222
+ 'untilDays': 90,
223
+ 'trigger': false,
224
+ 'trailing': false,
225
+ },
226
+ 'fetchOHLCV': {
227
+ 'limit': 4000,
228
+ },
229
+ },
230
+ 'swap': {
231
+ 'linear': undefined,
232
+ 'inverse': undefined,
233
+ },
234
+ 'future': {
235
+ 'linear': undefined,
236
+ 'inverse': undefined,
237
+ },
238
+ },
172
239
  'exceptions': {
173
240
  'exact': {
174
241
  'UNAUTHORIZED': errors.AuthenticationError,
@@ -932,6 +999,7 @@ class probit extends probit$1 {
932
999
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
933
1000
  * @param {int} [limit] the maximum amount of candles to fetch
934
1001
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1002
+ * @param {string} [params.until] timestamp in ms of the earliest candle to fetch
935
1003
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
936
1004
  */
937
1005
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -948,21 +1016,21 @@ class probit extends probit$1 {
948
1016
  'limit': requestLimit, // max 1000
949
1017
  };
950
1018
  const now = this.milliseconds();
951
- const duration = this.parseTimeframe(timeframe);
1019
+ const until = this.safeInteger(params, 'until');
1020
+ const durationMilliseconds = this.parseTimeframe(timeframe) * 1000;
952
1021
  let startTime = since;
953
- let endTime = now;
1022
+ let endTime = (until !== undefined) ? until - durationMilliseconds : now;
954
1023
  if (since === undefined) {
955
1024
  if (limit === undefined) {
956
1025
  limit = requestLimit;
957
1026
  }
958
- startTime = now - limit * duration * 1000;
1027
+ const startLimit = limit - 1;
1028
+ startTime = endTime - startLimit * durationMilliseconds;
959
1029
  }
960
1030
  else {
961
- if (limit === undefined) {
962
- endTime = now;
963
- }
964
- else {
965
- endTime = this.sum(since, this.sum(limit, 1) * duration * 1000);
1031
+ if (limit !== undefined) {
1032
+ const endByLimit = this.sum(since, limit * durationMilliseconds);
1033
+ endTime = Math.min(endTime, endByLimit);
966
1034
  }
967
1035
  }
968
1036
  const startTimeNormalized = this.normalizeOHLCVTimestamp(startTime, timeframe);
@@ -268,6 +268,73 @@ class timex extends timex$1 {
268
268
  'defaultSort': 'timestamp,asc',
269
269
  'defaultSortOrders': 'createdAt,asc',
270
270
  },
271
+ 'features': {
272
+ 'spot': {
273
+ 'sandbox': false,
274
+ 'createOrder': {
275
+ 'marginMode': false,
276
+ 'triggerPrice': false,
277
+ 'triggerDirection': false,
278
+ 'triggerPriceType': undefined,
279
+ 'stopLossPrice': false,
280
+ 'takeProfitPrice': false,
281
+ 'attachedStopLossTakeProfit': undefined,
282
+ // todo
283
+ 'timeInForce': {
284
+ 'IOC': true,
285
+ 'FOK': true,
286
+ 'PO': false,
287
+ 'GTD': true,
288
+ },
289
+ 'hedged': false,
290
+ 'trailing': false,
291
+ 'leverage': false,
292
+ 'marketBuyByCost': false,
293
+ 'marketBuyRequiresPrice': false,
294
+ 'selfTradePrevention': false,
295
+ 'iceberg': false,
296
+ },
297
+ 'createOrders': undefined,
298
+ 'fetchMyTrades': {
299
+ 'marginMode': false,
300
+ 'limit': 100,
301
+ 'daysBack': 100000,
302
+ 'untilDays': 100000, // todo
303
+ },
304
+ 'fetchOrder': {
305
+ 'marginMode': false,
306
+ 'trigger': false,
307
+ 'trailing': false,
308
+ },
309
+ 'fetchOpenOrders': {
310
+ 'marginMode': false,
311
+ 'limit': 100,
312
+ 'trigger': false,
313
+ 'trailing': false,
314
+ },
315
+ 'fetchOrders': undefined,
316
+ 'fetchClosedOrders': {
317
+ 'marginMode': false,
318
+ 'limit': 100,
319
+ 'daysBack': 100000,
320
+ 'daysBackCanceled': 1,
321
+ 'untilDays': 100000,
322
+ 'trigger': false,
323
+ 'trailing': false,
324
+ },
325
+ 'fetchOHLCV': {
326
+ 'limit': undefined,
327
+ },
328
+ },
329
+ 'swap': {
330
+ 'linear': undefined,
331
+ 'inverse': undefined,
332
+ },
333
+ 'future': {
334
+ 'linear': undefined,
335
+ 'inverse': undefined,
336
+ },
337
+ },
271
338
  });
272
339
  }
273
340
  /**