ccxt 4.4.39__py2.py3-none-any.whl → 4.4.40__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 +1 -1
- ccxt/ascendex.py +9 -9
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +9 -9
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/base/ws/aiohttp_client.py +2 -2
- ccxt/async_support/binance.py +13 -17
- ccxt/async_support/bingx.py +1 -2
- ccxt/async_support/bit2c.py +0 -1
- ccxt/async_support/bitbank.py +0 -1
- ccxt/async_support/bitbns.py +0 -1
- ccxt/async_support/bitfinex.py +15 -16
- ccxt/async_support/bitfinex1.py +0 -1
- ccxt/async_support/bitflyer.py +0 -1
- ccxt/async_support/bitget.py +1 -2
- ccxt/async_support/bithumb.py +0 -1
- ccxt/async_support/bitmart.py +3 -4
- ccxt/async_support/bitmex.py +5 -6
- ccxt/async_support/bitopro.py +4 -5
- ccxt/async_support/bitrue.py +5 -7
- ccxt/async_support/bitso.py +1 -2
- ccxt/async_support/bitstamp.py +1 -2
- ccxt/async_support/bitteam.py +1 -3
- ccxt/async_support/bitvavo.py +2 -4
- ccxt/async_support/blockchaincom.py +5 -5
- ccxt/async_support/blofin.py +10 -10
- ccxt/async_support/btcalpha.py +0 -1
- ccxt/async_support/btcbox.py +0 -1
- ccxt/async_support/btcmarkets.py +1 -3
- ccxt/async_support/bybit.py +2 -3
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinbase.py +77 -1
- ccxt/async_support/coinbaseexchange.py +1 -1
- ccxt/async_support/coinbaseinternational.py +62 -0
- ccxt/async_support/coincatch.py +1 -1
- ccxt/async_support/coinex.py +9 -9
- ccxt/async_support/coinlist.py +1 -1
- ccxt/async_support/coinmetro.py +1 -1
- ccxt/async_support/cryptocom.py +91 -2
- ccxt/async_support/currencycom.py +1 -1
- ccxt/async_support/defx.py +1 -2
- ccxt/async_support/delta.py +1 -1
- ccxt/async_support/digifinex.py +1 -1
- ccxt/async_support/exmo.py +2 -2
- ccxt/async_support/gate.py +1 -1
- ccxt/async_support/hashkey.py +3 -5
- ccxt/async_support/htx.py +1 -1
- ccxt/async_support/hyperliquid.py +1 -1
- ccxt/async_support/kraken.py +1 -1
- ccxt/async_support/kucoin.py +24 -24
- ccxt/async_support/luno.py +1 -1
- ccxt/async_support/mexc.py +137 -1
- ccxt/async_support/ndax.py +1 -1
- ccxt/async_support/okcoin.py +18 -18
- ccxt/async_support/okx.py +21 -21
- ccxt/async_support/phemex.py +12 -8
- ccxt/async_support/poloniex.py +1 -1
- ccxt/async_support/poloniexfutures.py +6 -6
- ccxt/async_support/vertex.py +11 -11
- ccxt/async_support/woo.py +33 -33
- ccxt/async_support/woofipro.py +24 -24
- ccxt/async_support/xt.py +26 -26
- ccxt/async_support/zonda.py +1 -1
- ccxt/base/exchange.py +13 -16
- ccxt/binance.py +13 -17
- ccxt/bingx.py +1 -2
- ccxt/bit2c.py +0 -1
- ccxt/bitbank.py +0 -1
- ccxt/bitbns.py +0 -1
- ccxt/bitfinex.py +15 -16
- ccxt/bitfinex1.py +0 -1
- ccxt/bitflyer.py +0 -1
- ccxt/bitget.py +1 -2
- ccxt/bithumb.py +0 -1
- ccxt/bitmart.py +3 -4
- ccxt/bitmex.py +5 -6
- ccxt/bitopro.py +4 -5
- ccxt/bitrue.py +5 -7
- ccxt/bitso.py +1 -2
- ccxt/bitstamp.py +1 -2
- ccxt/bitteam.py +1 -3
- ccxt/bitvavo.py +2 -4
- ccxt/blockchaincom.py +5 -5
- ccxt/blofin.py +10 -10
- ccxt/btcalpha.py +0 -1
- ccxt/btcbox.py +0 -1
- ccxt/btcmarkets.py +1 -3
- ccxt/bybit.py +2 -3
- ccxt/cex.py +1 -1
- ccxt/coinbase.py +77 -1
- ccxt/coinbaseexchange.py +1 -1
- ccxt/coinbaseinternational.py +62 -0
- ccxt/coincatch.py +1 -1
- ccxt/coinex.py +9 -9
- ccxt/coinlist.py +1 -1
- ccxt/coinmetro.py +1 -1
- ccxt/cryptocom.py +91 -2
- ccxt/currencycom.py +1 -1
- ccxt/defx.py +1 -2
- ccxt/delta.py +1 -1
- ccxt/digifinex.py +1 -1
- ccxt/exmo.py +2 -2
- ccxt/gate.py +1 -1
- ccxt/hashkey.py +3 -5
- ccxt/htx.py +1 -1
- ccxt/hyperliquid.py +1 -1
- ccxt/kraken.py +1 -1
- ccxt/kucoin.py +24 -24
- ccxt/luno.py +1 -1
- ccxt/mexc.py +137 -1
- ccxt/ndax.py +1 -1
- ccxt/okcoin.py +18 -18
- ccxt/okx.py +21 -21
- ccxt/phemex.py +12 -8
- ccxt/poloniex.py +1 -1
- ccxt/poloniexfutures.py +6 -6
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +1 -1
- ccxt/pro/bybit.py +12 -1
- ccxt/pro/coinex.py +2 -2
- ccxt/pro/gate.py +6 -6
- ccxt/pro/kucoin.py +3 -3
- ccxt/pro/okx.py +11 -11
- ccxt/pro/upbit.py +2 -2
- ccxt/vertex.py +11 -11
- ccxt/woo.py +33 -33
- ccxt/woofipro.py +24 -24
- ccxt/xt.py +26 -26
- ccxt/zonda.py +1 -1
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/METADATA +4 -4
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/RECORD +134 -134
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/WHEEL +0 -0
- {ccxt-4.4.39.dist-info → ccxt-4.4.40.dist-info}/top_level.txt +0 -0
ccxt/mexc.py
CHANGED
@@ -688,6 +688,143 @@ class mexc(Exchange, ImplicitAPI):
|
|
688
688
|
'maxTimeTillEnd': 90 * 86400 * 1000 - 1, # 90 days
|
689
689
|
'broker': 'CCXT',
|
690
690
|
},
|
691
|
+
'features': {
|
692
|
+
'def': {
|
693
|
+
'sandbox': False,
|
694
|
+
'createOrder': {
|
695
|
+
'marginMode': True,
|
696
|
+
'triggerPrice': False,
|
697
|
+
'triggerDirection': False,
|
698
|
+
'triggerPriceType': {
|
699
|
+
'last': False,
|
700
|
+
'mark': False,
|
701
|
+
'index': False,
|
702
|
+
},
|
703
|
+
'stopLossPrice': False, # todo
|
704
|
+
'takeProfitPrice': False,
|
705
|
+
'attachedStopLossTakeProfit': None,
|
706
|
+
'timeInForce': {
|
707
|
+
'IOC': True,
|
708
|
+
'FOK': True,
|
709
|
+
'PO': True,
|
710
|
+
'GTD': False,
|
711
|
+
},
|
712
|
+
'hedged': False,
|
713
|
+
# exchange-supported features
|
714
|
+
'selfTradePrevention': False,
|
715
|
+
'trailing': False,
|
716
|
+
'iceberg': False,
|
717
|
+
},
|
718
|
+
'createOrders': {
|
719
|
+
'max': 20,
|
720
|
+
},
|
721
|
+
'fetchMyTrades': {
|
722
|
+
'marginMode': False,
|
723
|
+
'limit': 100,
|
724
|
+
'daysBack': 30,
|
725
|
+
'untilDays': None,
|
726
|
+
},
|
727
|
+
'fetchOrder': {
|
728
|
+
'marginMode': False,
|
729
|
+
'trigger': False,
|
730
|
+
'trailing': False,
|
731
|
+
},
|
732
|
+
'fetchOpenOrders': {
|
733
|
+
'marginMode': True,
|
734
|
+
'limit': None,
|
735
|
+
'trigger': False,
|
736
|
+
'trailing': False,
|
737
|
+
},
|
738
|
+
'fetchOrders': {
|
739
|
+
'marginMode': True,
|
740
|
+
'limit': 1000,
|
741
|
+
'daysBack': 7,
|
742
|
+
'untilDays': 7,
|
743
|
+
'trigger': False,
|
744
|
+
'trailing': False,
|
745
|
+
},
|
746
|
+
'fetchClosedOrders': {
|
747
|
+
'marginMode': True,
|
748
|
+
'limit': 1000,
|
749
|
+
'daysBackClosed': 7,
|
750
|
+
'daysBackCanceled': 7,
|
751
|
+
'untilDays': 7,
|
752
|
+
'trigger': False,
|
753
|
+
'trailing': False,
|
754
|
+
},
|
755
|
+
'fetchOHLCV': {
|
756
|
+
'limit': 1000,
|
757
|
+
},
|
758
|
+
},
|
759
|
+
'spot': {
|
760
|
+
'extends': 'def',
|
761
|
+
},
|
762
|
+
'forDerivs': {
|
763
|
+
'extends': 'def',
|
764
|
+
'createOrder': {
|
765
|
+
'triggerPrice': True,
|
766
|
+
'triggerPriceType': {
|
767
|
+
'last': True,
|
768
|
+
'mark': True,
|
769
|
+
'index': True,
|
770
|
+
},
|
771
|
+
'triggerDirection': True,
|
772
|
+
'stopLossPrice': False, # todo
|
773
|
+
'takeProfitPrice': False,
|
774
|
+
'hedged': True,
|
775
|
+
},
|
776
|
+
'createOrders': {
|
777
|
+
'max': 50,
|
778
|
+
},
|
779
|
+
'fetchMyTrades': {
|
780
|
+
'marginMode': False,
|
781
|
+
'limit': 100,
|
782
|
+
'daysBack': 90,
|
783
|
+
'untilDays': 90,
|
784
|
+
},
|
785
|
+
'fetchOrder': {
|
786
|
+
'marginMode': False,
|
787
|
+
},
|
788
|
+
'fetchOpenOrders': {
|
789
|
+
'marginMode': False,
|
790
|
+
'limit': 100,
|
791
|
+
'trigger': True,
|
792
|
+
'trailing': False,
|
793
|
+
},
|
794
|
+
'fetchOrders': {
|
795
|
+
'marginMode': False,
|
796
|
+
'limit': 100,
|
797
|
+
'daysBack': 90,
|
798
|
+
'untilDays': 90,
|
799
|
+
'trigger': True,
|
800
|
+
'trailing': False,
|
801
|
+
},
|
802
|
+
'fetchClosedOrders': {
|
803
|
+
'marginMode': False,
|
804
|
+
'limit': 100,
|
805
|
+
'daysBackClosed': 90,
|
806
|
+
'daysBackCanceled': None,
|
807
|
+
'untilDays': 90,
|
808
|
+
'trigger': True,
|
809
|
+
'trailing': False,
|
810
|
+
},
|
811
|
+
'fetchOHLCV': {
|
812
|
+
'limit': 2000,
|
813
|
+
},
|
814
|
+
},
|
815
|
+
'swap': {
|
816
|
+
'linear': {
|
817
|
+
'extends': 'forDerivs',
|
818
|
+
},
|
819
|
+
'inverse': {
|
820
|
+
'extends': 'forDerivs',
|
821
|
+
},
|
822
|
+
},
|
823
|
+
'future': {
|
824
|
+
'linear': None,
|
825
|
+
'inverse': None,
|
826
|
+
},
|
827
|
+
},
|
691
828
|
'commonCurrencies': {
|
692
829
|
'BEYONDPROTOCOL': 'BEYOND',
|
693
830
|
'BIFI': 'BIFIF',
|
@@ -2160,7 +2297,6 @@ class mexc(Exchange, ImplicitAPI):
|
|
2160
2297
|
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
2161
2298
|
:param str [marginMode]: only 'isolated' is supported for spot-margin trading
|
2162
2299
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2163
|
-
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
|
2164
2300
|
:param bool [params.postOnly]: if True, the order will only be posted if it will be a maker order
|
2165
2301
|
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
2166
2302
|
"""
|
ccxt/ndax.py
CHANGED
@@ -1194,7 +1194,7 @@ class ndax(Exchange, ImplicitAPI):
|
|
1194
1194
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
1195
1195
|
:param int [limit]: max number of ledger entries to return, default is None
|
1196
1196
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1197
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
1197
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
1198
1198
|
"""
|
1199
1199
|
omsId = self.safe_integer(self.options, 'omsId', 1)
|
1200
1200
|
self.load_markets()
|
ccxt/okcoin.py
CHANGED
@@ -1563,16 +1563,16 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1563
1563
|
:param str id: order id
|
1564
1564
|
:param str symbol: unified symbol of the market the order was made in
|
1565
1565
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1566
|
-
:param bool [params.
|
1566
|
+
:param bool [params.trigger]: True if cancel trigger or conditional orders
|
1567
1567
|
:param bool [params.advanced]: True if canceling advanced orders only
|
1568
1568
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1569
1569
|
"""
|
1570
1570
|
if symbol is None:
|
1571
1571
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1572
1572
|
self.load_markets()
|
1573
|
-
|
1573
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1574
1574
|
advanced = self.safe_value(params, 'advanced')
|
1575
|
-
if
|
1575
|
+
if trigger or advanced:
|
1576
1576
|
orderInner = self.cancel_orders([id], symbol, params)
|
1577
1577
|
return self.safe_value(orderInner, 0)
|
1578
1578
|
market = self.market(symbol)
|
@@ -1620,7 +1620,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1620
1620
|
if symbol is None:
|
1621
1621
|
raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
|
1622
1622
|
self.load_markets()
|
1623
|
-
|
1623
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1624
1624
|
advanced = self.safe_value(params, 'advanced')
|
1625
1625
|
params = self.omit(params, ['stop', 'trigger', 'advanced'])
|
1626
1626
|
market = self.market(symbol)
|
@@ -1636,7 +1636,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1636
1636
|
'instId': market['id'],
|
1637
1637
|
})
|
1638
1638
|
for i in range(0, len(ids)):
|
1639
|
-
if
|
1639
|
+
if trigger or advanced:
|
1640
1640
|
request.append({
|
1641
1641
|
'algoId': ids[i],
|
1642
1642
|
'instId': market['id'],
|
@@ -1653,7 +1653,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1653
1653
|
'clOrdId': clientOrderIds[i],
|
1654
1654
|
})
|
1655
1655
|
response = None
|
1656
|
-
if
|
1656
|
+
if trigger:
|
1657
1657
|
response = self.privatePostTradeCancelAlgos(request)
|
1658
1658
|
elif advanced:
|
1659
1659
|
response = self.privatePostTradeCancelAdvanceAlgos(request)
|
@@ -1901,8 +1901,8 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1901
1901
|
# 'ordId': id,
|
1902
1902
|
}
|
1903
1903
|
clientOrderId = self.safe_string_2(params, 'clOrdId', 'clientOrderId')
|
1904
|
-
|
1905
|
-
if
|
1904
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1905
|
+
if trigger:
|
1906
1906
|
if clientOrderId is not None:
|
1907
1907
|
request['algoClOrdId'] = clientOrderId
|
1908
1908
|
else:
|
@@ -1914,7 +1914,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1914
1914
|
request['ordId'] = id
|
1915
1915
|
query = self.omit(params, ['clientOrderId', 'stop', 'trigger'])
|
1916
1916
|
response = None
|
1917
|
-
if
|
1917
|
+
if trigger:
|
1918
1918
|
response = self.privateGetTradeOrderAlgo(self.extend(request, query))
|
1919
1919
|
else:
|
1920
1920
|
response = self.privateGetTradeOrder(self.extend(request, query))
|
@@ -1933,7 +1933,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1933
1933
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1934
1934
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1935
1935
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1936
|
-
:param bool [params.
|
1936
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
1937
1937
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
1938
1938
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1939
1939
|
"""
|
@@ -1953,12 +1953,12 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1953
1953
|
if limit is not None:
|
1954
1954
|
request['limit'] = limit # default 100, max 100
|
1955
1955
|
ordType = self.safe_string(params, 'ordType')
|
1956
|
-
|
1957
|
-
if
|
1956
|
+
trigger = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
|
1957
|
+
if trigger and (ordType is None):
|
1958
1958
|
request['ordType'] = 'trigger' # default to trigger
|
1959
1959
|
params = self.omit(params, ['stop'])
|
1960
1960
|
response = None
|
1961
|
-
if
|
1961
|
+
if trigger:
|
1962
1962
|
response = self.privateGetTradeOrdersAlgoPending(self.extend(request, params))
|
1963
1963
|
else:
|
1964
1964
|
response = self.privateGetTradeOrdersPending(self.extend(request, params))
|
@@ -1977,7 +1977,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1977
1977
|
:param int [since]: the earliest time in ms to fetch orders for
|
1978
1978
|
:param int [limit]: the maximum number of order structures to retrieve
|
1979
1979
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1980
|
-
:param bool [params.
|
1980
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
1981
1981
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
1982
1982
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1983
1983
|
"""
|
@@ -1990,12 +1990,12 @@ class okcoin(Exchange, ImplicitAPI):
|
|
1990
1990
|
market = self.market(symbol)
|
1991
1991
|
request['instId'] = market['id']
|
1992
1992
|
ordType = self.safe_string(params, 'ordType')
|
1993
|
-
|
1994
|
-
if
|
1993
|
+
trigger = self.safe_value(params, 'stop') or (self.safe_string(params, 'ordType') is not None)
|
1994
|
+
if trigger and (ordType is None):
|
1995
1995
|
request['ordType'] = 'trigger' # default to trigger
|
1996
1996
|
params = self.omit(params, ['stop'])
|
1997
1997
|
response = None
|
1998
|
-
if
|
1998
|
+
if trigger:
|
1999
1999
|
response = self.privateGetTradeOrdersAlgoHistory(self.extend(request, params))
|
2000
2000
|
else:
|
2001
2001
|
method = None
|
@@ -2726,7 +2726,7 @@ class okcoin(Exchange, ImplicitAPI):
|
|
2726
2726
|
:param int [since]: timestamp in ms of the earliest ledger entry, default is None
|
2727
2727
|
:param int [limit]: max number of ledger entries to return, default is None
|
2728
2728
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
2729
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
2729
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
2730
2730
|
"""
|
2731
2731
|
self.load_markets()
|
2732
2732
|
method = None
|
ccxt/okx.py
CHANGED
@@ -3254,9 +3254,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3254
3254
|
"""
|
3255
3255
|
if symbol is None:
|
3256
3256
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
3257
|
-
|
3257
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3258
3258
|
trailing = self.safe_bool(params, 'trailing', False)
|
3259
|
-
if
|
3259
|
+
if trigger or trailing:
|
3260
3260
|
orderInner = self.cancel_orders([id], symbol, params)
|
3261
3261
|
return self.safe_value(orderInner, 0)
|
3262
3262
|
self.load_markets()
|
@@ -3314,9 +3314,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3314
3314
|
method = self.safe_string(params, 'method', defaultMethod)
|
3315
3315
|
clientOrderIds = self.parse_ids(self.safe_value_2(params, 'clOrdId', 'clientOrderId'))
|
3316
3316
|
algoIds = self.parse_ids(self.safe_value(params, 'algoId'))
|
3317
|
-
|
3317
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3318
3318
|
trailing = self.safe_bool(params, 'trailing', False)
|
3319
|
-
if
|
3319
|
+
if trigger or trailing:
|
3320
3320
|
method = 'privatePostTradeCancelAlgos'
|
3321
3321
|
if clientOrderIds is None:
|
3322
3322
|
ids = self.parse_ids(ids)
|
@@ -3327,7 +3327,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3327
3327
|
'instId': market['id'],
|
3328
3328
|
})
|
3329
3329
|
for i in range(0, len(ids)):
|
3330
|
-
if trailing or
|
3330
|
+
if trailing or trigger:
|
3331
3331
|
request.append({
|
3332
3332
|
'algoId': ids[i],
|
3333
3333
|
'instId': market['id'],
|
@@ -3398,9 +3398,9 @@ class okx(Exchange, ImplicitAPI):
|
|
3398
3398
|
options = self.safe_dict(self.options, 'cancelOrders', {})
|
3399
3399
|
defaultMethod = self.safe_string(options, 'method', 'privatePostTradeCancelBatchOrders')
|
3400
3400
|
method = self.safe_string(params, 'method', defaultMethod)
|
3401
|
-
|
3401
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
3402
3402
|
trailing = self.safe_bool(params, 'trailing', False)
|
3403
|
-
isStopOrTrailing =
|
3403
|
+
isStopOrTrailing = trigger or trailing
|
3404
3404
|
if isStopOrTrailing:
|
3405
3405
|
method = 'privatePostTradeCancelAlgos'
|
3406
3406
|
for i in range(0, len(orders)):
|
@@ -3723,8 +3723,8 @@ class okx(Exchange, ImplicitAPI):
|
|
3723
3723
|
options = self.safe_value(self.options, 'fetchOrder', {})
|
3724
3724
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrder')
|
3725
3725
|
method = self.safe_string(params, 'method', defaultMethod)
|
3726
|
-
|
3727
|
-
if
|
3726
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3727
|
+
if trigger:
|
3728
3728
|
method = 'privateGetTradeOrderAlgo'
|
3729
3729
|
if clientOrderId is not None:
|
3730
3730
|
request['algoClOrdId'] = clientOrderId
|
@@ -3852,7 +3852,7 @@ class okx(Exchange, ImplicitAPI):
|
|
3852
3852
|
:param int [since]: the earliest time in ms to fetch open orders for
|
3853
3853
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
3854
3854
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3855
|
-
:param bool [params.
|
3855
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
3856
3856
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
3857
3857
|
:param str [params.algoId]: Algo ID "'433845797218942976'"
|
3858
3858
|
:param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
@@ -3885,13 +3885,13 @@ class okx(Exchange, ImplicitAPI):
|
|
3885
3885
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersPending')
|
3886
3886
|
method = self.safe_string(params, 'method', defaultMethod)
|
3887
3887
|
ordType = self.safe_string(params, 'ordType')
|
3888
|
-
|
3888
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
3889
3889
|
trailing = self.safe_bool(params, 'trailing', False)
|
3890
|
-
if trailing or
|
3890
|
+
if trailing or trigger or (ordType in algoOrderTypes):
|
3891
3891
|
method = 'privateGetTradeOrdersAlgoPending'
|
3892
3892
|
if trailing:
|
3893
3893
|
request['ordType'] = 'move_order_stop'
|
3894
|
-
elif
|
3894
|
+
elif trigger and (ordType is None):
|
3895
3895
|
request['ordType'] = 'trigger'
|
3896
3896
|
query = self.omit(params, ['method', 'stop', 'trigger', 'trailing'])
|
3897
3897
|
response = None
|
@@ -4008,7 +4008,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4008
4008
|
:param int [since]: timestamp in ms of the earliest order, default is None
|
4009
4009
|
:param int [limit]: max number of orders to return, default is None
|
4010
4010
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
4011
|
-
:param bool [params.
|
4011
|
+
:param bool [params.trigger]: True if fetching trigger or conditional orders
|
4012
4012
|
:param str [params.ordType]: "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"
|
4013
4013
|
:param str [params.algoId]: Algo ID "'433845797218942976'"
|
4014
4014
|
:param int [params.until]: timestamp in ms to fetch orders for
|
@@ -4043,18 +4043,18 @@ class okx(Exchange, ImplicitAPI):
|
|
4043
4043
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersHistory')
|
4044
4044
|
method = self.safe_string(params, 'method', defaultMethod)
|
4045
4045
|
ordType = self.safe_string(params, 'ordType')
|
4046
|
-
|
4046
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
4047
4047
|
trailing = self.safe_bool(params, 'trailing', False)
|
4048
4048
|
if trailing:
|
4049
4049
|
method = 'privateGetTradeOrdersAlgoHistory'
|
4050
4050
|
request['ordType'] = 'move_order_stop'
|
4051
|
-
elif
|
4051
|
+
elif trigger or (ordType in algoOrderTypes):
|
4052
4052
|
method = 'privateGetTradeOrdersAlgoHistory'
|
4053
4053
|
algoId = self.safe_string(params, 'algoId')
|
4054
4054
|
if algoId is not None:
|
4055
4055
|
request['algoId'] = algoId
|
4056
4056
|
params = self.omit(params, 'algoId')
|
4057
|
-
if
|
4057
|
+
if trigger:
|
4058
4058
|
if ordType is None:
|
4059
4059
|
raise ArgumentsRequired(self.id + ' fetchCanceledOrders() requires an "ordType" string parameter, "conditional", "oco", "trigger", "move_order_stop", "iceberg", or "twap"')
|
4060
4060
|
else:
|
@@ -4224,14 +4224,14 @@ class okx(Exchange, ImplicitAPI):
|
|
4224
4224
|
defaultMethod = self.safe_string(options, 'method', 'privateGetTradeOrdersHistory')
|
4225
4225
|
method = self.safe_string(params, 'method', defaultMethod)
|
4226
4226
|
ordType = self.safe_string(params, 'ordType')
|
4227
|
-
|
4227
|
+
trigger = self.safe_bool_2(params, 'stop', 'trigger')
|
4228
4228
|
trailing = self.safe_bool(params, 'trailing', False)
|
4229
|
-
if trailing or
|
4229
|
+
if trailing or trigger or (ordType in algoOrderTypes):
|
4230
4230
|
method = 'privateGetTradeOrdersAlgoHistory'
|
4231
4231
|
request['state'] = 'effective'
|
4232
4232
|
if trailing:
|
4233
4233
|
request['ordType'] = 'move_order_stop'
|
4234
|
-
elif
|
4234
|
+
elif trigger:
|
4235
4235
|
if ordType is None:
|
4236
4236
|
request['ordType'] = 'trigger'
|
4237
4237
|
else:
|
@@ -4453,7 +4453,7 @@ class okx(Exchange, ImplicitAPI):
|
|
4453
4453
|
:param str [params.marginMode]: 'cross' or 'isolated'
|
4454
4454
|
:param int [params.until]: the latest time in ms to fetch entries for
|
4455
4455
|
: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)
|
4456
|
-
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger
|
4456
|
+
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger>`
|
4457
4457
|
"""
|
4458
4458
|
self.load_markets()
|
4459
4459
|
paginate = False
|
ccxt/phemex.py
CHANGED
@@ -2804,15 +2804,15 @@ class phemex(Exchange, ImplicitAPI):
|
|
2804
2804
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
2805
2805
|
self.load_markets()
|
2806
2806
|
market = self.market(symbol)
|
2807
|
-
|
2808
|
-
params = self.omit(params, 'stop', 'trigger')
|
2807
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger', False)
|
2808
|
+
params = self.omit(params, ['stop', 'trigger'])
|
2809
2809
|
request: dict = {
|
2810
2810
|
'symbol': market['id'],
|
2811
2811
|
# 'untriggerred': False, # False to cancel non-conditional orders, True to cancel conditional orders
|
2812
2812
|
# 'text': 'up to 40 characters max',
|
2813
2813
|
}
|
2814
|
-
if
|
2815
|
-
request['untriggerred'] =
|
2814
|
+
if trigger:
|
2815
|
+
request['untriggerred'] = trigger
|
2816
2816
|
response = None
|
2817
2817
|
if market['settle'] == 'USDT':
|
2818
2818
|
response = self.privateDeleteGOrdersAll(self.extend(request, params))
|
@@ -3894,19 +3894,23 @@ class phemex(Exchange, ImplicitAPI):
|
|
3894
3894
|
marketId = self.safe_string(contract, 'symbol')
|
3895
3895
|
symbol = self.safe_symbol(marketId, market)
|
3896
3896
|
timestamp = self.safe_integer_product(contract, 'timestamp', 0.000001)
|
3897
|
+
markEp = self.from_ep(self.safe_string(contract, 'markEp'), market)
|
3898
|
+
indexEp = self.from_ep(self.safe_string(contract, 'indexEp'), market)
|
3899
|
+
fundingRateEr = self.from_er(self.safe_string(contract, 'fundingRateEr'), market)
|
3900
|
+
nextFundingRateEr = self.from_er(self.safe_string(contract, 'predFundingRateEr'), market)
|
3897
3901
|
return {
|
3898
3902
|
'info': contract,
|
3899
3903
|
'symbol': symbol,
|
3900
|
-
'markPrice': self.
|
3901
|
-
'indexPrice': self.
|
3904
|
+
'markPrice': self.safe_number(contract, 'markPriceRp', markEp),
|
3905
|
+
'indexPrice': self.safe_number(contract, 'indexPriceRp', indexEp),
|
3902
3906
|
'interestRate': None,
|
3903
3907
|
'estimatedSettlePrice': None,
|
3904
3908
|
'timestamp': timestamp,
|
3905
3909
|
'datetime': self.iso8601(timestamp),
|
3906
|
-
'fundingRate': self.
|
3910
|
+
'fundingRate': self.safe_number(contract, 'fundingRateRr', fundingRateEr),
|
3907
3911
|
'fundingTimestamp': None,
|
3908
3912
|
'fundingDatetime': None,
|
3909
|
-
'nextFundingRate': self.
|
3913
|
+
'nextFundingRate': self.safe_number(contract, 'predFundingRateRr', nextFundingRateEr),
|
3910
3914
|
'nextFundingTimestamp': None,
|
3911
3915
|
'nextFundingDatetime': None,
|
3912
3916
|
'previousFundingRate': None,
|
ccxt/poloniex.py
CHANGED
@@ -1201,7 +1201,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1201
1201
|
:param int [since]: the earliest time in ms to fetch open orders for
|
1202
1202
|
:param int [limit]: the maximum number of open orders structures to retrieve
|
1203
1203
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1204
|
-
:param boolean [params.
|
1204
|
+
:param boolean [params.trigger]: set True to fetch trigger orders instead of regular orders
|
1205
1205
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1206
1206
|
"""
|
1207
1207
|
self.load_markets()
|
ccxt/poloniexfutures.py
CHANGED
@@ -1180,17 +1180,17 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1180
1180
|
cancel all open orders
|
1181
1181
|
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
|
1182
1182
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1183
|
-
:param dict [params.
|
1183
|
+
:param dict [params.trigger]: When True, all the trigger orders will be cancelled
|
1184
1184
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1185
1185
|
"""
|
1186
1186
|
self.load_markets()
|
1187
1187
|
request: dict = {}
|
1188
1188
|
if symbol is not None:
|
1189
1189
|
request['symbol'] = self.market_id(symbol)
|
1190
|
-
|
1190
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1191
1191
|
params = self.omit(params, ['stop', 'trigger'])
|
1192
1192
|
response = None
|
1193
|
-
if
|
1193
|
+
if trigger:
|
1194
1194
|
response = self.privateDeleteStopOrders(self.extend(request, params))
|
1195
1195
|
else:
|
1196
1196
|
response = self.privateDeleteOrders(self.extend(request, params))
|
@@ -1254,13 +1254,13 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1254
1254
|
:returns: An `array of order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1255
1255
|
"""
|
1256
1256
|
self.load_markets()
|
1257
|
-
|
1257
|
+
trigger = self.safe_value_2(params, 'stop', 'trigger')
|
1258
1258
|
until = self.safe_integer(params, 'until')
|
1259
1259
|
params = self.omit(params, ['trigger', 'stop', 'until'])
|
1260
1260
|
if status == 'closed':
|
1261
1261
|
status = 'done'
|
1262
1262
|
request: dict = {}
|
1263
|
-
if not
|
1263
|
+
if not trigger:
|
1264
1264
|
request['status'] = 'active' if (status == 'open') else 'done'
|
1265
1265
|
elif status != 'open':
|
1266
1266
|
raise BadRequest(self.id + ' fetchOrdersByStatus() can only fetch untriggered stop orders')
|
@@ -1273,7 +1273,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1273
1273
|
if until is not None:
|
1274
1274
|
request['endAt'] = until
|
1275
1275
|
response = None
|
1276
|
-
if
|
1276
|
+
if trigger:
|
1277
1277
|
response = self.privateGetStopOrders(self.extend(request, params))
|
1278
1278
|
else:
|
1279
1279
|
response = self.privateGetOrders(self.extend(request, params))
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/bitget.py
CHANGED
@@ -1090,7 +1090,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1090
1090
|
:param int [since]: the earliest time in ms to fetch orders for
|
1091
1091
|
:param int [limit]: the maximum number of order structures to retrieve
|
1092
1092
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
1093
|
-
:param boolean [params.
|
1093
|
+
:param boolean [params.trigger]: *contract only* set to True for watching trigger orders
|
1094
1094
|
:param str [params.marginMode]: 'isolated' or 'cross' for watching spot margin orders]
|
1095
1095
|
:param str [params.type]: 'spot', 'swap'
|
1096
1096
|
:param str [params.subType]: 'linear', 'inverse'
|
ccxt/pro/bybit.py
CHANGED
@@ -117,6 +117,12 @@ class bybit(ccxt.async_support.bybit):
|
|
117
117
|
'fetchPositionsSnapshot': True, # or False
|
118
118
|
'awaitPositionsSnapshot': True, # whether to wait for the positions snapshot before providing updates
|
119
119
|
},
|
120
|
+
'watchMyTrades': {
|
121
|
+
# filter execType: https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
122
|
+
'filterExecTypes': [
|
123
|
+
'Trade', 'AdlTrade', 'BustTrade', 'Settle',
|
124
|
+
],
|
125
|
+
},
|
120
126
|
'spot': {
|
121
127
|
'timeframes': {
|
122
128
|
'1m': '1m',
|
@@ -309,7 +315,7 @@ class bybit(ccxt.async_support.bybit):
|
|
309
315
|
:param str id: order id
|
310
316
|
:param str symbol: unified symbol of the market the order was made in
|
311
317
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
312
|
-
:param boolean [params.
|
318
|
+
:param boolean [params.trigger]: *spot only* whether the order is a trigger order
|
313
319
|
:param str [params.orderFilter]: *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
314
320
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
315
321
|
"""
|
@@ -1306,12 +1312,17 @@ class bybit(ccxt.async_support.bybit):
|
|
1306
1312
|
self.myTrades = ArrayCacheBySymbolById(limit)
|
1307
1313
|
trades = self.myTrades
|
1308
1314
|
symbols: dict = {}
|
1315
|
+
filterExecTypes = self.handle_option('watchMyTrades', 'filterExecTypes', [])
|
1309
1316
|
for i in range(0, len(data)):
|
1310
1317
|
rawTrade = data[i]
|
1311
1318
|
parsed = None
|
1312
1319
|
if spot:
|
1313
1320
|
parsed = self.parse_ws_trade(rawTrade)
|
1314
1321
|
else:
|
1322
|
+
# filter unified trades
|
1323
|
+
execType = self.safe_string(rawTrade, 'execType', '')
|
1324
|
+
if not self.in_array(execType, filterExecTypes):
|
1325
|
+
continue
|
1315
1326
|
parsed = self.parse_trade(rawTrade)
|
1316
1327
|
symbol = parsed['symbol']
|
1317
1328
|
symbols[symbol] = True
|
ccxt/pro/coinex.py
CHANGED
@@ -859,7 +859,7 @@ class coinex(ccxt.async_support.coinex):
|
|
859
859
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
860
860
|
"""
|
861
861
|
await self.load_markets()
|
862
|
-
|
862
|
+
trigger = self.safe_bool_2(params, 'trigger', 'stop')
|
863
863
|
params = self.omit(params, ['trigger', 'stop'])
|
864
864
|
messageHash = 'orders'
|
865
865
|
market = None
|
@@ -880,7 +880,7 @@ class coinex(ccxt.async_support.coinex):
|
|
880
880
|
else:
|
881
881
|
messageHash += ':swap'
|
882
882
|
method = None
|
883
|
-
if
|
883
|
+
if trigger:
|
884
884
|
method = 'stop.subscribe'
|
885
885
|
else:
|
886
886
|
method = 'order.subscribe'
|