ccxt 4.4.40__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 (173) 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/abstract/bitmart.py +2 -0
  7. ccxt/abstract/okx.py +5 -0
  8. ccxt/ace.py +1 -1
  9. ccxt/alpaca.py +0 -1
  10. ccxt/ascendex.py +0 -1
  11. ccxt/async_support/__init__.py +1 -1
  12. ccxt/async_support/ace.py +1 -1
  13. ccxt/async_support/alpaca.py +0 -1
  14. ccxt/async_support/ascendex.py +0 -1
  15. ccxt/async_support/base/exchange.py +24 -17
  16. ccxt/async_support/bigone.py +0 -1
  17. ccxt/async_support/binance.py +27 -24
  18. ccxt/async_support/bingx.py +5 -1
  19. ccxt/async_support/bitfinex.py +123 -1
  20. ccxt/async_support/bitget.py +1 -0
  21. ccxt/async_support/bitmart.py +243 -2
  22. ccxt/async_support/blofin.py +16 -7
  23. ccxt/async_support/bybit.py +8 -8
  24. ccxt/async_support/cex.py +1 -1
  25. ccxt/async_support/coinbase.py +8 -9
  26. ccxt/async_support/coinbaseexchange.py +5 -6
  27. ccxt/async_support/coinbaseinternational.py +7 -8
  28. ccxt/async_support/coincatch.py +0 -1
  29. ccxt/async_support/coincheck.py +0 -1
  30. ccxt/async_support/coinex.py +91 -6
  31. ccxt/async_support/coinlist.py +3 -4
  32. ccxt/async_support/coinmate.py +1 -3
  33. ccxt/async_support/coinmetro.py +4 -5
  34. ccxt/async_support/coinone.py +0 -1
  35. ccxt/async_support/coinsph.py +7 -8
  36. ccxt/async_support/cryptocom.py +3 -0
  37. ccxt/async_support/currencycom.py +3 -4
  38. ccxt/async_support/defx.py +6 -7
  39. ccxt/async_support/deribit.py +1 -3
  40. ccxt/async_support/digifinex.py +0 -1
  41. ccxt/async_support/ellipx.py +0 -2
  42. ccxt/async_support/exmo.py +61 -6
  43. ccxt/async_support/gate.py +2 -3
  44. ccxt/async_support/gemini.py +4 -5
  45. ccxt/async_support/hashkey.py +79 -67
  46. ccxt/async_support/hitbtc.py +47 -5
  47. ccxt/async_support/hollaex.py +4 -6
  48. ccxt/async_support/htx.py +2 -4
  49. ccxt/async_support/huobijp.py +0 -1
  50. ccxt/async_support/hyperliquid.py +60 -1
  51. ccxt/async_support/idex.py +8 -8
  52. ccxt/async_support/independentreserve.py +0 -1
  53. ccxt/async_support/indodax.py +0 -1
  54. ccxt/async_support/kraken.py +186 -28
  55. ccxt/async_support/krakenfutures.py +75 -3
  56. ccxt/async_support/kucoin.py +6 -4
  57. ccxt/async_support/kucoinfutures.py +10 -9
  58. ccxt/async_support/kuna.py +1 -3
  59. ccxt/async_support/latoken.py +1 -3
  60. ccxt/async_support/lbank.py +0 -1
  61. ccxt/async_support/luno.py +0 -1
  62. ccxt/async_support/lykke.py +0 -1
  63. ccxt/async_support/mercado.py +0 -1
  64. ccxt/async_support/mexc.py +6 -7
  65. ccxt/async_support/ndax.py +1 -1
  66. ccxt/async_support/novadax.py +4 -6
  67. ccxt/async_support/oceanex.py +0 -1
  68. ccxt/async_support/okcoin.py +1 -3
  69. ccxt/async_support/okx.py +7 -4
  70. ccxt/async_support/onetrading.py +1 -3
  71. ccxt/async_support/p2b.py +1 -1
  72. ccxt/async_support/paradex.py +5 -7
  73. ccxt/async_support/phemex.py +8 -10
  74. ccxt/async_support/poloniex.py +1 -3
  75. ccxt/async_support/poloniexfutures.py +6 -6
  76. ccxt/async_support/probit.py +0 -1
  77. ccxt/async_support/timex.py +0 -1
  78. ccxt/async_support/tokocrypto.py +11 -14
  79. ccxt/async_support/tradeogre.py +1 -1
  80. ccxt/async_support/upbit.py +0 -1
  81. ccxt/async_support/wavesexchange.py +4 -5
  82. ccxt/async_support/whitebit.py +8 -9
  83. ccxt/async_support/woo.py +98 -12
  84. ccxt/async_support/woofipro.py +96 -15
  85. ccxt/async_support/xt.py +6 -3
  86. ccxt/async_support/yobit.py +0 -1
  87. ccxt/async_support/zaif.py +0 -1
  88. ccxt/async_support/zonda.py +1 -2
  89. ccxt/base/exchange.py +39 -20
  90. ccxt/base/types.py +10 -0
  91. ccxt/bigone.py +0 -1
  92. ccxt/binance.py +27 -24
  93. ccxt/bingx.py +5 -1
  94. ccxt/bitfinex.py +123 -1
  95. ccxt/bitget.py +1 -0
  96. ccxt/bitmart.py +243 -2
  97. ccxt/blofin.py +16 -7
  98. ccxt/bybit.py +8 -8
  99. ccxt/cex.py +1 -1
  100. ccxt/coinbase.py +8 -9
  101. ccxt/coinbaseexchange.py +5 -6
  102. ccxt/coinbaseinternational.py +7 -8
  103. ccxt/coincatch.py +0 -1
  104. ccxt/coincheck.py +0 -1
  105. ccxt/coinex.py +91 -6
  106. ccxt/coinlist.py +3 -4
  107. ccxt/coinmate.py +1 -3
  108. ccxt/coinmetro.py +4 -5
  109. ccxt/coinone.py +0 -1
  110. ccxt/coinsph.py +7 -8
  111. ccxt/cryptocom.py +3 -0
  112. ccxt/currencycom.py +3 -4
  113. ccxt/defx.py +6 -7
  114. ccxt/deribit.py +1 -3
  115. ccxt/digifinex.py +0 -1
  116. ccxt/ellipx.py +0 -2
  117. ccxt/exmo.py +61 -6
  118. ccxt/gate.py +2 -3
  119. ccxt/gemini.py +4 -5
  120. ccxt/hashkey.py +79 -67
  121. ccxt/hitbtc.py +47 -5
  122. ccxt/hollaex.py +4 -6
  123. ccxt/htx.py +2 -4
  124. ccxt/huobijp.py +0 -1
  125. ccxt/hyperliquid.py +60 -1
  126. ccxt/idex.py +8 -8
  127. ccxt/independentreserve.py +0 -1
  128. ccxt/indodax.py +0 -1
  129. ccxt/kraken.py +186 -28
  130. ccxt/krakenfutures.py +75 -3
  131. ccxt/kucoin.py +6 -4
  132. ccxt/kucoinfutures.py +10 -9
  133. ccxt/kuna.py +1 -3
  134. ccxt/latoken.py +1 -3
  135. ccxt/lbank.py +0 -1
  136. ccxt/luno.py +0 -1
  137. ccxt/lykke.py +0 -1
  138. ccxt/mercado.py +0 -1
  139. ccxt/mexc.py +6 -7
  140. ccxt/ndax.py +1 -1
  141. ccxt/novadax.py +4 -6
  142. ccxt/oceanex.py +0 -1
  143. ccxt/okcoin.py +1 -3
  144. ccxt/okx.py +7 -4
  145. ccxt/onetrading.py +1 -3
  146. ccxt/p2b.py +1 -1
  147. ccxt/paradex.py +5 -7
  148. ccxt/phemex.py +8 -10
  149. ccxt/poloniex.py +1 -3
  150. ccxt/poloniexfutures.py +6 -6
  151. ccxt/pro/__init__.py +1 -1
  152. ccxt/probit.py +0 -1
  153. ccxt/timex.py +0 -1
  154. ccxt/tokocrypto.py +11 -14
  155. ccxt/tradeogre.py +1 -1
  156. ccxt/upbit.py +0 -1
  157. ccxt/wavesexchange.py +4 -5
  158. ccxt/whitebit.py +8 -9
  159. ccxt/woo.py +98 -12
  160. ccxt/woofipro.py +96 -15
  161. ccxt/xt.py +6 -3
  162. ccxt/yobit.py +0 -1
  163. ccxt/zaif.py +0 -1
  164. ccxt/zonda.py +1 -2
  165. {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/METADATA +5 -5
  166. {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/RECORD +169 -173
  167. ccxt/bitbay.py +0 -17
  168. ccxt/bitfinex2.py +0 -3624
  169. ccxt/hitbtc3.py +0 -16
  170. ccxt/pro/bitfinex2.py +0 -1086
  171. {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/LICENSE.txt +0 -0
  172. {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/WHEEL +0 -0
  173. {ccxt-4.4.40.dist-info → ccxt-4.4.42.dist-info}/top_level.txt +0 -0
ccxt/blofin.py CHANGED
@@ -167,7 +167,7 @@ class blofin(Exchange, ImplicitAPI):
167
167
  'rest': 'https://openapi.blofin.com',
168
168
  },
169
169
  'referral': {
170
- 'url': 'https://blofin.com/register?referral_code=jBd8U1',
170
+ 'url': 'https://blofin.com/register?referral_code=f79EsS',
171
171
  'discount': 0.05,
172
172
  },
173
173
  'www': 'https://www.blofin.com',
@@ -287,10 +287,18 @@ class blofin(Exchange, ImplicitAPI):
287
287
  'brokerId': 'ec6dd3a7dd982d0b',
288
288
  'accountsByType': {
289
289
  'swap': 'futures',
290
+ 'funding': 'funding',
290
291
  'future': 'futures',
292
+ 'copy_trading': 'copy_trading',
293
+ 'earn': 'earn',
294
+ 'spot': 'spot',
291
295
  },
292
296
  'accountsById': {
297
+ 'funding': 'funding',
293
298
  'futures': 'swap',
299
+ 'copy_trading': 'copy_trading',
300
+ 'earn': 'earn',
301
+ 'spot': 'spot',
294
302
  },
295
303
  'sandboxMode': False,
296
304
  'defaultNetwork': 'ERC20',
@@ -873,8 +881,9 @@ class blofin(Exchange, ImplicitAPI):
873
881
  entry = self.safe_dict(data, 0, {})
874
882
  return self.parse_funding_rate(entry, market)
875
883
 
876
- def parse_balance_by_type(self, type, response):
877
- if type:
884
+ def parse_balance_by_type(self, response):
885
+ data = self.safe_list(response, 'data')
886
+ if (data is not None) and isinstance(data, list):
878
887
  return self.parse_funding_balance(response)
879
888
  else:
880
889
  return self.parse_balance(response)
@@ -986,19 +995,19 @@ class blofin(Exchange, ImplicitAPI):
986
995
  :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
987
996
  """
988
997
  self.load_markets()
989
- accountType = self.safe_string_2(params, 'accountType', 'type')
990
- params = self.omit(params, ['accountType', 'type'])
998
+ accountType = None
999
+ accountType, params = self.handle_option_and_params_2(params, 'fetchBalance', 'accountType', 'type')
991
1000
  request: dict = {
992
1001
  }
993
1002
  response = None
994
- if accountType is not None:
1003
+ if accountType is not None and accountType != 'swap':
995
1004
  options = self.safe_dict(self.options, 'accountsByType', {})
996
1005
  parsedAccountType = self.safe_string(options, accountType, accountType)
997
1006
  request['accountType'] = parsedAccountType
998
1007
  response = self.privateGetAssetBalances(self.extend(request, params))
999
1008
  else:
1000
1009
  response = self.privateGetAccountBalance(self.extend(request, params))
1001
- return self.parse_balance_by_type(accountType, response)
1010
+ return self.parse_balance_by_type(response)
1002
1011
 
1003
1012
  def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
1004
1013
  market = self.market(symbol)
ccxt/bybit.py CHANGED
@@ -3530,29 +3530,29 @@ class bybit(Exchange, ImplicitAPI):
3530
3530
  avgPrice = self.omit_zero(self.safe_string(order, 'avgPrice'))
3531
3531
  rawTimeInForce = self.safe_string(order, 'timeInForce')
3532
3532
  timeInForce = self.parse_time_in_force(rawTimeInForce)
3533
- stopPrice = self.omit_zero(self.safe_string(order, 'triggerPrice'))
3533
+ triggerPrice = self.omit_zero(self.safe_string(order, 'triggerPrice'))
3534
3534
  reduceOnly = self.safe_bool(order, 'reduceOnly')
3535
3535
  takeProfitPrice = self.omit_zero(self.safe_string(order, 'takeProfit'))
3536
3536
  stopLossPrice = self.omit_zero(self.safe_string(order, 'stopLoss'))
3537
3537
  triggerDirection = self.safe_string(order, 'triggerDirection')
3538
3538
  isAscending = (triggerDirection == '1')
3539
- isStopOrderType2 = (stopPrice is not None) and reduceOnly
3539
+ isStopOrderType2 = (triggerPrice is not None) and reduceOnly
3540
3540
  if (stopLossPrice is None) and isStopOrderType2:
3541
3541
  # check if order is stop order type 2 - stopLossPrice
3542
3542
  if isAscending and (side == 'buy'):
3543
3543
  # stopLoss order against short position
3544
- stopLossPrice = stopPrice
3544
+ stopLossPrice = triggerPrice
3545
3545
  if not isAscending and (side == 'sell'):
3546
3546
  # stopLoss order against a long position
3547
- stopLossPrice = stopPrice
3547
+ stopLossPrice = triggerPrice
3548
3548
  if (takeProfitPrice is None) and isStopOrderType2:
3549
3549
  # check if order is stop order type 2 - takeProfitPrice
3550
3550
  if isAscending and (side == 'sell'):
3551
3551
  # takeprofit order against a long position
3552
- takeProfitPrice = stopPrice
3552
+ takeProfitPrice = triggerPrice
3553
3553
  if not isAscending and (side == 'buy'):
3554
3554
  # takeprofit order against a short position
3555
- takeProfitPrice = stopPrice
3555
+ takeProfitPrice = triggerPrice
3556
3556
  return self.safe_order({
3557
3557
  'info': order,
3558
3558
  'id': id,
@@ -3568,7 +3568,7 @@ class bybit(Exchange, ImplicitAPI):
3568
3568
  'reduceOnly': self.safe_bool(order, 'reduceOnly'),
3569
3569
  'side': side,
3570
3570
  'price': price,
3571
- 'triggerPrice': stopPrice,
3571
+ 'triggerPrice': triggerPrice,
3572
3572
  'takeProfitPrice': takeProfitPrice,
3573
3573
  'stopLossPrice': stopLossPrice,
3574
3574
  'amount': amount,
@@ -6369,7 +6369,7 @@ classic accounts only/ spot not supported* fetches information on an order made
6369
6369
  data = self.add_pagination_cursor_to_result(response)
6370
6370
  id = self.safe_string(result, 'symbol')
6371
6371
  market = self.safe_market(id, market, None, 'contract')
6372
- return self.parse_open_interests(data, market, since, limit)
6372
+ return self.parse_open_interests_history(data, market, since, limit)
6373
6373
 
6374
6374
  def fetch_open_interest(self, symbol: str, params={}):
6375
6375
  """
ccxt/cex.py CHANGED
@@ -1066,7 +1066,7 @@ class cex(Exchange, ImplicitAPI):
1066
1066
  'postOnly': None,
1067
1067
  'side': self.safe_string_lower(order, 'side'),
1068
1068
  'price': self.safe_number(order, 'price'),
1069
- 'stopPrice': self.safe_number(order, 'stopPrice'),
1069
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
1070
1070
  'amount': requestedBase,
1071
1071
  'cost': executedQuote,
1072
1072
  'average': self.safe_number(order, 'averagePrice'),
ccxt/coinbase.py CHANGED
@@ -2809,10 +2809,10 @@ class coinbase(Exchange, ImplicitAPI):
2809
2809
  'product_id': market['id'],
2810
2810
  'side': side.upper(),
2811
2811
  }
2812
- stopPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
2812
+ triggerPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
2813
2813
  stopLossPrice = self.safe_number(params, 'stopLossPrice')
2814
2814
  takeProfitPrice = self.safe_number(params, 'takeProfitPrice')
2815
- isStop = stopPrice is not None
2815
+ isStop = triggerPrice is not None
2816
2816
  isStopLoss = stopLossPrice is not None
2817
2817
  isTakeProfit = takeProfitPrice is not None
2818
2818
  timeInForce = self.safe_string(params, 'timeInForce')
@@ -2830,7 +2830,7 @@ class coinbase(Exchange, ImplicitAPI):
2830
2830
  'stop_limit_stop_limit_gtd': {
2831
2831
  'base_size': self.amount_to_precision(symbol, amount),
2832
2832
  'limit_price': self.price_to_precision(symbol, price),
2833
- 'stop_price': self.price_to_precision(symbol, stopPrice),
2833
+ 'stop_price': self.price_to_precision(symbol, triggerPrice),
2834
2834
  'stop_direction': stopDirection,
2835
2835
  'end_time': endTime,
2836
2836
  },
@@ -2840,25 +2840,25 @@ class coinbase(Exchange, ImplicitAPI):
2840
2840
  'stop_limit_stop_limit_gtc': {
2841
2841
  'base_size': self.amount_to_precision(symbol, amount),
2842
2842
  'limit_price': self.price_to_precision(symbol, price),
2843
- 'stop_price': self.price_to_precision(symbol, stopPrice),
2843
+ 'stop_price': self.price_to_precision(symbol, triggerPrice),
2844
2844
  'stop_direction': stopDirection,
2845
2845
  },
2846
2846
  }
2847
2847
  elif isStopLoss or isTakeProfit:
2848
- triggerPrice = None
2848
+ tpslPrice = None
2849
2849
  if isStopLoss:
2850
2850
  if stopDirection is None:
2851
2851
  stopDirection = 'STOP_DIRECTION_STOP_UP' if (side == 'buy') else 'STOP_DIRECTION_STOP_DOWN'
2852
- triggerPrice = self.price_to_precision(symbol, stopLossPrice)
2852
+ tpslPrice = self.price_to_precision(symbol, stopLossPrice)
2853
2853
  else:
2854
2854
  if stopDirection is None:
2855
2855
  stopDirection = 'STOP_DIRECTION_STOP_DOWN' if (side == 'buy') else 'STOP_DIRECTION_STOP_UP'
2856
- triggerPrice = self.price_to_precision(symbol, takeProfitPrice)
2856
+ tpslPrice = self.price_to_precision(symbol, takeProfitPrice)
2857
2857
  request['order_configuration'] = {
2858
2858
  'stop_limit_stop_limit_gtc': {
2859
2859
  'base_size': self.amount_to_precision(symbol, amount),
2860
2860
  'limit_price': self.price_to_precision(symbol, price),
2861
- 'stop_price': triggerPrice,
2861
+ 'stop_price': tpslPrice,
2862
2862
  'stop_direction': stopDirection,
2863
2863
  },
2864
2864
  }
@@ -3109,7 +3109,6 @@ class coinbase(Exchange, ImplicitAPI):
3109
3109
  'postOnly': postOnly,
3110
3110
  'side': self.safe_string_lower(order, 'side'),
3111
3111
  'price': price,
3112
- 'stopPrice': triggerPrice,
3113
3112
  'triggerPrice': triggerPrice,
3114
3113
  'amount': amount,
3115
3114
  'filled': self.safe_string(order, 'filled_size'),
ccxt/coinbaseexchange.py CHANGED
@@ -1042,7 +1042,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
1042
1042
  side = self.safe_string(order, 'side')
1043
1043
  timeInForce = self.safe_string(order, 'time_in_force')
1044
1044
  postOnly = self.safe_value(order, 'post_only')
1045
- stopPrice = self.safe_number(order, 'stop_price')
1045
+ triggerPrice = self.safe_number(order, 'stop_price')
1046
1046
  clientOrderId = self.safe_string(order, 'client_oid')
1047
1047
  return self.safe_order({
1048
1048
  'id': id,
@@ -1058,8 +1058,7 @@ class coinbaseexchange(Exchange, ImplicitAPI):
1058
1058
  'postOnly': postOnly,
1059
1059
  'side': side,
1060
1060
  'price': price,
1061
- 'stopPrice': stopPrice,
1062
- 'triggerPrice': stopPrice,
1061
+ 'triggerPrice': triggerPrice,
1063
1062
  'cost': cost,
1064
1063
  'amount': amount,
1065
1064
  'filled': filled,
@@ -1224,9 +1223,9 @@ class coinbaseexchange(Exchange, ImplicitAPI):
1224
1223
  clientOrderId = self.safe_string_2(params, 'clientOrderId', 'client_oid')
1225
1224
  if clientOrderId is not None:
1226
1225
  request['client_oid'] = clientOrderId
1227
- stopPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
1228
- if stopPrice is not None:
1229
- request['stop_price'] = self.price_to_precision(symbol, stopPrice)
1226
+ triggerPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
1227
+ if triggerPrice is not None:
1228
+ request['stop_price'] = self.price_to_precision(symbol, triggerPrice)
1230
1229
  timeInForce = self.safe_string_2(params, 'timeInForce', 'time_in_force')
1231
1230
  if timeInForce is not None:
1232
1231
  request['time_in_force'] = timeInForce
@@ -1630,7 +1630,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1630
1630
  :param float amount: how much you want to trade in units of the base currency, quote currency for 'market' 'buy' orders
1631
1631
  :param float [price]: the price to fulfill the order, in units of the quote currency, ignored in market orders
1632
1632
  :param dict [params]: extra parameters specific to the exchange API endpoint
1633
- :param float [params.stopPrice]: price to trigger stop orders
1633
+ :param float [params.stopPrice]: alias for triggerPrice
1634
1634
  :param float [params.triggerPrice]: price to trigger stop orders
1635
1635
  :param float [params.stopLossPrice]: price to trigger stop-loss orders
1636
1636
  :param bool [params.postOnly]: True or False
@@ -1642,7 +1642,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1642
1642
  self.load_markets()
1643
1643
  market = self.market(symbol)
1644
1644
  typeId = type.upper()
1645
- stopPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
1645
+ triggerPrice = self.safe_number_n(params, ['triggerPrice', 'stopPrice', 'stop_price'])
1646
1646
  clientOrderIdprefix = self.safe_string(self.options, 'brokerId', 'nfqkvdjp')
1647
1647
  clientOrderId = clientOrderIdprefix + '-' + self.uuid()
1648
1648
  clientOrderId = clientOrderId[0:17]
@@ -1652,12 +1652,12 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1652
1652
  'instrument': market['id'],
1653
1653
  'size': self.amount_to_precision(market['symbol'], amount),
1654
1654
  }
1655
- if stopPrice is not None:
1655
+ if triggerPrice is not None:
1656
1656
  if type == 'limit':
1657
1657
  typeId = 'STOP_LIMIT'
1658
1658
  else:
1659
1659
  typeId = 'STOP'
1660
- request['stop_price'] = stopPrice
1660
+ request['stop_price'] = triggerPrice
1661
1661
  request['type'] = typeId
1662
1662
  if type == 'limit':
1663
1663
  if price is None:
@@ -1751,7 +1751,6 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1751
1751
  'postOnly': None,
1752
1752
  'side': self.safe_string_lower(order, 'side'),
1753
1753
  'price': self.safe_string(order, 'price'),
1754
- 'stopPrice': self.safe_string(order, 'stop_price'),
1755
1754
  'triggerPrice': self.safe_string(order, 'stop_price'),
1756
1755
  'amount': self.safe_string(order, 'size'),
1757
1756
  'filled': self.safe_string(order, 'exec_qty'),
@@ -1885,9 +1884,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1885
1884
  request['size'] = self.amount_to_precision(symbol, amount)
1886
1885
  if price is not None:
1887
1886
  request['price'] = self.price_to_precision(symbol, price)
1888
- stopPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
1889
- if stopPrice is not None:
1890
- request['stop_price'] = stopPrice
1887
+ triggerPrice = self.safe_number_n(params, ['stopPrice', 'stop_price', 'triggerPrice'])
1888
+ if triggerPrice is not None:
1889
+ request['stop_price'] = triggerPrice
1891
1890
  clientOrderId = self.safe_string_2(params, 'client_order_id', 'clientOrderId')
1892
1891
  if clientOrderId is None:
1893
1892
  raise BadRequest(self.id + ' editOrder() requires a clientOrderId parameter')
ccxt/coincatch.py CHANGED
@@ -3907,7 +3907,6 @@ class coincatch(Exchange, ImplicitAPI):
3907
3907
  'amount': amount,
3908
3908
  'filled': self.safe_string_2(order, 'fillQuantity', 'filledQty'),
3909
3909
  'remaining': None,
3910
- 'stopPrice': None,
3911
3910
  'triggerPrice': triggerPrice,
3912
3911
  'takeProfitPrice': takeProfitPrice,
3913
3912
  'stopLossPrice': stopLossPrice,
ccxt/coincheck.py CHANGED
@@ -267,7 +267,6 @@ class coincheck(Exchange, ImplicitAPI):
267
267
  'status': status,
268
268
  'symbol': symbol,
269
269
  'price': price,
270
- 'stopPrice': None,
271
270
  'triggerPrice': None,
272
271
  'cost': None,
273
272
  'fee': None,
ccxt/coinex.py CHANGED
@@ -513,6 +513,92 @@ class coinex(Exchange, ImplicitAPI):
513
513
  # CSC, AE, BASE, AIPG, AKASH, POLKADOTASSETHUB ?, ALEO, STX, ALGO, ALPH, BLAST, AR, ARCH, ARDR, ARK, ARRR, MANTA, NTRN, LUNA, AURORA, AVAIL, ASC20, AVA, AYA, AZERO, BAN, BAND, BB, RUNES, BEAM, BELLSCOIN, BITCI, NEAR, AGORIC, BLOCX, BNC, BOBA, BRISE, KRC20, CANTO, CAPS, CCD, CELO, CFX, CHI, CKB, CLORE, CLV, CORE, CSPR, CTXC, DAG, DCR, DERO, DESO, DEFI, DGB, DNX, DOCK, DOGECHAIN, DYDX, DYMENSION, EGLD, ELA, ELF, ENJIN, EOSIO, ERG, ETN_SC, EVMOS, EWC, SGB, FACT, FB, FET, FIO, FIRO, NEO3, FLOW, FLARE, FLUX, LINEA, FREN, FSN, FB_BRC20, GLMR, GRIN, GRS, HACASH, HBAR, HERB, HIVE, MAPO, HMND, HNS, ZKSYNC, HTR, HUAHUA, MERLIN, ICP, ICX, INJ, IOST, IOTA, IOTX, IRIS, IRON, ONE, JOYSTREAM, KAI, KAR, KAS, KAVA, KCN, KDA, KLAY, KLY, KMD, KSM, KUB, KUJIRA, LAT, LBC, LUNC, LUKSO, MARS, METIS, MINA, MANTLE, MOB, MODE, MONA, MOVR, MTL, NEOX, NEXA, NIBI, NIMIQ, NMC, ONOMY, NRG, WAVES, NULS, OAS, OCTA, OLT, ONT, OORT, ORAI, OSMO, P3D, COMPOSABLE, PIVX, RON, POKT, POLYMESH, PRE_MARKET, PYI, QKC, QTUM, QUBIC, RSK, ROSE, ROUTE, RTM, THORCHAIN, RVN, RADIANT, SAGA, SALVIUM, SATOX, SC, SCP, _NULL, SCRT, SDN, RGBPP, SELF, SMH, SPACE, STARGAZE, STC, STEEM, STRATISEVM, STRD, STARKNET, SXP, SYS, TAIKO, TAO, TARA, TENET, THETA, TT, VENOM, VECHAIN, TOMO, VITE, VLX, VSYS, VTC, WAN, WAXP, WEMIX, XCH, XDC, XEC, XELIS, NEM, XHV, XLM, XNA, NANO, XPLA, XPR, XPRT, XRD, XTZ, XVG, XYM, ZANO, ZEC, ZEN, ZEPH, ZETA
514
514
  },
515
515
  },
516
+ 'features': {
517
+ 'spot': {
518
+ 'sandbox': False,
519
+ 'createOrder': {
520
+ 'marginMode': True,
521
+ 'triggerPrice': True,
522
+ 'triggerPriceType': None,
523
+ 'triggerDirection': False,
524
+ 'stopLossPrice': False, # todo
525
+ 'takeProfitPrice': False, # todo
526
+ 'attachedStopLossTakeProfit': None,
527
+ 'timeInForce': {
528
+ 'IOC': True,
529
+ 'FOK': True,
530
+ 'PO': True,
531
+ 'GTD': False,
532
+ },
533
+ 'hedged': False,
534
+ 'trailing': False,
535
+ # exchange-supported features
536
+ # 'marketBuyRequiresPrice': True,
537
+ # 'marketBuyByCost': True,
538
+ # 'selfTradePrevention': True,
539
+ # 'iceberg': True,
540
+ },
541
+ 'createOrders': {
542
+ 'max': 5,
543
+ },
544
+ 'fetchMyTrades': {
545
+ 'marginMode': True,
546
+ 'limit': 1000,
547
+ 'daysBack': None,
548
+ 'untilDays': 100000,
549
+ },
550
+ 'fetchOrder': {
551
+ 'marginMode': False,
552
+ 'trigger': False,
553
+ 'trailing': False,
554
+ },
555
+ 'fetchOpenOrders': {
556
+ 'marginMode': True,
557
+ 'limit': 1000,
558
+ 'trigger': True,
559
+ 'trailing': False,
560
+ },
561
+ 'fetchOrders': None,
562
+ 'fetchClosedOrders': {
563
+ 'marginMode': True,
564
+ 'limit': 1000,
565
+ 'daysBackClosed': None,
566
+ 'daysBackCanceled': None,
567
+ 'untilDays': None,
568
+ 'trigger': True,
569
+ 'trailing': False,
570
+ },
571
+ 'fetchOHLCV': {
572
+ 'limit': 1000,
573
+ },
574
+ },
575
+ 'forDerivatives': {
576
+ 'extends': 'spot',
577
+ 'createOrder': {
578
+ 'marginMode': True,
579
+ 'stopLossPrice': True,
580
+ 'takeProfitPrice': True,
581
+ },
582
+ 'fetchOpenOrders': {
583
+ 'marginMode': False,
584
+ },
585
+ 'fetchClosedOrders': {
586
+ 'marginMode': False,
587
+ },
588
+ },
589
+ 'swap': {
590
+ 'linear': {
591
+ 'extends': 'forDerivatives',
592
+ },
593
+ 'inverse': {
594
+ 'extends': 'forDerivatives',
595
+ },
596
+ },
597
+ 'future': {
598
+ 'linear': None,
599
+ 'inverse': None,
600
+ },
601
+ },
516
602
  'commonCurrencies': {
517
603
  'ACM': 'Actinium',
518
604
  },
@@ -1977,7 +2063,6 @@ class coinex(Exchange, ImplicitAPI):
1977
2063
  'reduceOnly': None,
1978
2064
  'side': side,
1979
2065
  'price': self.safe_string(order, 'price'),
1980
- 'stopPrice': self.safe_string(order, 'trigger_price'),
1981
2066
  'triggerPrice': self.safe_string(order, 'trigger_price'),
1982
2067
  'takeProfitPrice': self.safe_number(order, 'take_profit_price'),
1983
2068
  'stopLossPrice': self.safe_number(order, 'stop_loss_price'),
@@ -2017,7 +2102,7 @@ class coinex(Exchange, ImplicitAPI):
2017
2102
  market = self.market(symbol)
2018
2103
  swap = market['swap']
2019
2104
  clientOrderId = self.safe_string_2(params, 'client_id', 'clientOrderId')
2020
- stopPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
2105
+ triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
2021
2106
  stopLossPrice = self.safe_string(params, 'stopLossPrice')
2022
2107
  takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
2023
2108
  option = self.safe_string(params, 'option')
@@ -2062,8 +2147,8 @@ class coinex(Exchange, ImplicitAPI):
2062
2147
  request['take_profit_type'] = self.safe_string(params, 'stop_type', 'latest_price')
2063
2148
  else:
2064
2149
  request['amount'] = self.amount_to_precision(symbol, amount)
2065
- if stopPrice is not None:
2066
- request['trigger_price'] = self.price_to_precision(symbol, stopPrice)
2150
+ if triggerPrice is not None:
2151
+ request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
2067
2152
  request['trigger_price_type'] = self.safe_string(params, 'stop_type', 'latest_price')
2068
2153
  else:
2069
2154
  marginMode = None
@@ -2090,8 +2175,8 @@ class coinex(Exchange, ImplicitAPI):
2090
2175
  request['amount'] = self.cost_to_precision(symbol, amount)
2091
2176
  else:
2092
2177
  request['amount'] = self.amount_to_precision(symbol, amount)
2093
- if stopPrice is not None:
2094
- request['trigger_price'] = self.price_to_precision(symbol, stopPrice)
2178
+ if triggerPrice is not None:
2179
+ request['trigger_price'] = self.price_to_precision(symbol, triggerPrice)
2095
2180
  params = self.omit(params, ['reduceOnly', 'timeInForce', 'postOnly', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice'])
2096
2181
  return self.extend(request, params)
2097
2182
 
ccxt/coinlist.py CHANGED
@@ -1504,7 +1504,7 @@ class coinlist(Exchange, ImplicitAPI):
1504
1504
  elif type == 'limit':
1505
1505
  request['type'] = 'stop_limit'
1506
1506
  elif (type == 'stop_market') or (type == 'stop_limit') or (type == 'take_market') or (type == 'take_limit'):
1507
- raise ArgumentsRequired(self.id + ' createOrder() requires a stopPrice parameter for stop-loss and take-profit orders')
1507
+ raise ArgumentsRequired(self.id + ' createOrder() requires a triggerPrice parameter for stop-loss and take-profit orders')
1508
1508
  clientOrderId = self.safe_string_2(params, 'clientOrderId', 'client_id')
1509
1509
  if clientOrderId is not None:
1510
1510
  request['client_id'] = clientOrderId
@@ -1643,7 +1643,7 @@ class coinlist(Exchange, ImplicitAPI):
1643
1643
  type = self.parse_order_type(self.safe_string(order, 'type'))
1644
1644
  side = self.safe_string(order, 'side')
1645
1645
  price = self.safe_string(order, 'price')
1646
- stopPrice = self.safe_string(order, 'stop_price')
1646
+ triggerPrice = self.safe_string(order, 'stop_price')
1647
1647
  average = self.safe_string(order, 'average_fill_price') # from documentation
1648
1648
  amount = self.safe_string(order, 'size')
1649
1649
  filled = self.safe_string(order, 'size_filled')
@@ -1668,8 +1668,7 @@ class coinlist(Exchange, ImplicitAPI):
1668
1668
  'timeInForce': 'GTC',
1669
1669
  'side': side,
1670
1670
  'price': price,
1671
- 'stopPrice': stopPrice,
1672
- 'triggerPrice': stopPrice,
1671
+ 'triggerPrice': triggerPrice,
1673
1672
  'average': average,
1674
1673
  'amount': amount,
1675
1674
  'cost': None,
ccxt/coinmate.py CHANGED
@@ -938,7 +938,6 @@ class coinmate(Exchange, ImplicitAPI):
938
938
  marketId = self.safe_string(order, 'currencyPair')
939
939
  symbol = self.safe_symbol(marketId, market, '_')
940
940
  clientOrderId = self.safe_string(order, 'clientOrderId')
941
- stopPrice = self.safe_number(order, 'stopPrice')
942
941
  return self.safe_order({
943
942
  'id': id,
944
943
  'clientOrderId': clientOrderId,
@@ -951,8 +950,7 @@ class coinmate(Exchange, ImplicitAPI):
951
950
  'postOnly': None,
952
951
  'side': side,
953
952
  'price': priceString,
954
- 'stopPrice': stopPrice,
955
- 'triggerPrice': stopPrice,
953
+ 'triggerPrice': self.safe_number(order, 'stopPrice'),
956
954
  'amount': amountString,
957
955
  'cost': None,
958
956
  'average': averageString,
ccxt/coinmetro.py CHANGED
@@ -1202,10 +1202,10 @@ class coinmetro(Exchange, ImplicitAPI):
1202
1202
  if timeInForce is not None:
1203
1203
  params = self.omit(params, 'timeInForce')
1204
1204
  request['timeInForce'] = self.encode_order_time_in_force(timeInForce)
1205
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1206
- if stopPrice is not None:
1205
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1206
+ if triggerPrice is not None:
1207
1207
  params = self.omit(params, ['triggerPrice'])
1208
- request['stopPrice'] = self.price_to_precision(symbol, stopPrice)
1208
+ request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
1209
1209
  userData = self.safe_value(params, 'userData', {})
1210
1210
  comment = self.safe_string_2(params, 'clientOrderId', 'comment')
1211
1211
  if comment is not None:
@@ -1706,7 +1706,6 @@ class coinmetro(Exchange, ImplicitAPI):
1706
1706
  }
1707
1707
  trades = self.safe_value(order, 'fills', [])
1708
1708
  userData = self.safe_value(order, 'userData', {})
1709
- triggerPrice = self.safe_string(order, 'stopPrice')
1710
1709
  clientOrderId = self.safe_string(userData, 'comment')
1711
1710
  takeProfitPrice = self.safe_string(userData, 'takeProfit')
1712
1711
  stopLossPrice = self.safe_string(userData, 'stopLoss')
@@ -1722,7 +1721,7 @@ class coinmetro(Exchange, ImplicitAPI):
1722
1721
  'timeInForce': self.parse_order_time_in_force(self.safe_integer(order, 'timeInForce')),
1723
1722
  'side': side,
1724
1723
  'price': price,
1725
- 'triggerPrice': triggerPrice,
1724
+ 'triggerPrice': self.safe_string(order, 'stopPrice'),
1726
1725
  'takeProfitPrice': takeProfitPrice,
1727
1726
  'stopLossPrice': stopLossPrice,
1728
1727
  'average': None,
ccxt/coinone.py CHANGED
@@ -915,7 +915,6 @@ class coinone(Exchange, ImplicitAPI):
915
915
  'postOnly': None,
916
916
  'side': side,
917
917
  'price': self.safe_string(order, 'price'),
918
- 'stopPrice': None,
919
918
  'triggerPrice': None,
920
919
  'cost': None,
921
920
  'average': self.safe_string(order, 'averageExecutedPrice'),
ccxt/coinsph.py CHANGED
@@ -1146,10 +1146,10 @@ class coinsph(Exchange, ImplicitAPI):
1146
1146
  quoteAmount = self.cost_to_precision(symbol, amount)
1147
1147
  request['quoteOrderQty'] = quoteAmount
1148
1148
  if orderType == 'STOP_LOSS' or orderType == 'STOP_LOSS_LIMIT' or orderType == 'TAKE_PROFIT' or orderType == 'TAKE_PROFIT_LIMIT':
1149
- stopPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1150
- if stopPrice is None:
1149
+ triggerPrice = self.safe_string_2(params, 'triggerPrice', 'stopPrice')
1150
+ if triggerPrice is None:
1151
1151
  raise InvalidOrder(self.id + ' createOrder() requires a triggerPrice or stopPrice param for stop_loss, take_profit, stop_loss_limit, and take_profit_limit orders')
1152
- request['stopPrice'] = self.price_to_precision(symbol, stopPrice)
1152
+ request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
1153
1153
  request['newOrderRespType'] = newOrderRespType
1154
1154
  params = self.omit(params, 'price', 'stopPrice', 'triggerPrice', 'quantity', 'quoteOrderQty')
1155
1155
  response = None
@@ -1374,9 +1374,9 @@ class coinsph(Exchange, ImplicitAPI):
1374
1374
  market = self.safe_market(marketId, market)
1375
1375
  timestamp = self.safe_integer_2(order, 'time', 'transactTime')
1376
1376
  trades = self.safe_value(order, 'fills', None)
1377
- stopPrice = self.safe_string(order, 'stopPrice')
1378
- if Precise.string_eq(stopPrice, '0'):
1379
- stopPrice = None
1377
+ triggerPrice = self.safe_string(order, 'stopPrice')
1378
+ if Precise.string_eq(triggerPrice, '0'):
1379
+ triggerPrice = None
1380
1380
  return self.safe_order({
1381
1381
  'id': id,
1382
1382
  'clientOrderId': self.safe_string(order, 'clientOrderId'),
@@ -1389,8 +1389,7 @@ class coinsph(Exchange, ImplicitAPI):
1389
1389
  'timeInForce': self.parse_order_time_in_force(self.safe_string(order, 'timeInForce')),
1390
1390
  'side': self.parse_order_side(self.safe_string(order, 'side')),
1391
1391
  'price': self.safe_string(order, 'price'),
1392
- 'stopPrice': stopPrice,
1393
- 'triggerPrice': stopPrice,
1392
+ 'triggerPrice': triggerPrice,
1394
1393
  'average': None,
1395
1394
  'amount': self.safe_string(order, 'origQty'),
1396
1395
  'cost': self.safe_string(order, 'cummulativeQuoteQty'),
ccxt/cryptocom.py CHANGED
@@ -507,6 +507,9 @@ class cryptocom(Exchange, ImplicitAPI):
507
507
  '40801': RequestTimeout,
508
508
  '42901': RateLimitExceeded,
509
509
  '43005': InvalidOrder, # Rejected POST_ONLY create-order request(normally happened when exec_inst contains POST_ONLY but time_in_force is NOT GOOD_TILL_CANCEL)
510
+ '43003': InvalidOrder, # FOK order has not been filled and cancelled
511
+ '43004': InvalidOrder, # IOC order has not been filled and cancelled
512
+ '43012': BadRequest, # Canceled due to Self Trade Prevention
510
513
  '50001': ExchangeError,
511
514
  '9010001': OnMaintenance, # {"code":9010001,"message":"SYSTEM_MAINTENANCE","details":"Crypto.com Exchange is currently under maintenance. Please refer to https://status.crypto.com for more details."}
512
515
  },
ccxt/currencycom.py CHANGED
@@ -1198,7 +1198,6 @@ class currencycom(Exchange, ImplicitAPI):
1198
1198
  'timeInForce': timeInForce,
1199
1199
  'side': side,
1200
1200
  'price': price,
1201
- 'stopPrice': None,
1202
1201
  'triggerPrice': None,
1203
1202
  'amount': amount,
1204
1203
  'cost': None,
@@ -1296,11 +1295,11 @@ class currencycom(Exchange, ImplicitAPI):
1296
1295
  request['type'] = 'STOP'
1297
1296
  request['price'] = self.price_to_precision(symbol, price)
1298
1297
  elif type == 'market':
1299
- stopPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
1298
+ triggerPrice = self.safe_value_2(params, 'triggerPrice', 'stopPrice')
1300
1299
  params = self.omit(params, ['triggerPrice', 'stopPrice'])
1301
- if stopPrice is not None:
1300
+ if triggerPrice is not None:
1302
1301
  request['type'] = 'STOP'
1303
- request['price'] = self.price_to_precision(symbol, stopPrice)
1302
+ request['price'] = self.price_to_precision(symbol, triggerPrice)
1304
1303
  response = self.privatePostV2Order(self.extend(request, params))
1305
1304
  #
1306
1305
  # limit
ccxt/defx.py CHANGED
@@ -1156,7 +1156,7 @@ class defx(Exchange, ImplicitAPI):
1156
1156
  'type': orderType,
1157
1157
  }
1158
1158
  takeProfitPrice = self.safe_string(params, 'takeProfitPrice')
1159
- stopPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
1159
+ triggerPrice = self.safe_string_2(params, 'stopPrice', 'triggerPrice')
1160
1160
  isMarket = orderType == 'MARKET'
1161
1161
  isLimit = orderType == 'LIMIT'
1162
1162
  timeInForce = self.safe_string_upper(params, 'timeInForce')
@@ -1171,7 +1171,7 @@ class defx(Exchange, ImplicitAPI):
1171
1171
  clientOrderId = self.safe_string(params, 'clientOrderId')
1172
1172
  if clientOrderId is not None:
1173
1173
  request['newClientOrderId'] = clientOrderId
1174
- if stopPrice is not None or takeProfitPrice is not None:
1174
+ if triggerPrice is not None or takeProfitPrice is not None:
1175
1175
  request['workingType'] = 'MARK_PRICE'
1176
1176
  if takeProfitPrice is not None:
1177
1177
  request['stopPrice'] = self.price_to_precision(symbol, takeProfitPrice)
@@ -1180,7 +1180,7 @@ class defx(Exchange, ImplicitAPI):
1180
1180
  else:
1181
1181
  request['type'] = 'TAKE_PROFIT_LIMIT'
1182
1182
  else:
1183
- request['stopPrice'] = self.price_to_precision(symbol, stopPrice)
1183
+ request['stopPrice'] = self.price_to_precision(symbol, triggerPrice)
1184
1184
  if isMarket:
1185
1185
  request['type'] = 'STOP_MARKET'
1186
1186
  else:
@@ -1267,12 +1267,12 @@ class defx(Exchange, ImplicitAPI):
1267
1267
  average = self.omit_zero(self.safe_string(order, 'avgPrice'))
1268
1268
  timeInForce = self.safe_string_lower(order, 'timeInForce')
1269
1269
  takeProfitPrice: Str = None
1270
- stopPrice: Str = None
1270
+ triggerPrice: Str = None
1271
1271
  if orderType is not None:
1272
1272
  if orderType.find('take_profit') >= 0:
1273
1273
  takeProfitPrice = self.safe_string(order, 'stopPrice')
1274
1274
  else:
1275
- stopPrice = self.safe_string(order, 'stopPrice')
1275
+ triggerPrice = self.safe_string(order, 'stopPrice')
1276
1276
  timestamp = self.parse8601(self.safe_string(order, 'createdAt'))
1277
1277
  lastTradeTimestamp = self.parse8601(self.safe_string(order, 'updatedAt'))
1278
1278
  return self.safe_order({
@@ -1290,8 +1290,7 @@ class defx(Exchange, ImplicitAPI):
1290
1290
  'reduceOnly': self.safe_bool(order, 'reduceOnly'),
1291
1291
  'side': side,
1292
1292
  'price': price,
1293
- 'stopPrice': stopPrice,
1294
- 'triggerPrice': stopPrice,
1293
+ 'triggerPrice': triggerPrice,
1295
1294
  'takeProfitPrice': takeProfitPrice,
1296
1295
  'stopLossPrice': None,
1297
1296
  'average': average,