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.
- ccxt/__init__.py +3 -1
- ccxt/abstract/bingx.py +16 -0
- ccxt/abstract/bitbank.py +5 -0
- ccxt/abstract/bitfinex2.py +1 -0
- ccxt/abstract/coinbaseexchange.py +1 -0
- ccxt/abstract/ellipx.py +25 -0
- ccxt/abstract/kraken.py +1 -0
- ccxt/alpaca.py +2 -0
- ccxt/async_support/__init__.py +3 -1
- ccxt/async_support/alpaca.py +2 -0
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +164 -7
- ccxt/async_support/bingx.py +155 -8
- ccxt/async_support/bitbank.py +5 -0
- ccxt/async_support/bitbns.py +2 -0
- ccxt/async_support/bitfinex2.py +1 -0
- ccxt/async_support/bitget.py +174 -40
- ccxt/async_support/bitmex.py +2 -0
- ccxt/async_support/bitopro.py +3 -0
- ccxt/async_support/bitrue.py +1 -0
- ccxt/async_support/btcmarkets.py +2 -0
- ccxt/async_support/bybit.py +143 -12
- ccxt/async_support/cex.py +16 -5
- ccxt/async_support/coinbase.py +5 -24
- ccxt/async_support/coinbaseexchange.py +2 -1
- ccxt/async_support/coinex.py +2 -0
- ccxt/async_support/coinone.py +7 -7
- ccxt/async_support/coinsph.py +7 -7
- ccxt/async_support/coinspot.py +39 -39
- ccxt/async_support/cryptocom.py +36 -34
- ccxt/async_support/ellipx.py +1828 -0
- ccxt/async_support/gate.py +1 -0
- ccxt/async_support/hyperliquid.py +13 -2
- ccxt/async_support/kraken.py +1 -0
- ccxt/async_support/krakenfutures.py +3 -1
- ccxt/async_support/kucoinfutures.py +1 -1
- ccxt/async_support/lbank.py +1 -0
- ccxt/async_support/okcoin.py +2 -0
- ccxt/async_support/okx.py +103 -8
- ccxt/async_support/onetrading.py +20 -1
- ccxt/async_support/paradex.py +2 -0
- ccxt/async_support/phemex.py +33 -6
- ccxt/async_support/poloniex.py +3 -1
- ccxt/async_support/poloniexfutures.py +3 -1
- ccxt/async_support/vertex.py +2 -0
- ccxt/async_support/woo.py +69 -69
- ccxt/base/exchange.py +100 -2
- ccxt/binance.py +164 -7
- ccxt/bingx.py +155 -8
- ccxt/bitbank.py +5 -0
- ccxt/bitbns.py +2 -0
- ccxt/bitfinex2.py +1 -0
- ccxt/bitget.py +174 -40
- ccxt/bitmex.py +2 -0
- ccxt/bitopro.py +3 -0
- ccxt/bitrue.py +1 -0
- ccxt/btcmarkets.py +2 -0
- ccxt/bybit.py +143 -12
- ccxt/cex.py +16 -5
- ccxt/coinbase.py +5 -24
- ccxt/coinbaseexchange.py +2 -1
- ccxt/coinex.py +2 -0
- ccxt/coinone.py +7 -7
- ccxt/coinsph.py +7 -7
- ccxt/coinspot.py +39 -39
- ccxt/cryptocom.py +36 -34
- ccxt/ellipx.py +1828 -0
- ccxt/gate.py +1 -0
- ccxt/hyperliquid.py +13 -2
- ccxt/kraken.py +1 -0
- ccxt/krakenfutures.py +3 -1
- ccxt/kucoinfutures.py +1 -1
- ccxt/lbank.py +1 -0
- ccxt/okcoin.py +2 -0
- ccxt/okx.py +103 -8
- ccxt/onetrading.py +20 -1
- ccxt/paradex.py +2 -0
- ccxt/phemex.py +33 -6
- ccxt/poloniex.py +3 -1
- ccxt/poloniexfutures.py +3 -1
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/idex.py +15 -0
- ccxt/pro/okx.py +8 -0
- ccxt/pro/probit.py +4 -2
- ccxt/pro/woo.py +15 -15
- ccxt/test/tests_async.py +3 -1
- ccxt/test/tests_helpers.py +1 -3
- ccxt/test/tests_sync.py +3 -1
- ccxt/vertex.py +2 -0
- ccxt/woo.py +69 -69
- {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/METADATA +9 -8
- {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/RECORD +95 -92
- {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/WHEEL +0 -0
- {ccxt-4.4.32.dist-info → ccxt-4.4.34.dist-info}/top_level.txt +0 -0
ccxt/bitget.py
CHANGED
@@ -1461,6 +1461,141 @@ class bitget(Exchange, ImplicitAPI):
|
|
1461
1461
|
},
|
1462
1462
|
'defaultTimeInForce': 'GTC', # 'GTC' = Good To Cancel(default), 'IOC' = Immediate Or Cancel
|
1463
1463
|
},
|
1464
|
+
'features': {
|
1465
|
+
'spot': {
|
1466
|
+
'sandbox': True,
|
1467
|
+
'createOrder': {
|
1468
|
+
'marginMode': True,
|
1469
|
+
'triggerPrice': True,
|
1470
|
+
'triggerPriceType': {
|
1471
|
+
'last': True,
|
1472
|
+
'mark': True,
|
1473
|
+
'index': False, # not on spot
|
1474
|
+
},
|
1475
|
+
'triggerDirection': False,
|
1476
|
+
'stopLossPrice': True, # but not yet implemented in spot
|
1477
|
+
'takeProfitPrice': True, # but not yet implemented in spot
|
1478
|
+
'attachedStopLossTakeProfit': {
|
1479
|
+
'triggerPriceType': {
|
1480
|
+
'last': False,
|
1481
|
+
'mark': False,
|
1482
|
+
'index': False,
|
1483
|
+
},
|
1484
|
+
'limitPrice': True,
|
1485
|
+
},
|
1486
|
+
'timeInForce': {
|
1487
|
+
'GTC': True,
|
1488
|
+
'IOC': True,
|
1489
|
+
'FOK': True,
|
1490
|
+
'PO': True,
|
1491
|
+
'GTD': False,
|
1492
|
+
},
|
1493
|
+
'hedged': False,
|
1494
|
+
'trailing': False,
|
1495
|
+
'marketBuyRequiresPrice': True,
|
1496
|
+
'marketBuyByCost': True,
|
1497
|
+
# exchange-supported features
|
1498
|
+
# 'selfTradePrevention': True,
|
1499
|
+
# 'twap': False,
|
1500
|
+
# 'iceberg': False,
|
1501
|
+
# 'oco': False,
|
1502
|
+
},
|
1503
|
+
'createOrders': {
|
1504
|
+
'max': 50,
|
1505
|
+
},
|
1506
|
+
'fetchMyTrades': {
|
1507
|
+
'marginMode': True,
|
1508
|
+
'limit': 100,
|
1509
|
+
'daysBack': None,
|
1510
|
+
'untilDays': 90,
|
1511
|
+
},
|
1512
|
+
'fetchOrder': {
|
1513
|
+
'marginMode': False,
|
1514
|
+
'trigger': False,
|
1515
|
+
'trailing': False,
|
1516
|
+
},
|
1517
|
+
'fetchOpenOrders': {
|
1518
|
+
'marginMode': True,
|
1519
|
+
'limit': 100,
|
1520
|
+
'trigger': True,
|
1521
|
+
'trailing': False,
|
1522
|
+
},
|
1523
|
+
'fetchOrders': None,
|
1524
|
+
'fetchClosedOrders': {
|
1525
|
+
'marginMode': True,
|
1526
|
+
'limit': 100,
|
1527
|
+
'daysBackClosed': None,
|
1528
|
+
'daysBackCanceled': None,
|
1529
|
+
'untilDays': 90,
|
1530
|
+
'trigger': True,
|
1531
|
+
'trailing': False,
|
1532
|
+
},
|
1533
|
+
'fetchOHLCV': {
|
1534
|
+
'limit': 1000, # variable timespans for recent endpoint, 200 for historical
|
1535
|
+
},
|
1536
|
+
},
|
1537
|
+
'forPerps': {
|
1538
|
+
'extends': 'spot',
|
1539
|
+
'createOrder': {
|
1540
|
+
'triggerPrice': True,
|
1541
|
+
'triggerPriceType': {
|
1542
|
+
'last': True,
|
1543
|
+
'mark': True,
|
1544
|
+
'index': False, # not on spot
|
1545
|
+
},
|
1546
|
+
'triggerDirection': False,
|
1547
|
+
'stopLossPrice': True,
|
1548
|
+
'takeProfitPrice': True,
|
1549
|
+
'attachedStopLossTakeProfit': {
|
1550
|
+
'triggerPriceType': {
|
1551
|
+
'last': True,
|
1552
|
+
'mark': True,
|
1553
|
+
'index': True,
|
1554
|
+
},
|
1555
|
+
'limitPrice': False,
|
1556
|
+
},
|
1557
|
+
'timeInForce': {
|
1558
|
+
'GTC': True,
|
1559
|
+
'IOC': True,
|
1560
|
+
'FOK': True,
|
1561
|
+
'PO': True,
|
1562
|
+
'GTD': False,
|
1563
|
+
},
|
1564
|
+
'hedged': True,
|
1565
|
+
'trailing': True,
|
1566
|
+
'marketBuyRequiresPrice': False,
|
1567
|
+
'marketBuyByCost': False,
|
1568
|
+
# exchange-supported features
|
1569
|
+
# 'selfTradePrevention': True,
|
1570
|
+
# 'trailing': True,
|
1571
|
+
# 'twap': False,
|
1572
|
+
# 'iceberg': False,
|
1573
|
+
# 'oco': False,
|
1574
|
+
},
|
1575
|
+
'fetchMyTrades': {
|
1576
|
+
'untilDays': 7,
|
1577
|
+
},
|
1578
|
+
'fetchClosedOrders': {
|
1579
|
+
'trailing': True,
|
1580
|
+
},
|
1581
|
+
},
|
1582
|
+
'swap': {
|
1583
|
+
'linear': {
|
1584
|
+
'extends': 'forPerps',
|
1585
|
+
},
|
1586
|
+
'inverse': {
|
1587
|
+
'extends': 'forPerps',
|
1588
|
+
},
|
1589
|
+
},
|
1590
|
+
'future': {
|
1591
|
+
'linear': {
|
1592
|
+
'extends': 'forPerps',
|
1593
|
+
},
|
1594
|
+
'inverse': {
|
1595
|
+
'extends': 'forPerps',
|
1596
|
+
},
|
1597
|
+
},
|
1598
|
+
},
|
1464
1599
|
})
|
1465
1600
|
|
1466
1601
|
def set_sandbox_mode(self, enabled):
|
@@ -4121,7 +4256,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4121
4256
|
raise ExchangeError(self.id + ' createOrder() params can only contain one of triggerPrice, stopLossPrice, takeProfitPrice, trailingPercent')
|
4122
4257
|
if type == 'limit':
|
4123
4258
|
request['price'] = self.price_to_precision(symbol, price)
|
4124
|
-
|
4259
|
+
triggerPriceType = self.safe_string_2(params, 'triggerPriceType', 'triggerType', 'mark_price')
|
4125
4260
|
reduceOnly = self.safe_bool(params, 'reduceOnly', False)
|
4126
4261
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
4127
4262
|
exchangeSpecificTifParam = self.safe_string_2(params, 'force', 'timeInForce')
|
@@ -4147,7 +4282,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4147
4282
|
if clientOrderId is not None:
|
4148
4283
|
request['clientOid'] = clientOrderId
|
4149
4284
|
if isTriggerOrder or isStopLossOrTakeProfitTrigger or isTrailingPercentOrder:
|
4150
|
-
request['triggerType'] =
|
4285
|
+
request['triggerType'] = triggerPriceType
|
4151
4286
|
if isTrailingPercentOrder:
|
4152
4287
|
if not isMarketOrder:
|
4153
4288
|
raise BadRequest(self.id + ' createOrder() bitget trailing orders must be market orders')
|
@@ -4256,7 +4391,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4256
4391
|
request['size'] = quantity
|
4257
4392
|
if triggerPrice is not None:
|
4258
4393
|
request['planType'] = planType
|
4259
|
-
request['triggerType'] =
|
4394
|
+
request['triggerType'] = triggerPriceType
|
4260
4395
|
request['triggerPrice'] = self.price_to_precision(symbol, triggerPrice)
|
4261
4396
|
if price is not None:
|
4262
4397
|
request['executePrice'] = self.price_to_precision(symbol, price)
|
@@ -4528,7 +4663,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4528
4663
|
:param str symbol: unified symbol of the market the order was made in
|
4529
4664
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4530
4665
|
:param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
|
4531
|
-
:param boolean [params.
|
4666
|
+
:param boolean [params.trigger]: set to True for canceling trigger orders
|
4532
4667
|
:param str [params.planType]: *swap only* either profit_plan, loss_plan, normal_plan, pos_profit, pos_loss, moving_plan or track_plan
|
4533
4668
|
:param boolean [params.trailing]: set to True if you want to cancel a trailing order
|
4534
4669
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
@@ -4548,17 +4683,17 @@ class bitget(Exchange, ImplicitAPI):
|
|
4548
4683
|
marginMode, params = self.handle_margin_mode_and_params('cancelOrder', params)
|
4549
4684
|
request: dict = {}
|
4550
4685
|
trailing = self.safe_value(params, 'trailing')
|
4551
|
-
|
4686
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
4552
4687
|
params = self.omit(params, ['stop', 'trigger', 'trailing'])
|
4553
|
-
if not (market['spot'] and
|
4688
|
+
if not (market['spot'] and trigger):
|
4554
4689
|
request['symbol'] = market['id']
|
4555
|
-
if not ((market['swap'] or market['future']) and
|
4690
|
+
if not ((market['swap'] or market['future']) and trigger):
|
4556
4691
|
request['orderId'] = id
|
4557
4692
|
if (market['swap']) or (market['future']):
|
4558
4693
|
productType = None
|
4559
4694
|
productType, params = self.handle_product_type_and_params(market, params)
|
4560
4695
|
request['productType'] = productType
|
4561
|
-
if
|
4696
|
+
if trigger or trailing:
|
4562
4697
|
orderIdList = []
|
4563
4698
|
orderId: dict = {
|
4564
4699
|
'orderId': id,
|
@@ -4569,7 +4704,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4569
4704
|
planType = self.safe_string(params, 'planType', 'track_plan')
|
4570
4705
|
request['planType'] = planType
|
4571
4706
|
response = self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
|
4572
|
-
elif
|
4707
|
+
elif trigger:
|
4573
4708
|
response = self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
|
4574
4709
|
else:
|
4575
4710
|
response = self.privateMixPostV2MixOrderCancelOrder(self.extend(request, params))
|
@@ -4580,7 +4715,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4580
4715
|
elif marginMode == 'cross':
|
4581
4716
|
response = self.privateMarginPostV2MarginCrossedCancelOrder(self.extend(request, params))
|
4582
4717
|
else:
|
4583
|
-
if
|
4718
|
+
if trigger:
|
4584
4719
|
response = self.privateSpotPostV2SpotTradeCancelPlanOrder(self.extend(request, params))
|
4585
4720
|
else:
|
4586
4721
|
response = self.privateSpotPostV2SpotTradeCancelOrder(self.extend(request, params))
|
@@ -4629,7 +4764,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4629
4764
|
#
|
4630
4765
|
data = self.safe_value(response, 'data', {})
|
4631
4766
|
order = None
|
4632
|
-
if (market['swap'] or market['future']) and
|
4767
|
+
if (market['swap'] or market['future']) and trigger:
|
4633
4768
|
orderInfo = self.safe_value(data, 'successList', [])
|
4634
4769
|
order = orderInfo[0]
|
4635
4770
|
else:
|
@@ -4650,7 +4785,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4650
4785
|
:param str symbol: unified market symbol, default is None
|
4651
4786
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4652
4787
|
:param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
|
4653
|
-
:param boolean [params.
|
4788
|
+
:param boolean [params.trigger]: *contract only* set to True for canceling trigger orders
|
4654
4789
|
:returns dict: an array of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4655
4790
|
"""
|
4656
4791
|
if symbol is None:
|
@@ -4665,7 +4800,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4665
4800
|
market = self.market(symbol)
|
4666
4801
|
marginMode = None
|
4667
4802
|
marginMode, params = self.handle_margin_mode_and_params('cancelOrders', params)
|
4668
|
-
|
4803
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
4669
4804
|
params = self.omit(params, ['stop', 'trigger'])
|
4670
4805
|
orderIdList = []
|
4671
4806
|
for i in range(0, len(ids)):
|
@@ -4694,7 +4829,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4694
4829
|
productType = None
|
4695
4830
|
productType, params = self.handle_product_type_and_params(market, params)
|
4696
4831
|
request['productType'] = productType
|
4697
|
-
if
|
4832
|
+
if trigger:
|
4698
4833
|
response = self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
|
4699
4834
|
else:
|
4700
4835
|
response = self.privateMixPostV2MixOrderBatchCancelOrders(self.extend(request, params))
|
@@ -4731,7 +4866,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4731
4866
|
:param str symbol: unified market symbol
|
4732
4867
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4733
4868
|
:param str [params.marginMode]: 'isolated' or 'cross' for spot margin trading
|
4734
|
-
:param boolean [params.
|
4869
|
+
:param boolean [params.trigger]: *contract only* set to True for canceling trigger orders
|
4735
4870
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
4736
4871
|
"""
|
4737
4872
|
if symbol is None:
|
@@ -4749,7 +4884,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4749
4884
|
request: dict = {
|
4750
4885
|
'symbol': market['id'],
|
4751
4886
|
}
|
4752
|
-
|
4887
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
4753
4888
|
params = self.omit(params, ['stop', 'trigger'])
|
4754
4889
|
response = None
|
4755
4890
|
if market['spot']:
|
@@ -4775,7 +4910,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4775
4910
|
# }
|
4776
4911
|
#
|
4777
4912
|
else:
|
4778
|
-
if
|
4913
|
+
if trigger:
|
4779
4914
|
stopRequest: dict = {
|
4780
4915
|
'symbolList': [market['id']],
|
4781
4916
|
}
|
@@ -4807,7 +4942,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4807
4942
|
productType = None
|
4808
4943
|
productType, params = self.handle_product_type_and_params(market, params)
|
4809
4944
|
request['productType'] = productType
|
4810
|
-
if
|
4945
|
+
if trigger:
|
4811
4946
|
response = self.privateMixPostV2MixOrderCancelPlanOrder(self.extend(request, params))
|
4812
4947
|
else:
|
4813
4948
|
response = self.privateMixPostV2MixOrderBatchCancelOrders(self.extend(request, params))
|
@@ -4963,7 +5098,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
4963
5098
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4964
5099
|
:param int [params.until]: the latest time in ms to fetch orders for
|
4965
5100
|
: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'
|
4966
|
-
:param boolean [params.
|
5101
|
+
:param boolean [params.trigger]: set to True for fetching trigger orders
|
4967
5102
|
: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)
|
4968
5103
|
:param str [params.isPlan]: *swap only* 'plan' for stop orders and 'profit_loss' for tp/sl orders, default is 'plan'
|
4969
5104
|
:param boolean [params.trailing]: set to True if you want to fetch trailing orders
|
@@ -5001,9 +5136,9 @@ class bitget(Exchange, ImplicitAPI):
|
|
5001
5136
|
return self.fetch_paginated_call_cursor('fetchOpenOrders', symbol, since, limit, params, cursorReceived, 'idLessThan')
|
5002
5137
|
response = None
|
5003
5138
|
trailing = self.safe_bool(params, 'trailing')
|
5004
|
-
|
5139
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
5005
5140
|
planTypeDefined = self.safe_string(params, 'planType') is not None
|
5006
|
-
|
5141
|
+
isTrigger = (trigger or planTypeDefined)
|
5007
5142
|
params = self.omit(params, ['stop', 'trigger', 'trailing'])
|
5008
5143
|
request, params = self.handle_until_option('endTime', request, params)
|
5009
5144
|
if since is not None:
|
@@ -5027,7 +5162,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5027
5162
|
elif marginMode == 'cross':
|
5028
5163
|
response = self.privateMarginGetV2MarginCrossedOpenOrders(self.extend(request, query))
|
5029
5164
|
else:
|
5030
|
-
if
|
5165
|
+
if trigger:
|
5031
5166
|
response = self.privateSpotGetV2SpotTradeCurrentPlanOrder(self.extend(request, query))
|
5032
5167
|
else:
|
5033
5168
|
response = self.privateSpotGetV2SpotTradeUnfilledOrders(self.extend(request, query))
|
@@ -5039,7 +5174,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5039
5174
|
planType = self.safe_string(params, 'planType', 'track_plan')
|
5040
5175
|
request['planType'] = planType
|
5041
5176
|
response = self.privateMixGetV2MixOrderOrdersPlanPending(self.extend(request, query))
|
5042
|
-
elif
|
5177
|
+
elif isTrigger:
|
5043
5178
|
planType = self.safe_string(query, 'planType', 'normal_plan')
|
5044
5179
|
request['planType'] = planType
|
5045
5180
|
response = self.privateMixGetV2MixOrderOrdersPlanPending(self.extend(request, query))
|
@@ -5222,7 +5357,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5222
5357
|
#
|
5223
5358
|
data = self.safe_value(response, 'data')
|
5224
5359
|
if type == 'spot':
|
5225
|
-
if (marginMode is not None) or
|
5360
|
+
if (marginMode is not None) or trigger:
|
5226
5361
|
resultList = self.safe_list(data, 'orderList', [])
|
5227
5362
|
return self.parse_orders(resultList, market, since, limit)
|
5228
5363
|
else:
|
@@ -5326,7 +5461,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5326
5461
|
return self.fetch_paginated_call_cursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, cursorReceived, 'idLessThan')
|
5327
5462
|
response = None
|
5328
5463
|
trailing = self.safe_value(params, 'trailing')
|
5329
|
-
|
5464
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
5330
5465
|
params = self.omit(params, ['stop', 'trigger', 'trailing'])
|
5331
5466
|
request, params = self.handle_until_option('endTime', request, params)
|
5332
5467
|
if since is not None:
|
@@ -5348,20 +5483,19 @@ class bitget(Exchange, ImplicitAPI):
|
|
5348
5483
|
response = self.privateMarginGetV2MarginIsolatedHistoryOrders(self.extend(request, params))
|
5349
5484
|
elif marginMode == 'cross':
|
5350
5485
|
response = self.privateMarginGetV2MarginCrossedHistoryOrders(self.extend(request, params))
|
5486
|
+
elif trigger:
|
5487
|
+
if symbol is None:
|
5488
|
+
raise ArgumentsRequired(self.id + ' fetchCanceledAndClosedOrders() requires a symbol argument')
|
5489
|
+
endTime = self.safe_integer_n(params, ['endTime', 'until'])
|
5490
|
+
params = self.omit(params, ['until'])
|
5491
|
+
if since is None:
|
5492
|
+
since = now - 7776000000
|
5493
|
+
request['startTime'] = since
|
5494
|
+
if endTime is None:
|
5495
|
+
request['endTime'] = now
|
5496
|
+
response = self.privateSpotGetV2SpotTradeHistoryPlanOrder(self.extend(request, params))
|
5351
5497
|
else:
|
5352
|
-
|
5353
|
-
if symbol is None:
|
5354
|
-
raise ArgumentsRequired(self.id + ' fetchCanceledAndClosedOrders() requires a symbol argument')
|
5355
|
-
endTime = self.safe_integer_n(params, ['endTime', 'until'])
|
5356
|
-
params = self.omit(params, ['until'])
|
5357
|
-
if since is None:
|
5358
|
-
since = now - 7776000000
|
5359
|
-
request['startTime'] = since
|
5360
|
-
if endTime is None:
|
5361
|
-
request['endTime'] = now
|
5362
|
-
response = self.privateSpotGetV2SpotTradeHistoryPlanOrder(self.extend(request, params))
|
5363
|
-
else:
|
5364
|
-
response = self.privateSpotGetV2SpotTradeHistoryOrders(self.extend(request, params))
|
5498
|
+
response = self.privateSpotGetV2SpotTradeHistoryOrders(self.extend(request, params))
|
5365
5499
|
else:
|
5366
5500
|
productType = None
|
5367
5501
|
productType, params = self.handle_product_type_and_params(market, params)
|
@@ -5370,7 +5504,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5370
5504
|
planType = self.safe_string(params, 'planType', 'track_plan')
|
5371
5505
|
request['planType'] = planType
|
5372
5506
|
response = self.privateMixGetV2MixOrderOrdersPlanHistory(self.extend(request, params))
|
5373
|
-
elif
|
5507
|
+
elif trigger:
|
5374
5508
|
planType = self.safe_string(params, 'planType', 'normal_plan')
|
5375
5509
|
request['planType'] = planType
|
5376
5510
|
response = self.privateMixGetV2MixOrderOrdersPlanHistory(self.extend(request, params))
|
@@ -5556,7 +5690,7 @@ class bitget(Exchange, ImplicitAPI):
|
|
5556
5690
|
#
|
5557
5691
|
data = self.safe_value(response, 'data', {})
|
5558
5692
|
if marketType == 'spot':
|
5559
|
-
if (marginMode is not None) or
|
5693
|
+
if (marginMode is not None) or trigger:
|
5560
5694
|
return self.parse_orders(self.safe_value(data, 'orderList', []), market, since, limit)
|
5561
5695
|
else:
|
5562
5696
|
return self.parse_orders(self.safe_value(data, 'entrustedList', []), market, since, limit)
|
ccxt/bitmex.py
CHANGED
@@ -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,
|
ccxt/bitopro.py
CHANGED
@@ -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
|
self.load_markets()
|
ccxt/bitrue.py
CHANGED
@@ -531,6 +531,7 @@ class bitrue(Exchange, ImplicitAPI):
|
|
531
531
|
'-4051': InsufficientFunds, # {"code":-4051,"msg":"Isolated balance insufficient."}
|
532
532
|
},
|
533
533
|
'broad': {
|
534
|
+
'Insufficient account balance': InsufficientFunds, # {"code":-2010,"msg":"Insufficient account balance.","data":null}
|
534
535
|
'has no operation privilege': PermissionDenied,
|
535
536
|
'MAX_POSITION': InvalidOrder, # {"code":-2010,"msg":"Filter failure: MAX_POSITION"}
|
536
537
|
},
|
ccxt/btcmarkets.py
CHANGED
@@ -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
|
self.load_markets()
|