ccxt 4.2.59 → 4.2.61

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 (184) hide show
  1. package/README.md +103 -102
  2. package/build.sh +2 -2
  3. package/dist/ccxt.browser.js +11853 -3790
  4. package/dist/ccxt.browser.min.js +7 -7
  5. package/dist/cjs/ccxt.js +4 -1
  6. package/dist/cjs/src/abstract/hyperliquid.js +9 -0
  7. package/dist/cjs/src/ascendex.js +10 -12
  8. package/dist/cjs/src/base/Exchange.js +22 -1
  9. package/dist/cjs/src/base/functions/encode.js +5 -0
  10. package/dist/cjs/src/base/functions.js +1 -0
  11. package/dist/cjs/src/bingx.js +38 -0
  12. package/dist/cjs/src/bitfinex2.js +20 -3
  13. package/dist/cjs/src/bitget.js +9 -2
  14. package/dist/cjs/src/bitmart.js +41 -23
  15. package/dist/cjs/src/blofin.js +59 -1
  16. package/dist/cjs/src/coinbase.js +108 -103
  17. package/dist/cjs/src/coinex.js +61 -1
  18. package/dist/cjs/src/hitbtc.js +1 -1
  19. package/dist/cjs/src/htx.js +4 -1
  20. package/dist/cjs/src/hyperliquid.js +2035 -0
  21. package/dist/cjs/src/kraken.js +50 -41
  22. package/dist/cjs/src/krakenfutures.js +28 -0
  23. package/dist/cjs/src/kucoinfutures.js +3 -2
  24. package/dist/cjs/src/okx.js +1 -1
  25. package/dist/cjs/src/phemex.js +2 -2
  26. package/dist/cjs/src/pro/binance.js +16 -3
  27. package/dist/cjs/src/pro/bingx.js +1 -0
  28. package/dist/cjs/src/static_dependencies/ethers/abi-coder.js +158 -0
  29. package/dist/cjs/src/static_dependencies/ethers/address/address.js +144 -0
  30. package/dist/cjs/src/static_dependencies/ethers/coders/abstract-coder.js +407 -0
  31. package/dist/cjs/src/static_dependencies/ethers/coders/address.js +45 -0
  32. package/dist/cjs/src/static_dependencies/ethers/coders/anonymous.js +28 -0
  33. package/dist/cjs/src/static_dependencies/ethers/coders/array.js +176 -0
  34. package/dist/cjs/src/static_dependencies/ethers/coders/boolean.js +27 -0
  35. package/dist/cjs/src/static_dependencies/ethers/coders/bytes.js +52 -0
  36. package/dist/cjs/src/static_dependencies/ethers/coders/fixed-bytes.js +45 -0
  37. package/dist/cjs/src/static_dependencies/ethers/coders/null.js +30 -0
  38. package/dist/cjs/src/static_dependencies/ethers/coders/number.js +60 -0
  39. package/dist/cjs/src/static_dependencies/ethers/coders/string.js +27 -0
  40. package/dist/cjs/src/static_dependencies/ethers/coders/tuple.js +68 -0
  41. package/dist/cjs/src/static_dependencies/ethers/fragments.js +614 -0
  42. package/dist/cjs/src/static_dependencies/ethers/hash/typed-data.js +492 -0
  43. package/dist/cjs/src/static_dependencies/ethers/index.js +35 -0
  44. package/dist/cjs/src/static_dependencies/ethers/interface.js +44 -0
  45. package/dist/cjs/src/static_dependencies/ethers/typed.js +618 -0
  46. package/dist/cjs/src/static_dependencies/ethers/utils/base58.js +20 -0
  47. package/dist/cjs/src/static_dependencies/ethers/utils/data.js +134 -0
  48. package/dist/cjs/src/static_dependencies/ethers/utils/errors.js +228 -0
  49. package/dist/cjs/src/static_dependencies/ethers/utils/events.js +13 -0
  50. package/dist/cjs/src/static_dependencies/ethers/utils/fixednumber.js +29 -0
  51. package/dist/cjs/src/static_dependencies/ethers/utils/index.js +53 -0
  52. package/dist/cjs/src/static_dependencies/ethers/utils/maths.js +231 -0
  53. package/dist/cjs/src/static_dependencies/ethers/utils/properties.js +47 -0
  54. package/dist/cjs/src/static_dependencies/ethers/utils/utf8.js +218 -0
  55. package/dist/cjs/src/static_dependencies/messagepack/msgpack.js +292 -0
  56. package/dist/cjs/src/tokocrypto.js +22 -2
  57. package/dist/cjs/src/wazirx.js +314 -4
  58. package/dist/cjs/src/woo.js +157 -77
  59. package/js/ccxt.d.ts +5 -2
  60. package/js/ccxt.js +4 -2
  61. package/js/src/abstract/blofin.d.ts +1 -0
  62. package/js/src/abstract/coinbase.d.ts +3 -3
  63. package/js/src/abstract/hyperliquid.d.ts +9 -0
  64. package/js/src/abstract/hyperliquid.js +11 -0
  65. package/js/src/abstract/wazirx.d.ts +5 -0
  66. package/js/src/ascendex.d.ts +2 -2
  67. package/js/src/ascendex.js +10 -12
  68. package/js/src/base/Exchange.d.ts +4 -0
  69. package/js/src/base/Exchange.js +13 -1
  70. package/js/src/base/functions/encode.d.ts +2 -1
  71. package/js/src/base/functions/encode.js +5 -1
  72. package/js/src/bingx.d.ts +3 -1
  73. package/js/src/bingx.js +38 -0
  74. package/js/src/bitfinex2.js +20 -3
  75. package/js/src/bitget.js +9 -2
  76. package/js/src/bitmart.d.ts +9 -2
  77. package/js/src/bitmart.js +41 -23
  78. package/js/src/blofin.d.ts +2 -1
  79. package/js/src/blofin.js +59 -1
  80. package/js/src/coinbase.js +108 -103
  81. package/js/src/coinex.d.ts +3 -1
  82. package/js/src/coinex.js +61 -1
  83. package/js/src/hitbtc.js +1 -1
  84. package/js/src/htx.js +4 -1
  85. package/js/src/hyperliquid.d.ts +83 -0
  86. package/js/src/hyperliquid.js +2036 -0
  87. package/js/src/kraken.js +50 -41
  88. package/js/src/krakenfutures.d.ts +2 -1
  89. package/js/src/krakenfutures.js +28 -0
  90. package/js/src/kucoinfutures.js +3 -2
  91. package/js/src/okx.js +1 -1
  92. package/js/src/phemex.js +2 -2
  93. package/js/src/pro/binance.js +16 -3
  94. package/js/src/pro/bingx.js +1 -0
  95. package/js/src/pro/deribit.d.ts +1 -1
  96. package/js/src/static_dependencies/ethers/abi-coder.d.ts +50 -0
  97. package/js/src/static_dependencies/ethers/abi-coder.js +148 -0
  98. package/js/src/static_dependencies/ethers/address/address.d.ts +55 -0
  99. package/js/src/static_dependencies/ethers/address/address.js +162 -0
  100. package/js/src/static_dependencies/ethers/address/checks.d.ts +80 -0
  101. package/js/src/static_dependencies/ethers/address/checks.js +119 -0
  102. package/js/src/static_dependencies/ethers/address/contract-address.d.ts +47 -0
  103. package/js/src/static_dependencies/ethers/address/contract-address.js +73 -0
  104. package/js/src/static_dependencies/ethers/address/index.d.ts +48 -0
  105. package/js/src/static_dependencies/ethers/address/index.js +24 -0
  106. package/js/src/static_dependencies/ethers/bytes32.d.ts +14 -0
  107. package/js/src/static_dependencies/ethers/bytes32.js +45 -0
  108. package/js/src/static_dependencies/ethers/coders/abstract-coder.d.ts +120 -0
  109. package/js/src/static_dependencies/ethers/coders/abstract-coder.js +424 -0
  110. package/js/src/static_dependencies/ethers/coders/address.d.ts +12 -0
  111. package/js/src/static_dependencies/ethers/coders/address.js +34 -0
  112. package/js/src/static_dependencies/ethers/coders/anonymous.d.ts +14 -0
  113. package/js/src/static_dependencies/ethers/coders/anonymous.js +27 -0
  114. package/js/src/static_dependencies/ethers/coders/array.d.ts +24 -0
  115. package/js/src/static_dependencies/ethers/coders/array.js +162 -0
  116. package/js/src/static_dependencies/ethers/coders/boolean.d.ts +12 -0
  117. package/js/src/static_dependencies/ethers/coders/boolean.js +26 -0
  118. package/js/src/static_dependencies/ethers/coders/bytes.d.ts +18 -0
  119. package/js/src/static_dependencies/ethers/coders/bytes.js +39 -0
  120. package/js/src/static_dependencies/ethers/coders/fixed-bytes.d.ts +14 -0
  121. package/js/src/static_dependencies/ethers/coders/fixed-bytes.js +32 -0
  122. package/js/src/static_dependencies/ethers/coders/null.d.ts +11 -0
  123. package/js/src/static_dependencies/ethers/coders/null.js +29 -0
  124. package/js/src/static_dependencies/ethers/coders/number.d.ts +15 -0
  125. package/js/src/static_dependencies/ethers/coders/number.js +48 -0
  126. package/js/src/static_dependencies/ethers/coders/string.d.ts +12 -0
  127. package/js/src/static_dependencies/ethers/coders/string.js +26 -0
  128. package/js/src/static_dependencies/ethers/coders/tuple.d.ts +15 -0
  129. package/js/src/static_dependencies/ethers/coders/tuple.js +67 -0
  130. package/js/src/static_dependencies/ethers/fragments.d.ts +458 -0
  131. package/js/src/static_dependencies/ethers/fragments.js +1252 -0
  132. package/js/src/static_dependencies/ethers/hash/index.d.ts +10 -0
  133. package/js/src/static_dependencies/ethers/hash/index.js +15 -0
  134. package/js/src/static_dependencies/ethers/hash/solidity.d.ts +30 -0
  135. package/js/src/static_dependencies/ethers/hash/solidity.js +107 -0
  136. package/js/src/static_dependencies/ethers/hash/typed-data.d.ts +144 -0
  137. package/js/src/static_dependencies/ethers/hash/typed-data.js +490 -0
  138. package/js/src/static_dependencies/ethers/index.d.ts +19 -0
  139. package/js/src/static_dependencies/ethers/index.js +22 -0
  140. package/js/src/static_dependencies/ethers/interface.d.ts +380 -0
  141. package/js/src/static_dependencies/ethers/interface.js +990 -0
  142. package/js/src/static_dependencies/ethers/typed.d.ts +569 -0
  143. package/js/src/static_dependencies/ethers/typed.js +608 -0
  144. package/js/src/static_dependencies/ethers/utils/base58.d.ts +22 -0
  145. package/js/src/static_dependencies/ethers/utils/base58.js +68 -0
  146. package/js/src/static_dependencies/ethers/utils/base64-browser.d.ts +3 -0
  147. package/js/src/static_dependencies/ethers/utils/base64-browser.js +24 -0
  148. package/js/src/static_dependencies/ethers/utils/base64.d.ts +39 -0
  149. package/js/src/static_dependencies/ethers/utils/base64.js +58 -0
  150. package/js/src/static_dependencies/ethers/utils/data.d.ts +92 -0
  151. package/js/src/static_dependencies/ethers/utils/data.js +175 -0
  152. package/js/src/static_dependencies/ethers/utils/errors.d.ts +509 -0
  153. package/js/src/static_dependencies/ethers/utils/errors.js +227 -0
  154. package/js/src/static_dependencies/ethers/utils/events.d.ts +76 -0
  155. package/js/src/static_dependencies/ethers/utils/events.js +52 -0
  156. package/js/src/static_dependencies/ethers/utils/fixednumber.d.ts +251 -0
  157. package/js/src/static_dependencies/ethers/utils/fixednumber.js +529 -0
  158. package/js/src/static_dependencies/ethers/utils/index.d.ts +30 -0
  159. package/js/src/static_dependencies/ethers/utils/index.js +38 -0
  160. package/js/src/static_dependencies/ethers/utils/maths.d.ts +65 -0
  161. package/js/src/static_dependencies/ethers/utils/maths.js +220 -0
  162. package/js/src/static_dependencies/ethers/utils/properties.d.ts +22 -0
  163. package/js/src/static_dependencies/ethers/utils/properties.js +59 -0
  164. package/js/src/static_dependencies/ethers/utils/rlp-decode.d.ts +5 -0
  165. package/js/src/static_dependencies/ethers/utils/rlp-decode.js +84 -0
  166. package/js/src/static_dependencies/ethers/utils/rlp-encode.d.ts +5 -0
  167. package/js/src/static_dependencies/ethers/utils/rlp-encode.js +54 -0
  168. package/js/src/static_dependencies/ethers/utils/rlp.d.ts +16 -0
  169. package/js/src/static_dependencies/ethers/utils/rlp.js +14 -0
  170. package/js/src/static_dependencies/ethers/utils/units.d.ts +23 -0
  171. package/js/src/static_dependencies/ethers/utils/units.js +88 -0
  172. package/js/src/static_dependencies/ethers/utils/utf8.d.ts +95 -0
  173. package/js/src/static_dependencies/ethers/utils/utf8.js +225 -0
  174. package/js/src/static_dependencies/ethers/utils/uuid.d.ts +7 -0
  175. package/js/src/static_dependencies/ethers/utils/uuid.js +35 -0
  176. package/js/src/static_dependencies/messagepack/msgpack.d.ts +2 -0
  177. package/js/src/static_dependencies/messagepack/msgpack.js +572 -0
  178. package/js/src/tokocrypto.js +22 -2
  179. package/js/src/wazirx.d.ts +12 -1
  180. package/js/src/wazirx.js +314 -4
  181. package/js/src/woo.d.ts +8 -0
  182. package/js/src/woo.js +157 -77
  183. package/package.json +1 -1
  184. package/skip-tests.json +60 -16
package/js/src/woo.js CHANGED
@@ -87,10 +87,10 @@ export default class woo extends Exchange {
87
87
  'fetchPositionMode': false,
88
88
  'fetchPositions': true,
89
89
  'fetchPremiumIndexOHLCV': false,
90
- 'fetchStatus': false,
90
+ 'fetchStatus': true,
91
91
  'fetchTicker': false,
92
92
  'fetchTickers': false,
93
- 'fetchTime': false,
93
+ 'fetchTime': true,
94
94
  'fetchTrades': true,
95
95
  'fetchTradingFee': false,
96
96
  'fetchTradingFees': true,
@@ -327,6 +327,67 @@ export default class woo extends Exchange {
327
327
  'precisionMode': TICK_SIZE,
328
328
  });
329
329
  }
330
+ async fetchStatus(params = {}) {
331
+ /**
332
+ * @method
333
+ * @name woo#fetchStatus
334
+ * @description the latest known information on the availability of the exchange API
335
+ * @see https://docs.woo.org/#get-system-maintenance-status-public
336
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
337
+ * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
338
+ */
339
+ const response = await this.v1PublicGetSystemInfo(params);
340
+ //
341
+ // {
342
+ // "success": true,
343
+ // "data": {
344
+ // "status": "0",
345
+ // "msg": "System is functioning properly."
346
+ // },
347
+ // "timestamp": "1709274106602"
348
+ // }
349
+ //
350
+ const data = this.safeDict(response, 'data', {});
351
+ let status = this.safeString(data, 'status');
352
+ if (status === undefined) {
353
+ status = 'error';
354
+ }
355
+ else if (status === '0') {
356
+ status = 'ok';
357
+ }
358
+ else {
359
+ status = 'maintenance';
360
+ }
361
+ return {
362
+ 'status': status,
363
+ 'updated': undefined,
364
+ 'eta': undefined,
365
+ 'url': undefined,
366
+ 'info': response,
367
+ };
368
+ }
369
+ async fetchTime(params = {}) {
370
+ /**
371
+ * @method
372
+ * @name woo#fetchTime
373
+ * @description fetches the current integer timestamp in milliseconds from the exchange server
374
+ * @see https://docs.woo.org/#get-system-maintenance-status-public
375
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
376
+ * @returns {int} the current integer timestamp in milliseconds from the exchange server
377
+ */
378
+ const response = await this.v1PublicGetSystemInfo(params);
379
+ //
380
+ // {
381
+ // "success": true,
382
+ // "data": {
383
+ // "status": "0",
384
+ // "msg": "System is functioning properly."
385
+ // },
386
+ // "timestamp": "1709274106602"
387
+ // }
388
+ //
389
+ return this.safeInteger(response, 'timestamp');
390
+ }
330
391
  async fetchMarkets(params = {}) {
331
392
  /**
332
393
  * @method
@@ -357,7 +418,7 @@ export default class woo extends Exchange {
357
418
  // "success": true
358
419
  // }
359
420
  //
360
- const data = this.safeValue(response, 'rows', []);
421
+ const data = this.safeList(response, 'rows', []);
361
422
  return this.parseMarkets(data);
362
423
  }
363
424
  parseMarket(market) {
@@ -609,7 +670,7 @@ export default class woo extends Exchange {
609
670
  // "timestamp": 1673323685109
610
671
  // }
611
672
  //
612
- const data = this.safeValue(response, 'data', {});
673
+ const data = this.safeDict(response, 'data', {});
613
674
  const maker = this.safeString(data, 'makerFeeRate');
614
675
  const taker = this.safeString(data, 'takerFeeRate');
615
676
  const result = {};
@@ -696,7 +757,7 @@ export default class woo extends Exchange {
696
757
  // "success": true
697
758
  // }
698
759
  //
699
- const tokenRows = this.safeValue(tokenResponse, 'rows', []);
760
+ const tokenRows = this.safeList(tokenResponse, 'rows', []);
700
761
  const networksByCurrencyId = this.groupBy(tokenRows, 'balance_token');
701
762
  const currencyIds = Object.keys(networksByCurrencyId);
702
763
  for (let i = 0; i < currencyIds.length; i++) {
@@ -856,7 +917,7 @@ export default class woo extends Exchange {
856
917
  * @param {string} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
857
918
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
858
919
  */
859
- const reduceOnly = this.safeValue2(params, 'reduceOnly', 'reduce_only');
920
+ const reduceOnly = this.safeBool2(params, 'reduceOnly', 'reduce_only');
860
921
  params = this.omit(params, ['reduceOnly', 'reduce_only']);
861
922
  const orderType = type.toUpperCase();
862
923
  await this.loadMarkets();
@@ -1027,9 +1088,9 @@ export default class woo extends Exchange {
1027
1088
  // },
1028
1089
  // "timestamp": "1686149372216"
1029
1090
  // }
1030
- const data = this.safeValue(response, 'data');
1091
+ const data = this.safeDict(response, 'data');
1031
1092
  if (data !== undefined) {
1032
- const rows = this.safeValue(data, 'rows', []);
1093
+ const rows = this.safeList(data, 'rows', []);
1033
1094
  return this.parseOrder(rows[0], market);
1034
1095
  }
1035
1096
  const order = this.parseOrder(response, market);
@@ -1130,7 +1191,7 @@ export default class woo extends Exchange {
1130
1191
  // "timestamp": 0
1131
1192
  // }
1132
1193
  //
1133
- const data = this.safeValue(response, 'data', {});
1194
+ const data = this.safeDict(response, 'data', {});
1134
1195
  return this.parseOrder(data, market);
1135
1196
  }
1136
1197
  async cancelOrder(id, symbol = undefined, params = {}) {
@@ -1204,8 +1265,8 @@ export default class woo extends Exchange {
1204
1265
  * @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
1205
1266
  */
1206
1267
  await this.loadMarkets();
1207
- const stop = this.safeValue(params, 'stop');
1208
- params = this.omit(params, 'stop');
1268
+ const stop = this.safeBool2(params, 'stop', 'trigger');
1269
+ params = this.omit(params, ['stop', 'trigger']);
1209
1270
  if (stop) {
1210
1271
  return await this.v3PrivateDeleteAlgoOrdersPending(params);
1211
1272
  }
@@ -1239,8 +1300,8 @@ export default class woo extends Exchange {
1239
1300
  */
1240
1301
  await this.loadMarkets();
1241
1302
  const market = (symbol !== undefined) ? this.market(symbol) : undefined;
1242
- const stop = this.safeValue(params, 'stop');
1243
- params = this.omit(params, 'stop');
1303
+ const stop = this.safeBool2(params, 'stop', 'trigger');
1304
+ params = this.omit(params, ['stop', 'trigger']);
1244
1305
  const request = {};
1245
1306
  const clientOrderId = this.safeString2(params, 'clOrdID', 'clientOrderId');
1246
1307
  let response = undefined;
@@ -1314,9 +1375,9 @@ export default class woo extends Exchange {
1314
1375
  await this.loadMarkets();
1315
1376
  const request = {};
1316
1377
  let market = undefined;
1317
- const stop = this.safeValue(params, 'stop');
1378
+ const stop = this.safeBool2(params, 'stop', 'trigger');
1318
1379
  const trailing = this.safeBool(params, 'trailing', false);
1319
- params = this.omit(params, ['stop', 'trailing']);
1380
+ params = this.omit(params, ['stop', 'trailing', 'trigger']);
1320
1381
  if (symbol !== undefined) {
1321
1382
  market = this.market(symbol);
1322
1383
  request['symbol'] = market['id'];
@@ -1374,7 +1435,7 @@ export default class woo extends Exchange {
1374
1435
  // }
1375
1436
  //
1376
1437
  const data = this.safeValue(response, 'data', response);
1377
- const orders = this.safeValue(data, 'rows');
1438
+ const orders = this.safeList(data, 'rows');
1378
1439
  return this.parseOrders(orders, market, since, limit, params);
1379
1440
  }
1380
1441
  parseTimeInForce(timeInForce) {
@@ -1476,7 +1537,7 @@ export default class woo extends Exchange {
1476
1537
  'type': orderType,
1477
1538
  'timeInForce': this.parseTimeInForce(orderType),
1478
1539
  'postOnly': undefined,
1479
- 'reduceOnly': this.safeValue(order, 'reduce_only'),
1540
+ 'reduceOnly': this.safeBool(order, 'reduce_only'),
1480
1541
  'side': side,
1481
1542
  'price': price,
1482
1543
  'stopPrice': stopPrice,
@@ -1634,7 +1695,7 @@ export default class woo extends Exchange {
1634
1695
  // }
1635
1696
  //
1636
1697
  }
1637
- const rows = this.safeValue(response, 'rows', []);
1698
+ const rows = this.safeList(response, 'rows', []);
1638
1699
  return this.parseOHLCVs(rows, market, timeframe, since, limit);
1639
1700
  }
1640
1701
  parseOHLCV(ohlcv, market = undefined) {
@@ -1687,7 +1748,7 @@ export default class woo extends Exchange {
1687
1748
  // }
1688
1749
  // ]
1689
1750
  // }
1690
- const trades = this.safeValue(response, 'rows', []);
1751
+ const trades = this.safeList(response, 'rows', []);
1691
1752
  return this.parseTrades(trades, market, since, limit, params);
1692
1753
  }
1693
1754
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
@@ -1735,7 +1796,7 @@ export default class woo extends Exchange {
1735
1796
  // ...
1736
1797
  // ]
1737
1798
  // }
1738
- const trades = this.safeValue(response, 'rows', []);
1799
+ const trades = this.safeList(response, 'rows', []);
1739
1800
  return this.parseTrades(trades, market, since, limit, params);
1740
1801
  }
1741
1802
  async fetchAccounts(params = {}) {
@@ -1763,7 +1824,7 @@ export default class woo extends Exchange {
1763
1824
  // "success": true
1764
1825
  // }
1765
1826
  //
1766
- const rows = this.safeValue(response, 'rows', []);
1827
+ const rows = this.safeList(response, 'rows', []);
1767
1828
  return this.parseAccounts(rows, params);
1768
1829
  }
1769
1830
  parseAccount(account) {
@@ -1817,14 +1878,14 @@ export default class woo extends Exchange {
1817
1878
  // "timestamp": 1673323746259
1818
1879
  // }
1819
1880
  //
1820
- const data = this.safeValue(response, 'data');
1881
+ const data = this.safeDict(response, 'data');
1821
1882
  return this.parseBalance(data);
1822
1883
  }
1823
1884
  parseBalance(response) {
1824
1885
  const result = {
1825
1886
  'info': response,
1826
1887
  };
1827
- const balances = this.safeValue(response, 'holding', []);
1888
+ const balances = this.safeList(response, 'holding', []);
1828
1889
  for (let i = 0; i < balances.length; i++) {
1829
1890
  const balance = balances[i];
1830
1891
  const code = this.safeCurrencyCode(this.safeString(balance, 'token'));
@@ -2101,6 +2162,7 @@ export default class woo extends Exchange {
2101
2162
  /**
2102
2163
  * @method
2103
2164
  * @name woo#transfer
2165
+ * @see https://docs.woo.org/#get-transfer-history
2104
2166
  * @description transfer currency internally between wallets on the same account
2105
2167
  * @param {string} code unified currency code
2106
2168
  * @param {float} amount amount to transfer
@@ -2113,7 +2175,7 @@ export default class woo extends Exchange {
2113
2175
  const currency = this.currency(code);
2114
2176
  const request = {
2115
2177
  'token': currency['id'],
2116
- 'amount': this.parseNumber(amount),
2178
+ 'amount': this.parseToNumeric(amount),
2117
2179
  'from_application_id': fromAccount,
2118
2180
  'to_application_id': toAccount,
2119
2181
  };
@@ -2125,7 +2187,7 @@ export default class woo extends Exchange {
2125
2187
  // }
2126
2188
  //
2127
2189
  const transfer = this.parseTransfer(response, currency);
2128
- const transferOptions = this.safeValue(this.options, 'transfer', {});
2190
+ const transferOptions = this.safeDict(this.options, 'transfer', {});
2129
2191
  const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
2130
2192
  if (fillResponseFromRequest) {
2131
2193
  transfer['amount'] = amount;
@@ -2139,41 +2201,71 @@ export default class woo extends Exchange {
2139
2201
  * @method
2140
2202
  * @name woo#fetchTransfers
2141
2203
  * @description fetch a history of internal transfers made on an account
2204
+ * @see https://docs.woo.org/#get-transfer-history
2142
2205
  * @param {string} code unified currency code of the currency transferred
2143
2206
  * @param {int} [since] the earliest time in ms to fetch transfers for
2144
2207
  * @param {int} [limit] the maximum number of transfers structures to retrieve
2145
2208
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2209
+ * @param {int} [params.until] the latest time in ms to fetch entries for
2146
2210
  * @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
2147
2211
  */
2148
- const request = {
2149
- 'type': 'COLLATERAL',
2150
- };
2151
- const [currency, rows] = await this.getAssetHistoryRows(code, since, limit, this.extend(request, params));
2152
- return this.parseTransfers(rows, currency, since, limit, params);
2212
+ const request = {};
2213
+ if (limit !== undefined) {
2214
+ request['size'] = limit;
2215
+ }
2216
+ if (since !== undefined) {
2217
+ request['start_t'] = since;
2218
+ }
2219
+ const until = this.safeInteger2(params, 'until', 'till'); // unified in milliseconds
2220
+ params = this.omit(params, ['until', 'till']);
2221
+ if (until !== undefined) {
2222
+ request['end_t'] = until;
2223
+ }
2224
+ const response = await this.v1PrivateGetAssetMainSubTransferHistory(this.extend(request, params));
2225
+ //
2226
+ // {
2227
+ // "rows": [
2228
+ // {
2229
+ // "id": 46704,
2230
+ // "token": "USDT",
2231
+ // "amount": 30000.00000000,
2232
+ // "status": "COMPLETED",
2233
+ // "from_application_id": "0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3",
2234
+ // "to_application_id": "c01e6940-a735-4022-9b6c-9d3971cdfdfa",
2235
+ // "from_user": "LeverageLow",
2236
+ // "to_user": "dev",
2237
+ // "created_time": "1709022325.427",
2238
+ // "updated_time": "1709022325.542"
2239
+ // }
2240
+ // ],
2241
+ // "meta": {
2242
+ // "total": 50,
2243
+ // "records_per_page": 25,
2244
+ // "current_page": 1
2245
+ // },
2246
+ // "success": true
2247
+ // }
2248
+ //
2249
+ const data = this.safeList(response, 'rows', []);
2250
+ return this.parseTransfers(data, undefined, since, limit, params);
2153
2251
  }
2154
2252
  parseTransfer(transfer, currency = undefined) {
2155
2253
  //
2156
- // getAssetHistoryRows
2157
- // {
2158
- // "created_time": "1579399877.041", // Unix epoch time in seconds
2159
- // "updated_time": "1579399877.041", // Unix epoch time in seconds
2160
- // "id": "202029292829292",
2161
- // "external_id": "202029292829292",
2162
- // "application_id": null,
2163
- // "token": "ETH",
2164
- // "target_address": "0x31d64B3230f8baDD91dE1710A65DF536aF8f7cDa",
2165
- // "source_address": "0x70fd25717f769c7f9a46b319f0f9103c0d887af0",
2166
- // "extra": "",
2167
- // "type": "BALANCE",
2168
- // "token_side": "DEPOSIT",
2169
- // "amount": 1000,
2170
- // "tx_id": "0x8a74c517bc104c8ebad0c3c3f64b1f302ed5f8bca598ae4459c63419038106b6",
2171
- // "fee_token": null,
2172
- // "fee_amount": null,
2173
- // "status": "CONFIRMING"
2174
- // }
2254
+ // fetchTransfers
2255
+ // {
2256
+ // "id": 46704,
2257
+ // "token": "USDT",
2258
+ // "amount": 30000.00000000,
2259
+ // "status": "COMPLETED",
2260
+ // "from_application_id": "0f1bd3cd-dba2-4563-b8bb-0adb1bfb83a3",
2261
+ // "to_application_id": "c01e6940-a735-4022-9b6c-9d3971cdfdfa",
2262
+ // "from_user": "LeverageLow",
2263
+ // "to_user": "dev",
2264
+ // "created_time": "1709022325.427",
2265
+ // "updated_time": "1709022325.542"
2266
+ // }
2175
2267
  //
2176
- // v1PrivatePostAssetMainSubTransfer
2268
+ // transfer
2177
2269
  // {
2178
2270
  // "success": true,
2179
2271
  // "id": 200
@@ -2182,22 +2274,8 @@ export default class woo extends Exchange {
2182
2274
  const networkizedCode = this.safeString(transfer, 'token');
2183
2275
  const currencyDefined = this.getCurrencyFromChaincode(networkizedCode, currency);
2184
2276
  const code = currencyDefined['code'];
2185
- let movementDirection = this.safeStringLower(transfer, 'token_side');
2186
- if (movementDirection === 'withdraw') {
2187
- movementDirection = 'withdrawal';
2188
- }
2189
- let fromAccount = undefined;
2190
- let toAccount = undefined;
2191
- if (movementDirection === 'withdraw') {
2192
- fromAccount = undefined;
2193
- toAccount = 'spot';
2194
- }
2195
- else if (movementDirection === 'deposit') {
2196
- fromAccount = 'spot';
2197
- toAccount = undefined;
2198
- }
2199
2277
  const timestamp = this.safeTimestamp(transfer, 'created_time');
2200
- const success = this.safeValue(transfer, 'success');
2278
+ const success = this.safeBool(transfer, 'success');
2201
2279
  let status = undefined;
2202
2280
  if (success !== undefined) {
2203
2281
  status = success ? 'ok' : 'failed';
@@ -2208,8 +2286,8 @@ export default class woo extends Exchange {
2208
2286
  'datetime': this.iso8601(timestamp),
2209
2287
  'currency': code,
2210
2288
  'amount': this.safeNumber(transfer, 'amount'),
2211
- 'fromAccount': fromAccount,
2212
- 'toAccount': toAccount,
2289
+ 'fromAccount': this.safeString(transfer, 'from_application_id'),
2290
+ 'toAccount': this.safeString(transfer, 'to_application_id'),
2213
2291
  'status': this.parseTransferStatus(this.safeString(transfer, 'status', status)),
2214
2292
  'info': transfer,
2215
2293
  };
@@ -2247,11 +2325,11 @@ export default class woo extends Exchange {
2247
2325
  if (tag !== undefined) {
2248
2326
  request['extra'] = tag;
2249
2327
  }
2250
- const networks = this.safeValue(this.options, 'networks', {});
2251
- const currencyNetworks = this.safeValue(currency, 'networks', {});
2328
+ const networks = this.safeDict(this.options, 'networks', {});
2329
+ const currencyNetworks = this.safeDict(currency, 'networks', {});
2252
2330
  const network = this.safeStringUpper(params, 'network');
2253
2331
  const networkId = this.safeString(networks, network, network);
2254
- const coinNetwork = this.safeValue(currencyNetworks, networkId, {});
2332
+ const coinNetwork = this.safeDict(currencyNetworks, networkId, {});
2255
2333
  const coinNetworkId = this.safeString(coinNetwork, 'id');
2256
2334
  if (coinNetworkId === undefined) {
2257
2335
  throw new BadRequest(this.id + ' withdraw() require network parameter');
@@ -2379,7 +2457,9 @@ export default class woo extends Exchange {
2379
2457
  body = auth;
2380
2458
  }
2381
2459
  else {
2382
- url += '?' + auth;
2460
+ if (Object.keys(params).length) {
2461
+ url += '?' + auth;
2462
+ }
2383
2463
  }
2384
2464
  auth += '|' + ts;
2385
2465
  headers['content-type'] = 'application/x-www-form-urlencoded';
@@ -2396,7 +2476,7 @@ export default class woo extends Exchange {
2396
2476
  // 400 Bad Request {"success":false,"code":-1012,"message":"Amount is required for buy market orders when margin disabled."}
2397
2477
  // {"code":"-1011","message":"The system is under maintenance.","success":false}
2398
2478
  //
2399
- const success = this.safeValue(response, 'success');
2479
+ const success = this.safeBool(response, 'success');
2400
2480
  const errorCode = this.safeString(response, 'code');
2401
2481
  if (!success) {
2402
2482
  const feedback = this.id + ' ' + this.json(response);
@@ -2472,7 +2552,7 @@ export default class woo extends Exchange {
2472
2552
  // "success":true
2473
2553
  // }
2474
2554
  //
2475
- const result = this.safeValue(response, 'rows', []);
2555
+ const result = this.safeList(response, 'rows', []);
2476
2556
  return this.parseIncomes(result, market, since, limit);
2477
2557
  }
2478
2558
  parseFundingRate(fundingRate, market = undefined) {
@@ -2553,7 +2633,7 @@ export default class woo extends Exchange {
2553
2633
  // "timestamp":1653633985646
2554
2634
  // }
2555
2635
  //
2556
- const rows = this.safeValue(response, 'rows', {});
2636
+ const rows = this.safeList(response, 'rows', []);
2557
2637
  const result = this.parseFundingRates(rows);
2558
2638
  return this.filterByArray(result, 'symbol', symbols);
2559
2639
  }
@@ -2607,7 +2687,7 @@ export default class woo extends Exchange {
2607
2687
  // "timestamp":1653640814885
2608
2688
  // }
2609
2689
  //
2610
- const result = this.safeValue(response, 'rows');
2690
+ const result = this.safeList(response, 'rows');
2611
2691
  const rates = [];
2612
2692
  for (let i = 0; i < result.length; i++) {
2613
2693
  const entry = result[i];
@@ -2769,8 +2849,8 @@ export default class woo extends Exchange {
2769
2849
  // "timestamp": 1673323880342
2770
2850
  // }
2771
2851
  //
2772
- const result = this.safeValue(response, 'data', {});
2773
- const positions = this.safeValue(result, 'positions', []);
2852
+ const result = this.safeDict(response, 'data', {});
2853
+ const positions = this.safeList(result, 'positions', []);
2774
2854
  return this.parsePositions(positions, symbols);
2775
2855
  }
2776
2856
  parsePosition(position, market = undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccxt",
3
- "version": "4.2.59",
3
+ "version": "4.2.61",
4
4
  "description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
5
5
  "unpkg": "dist/ccxt.browser.js",
6
6
  "type": "module",
package/skip-tests.json CHANGED
@@ -219,17 +219,21 @@
219
219
  "withdraw": "not provided",
220
220
  "deposit": "not provided"
221
221
  },
222
+ "fetchTicker": {
223
+ "spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269273148#L3651"
224
+ },
222
225
  "fetchTickers": {
226
+ "spread": "same as above",
223
227
  "open": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269177570#L3624",
224
- "bid": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269219719#L3210",
225
- "ask": "same",
226
228
  "bidVolume": "same",
227
229
  "askVolume": "same"
228
230
  },
231
+ "watchTicker": {
232
+ "spread": "same as above"
233
+ },
229
234
  "watchTickers": {
235
+ "spread": "same as above",
230
236
  "open": "same",
231
- "bid": "same",
232
- "ask": "same",
233
237
  "bidVolume": "same",
234
238
  "askVolume": "same"
235
239
  },
@@ -239,9 +243,7 @@
239
243
  "fetchL2OrderBook": {
240
244
  "bid": "same"
241
245
  },
242
- "watchOrderBook": {
243
- "bid": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269129438#L3999"
244
- },
246
+ "watchOrderBook": "complete skip because of frequent checksum mismatches: https://app.travis-ci.com/github/ccxt/ccxt/builds/269273148#L3553 and also for this https://app.travis-ci.com/github/ccxt/ccxt/builds/269129438#L3999",
245
247
  "watchOrderBookForSymbols": {
246
248
  "bid": "same"
247
249
  }
@@ -283,8 +285,6 @@
283
285
  }
284
286
  },
285
287
  "bithumb": {
286
- "skip": "fetchMarkets returning undefined",
287
- "until": "2023-09-05",
288
288
  "skipMethods": {
289
289
  "fetchTickers": {
290
290
  "quoteVolume": "quoteVolume >= baseVolume * low is failing",
@@ -293,6 +293,18 @@
293
293
  "fetchTicker": {
294
294
  "quoteVolume": "quoteVolume >= baseVolume * low is failing",
295
295
  "baseVolume": "quoteVolume >= baseVolume * low is failing"
296
+ },
297
+ "fetchOrderBook": {
298
+ "ask": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269273148#L4074"
299
+ },
300
+ "fetchL2OrderBook": {
301
+ "ask": "same as above"
302
+ },
303
+ "watchOrderBook": {
304
+ "ask": "same as above"
305
+ },
306
+ "watchOrderBookForSymbols": {
307
+ "ask": "same as above"
296
308
  }
297
309
  }
298
310
  },
@@ -795,8 +807,8 @@
795
807
  }
796
808
  },
797
809
  "delta": {
798
- "skip": "frequent timeouts https://app.travis-ci.com/github/ccxt/ccxt/builds/269219719#L3723",
799
- "until": "2024-03-05",
810
+ "skip": "frequent timeouts https://app.travis-ci.com/github/ccxt/ccxt/builds/269273148#L4301",
811
+ "until": "2024-03-15",
800
812
  "skipMethods": {
801
813
  "loadMarkets": "expiryDatetime must be equal to expiry in iso8601 format",
802
814
  "fetchOrderBook": "ask crossing bids test failing",
@@ -1217,21 +1229,35 @@
1217
1229
  "fetchTickers": {
1218
1230
  "quoteVolume": "quoteVolume >= baseVolume * low is failing",
1219
1231
  "baseVolume": "quoteVolume >= baseVolume * low is failing",
1220
- "bid":"messed bid-ask",
1221
- "ask":"messed bid-ask"
1232
+ "spread":"https://app.travis-ci.com/github/ccxt/ccxt/builds/269273148#L3916"
1222
1233
  },
1223
1234
  "fetchTicker": {
1224
1235
  "quoteVolume": "quoteVolume >= baseVolume * low is failing",
1225
1236
  "baseVolume": "quoteVolume >= baseVolume * low is failing",
1226
- "bid":"messed bid-ask",
1227
- "ask":"messed bid-ask"
1237
+ "spread": "same as above"
1228
1238
  },
1229
1239
  "fetchAccounts": {
1230
1240
  "type": "type is not provided"
1231
1241
  },
1232
1242
  "fetchLeverageTiers": "swap only supported",
1233
1243
  "watchTicker": {
1234
- "quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L6610"
1244
+ "quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L6610",
1245
+ "spread": "same as above"
1246
+ },
1247
+ "watchTickers": {
1248
+ "spread": "same as above"
1249
+ },
1250
+ "fetchOrderBook": {
1251
+ "spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269273148#L3916"
1252
+ },
1253
+ "fetchL2OrderBook": {
1254
+ "spread": "same as above"
1255
+ },
1256
+ "watchOrderBook": {
1257
+ "spread": "same as above"
1258
+ },
1259
+ "watchOrderBookForSymbols": {
1260
+ "spread": "same as above"
1235
1261
  }
1236
1262
  }
1237
1263
  },
@@ -1577,6 +1603,8 @@
1577
1603
  "wazirx": {
1578
1604
  "skipWs": "timeouts",
1579
1605
  "skipMethods": {
1606
+ "loadMarkets": "private",
1607
+ "fetchCurrencies": "private",
1580
1608
  "fetchTickers": {
1581
1609
  "ask": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269200021#L4048"
1582
1610
  }
@@ -1606,5 +1634,21 @@
1606
1634
  "withdraw": "not provided"
1607
1635
  }
1608
1636
  }
1637
+ },
1638
+ "hyperliquid": {
1639
+ "skipMethods": {
1640
+ "loadMarkets": {
1641
+ "currencyIdAndCode": "different"
1642
+ },
1643
+ "fetchTrades": "private",
1644
+ "fetchCurrencies": {
1645
+ "id": "skip",
1646
+ "precision": "skip",
1647
+ "networks": "not provided",
1648
+ "limits" : "not provided",
1649
+ "deposit": "not provided",
1650
+ "withdraw": "not provided"
1651
+ }
1652
+ }
1609
1653
  }
1610
1654
  }