ccxt 4.4.41__py2.py3-none-any.whl → 4.4.42__py2.py3-none-any.whl

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 (162) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/binance.py +3 -0
  3. ccxt/abstract/binancecoinm.py +3 -0
  4. ccxt/abstract/binanceus.py +3 -0
  5. ccxt/abstract/binanceusdm.py +3 -0
  6. ccxt/ace.py +1 -1
  7. ccxt/alpaca.py +0 -1
  8. ccxt/ascendex.py +0 -1
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/ace.py +1 -1
  11. ccxt/async_support/alpaca.py +0 -1
  12. ccxt/async_support/ascendex.py +0 -1
  13. ccxt/async_support/base/exchange.py +15 -15
  14. ccxt/async_support/bigone.py +0 -1
  15. ccxt/async_support/binance.py +3 -0
  16. ccxt/async_support/bingx.py +2 -0
  17. ccxt/async_support/bitfinex.py +122 -0
  18. ccxt/async_support/blofin.py +16 -7
  19. ccxt/async_support/cex.py +1 -1
  20. ccxt/async_support/coinbase.py +8 -9
  21. ccxt/async_support/coinbaseexchange.py +5 -6
  22. ccxt/async_support/coinbaseinternational.py +7 -8
  23. ccxt/async_support/coincatch.py +0 -1
  24. ccxt/async_support/coincheck.py +0 -1
  25. ccxt/async_support/coinex.py +91 -6
  26. ccxt/async_support/coinlist.py +3 -4
  27. ccxt/async_support/coinmate.py +1 -3
  28. ccxt/async_support/coinmetro.py +4 -5
  29. ccxt/async_support/coinone.py +0 -1
  30. ccxt/async_support/coinsph.py +7 -8
  31. ccxt/async_support/cryptocom.py +3 -0
  32. ccxt/async_support/currencycom.py +3 -4
  33. ccxt/async_support/defx.py +6 -7
  34. ccxt/async_support/deribit.py +1 -3
  35. ccxt/async_support/digifinex.py +0 -1
  36. ccxt/async_support/ellipx.py +0 -2
  37. ccxt/async_support/exmo.py +1 -2
  38. ccxt/async_support/gate.py +1 -2
  39. ccxt/async_support/gemini.py +4 -5
  40. ccxt/async_support/hashkey.py +79 -67
  41. ccxt/async_support/hitbtc.py +47 -5
  42. ccxt/async_support/hollaex.py +4 -6
  43. ccxt/async_support/htx.py +1 -3
  44. ccxt/async_support/huobijp.py +0 -1
  45. ccxt/async_support/idex.py +8 -8
  46. ccxt/async_support/independentreserve.py +0 -1
  47. ccxt/async_support/indodax.py +0 -1
  48. ccxt/async_support/kraken.py +63 -3
  49. ccxt/async_support/krakenfutures.py +75 -3
  50. ccxt/async_support/kucoin.py +1 -3
  51. ccxt/async_support/kucoinfutures.py +10 -9
  52. ccxt/async_support/kuna.py +1 -3
  53. ccxt/async_support/latoken.py +1 -3
  54. ccxt/async_support/lbank.py +0 -1
  55. ccxt/async_support/luno.py +0 -1
  56. ccxt/async_support/lykke.py +0 -1
  57. ccxt/async_support/mercado.py +0 -1
  58. ccxt/async_support/mexc.py +3 -4
  59. ccxt/async_support/ndax.py +1 -1
  60. ccxt/async_support/novadax.py +4 -6
  61. ccxt/async_support/oceanex.py +0 -1
  62. ccxt/async_support/okcoin.py +1 -3
  63. ccxt/async_support/okx.py +1 -3
  64. ccxt/async_support/onetrading.py +1 -3
  65. ccxt/async_support/p2b.py +1 -1
  66. ccxt/async_support/paradex.py +5 -7
  67. ccxt/async_support/phemex.py +8 -10
  68. ccxt/async_support/poloniex.py +1 -3
  69. ccxt/async_support/poloniexfutures.py +6 -6
  70. ccxt/async_support/probit.py +0 -1
  71. ccxt/async_support/timex.py +0 -1
  72. ccxt/async_support/tokocrypto.py +11 -14
  73. ccxt/async_support/tradeogre.py +1 -1
  74. ccxt/async_support/upbit.py +0 -1
  75. ccxt/async_support/wavesexchange.py +4 -5
  76. ccxt/async_support/whitebit.py +8 -9
  77. ccxt/async_support/woo.py +98 -12
  78. ccxt/async_support/woofipro.py +96 -15
  79. ccxt/async_support/xt.py +3 -2
  80. ccxt/async_support/yobit.py +0 -1
  81. ccxt/async_support/zaif.py +0 -1
  82. ccxt/async_support/zonda.py +1 -2
  83. ccxt/base/exchange.py +21 -17
  84. ccxt/bigone.py +0 -1
  85. ccxt/binance.py +3 -0
  86. ccxt/bingx.py +2 -0
  87. ccxt/bitfinex.py +122 -0
  88. ccxt/blofin.py +16 -7
  89. ccxt/cex.py +1 -1
  90. ccxt/coinbase.py +8 -9
  91. ccxt/coinbaseexchange.py +5 -6
  92. ccxt/coinbaseinternational.py +7 -8
  93. ccxt/coincatch.py +0 -1
  94. ccxt/coincheck.py +0 -1
  95. ccxt/coinex.py +91 -6
  96. ccxt/coinlist.py +3 -4
  97. ccxt/coinmate.py +1 -3
  98. ccxt/coinmetro.py +4 -5
  99. ccxt/coinone.py +0 -1
  100. ccxt/coinsph.py +7 -8
  101. ccxt/cryptocom.py +3 -0
  102. ccxt/currencycom.py +3 -4
  103. ccxt/defx.py +6 -7
  104. ccxt/deribit.py +1 -3
  105. ccxt/digifinex.py +0 -1
  106. ccxt/ellipx.py +0 -2
  107. ccxt/exmo.py +1 -2
  108. ccxt/gate.py +1 -2
  109. ccxt/gemini.py +4 -5
  110. ccxt/hashkey.py +79 -67
  111. ccxt/hitbtc.py +47 -5
  112. ccxt/hollaex.py +4 -6
  113. ccxt/htx.py +1 -3
  114. ccxt/huobijp.py +0 -1
  115. ccxt/idex.py +8 -8
  116. ccxt/independentreserve.py +0 -1
  117. ccxt/indodax.py +0 -1
  118. ccxt/kraken.py +63 -3
  119. ccxt/krakenfutures.py +75 -3
  120. ccxt/kucoin.py +1 -3
  121. ccxt/kucoinfutures.py +10 -9
  122. ccxt/kuna.py +1 -3
  123. ccxt/latoken.py +1 -3
  124. ccxt/lbank.py +0 -1
  125. ccxt/luno.py +0 -1
  126. ccxt/lykke.py +0 -1
  127. ccxt/mercado.py +0 -1
  128. ccxt/mexc.py +3 -4
  129. ccxt/ndax.py +1 -1
  130. ccxt/novadax.py +4 -6
  131. ccxt/oceanex.py +0 -1
  132. ccxt/okcoin.py +1 -3
  133. ccxt/okx.py +1 -3
  134. ccxt/onetrading.py +1 -3
  135. ccxt/p2b.py +1 -1
  136. ccxt/paradex.py +5 -7
  137. ccxt/phemex.py +8 -10
  138. ccxt/poloniex.py +1 -3
  139. ccxt/poloniexfutures.py +6 -6
  140. ccxt/pro/__init__.py +1 -1
  141. ccxt/probit.py +0 -1
  142. ccxt/timex.py +0 -1
  143. ccxt/tokocrypto.py +11 -14
  144. ccxt/tradeogre.py +1 -1
  145. ccxt/upbit.py +0 -1
  146. ccxt/wavesexchange.py +4 -5
  147. ccxt/whitebit.py +8 -9
  148. ccxt/woo.py +98 -12
  149. ccxt/woofipro.py +96 -15
  150. ccxt/xt.py +3 -2
  151. ccxt/yobit.py +0 -1
  152. ccxt/zaif.py +0 -1
  153. ccxt/zonda.py +1 -2
  154. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/METADATA +5 -5
  155. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/RECORD +158 -162
  156. ccxt/bitbay.py +0 -17
  157. ccxt/bitfinex2.py +0 -3624
  158. ccxt/hitbtc3.py +0 -16
  159. ccxt/pro/bitfinex2.py +0 -1086
  160. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/LICENSE.txt +0 -0
  161. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/WHEEL +0 -0
  162. {ccxt-4.4.41.dist-info → ccxt-4.4.42.dist-info}/top_level.txt +0 -0
@@ -1536,8 +1536,6 @@ class tokocrypto(Exchange, ImplicitAPI):
1536
1536
  # GTX means "Good Till Crossing" and is an equivalent way of saying Post Only
1537
1537
  timeInForce = 'PO'
1538
1538
  postOnly = (type == 'limit_maker') or (timeInForce == 'PO')
1539
- stopPriceString = self.safe_string(order, 'stopPrice')
1540
- stopPrice = self.parse_number(self.omit_zero(stopPriceString))
1541
1539
  return self.safe_order({
1542
1540
  'info': order,
1543
1541
  'id': id,
@@ -1552,8 +1550,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1552
1550
  'reduceOnly': self.safe_value(order, 'reduceOnly'),
1553
1551
  'side': side,
1554
1552
  'price': price,
1555
- 'stopPrice': stopPrice,
1556
- 'triggerPrice': stopPrice,
1553
+ 'triggerPrice': self.parse_number(self.omit_zero(self.safe_string(order, 'stopPrice'))),
1557
1554
  'amount': amount,
1558
1555
  'cost': cost,
1559
1556
  'average': average,
@@ -1600,8 +1597,8 @@ class tokocrypto(Exchange, ImplicitAPI):
1600
1597
  params = self.omit(params, ['clientId', 'clientOrderId'])
1601
1598
  initialUppercaseType = type.upper()
1602
1599
  uppercaseType = initialUppercaseType
1603
- stopPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
1604
- if stopPrice is not None:
1600
+ triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
1601
+ if triggerPrice is not None:
1605
1602
  params = self.omit(params, ['triggerPrice', 'stopPrice'])
1606
1603
  if uppercaseType == 'MARKET':
1607
1604
  uppercaseType = 'STOP_LOSS'
@@ -1610,7 +1607,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1610
1607
  validOrderTypes = self.safe_value(market['info'], 'orderTypes')
1611
1608
  if not self.in_array(uppercaseType, validOrderTypes):
1612
1609
  if initialUppercaseType != uppercaseType:
1613
- raise InvalidOrder(self.id + ' stopPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders')
1610
+ raise InvalidOrder(self.id + ' triggerPrice parameter is not allowed for ' + symbol + ' ' + type + ' orders')
1614
1611
  else:
1615
1612
  raise InvalidOrder(self.id + ' ' + type + ' is not a valid order type for the ' + symbol + ' market')
1616
1613
  reverseOrderTypeMapping: dict = {
@@ -1640,7 +1637,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1640
1637
  request['clientId'] = clientOrderId
1641
1638
  # additional required fields depending on the order type
1642
1639
  priceIsRequired = False
1643
- stopPriceIsRequired = False
1640
+ triggerPriceIsRequired = False
1644
1641
  quantityIsRequired = False
1645
1642
  #
1646
1643
  # spot/margin
@@ -1679,13 +1676,13 @@ class tokocrypto(Exchange, ImplicitAPI):
1679
1676
  priceIsRequired = True
1680
1677
  quantityIsRequired = True
1681
1678
  elif (uppercaseType == 'STOP_LOSS') or (uppercaseType == 'TAKE_PROFIT'):
1682
- stopPriceIsRequired = True
1679
+ triggerPriceIsRequired = True
1683
1680
  quantityIsRequired = True
1684
1681
  if market['linear'] or market['inverse']:
1685
1682
  priceIsRequired = True
1686
1683
  elif (uppercaseType == 'STOP_LOSS_LIMIT') or (uppercaseType == 'TAKE_PROFIT_LIMIT'):
1687
1684
  quantityIsRequired = True
1688
- stopPriceIsRequired = True
1685
+ triggerPriceIsRequired = True
1689
1686
  priceIsRequired = True
1690
1687
  elif uppercaseType == 'LIMIT_MAKER':
1691
1688
  priceIsRequired = True
@@ -1696,11 +1693,11 @@ class tokocrypto(Exchange, ImplicitAPI):
1696
1693
  if price is None:
1697
1694
  raise InvalidOrder(self.id + ' createOrder() requires a price argument for a ' + type + ' order')
1698
1695
  request['price'] = self.price_to_precision(symbol, price)
1699
- if stopPriceIsRequired:
1700
- if stopPrice is None:
1701
- raise InvalidOrder(self.id + ' createOrder() requires a stopPrice extra param for a ' + type + ' order')
1696
+ if triggerPriceIsRequired:
1697
+ if triggerPrice is None:
1698
+ raise InvalidOrder(self.id + ' createOrder() requires a triggerPrice extra param for a ' + type + ' order')
1702
1699
  else:
1703
- request['stopPrice'] = self.price_to_precision(symbol, stopPrice)
1700
+ request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
1704
1701
  response = await self.privatePostOpenV1Orders(self.extend(request, params))
1705
1702
  #
1706
1703
  # {
@@ -561,7 +561,7 @@ class tradeogre(Exchange, ImplicitAPI):
561
561
  'postOnly': None,
562
562
  'side': self.safe_string(order, 'type'),
563
563
  'price': self.safe_string(order, 'price'),
564
- 'stopPrice': None,
564
+ 'triggerPrice': None,
565
565
  'amount': self.safe_string(order, 'quantity'),
566
566
  'cost': None,
567
567
  'average': None,
@@ -1513,7 +1513,6 @@ class upbit(Exchange, ImplicitAPI):
1513
1513
  'postOnly': None,
1514
1514
  'side': side,
1515
1515
  'price': price,
1516
- 'stopPrice': None,
1517
1516
  'triggerPrice': None,
1518
1517
  'cost': self.parse_number(cost),
1519
1518
  'average': self.parse_number(average),
@@ -1244,7 +1244,7 @@ class wavesexchange(Exchange, ImplicitAPI):
1244
1244
  :param float amount: how much of currency you want to trade in units of base currency
1245
1245
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
1246
1246
  :param dict [params]: extra parameters specific to the exchange API endpoint
1247
- :param float [params.stopPrice]: The price at which a stop order is triggered at
1247
+ :param float [params.triggerPrice]: The price at which a stop order is triggered at
1248
1248
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
1249
1249
  """
1250
1250
  self.check_required_dependencies()
@@ -1255,8 +1255,8 @@ class wavesexchange(Exchange, ImplicitAPI):
1255
1255
  amountAsset = self.get_asset_id(market['baseId'])
1256
1256
  priceAsset = self.get_asset_id(market['quoteId'])
1257
1257
  isMarketOrder = (type == 'market')
1258
- stopPrice = self.safe_float_2(params, 'triggerPrice', 'stopPrice')
1259
- isStopOrder = (stopPrice is not None)
1258
+ triggerPrice = self.safe_float_2(params, 'triggerPrice', 'stopPrice')
1259
+ isStopOrder = (triggerPrice is not None)
1260
1260
  if (isMarketOrder) and (price is None):
1261
1261
  raise InvalidOrder(self.id + ' createOrder() requires a price argument for ' + type + ' orders to determine the max price for buy and the min price for sell')
1262
1262
  timestamp = self.milliseconds()
@@ -1352,7 +1352,7 @@ class wavesexchange(Exchange, ImplicitAPI):
1352
1352
  'c': {
1353
1353
  't': 'sp',
1354
1354
  'v': {
1355
- 'p': self.to_real_symbol_price(symbol, stopPrice),
1355
+ 'p': self.to_real_symbol_price(symbol, triggerPrice),
1356
1356
  },
1357
1357
  },
1358
1358
  }
@@ -1726,7 +1726,6 @@ class wavesexchange(Exchange, ImplicitAPI):
1726
1726
  'postOnly': None,
1727
1727
  'side': side,
1728
1728
  'price': price,
1729
- 'stopPrice': triggerPrice,
1730
1729
  'triggerPrice': triggerPrice,
1731
1730
  'amount': amount,
1732
1731
  'cost': None,
@@ -1275,8 +1275,8 @@ class whitebit(Exchange, ImplicitAPI):
1275
1275
  marketType = self.safe_string(market, 'type')
1276
1276
  isLimitOrder = type == 'limit'
1277
1277
  isMarketOrder = type == 'market'
1278
- stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
1279
- isStopOrder = (stopPrice is not None)
1278
+ triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
1279
+ isStopOrder = (triggerPrice is not None)
1280
1280
  postOnly = self.is_post_only(isMarketOrder, False, params)
1281
1281
  marginMode, query = self.handle_margin_mode_and_params('createOrder', params)
1282
1282
  if postOnly:
@@ -1287,7 +1287,7 @@ class whitebit(Exchange, ImplicitAPI):
1287
1287
  useCollateralEndpoint = marginMode is not None or marketType == 'swap'
1288
1288
  response = None
1289
1289
  if isStopOrder:
1290
- request['activation_price'] = self.price_to_precision(symbol, stopPrice)
1290
+ request['activation_price'] = self.price_to_precision(symbol, triggerPrice)
1291
1291
  if isLimitOrder:
1292
1292
  # stop limit order
1293
1293
  request['price'] = self.price_to_precision(symbol, price)
@@ -1347,11 +1347,11 @@ class whitebit(Exchange, ImplicitAPI):
1347
1347
  # Update clientOrderId of the order
1348
1348
  request['clientOrderId'] = clientOrderId
1349
1349
  isLimitOrder = type == 'limit'
1350
- stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
1351
- isStopOrder = (stopPrice is not None)
1350
+ triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'activation_price'])
1351
+ isStopOrder = (triggerPrice is not None)
1352
1352
  params = self.omit(params, ['clOrdId', 'clientOrderId', 'triggerPrice', 'stopPrice'])
1353
1353
  if isStopOrder:
1354
- request['activation_price'] = self.price_to_precision(symbol, stopPrice)
1354
+ request['activation_price'] = self.price_to_precision(symbol, triggerPrice)
1355
1355
  if isLimitOrder:
1356
1356
  # stop limit order
1357
1357
  request['amount'] = self.amount_to_precision(symbol, amount)
@@ -1714,7 +1714,7 @@ class whitebit(Exchange, ImplicitAPI):
1714
1714
  if clientOrderId == '':
1715
1715
  clientOrderId = None
1716
1716
  price = self.safe_string(order, 'price')
1717
- stopPrice = self.safe_number(order, 'activation_price')
1717
+ triggerPrice = self.safe_number(order, 'activation_price')
1718
1718
  orderId = self.safe_string_2(order, 'orderId', 'id')
1719
1719
  type = self.safe_string(order, 'type')
1720
1720
  orderType = self.parse_order_type(type)
@@ -1747,8 +1747,7 @@ class whitebit(Exchange, ImplicitAPI):
1747
1747
  'side': side,
1748
1748
  'price': price,
1749
1749
  'type': orderType,
1750
- 'stopPrice': stopPrice,
1751
- 'triggerPrice': stopPrice,
1750
+ 'triggerPrice': triggerPrice,
1752
1751
  'amount': amount,
1753
1752
  'filled': filled,
1754
1753
  'remaining': remaining,
ccxt/async_support/woo.py CHANGED
@@ -321,6 +321,92 @@ class woo(Exchange, ImplicitAPI):
321
321
  },
322
322
  'brokerId': 'bc830de7-50f3-460b-9ee0-f430f83f9dad',
323
323
  },
324
+ 'features': {
325
+ 'default': {
326
+ 'sandbox': True,
327
+ 'createOrder': {
328
+ 'marginMode': True,
329
+ 'triggerPrice': True,
330
+ 'triggerPriceType': {
331
+ 'last': True,
332
+ 'mark': True,
333
+ 'index': False,
334
+ },
335
+ 'triggerDirection': False,
336
+ 'stopLossPrice': False, # todo by triggerPrice
337
+ 'takeProfitPrice': False, # todo by triggerPrice
338
+ 'attachedStopLossTakeProfit': None,
339
+ 'timeInForce': {
340
+ 'IOC': True,
341
+ 'FOK': True,
342
+ 'PO': True,
343
+ 'GTD': True,
344
+ },
345
+ 'hedged': False,
346
+ 'trailing': True,
347
+ # exchange specific params:
348
+ # 'iceberg': True,
349
+ # 'oco': True,
350
+ },
351
+ 'createOrders': None,
352
+ 'fetchMyTrades': {
353
+ 'marginMode': False,
354
+ 'limit': 500,
355
+ 'daysBack': 90,
356
+ 'untilDays': 10000,
357
+ },
358
+ 'fetchOrder': {
359
+ 'marginMode': False,
360
+ 'trigger': True,
361
+ 'trailing': False,
362
+ },
363
+ 'fetchOpenOrders': {
364
+ 'marginMode': False,
365
+ 'limit': 500,
366
+ 'trigger': True,
367
+ 'trailing': True,
368
+ },
369
+ 'fetchOrders': {
370
+ 'marginMode': False,
371
+ 'limit': 500,
372
+ 'daysBack': None,
373
+ 'untilDays': 100000,
374
+ 'trigger': True,
375
+ 'trailing': True,
376
+ },
377
+ 'fetchClosedOrders': {
378
+ 'marginMode': False,
379
+ 'limit': 500,
380
+ 'daysBackClosed': None,
381
+ 'daysBackCanceled': None,
382
+ 'untilDays': 100000,
383
+ 'trigger': True,
384
+ 'trailing': True,
385
+ },
386
+ 'fetchOHLCV': {
387
+ 'limit': 1000,
388
+ },
389
+ },
390
+ 'spot': {
391
+ 'extends': 'default',
392
+ },
393
+ 'forSwap': {
394
+ 'extends': 'default',
395
+ 'createOrder': {
396
+ 'hedged': True,
397
+ },
398
+ },
399
+ 'swap': {
400
+ 'linear': {
401
+ 'extends': 'forSwap',
402
+ },
403
+ 'inverse': None,
404
+ },
405
+ 'future': {
406
+ 'linear': None,
407
+ 'inverse': None,
408
+ },
409
+ },
324
410
  'commonCurrencies': {},
325
411
  'exceptions': {
326
412
  'exact': {
@@ -965,7 +1051,7 @@ class woo(Exchange, ImplicitAPI):
965
1051
  marginMode, params = self.handle_margin_mode_and_params('createOrder', params)
966
1052
  if marginMode is not None:
967
1053
  request['margin_mode'] = self.encode_margin_mode(marginMode)
968
- stopPrice = self.safe_number_2(params, 'triggerPrice', 'stopPrice')
1054
+ triggerPrice = self.safe_number_2(params, 'triggerPrice', 'stopPrice')
969
1055
  stopLoss = self.safe_value(params, 'stopLoss')
970
1056
  takeProfit = self.safe_value(params, 'takeProfit')
971
1057
  algoType = self.safe_string(params, 'algoType')
@@ -975,7 +1061,7 @@ class woo(Exchange, ImplicitAPI):
975
1061
  isTrailingAmountOrder = trailingAmount is not None
976
1062
  isTrailingPercentOrder = trailingPercent is not None
977
1063
  isTrailing = isTrailingAmountOrder or isTrailingPercentOrder
978
- isConditional = isTrailing or stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1064
+ isConditional = isTrailing or triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
979
1065
  isMarket = orderType == 'MARKET'
980
1066
  timeInForce = self.safe_string_lower(params, 'timeInForce')
981
1067
  postOnly = self.is_post_only(isMarket, None, params)
@@ -1028,9 +1114,9 @@ class woo(Exchange, ImplicitAPI):
1028
1114
  elif isTrailingPercentOrder:
1029
1115
  convertedTrailingPercent = Precise.string_div(trailingPercent, '100')
1030
1116
  request['callbackRate'] = convertedTrailingPercent
1031
- elif stopPrice is not None:
1117
+ elif triggerPrice is not None:
1032
1118
  if algoType != 'TRAILING_STOP':
1033
- request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
1119
+ request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
1034
1120
  request['algoType'] = 'STOP'
1035
1121
  elif (stopLoss is not None) or (takeProfit is not None):
1036
1122
  request['algoType'] = 'BRACKET'
@@ -1145,9 +1231,9 @@ class woo(Exchange, ImplicitAPI):
1145
1231
  clientOrderIdUnified = self.safe_string_2(params, 'clOrdID', 'clientOrderId')
1146
1232
  clientOrderIdExchangeSpecific = self.safe_string(params, 'client_order_id', clientOrderIdUnified)
1147
1233
  isByClientOrder = clientOrderIdExchangeSpecific is not None
1148
- stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
1149
- if stopPrice is not None:
1150
- request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
1234
+ triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
1235
+ if triggerPrice is not None:
1236
+ request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
1151
1237
  trailingTriggerPrice = self.safe_string_2(params, 'trailingTriggerPrice', 'activatedPrice', self.number_to_string(price))
1152
1238
  trailingAmount = self.safe_string_2(params, 'trailingAmount', 'callbackValue')
1153
1239
  trailingPercent = self.safe_string_2(params, 'trailingPercent', 'callbackRate')
@@ -1163,7 +1249,7 @@ class woo(Exchange, ImplicitAPI):
1163
1249
  convertedTrailingPercent = Precise.string_div(trailingPercent, '100')
1164
1250
  request['callbackRate'] = convertedTrailingPercent
1165
1251
  params = self.omit(params, ['clOrdID', 'clientOrderId', 'client_order_id', 'stopPrice', 'triggerPrice', 'takeProfitPrice', 'stopLossPrice', 'trailingTriggerPrice', 'trailingAmount', 'trailingPercent'])
1166
- isConditional = isTrailing or (stopPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
1252
+ isConditional = isTrailing or (triggerPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
1167
1253
  response = None
1168
1254
  if isByClientOrder:
1169
1255
  request['client_order_id'] = clientOrderIdExchangeSpecific
@@ -1570,7 +1656,7 @@ class woo(Exchange, ImplicitAPI):
1570
1656
  fee = self.safe_number_2(order, 'total_fee', 'totalFee')
1571
1657
  feeCurrency = self.safe_string_2(order, 'fee_asset', 'feeAsset')
1572
1658
  transactions = self.safe_value(order, 'Transactions')
1573
- stopPrice = self.safe_number(order, 'triggerPrice')
1659
+ triggerPrice = self.safe_number(order, 'triggerPrice')
1574
1660
  takeProfitPrice: Num = None
1575
1661
  stopLossPrice: Num = None
1576
1662
  childOrders = self.safe_value(order, 'childOrders')
@@ -1599,8 +1685,7 @@ class woo(Exchange, ImplicitAPI):
1599
1685
  'reduceOnly': self.safe_bool(order, 'reduce_only'),
1600
1686
  'side': side,
1601
1687
  'price': price,
1602
- 'stopPrice': stopPrice,
1603
- 'triggerPrice': stopPrice,
1688
+ 'triggerPrice': triggerPrice,
1604
1689
  'takeProfitPrice': takeProfitPrice,
1605
1690
  'stopLossPrice': stopLossPrice,
1606
1691
  'average': average,
@@ -1808,7 +1893,7 @@ class woo(Exchange, ImplicitAPI):
1808
1893
  """
1809
1894
  fetch all trades made by the user
1810
1895
 
1811
- https://docs.woox.io/#get-trades
1896
+ https://docs.woox.io/#get-trade-history
1812
1897
 
1813
1898
  :param str symbol: unified market symbol
1814
1899
  :param int [since]: the earliest time in ms to fetch trades for
@@ -1829,6 +1914,7 @@ class woo(Exchange, ImplicitAPI):
1829
1914
  request['symbol'] = market['id']
1830
1915
  if since is not None:
1831
1916
  request['start_t'] = since
1917
+ request, params = self.handle_until_option('end_t', request, params)
1832
1918
  if limit is not None:
1833
1919
  request['size'] = limit
1834
1920
  else:
@@ -308,6 +308,88 @@ class woofipro(Exchange, ImplicitAPI):
308
308
  'brokerId': 'CCXT',
309
309
  'verifyingContractAddress': '0x6F7a338F2aA472838dEFD3283eB360d4Dff5D203',
310
310
  },
311
+ 'features': {
312
+ 'default': {
313
+ 'sandbox': True,
314
+ 'createOrder': {
315
+ 'marginMode': False,
316
+ 'triggerPrice': True,
317
+ 'triggerPriceType': None,
318
+ 'triggerDirection': False,
319
+ 'stopLossPrice': False, # todo by triggerPrice
320
+ 'takeProfitPrice': False, # todo by triggerPrice
321
+ 'attachedStopLossTakeProfit': None,
322
+ 'timeInForce': {
323
+ 'IOC': True,
324
+ 'FOK': True,
325
+ 'PO': True,
326
+ 'GTD': False,
327
+ },
328
+ 'hedged': False,
329
+ 'trailing': True,
330
+ # exchange specific
331
+ # 'iceberg': True,
332
+ },
333
+ 'createOrders': {
334
+ 'max': 10,
335
+ },
336
+ 'fetchMyTrades': {
337
+ 'marginMode': False,
338
+ 'limit': 500,
339
+ 'daysBack': None,
340
+ 'untilDays': 100000,
341
+ },
342
+ 'fetchOrder': {
343
+ 'marginMode': False,
344
+ 'trigger': True,
345
+ 'trailing': False,
346
+ },
347
+ 'fetchOpenOrders': {
348
+ 'marginMode': False,
349
+ 'limit': 500,
350
+ 'trigger': True,
351
+ 'trailing': False,
352
+ },
353
+ 'fetchOrders': None,
354
+ 'fetchClosedOrders': {
355
+ 'marginMode': False,
356
+ 'limit': 500,
357
+ 'daysBackClosed': None,
358
+ 'daysBackCanceled': None,
359
+ 'untilDays': 100000,
360
+ 'trigger': True,
361
+ 'trailing': False,
362
+ },
363
+ 'fetchOHLCV': {
364
+ 'limit': 1000,
365
+ },
366
+ },
367
+ 'spot': {
368
+ 'extends': 'default',
369
+ },
370
+ 'forDerivatives': {
371
+ 'extends': 'default',
372
+ 'createOrder': {
373
+ # todo: implementation needs unification
374
+ 'triggerPriceType': None,
375
+ 'attachedStopLossTakeProfit': {
376
+ # todo: implementation needs unification
377
+ 'triggerPriceType': None,
378
+ 'limitPrice': False,
379
+ },
380
+ },
381
+ },
382
+ 'swap': {
383
+ 'linear': {
384
+ 'extends': 'forDerivatives',
385
+ },
386
+ 'inverse': None,
387
+ },
388
+ 'future': {
389
+ 'linear': None,
390
+ 'inverse': None,
391
+ },
392
+ },
311
393
  'commonCurrencies': {},
312
394
  'exceptions': {
313
395
  'exact': {
@@ -1162,7 +1244,7 @@ class woofipro(Exchange, ImplicitAPI):
1162
1244
  fee = self.safe_value_2(order, 'total_fee', 'totalFee')
1163
1245
  feeCurrency = self.safe_string_2(order, 'fee_asset', 'feeAsset')
1164
1246
  transactions = self.safe_value(order, 'Transactions')
1165
- stopPrice = self.safe_number(order, 'triggerPrice')
1247
+ triggerPrice = self.safe_number(order, 'triggerPrice')
1166
1248
  takeProfitPrice: Num = None
1167
1249
  stopLossPrice: Num = None
1168
1250
  childOrders = self.safe_value(order, 'childOrders')
@@ -1191,8 +1273,7 @@ class woofipro(Exchange, ImplicitAPI):
1191
1273
  'reduceOnly': self.safe_bool(order, 'reduce_only'),
1192
1274
  'side': side,
1193
1275
  'price': price,
1194
- 'stopPrice': stopPrice,
1195
- 'triggerPrice': stopPrice,
1276
+ 'triggerPrice': triggerPrice,
1196
1277
  'takeProfitPrice': takeProfitPrice,
1197
1278
  'stopLossPrice': stopLossPrice,
1198
1279
  'average': average,
@@ -1260,11 +1341,11 @@ class woofipro(Exchange, ImplicitAPI):
1260
1341
  'symbol': market['id'],
1261
1342
  'side': orderSide,
1262
1343
  }
1263
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1344
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1264
1345
  stopLoss = self.safe_value(params, 'stopLoss')
1265
1346
  takeProfit = self.safe_value(params, 'takeProfit')
1266
1347
  algoType = self.safe_string(params, 'algoType')
1267
- isConditional = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1348
+ isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1268
1349
  isMarket = orderType == 'MARKET'
1269
1350
  timeInForce = self.safe_string_lower(params, 'timeInForce')
1270
1351
  postOnly = self.is_post_only(isMarket, None, params)
@@ -1290,8 +1371,8 @@ class woofipro(Exchange, ImplicitAPI):
1290
1371
  clientOrderId = self.safe_string_n(params, ['clOrdID', 'clientOrderId', 'client_order_id'])
1291
1372
  if clientOrderId is not None:
1292
1373
  request['client_order_id'] = clientOrderId
1293
- if stopPrice is not None:
1294
- request['trigger_price'] = self.price_to_precision(symbol, stopPrice)
1374
+ if triggerPrice is not None:
1375
+ request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
1295
1376
  request['algo_type'] = 'STOP'
1296
1377
  elif (stopLoss is not None) or (takeProfit is not None):
1297
1378
  request['algo_type'] = 'TP_SL'
@@ -1352,10 +1433,10 @@ class woofipro(Exchange, ImplicitAPI):
1352
1433
  await self.load_markets()
1353
1434
  market = self.market(symbol)
1354
1435
  request = self.create_order_request(symbol, type, side, amount, price, params)
1355
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1436
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1356
1437
  stopLoss = self.safe_value(params, 'stopLoss')
1357
1438
  takeProfit = self.safe_value(params, 'takeProfit')
1358
- isConditional = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1439
+ isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(params, 'childOrders') is not None)
1359
1440
  response = None
1360
1441
  if isConditional:
1361
1442
  response = await self.v1PrivatePostAlgoOrder(request)
@@ -1414,10 +1495,10 @@ class woofipro(Exchange, ImplicitAPI):
1414
1495
  amount = self.safe_value(rawOrder, 'amount')
1415
1496
  price = self.safe_value(rawOrder, 'price')
1416
1497
  orderParams = self.safe_dict(rawOrder, 'params', {})
1417
- stopPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
1498
+ triggerPrice = self.safe_string_2(orderParams, 'triggerPrice', 'stopPrice')
1418
1499
  stopLoss = self.safe_value(orderParams, 'stopLoss')
1419
1500
  takeProfit = self.safe_value(orderParams, 'takeProfit')
1420
- isConditional = stopPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
1501
+ isConditional = triggerPrice is not None or stopLoss is not None or takeProfit is not None or (self.safe_value(orderParams, 'childOrders') is not None)
1421
1502
  if isConditional:
1422
1503
  raise NotSupported(self.id + 'createOrders() only support non-stop order')
1423
1504
  orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
@@ -1471,10 +1552,10 @@ class woofipro(Exchange, ImplicitAPI):
1471
1552
  request: dict = {
1472
1553
  'order_id': id,
1473
1554
  }
1474
- stopPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
1475
- if stopPrice is not None:
1476
- request['triggerPrice'] = self.price_to_precision(symbol, stopPrice)
1477
- isConditional = (stopPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
1555
+ triggerPrice = self.safe_string_n(params, ['triggerPrice', 'stopPrice', 'takeProfitPrice', 'stopLossPrice'])
1556
+ if triggerPrice is not None:
1557
+ request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
1558
+ isConditional = (triggerPrice is not None) or (self.safe_value(params, 'childOrders') is not None)
1478
1559
  orderQtyKey = 'quantity' if isConditional else 'order_quantity'
1479
1560
  priceKey = 'price' if isConditional else 'order_price'
1480
1561
  if price is not None:
ccxt/async_support/xt.py CHANGED
@@ -2232,7 +2232,8 @@ class xt(Exchange, ImplicitAPI):
2232
2232
  :param str [params.timeInForce]: 'GTC', 'IOC', 'FOK' or 'GTX'
2233
2233
  :param str [params.entrustType]: 'TAKE_PROFIT', 'STOP', 'TAKE_PROFIT_MARKET', 'STOP_MARKET', 'TRAILING_STOP_MARKET', required if stopPrice is defined, currently isn't functioning on xt's side
2234
2234
  :param str [params.triggerPriceType]: 'INDEX_PRICE', 'MARK_PRICE', 'LATEST_PRICE', required if stopPrice is defined
2235
- :param float [params.stopPrice]: price to trigger a stop order
2235
+ :param float [params.triggerPrice]: price to trigger a stop order
2236
+ :param float [params.stopPrice]: alias for triggerPrice
2236
2237
  :param float [params.stopLoss]: price to set a stop-loss on an open position
2237
2238
  :param float [params.takeProfit]: price to set a take-profit on an open position
2238
2239
  :returns dict: an `order structure <https://docs.ccxt.com/en/latest/manual.html#order-structure>`
@@ -3334,7 +3335,7 @@ class xt(Exchange, ImplicitAPI):
3334
3335
  'postOnly': None,
3335
3336
  'side': self.safe_string_lower_2(order, 'side', 'orderSide'),
3336
3337
  'price': self.safe_number(order, 'price'),
3337
- 'stopPrice': self.safe_number(order, 'stopPrice'),
3338
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
3338
3339
  'stopLoss': self.safe_number(order, 'triggerStopPrice'),
3339
3340
  'takeProfit': self.safe_number(order, 'triggerProfitPrice'),
3340
3341
  'amount': amount,
@@ -1005,7 +1005,6 @@ class yobit(Exchange, ImplicitAPI):
1005
1005
  'postOnly': None,
1006
1006
  'side': side,
1007
1007
  'price': price,
1008
- 'stopPrice': None,
1009
1008
  'triggerPrice': None,
1010
1009
  'cost': None,
1011
1010
  'amount': amount,
@@ -537,7 +537,6 @@ class zaif(Exchange, ImplicitAPI):
537
537
  'postOnly': None,
538
538
  'side': side,
539
539
  'price': price,
540
- 'stopPrice': None,
541
540
  'triggerPrice': None,
542
541
  'cost': None,
543
542
  'amount': amount,
@@ -505,7 +505,6 @@ class zonda(Exchange, ImplicitAPI):
505
505
  'postOnly': postOnly,
506
506
  'side': self.safe_string_lower(order, 'offerType'),
507
507
  'price': self.safe_string(order, 'rate'),
508
- 'stopPrice': None,
509
508
  'triggerPrice': None,
510
509
  'amount': amount,
511
510
  'cost': None,
@@ -1400,7 +1399,7 @@ class zonda(Exchange, ImplicitAPI):
1400
1399
  response = None
1401
1400
  if isStopOrder:
1402
1401
  if not isStopLossPrice:
1403
- raise ExchangeError(self.id + ' createOrder() zonda requires `triggerPrice` or `stopPrice` parameter for stop-limit or stop-market orders')
1402
+ raise ExchangeError(self.id + ' createOrder() zonda requires `triggerPrice` parameter for stop-limit or stop-market orders')
1404
1403
  request['stopRate'] = self.price_to_precision(symbol, stopLossPrice)
1405
1404
  response = await self.v1_01PrivatePostTradingStopOfferSymbol(self.extend(request, params))
1406
1405
  else: