ccxt 4.4.32__py2.py3-none-any.whl → 4.4.34__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 (95) hide show
  1. ccxt/__init__.py +3 -1
  2. ccxt/abstract/bingx.py +16 -0
  3. ccxt/abstract/bitbank.py +5 -0
  4. ccxt/abstract/bitfinex2.py +1 -0
  5. ccxt/abstract/coinbaseexchange.py +1 -0
  6. ccxt/abstract/ellipx.py +25 -0
  7. ccxt/abstract/kraken.py +1 -0
  8. ccxt/alpaca.py +2 -0
  9. ccxt/async_support/__init__.py +3 -1
  10. ccxt/async_support/alpaca.py +2 -0
  11. ccxt/async_support/base/exchange.py +1 -1
  12. ccxt/async_support/binance.py +164 -7
  13. ccxt/async_support/bingx.py +155 -8
  14. ccxt/async_support/bitbank.py +5 -0
  15. ccxt/async_support/bitbns.py +2 -0
  16. ccxt/async_support/bitfinex2.py +1 -0
  17. ccxt/async_support/bitget.py +174 -40
  18. ccxt/async_support/bitmex.py +2 -0
  19. ccxt/async_support/bitopro.py +3 -0
  20. ccxt/async_support/bitrue.py +1 -0
  21. ccxt/async_support/btcmarkets.py +2 -0
  22. ccxt/async_support/bybit.py +143 -12
  23. ccxt/async_support/cex.py +16 -5
  24. ccxt/async_support/coinbase.py +5 -24
  25. ccxt/async_support/coinbaseexchange.py +2 -1
  26. ccxt/async_support/coinex.py +2 -0
  27. ccxt/async_support/coinone.py +7 -7
  28. ccxt/async_support/coinsph.py +7 -7
  29. ccxt/async_support/coinspot.py +39 -39
  30. ccxt/async_support/cryptocom.py +36 -34
  31. ccxt/async_support/ellipx.py +1828 -0
  32. ccxt/async_support/gate.py +1 -0
  33. ccxt/async_support/hyperliquid.py +13 -2
  34. ccxt/async_support/kraken.py +1 -0
  35. ccxt/async_support/krakenfutures.py +3 -1
  36. ccxt/async_support/kucoinfutures.py +1 -1
  37. ccxt/async_support/lbank.py +1 -0
  38. ccxt/async_support/okcoin.py +2 -0
  39. ccxt/async_support/okx.py +103 -8
  40. ccxt/async_support/onetrading.py +20 -1
  41. ccxt/async_support/paradex.py +2 -0
  42. ccxt/async_support/phemex.py +33 -6
  43. ccxt/async_support/poloniex.py +3 -1
  44. ccxt/async_support/poloniexfutures.py +3 -1
  45. ccxt/async_support/vertex.py +2 -0
  46. ccxt/async_support/woo.py +69 -69
  47. ccxt/base/exchange.py +100 -2
  48. ccxt/binance.py +164 -7
  49. ccxt/bingx.py +155 -8
  50. ccxt/bitbank.py +5 -0
  51. ccxt/bitbns.py +2 -0
  52. ccxt/bitfinex2.py +1 -0
  53. ccxt/bitget.py +174 -40
  54. ccxt/bitmex.py +2 -0
  55. ccxt/bitopro.py +3 -0
  56. ccxt/bitrue.py +1 -0
  57. ccxt/btcmarkets.py +2 -0
  58. ccxt/bybit.py +143 -12
  59. ccxt/cex.py +16 -5
  60. ccxt/coinbase.py +5 -24
  61. ccxt/coinbaseexchange.py +2 -1
  62. ccxt/coinex.py +2 -0
  63. ccxt/coinone.py +7 -7
  64. ccxt/coinsph.py +7 -7
  65. ccxt/coinspot.py +39 -39
  66. ccxt/cryptocom.py +36 -34
  67. ccxt/ellipx.py +1828 -0
  68. ccxt/gate.py +1 -0
  69. ccxt/hyperliquid.py +13 -2
  70. ccxt/kraken.py +1 -0
  71. ccxt/krakenfutures.py +3 -1
  72. ccxt/kucoinfutures.py +1 -1
  73. ccxt/lbank.py +1 -0
  74. ccxt/okcoin.py +2 -0
  75. ccxt/okx.py +103 -8
  76. ccxt/onetrading.py +20 -1
  77. ccxt/paradex.py +2 -0
  78. ccxt/phemex.py +33 -6
  79. ccxt/poloniex.py +3 -1
  80. ccxt/poloniexfutures.py +3 -1
  81. ccxt/pro/__init__.py +1 -1
  82. ccxt/pro/idex.py +15 -0
  83. ccxt/pro/okx.py +8 -0
  84. ccxt/pro/probit.py +4 -2
  85. ccxt/pro/woo.py +15 -15
  86. ccxt/test/tests_async.py +3 -1
  87. ccxt/test/tests_helpers.py +1 -3
  88. ccxt/test/tests_sync.py +3 -1
  89. ccxt/vertex.py +2 -0
  90. ccxt/woo.py +69 -69
  91. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/METADATA +9 -8
  92. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/RECORD +95 -92
  93. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/LICENSE.txt +0 -0
  94. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/WHEEL +0 -0
  95. {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/top_level.txt +0 -0
@@ -1462,6 +1462,141 @@ class bitget(Exchange, ImplicitAPI):
1462
1462
  },
1463
1463
  'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
1464
1464
  },
1465
+ 'features': {
1466
+ 'spot': {
1467
+ 'sandbox': True,
1468
+ 'createOrder': {
1469
+ 'marginMode': True,
1470
+ 'triggerPrice': True,
1471
+ 'triggerPriceType': {
1472
+ 'last': True,
1473
+ 'mark': True,
1474
+ 'index': False, # not on spot
1475
+ },
1476
+ 'triggerDirection': False,
1477
+ 'stopLossPrice': True, # but not yet implemented in spot
1478
+ 'takeProfitPrice': True, # but not yet implemented in spot
1479
+ 'attachedStopLossTakeProfit': {
1480
+ 'triggerPriceType': {
1481
+ 'last': False,
1482
+ 'mark': False,
1483
+ 'index': False,
1484
+ },
1485
+ 'limitPrice': True,
1486
+ },
1487
+ 'timeInForce': {
1488
+ 'GTC': True,
1489
+ 'IOC': True,
1490
+ 'FOK': True,
1491
+ 'PO': True,
1492
+ 'GTD': False,
1493
+ },
1494
+ 'hedged': False,
1495
+ 'trailing': False,
1496
+ 'marketBuyRequiresPrice': True,
1497
+ 'marketBuyByCost': True,
1498
+ # exchange-supported features
1499
+ # 'selfTradePrevention': True,
1500
+ # 'twap': False,
1501
+ # 'iceberg': False,
1502
+ # 'oco': False,
1503
+ },
1504
+ 'createOrders': {
1505
+ 'max': 50,
1506
+ },
1507
+ 'fetchMyTrades': {
1508
+ 'marginMode': True,
1509
+ 'limit': 100,
1510
+ 'daysBack': None,
1511
+ 'untilDays': 90,
1512
+ },
1513
+ 'fetchOrder': {
1514
+ 'marginMode': False,
1515
+ 'trigger': False,
1516
+ 'trailing': False,
1517
+ },
1518
+ 'fetchOpenOrders': {
1519
+ 'marginMode': True,
1520
+ 'limit': 100,
1521
+ 'trigger': True,
1522
+ 'trailing': False,
1523
+ },
1524
+ 'fetchOrders': None,
1525
+ 'fetchClosedOrders': {
1526
+ 'marginMode': True,
1527
+ 'limit': 100,
1528
+ 'daysBackClosed': None,
1529
+ 'daysBackCanceled': None,
1530
+ 'untilDays': 90,
1531
+ 'trigger': True,
1532
+ 'trailing': False,
1533
+ },
1534
+ 'fetchOHLCV': {
1535
+ 'limit': 1000, # variable timespans for recent endpoint, 200 for historical
1536
+ },
1537
+ },
1538
+ 'forPerps': {
1539
+ 'extends': 'spot',
1540
+ 'createOrder': {
1541
+ 'triggerPrice': True,
1542
+ 'triggerPriceType': {
1543
+ 'last': True,
1544
+ 'mark': True,
1545
+ 'index': False, # not on spot
1546
+ },
1547
+ 'triggerDirection': False,
1548
+ 'stopLossPrice': True,
1549
+ 'takeProfitPrice': True,
1550
+ 'attachedStopLossTakeProfit': {
1551
+ 'triggerPriceType': {
1552
+ 'last': True,
1553
+ 'mark': True,
1554
+ 'index': True,
1555
+ },
1556
+ 'limitPrice': False,
1557
+ },
1558
+ 'timeInForce': {
1559
+ 'GTC': True,
1560
+ 'IOC': True,
1561
+ 'FOK': True,
1562
+ 'PO': True,
1563
+ 'GTD': False,
1564
+ },
1565
+ 'hedged': True,
1566
+ 'trailing': True,
1567
+ 'marketBuyRequiresPrice': False,
1568
+ 'marketBuyByCost': False,
1569
+ # exchange-supported features
1570
+ # 'selfTradePrevention': True,
1571
+ # 'trailing': True,
1572
+ # 'twap': False,
1573
+ # 'iceberg': False,
1574
+ # 'oco': False,
1575
+ },
1576
+ 'fetchMyTrades': {
1577
+ 'untilDays': 7,
1578
+ },
1579
+ 'fetchClosedOrders': {
1580
+ 'trailing': True,
1581
+ },
1582
+ },
1583
+ 'swap': {
1584
+ 'linear': {
1585
+ 'extends': 'forPerps',
1586
+ },
1587
+ 'inverse': {
1588
+ 'extends': 'forPerps',
1589
+ },
1590
+ },
1591
+ 'future': {
1592
+ 'linear': {
1593
+ 'extends': 'forPerps',
1594
+ },
1595
+ 'inverse': {
1596
+ 'extends': 'forPerps',
1597
+ },
1598
+ },
1599
+ },
1465
1600
  })
1466
1601
 
1467
1602
  def set_sandbox_mode(self, enabled):
@@ -4122,7 +4257,7 @@ class bitget(Exchange, ImplicitAPI):
4122
4257
  raise ExchangeError(self.id + ' createOrder() params can only contain one of triggerPrice, stopLossPrice, takeProfitPrice, trailingPercent')
4123
4258
  if type == 'limit':
4124
4259
  request['price'] = self.price_to_precision(symbol, price)
4125
- triggerType = self.safe_string(params, 'triggerType', 'mark_price')
4260
+ triggerPriceType = self.safe_string_2(params, 'triggerPriceType', 'triggerType', 'mark_price')
4126
4261
  reduceOnly = self.safe_bool(params, 'reduceOnly', False)
4127
4262
  clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
4128
4263
  exchangeSpecificTifParam = self.safe_string_2(params, 'force', 'timeInForce')
@@ -4148,7 +4283,7 @@ class bitget(Exchange, ImplicitAPI):
4148
4283
  if clientOrderId is not None:
4149
4284
  request['clientOid'] = clientOrderId
4150
4285
  if isTriggerOrder or isStopLossOrTakeProfitTrigger or isTrailingPercentOrder:
4151
- request['triggerType'] = triggerType
4286
+ request['triggerType'] = triggerPriceType
4152
4287
  if isTrailingPercentOrder:
4153
4288
  if not isMarketOrder:
4154
4289
  raise BadRequest(self.id + ' createOrder() bitget trailing orders must be market orders')
@@ -4257,7 +4392,7 @@ class bitget(Exchange, ImplicitAPI):
4257
4392
  request['size'] = quantity
4258
4393
  if triggerPrice is not None:
4259
4394
  request['planType'] = planType
4260
- request['triggerType'] = triggerType
4395
+ request['triggerType'] = triggerPriceType
4261
4396
  request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
4262
4397
  if price is not None:
4263
4398
  request['executePrice'] = self.price_to_precision(symbol, price)
@@ -4529,7 +4664,7 @@ class bitget(Exchange, ImplicitAPI):
4529
4664
  :param str symbol: unified symbol of the market the order was made in
4530
4665
  :param dict [params]: extra parameters specific to the exchange API endpoint
4531
4666
  :param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
4532
- :param boolean [params.stop]: set to True for canceling trigger orders
4667
+ :param boolean [params.trigger]: set to True for canceling trigger orders
4533
4668
  :param str [params.planType]: *swap only* either profit_plan, loss_plan, normal_plan, pos_profit, pos_loss, moving_plan or track_plan
4534
4669
  :param boolean [params.trailing]: set to True if you want to cancel a trailing order
4535
4670
  :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
@@ -4549,17 +4684,17 @@ class bitget(Exchange, ImplicitAPI):
4549
4684
  marginMode, params = self.handle_margin_mode_and_params('cancelOrder', params)
4550
4685
  request: dict = {}
4551
4686
  trailing = self.safe_value(params, 'trailing')
4552
- stop = self.safe_value_2(params, 'stop', 'trigger')
4687
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
4553
4688
  params = self.omit(params, ['stop', 'trigger', 'trailing'])
4554
- if not (market['spot'] and stop):
4689
+ if not (market['spot'] and trigger):
4555
4690
  request['symbol'] = market['id']
4556
- if not ((market['swap'] or market['future']) and stop):
4691
+ if not ((market['swap'] or market['future']) and trigger):
4557
4692
  request['orderId'] = id
4558
4693
  if (market['swap']) or (market['future']):
4559
4694
  productType = None
4560
4695
  productType, params = self.handle_product_type_and_params(market, params)
4561
4696
  request['productType'] = productType
4562
- if stop or trailing:
4697
+ if trigger or trailing:
4563
4698
  orderIdList = []
4564
4699
  orderId: dict = {
4565
4700
  'orderId': id,
@@ -4570,7 +4705,7 @@ class bitget(Exchange, ImplicitAPI):
4570
4705
  planType = self.safe_string(params, 'planType', 'track_plan')
4571
4706
  request['planType'] = planType
4572
4707
  response = await self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
4573
- elif stop:
4708
+ elif trigger:
4574
4709
  response = await self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
4575
4710
  else:
4576
4711
  response = await self.privateMixPostV2MixOrderCancelOrder(self.extend(request, params))
@@ -4581,7 +4716,7 @@ class bitget(Exchange, ImplicitAPI):
4581
4716
  elif marginMode == 'cross':
4582
4717
  response = await self.privateMarginPostV2MarginCrossedCancelOrder(self.extend(request, params))
4583
4718
  else:
4584
- if stop:
4719
+ if trigger:
4585
4720
  response = await self.privateSpotPostV2SpotTradeCancelPlanOrder(self.extend(request, params))
4586
4721
  else:
4587
4722
  response = await self.privateSpotPostV2SpotTradeCancelOrder(self.extend(request, params))
@@ -4630,7 +4765,7 @@ class bitget(Exchange, ImplicitAPI):
4630
4765
  #
4631
4766
  data = self.safe_value(response, 'data', {})
4632
4767
  order = None
4633
- if (market['swap'] or market['future']) and stop:
4768
+ if (market['swap'] or market['future']) and trigger:
4634
4769
  orderInfo = self.safe_value(data, 'successList', [])
4635
4770
  order = orderInfo[0]
4636
4771
  else:
@@ -4651,7 +4786,7 @@ class bitget(Exchange, ImplicitAPI):
4651
4786
  :param str symbol: unified market symbol, default is None
4652
4787
  :param dict [params]: extra parameters specific to the exchange API endpoint
4653
4788
  :param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
4654
- :param boolean [params.stop]: *contract only* set to True for canceling trigger orders
4789
+ :param boolean [params.trigger]: *contract only* set to True for canceling trigger orders
4655
4790
  :returns dict: an array of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
4656
4791
  """
4657
4792
  if symbol is None:
@@ -4666,7 +4801,7 @@ class bitget(Exchange, ImplicitAPI):
4666
4801
  market = self.market(symbol)
4667
4802
  marginMode = None
4668
4803
  marginMode, params = self.handle_margin_mode_and_params('cancelOrders', params)
4669
- stop = self.safe_value_2(params, 'stop', 'trigger')
4804
+ trigger = self.safe_value_2(params, 'stop', 'trigger')
4670
4805
  params = self.omit(params, ['stop', 'trigger'])
4671
4806
  orderIdList = []
4672
4807
  for i in range(0, len(ids)):
@@ -4695,7 +4830,7 @@ class bitget(Exchange, ImplicitAPI):
4695
4830
  productType = None
4696
4831
  productType, params = self.handle_product_type_and_params(market, params)
4697
4832
  request['productType'] = productType
4698
- if stop:
4833
+ if trigger:
4699
4834
  response = await self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
4700
4835
  else:
4701
4836
  response = await self.privateMixPostV2MixOrderBatchCancelOrders(self.extend(request, params))
@@ -4732,7 +4867,7 @@ class bitget(Exchange, ImplicitAPI):
4732
4867
  :param str symbol: unified market symbol
4733
4868
  :param dict [params]: extra parameters specific to the exchange API endpoint
4734
4869
  :param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
4735
- :param boolean [params.stop]: *contract only* set to True for canceling trigger orders
4870
+ :param boolean [params.trigger]: *contract only* set to True for canceling trigger orders
4736
4871
  :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
4737
4872
  """
4738
4873
  if symbol is None:
@@ -4750,7 +4885,7 @@ class bitget(Exchange, ImplicitAPI):
4750
4885
  request: dict = {
4751
4886
  'symbol': market['id'],
4752
4887
  }
4753
- stop = self.safe_bool_2(params, 'stop', 'trigger')
4888
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
4754
4889
  params = self.omit(params, ['stop', 'trigger'])
4755
4890
  response = None
4756
4891
  if market['spot']:
@@ -4776,7 +4911,7 @@ class bitget(Exchange, ImplicitAPI):
4776
4911
  # }
4777
4912
  #
4778
4913
  else:
4779
- if stop:
4914
+ if trigger:
4780
4915
  stopRequest: dict = {
4781
4916
  'symbolList': [market['id']],
4782
4917
  }
@@ -4808,7 +4943,7 @@ class bitget(Exchange, ImplicitAPI):
4808
4943
  productType = None
4809
4944
  productType, params = self.handle_product_type_and_params(market, params)
4810
4945
  request['productType'] = productType
4811
- if stop:
4946
+ if trigger:
4812
4947
  response = await self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
4813
4948
  else:
4814
4949
  response = await self.privateMixPostV2MixOrderBatchCancelOrders(self.extend(request, params))
@@ -4964,7 +5099,7 @@ class bitget(Exchange, ImplicitAPI):
4964
5099
  :param dict [params]: extra parameters specific to the exchange API endpoint
4965
5100
  :param int [params.until]: the latest time in ms to fetch orders for
4966
5101
  :param str [params.planType]: *contract stop only* 'normal_plan': average trigger order, 'profit_loss': opened tp/sl orders, 'track_plan': trailing stop order, default is 'normal_plan'
4967
- :param boolean [params.stop]: set to True for fetching trigger orders
5102
+ :param boolean [params.trigger]: set to True for fetching trigger orders
4968
5103
  :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
4969
5104
  :param str [params.isPlan]: *swap only* 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan'
4970
5105
  :param boolean [params.trailing]: set to True if you want to fetch trailing orders
@@ -5002,9 +5137,9 @@ class bitget(Exchange, ImplicitAPI):
5002
5137
  return await self.fetch_paginated_call_cursor('fetchOpenOrders', symbol, since, limit, params, cursorReceived, 'idLessThan')
5003
5138
  response = None
5004
5139
  trailing = self.safe_bool(params, 'trailing')
5005
- stop = self.safe_bool_2(params, 'stop', 'trigger')
5140
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
5006
5141
  planTypeDefined = self.safe_string(params, 'planType') is not None
5007
- isStop = (stop or planTypeDefined)
5142
+ isTrigger = (trigger or planTypeDefined)
5008
5143
  params = self.omit(params, ['stop', 'trigger', 'trailing'])
5009
5144
  request, params = self.handle_until_option('endTime', request, params)
5010
5145
  if since is not None:
@@ -5028,7 +5163,7 @@ class bitget(Exchange, ImplicitAPI):
5028
5163
  elif marginMode == 'cross':
5029
5164
  response = await self.privateMarginGetV2MarginCrossedOpenOrders(self.extend(request, query))
5030
5165
  else:
5031
- if stop:
5166
+ if trigger:
5032
5167
  response = await self.privateSpotGetV2SpotTradeCurrentPlanOrder(self.extend(request, query))
5033
5168
  else:
5034
5169
  response = await self.privateSpotGetV2SpotTradeUnfilledOrders(self.extend(request, query))
@@ -5040,7 +5175,7 @@ class bitget(Exchange, ImplicitAPI):
5040
5175
  planType = self.safe_string(params, 'planType', 'track_plan')
5041
5176
  request['planType'] = planType
5042
5177
  response = await self.privateMixGetV2MixOrderOrdersPlanPending(self.extend(request, query))
5043
- elif isStop:
5178
+ elif isTrigger:
5044
5179
  planType = self.safe_string(query, 'planType', 'normal_plan')
5045
5180
  request['planType'] = planType
5046
5181
  response = await self.privateMixGetV2MixOrderOrdersPlanPending(self.extend(request, query))
@@ -5223,7 +5358,7 @@ class bitget(Exchange, ImplicitAPI):
5223
5358
  #
5224
5359
  data = self.safe_value(response, 'data')
5225
5360
  if type == 'spot':
5226
- if (marginMode is not None) or stop:
5361
+ if (marginMode is not None) or trigger:
5227
5362
  resultList = self.safe_list(data, 'orderList', [])
5228
5363
  return self.parse_orders(resultList, market, since, limit)
5229
5364
  else:
@@ -5327,7 +5462,7 @@ class bitget(Exchange, ImplicitAPI):
5327
5462
  return await self.fetch_paginated_call_cursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, cursorReceived, 'idLessThan')
5328
5463
  response = None
5329
5464
  trailing = self.safe_value(params, 'trailing')
5330
- stop = self.safe_bool_2(params, 'stop', 'trigger')
5465
+ trigger = self.safe_bool_2(params, 'stop', 'trigger')
5331
5466
  params = self.omit(params, ['stop', 'trigger', 'trailing'])
5332
5467
  request, params = self.handle_until_option('endTime', request, params)
5333
5468
  if since is not None:
@@ -5349,20 +5484,19 @@ class bitget(Exchange, ImplicitAPI):
5349
5484
  response = await self.privateMarginGetV2MarginIsolatedHistoryOrders(self.extend(request, params))
5350
5485
  elif marginMode == 'cross':
5351
5486
  response = await self.privateMarginGetV2MarginCrossedHistoryOrders(self.extend(request, params))
5487
+ elif trigger:
5488
+ if symbol is None:
5489
+ raise ArgumentsRequired(self.id + ' fetchCanceledAndClosedOrders() requires a symbol argument')
5490
+ endTime = self.safe_integer_n(params, ['endTime', 'until'])
5491
+ params = self.omit(params, ['until'])
5492
+ if since is None:
5493
+ since = now - 7776000000
5494
+ request['startTime'] = since
5495
+ if endTime is None:
5496
+ request['endTime'] = now
5497
+ response = await self.privateSpotGetV2SpotTradeHistoryPlanOrder(self.extend(request, params))
5352
5498
  else:
5353
- if stop:
5354
- if symbol is None:
5355
- raise ArgumentsRequired(self.id + ' fetchCanceledAndClosedOrders() requires a symbol argument')
5356
- endTime = self.safe_integer_n(params, ['endTime', 'until'])
5357
- params = self.omit(params, ['until'])
5358
- if since is None:
5359
- since = now - 7776000000
5360
- request['startTime'] = since
5361
- if endTime is None:
5362
- request['endTime'] = now
5363
- response = await self.privateSpotGetV2SpotTradeHistoryPlanOrder(self.extend(request, params))
5364
- else:
5365
- response = await self.privateSpotGetV2SpotTradeHistoryOrders(self.extend(request, params))
5499
+ response = await self.privateSpotGetV2SpotTradeHistoryOrders(self.extend(request, params))
5366
5500
  else:
5367
5501
  productType = None
5368
5502
  productType, params = self.handle_product_type_and_params(market, params)
@@ -5371,7 +5505,7 @@ class bitget(Exchange, ImplicitAPI):
5371
5505
  planType = self.safe_string(params, 'planType', 'track_plan')
5372
5506
  request['planType'] = planType
5373
5507
  response = await self.privateMixGetV2MixOrderOrdersPlanHistory(self.extend(request, params))
5374
- elif stop:
5508
+ elif trigger:
5375
5509
  planType = self.safe_string(params, 'planType', 'normal_plan')
5376
5510
  request['planType'] = planType
5377
5511
  response = await self.privateMixGetV2MixOrderOrdersPlanHistory(self.extend(request, params))
@@ -5557,7 +5691,7 @@ class bitget(Exchange, ImplicitAPI):
5557
5691
  #
5558
5692
  data = self.safe_value(response, 'data', {})
5559
5693
  if marketType == 'spot':
5560
- if (marginMode is not None) or stop:
5694
+ if (marginMode is not None) or trigger:
5561
5695
  return self.parse_orders(self.safe_value(data, 'orderList', []), market, since, limit)
5562
5696
  else:
5563
5697
  return self.parse_orders(self.safe_value(data, 'entrustedList', []), market, since, limit)
@@ -55,7 +55,9 @@ class bitmex(Exchange, ImplicitAPI):
55
55
  'closePosition': True,
56
56
  'createOrder': True,
57
57
  'createReduceOnlyOrder': True,
58
+ 'createStopOrder': True,
58
59
  'createTrailingAmountOrder': True,
60
+ 'createTriggerOrder': True,
59
61
  'editOrder': True,
60
62
  'fetchBalance': True,
61
63
  'fetchClosedOrders': True,
@@ -42,6 +42,8 @@ class bitopro(Exchange, ImplicitAPI):
42
42
  'closeAllPositions': False,
43
43
  'closePosition': False,
44
44
  'createOrder': True,
45
+ 'createStopOrder': True,
46
+ 'createTriggerOrder': True,
45
47
  'editOrder': False,
46
48
  'fetchBalance': True,
47
49
  'fetchBorrowRateHistories': False,
@@ -986,6 +988,7 @@ class bitopro(Exchange, ImplicitAPI):
986
988
  :param float amount: how much of currency you want to trade in units of base currency
987
989
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
988
990
  :param dict [params]: extra parameters specific to the exchange API endpoint
991
+ :param dict [params.triggerPrice]: the price at which a trigger order is triggered at
989
992
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
990
993
  """
991
994
  await self.load_markets()
@@ -532,6 +532,7 @@ class bitrue(Exchange, ImplicitAPI):
532
532
  '-4051': InsufficientFunds, # {"code":-4051,"msg":"Isolated balance insufficient."}
533
533
  },
534
534
  'broad': {
535
+ 'Insufficient account balance': InsufficientFunds, # {"code":-2010,"msg":"Insufficient account balance.","data":null}
535
536
  'has no operation privilege': PermissionDenied,
536
537
  'MAX_POSITION': InvalidOrder, # {"code":-2010,"msg":"Filter failure: MAX_POSITION"}
537
538
  },
@@ -42,6 +42,7 @@ class btcmarkets(Exchange, ImplicitAPI):
42
42
  'createDepositAddress': False,
43
43
  'createOrder': True,
44
44
  'createReduceOnlyOrder': False,
45
+ 'createTriggerOrder': True,
45
46
  'fetchBalance': True,
46
47
  'fetchBorrowRateHistories': False,
47
48
  'fetchBorrowRateHistory': False,
@@ -787,6 +788,7 @@ class btcmarkets(Exchange, ImplicitAPI):
787
788
  :param float amount: how much of currency you want to trade in units of base currency
788
789
  :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
789
790
  :param dict [params]: extra parameters specific to the exchange API endpoint
791
+ :param float [params.triggerPrice]: the price at which a trigger order is triggered at
790
792
  :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
791
793
  """
792
794
  await self.load_markets()