ccxt 4.1.50 → 4.1.52

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 (183) hide show
  1. package/README.md +110 -113
  2. package/dist/ccxt.browser.js +1377 -2931
  3. package/dist/ccxt.browser.min.js +7 -7
  4. package/dist/cjs/ccxt.js +1 -7
  5. package/dist/cjs/src/alpaca.js +62 -64
  6. package/dist/cjs/src/ascendex.js +3 -1
  7. package/dist/cjs/src/base/Exchange.js +10 -0
  8. package/dist/cjs/src/bigone.js +60 -77
  9. package/dist/cjs/src/binance.js +1 -0
  10. package/dist/cjs/src/bingx.js +4 -11
  11. package/dist/cjs/src/bitbank.js +58 -59
  12. package/dist/cjs/src/bitbns.js +1 -0
  13. package/dist/cjs/src/bitfinex.js +1 -0
  14. package/dist/cjs/src/bitfinex2.js +1 -0
  15. package/dist/cjs/src/bitflyer.js +1 -0
  16. package/dist/cjs/src/bitget.js +3 -8
  17. package/dist/cjs/src/bithumb.js +1 -0
  18. package/dist/cjs/src/bitmart.js +10 -1
  19. package/dist/cjs/src/bitmex.js +114 -119
  20. package/dist/cjs/src/bitopro.js +63 -65
  21. package/dist/cjs/src/bitpanda.js +60 -60
  22. package/dist/cjs/src/bitrue.js +67 -71
  23. package/dist/cjs/src/bitso.js +1 -0
  24. package/dist/cjs/src/bitstamp.js +1 -0
  25. package/dist/cjs/src/bittrex.js +57 -57
  26. package/dist/cjs/src/bitvavo.js +10 -2
  27. package/dist/cjs/src/blockchaincom.js +2 -2
  28. package/dist/cjs/src/btcalpha.js +59 -60
  29. package/dist/cjs/src/btcmarkets.js +68 -69
  30. package/dist/cjs/src/btcturk.js +72 -74
  31. package/dist/cjs/src/bybit.js +3 -1
  32. package/dist/cjs/src/coinbase.js +7 -2
  33. package/dist/cjs/src/coinbasepro.js +1 -0
  34. package/dist/cjs/src/coincheck.js +1 -0
  35. package/dist/cjs/src/coinex.js +4 -0
  36. package/dist/cjs/src/coinlist.js +60 -60
  37. package/dist/cjs/src/coinmate.js +1 -0
  38. package/dist/cjs/src/coinsph.js +2 -4
  39. package/dist/cjs/src/cryptocom.js +1 -0
  40. package/dist/cjs/src/currencycom.js +2 -2
  41. package/dist/cjs/src/deribit.js +2 -0
  42. package/dist/cjs/src/digifinex.js +5 -2
  43. package/dist/cjs/src/exmo.js +1 -0
  44. package/dist/cjs/src/gate.js +2 -0
  45. package/dist/cjs/src/gemini.js +2 -0
  46. package/dist/cjs/src/hitbtc.js +4 -0
  47. package/dist/cjs/src/hollaex.js +2 -0
  48. package/dist/cjs/src/htx.js +4 -0
  49. package/dist/cjs/src/huobijp.js +2 -0
  50. package/dist/cjs/src/idex.js +2 -0
  51. package/dist/cjs/src/indodax.js +1 -0
  52. package/dist/cjs/src/kraken.js +10 -13
  53. package/dist/cjs/src/kucoin.js +6 -5
  54. package/dist/cjs/src/kuna.js +3 -1
  55. package/dist/cjs/src/latoken.js +1 -0
  56. package/dist/cjs/src/lbank.js +1 -0
  57. package/dist/cjs/src/lykke.js +2 -0
  58. package/dist/cjs/src/mercado.js +1 -0
  59. package/dist/cjs/src/mexc.js +2 -0
  60. package/dist/cjs/src/ndax.js +2 -0
  61. package/dist/cjs/src/novadax.js +1 -0
  62. package/dist/cjs/src/okcoin.js +2 -0
  63. package/dist/cjs/src/okx.js +2 -0
  64. package/dist/cjs/src/phemex.js +2 -0
  65. package/dist/cjs/src/poloniex.js +1 -0
  66. package/dist/cjs/src/pro/binance.js +5 -3
  67. package/dist/cjs/src/pro/coinbase.js +12 -3
  68. package/dist/cjs/src/pro/cryptocom.js +17 -17
  69. package/dist/cjs/src/pro/krakenfutures.js +24 -3
  70. package/dist/cjs/src/probit.js +4 -2
  71. package/dist/cjs/src/tidex.js +1 -0
  72. package/dist/cjs/src/timex.js +2 -0
  73. package/dist/cjs/src/upbit.js +2 -0
  74. package/dist/cjs/src/wavesexchange.js +2 -1
  75. package/dist/cjs/src/whitebit.js +1 -0
  76. package/dist/cjs/src/woo.js +1 -0
  77. package/dist/cjs/src/zaif.js +1 -0
  78. package/dist/cjs/src/zonda.js +1 -0
  79. package/js/ccxt.d.ts +2 -8
  80. package/js/ccxt.js +2 -6
  81. package/js/src/abstract/kraken.d.ts +0 -5
  82. package/js/src/alpaca.d.ts +3 -2
  83. package/js/src/alpaca.js +62 -64
  84. package/js/src/ascendex.js +3 -1
  85. package/js/src/base/Exchange.d.ts +2 -0
  86. package/js/src/base/Exchange.js +10 -0
  87. package/js/src/base/types.d.ts +6 -3
  88. package/js/src/bigone.d.ts +3 -3
  89. package/js/src/bigone.js +60 -77
  90. package/js/src/binance.js +1 -0
  91. package/js/src/bingx.d.ts +2 -2
  92. package/js/src/bingx.js +4 -11
  93. package/js/src/bitbank.d.ts +3 -2
  94. package/js/src/bitbank.js +58 -59
  95. package/js/src/bitbns.js +1 -0
  96. package/js/src/bitfinex.js +1 -0
  97. package/js/src/bitfinex2.js +1 -0
  98. package/js/src/bitflyer.js +1 -0
  99. package/js/src/bitget.d.ts +1 -2
  100. package/js/src/bitget.js +3 -8
  101. package/js/src/bithumb.js +1 -0
  102. package/js/src/bitmart.js +10 -1
  103. package/js/src/bitmex.d.ts +3 -2
  104. package/js/src/bitmex.js +114 -119
  105. package/js/src/bitopro.d.ts +3 -2
  106. package/js/src/bitopro.js +63 -65
  107. package/js/src/bitpanda.d.ts +3 -2
  108. package/js/src/bitpanda.js +60 -60
  109. package/js/src/bitrue.d.ts +3 -2
  110. package/js/src/bitrue.js +67 -71
  111. package/js/src/bitso.js +1 -0
  112. package/js/src/bitstamp.js +1 -0
  113. package/js/src/bittrex.d.ts +3 -2
  114. package/js/src/bittrex.js +57 -57
  115. package/js/src/bitvavo.js +10 -2
  116. package/js/src/blockchaincom.js +2 -2
  117. package/js/src/btcalpha.d.ts +3 -2
  118. package/js/src/btcalpha.js +59 -60
  119. package/js/src/btcmarkets.d.ts +3 -2
  120. package/js/src/btcmarkets.js +68 -69
  121. package/js/src/btcturk.d.ts +3 -2
  122. package/js/src/btcturk.js +72 -74
  123. package/js/src/bybit.js +3 -1
  124. package/js/src/coinbase.js +7 -2
  125. package/js/src/coinbasepro.js +1 -0
  126. package/js/src/coincheck.js +1 -0
  127. package/js/src/coinex.js +4 -0
  128. package/js/src/coinlist.d.ts +3 -2
  129. package/js/src/coinlist.js +60 -60
  130. package/js/src/coinmate.js +1 -0
  131. package/js/src/coinsph.js +2 -4
  132. package/js/src/cryptocom.js +1 -0
  133. package/js/src/currencycom.js +2 -2
  134. package/js/src/deribit.js +2 -0
  135. package/js/src/digifinex.js +5 -2
  136. package/js/src/exmo.js +1 -0
  137. package/js/src/gate.js +2 -0
  138. package/js/src/gemini.js +2 -0
  139. package/js/src/hitbtc.js +4 -0
  140. package/js/src/hollaex.js +2 -0
  141. package/js/src/htx.js +4 -0
  142. package/js/src/huobijp.js +2 -0
  143. package/js/src/idex.js +2 -0
  144. package/js/src/indodax.js +1 -0
  145. package/js/src/kraken.js +10 -13
  146. package/js/src/kucoin.js +6 -5
  147. package/js/src/kuna.js +3 -1
  148. package/js/src/latoken.js +1 -0
  149. package/js/src/lbank.js +1 -0
  150. package/js/src/lykke.js +2 -0
  151. package/js/src/mercado.js +1 -0
  152. package/js/src/mexc.js +2 -0
  153. package/js/src/ndax.js +2 -0
  154. package/js/src/novadax.js +1 -0
  155. package/js/src/okcoin.js +2 -0
  156. package/js/src/okx.js +2 -0
  157. package/js/src/phemex.js +2 -0
  158. package/js/src/poloniex.js +1 -0
  159. package/js/src/pro/binance.js +5 -3
  160. package/js/src/pro/coinbase.js +12 -3
  161. package/js/src/pro/cryptocom.js +17 -17
  162. package/js/src/pro/krakenfutures.js +24 -3
  163. package/js/src/probit.js +4 -2
  164. package/js/src/tidex.js +1 -0
  165. package/js/src/timex.js +2 -0
  166. package/js/src/upbit.js +2 -0
  167. package/js/src/wavesexchange.js +2 -1
  168. package/js/src/whitebit.js +1 -0
  169. package/js/src/woo.js +1 -0
  170. package/js/src/zaif.js +1 -0
  171. package/js/src/zonda.js +1 -0
  172. package/package.json +1 -1
  173. package/skip-tests.json +2 -3
  174. package/dist/cjs/src/btctradeua.js +0 -571
  175. package/dist/cjs/src/coinfalcon.js +0 -1012
  176. package/js/src/abstract/btctradeua.d.ts +0 -20
  177. package/js/src/abstract/btctradeua.js +0 -11
  178. package/js/src/abstract/coinfalcon.d.ts +0 -26
  179. package/js/src/abstract/coinfalcon.js +0 -11
  180. package/js/src/btctradeua.d.ts +0 -30
  181. package/js/src/btctradeua.js +0 -572
  182. package/js/src/coinfalcon.d.ts +0 -53
  183. package/js/src/coinfalcon.js +0 -1013
@@ -1598,6 +1598,8 @@ class gemini extends gemini$1 {
1598
1598
  'currency': code,
1599
1599
  'status': this.parseTransactionStatus(statusRaw),
1600
1600
  'updated': undefined,
1601
+ 'internal': undefined,
1602
+ 'comment': this.safeString(transaction, 'message'),
1601
1603
  'fee': fee,
1602
1604
  };
1603
1605
  }
@@ -1440,6 +1440,9 @@ class hitbtc extends hitbtc$1 {
1440
1440
  const sender = this.safeValue(native, 'senders');
1441
1441
  const addressFrom = this.safeString(sender, 0);
1442
1442
  const amount = this.safeNumber(native, 'amount');
1443
+ const subType = this.safeString(transaction, 'subtype');
1444
+ const internal = subType === 'OFFCHAIN';
1445
+ // https://api.hitbtc.com/#check-if-offchain-is-available
1443
1446
  const fee = {
1444
1447
  'currency': undefined,
1445
1448
  'cost': undefined,
@@ -1469,6 +1472,7 @@ class hitbtc extends hitbtc$1 {
1469
1472
  'tagTo': tagTo,
1470
1473
  'updated': updated,
1471
1474
  'comment': undefined,
1475
+ 'internal': internal,
1472
1476
  'fee': fee,
1473
1477
  };
1474
1478
  }
@@ -1651,6 +1651,8 @@ class hollaex extends hollaex$1 {
1651
1651
  'currency': currency['code'],
1652
1652
  'status': status,
1653
1653
  'updated': updated,
1654
+ 'comment': this.safeString(transaction, 'message'),
1655
+ 'internal': undefined,
1654
1656
  'fee': fee,
1655
1657
  };
1656
1658
  }
@@ -6069,6 +6069,8 @@ class htx extends htx$1 {
6069
6069
  if (networkId === 'ETH' && txHash.indexOf('0x') < 0) {
6070
6070
  txHash = '0x' + txHash;
6071
6071
  }
6072
+ const subType = this.safeString(transaction, 'sub-type');
6073
+ const internal = subType === 'FAST';
6072
6074
  return {
6073
6075
  'info': transaction,
6074
6076
  'id': this.safeString2(transaction, 'id', 'data'),
@@ -6087,6 +6089,8 @@ class htx extends htx$1 {
6087
6089
  'currency': code,
6088
6090
  'status': this.parseTransactionStatus(this.safeString(transaction, 'state')),
6089
6091
  'updated': this.safeInteger(transaction, 'updated-at'),
6092
+ 'comment': undefined,
6093
+ 'internal': internal,
6090
6094
  'fee': {
6091
6095
  'currency': code,
6092
6096
  'cost': this.parseNumber(feeCost),
@@ -1729,6 +1729,8 @@ class huobijp extends huobijp$1 {
1729
1729
  'currency': code,
1730
1730
  'status': this.parseTransactionStatus(this.safeString(transaction, 'state')),
1731
1731
  'updated': this.safeInteger(transaction, 'updated-at'),
1732
+ 'comment': undefined,
1733
+ 'internal': undefined,
1732
1734
  'fee': {
1733
1735
  'currency': code,
1734
1736
  'cost': this.parseNumber(feeCost),
@@ -1674,6 +1674,8 @@ class idex extends idex$1 {
1674
1674
  'currency': code,
1675
1675
  'status': status,
1676
1676
  'updated': updated,
1677
+ 'comment': undefined,
1678
+ 'internal': undefined,
1677
1679
  'fee': fee,
1678
1680
  };
1679
1681
  }
@@ -999,6 +999,7 @@ class indodax extends indodax$1 {
999
999
  'tag': undefined,
1000
1000
  'tagTo': undefined,
1001
1001
  'comment': this.safeString(transaction, 'withdraw_memo'),
1002
+ 'internal': undefined,
1002
1003
  'fee': fee,
1003
1004
  'info': transaction,
1004
1005
  };
@@ -193,12 +193,6 @@ class kraken extends kraken$1 {
193
193
  'WithdrawInfo': 3,
194
194
  'WithdrawStatus': 3,
195
195
  'WalletTransfer': 3,
196
- // staking
197
- 'Stake': 3,
198
- 'Unstake': 3,
199
- 'Staking/Assets': 3,
200
- 'Staking/Pending': 3,
201
- 'Staking/Transactions': 3,
202
196
  // sub accounts
203
197
  'CreateSubaccount': 3,
204
198
  'AccountTransfer': 3,
@@ -492,7 +486,7 @@ class kraken extends kraken$1 {
492
486
  'max': undefined,
493
487
  },
494
488
  'cost': {
495
- 'min': undefined,
489
+ 'min': this.safeNumber(market, 'costmin'),
496
490
  'max': undefined,
497
491
  },
498
492
  },
@@ -1263,7 +1257,7 @@ class kraken extends kraken$1 {
1263
1257
  /**
1264
1258
  * @method
1265
1259
  * @name kraken#createOrder
1266
- * @see https://docs.kraken.com/rest/#tag/User-Trading/operation/addOrder
1260
+ * @see https://docs.kraken.com/rest/#tag/Trading/operation/addOrder
1267
1261
  * @description create a trade order
1268
1262
  * @param {string} symbol unified symbol of the market to create an order in
1269
1263
  * @param {string} type 'market' or 'limit'
@@ -1606,7 +1600,7 @@ class kraken extends kraken$1 {
1606
1600
  * @method
1607
1601
  * @name kraken#editOrder
1608
1602
  * @description edit a trade order
1609
- * @see https://docs.kraken.com/rest/#tag/User-Trading/operation/editOrder
1603
+ * @see https://docs.kraken.com/rest/#tag/Trading/operation/editOrder
1610
1604
  * @param {string} id order id
1611
1605
  * @param {string} symbol unified symbol of the market to create an order in
1612
1606
  * @param {string} type 'market' or 'limit'
@@ -1716,9 +1710,7 @@ class kraken extends kraken$1 {
1716
1710
  if (!(id in result)) {
1717
1711
  throw new errors.OrderNotFound(this.id + ' fetchOrder() could not find order id ' + id);
1718
1712
  }
1719
- const order = this.parseOrder(this.extend({ 'id': id }, result[id]));
1720
- order['info'] = order;
1721
- return order;
1713
+ return this.parseOrder(this.extend({ 'id': id }, result[id]));
1722
1714
  }
1723
1715
  async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
1724
1716
  /**
@@ -2165,6 +2157,8 @@ class kraken extends kraken$1 {
2165
2157
  'txid': txid,
2166
2158
  'timestamp': timestamp,
2167
2159
  'datetime': this.iso8601(timestamp),
2160
+ 'comment': undefined,
2161
+ 'internal': undefined,
2168
2162
  'fee': {
2169
2163
  'currency': code,
2170
2164
  'cost': feeCost,
@@ -2202,6 +2196,9 @@ class kraken extends kraken$1 {
2202
2196
  const request = {
2203
2197
  'asset': currency['id'],
2204
2198
  };
2199
+ if (since !== undefined) {
2200
+ request['start'] = since;
2201
+ }
2205
2202
  const response = await this.privatePostDepositStatus(this.extend(request, params));
2206
2203
  //
2207
2204
  // { error: [],
@@ -2428,7 +2425,7 @@ class kraken extends kraken$1 {
2428
2425
  const request = {
2429
2426
  'asset': currency['id'],
2430
2427
  'amount': amount,
2431
- // 'address': address, // they don't allow withdrawals to direct addresses
2428
+ 'address': address,
2432
2429
  };
2433
2430
  const response = await this.privatePostWithdraw(this.extend(request, params));
2434
2431
  //
@@ -1757,8 +1757,8 @@ class kucoin extends kucoin$1 {
1757
1757
  * @method
1758
1758
  * @name kucoin#fetchOrderBook
1759
1759
  * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
1760
- * @see https://docs.kucoin.com/#get-part-order-book-aggregated
1761
- * @see https://docs.kucoin.com/#get-full-order-book-aggregated
1760
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-part-order-book-aggregated-
1761
+ * @see https://www.kucoin.com/docs/rest/spot-trading/market-data/get-full-order-book-aggregated-
1762
1762
  * @param {string} symbol unified symbol of the market to fetch the order book for
1763
1763
  * @param {int} [limit] the maximum amount of order book entries to return
1764
1764
  * @param {object} [params] extra parameters specific to the kucoin api endpoint
@@ -1768,7 +1768,6 @@ class kucoin extends kucoin$1 {
1768
1768
  const market = this.market(symbol);
1769
1769
  const level = this.safeInteger(params, 'level', 2);
1770
1770
  const request = { 'symbol': market['id'] };
1771
- let method = 'publicGetMarketOrderbookLevelLevelLimit';
1772
1771
  const isAuthenticated = this.checkRequiredCredentials(false);
1773
1772
  let response = undefined;
1774
1773
  if (!isAuthenticated || limit !== undefined) {
@@ -1784,11 +1783,11 @@ class kucoin extends kucoin$1 {
1784
1783
  }
1785
1784
  request['limit'] = limit ? limit : 100;
1786
1785
  }
1786
+ response = await this.publicGetMarketOrderbookLevelLevelLimit(this.extend(request, params));
1787
1787
  }
1788
1788
  else {
1789
- method = 'privateGetMarketOrderbookLevel2'; // recommended (v3)
1789
+ response = await this.privateGetMarketOrderbookLevel2(this.extend(request, params));
1790
1790
  }
1791
- response = await this[method](this.extend(request, params));
1792
1791
  //
1793
1792
  // public (v1) market/orderbook/level2_20 and market/orderbook/level2_100
1794
1793
  //
@@ -3160,6 +3159,7 @@ class kucoin extends kucoin$1 {
3160
3159
  updated = updated * 1000;
3161
3160
  }
3162
3161
  }
3162
+ const internal = this.safeValue(transaction, 'isInner');
3163
3163
  const tag = this.safeString(transaction, 'memo');
3164
3164
  return {
3165
3165
  'info': transaction,
@@ -3179,6 +3179,7 @@ class kucoin extends kucoin$1 {
3179
3179
  'type': type,
3180
3180
  'status': this.parseTransactionStatus(rawStatus),
3181
3181
  'comment': this.safeString(transaction, 'remark'),
3182
+ 'internal': internal,
3182
3183
  'fee': fee,
3183
3184
  'updated': updated,
3184
3185
  };
@@ -1764,6 +1764,7 @@ class kuna extends kuna$1 {
1764
1764
  const type = this.safeStringLower(transaction, 'type');
1765
1765
  const address = this.safeString(transaction, 'address');
1766
1766
  const isDeposit = (type === 'deposit');
1767
+ const parsedType = isDeposit ? type : 'withdrawal';
1767
1768
  return {
1768
1769
  'info': transaction,
1769
1770
  'id': this.safeString(transaction, 'id'),
@@ -1776,13 +1777,14 @@ class kuna extends kuna$1 {
1776
1777
  'address': address,
1777
1778
  'addressTo': address,
1778
1779
  'amount': this.safeNumber(transaction, 'amount'),
1779
- 'type': !isDeposit ? 'withdrawal' : type,
1780
+ 'type': parsedType,
1780
1781
  'status': this.parseTransactionStatus(this.safeString(transaction, 'status')),
1781
1782
  'updated': this.parse8601(this.safeString(transaction, 'updatedAt')),
1782
1783
  'tagFrom': undefined,
1783
1784
  'tag': undefined,
1784
1785
  'tagTo': undefined,
1785
1786
  'comment': this.safeString(transaction, 'memo'),
1787
+ 'internal': undefined,
1786
1788
  'fee': {
1787
1789
  'cost': this.safeNumber(transaction, 'fee'),
1788
1790
  'currency': code,
@@ -1492,6 +1492,7 @@ class latoken extends latoken$1 {
1492
1492
  'status': status,
1493
1493
  'updated': undefined,
1494
1494
  'comment': undefined,
1495
+ 'internal': undefined,
1495
1496
  'fee': fee,
1496
1497
  };
1497
1498
  }
@@ -779,6 +779,7 @@ class lbank extends lbank$1 {
779
779
  'tag': undefined,
780
780
  'tagTo': undefined,
781
781
  'comment': undefined,
782
+ 'internal': undefined,
782
783
  'fee': undefined,
783
784
  'info': transaction,
784
785
  };
@@ -1162,6 +1162,8 @@ class lykke extends lykke$1 {
1162
1162
  'currency': code,
1163
1163
  'status': undefined,
1164
1164
  'updated': undefined,
1165
+ 'internal': undefined,
1166
+ 'comment': undefined,
1165
1167
  'fee': fee,
1166
1168
  };
1167
1169
  }
@@ -710,6 +710,7 @@ class mercado extends mercado$1 {
710
710
  'tag': undefined,
711
711
  'tagTo': undefined,
712
712
  'comment': undefined,
713
+ 'internal': undefined,
713
714
  'fee': undefined,
714
715
  'info': transaction,
715
716
  };
@@ -4538,6 +4538,8 @@ class mexc extends mexc$1 {
4538
4538
  'currency': code,
4539
4539
  'status': status,
4540
4540
  'updated': undefined,
4541
+ 'comment': undefined,
4542
+ 'internal': undefined,
4541
4543
  'fee': fee,
4542
4544
  };
4543
4545
  }
@@ -2264,6 +2264,8 @@ class ndax extends ndax$1 {
2264
2264
  'status': this.parseTransactionStatusByType(transactionStatus, type),
2265
2265
  'updated': updated,
2266
2266
  'fee': fee,
2267
+ 'internal': undefined,
2268
+ 'comment': undefined,
2267
2269
  'network': undefined,
2268
2270
  };
2269
2271
  }
@@ -1421,6 +1421,7 @@ class novadax extends novadax$1 {
1421
1421
  'timestamp': timestamp,
1422
1422
  'datetime': this.iso8601(timestamp),
1423
1423
  'comment': undefined,
1424
+ 'internal': undefined,
1424
1425
  'fee': {
1425
1426
  'currency': undefined,
1426
1427
  'cost': undefined,
@@ -2711,6 +2711,8 @@ class okcoin extends okcoin$1 {
2711
2711
  'txid': txid,
2712
2712
  'timestamp': timestamp,
2713
2713
  'datetime': this.iso8601(timestamp),
2714
+ 'comment': undefined,
2715
+ 'internal': undefined,
2714
2716
  'fee': {
2715
2717
  'currency': code,
2716
2718
  'cost': feeCost,
@@ -4889,6 +4889,8 @@ class okx extends okx$1 {
4889
4889
  'txid': txid,
4890
4890
  'timestamp': timestamp,
4891
4891
  'datetime': this.iso8601(timestamp),
4892
+ 'internal': undefined,
4893
+ 'comment': undefined,
4892
4894
  'fee': {
4893
4895
  'currency': code,
4894
4896
  'cost': feeCost,
@@ -3322,6 +3322,8 @@ class phemex extends phemex$1 {
3322
3322
  'currency': code,
3323
3323
  'status': status,
3324
3324
  'updated': undefined,
3325
+ 'comment': undefined,
3326
+ 'internal': undefined,
3325
3327
  'fee': fee,
3326
3328
  };
3327
3329
  }
@@ -2250,6 +2250,7 @@ class poloniex extends poloniex$1 {
2250
2250
  'timestamp': timestamp,
2251
2251
  'datetime': this.iso8601(timestamp),
2252
2252
  'comment': undefined,
2253
+ 'internal': undefined,
2253
2254
  'fee': {
2254
2255
  'currency': code,
2255
2256
  'cost': this.parseNumber(feeCostString),
@@ -2359,8 +2359,10 @@ class binance extends binance$1 {
2359
2359
  market = this.getMarketFromSymbols(symbols);
2360
2360
  messageHash = '::' + symbols.join(',');
2361
2361
  }
2362
- const defaultType = this.safeString2(this.options, 'watchPositions', 'defaultType', 'future');
2363
- let type = this.safeString(params, 'type', defaultType);
2362
+ let type = this.handleMarketTypeAndParams('watchPositions', market, params);
2363
+ if (type === 'spot' || type === 'margin') {
2364
+ type = 'future';
2365
+ }
2364
2366
  let subType = undefined;
2365
2367
  [subType, params] = this.handleSubTypeAndParams('watchPositions', market, params);
2366
2368
  if (this.isLinear(type, subType)) {
@@ -2505,7 +2507,7 @@ class binance extends binance$1 {
2505
2507
  return this.safePosition({
2506
2508
  'info': position,
2507
2509
  'id': undefined,
2508
- 'symbol': this.safeSymbol(marketId),
2510
+ 'symbol': this.safeSymbol(marketId, undefined, undefined, 'future'),
2509
2511
  'notional': undefined,
2510
2512
  'marginMode': this.safeString(position, 'mt'),
2511
2513
  'liquidationPrice': undefined,
@@ -12,14 +12,23 @@ class coinbase extends coinbase$1 {
12
12
  return this.deepExtend(super.describe(), {
13
13
  'has': {
14
14
  'ws': true,
15
+ 'cancelAllOrdersWs': false,
16
+ 'cancelOrdersWs': false,
17
+ 'cancelOrderWs': false,
18
+ 'createOrderWs': false,
19
+ 'editOrderWs': false,
20
+ 'fetchBalanceWs': false,
21
+ 'fetchOpenOrdersWs': false,
22
+ 'fetchOrderWs': false,
23
+ 'fetchTradesWs': false,
24
+ 'watchBalance': false,
25
+ 'watchMyTrades': false,
15
26
  'watchOHLCV': false,
16
27
  'watchOrderBook': true,
28
+ 'watchOrders': true,
17
29
  'watchTicker': true,
18
30
  'watchTickers': true,
19
31
  'watchTrades': true,
20
- 'watchBalance': false,
21
- 'watchOrders': true,
22
- 'watchMyTrades': false,
23
32
  },
24
33
  'urls': {
25
34
  'api': {
@@ -525,24 +525,24 @@ class cryptocom extends cryptocom$1 {
525
525
  handlePositions(client, message) {
526
526
  //
527
527
  // {
528
- // subscription: "user.position_balance",
529
- // channel: "user.position_balance",
530
- // data: [{
531
- // balances: [{
532
- // instrument_name: "USD",
533
- // quantity: "8.9979961950886",
534
- // update_timestamp_ms: 1695598760597,
528
+ // "subscription": "user.position_balance",
529
+ // "channel": "user.position_balance",
530
+ // "data": [{
531
+ // "balances": [{
532
+ // "instrument_name": "USD",
533
+ // "quantity": "8.9979961950886",
534
+ // "update_timestamp_ms": 1695598760597,
535
535
  // }],
536
- // positions: [{
537
- // account_id: "96a0edb1-afb5-4c7c-af89-5cb610319e2c",
538
- // instrument_name: "LTCUSD-PERP",
539
- // type: "PERPETUAL_SWAP",
540
- // quantity: "1.8",
541
- // cost: "114.766",
542
- // open_position_pnl: "-0.0216206",
543
- // session_pnl: "0.00962994",
544
- // update_timestamp_ms: 1695598760597,
545
- // open_pos_cost: "114.766",
536
+ // "positions": [{
537
+ // "account_id": "96a0edb1-afb5-4c7c-af89-5cb610319e2c",
538
+ // "instrument_name": "LTCUSD-PERP",
539
+ // "type": "PERPETUAL_SWAP",
540
+ // "quantity": "1.8",
541
+ // "cost": "114.766",
542
+ // "open_position_pnl": "-0.0216206",
543
+ // "session_pnl": "0.00962994",
544
+ // "update_timestamp_ms": 1695598760597,
545
+ // "open_pos_cost": "114.766",
546
546
  // }],
547
547
  // }],
548
548
  // }
@@ -612,6 +612,25 @@ class krakenfutures extends krakenfutures$1 {
612
612
  // "reason": "cancelled_by_user"
613
613
  // }
614
614
  //
615
+ // {
616
+ // "feed": 'open_orders',
617
+ // "order": {
618
+ // "instrument": 'PF_XBTUSD',
619
+ // "time": 1698159920097,
620
+ // "last_update_time": 1699835622988,
621
+ // "qty": 1.1,
622
+ // "filled": 0,
623
+ // "limit_price": 20000,
624
+ // "stop_price": 0,
625
+ // "type": 'limit',
626
+ // "order_id": '0eaf02b0-855d-4451-a3b7-e2b3070c1fa4',
627
+ // "direction": 0,
628
+ // "reduce_only": false
629
+ // },
630
+ // "is_cancel": false,
631
+ // "reason": 'edited_by_user'
632
+ // }
633
+ //
615
634
  let orders = this.orders;
616
635
  if (orders === undefined) {
617
636
  const limit = this.safeInteger(this.options, 'ordersLimit');
@@ -626,7 +645,8 @@ class krakenfutures extends krakenfutures$1 {
626
645
  const orderId = this.safeString(order, 'order_id');
627
646
  const previousOrders = this.safeValue(orders.hashmap, symbol, {});
628
647
  const previousOrder = this.safeValue(previousOrders, orderId);
629
- if (previousOrder === undefined) {
648
+ const reason = this.safeString(message, 'reason');
649
+ if ((previousOrder === undefined) || (reason === 'edited_by_user')) {
630
650
  const parsed = this.parseWsOrder(order);
631
651
  orders.append(parsed);
632
652
  client.resolve(orders, messageHash);
@@ -652,9 +672,10 @@ class krakenfutures extends krakenfutures$1 {
652
672
  }
653
673
  previousOrder['cost'] = totalCost;
654
674
  if (previousOrder['filled'] !== undefined) {
655
- previousOrder['filled'] = Precise["default"].stringAdd(previousOrder['filled'], this.numberToString(trade['amount']));
675
+ const stringOrderFilled = this.numberToString(previousOrder['filled']);
676
+ previousOrder['filled'] = Precise["default"].stringAdd(stringOrderFilled, this.numberToString(trade['amount']));
656
677
  if (previousOrder['amount'] !== undefined) {
657
- previousOrder['remaining'] = Precise["default"].stringSub(previousOrder['amount'], previousOrder['filled']);
678
+ previousOrder['remaining'] = Precise["default"].stringSub(this.numberToString(previousOrder['amount']), stringOrderFilled);
658
679
  }
659
680
  }
660
681
  if (previousOrder['fee'] === undefined) {
@@ -302,8 +302,8 @@ class probit extends probit$1 {
302
302
  'option': false,
303
303
  'active': !closed,
304
304
  'contract': false,
305
- 'linear': undefined,
306
- 'inverse': undefined,
305
+ 'linear': 'rfwf',
306
+ 'inverse': 3,
307
307
  'taker': this.parseNumber(taker),
308
308
  'maker': this.parseNumber(maker),
309
309
  'contractSize': undefined,
@@ -1594,6 +1594,8 @@ class probit extends probit$1 {
1594
1594
  'timestamp': timestamp,
1595
1595
  'datetime': this.iso8601(timestamp),
1596
1596
  'updated': undefined,
1597
+ 'internal': undefined,
1598
+ 'comment': undefined,
1597
1599
  'fee': fee,
1598
1600
  'info': transaction,
1599
1601
  };
@@ -963,6 +963,7 @@ class tidex extends tidex$1 {
963
963
  'tag': undefined,
964
964
  'tagTo': undefined,
965
965
  'comment': undefined,
966
+ 'internal': undefined,
966
967
  'fee': undefined,
967
968
  'info': transaction,
968
969
  };
@@ -452,6 +452,8 @@ class timex extends timex$1 {
452
452
  'currency': this.safeCurrencyCode(undefined, currency),
453
453
  'status': 'ok',
454
454
  'updated': undefined,
455
+ 'internal': undefined,
456
+ 'comment': undefined,
455
457
  'fee': undefined,
456
458
  };
457
459
  }
@@ -1307,6 +1307,8 @@ class upbit extends upbit$1 {
1307
1307
  'txid': txid,
1308
1308
  'timestamp': timestamp,
1309
1309
  'datetime': this.iso8601(timestamp),
1310
+ 'internal': undefined,
1311
+ 'comment': undefined,
1310
1312
  'fee': {
1311
1313
  'currency': code,
1312
1314
  'cost': feeCost,
@@ -18,7 +18,7 @@ class wavesexchange extends wavesexchange$1 {
18
18
  'id': 'wavesexchange',
19
19
  'name': 'Waves.Exchange',
20
20
  'countries': ['CH'],
21
- 'certified': true,
21
+ 'certified': false,
22
22
  'pro': false,
23
23
  'has': {
24
24
  'CORS': undefined,
@@ -2592,6 +2592,7 @@ class wavesexchange extends wavesexchange$1 {
2592
2592
  'tag': undefined,
2593
2593
  'tagTo': undefined,
2594
2594
  'comment': undefined,
2595
+ 'internal': undefined,
2595
2596
  'fee': undefined,
2596
2597
  'info': transaction,
2597
2598
  };
@@ -1818,6 +1818,7 @@ class whitebit extends whitebit$1 {
1818
1818
  'tag': undefined,
1819
1819
  'tagTo': undefined,
1820
1820
  'comment': this.safeString(transaction, 'description'),
1821
+ 'internal': undefined,
1821
1822
  'fee': {
1822
1823
  'cost': this.safeNumber(transaction, 'fee'),
1823
1824
  'currency': this.safeCurrencyCode(currencyId, currency),
@@ -1894,6 +1894,7 @@ class woo extends woo$1 {
1894
1894
  'status': this.parseTransactionStatus(this.safeString(transaction, 'status')),
1895
1895
  'updated': this.safeTimestamp(transaction, 'updated_time'),
1896
1896
  'comment': undefined,
1897
+ 'internal': undefined,
1897
1898
  'fee': fee,
1898
1899
  'network': undefined,
1899
1900
  };
@@ -684,6 +684,7 @@ class zaif extends zaif$1 {
684
684
  'tag': undefined,
685
685
  'tagTo': undefined,
686
686
  'comment': undefined,
687
+ 'internal': undefined,
687
688
  'fee': fee,
688
689
  'info': transaction,
689
690
  };
@@ -1767,6 +1767,7 @@ class zonda extends zonda$1 {
1767
1767
  'tag': undefined,
1768
1768
  'tagTo': undefined,
1769
1769
  'comment': undefined,
1770
+ 'internal': undefined,
1770
1771
  'fee': undefined,
1771
1772
  'info': transaction,
1772
1773
  };