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
@@ -281,6 +281,78 @@ export default class whitebit extends Exchange {
281
281
  'defaultType': 'spot',
282
282
  'brokerId': 'ccxt',
283
283
  },
284
+ 'features': {
285
+ 'default': {
286
+ 'sandbox': false,
287
+ 'createOrder': {
288
+ 'marginMode': true,
289
+ 'triggerPrice': true,
290
+ 'triggerDirection': false,
291
+ 'triggerPriceType': undefined,
292
+ 'stopLossPrice': false,
293
+ 'takeProfitPrice': false,
294
+ 'attachedStopLossTakeProfit': undefined,
295
+ 'timeInForce': {
296
+ 'IOC': true,
297
+ 'FOK': false,
298
+ 'PO': true,
299
+ 'GTD': false,
300
+ },
301
+ 'hedged': false,
302
+ 'trailing': false,
303
+ 'leverage': false,
304
+ 'marketBuyByCost': true,
305
+ 'marketBuyRequiresPrice': false,
306
+ 'selfTradePrevention': false,
307
+ 'iceberg': false,
308
+ },
309
+ 'createOrders': undefined,
310
+ 'fetchMyTrades': {
311
+ 'marginMode': false,
312
+ 'limit': 100,
313
+ 'daysBack': undefined,
314
+ 'untilDays': undefined,
315
+ 'symbolRequired': false,
316
+ },
317
+ 'fetchOrder': undefined,
318
+ 'fetchOpenOrders': {
319
+ 'marginMode': false,
320
+ 'limit': 100,
321
+ 'trigger': false,
322
+ 'trailing': false,
323
+ 'symbolRequired': false,
324
+ },
325
+ 'fetchOrders': undefined,
326
+ 'fetchClosedOrders': {
327
+ 'marginMode': false,
328
+ 'limit': 100,
329
+ 'daysBack': undefined,
330
+ 'daysBackCanceled': undefined,
331
+ 'untilDays': undefined,
332
+ 'trigger': false,
333
+ 'trailing': false,
334
+ 'symbolRequired': false,
335
+ },
336
+ 'fetchOHLCV': {
337
+ 'limit': 1440,
338
+ },
339
+ },
340
+ 'spot': {
341
+ 'extends': 'default',
342
+ },
343
+ 'swap': {
344
+ 'linear': {
345
+ 'extends': 'default',
346
+ },
347
+ 'inverse': {
348
+ 'extends': 'default',
349
+ },
350
+ },
351
+ 'future': {
352
+ 'linear': undefined,
353
+ 'inverse': undefined,
354
+ },
355
+ },
284
356
  'precisionMode': TICK_SIZE,
285
357
  'exceptions': {
286
358
  'exact': {
@@ -1263,11 +1335,9 @@ export default class whitebit extends Exchange {
1263
1335
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1264
1336
  */
1265
1337
  async createMarketOrderWithCost(symbol, side, cost, params = {}) {
1266
- const req = {
1267
- 'cost': cost,
1268
- };
1338
+ params['cost'] = cost;
1269
1339
  // only buy side is supported
1270
- return await this.createOrder(symbol, 'market', side, 0, undefined, this.extend(req, params));
1340
+ return await this.createOrder(symbol, 'market', side, 0, undefined, params);
1271
1341
  }
1272
1342
  /**
1273
1343
  * @method
package/js/src/woo.d.ts CHANGED
@@ -628,7 +628,7 @@ export default class woo extends Exchange {
628
628
  */
629
629
  reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
630
630
  modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
631
- fetchPosition(symbol?: Str, params?: {}): Promise<import("./base/types.js").Position>;
631
+ fetchPosition(symbol: Str, params?: {}): Promise<import("./base/types.js").Position>;
632
632
  fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
633
633
  parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
634
634
  /**
package/js/src/woo.js CHANGED
@@ -350,17 +350,20 @@ export default class woo extends Exchange {
350
350
  'limit': 500,
351
351
  'daysBack': 90,
352
352
  'untilDays': 10000,
353
+ 'symbolRequired': false,
353
354
  },
354
355
  'fetchOrder': {
355
356
  'marginMode': false,
356
357
  'trigger': true,
357
358
  'trailing': false,
359
+ 'symbolRequired': false,
358
360
  },
359
361
  'fetchOpenOrders': {
360
362
  'marginMode': false,
361
363
  'limit': 500,
362
364
  'trigger': true,
363
365
  'trailing': true,
366
+ 'symbolRequired': false,
364
367
  },
365
368
  'fetchOrders': {
366
369
  'marginMode': false,
@@ -369,6 +372,7 @@ export default class woo extends Exchange {
369
372
  'untilDays': 100000,
370
373
  'trigger': true,
371
374
  'trailing': true,
375
+ 'symbolRequired': false,
372
376
  },
373
377
  'fetchClosedOrders': {
374
378
  'marginMode': false,
@@ -378,6 +382,7 @@ export default class woo extends Exchange {
378
382
  'untilDays': 100000,
379
383
  'trigger': true,
380
384
  'trailing': true,
385
+ 'symbolRequired': false,
381
386
  },
382
387
  'fetchOHLCV': {
383
388
  'limit': 1000,
@@ -1165,6 +1170,7 @@ export default class woo extends Exchange {
1165
1170
  'algoType': 'POSITIONAL_TP_SL',
1166
1171
  'childOrders': [],
1167
1172
  };
1173
+ const childOrders = outterOrder['childOrders'];
1168
1174
  const closeSide = (orderSide === 'BUY') ? 'SELL' : 'BUY';
1169
1175
  if (stopLoss !== undefined) {
1170
1176
  const stopLossPrice = this.safeString(stopLoss, 'triggerPrice', stopLoss);
@@ -1175,7 +1181,7 @@ export default class woo extends Exchange {
1175
1181
  'type': 'CLOSE_POSITION',
1176
1182
  'reduceOnly': true,
1177
1183
  };
1178
- outterOrder['childOrders'].push(stopLossOrder);
1184
+ childOrders.push(stopLossOrder);
1179
1185
  }
1180
1186
  if (takeProfit !== undefined) {
1181
1187
  const takeProfitPrice = this.safeString(takeProfit, 'triggerPrice', takeProfit);
@@ -1186,7 +1192,7 @@ export default class woo extends Exchange {
1186
1192
  'type': 'CLOSE_POSITION',
1187
1193
  'reduceOnly': true,
1188
1194
  };
1189
- outterOrder['childOrders'].push(takeProfitOrder);
1195
+ childOrders.push(takeProfitOrder);
1190
1196
  }
1191
1197
  request['childOrders'] = [outterOrder];
1192
1198
  }
@@ -2246,7 +2252,9 @@ export default class woo extends Exchange {
2246
2252
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2247
2253
  */
2248
2254
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2249
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, params);
2255
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, params);
2256
+ const currency = this.safeValue(currencyRows, 0);
2257
+ const rows = this.safeList(currencyRows, 1);
2250
2258
  return this.parseLedger(rows, currency, since, limit, params);
2251
2259
  }
2252
2260
  parseLedgerEntry(item, currency = undefined) {
@@ -2349,7 +2357,9 @@ export default class woo extends Exchange {
2349
2357
  const request = {
2350
2358
  'type': 'BALANCE',
2351
2359
  };
2352
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2360
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2361
+ const currency = this.safeValue(currencyRows, 0);
2362
+ const rows = this.safeList(currencyRows, 1);
2353
2363
  //
2354
2364
  // {
2355
2365
  // "rows":[],
@@ -3269,7 +3279,7 @@ export default class woo extends Exchange {
3269
3279
  };
3270
3280
  return await this.v1PrivatePostClientIsolatedMargin(this.extend(request, params));
3271
3281
  }
3272
- async fetchPosition(symbol = undefined, params = {}) {
3282
+ async fetchPosition(symbol, params = {}) {
3273
3283
  await this.loadMarkets();
3274
3284
  const market = this.market(symbol);
3275
3285
  const request = {
@@ -453,7 +453,7 @@ export default class woofipro extends Exchange {
453
453
  * @param {object} [params] extra parameters specific to the exchange API endpoint
454
454
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
455
455
  */
456
- fetchPosition(symbol?: Str, params?: {}): Promise<import("./base/types.js").Position>;
456
+ fetchPosition(symbol: Str, params?: {}): Promise<import("./base/types.js").Position>;
457
457
  /**
458
458
  * @method
459
459
  * @name woofipro#fetchPositions
@@ -337,17 +337,20 @@ export default class woofipro extends Exchange {
337
337
  'limit': 500,
338
338
  'daysBack': undefined,
339
339
  'untilDays': 100000,
340
+ 'symbolRequired': false,
340
341
  },
341
342
  'fetchOrder': {
342
343
  'marginMode': false,
343
344
  'trigger': true,
344
345
  'trailing': false,
346
+ 'symbolRequired': false,
345
347
  },
346
348
  'fetchOpenOrders': {
347
349
  'marginMode': false,
348
350
  'limit': 500,
349
351
  'trigger': true,
350
352
  'trailing': false,
353
+ 'symbolRequired': false,
351
354
  },
352
355
  'fetchOrders': undefined,
353
356
  'fetchClosedOrders': {
@@ -358,6 +361,7 @@ export default class woofipro extends Exchange {
358
361
  'untilDays': 100000,
359
362
  'trigger': true,
360
363
  'trailing': false,
364
+ 'symbolRequired': false,
361
365
  },
362
366
  'fetchOHLCV': {
363
367
  'limit': 1000,
@@ -1412,6 +1416,7 @@ export default class woofipro extends Exchange {
1412
1416
  'algo_type': 'POSITIONAL_TP_SL',
1413
1417
  'child_orders': [],
1414
1418
  };
1419
+ const childOrders = outterOrder['child_orders'];
1415
1420
  const closeSide = (orderSide === 'BUY') ? 'SELL' : 'BUY';
1416
1421
  if (stopLoss !== undefined) {
1417
1422
  const stopLossPrice = this.safeNumber2(stopLoss, 'triggerPrice', 'price', stopLoss);
@@ -1422,7 +1427,7 @@ export default class woofipro extends Exchange {
1422
1427
  'type': 'LIMIT',
1423
1428
  'reduce_only': true,
1424
1429
  };
1425
- outterOrder['child_orders'].push(stopLossOrder);
1430
+ childOrders.push(stopLossOrder);
1426
1431
  }
1427
1432
  if (takeProfit !== undefined) {
1428
1433
  const takeProfitPrice = this.safeNumber2(takeProfit, 'triggerPrice', 'price', takeProfit);
@@ -1433,7 +1438,7 @@ export default class woofipro extends Exchange {
1433
1438
  'type': 'LIMIT',
1434
1439
  'reduce_only': true,
1435
1440
  };
1436
- outterOrder['child_orders'].push(takeProfitOrder);
1441
+ outterOrder.push(takeProfitOrder);
1437
1442
  }
1438
1443
  request['child_orders'] = [outterOrder];
1439
1444
  }
@@ -1535,7 +1540,7 @@ export default class woofipro extends Exchange {
1535
1540
  const takeProfit = this.safeValue(orderParams, 'takeProfit');
1536
1541
  const isConditional = triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(orderParams, 'childOrders') !== undefined);
1537
1542
  if (isConditional) {
1538
- throw new NotSupported(this.id + 'createOrders() only support non-stop order');
1543
+ throw new NotSupported(this.id + ' createOrders() only support non-stop order');
1539
1544
  }
1540
1545
  const orderRequest = this.createOrderRequest(marketId, type, side, amount, price, orderParams);
1541
1546
  ordersRequests.push(orderRequest);
@@ -1835,7 +1840,10 @@ export default class woofipro extends Exchange {
1835
1840
  */
1836
1841
  async fetchOrder(id, symbol = undefined, params = {}) {
1837
1842
  await this.loadMarkets();
1838
- const market = (symbol !== undefined) ? this.market(symbol) : undefined;
1843
+ let market = undefined;
1844
+ if (symbol !== undefined) {
1845
+ market = this.market(symbol);
1846
+ }
1839
1847
  const trigger = this.safeBool2(params, 'stop', 'trigger', false);
1840
1848
  const request = {};
1841
1849
  const clientOrderId = this.safeStringN(params, ['clOrdID', 'clientOrderId', 'client_order_id']);
@@ -2278,7 +2286,9 @@ export default class woofipro extends Exchange {
2278
2286
  * @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
2279
2287
  */
2280
2288
  async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
2281
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, params);
2289
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, params);
2290
+ const currency = this.safeValue(currencyRows, 0);
2291
+ const rows = this.safeList(currencyRows, 1);
2282
2292
  return this.parseLedger(rows, currency, since, limit, params);
2283
2293
  }
2284
2294
  parseTransaction(transaction, currency = undefined) {
@@ -2372,7 +2382,9 @@ export default class woofipro extends Exchange {
2372
2382
  */
2373
2383
  async fetchDepositsWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
2374
2384
  const request = {};
2375
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2385
+ const currencyRows = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2386
+ const currency = this.safeValue(currencyRows, 0);
2387
+ const rows = this.safeList(currencyRows, 1);
2376
2388
  //
2377
2389
  // {
2378
2390
  // "rows":[],
@@ -2431,7 +2443,7 @@ export default class woofipro extends Exchange {
2431
2443
  if (code !== undefined) {
2432
2444
  code = code.toUpperCase();
2433
2445
  if (code !== 'USDC') {
2434
- throw new NotSupported(this.id + 'withdraw() only support USDC');
2446
+ throw new NotSupported(this.id + ' withdraw() only support USDC');
2435
2447
  }
2436
2448
  }
2437
2449
  const currency = this.currency(code);
@@ -2646,7 +2658,7 @@ export default class woofipro extends Exchange {
2646
2658
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2647
2659
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
2648
2660
  */
2649
- async fetchPosition(symbol = undefined, params = {}) {
2661
+ async fetchPosition(symbol, params = {}) {
2650
2662
  await this.loadMarkets();
2651
2663
  const market = this.market(symbol);
2652
2664
  const request = {
@@ -2774,9 +2786,13 @@ export default class woofipro extends Exchange {
2774
2786
  let auth = '';
2775
2787
  const ts = this.nonce().toString();
2776
2788
  url += pathWithParams;
2789
+ let apiKey = this.apiKey;
2790
+ if (apiKey.indexOf('ed25519:') < 0) {
2791
+ apiKey = 'ed25519:' + apiKey;
2792
+ }
2777
2793
  headers = {
2778
2794
  'orderly-account-id': this.accountId,
2779
- 'orderly-key': this.apiKey,
2795
+ 'orderly-key': apiKey,
2780
2796
  'orderly-timestamp': ts,
2781
2797
  };
2782
2798
  auth = ts + method + '/' + version + '/' + pathWithParams;
package/js/src/xt.js CHANGED
@@ -676,6 +676,123 @@ export default class xt extends Exchange {
676
676
  'createMarketBuyOrderRequiresPrice': true,
677
677
  'recvWindow': '5000', // in milliseconds, spot only
678
678
  },
679
+ 'features': {
680
+ 'default': {
681
+ 'sandbox': false,
682
+ 'createOrder': {
683
+ 'marginMode': false,
684
+ 'triggerPrice': false,
685
+ 'triggerDirection': false,
686
+ 'triggerPriceType': undefined,
687
+ 'stopLossPrice': false,
688
+ 'takeProfitPrice': false,
689
+ 'attachedStopLossTakeProfit': undefined,
690
+ 'timeInForce': {
691
+ 'IOC': true,
692
+ 'FOK': true,
693
+ 'PO': true,
694
+ 'GTD': false,
695
+ },
696
+ 'hedged': false,
697
+ 'trailing': false,
698
+ 'leverage': false,
699
+ 'marketBuyByCost': true,
700
+ 'marketBuyRequiresPrice': false,
701
+ 'selfTradePrevention': false,
702
+ 'iceberg': false,
703
+ },
704
+ 'createOrders': undefined,
705
+ 'fetchMyTrades': {
706
+ 'marginMode': true,
707
+ 'limit': 100,
708
+ 'daysBack': 100000,
709
+ 'untilDays': 100000,
710
+ 'marketType': true,
711
+ 'subType': true,
712
+ 'symbolRequired': false,
713
+ },
714
+ 'fetchOrder': {
715
+ 'marginMode': false,
716
+ 'trigger': true,
717
+ 'trailing': false,
718
+ 'marketType': true,
719
+ 'subType': true,
720
+ 'symbolRequired': false,
721
+ },
722
+ 'fetchOpenOrders': {
723
+ 'marginMode': true,
724
+ 'limit': 100,
725
+ 'trigger': true,
726
+ 'trailing': false,
727
+ 'marketType': true,
728
+ 'subType': true,
729
+ 'symbolRequired': false,
730
+ },
731
+ 'fetchOrders': {
732
+ 'marginMode': true,
733
+ 'limit': 100,
734
+ 'daysBack': 100000,
735
+ 'untilDays': 100000,
736
+ 'trigger': true,
737
+ 'trailing': false,
738
+ 'marketType': true,
739
+ 'subType': true,
740
+ 'symbolRequired': false,
741
+ },
742
+ 'fetchClosedOrders': {
743
+ 'marginMode': true,
744
+ 'limit': 100,
745
+ 'daysBack': 100000,
746
+ 'daysBackCanceled': 1,
747
+ 'untilDays': 100000,
748
+ 'trigger': true,
749
+ 'trailing': false,
750
+ 'marketType': true,
751
+ 'subType': true,
752
+ 'symbolRequired': false,
753
+ },
754
+ 'fetchOHLCV': {
755
+ 'limit': 1000, // todo for derivatives
756
+ },
757
+ },
758
+ 'spot': {
759
+ 'extends': 'default',
760
+ },
761
+ 'forDerivatives': {
762
+ 'extends': 'default',
763
+ 'createOrder': {
764
+ 'triggerPrice': true,
765
+ // todo
766
+ 'triggerPriceType': {
767
+ 'last': true,
768
+ 'mark': true,
769
+ 'index': true,
770
+ },
771
+ 'stopLossPrice': true,
772
+ 'takeProfitPrice': true,
773
+ },
774
+ 'fetchMyTrades': {
775
+ 'daysBack': undefined,
776
+ 'untilDays': undefined,
777
+ },
778
+ },
779
+ 'swap': {
780
+ 'linear': {
781
+ 'extends': 'forDerivatives',
782
+ },
783
+ 'inverse': {
784
+ 'extends': 'forDerivatives',
785
+ },
786
+ },
787
+ 'future': {
788
+ 'linear': {
789
+ 'extends': 'forDerivatives',
790
+ },
791
+ 'inverse': {
792
+ 'extends': 'forDerivatives',
793
+ },
794
+ },
795
+ },
679
796
  });
680
797
  }
681
798
  nonce() {
package/js/src/yobit.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/yobit.js';
2
- import type { Transaction, Balances, Dict, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Num, TradingFees, Dictionary, int, DepositAddress } from './base/types.js';
2
+ import type { Transaction, Balances, Dict, Int, Market, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Num, TradingFees, int, DepositAddress, OrderBooks } from './base/types.js';
3
3
  /**
4
4
  * @class yobit
5
5
  * @augments Exchange
@@ -46,7 +46,7 @@ export default class yobit extends Exchange {
46
46
  * @param {object} [params] extra parameters specific to the exchange API endpoint
47
47
  * @returns {object} a dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbol
48
48
  */
49
- fetchOrderBooks(symbols?: Strings, limit?: Int, params?: {}): Promise<Dictionary<OrderBook>>;
49
+ fetchOrderBooks(symbols?: Strings, limit?: Int, params?: {}): Promise<OrderBooks>;
50
50
  parseTicker(ticker: Dict, market?: Market): Ticker;
51
51
  fetchTickersHelper(idsString: string, params?: {}): Promise<Tickers>;
52
52
  /**
package/js/src/yobit.js CHANGED
@@ -311,6 +311,65 @@ export default class yobit extends Exchange {
311
311
  'Rate Limited': RateLimitExceeded,
312
312
  },
313
313
  },
314
+ 'features': {
315
+ 'spot': {
316
+ 'sandbox': false,
317
+ 'createOrder': {
318
+ 'marginMode': false,
319
+ 'triggerPrice': false,
320
+ 'triggerDirection': false,
321
+ 'triggerPriceType': undefined,
322
+ 'stopLossPrice': false,
323
+ 'takeProfitPrice': false,
324
+ 'attachedStopLossTakeProfit': undefined,
325
+ 'timeInForce': {
326
+ 'IOC': false,
327
+ 'FOK': false,
328
+ 'PO': false,
329
+ 'GTD': false,
330
+ },
331
+ 'hedged': false,
332
+ 'trailing': false,
333
+ 'leverage': false,
334
+ 'marketBuyByCost': false,
335
+ 'marketBuyRequiresPrice': false,
336
+ 'selfTradePrevention': false,
337
+ 'iceberg': false,
338
+ },
339
+ 'createOrders': undefined,
340
+ 'fetchMyTrades': {
341
+ 'marginMode': false,
342
+ 'limit': 1000,
343
+ 'daysBack': 100000,
344
+ 'untilDays': 100000,
345
+ 'symbolRequired': true,
346
+ },
347
+ 'fetchOrder': {
348
+ 'marginMode': false,
349
+ 'trigger': false,
350
+ 'trailing': false,
351
+ 'symbolRequired': false,
352
+ },
353
+ 'fetchOpenOrders': {
354
+ 'marginMode': false,
355
+ 'limit': undefined,
356
+ 'trigger': false,
357
+ 'trailing': false,
358
+ 'symbolRequired': true,
359
+ },
360
+ 'fetchOrders': undefined,
361
+ 'fetchClosedOrders': undefined,
362
+ 'fetchOHLCV': undefined,
363
+ },
364
+ 'swap': {
365
+ 'linear': undefined,
366
+ 'inverse': undefined,
367
+ },
368
+ 'future': {
369
+ 'linear': undefined,
370
+ 'inverse': undefined,
371
+ },
372
+ },
314
373
  'orders': {}, // orders cache / emulation
315
374
  });
316
375
  }
package/js/src/zaif.js CHANGED
@@ -132,6 +132,63 @@ export default class zaif extends Exchange {
132
132
  },
133
133
  },
134
134
  'options': {},
135
+ 'features': {
136
+ 'spot': {
137
+ 'sandbox': false,
138
+ 'createOrder': {
139
+ 'marginMode': true,
140
+ 'triggerPrice': true,
141
+ 'triggerDirection': false,
142
+ 'triggerPriceType': undefined,
143
+ 'stopLossPrice': false,
144
+ 'takeProfitPrice': false,
145
+ 'attachedStopLossTakeProfit': undefined,
146
+ 'timeInForce': {
147
+ 'IOC': false,
148
+ 'FOK': false,
149
+ 'PO': false,
150
+ 'GTD': false,
151
+ },
152
+ 'hedged': false,
153
+ 'trailing': false,
154
+ 'leverage': true,
155
+ 'marketBuyByCost': false,
156
+ 'marketBuyRequiresPrice': false,
157
+ 'selfTradePrevention': false,
158
+ 'iceberg': false,
159
+ },
160
+ 'createOrders': undefined,
161
+ 'fetchMyTrades': undefined,
162
+ 'fetchOrder': undefined,
163
+ 'fetchOpenOrders': {
164
+ 'marginMode': true,
165
+ 'limit': undefined,
166
+ 'trigger': false,
167
+ 'trailing': false,
168
+ 'symbolRequired': false,
169
+ },
170
+ 'fetchOrders': undefined,
171
+ 'fetchClosedOrders': {
172
+ 'marginMode': true,
173
+ 'limit': 1000,
174
+ 'daysBack': 100000,
175
+ 'daysBackCanceled': 1,
176
+ 'untilDays': 100000,
177
+ 'trigger': false,
178
+ 'trailing': false,
179
+ 'symbolRequired': false,
180
+ },
181
+ 'fetchOHLCV': undefined,
182
+ },
183
+ 'swap': {
184
+ 'linear': undefined,
185
+ 'inverse': undefined,
186
+ },
187
+ 'future': {
188
+ 'linear': undefined,
189
+ 'inverse': undefined,
190
+ },
191
+ },
135
192
  'precisionMode': TICK_SIZE,
136
193
  'exceptions': {
137
194
  'exact': {
package/js/src/zonda.d.ts CHANGED
@@ -131,6 +131,7 @@ export default class zonda extends Exchange {
131
131
  * @method
132
132
  * @name zonda#createOrder
133
133
  * @description create a trade order
134
+ * @see https://docs.zondacrypto.exchange/reference/new-order
134
135
  * @param {string} symbol unified symbol of the market to create an order in
135
136
  * @param {string} type 'market' or 'limit'
136
137
  * @param {string} side 'buy' or 'sell'