ccxt 4.4.41 → 4.4.43

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 (188) hide show
  1. package/README.md +36 -34
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/ace.js +1 -1
  5. package/dist/cjs/src/alpaca.js +0 -1
  6. package/dist/cjs/src/ascendex.js +0 -1
  7. package/dist/cjs/src/base/Exchange.js +21 -16
  8. package/dist/cjs/src/bigone.js +0 -1
  9. package/dist/cjs/src/binance.js +3 -0
  10. package/dist/cjs/src/bingx.js +35 -12
  11. package/dist/cjs/src/bitfinex.js +123 -0
  12. package/dist/cjs/src/bitstamp.js +54 -0
  13. package/dist/cjs/src/blofin.js +16 -7
  14. package/dist/cjs/src/cex.js +1 -1
  15. package/dist/cjs/src/coinbase.js +8 -9
  16. package/dist/cjs/src/coinbaseexchange.js +5 -6
  17. package/dist/cjs/src/coinbaseinternational.js +7 -8
  18. package/dist/cjs/src/coincatch.js +0 -1
  19. package/dist/cjs/src/coincheck.js +0 -1
  20. package/dist/cjs/src/coinex.js +91 -6
  21. package/dist/cjs/src/coinlist.js +3 -4
  22. package/dist/cjs/src/coinmate.js +1 -3
  23. package/dist/cjs/src/coinmetro.js +4 -5
  24. package/dist/cjs/src/coinone.js +0 -1
  25. package/dist/cjs/src/coinsph.js +7 -8
  26. package/dist/cjs/src/cryptocom.js +3 -0
  27. package/dist/cjs/src/currencycom.js +3 -4
  28. package/dist/cjs/src/defx.js +6 -7
  29. package/dist/cjs/src/deribit.js +1 -3
  30. package/dist/cjs/src/digifinex.js +0 -1
  31. package/dist/cjs/src/ellipx.js +0 -2
  32. package/dist/cjs/src/exmo.js +1 -2
  33. package/dist/cjs/src/gate.js +1 -2
  34. package/dist/cjs/src/gemini.js +63 -6
  35. package/dist/cjs/src/hashkey.js +79 -83
  36. package/dist/cjs/src/hitbtc.js +49 -5
  37. package/dist/cjs/src/hollaex.js +4 -6
  38. package/dist/cjs/src/htx.js +1 -3
  39. package/dist/cjs/src/huobijp.js +0 -1
  40. package/dist/cjs/src/hyperliquid.js +1 -1
  41. package/dist/cjs/src/idex.js +8 -8
  42. package/dist/cjs/src/independentreserve.js +0 -1
  43. package/dist/cjs/src/indodax.js +0 -1
  44. package/dist/cjs/src/kraken.js +63 -3
  45. package/dist/cjs/src/krakenfutures.js +75 -3
  46. package/dist/cjs/src/kucoin.js +1 -3
  47. package/dist/cjs/src/kucoinfutures.js +10 -9
  48. package/dist/cjs/src/kuna.js +1 -3
  49. package/dist/cjs/src/latoken.js +1 -3
  50. package/dist/cjs/src/lbank.js +0 -1
  51. package/dist/cjs/src/luno.js +0 -1
  52. package/dist/cjs/src/lykke.js +0 -1
  53. package/dist/cjs/src/mercado.js +0 -1
  54. package/dist/cjs/src/mexc.js +3 -4
  55. package/dist/cjs/src/myokx.js +35 -0
  56. package/dist/cjs/src/ndax.js +1 -1
  57. package/dist/cjs/src/novadax.js +4 -6
  58. package/dist/cjs/src/oceanex.js +0 -1
  59. package/dist/cjs/src/okcoin.js +1 -3
  60. package/dist/cjs/src/okx.js +1 -3
  61. package/dist/cjs/src/onetrading.js +1 -3
  62. package/dist/cjs/src/p2b.js +1 -1
  63. package/dist/cjs/src/paradex.js +5 -7
  64. package/dist/cjs/src/phemex.js +15 -15
  65. package/dist/cjs/src/poloniex.js +1 -3
  66. package/dist/cjs/src/poloniexfutures.js +6 -6
  67. package/dist/cjs/src/pro/myokx.js +24 -0
  68. package/dist/cjs/src/probit.js +0 -1
  69. package/dist/cjs/src/timex.js +0 -1
  70. package/dist/cjs/src/tokocrypto.js +11 -14
  71. package/dist/cjs/src/tradeogre.js +1 -1
  72. package/dist/cjs/src/upbit.js +0 -1
  73. package/dist/cjs/src/vertex.js +69 -4
  74. package/dist/cjs/src/wavesexchange.js +4 -5
  75. package/dist/cjs/src/whitebit.js +8 -9
  76. package/dist/cjs/src/woo.js +101 -15
  77. package/dist/cjs/src/woofipro.js +96 -15
  78. package/dist/cjs/src/xt.js +3 -2
  79. package/dist/cjs/src/yobit.js +0 -1
  80. package/dist/cjs/src/zaif.js +0 -1
  81. package/dist/cjs/src/zonda.js +1 -2
  82. package/js/ccxt.d.ts +8 -2
  83. package/js/ccxt.js +6 -2
  84. package/js/src/abstract/binance.d.ts +3 -0
  85. package/js/src/abstract/binancecoinm.d.ts +3 -0
  86. package/js/src/abstract/binanceus.d.ts +3 -0
  87. package/js/src/abstract/binanceusdm.d.ts +3 -0
  88. package/js/src/abstract/bingx.d.ts +4 -0
  89. package/js/src/abstract/bitstamp.d.ts +1 -0
  90. package/js/src/abstract/myokx.d.ts +343 -0
  91. package/js/src/abstract/myokx.js +11 -0
  92. package/js/src/ace.js +1 -1
  93. package/js/src/alpaca.js +0 -1
  94. package/js/src/ascendex.js +0 -1
  95. package/js/src/base/Exchange.d.ts +6 -6
  96. package/js/src/base/Exchange.js +21 -16
  97. package/js/src/bigone.js +0 -1
  98. package/js/src/binance.js +3 -0
  99. package/js/src/bingx.js +35 -12
  100. package/js/src/bitfinex.d.ts +11 -1
  101. package/js/src/bitfinex.js +123 -0
  102. package/js/src/bitstamp.js +54 -0
  103. package/js/src/blofin.d.ts +1 -1
  104. package/js/src/blofin.js +16 -7
  105. package/js/src/cex.js +1 -1
  106. package/js/src/coinbase.js +8 -9
  107. package/js/src/coinbaseexchange.js +5 -6
  108. package/js/src/coinbaseinternational.d.ts +1 -1
  109. package/js/src/coinbaseinternational.js +7 -8
  110. package/js/src/coincatch.js +0 -1
  111. package/js/src/coincheck.js +0 -1
  112. package/js/src/coinex.js +91 -6
  113. package/js/src/coinlist.js +3 -4
  114. package/js/src/coinmate.js +1 -3
  115. package/js/src/coinmetro.js +4 -5
  116. package/js/src/coinone.js +0 -1
  117. package/js/src/coinsph.js +7 -8
  118. package/js/src/cryptocom.js +3 -0
  119. package/js/src/currencycom.js +3 -4
  120. package/js/src/defx.js +6 -7
  121. package/js/src/deribit.js +1 -3
  122. package/js/src/digifinex.js +0 -1
  123. package/js/src/ellipx.js +0 -2
  124. package/js/src/exmo.d.ts +1 -1
  125. package/js/src/exmo.js +1 -2
  126. package/js/src/gate.d.ts +1 -1
  127. package/js/src/gate.js +1 -2
  128. package/js/src/gemini.js +63 -6
  129. package/js/src/hashkey.js +79 -83
  130. package/js/src/hitbtc.d.ts +11 -1
  131. package/js/src/hitbtc.js +49 -5
  132. package/js/src/hollaex.js +4 -6
  133. package/js/src/htx.js +1 -3
  134. package/js/src/huobijp.js +0 -1
  135. package/js/src/hyperliquid.js +1 -1
  136. package/js/src/idex.js +8 -8
  137. package/js/src/independentreserve.js +0 -1
  138. package/js/src/indodax.js +0 -1
  139. package/js/src/kraken.d.ts +2 -2
  140. package/js/src/kraken.js +63 -3
  141. package/js/src/krakenfutures.d.ts +2 -2
  142. package/js/src/krakenfutures.js +75 -3
  143. package/js/src/kucoin.js +1 -3
  144. package/js/src/kucoinfutures.d.ts +5 -4
  145. package/js/src/kucoinfutures.js +10 -9
  146. package/js/src/kuna.js +1 -3
  147. package/js/src/latoken.js +1 -3
  148. package/js/src/lbank.js +0 -1
  149. package/js/src/luno.js +0 -1
  150. package/js/src/lykke.js +0 -1
  151. package/js/src/mercado.js +0 -1
  152. package/js/src/mexc.js +3 -4
  153. package/js/src/myokx.d.ts +4 -0
  154. package/js/src/myokx.js +36 -0
  155. package/js/src/ndax.js +1 -1
  156. package/js/src/novadax.js +4 -6
  157. package/js/src/oceanex.js +0 -1
  158. package/js/src/okcoin.js +1 -3
  159. package/js/src/okx.js +1 -3
  160. package/js/src/onetrading.js +1 -3
  161. package/js/src/p2b.js +1 -1
  162. package/js/src/paradex.d.ts +1 -1
  163. package/js/src/paradex.js +5 -7
  164. package/js/src/phemex.d.ts +1 -0
  165. package/js/src/phemex.js +15 -15
  166. package/js/src/poloniex.js +1 -3
  167. package/js/src/poloniexfutures.js +6 -6
  168. package/js/src/pro/myokx.d.ts +4 -0
  169. package/js/src/pro/myokx.js +25 -0
  170. package/js/src/probit.js +0 -1
  171. package/js/src/timex.js +0 -1
  172. package/js/src/tokocrypto.js +11 -14
  173. package/js/src/tradeogre.js +1 -1
  174. package/js/src/upbit.js +0 -1
  175. package/js/src/vertex.d.ts +11 -1
  176. package/js/src/vertex.js +69 -4
  177. package/js/src/wavesexchange.d.ts +1 -1
  178. package/js/src/wavesexchange.js +4 -5
  179. package/js/src/whitebit.js +8 -9
  180. package/js/src/woo.d.ts +1 -1
  181. package/js/src/woo.js +101 -15
  182. package/js/src/woofipro.js +96 -15
  183. package/js/src/xt.d.ts +2 -1
  184. package/js/src/xt.js +3 -2
  185. package/js/src/yobit.js +0 -1
  186. package/js/src/zaif.js +0 -1
  187. package/js/src/zonda.js +1 -2
  188. package/package.json +15 -8
@@ -867,12 +867,12 @@ class poloniexfutures extends poloniexfutures$1 {
867
867
  'size': preciseAmount,
868
868
  'leverage': 1,
869
869
  };
870
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
871
- if (stopPrice) {
870
+ const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
871
+ if (triggerPrice) {
872
872
  request['stop'] = (side === 'buy') ? 'up' : 'down';
873
873
  const stopPriceType = this.safeString(params, 'stopPriceType', 'TP');
874
874
  request['stopPriceType'] = stopPriceType;
875
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
875
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
876
876
  }
877
877
  const timeInForce = this.safeStringUpper(params, 'timeInForce');
878
878
  if (type === 'limit') {
@@ -929,7 +929,7 @@ class poloniexfutures extends poloniexfutures$1 {
929
929
  'trades': undefined,
930
930
  'timeInForce': undefined,
931
931
  'postOnly': undefined,
932
- 'stopPrice': undefined,
932
+ 'triggerPrice': undefined,
933
933
  'info': response,
934
934
  }, market);
935
935
  }
@@ -1260,7 +1260,7 @@ class poloniexfutures extends poloniexfutures$1 {
1260
1260
  'trades': undefined,
1261
1261
  'timeInForce': undefined,
1262
1262
  'postOnly': undefined,
1263
- 'stopPrice': undefined,
1263
+ 'triggerPrice': undefined,
1264
1264
  'info': response,
1265
1265
  }));
1266
1266
  }
@@ -1597,7 +1597,7 @@ class poloniexfutures extends poloniexfutures$1 {
1597
1597
  'side': this.safeString(order, 'side'),
1598
1598
  'amount': this.safeString(order, 'size'),
1599
1599
  'price': this.safeString(order, 'price'),
1600
- 'stopPrice': this.safeString(order, 'stopPrice'),
1600
+ 'triggerPrice': this.safeString(order, 'stopPrice'),
1601
1601
  'cost': this.safeString(order, 'dealValue'),
1602
1602
  'filled': filled,
1603
1603
  'remaining': undefined,
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ var okx = require('./okx.js');
4
+
5
+ // ---------------------------------------------------------------------------
6
+ // ---------------------------------------------------------------------------
7
+ class myokx extends okx {
8
+ describe() {
9
+ return this.deepExtend(super.describe(), {
10
+ 'id': 'myokx',
11
+ 'name': 'MyOKX',
12
+ 'urls': {
13
+ 'api': {
14
+ 'ws': 'wss://wseea.okx.com:8443/ws/v5',
15
+ },
16
+ 'test': {
17
+ 'ws': 'wss://wseeapap.okx.com:8443/ws/v5',
18
+ },
19
+ },
20
+ });
21
+ }
22
+ }
23
+
24
+ module.exports = myokx;
@@ -1164,7 +1164,6 @@ class probit extends probit$1 {
1164
1164
  'side': side,
1165
1165
  'status': status,
1166
1166
  'price': price,
1167
- 'stopPrice': undefined,
1168
1167
  'triggerPrice': undefined,
1169
1168
  'amount': amount,
1170
1169
  'filled': filled,
@@ -1562,7 +1562,6 @@ class timex extends timex$1 {
1562
1562
  'postOnly': undefined,
1563
1563
  'side': side,
1564
1564
  'price': price,
1565
- 'stopPrice': undefined,
1566
1565
  'triggerPrice': undefined,
1567
1566
  'amount': amount,
1568
1567
  'cost': undefined,
@@ -1549,8 +1549,6 @@ class tokocrypto extends tokocrypto$1 {
1549
1549
  timeInForce = 'PO';
1550
1550
  }
1551
1551
  const postOnly = (type === 'limit_maker') || (timeInForce === 'PO');
1552
- const stopPriceString = this.safeString(order, 'stopPrice');
1553
- const stopPrice = this.parseNumber(this.omitZero(stopPriceString));
1554
1552
  return this.safeOrder({
1555
1553
  'info': order,
1556
1554
  'id': id,
@@ -1565,8 +1563,7 @@ class tokocrypto extends tokocrypto$1 {
1565
1563
  'reduceOnly': this.safeValue(order, 'reduceOnly'),
1566
1564
  'side': side,
1567
1565
  'price': price,
1568
- 'stopPrice': stopPrice,
1569
- 'triggerPrice': stopPrice,
1566
+ 'triggerPrice': this.parseNumber(this.omitZero(this.safeString(order, 'stopPrice'))),
1570
1567
  'amount': amount,
1571
1568
  'cost': cost,
1572
1569
  'average': average,
@@ -1614,8 +1611,8 @@ class tokocrypto extends tokocrypto$1 {
1614
1611
  params = this.omit(params, ['clientId', 'clientOrderId']);
1615
1612
  const initialUppercaseType = type.toUpperCase();
1616
1613
  let uppercaseType = initialUppercaseType;
1617
- const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1618
- if (stopPrice !== undefined) {
1614
+ const triggerPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
1615
+ if (triggerPrice !== undefined) {
1619
1616
  params = this.omit(params, ['triggerPrice', 'stopPrice']);
1620
1617
  if (uppercaseType === 'MARKET') {
1621
1618
  uppercaseType = 'STOP_LOSS';
@@ -1627,7 +1624,7 @@ class tokocrypto extends tokocrypto$1 {
1627
1624
  const validOrderTypes = this.safeValue(market['info'], 'orderTypes');
1628
1625
  if (!this.inArray(uppercaseType, validOrderTypes)) {
1629
1626
  if (initialUppercaseType !== uppercaseType) {
1630
- throw new errors.InvalidOrder(this.id + ' stopPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders');
1627
+ throw new errors.InvalidOrder(this.id + ' triggerPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders');
1631
1628
  }
1632
1629
  else {
1633
1630
  throw new errors.InvalidOrder(this.id + ' ' + type + ' is not a valid order type for the ' + symbol + ' market');
@@ -1666,7 +1663,7 @@ class tokocrypto extends tokocrypto$1 {
1666
1663
  }
1667
1664
  // additional required fields depending on the order type
1668
1665
  let priceIsRequired = false;
1669
- let stopPriceIsRequired = false;
1666
+ let triggerPriceIsRequired = false;
1670
1667
  let quantityIsRequired = false;
1671
1668
  //
1672
1669
  // spot/margin
@@ -1714,7 +1711,7 @@ class tokocrypto extends tokocrypto$1 {
1714
1711
  quantityIsRequired = true;
1715
1712
  }
1716
1713
  else if ((uppercaseType === 'STOP_LOSS') || (uppercaseType === 'TAKE_PROFIT')) {
1717
- stopPriceIsRequired = true;
1714
+ triggerPriceIsRequired = true;
1718
1715
  quantityIsRequired = true;
1719
1716
  if (market['linear'] || market['inverse']) {
1720
1717
  priceIsRequired = true;
@@ -1722,7 +1719,7 @@ class tokocrypto extends tokocrypto$1 {
1722
1719
  }
1723
1720
  else if ((uppercaseType === 'STOP_LOSS_LIMIT') || (uppercaseType === 'TAKE_PROFIT_LIMIT')) {
1724
1721
  quantityIsRequired = true;
1725
- stopPriceIsRequired = true;
1722
+ triggerPriceIsRequired = true;
1726
1723
  priceIsRequired = true;
1727
1724
  }
1728
1725
  else if (uppercaseType === 'LIMIT_MAKER') {
@@ -1738,12 +1735,12 @@ class tokocrypto extends tokocrypto$1 {
1738
1735
  }
1739
1736
  request['price'] = this.priceToPrecision(symbol, price);
1740
1737
  }
1741
- if (stopPriceIsRequired) {
1742
- if (stopPrice === undefined) {
1743
- throw new errors.InvalidOrder(this.id + ' createOrder() requires a stopPrice extra param for a ' + type + ' order');
1738
+ if (triggerPriceIsRequired) {
1739
+ if (triggerPrice === undefined) {
1740
+ throw new errors.InvalidOrder(this.id + ' createOrder() requires a triggerPrice extra param for a ' + type + ' order');
1744
1741
  }
1745
1742
  else {
1746
- request['stopPrice'] = this.priceToPrecision(symbol, stopPrice);
1743
+ request['stopPrice'] = this.priceToPrecision(symbol, triggerPrice);
1747
1744
  }
1748
1745
  }
1749
1746
  const response = await this.privatePostOpenV1Orders(this.extend(request, params));
@@ -578,7 +578,7 @@ class tradeogre extends tradeogre$1 {
578
578
  'postOnly': undefined,
579
579
  'side': this.safeString(order, 'type'),
580
580
  'price': this.safeString(order, 'price'),
581
- 'stopPrice': undefined,
581
+ 'triggerPrice': undefined,
582
582
  'amount': this.safeString(order, 'quantity'),
583
583
  'cost': undefined,
584
584
  'average': undefined,
@@ -1560,7 +1560,6 @@ class upbit extends upbit$1 {
1560
1560
  'postOnly': undefined,
1561
1561
  'side': side,
1562
1562
  'price': price,
1563
- 'stopPrice': undefined,
1564
1563
  'triggerPrice': undefined,
1565
1564
  'cost': this.parseNumber(cost),
1566
1565
  'average': this.parseNumber(average),
@@ -86,6 +86,7 @@ class vertex extends vertex$1 {
86
86
  'fetchOHLCV': true,
87
87
  'fetchOpenInterest': true,
88
88
  'fetchOpenInterestHistory': false,
89
+ 'fetchOpenInterests': true,
89
90
  'fetchOpenOrders': true,
90
91
  'fetchOrder': true,
91
92
  'fetchOrderBook': true,
@@ -1349,16 +1350,80 @@ class vertex extends vertex$1 {
1349
1350
  // }
1350
1351
  // }
1351
1352
  //
1352
- const value = this.safeNumber(interest, 'open_interest_usd');
1353
+ const marketId = this.safeString(interest, 'ticker_id');
1353
1354
  return this.safeOpenInterest({
1354
- 'symbol': market['symbol'],
1355
- 'openInterestAmount': undefined,
1356
- 'openInterestValue': value,
1355
+ 'symbol': this.safeSymbol(marketId, market),
1356
+ 'openInterestAmount': this.safeNumber(interest, 'open_interest'),
1357
+ 'openInterestValue': this.safeNumber(interest, 'open_interest_usd'),
1357
1358
  'timestamp': undefined,
1358
1359
  'datetime': undefined,
1359
1360
  'info': interest,
1360
1361
  }, market);
1361
1362
  }
1363
+ /**
1364
+ * @method
1365
+ * @name vertex#fetchOpenInterests
1366
+ * @description Retrieves the open interest for a list of symbols
1367
+ * @see https://docs.vertexprotocol.com/developer-resources/api/v2/contracts
1368
+ * @param {string[]} [symbols] a list of unified CCXT market symbols
1369
+ * @param {object} [params] exchange specific parameters
1370
+ * @returns {object[]} a list of [open interest structures]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
1371
+ */
1372
+ async fetchOpenInterests(symbols = undefined, params = {}) {
1373
+ await this.loadMarkets();
1374
+ symbols = this.marketSymbols(symbols);
1375
+ const response = await this.v2ArchiveGetContracts(params);
1376
+ //
1377
+ // {
1378
+ // "ADA-PERP_USDC": {
1379
+ // "ticker_id": "ADA-PERP_USDC",
1380
+ // "base_currency": "ADA-PERP",
1381
+ // "quote_currency": "USDC",
1382
+ // "last_price": 0.85506,
1383
+ // "base_volume": 1241320.0,
1384
+ // "quote_volume": 1122670.9080057142,
1385
+ // "product_type": "perpetual",
1386
+ // "contract_price": 0.8558601432685385,
1387
+ // "contract_price_currency": "USD",
1388
+ // "open_interest": 104040.0,
1389
+ // "open_interest_usd": 89043.68930565874,
1390
+ // "index_price": 0.8561952606869176,
1391
+ // "mark_price": 0.856293781088936,
1392
+ // "funding_rate": 0.000116153806226841,
1393
+ // "next_funding_rate_timestamp": 1734685200,
1394
+ // "price_change_percent_24h": -12.274325340321374
1395
+ // },
1396
+ // }
1397
+ //
1398
+ const parsedSymbols = [];
1399
+ const results = [];
1400
+ const markets = Object.keys(response);
1401
+ if (symbols === undefined) {
1402
+ symbols = [];
1403
+ for (let y = 0; y < markets.length; y++) {
1404
+ const tickerId = markets[y];
1405
+ const parsedTickerId = tickerId.split('-');
1406
+ const currentSymbol = parsedTickerId[0] + '/USDC:USDC';
1407
+ if (!this.inArray(currentSymbol, symbols)) {
1408
+ symbols.push(currentSymbol);
1409
+ }
1410
+ }
1411
+ }
1412
+ for (let i = 0; i < markets.length; i++) {
1413
+ const marketId = markets[i];
1414
+ const marketInner = this.safeMarket(marketId);
1415
+ const openInterest = this.safeDict(response, marketId, {});
1416
+ for (let j = 0; j < symbols.length; j++) {
1417
+ const market = this.market(symbols[j]);
1418
+ const tickerId = market['base'] + '_USDC';
1419
+ if (marketInner['marketId'] === tickerId) {
1420
+ parsedSymbols.push(market['symbol']);
1421
+ results.push(this.parseOpenInterest(openInterest, market));
1422
+ }
1423
+ }
1424
+ }
1425
+ return this.filterByArray(results, 'symbol', parsedSymbols);
1426
+ }
1362
1427
  /**
1363
1428
  * @method
1364
1429
  * @name vertex#fetchOpenInterest
@@ -1292,7 +1292,7 @@ class wavesexchange extends wavesexchange$1 {
1292
1292
  * @param {float} amount how much of currency you want to trade in units of base currency
1293
1293
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1294
1294
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1295
- * @param {float} [params.stopPrice] The price at which a stop order is triggered at
1295
+ * @param {float} [params.triggerPrice] The price at which a stop order is triggered at
1296
1296
  * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1297
1297
  */
1298
1298
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
@@ -1304,8 +1304,8 @@ class wavesexchange extends wavesexchange$1 {
1304
1304
  const amountAsset = this.getAssetId(market['baseId']);
1305
1305
  const priceAsset = this.getAssetId(market['quoteId']);
1306
1306
  const isMarketOrder = (type === 'market');
1307
- const stopPrice = this.safeFloat2(params, 'triggerPrice', 'stopPrice');
1308
- const isStopOrder = (stopPrice !== undefined);
1307
+ const triggerPrice = this.safeFloat2(params, 'triggerPrice', 'stopPrice');
1308
+ const isStopOrder = (triggerPrice !== undefined);
1309
1309
  if ((isMarketOrder) && (price === undefined)) {
1310
1310
  throw new errors.InvalidOrder(this.id + ' createOrder() requires a price argument for ' + type + ' orders to determine the max price for buy and the min price for sell');
1311
1311
  }
@@ -1412,7 +1412,7 @@ class wavesexchange extends wavesexchange$1 {
1412
1412
  'c': {
1413
1413
  't': 'sp',
1414
1414
  'v': {
1415
- 'p': this.toRealSymbolPrice(symbol, stopPrice),
1415
+ 'p': this.toRealSymbolPrice(symbol, triggerPrice),
1416
1416
  },
1417
1417
  },
1418
1418
  };
@@ -1810,7 +1810,6 @@ class wavesexchange extends wavesexchange$1 {
1810
1810
  'postOnly': undefined,
1811
1811
  'side': side,
1812
1812
  'price': price,
1813
- 'stopPrice': triggerPrice,
1814
1813
  'triggerPrice': triggerPrice,
1815
1814
  'amount': amount,
1816
1815
  'cost': undefined,
@@ -1294,8 +1294,8 @@ class whitebit extends whitebit$1 {
1294
1294
  const marketType = this.safeString(market, 'type');
1295
1295
  const isLimitOrder = type === 'limit';
1296
1296
  const isMarketOrder = type === 'market';
1297
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1298
- const isStopOrder = (stopPrice !== undefined);
1297
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1298
+ const isStopOrder = (triggerPrice !== undefined);
1299
1299
  const postOnly = this.isPostOnly(isMarketOrder, false, params);
1300
1300
  const [marginMode, query] = this.handleMarginModeAndParams('createOrder', params);
1301
1301
  if (postOnly) {
@@ -1308,7 +1308,7 @@ class whitebit extends whitebit$1 {
1308
1308
  const useCollateralEndpoint = marginMode !== undefined || marketType === 'swap';
1309
1309
  let response = undefined;
1310
1310
  if (isStopOrder) {
1311
- request['activation_price'] = this.priceToPrecision(symbol, stopPrice);
1311
+ request['activation_price'] = this.priceToPrecision(symbol, triggerPrice);
1312
1312
  if (isLimitOrder) {
1313
1313
  // stop limit order
1314
1314
  request['price'] = this.priceToPrecision(symbol, price);
@@ -1385,11 +1385,11 @@ class whitebit extends whitebit$1 {
1385
1385
  request['clientOrderId'] = clientOrderId;
1386
1386
  }
1387
1387
  const isLimitOrder = type === 'limit';
1388
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1389
- const isStopOrder = (stopPrice !== undefined);
1388
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'activation_price']);
1389
+ const isStopOrder = (triggerPrice !== undefined);
1390
1390
  params = this.omit(params, ['clOrdId', 'clientOrderId', 'triggerPrice', 'stopPrice']);
1391
1391
  if (isStopOrder) {
1392
- request['activation_price'] = this.priceToPrecision(symbol, stopPrice);
1392
+ request['activation_price'] = this.priceToPrecision(symbol, triggerPrice);
1393
1393
  if (isLimitOrder) {
1394
1394
  // stop limit order
1395
1395
  request['amount'] = this.amountToPrecision(symbol, amount);
@@ -1783,7 +1783,7 @@ class whitebit extends whitebit$1 {
1783
1783
  clientOrderId = undefined;
1784
1784
  }
1785
1785
  const price = this.safeString(order, 'price');
1786
- const stopPrice = this.safeNumber(order, 'activation_price');
1786
+ const triggerPrice = this.safeNumber(order, 'activation_price');
1787
1787
  const orderId = this.safeString2(order, 'orderId', 'id');
1788
1788
  const type = this.safeString(order, 'type');
1789
1789
  const orderType = this.parseOrderType(type);
@@ -1819,8 +1819,7 @@ class whitebit extends whitebit$1 {
1819
1819
  'side': side,
1820
1820
  'price': price,
1821
1821
  'type': orderType,
1822
- 'stopPrice': stopPrice,
1823
- 'triggerPrice': stopPrice,
1822
+ 'triggerPrice': triggerPrice,
1824
1823
  'amount': amount,
1825
1824
  'filled': filled,
1826
1825
  'remaining': remaining,
@@ -310,6 +310,92 @@ class woo extends woo$1 {
310
310
  },
311
311
  'brokerId': 'bc830de7-50f3-460b-9ee0-f430f83f9dad',
312
312
  },
313
+ 'features': {
314
+ 'default': {
315
+ 'sandbox': true,
316
+ 'createOrder': {
317
+ 'marginMode': true,
318
+ 'triggerPrice': true,
319
+ 'triggerPriceType': {
320
+ 'last': true,
321
+ 'mark': true,
322
+ 'index': false,
323
+ },
324
+ 'triggerDirection': false,
325
+ 'stopLossPrice': false,
326
+ 'takeProfitPrice': false,
327
+ 'attachedStopLossTakeProfit': undefined,
328
+ 'timeInForce': {
329
+ 'IOC': true,
330
+ 'FOK': true,
331
+ 'PO': true,
332
+ 'GTD': true,
333
+ },
334
+ 'hedged': false,
335
+ 'trailing': true,
336
+ // exchange specific params:
337
+ // 'iceberg': true,
338
+ // 'oco': true,
339
+ },
340
+ 'createOrders': undefined,
341
+ 'fetchMyTrades': {
342
+ 'marginMode': false,
343
+ 'limit': 500,
344
+ 'daysBack': 90,
345
+ 'untilDays': 10000,
346
+ },
347
+ 'fetchOrder': {
348
+ 'marginMode': false,
349
+ 'trigger': true,
350
+ 'trailing': false,
351
+ },
352
+ 'fetchOpenOrders': {
353
+ 'marginMode': false,
354
+ 'limit': 500,
355
+ 'trigger': true,
356
+ 'trailing': true,
357
+ },
358
+ 'fetchOrders': {
359
+ 'marginMode': false,
360
+ 'limit': 500,
361
+ 'daysBack': undefined,
362
+ 'untilDays': 100000,
363
+ 'trigger': true,
364
+ 'trailing': true,
365
+ },
366
+ 'fetchClosedOrders': {
367
+ 'marginMode': false,
368
+ 'limit': 500,
369
+ 'daysBackClosed': undefined,
370
+ 'daysBackCanceled': undefined,
371
+ 'untilDays': 100000,
372
+ 'trigger': true,
373
+ 'trailing': true,
374
+ },
375
+ 'fetchOHLCV': {
376
+ 'limit': 1000,
377
+ },
378
+ },
379
+ 'spot': {
380
+ 'extends': 'default',
381
+ },
382
+ 'forSwap': {
383
+ 'extends': 'default',
384
+ 'createOrder': {
385
+ 'hedged': true,
386
+ },
387
+ },
388
+ 'swap': {
389
+ 'linear': {
390
+ 'extends': 'forSwap',
391
+ },
392
+ 'inverse': undefined,
393
+ },
394
+ 'future': {
395
+ 'linear': undefined,
396
+ 'inverse': undefined,
397
+ },
398
+ },
313
399
  'commonCurrencies': {},
314
400
  'exceptions': {
315
401
  'exact': {
@@ -975,7 +1061,7 @@ class woo extends woo$1 {
975
1061
  if (marginMode !== undefined) {
976
1062
  request['margin_mode'] = this.encodeMarginMode(marginMode);
977
1063
  }
978
- const stopPrice = this.safeNumber2(params, 'triggerPrice', 'stopPrice');
1064
+ const triggerPrice = this.safeString2(params, 'triggerPrice', 'stopPrice');
979
1065
  const stopLoss = this.safeValue(params, 'stopLoss');
980
1066
  const takeProfit = this.safeValue(params, 'takeProfit');
981
1067
  const algoType = this.safeString(params, 'algoType');
@@ -985,7 +1071,7 @@ class woo extends woo$1 {
985
1071
  const isTrailingAmountOrder = trailingAmount !== undefined;
986
1072
  const isTrailingPercentOrder = trailingPercent !== undefined;
987
1073
  const isTrailing = isTrailingAmountOrder || isTrailingPercentOrder;
988
- const isConditional = isTrailing || stopPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
1074
+ const isConditional = isTrailing || triggerPrice !== undefined || stopLoss !== undefined || takeProfit !== undefined || (this.safeValue(params, 'childOrders') !== undefined);
989
1075
  const isMarket = orderType === 'MARKET';
990
1076
  const timeInForce = this.safeStringLower(params, 'timeInForce');
991
1077
  const postOnly = this.isPostOnly(isMarket, undefined, params);
@@ -1055,9 +1141,9 @@ class woo extends woo$1 {
1055
1141
  request['callbackRate'] = convertedTrailingPercent;
1056
1142
  }
1057
1143
  }
1058
- else if (stopPrice !== undefined) {
1144
+ else if (triggerPrice !== undefined) {
1059
1145
  if (algoType !== 'TRAILING_STOP') {
1060
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
1146
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
1061
1147
  request['algoType'] = 'STOP';
1062
1148
  }
1063
1149
  }
@@ -1071,7 +1157,7 @@ class woo extends woo$1 {
1071
1157
  };
1072
1158
  const closeSide = (orderSide === 'BUY') ? 'SELL' : 'BUY';
1073
1159
  if (stopLoss !== undefined) {
1074
- const stopLossPrice = this.safeNumber2(stopLoss, 'triggerPrice', 'price', stopLoss);
1160
+ const stopLossPrice = this.safeString(stopLoss, 'triggerPrice', stopLoss);
1075
1161
  const stopLossOrder = {
1076
1162
  'side': closeSide,
1077
1163
  'algoType': 'STOP_LOSS',
@@ -1082,7 +1168,7 @@ class woo extends woo$1 {
1082
1168
  outterOrder['childOrders'].push(stopLossOrder);
1083
1169
  }
1084
1170
  if (takeProfit !== undefined) {
1085
- const takeProfitPrice = this.safeNumber2(takeProfit, 'triggerPrice', 'price', takeProfit);
1171
+ const takeProfitPrice = this.safeString(takeProfit, 'triggerPrice', takeProfit);
1086
1172
  const takeProfitOrder = {
1087
1173
  'side': closeSide,
1088
1174
  'algoType': 'TAKE_PROFIT',
@@ -1182,9 +1268,9 @@ class woo extends woo$1 {
1182
1268
  const clientOrderIdUnified = this.safeString2(params, 'clOrdID', 'clientOrderId');
1183
1269
  const clientOrderIdExchangeSpecific = this.safeString(params, 'client_order_id', clientOrderIdUnified);
1184
1270
  const isByClientOrder = clientOrderIdExchangeSpecific !== undefined;
1185
- const stopPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice']);
1186
- if (stopPrice !== undefined) {
1187
- request['triggerPrice'] = this.priceToPrecision(symbol, stopPrice);
1271
+ const triggerPrice = this.safeNumberN(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice']);
1272
+ if (triggerPrice !== undefined) {
1273
+ request['triggerPrice'] = this.priceToPrecision(symbol, triggerPrice);
1188
1274
  }
1189
1275
  const trailingTriggerPrice = this.safeString2(params, 'trailingTriggerPrice', 'activatedPrice', this.numberToString(price));
1190
1276
  const trailingAmount = this.safeString2(params, 'trailingAmount', 'callbackValue');
@@ -1205,7 +1291,7 @@ class woo extends woo$1 {
1205
1291
  }
1206
1292
  }
1207
1293
  params = this.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent']);
1208
- const isConditional = isTrailing || (stopPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
1294
+ const isConditional = isTrailing || (triggerPrice !== undefined) || (this.safeValue(params, 'childOrders') !== undefined);
1209
1295
  let response = undefined;
1210
1296
  if (isByClientOrder) {
1211
1297
  request['client_order_id'] = clientOrderIdExchangeSpecific;
@@ -1642,7 +1728,7 @@ class woo extends woo$1 {
1642
1728
  const fee = this.safeNumber2(order, 'total_fee', 'totalFee');
1643
1729
  const feeCurrency = this.safeString2(order, 'fee_asset', 'feeAsset');
1644
1730
  const transactions = this.safeValue(order, 'Transactions');
1645
- const stopPrice = this.safeNumber(order, 'triggerPrice');
1731
+ const triggerPrice = this.safeNumber(order, 'triggerPrice');
1646
1732
  let takeProfitPrice = undefined;
1647
1733
  let stopLossPrice = undefined;
1648
1734
  const childOrders = this.safeValue(order, 'childOrders');
@@ -1673,8 +1759,7 @@ class woo extends woo$1 {
1673
1759
  'reduceOnly': this.safeBool(order, 'reduce_only'),
1674
1760
  'side': side,
1675
1761
  'price': price,
1676
- 'stopPrice': stopPrice,
1677
- 'triggerPrice': stopPrice,
1762
+ 'triggerPrice': triggerPrice,
1678
1763
  'takeProfitPrice': takeProfitPrice,
1679
1764
  'stopLossPrice': stopLossPrice,
1680
1765
  'average': average,
@@ -1890,7 +1975,7 @@ class woo extends woo$1 {
1890
1975
  * @method
1891
1976
  * @name woo#fetchMyTrades
1892
1977
  * @description fetch all trades made by the user
1893
- * @see https://docs.woox.io/#get-trades
1978
+ * @see https://docs.woox.io/#get-trade-history
1894
1979
  * @param {string} symbol unified market symbol
1895
1980
  * @param {int} [since] the earliest time in ms to fetch trades for
1896
1981
  * @param {int} [limit] the maximum number of trades structures to retrieve
@@ -1905,7 +1990,7 @@ class woo extends woo$1 {
1905
1990
  if (paginate) {
1906
1991
  return await this.fetchPaginatedCallIncremental('fetchMyTrades', symbol, since, limit, params, 'page', 500);
1907
1992
  }
1908
- const request = {};
1993
+ let request = {};
1909
1994
  let market = undefined;
1910
1995
  if (symbol !== undefined) {
1911
1996
  market = this.market(symbol);
@@ -1914,6 +1999,7 @@ class woo extends woo$1 {
1914
1999
  if (since !== undefined) {
1915
2000
  request['start_t'] = since;
1916
2001
  }
2002
+ [request, params] = this.handleUntilOption('end_t', request, params);
1917
2003
  if (limit !== undefined) {
1918
2004
  request['size'] = limit;
1919
2005
  }