ccxt 4.4.50 → 4.4.57

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 (277) hide show
  1. package/README.md +227 -142
  2. package/dist/ccxt.browser.min.js +8 -8
  3. package/dist/cjs/ccxt.js +1 -4
  4. package/dist/cjs/src/ace.js +3 -0
  5. package/dist/cjs/src/alpaca.js +6 -1
  6. package/dist/cjs/src/ascendex.js +2 -1
  7. package/dist/cjs/src/base/Exchange.js +151 -59
  8. package/dist/cjs/src/bigone.js +5 -0
  9. package/dist/cjs/src/binance.js +87 -68
  10. package/dist/cjs/src/bingx.js +27 -30
  11. package/dist/cjs/src/bit2c.js +3 -0
  12. package/dist/cjs/src/bitbank.js +3 -0
  13. package/dist/cjs/src/bitbns.js +3 -0
  14. package/dist/cjs/src/bitfinex.js +7 -2
  15. package/dist/cjs/src/bitflyer.js +5 -0
  16. package/dist/cjs/src/bitget.js +9 -5
  17. package/dist/cjs/src/bithumb.js +2 -0
  18. package/dist/cjs/src/bitmart.js +20 -8
  19. package/dist/cjs/src/bitmex.js +99 -93
  20. package/dist/cjs/src/bitopro.js +5 -0
  21. package/dist/cjs/src/bitrue.js +4 -0
  22. package/dist/cjs/src/bitso.js +3 -0
  23. package/dist/cjs/src/bitstamp.js +3 -0
  24. package/dist/cjs/src/bitteam.js +5 -0
  25. package/dist/cjs/src/bitvavo.js +4 -0
  26. package/dist/cjs/src/blockchaincom.js +5 -1
  27. package/dist/cjs/src/blofin.js +7 -0
  28. package/dist/cjs/src/btcalpha.js +5 -0
  29. package/dist/cjs/src/btcbox.js +3 -3
  30. package/dist/cjs/src/btcmarkets.js +5 -0
  31. package/dist/cjs/src/btcturk.js +3 -0
  32. package/dist/cjs/src/bybit.js +12 -2
  33. package/dist/cjs/src/cex.js +2 -0
  34. package/dist/cjs/src/coinbase.js +16 -8
  35. package/dist/cjs/src/coinbaseexchange.js +5 -0
  36. package/dist/cjs/src/coinbaseinternational.js +7 -3
  37. package/dist/cjs/src/coincatch.js +4 -1
  38. package/dist/cjs/src/coincheck.js +2 -0
  39. package/dist/cjs/src/coinex.js +6 -2
  40. package/dist/cjs/src/coinlist.js +5 -0
  41. package/dist/cjs/src/coinmate.js +5 -1
  42. package/dist/cjs/src/coinmetro.js +29 -8
  43. package/dist/cjs/src/coinone.js +4 -1
  44. package/dist/cjs/src/coinsph.js +5 -1
  45. package/dist/cjs/src/coinspot.js +2 -1
  46. package/dist/cjs/src/cryptocom.js +5 -0
  47. package/dist/cjs/src/currencycom.js +4 -1
  48. package/dist/cjs/src/defx.js +5 -0
  49. package/dist/cjs/src/delta.js +3 -0
  50. package/dist/cjs/src/deribit.js +37 -36
  51. package/dist/cjs/src/digifinex.js +10 -5
  52. package/dist/cjs/src/ellipx.js +9 -5
  53. package/dist/cjs/src/exmo.js +5 -2
  54. package/dist/cjs/src/gate.js +5 -1
  55. package/dist/cjs/src/gemini.js +3 -0
  56. package/dist/cjs/src/hashkey.js +5 -4
  57. package/dist/cjs/src/hitbtc.js +4 -0
  58. package/dist/cjs/src/hollaex.js +8 -2
  59. package/dist/cjs/src/htx.js +15 -5
  60. package/dist/cjs/src/huobijp.js +5 -0
  61. package/dist/cjs/src/hyperliquid.js +9 -4
  62. package/dist/cjs/src/idex.js +6 -2
  63. package/dist/cjs/src/independentreserve.js +4 -0
  64. package/dist/cjs/src/indodax.js +3 -0
  65. package/dist/cjs/src/kraken.js +7 -5
  66. package/dist/cjs/src/krakenfutures.js +5 -2
  67. package/dist/cjs/src/kucoin.js +18 -10
  68. package/dist/cjs/src/kucoinfutures.js +5 -1
  69. package/dist/cjs/src/kuna.js +3 -0
  70. package/dist/cjs/src/latoken.js +4 -0
  71. package/dist/cjs/src/lbank.js +6 -1
  72. package/dist/cjs/src/luno.js +7 -2
  73. package/dist/cjs/src/mercado.js +5 -1
  74. package/dist/cjs/src/mexc.js +36 -15
  75. package/dist/cjs/src/ndax.js +7 -2
  76. package/dist/cjs/src/novadax.js +6 -1
  77. package/dist/cjs/src/oceanex.js +4 -0
  78. package/dist/cjs/src/okcoin.js +6 -2
  79. package/dist/cjs/src/okx.js +18 -4
  80. package/dist/cjs/src/onetrading.js +6 -2
  81. package/dist/cjs/src/oxfun.js +3 -0
  82. package/dist/cjs/src/p2b.js +3 -0
  83. package/dist/cjs/src/paradex.js +10 -4
  84. package/dist/cjs/src/phemex.js +12 -5
  85. package/dist/cjs/src/poloniex.js +6 -3
  86. package/dist/cjs/src/poloniexfutures.js +5 -1
  87. package/dist/cjs/src/pro/binance.js +4 -2
  88. package/dist/cjs/src/pro/bitcoincom.js +1 -4
  89. package/dist/cjs/src/pro/bitget.js +3 -3
  90. package/dist/cjs/src/pro/bitopro.js +1 -1
  91. package/dist/cjs/src/pro/blofin.js +8 -0
  92. package/dist/cjs/src/pro/bybit.js +10 -2
  93. package/dist/cjs/src/pro/cex.js +1 -1
  94. package/dist/cjs/src/pro/coincatch.js +3 -3
  95. package/dist/cjs/src/pro/coinex.js +4 -1
  96. package/dist/cjs/src/pro/htx.js +8 -8
  97. package/dist/cjs/src/pro/mexc.js +3 -3
  98. package/dist/cjs/src/pro/okx.js +1 -1
  99. package/dist/cjs/src/probit.js +14 -9
  100. package/dist/cjs/src/timex.js +5 -1
  101. package/dist/cjs/src/tokocrypto.js +6 -1
  102. package/dist/cjs/src/tradeogre.js +2 -0
  103. package/dist/cjs/src/upbit.js +3 -0
  104. package/dist/cjs/src/vertex.js +71 -4
  105. package/dist/cjs/src/wavesexchange.js +96 -3
  106. package/dist/cjs/src/wazirx.js +61 -3
  107. package/dist/cjs/src/whitebit.js +74 -4
  108. package/dist/cjs/src/woo.js +15 -5
  109. package/dist/cjs/src/woofipro.js +25 -9
  110. package/dist/cjs/src/xt.js +117 -0
  111. package/dist/cjs/src/yobit.js +59 -0
  112. package/dist/cjs/src/zaif.js +57 -0
  113. package/dist/cjs/src/zonda.js +58 -0
  114. package/js/ccxt.d.ts +3 -6
  115. package/js/ccxt.js +2 -4
  116. package/js/src/abstract/binance.d.ts +0 -1
  117. package/js/src/abstract/binancecoinm.d.ts +0 -1
  118. package/js/src/abstract/binanceus.d.ts +0 -1
  119. package/js/src/abstract/binanceusdm.d.ts +0 -1
  120. package/js/src/ace.js +3 -0
  121. package/js/src/alpaca.js +6 -1
  122. package/js/src/ascendex.js +2 -1
  123. package/js/src/base/Exchange.d.ts +9 -3
  124. package/js/src/base/Exchange.js +151 -59
  125. package/js/src/base/types.d.ts +2 -0
  126. package/js/src/bigone.d.ts +1 -1
  127. package/js/src/bigone.js +5 -0
  128. package/js/src/binance.d.ts +33 -33
  129. package/js/src/binance.js +87 -68
  130. package/js/src/bingx.d.ts +1 -1
  131. package/js/src/bingx.js +27 -30
  132. package/js/src/bit2c.js +3 -0
  133. package/js/src/bitbank.js +3 -0
  134. package/js/src/bitbns.js +3 -0
  135. package/js/src/bitfinex.js +7 -2
  136. package/js/src/bitflyer.js +5 -0
  137. package/js/src/bitget.js +9 -5
  138. package/js/src/bithumb.js +2 -0
  139. package/js/src/bitmart.d.ts +5 -5
  140. package/js/src/bitmart.js +20 -8
  141. package/js/src/bitmex.js +99 -93
  142. package/js/src/bitopro.d.ts +2 -2
  143. package/js/src/bitopro.js +5 -0
  144. package/js/src/bitrue.js +4 -0
  145. package/js/src/bitso.d.ts +2 -2
  146. package/js/src/bitso.js +3 -0
  147. package/js/src/bitstamp.js +3 -0
  148. package/js/src/bitteam.js +5 -0
  149. package/js/src/bitvavo.js +4 -0
  150. package/js/src/blockchaincom.js +5 -1
  151. package/js/src/blofin.js +7 -0
  152. package/js/src/btcalpha.js +5 -0
  153. package/js/src/btcbox.js +3 -3
  154. package/js/src/btcmarkets.js +5 -0
  155. package/js/src/btcturk.js +3 -0
  156. package/js/src/bybit.d.ts +3 -3
  157. package/js/src/bybit.js +12 -2
  158. package/js/src/cex.js +2 -0
  159. package/js/src/coinbase.d.ts +4 -4
  160. package/js/src/coinbase.js +16 -8
  161. package/js/src/coinbaseexchange.js +5 -0
  162. package/js/src/coinbaseinternational.d.ts +1 -1
  163. package/js/src/coinbaseinternational.js +7 -3
  164. package/js/src/coincatch.js +4 -1
  165. package/js/src/coincheck.js +2 -0
  166. package/js/src/coinex.d.ts +1 -1
  167. package/js/src/coinex.js +6 -2
  168. package/js/src/coinlist.js +5 -0
  169. package/js/src/coinmate.js +5 -1
  170. package/js/src/coinmetro.js +29 -8
  171. package/js/src/coinone.js +4 -1
  172. package/js/src/coinsph.js +5 -1
  173. package/js/src/coinspot.js +2 -1
  174. package/js/src/cryptocom.js +5 -0
  175. package/js/src/currencycom.js +4 -1
  176. package/js/src/defx.js +5 -0
  177. package/js/src/delta.js +3 -0
  178. package/js/src/deribit.d.ts +5 -3
  179. package/js/src/deribit.js +37 -36
  180. package/js/src/digifinex.js +10 -5
  181. package/js/src/ellipx.d.ts +1 -1
  182. package/js/src/ellipx.js +9 -5
  183. package/js/src/exmo.d.ts +3 -3
  184. package/js/src/exmo.js +5 -2
  185. package/js/src/gate.js +5 -1
  186. package/js/src/gemini.js +3 -0
  187. package/js/src/hashkey.js +5 -4
  188. package/js/src/hitbtc.d.ts +2 -2
  189. package/js/src/hitbtc.js +4 -0
  190. package/js/src/hollaex.d.ts +2 -2
  191. package/js/src/hollaex.js +8 -2
  192. package/js/src/htx.d.ts +1 -1
  193. package/js/src/htx.js +15 -5
  194. package/js/src/huobijp.js +5 -0
  195. package/js/src/hyperliquid.d.ts +1 -1
  196. package/js/src/hyperliquid.js +9 -4
  197. package/js/src/idex.d.ts +1 -1
  198. package/js/src/idex.js +6 -2
  199. package/js/src/independentreserve.js +4 -0
  200. package/js/src/indodax.js +3 -0
  201. package/js/src/kraken.js +7 -5
  202. package/js/src/krakenfutures.js +5 -2
  203. package/js/src/kucoin.d.ts +2 -1
  204. package/js/src/kucoin.js +18 -10
  205. package/js/src/kucoinfutures.d.ts +1 -1
  206. package/js/src/kucoinfutures.js +5 -1
  207. package/js/src/kuna.js +3 -0
  208. package/js/src/latoken.js +4 -0
  209. package/js/src/lbank.js +6 -1
  210. package/js/src/luno.d.ts +1 -1
  211. package/js/src/luno.js +7 -2
  212. package/js/src/mercado.js +5 -1
  213. package/js/src/mexc.d.ts +1 -1
  214. package/js/src/mexc.js +36 -15
  215. package/js/src/ndax.js +7 -2
  216. package/js/src/novadax.js +6 -1
  217. package/js/src/oceanex.d.ts +2 -2
  218. package/js/src/oceanex.js +4 -0
  219. package/js/src/okcoin.js +6 -2
  220. package/js/src/okx.js +18 -4
  221. package/js/src/onetrading.d.ts +1 -1
  222. package/js/src/onetrading.js +6 -2
  223. package/js/src/oxfun.js +3 -0
  224. package/js/src/p2b.js +3 -0
  225. package/js/src/paradex.js +10 -4
  226. package/js/src/phemex.d.ts +1 -1
  227. package/js/src/phemex.js +12 -5
  228. package/js/src/poloniex.js +6 -3
  229. package/js/src/poloniexfutures.d.ts +1 -1
  230. package/js/src/poloniexfutures.js +5 -1
  231. package/js/src/pro/binance.js +4 -2
  232. package/js/src/pro/bitcoincom.js +1 -4
  233. package/js/src/pro/bitget.js +3 -3
  234. package/js/src/pro/bitopro.js +1 -1
  235. package/js/src/pro/blofin.js +8 -0
  236. package/js/src/pro/bybit.js +10 -2
  237. package/js/src/pro/cex.js +1 -1
  238. package/js/src/pro/coincatch.js +3 -3
  239. package/js/src/pro/coinex.js +4 -1
  240. package/js/src/pro/htx.d.ts +8 -8
  241. package/js/src/pro/htx.js +8 -8
  242. package/js/src/pro/mexc.js +3 -3
  243. package/js/src/pro/okx.js +1 -1
  244. package/js/src/probit.d.ts +1 -0
  245. package/js/src/probit.js +14 -9
  246. package/js/src/static_dependencies/node-fetch/headers.d.ts +5 -0
  247. package/js/src/static_dependencies/proxies/agent-base/helpers.d.ts +1 -0
  248. package/js/src/static_dependencies/proxies/https-proxy-agent/parse-proxy-response.d.ts +1 -0
  249. package/js/src/timex.js +5 -1
  250. package/js/src/tokocrypto.js +6 -1
  251. package/js/src/tradeogre.js +2 -0
  252. package/js/src/upbit.d.ts +2 -2
  253. package/js/src/upbit.js +3 -0
  254. package/js/src/vertex.js +71 -4
  255. package/js/src/wavesexchange.d.ts +2 -1
  256. package/js/src/wavesexchange.js +96 -3
  257. package/js/src/wazirx.js +61 -3
  258. package/js/src/whitebit.js +74 -4
  259. package/js/src/woo.d.ts +1 -1
  260. package/js/src/woo.js +15 -5
  261. package/js/src/woofipro.d.ts +1 -1
  262. package/js/src/woofipro.js +25 -9
  263. package/js/src/xt.js +117 -0
  264. package/js/src/yobit.d.ts +2 -2
  265. package/js/src/yobit.js +59 -0
  266. package/js/src/zaif.js +57 -0
  267. package/js/src/zonda.d.ts +1 -0
  268. package/js/src/zonda.js +58 -0
  269. package/package.json +25 -7
  270. package/dist/cjs/src/abstract/lykke.js +0 -9
  271. package/dist/cjs/src/lykke.js +0 -1401
  272. package/js/src/abstract/lykke.d.ts +0 -32
  273. package/js/src/abstract/lykke.js +0 -11
  274. package/js/src/hitbtc3.d.ts +0 -8
  275. package/js/src/hitbtc3.js +0 -20
  276. package/js/src/lykke.d.ts +0 -212
  277. package/js/src/lykke.js +0 -1402
@@ -344,6 +344,84 @@ class wavesexchange extends wavesexchange$1 {
344
344
  'BEP20': 'BSC',
345
345
  },
346
346
  },
347
+ 'features': {
348
+ 'spot': {
349
+ 'sandbox': true,
350
+ 'createOrder': {
351
+ 'marginMode': false,
352
+ 'triggerPrice': true,
353
+ 'triggerDirection': false,
354
+ 'triggerPriceType': undefined,
355
+ 'stopLossPrice': false,
356
+ 'takeProfitPrice': false,
357
+ 'attachedStopLossTakeProfit': undefined,
358
+ 'timeInForce': {
359
+ 'IOC': false,
360
+ 'FOK': false,
361
+ 'PO': false,
362
+ 'GTD': true, // todo
363
+ },
364
+ 'hedged': false,
365
+ 'trailing': false,
366
+ 'leverage': false,
367
+ 'marketBuyByCost': false,
368
+ 'marketBuyRequiresPrice': true,
369
+ 'selfTradePrevention': false,
370
+ 'iceberg': false,
371
+ },
372
+ 'createOrders': undefined,
373
+ 'fetchMyTrades': {
374
+ 'marginMode': false,
375
+ 'limit': 100,
376
+ 'daysBack': 100000,
377
+ 'untilDays': 100000,
378
+ 'symbolRequired': false,
379
+ },
380
+ 'fetchOrder': {
381
+ 'marginMode': false,
382
+ 'trigger': false,
383
+ 'trailing': false,
384
+ 'symbolRequired': false,
385
+ },
386
+ 'fetchOpenOrders': {
387
+ 'marginMode': false,
388
+ 'limit': 100,
389
+ 'trigger': false,
390
+ 'trailing': false,
391
+ 'symbolRequired': false,
392
+ },
393
+ 'fetchOrders': {
394
+ 'marginMode': false,
395
+ 'limit': 100,
396
+ 'daysBack': undefined,
397
+ 'untilDays': undefined,
398
+ 'trigger': false,
399
+ 'trailing': false,
400
+ 'symbolRequired': true,
401
+ },
402
+ 'fetchClosedOrders': {
403
+ 'marginMode': false,
404
+ 'limit': 100,
405
+ 'daysBack': 100000,
406
+ 'daysBackCanceled': 1,
407
+ 'untilDays': 100000,
408
+ 'trigger': false,
409
+ 'trailing': false,
410
+ 'symbolRequired': false,
411
+ },
412
+ 'fetchOHLCV': {
413
+ 'limit': undefined, // todo
414
+ },
415
+ },
416
+ 'swap': {
417
+ 'linear': undefined,
418
+ 'inverse': undefined,
419
+ },
420
+ 'future': {
421
+ 'linear': undefined,
422
+ 'inverse': undefined,
423
+ },
424
+ },
347
425
  'commonCurrencies': {
348
426
  'EGG': 'Waves Ducks',
349
427
  },
@@ -688,6 +766,7 @@ class wavesexchange extends wavesexchange$1 {
688
766
  if (hexSecretKeyBytes.length !== 64) {
689
767
  throw new errors.AuthenticationError(this.id + ' secret must be a base58 encoded private key');
690
768
  }
769
+ return true;
691
770
  }
692
771
  sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
693
772
  const query = this.omit(params, this.extractParams(path));
@@ -956,6 +1035,7 @@ class wavesexchange extends wavesexchange$1 {
956
1035
  * @param {int} [since] timestamp in ms of the earliest candle to fetch
957
1036
  * @param {int} [limit] the maximum amount of candles to fetch
958
1037
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1038
+ * @param {int} [params.until] timestamp in ms of the latest candle to fetch
959
1039
  * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
960
1040
  */
961
1041
  async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
@@ -967,22 +1047,35 @@ class wavesexchange extends wavesexchange$1 {
967
1047
  'interval': this.safeString(this.timeframes, timeframe, timeframe),
968
1048
  };
969
1049
  const allowedCandles = this.safeInteger(this.options, 'allowedCandles', 1440);
1050
+ const until = this.safeInteger(params, 'until');
1051
+ const untilIsDefined = until !== undefined;
970
1052
  if (limit === undefined) {
971
1053
  limit = allowedCandles;
972
1054
  }
973
1055
  limit = Math.min(allowedCandles, limit);
974
1056
  const duration = this.parseTimeframe(timeframe) * 1000;
975
1057
  if (since === undefined) {
976
- const durationRoundedTimestamp = this.parseToInt(this.milliseconds() / duration) * duration;
1058
+ const now = this.milliseconds();
1059
+ const timeEnd = untilIsDefined ? until : now;
1060
+ const durationRoundedTimestamp = this.parseToInt(timeEnd / duration) * duration;
977
1061
  const delta = (limit - 1) * duration;
978
1062
  const timeStart = durationRoundedTimestamp - delta;
979
1063
  request['timeStart'] = timeStart.toString();
1064
+ if (untilIsDefined) {
1065
+ request['timeEnd'] = until.toString();
1066
+ }
980
1067
  }
981
1068
  else {
982
1069
  request['timeStart'] = since.toString();
983
- const timeEnd = this.sum(since, duration * limit);
984
- request['timeEnd'] = timeEnd.toString();
1070
+ if (untilIsDefined) {
1071
+ request['timeEnd'] = until.toString();
1072
+ }
1073
+ else {
1074
+ const timeEnd = this.sum(since, duration * limit);
1075
+ request['timeEnd'] = timeEnd.toString();
1076
+ }
985
1077
  }
1078
+ params = this.omit(params, 'until');
986
1079
  const response = await this.publicGetCandlesBaseIdQuoteId(this.extend(request, params));
987
1080
  //
988
1081
  // {
@@ -207,6 +207,64 @@ class wazirx extends wazirx$1 {
207
207
  // You can get network from fetchCurrencies
208
208
  },
209
209
  },
210
+ 'features': {
211
+ 'spot': {
212
+ 'sandbox': false,
213
+ 'createOrder': {
214
+ 'marginMode': false,
215
+ 'triggerPrice': true,
216
+ 'triggerDirection': false,
217
+ 'triggerPriceType': undefined,
218
+ 'stopLossPrice': false,
219
+ 'takeProfitPrice': false,
220
+ 'attachedStopLossTakeProfit': undefined,
221
+ 'timeInForce': {
222
+ 'IOC': false,
223
+ 'FOK': false,
224
+ 'PO': false,
225
+ 'GTD': false,
226
+ },
227
+ 'hedged': false,
228
+ 'trailing': false,
229
+ 'leverage': false,
230
+ 'marketBuyByCost': false,
231
+ 'marketBuyRequiresPrice': false,
232
+ 'selfTradePrevention': false,
233
+ 'iceberg': false,
234
+ },
235
+ 'createOrders': undefined,
236
+ 'fetchMyTrades': undefined,
237
+ 'fetchOrder': undefined,
238
+ 'fetchOpenOrders': {
239
+ 'marginMode': false,
240
+ 'limit': undefined,
241
+ 'trigger': false,
242
+ 'trailing': false,
243
+ 'symbolRequired': true,
244
+ },
245
+ 'fetchOrders': {
246
+ 'marginMode': false,
247
+ 'limit': 1000,
248
+ 'daysBack': 100000,
249
+ 'untilDays': 100000,
250
+ 'trigger': false,
251
+ 'trailing': false,
252
+ 'symbolRequired': true,
253
+ },
254
+ 'fetchClosedOrders': undefined,
255
+ 'fetchOHLCV': {
256
+ 'limit': 2000,
257
+ },
258
+ },
259
+ 'swap': {
260
+ 'linear': undefined,
261
+ 'inverse': undefined,
262
+ },
263
+ 'future': {
264
+ 'linear': undefined,
265
+ 'inverse': undefined,
266
+ },
267
+ },
210
268
  });
211
269
  }
212
270
  /**
@@ -887,10 +945,10 @@ class wazirx extends wazirx$1 {
887
945
  'type': 'limit',
888
946
  };
889
947
  request['price'] = this.priceToPrecision(symbol, price);
890
- const stopPrice = this.safeString(params, 'stopPrice');
891
- if (stopPrice !== undefined) {
948
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
949
+ if (triggerPrice !== undefined) {
892
950
  request['type'] = 'stop_limit';
893
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
951
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
894
952
  }
895
953
  const response = await this.privatePostOrder(this.extend(request, params));
896
954
  // {
@@ -278,6 +278,78 @@ class whitebit extends whitebit$1 {
278
278
  'defaultType': 'spot',
279
279
  'brokerId': 'ccxt',
280
280
  },
281
+ 'features': {
282
+ 'default': {
283
+ 'sandbox': false,
284
+ 'createOrder': {
285
+ 'marginMode': true,
286
+ 'triggerPrice': true,
287
+ 'triggerDirection': false,
288
+ 'triggerPriceType': undefined,
289
+ 'stopLossPrice': false,
290
+ 'takeProfitPrice': false,
291
+ 'attachedStopLossTakeProfit': undefined,
292
+ 'timeInForce': {
293
+ 'IOC': true,
294
+ 'FOK': false,
295
+ 'PO': true,
296
+ 'GTD': false,
297
+ },
298
+ 'hedged': false,
299
+ 'trailing': false,
300
+ 'leverage': false,
301
+ 'marketBuyByCost': true,
302
+ 'marketBuyRequiresPrice': false,
303
+ 'selfTradePrevention': false,
304
+ 'iceberg': false,
305
+ },
306
+ 'createOrders': undefined,
307
+ 'fetchMyTrades': {
308
+ 'marginMode': false,
309
+ 'limit': 100,
310
+ 'daysBack': undefined,
311
+ 'untilDays': undefined,
312
+ 'symbolRequired': false,
313
+ },
314
+ 'fetchOrder': undefined,
315
+ 'fetchOpenOrders': {
316
+ 'marginMode': false,
317
+ 'limit': 100,
318
+ 'trigger': false,
319
+ 'trailing': false,
320
+ 'symbolRequired': false,
321
+ },
322
+ 'fetchOrders': undefined,
323
+ 'fetchClosedOrders': {
324
+ 'marginMode': false,
325
+ 'limit': 100,
326
+ 'daysBack': undefined,
327
+ 'daysBackCanceled': undefined,
328
+ 'untilDays': undefined,
329
+ 'trigger': false,
330
+ 'trailing': false,
331
+ 'symbolRequired': false,
332
+ },
333
+ 'fetchOHLCV': {
334
+ 'limit': 1440,
335
+ },
336
+ },
337
+ 'spot': {
338
+ 'extends': 'default',
339
+ },
340
+ 'swap': {
341
+ 'linear': {
342
+ 'extends': 'default',
343
+ },
344
+ 'inverse': {
345
+ 'extends': 'default',
346
+ },
347
+ },
348
+ 'future': {
349
+ 'linear': undefined,
350
+ 'inverse': undefined,
351
+ },
352
+ },
281
353
  'precisionMode': number.TICK_SIZE,
282
354
  'exceptions': {
283
355
  'exact': {
@@ -1260,11 +1332,9 @@ class whitebit extends whitebit$1 {
1260
1332
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1261
1333
  */
1262
1334
  async createMarketOrderWithCost(symbol, side, cost, params = {}) {
1263
- const req = {
1264
- 'cost': cost,
1265
- };
1335
+ params['cost'] = cost;
1266
1336
  // only buy side is supported
1267
- return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
1337
+ return await this.createOrder(symbol, 'market', side, 0, undefined, params);
1268
1338
  }
1269
1339
  /**
1270
1340
  * @method
@@ -347,17 +347,20 @@ class woo extends woo$1 {
347
347
  'limit': 500,
348
348
  'daysBack': 90,
349
349
  'untilDays': 10000,
350
+ 'symbolRequired': false,
350
351
  },
351
352
  'fetchOrder': {
352
353
  'marginMode': false,
353
354
  'trigger': true,
354
355
  'trailing': false,
356
+ 'symbolRequired': false,
355
357
  },
356
358
  'fetchOpenOrders': {
357
359
  'marginMode': false,
358
360
  'limit': 500,
359
361
  'trigger': true,
360
362
  'trailing': true,
363
+ 'symbolRequired': false,
361
364
  },
362
365
  'fetchOrders': {
363
366
  'marginMode': false,
@@ -366,6 +369,7 @@ class woo extends woo$1 {
366
369
  'untilDays': 100000,
367
370
  'trigger': true,
368
371
  'trailing': true,
372
+ 'symbolRequired': false,
369
373
  },
370
374
  'fetchClosedOrders': {
371
375
  'marginMode': false,
@@ -375,6 +379,7 @@ class woo extends woo$1 {
375
379
  'untilDays': 100000,
376
380
  'trigger': true,
377
381
  'trailing': true,
382
+ 'symbolRequired': false,
378
383
  },
379
384
  'fetchOHLCV': {
380
385
  'limit': 1000,
@@ -1162,6 +1167,7 @@ class woo extends woo$1 {
1162
1167
  'algoType': 'POSITIONAL_TP_SL',
1163
1168
  'childOrders': [],
1164
1169
  };
1170
+ const childOrders = outterOrder['childOrders'];
1165
1171
  const closeSide = (orderSide === 'BUY') ? 'SELL' : 'BUY';
1166
1172
  if (stopLoss !== undefined) {
1167
1173
  const stopLossPrice = this.safeString(stopLoss, 'triggerPrice', stopLoss);
@@ -1172,7 +1178,7 @@ class woo extends woo$1 {
1172
1178
  'type': 'CLOSE_POSITION',
1173
1179
  'reduceOnly': true,
1174
1180
  };
1175
- outterOrder['childOrders'].push(stopLossOrder);
1181
+ childOrders.push(stopLossOrder);
1176
1182
  }
1177
1183
  if (takeProfit !== undefined) {
1178
1184
  const takeProfitPrice = this.safeString(takeProfit, 'triggerPrice', takeProfit);
@@ -1183,7 +1189,7 @@ class woo extends woo$1 {
1183
1189
  'type': 'CLOSE_POSITION',
1184
1190
  'reduceOnly': true,
1185
1191
  };
1186
- outterOrder['childOrders'].push(takeProfitOrder);
1192
+ childOrders.push(takeProfitOrder);
1187
1193
  }
1188
1194
  request['childOrders'] = [outterOrder];
1189
1195
  }
@@ -2243,7 +2249,9 @@ class woo extends woo$1 {
2243
2249
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2244
2250
  */
2245
2251
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2246
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, params);
2252
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, params);
2253
+ const currency = this.safeValue(currencyRows, 0);
2254
+ const rows = this.safeList(currencyRows, 1);
2247
2255
  return this.parseLedger(rows, currency, since, limit, params);
2248
2256
  }
2249
2257
  parseLedgerEntry(item, currency = undefined) {
@@ -2346,7 +2354,9 @@ class woo extends woo$1 {
2346
2354
  const request = {
2347
2355
  'type': 'BALANCE',
2348
2356
  };
2349
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2357
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2358
+ const currency = this.safeValue(currencyRows, 0);
2359
+ const rows = this.safeList(currencyRows, 1);
2350
2360
  //
2351
2361
  // {
2352
2362
  // "rows":[],
@@ -3266,7 +3276,7 @@ class woo extends woo$1 {
3266
3276
  };
3267
3277
  return await this.v1PrivatePostClientIsolatedMargin(this.extend(request, params));
3268
3278
  }
3269
- async fetchPosition(symbol = undefined, params = {}) {
3279
+ async fetchPosition(symbol, params = {}) {
3270
3280
  await this.loadMarkets();
3271
3281
  const market = this.market(symbol);
3272
3282
  const request = {
@@ -334,17 +334,20 @@ class woofipro extends woofipro$1 {
334
334
  'limit': 500,
335
335
  'daysBack': undefined,
336
336
  'untilDays': 100000,
337
+ 'symbolRequired': false,
337
338
  },
338
339
  'fetchOrder': {
339
340
  'marginMode': false,
340
341
  'trigger': true,
341
342
  'trailing': false,
343
+ 'symbolRequired': false,
342
344
  },
343
345
  'fetchOpenOrders': {
344
346
  'marginMode': false,
345
347
  'limit': 500,
346
348
  'trigger': true,
347
349
  'trailing': false,
350
+ 'symbolRequired': false,
348
351
  },
349
352
  'fetchOrders': undefined,
350
353
  'fetchClosedOrders': {
@@ -355,6 +358,7 @@ class woofipro extends woofipro$1 {
355
358
  'untilDays': 100000,
356
359
  'trigger': true,
357
360
  'trailing': false,
361
+ 'symbolRequired': false,
358
362
  },
359
363
  'fetchOHLCV': {
360
364
  'limit': 1000,
@@ -1409,6 +1413,7 @@ class woofipro extends woofipro$1 {
1409
1413
  'algo_type': 'POSITIONAL_TP_SL',
1410
1414
  'child_orders': [],
1411
1415
  };
1416
+ const childOrders = outterOrder['child_orders'];
1412
1417
  const closeSide = (orderSide === 'BUY') ? 'SELL' : 'BUY';
1413
1418
  if (stopLoss !== undefined) {
1414
1419
  const stopLossPrice = this.safeNumber2(stopLoss, 'triggerPrice', 'price', stopLoss);
@@ -1419,7 +1424,7 @@ class woofipro extends woofipro$1 {
1419
1424
  'type': 'LIMIT',
1420
1425
  'reduce_only': true,
1421
1426
  };
1422
- outterOrder['child_orders'].push(stopLossOrder);
1427
+ childOrders.push(stopLossOrder);
1423
1428
  }
1424
1429
  if (takeProfit !== undefined) {
1425
1430
  const takeProfitPrice = this.safeNumber2(takeProfit, 'triggerPrice', 'price', takeProfit);
@@ -1430,7 +1435,7 @@ class woofipro extends woofipro$1 {
1430
1435
  'type': 'LIMIT',
1431
1436
  'reduce_only': true,
1432
1437
  };
1433
- outterOrder['child_orders'].push(takeProfitOrder);
1438
+ outterOrder.push(takeProfitOrder);
1434
1439
  }
1435
1440
  request['child_orders'] = [outterOrder];
1436
1441
  }
@@ -1532,7 +1537,7 @@ class woofipro extends woofipro$1 {
1532
1537
  const takeProfit = this.safeValue(orderParams, 'takeProfit');
1533
1538
  const isConditional = triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(orderParams, 'childOrders') !== undefined);
1534
1539
  if (isConditional) {
1535
- throw new errors.NotSupported(this.id + 'createOrders() only support non-stop order');
1540
+ throw new errors.NotSupported(this.id + ' createOrders() only support non-stop order');
1536
1541
  }
1537
1542
  const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams);
1538
1543
  ordersRequests.push(orderRequest);
@@ -1832,7 +1837,10 @@ class woofipro extends woofipro$1 {
1832
1837
  */
1833
1838
  async fetchOrder(id, symbol = undefined, params = {}) {
1834
1839
  await this.loadMarkets();
1835
- const market = (symbol !== undefined) ? this.market(symbol) : undefined;
1840
+ let market = undefined;
1841
+ if (symbol !== undefined) {
1842
+ market = this.market(symbol);
1843
+ }
1836
1844
  const trigger = this.safeBool2(params, 'stop', 'trigger', false);
1837
1845
  const request = {};
1838
1846
  const clientOrderId = this.safeStringN(params, ['clOrdID', 'clientOrderId', 'client_order_id']);
@@ -2275,7 +2283,9 @@ class woofipro extends woofipro$1 {
2275
2283
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2276
2284
  */
2277
2285
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2278
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, params);
2286
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, params);
2287
+ const currency = this.safeValue(currencyRows, 0);
2288
+ const rows = this.safeList(currencyRows, 1);
2279
2289
  return this.parseLedger(rows, currency, since, limit, params);
2280
2290
  }
2281
2291
  parseTransaction(transaction, currency = undefined) {
@@ -2369,7 +2379,9 @@ class woofipro extends woofipro$1 {
2369
2379
  */
2370
2380
  async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
2371
2381
  const request = {};
2372
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2382
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2383
+ const currency = this.safeValue(currencyRows, 0);
2384
+ const rows = this.safeList(currencyRows, 1);
2373
2385
  //
2374
2386
  // {
2375
2387
  // "rows":[],
@@ -2428,7 +2440,7 @@ class woofipro extends woofipro$1 {
2428
2440
  if (code !== undefined) {
2429
2441
  code = code.toUpperCase();
2430
2442
  if (code !== 'USDC') {
2431
- throw new errors.NotSupported(this.id + 'withdraw() only support USDC');
2443
+ throw new errors.NotSupported(this.id + ' withdraw() only support USDC');
2432
2444
  }
2433
2445
  }
2434
2446
  const currency = this.currency(code);
@@ -2643,7 +2655,7 @@ class woofipro extends woofipro$1 {
2643
2655
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2644
2656
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
2645
2657
  */
2646
- async fetchPosition(symbol = undefined, params = {}) {
2658
+ async fetchPosition(symbol, params = {}) {
2647
2659
  await this.loadMarkets();
2648
2660
  const market = this.market(symbol);
2649
2661
  const request = {
@@ -2771,9 +2783,13 @@ class woofipro extends woofipro$1 {
2771
2783
  let auth = '';
2772
2784
  const ts = this.nonce().toString();
2773
2785
  url += pathWithParams;
2786
+ let apiKey = this.apiKey;
2787
+ if (apiKey.indexOf('ed25519:') < 0) {
2788
+ apiKey = 'ed25519:' + apiKey;
2789
+ }
2774
2790
  headers = {
2775
2791
  'orderly-account-id': this.accountId,
2776
- 'orderly-key': this.apiKey,
2792
+ 'orderly-key': apiKey,
2777
2793
  'orderly-timestamp': ts,
2778
2794
  };
2779
2795
  auth = ts + method + '/' + version + '/' + pathWithParams;
@@ -673,6 +673,123 @@ class xt extends xt$1 {
673
673
  'createMarketBuyOrderRequiresPrice': true,
674
674
  'recvWindow': '5000', // in milliseconds, spot only
675
675
  },
676
+ 'features': {
677
+ 'default': {
678
+ 'sandbox': false,
679
+ 'createOrder': {
680
+ 'marginMode': false,
681
+ 'triggerPrice': false,
682
+ 'triggerDirection': false,
683
+ 'triggerPriceType': undefined,
684
+ 'stopLossPrice': false,
685
+ 'takeProfitPrice': false,
686
+ 'attachedStopLossTakeProfit': undefined,
687
+ 'timeInForce': {
688
+ 'IOC': true,
689
+ 'FOK': true,
690
+ 'PO': true,
691
+ 'GTD': false,
692
+ },
693
+ 'hedged': false,
694
+ 'trailing': false,
695
+ 'leverage': false,
696
+ 'marketBuyByCost': true,
697
+ 'marketBuyRequiresPrice': false,
698
+ 'selfTradePrevention': false,
699
+ 'iceberg': false,
700
+ },
701
+ 'createOrders': undefined,
702
+ 'fetchMyTrades': {
703
+ 'marginMode': true,
704
+ 'limit': 100,
705
+ 'daysBack': 100000,
706
+ 'untilDays': 100000,
707
+ 'marketType': true,
708
+ 'subType': true,
709
+ 'symbolRequired': false,
710
+ },
711
+ 'fetchOrder': {
712
+ 'marginMode': false,
713
+ 'trigger': true,
714
+ 'trailing': false,
715
+ 'marketType': true,
716
+ 'subType': true,
717
+ 'symbolRequired': false,
718
+ },
719
+ 'fetchOpenOrders': {
720
+ 'marginMode': true,
721
+ 'limit': 100,
722
+ 'trigger': true,
723
+ 'trailing': false,
724
+ 'marketType': true,
725
+ 'subType': true,
726
+ 'symbolRequired': false,
727
+ },
728
+ 'fetchOrders': {
729
+ 'marginMode': true,
730
+ 'limit': 100,
731
+ 'daysBack': 100000,
732
+ 'untilDays': 100000,
733
+ 'trigger': true,
734
+ 'trailing': false,
735
+ 'marketType': true,
736
+ 'subType': true,
737
+ 'symbolRequired': false,
738
+ },
739
+ 'fetchClosedOrders': {
740
+ 'marginMode': true,
741
+ 'limit': 100,
742
+ 'daysBack': 100000,
743
+ 'daysBackCanceled': 1,
744
+ 'untilDays': 100000,
745
+ 'trigger': true,
746
+ 'trailing': false,
747
+ 'marketType': true,
748
+ 'subType': true,
749
+ 'symbolRequired': false,
750
+ },
751
+ 'fetchOHLCV': {
752
+ 'limit': 1000, // todo for derivatives
753
+ },
754
+ },
755
+ 'spot': {
756
+ 'extends': 'default',
757
+ },
758
+ 'forDerivatives': {
759
+ 'extends': 'default',
760
+ 'createOrder': {
761
+ 'triggerPrice': true,
762
+ // todo
763
+ 'triggerPriceType': {
764
+ 'last': true,
765
+ 'mark': true,
766
+ 'index': true,
767
+ },
768
+ 'stopLossPrice': true,
769
+ 'takeProfitPrice': true,
770
+ },
771
+ 'fetchMyTrades': {
772
+ 'daysBack': undefined,
773
+ 'untilDays': undefined,
774
+ },
775
+ },
776
+ 'swap': {
777
+ 'linear': {
778
+ 'extends': 'forDerivatives',
779
+ },
780
+ 'inverse': {
781
+ 'extends': 'forDerivatives',
782
+ },
783
+ },
784
+ 'future': {
785
+ 'linear': {
786
+ 'extends': 'forDerivatives',
787
+ },
788
+ 'inverse': {
789
+ 'extends': 'forDerivatives',
790
+ },
791
+ },
792
+ },
676
793
  });
677
794
  }
678
795
  nonce() {