ccxt 4.3.58__py2.py3-none-any.whl → 4.3.60__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +5 -5
- ccxt/abstract/bingx.py +1 -1
- ccxt/abstract/bitmart.py +1 -0
- ccxt/abstract/btcbox.py +1 -0
- ccxt/abstract/upbit.py +3 -0
- ccxt/abstract/xt.py +1 -0
- ccxt/async_support/__init__.py +5 -5
- ccxt/async_support/base/exchange.py +1 -1
- ccxt/async_support/binance.py +91 -2
- ccxt/async_support/bingx.py +448 -123
- ccxt/async_support/bitfinex.py +38 -4
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bitmart.py +1 -0
- ccxt/async_support/bitso.py +4 -1
- ccxt/async_support/btcbox.py +145 -8
- ccxt/async_support/bybit.py +3 -5
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/cryptocom.py +11 -5
- ccxt/async_support/deribit.py +15 -1
- ccxt/async_support/digifinex.py +30 -7
- ccxt/async_support/gate.py +17 -18
- ccxt/async_support/htx.py +7 -7
- ccxt/async_support/hyperliquid.py +107 -3
- ccxt/async_support/kraken.py +2 -2
- ccxt/async_support/mexc.py +11 -11
- ccxt/async_support/novadax.py +1 -1
- ccxt/async_support/okcoin.py +1 -1
- ccxt/async_support/okx.py +11 -2
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/timex.py +16 -2
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +139 -45
- ccxt/async_support/xt.py +71 -8
- ccxt/base/errors.py +23 -23
- ccxt/base/exchange.py +9 -9
- ccxt/binance.py +91 -2
- ccxt/bingx.py +448 -123
- ccxt/bitfinex.py +38 -4
- ccxt/bitget.py +1 -1
- ccxt/bitmart.py +1 -0
- ccxt/bitso.py +4 -1
- ccxt/btcbox.py +145 -8
- ccxt/bybit.py +3 -5
- ccxt/cex.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/cryptocom.py +11 -5
- ccxt/deribit.py +15 -1
- ccxt/digifinex.py +30 -7
- ccxt/gate.py +17 -18
- ccxt/htx.py +7 -7
- ccxt/hyperliquid.py +107 -3
- ccxt/kraken.py +2 -2
- ccxt/mexc.py +11 -11
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +11 -2
- ccxt/phemex.py +1 -1
- ccxt/pro/__init__.py +3 -1
- ccxt/pro/binance.py +11 -13
- ccxt/pro/bingx.py +11 -8
- ccxt/pro/bitmart.py +2 -2
- ccxt/pro/bitopro.py +1 -1
- ccxt/pro/cex.py +1 -1
- ccxt/pro/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/hyperliquid.py +1 -1
- ccxt/pro/kucoin.py +35 -3
- ccxt/pro/phemex.py +1 -1
- ccxt/pro/xt.py +1046 -0
- ccxt/probit.py +1 -1
- ccxt/test/tests_async.py +2 -2
- ccxt/test/tests_helpers.py +1 -1
- ccxt/test/tests_sync.py +2 -2
- ccxt/timex.py +16 -2
- ccxt/tokocrypto.py +1 -1
- ccxt/upbit.py +139 -45
- ccxt/xt.py +71 -8
- {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/METADATA +5 -5
- {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/RECORD +84 -83
- {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/WHEEL +0 -0
- {ccxt-4.3.58.dist-info → ccxt-4.3.60.dist-info}/top_level.txt +0 -0
ccxt/async_support/xt.py
CHANGED
@@ -40,7 +40,7 @@ class xt(Exchange, ImplicitAPI):
|
|
40
40
|
'rateLimit': 100,
|
41
41
|
'version': 'v4',
|
42
42
|
'certified': False,
|
43
|
-
'pro':
|
43
|
+
'pro': True,
|
44
44
|
'has': {
|
45
45
|
'CORS': False,
|
46
46
|
'spot': True,
|
@@ -235,6 +235,7 @@ class xt(Exchange, ImplicitAPI):
|
|
235
235
|
'withdraw': 1,
|
236
236
|
'balance/transfer': 1,
|
237
237
|
'balance/account/transfer': 1,
|
238
|
+
'ws-token': 1,
|
238
239
|
},
|
239
240
|
'delete': {
|
240
241
|
'batch-order': 1,
|
@@ -835,7 +836,7 @@ class xt(Exchange, ImplicitAPI):
|
|
835
836
|
'name': self.safe_string(entry, 'fullName'),
|
836
837
|
'active': active,
|
837
838
|
'fee': self.parse_number(minWithdrawFeeString),
|
838
|
-
'precision':
|
839
|
+
'precision': minPrecision,
|
839
840
|
'deposit': deposit,
|
840
841
|
'withdraw': withdraw,
|
841
842
|
'networks': networks,
|
@@ -1436,8 +1437,12 @@ class xt(Exchange, ImplicitAPI):
|
|
1436
1437
|
orderBook = self.safe_value(response, 'result', {})
|
1437
1438
|
timestamp = self.safe_integer_2(orderBook, 'timestamp', 't')
|
1438
1439
|
if market['spot']:
|
1439
|
-
|
1440
|
-
|
1440
|
+
ob = self.parse_order_book(orderBook, symbol, timestamp)
|
1441
|
+
ob['nonce'] = self.safe_integer(orderBook, 'lastUpdateId')
|
1442
|
+
return ob
|
1443
|
+
swapOb = self.parse_order_book(orderBook, symbol, timestamp, 'b', 'a')
|
1444
|
+
swapOb['nonce'] = self.safe_integer_2(orderBook, 'u', 'lastUpdateId')
|
1445
|
+
return swapOb
|
1441
1446
|
|
1442
1447
|
async def fetch_ticker(self, symbol: str, params={}):
|
1443
1448
|
"""
|
@@ -1680,8 +1685,9 @@ class xt(Exchange, ImplicitAPI):
|
|
1680
1685
|
#
|
1681
1686
|
marketId = self.safe_string(ticker, 's')
|
1682
1687
|
marketType = market['type'] if (market is not None) else None
|
1688
|
+
hasSpotKeys = ('cv' in ticker) or ('aq' in ticker)
|
1683
1689
|
if marketType is None:
|
1684
|
-
marketType =
|
1690
|
+
marketType = 'spot' if hasSpotKeys else 'contract'
|
1685
1691
|
market = self.safe_market(marketId, market, '_', marketType)
|
1686
1692
|
symbol = market['symbol']
|
1687
1693
|
timestamp = self.safe_integer(ticker, 't')
|
@@ -1889,6 +1895,29 @@ class xt(Exchange, ImplicitAPI):
|
|
1889
1895
|
# "b": True
|
1890
1896
|
# }
|
1891
1897
|
#
|
1898
|
+
# spot: watchMyTrades
|
1899
|
+
#
|
1900
|
+
# {
|
1901
|
+
# "s": "btc_usdt", # symbol
|
1902
|
+
# "t": 1656043204763, # time
|
1903
|
+
# "i": "6316559590087251233", # tradeId
|
1904
|
+
# "oi": "6216559590087220004", # orderId
|
1905
|
+
# "p": "30000", # trade price
|
1906
|
+
# "q": "3", # qty quantity
|
1907
|
+
# "v": "90000" # volume trade amount
|
1908
|
+
# }
|
1909
|
+
#
|
1910
|
+
# spot: watchTrades
|
1911
|
+
#
|
1912
|
+
# {
|
1913
|
+
# s: 'btc_usdt',
|
1914
|
+
# i: '228825383103928709',
|
1915
|
+
# t: 1684258222702,
|
1916
|
+
# p: '27003.65',
|
1917
|
+
# q: '0.000796',
|
1918
|
+
# b: True
|
1919
|
+
# }
|
1920
|
+
#
|
1892
1921
|
# swap and future: fetchTrades
|
1893
1922
|
#
|
1894
1923
|
# {
|
@@ -1933,19 +1962,53 @@ class xt(Exchange, ImplicitAPI):
|
|
1933
1962
|
# "takerMaker": "TAKER"
|
1934
1963
|
# }
|
1935
1964
|
#
|
1965
|
+
# contract watchMyTrades
|
1966
|
+
#
|
1967
|
+
# {
|
1968
|
+
# "symbol": 'btc_usdt',
|
1969
|
+
# "orderSide": 'SELL',
|
1970
|
+
# "positionSide": 'LONG',
|
1971
|
+
# "orderId": '231485367663419328',
|
1972
|
+
# "price": '27152.7',
|
1973
|
+
# "quantity": '33',
|
1974
|
+
# "marginUnfrozen": '2.85318000',
|
1975
|
+
# "timestamp": 1684892412565
|
1976
|
+
# }
|
1977
|
+
#
|
1978
|
+
# watchMyTrades(ws, swap)
|
1979
|
+
#
|
1980
|
+
# {
|
1981
|
+
# 'fee': '0.04080840',
|
1982
|
+
# 'isMaker': False,
|
1983
|
+
# 'marginUnfrozen': '0.75711984',
|
1984
|
+
# 'orderId': '376172779053188416',
|
1985
|
+
# 'orderSide': 'BUY',
|
1986
|
+
# 'positionSide': 'LONG',
|
1987
|
+
# 'price': '3400.70',
|
1988
|
+
# 'quantity': '2',
|
1989
|
+
# 'symbol': 'eth_usdt',
|
1990
|
+
# 'timestamp': 1719388579622
|
1991
|
+
# }
|
1992
|
+
#
|
1936
1993
|
marketId = self.safe_string_2(trade, 's', 'symbol')
|
1937
1994
|
marketType = market['type'] if (market is not None) else None
|
1995
|
+
hasSpotKeys = ('b' in trade) or ('bizType' in trade) or ('oi' in trade)
|
1938
1996
|
if marketType is None:
|
1939
|
-
marketType =
|
1997
|
+
marketType = 'spot' if hasSpotKeys else 'contract'
|
1940
1998
|
market = self.safe_market(marketId, market, '_', marketType)
|
1941
1999
|
bidOrAsk = self.safe_string(trade, 'm')
|
1942
2000
|
side = self.safe_string_lower(trade, 'orderSide')
|
1943
2001
|
if bidOrAsk is not None:
|
1944
2002
|
side = 'buy' if (bidOrAsk == 'BID') else 'sell'
|
1945
2003
|
buyerMaker = self.safe_value(trade, 'b')
|
2004
|
+
if buyerMaker is not None:
|
2005
|
+
side = 'buy'
|
1946
2006
|
takerOrMaker = self.safe_string_lower(trade, 'takerMaker')
|
1947
2007
|
if buyerMaker is not None:
|
1948
2008
|
takerOrMaker = 'maker' if buyerMaker else 'taker'
|
2009
|
+
isMaker = self.safe_bool(trade, 'isMaker')
|
2010
|
+
if isMaker is not None:
|
2011
|
+
takerOrMaker = 'maker' if isMaker else 'taker'
|
1949
2012
|
timestamp = self.safe_integer_n(trade, ['t', 'time', 'timestamp'])
|
1950
2013
|
quantity = self.safe_string_2(trade, 'q', 'quantity')
|
1951
2014
|
amount = None
|
@@ -1962,7 +2025,7 @@ class xt(Exchange, ImplicitAPI):
|
|
1962
2025
|
'timestamp': timestamp,
|
1963
2026
|
'datetime': self.iso8601(timestamp),
|
1964
2027
|
'symbol': market['symbol'],
|
1965
|
-
'order': self.
|
2028
|
+
'order': self.safe_string_2(trade, 'orderId', 'oi'),
|
1966
2029
|
'type': self.safe_string_lower(trade, 'orderType'),
|
1967
2030
|
'side': side,
|
1968
2031
|
'takerOrMaker': takerOrMaker,
|
@@ -4419,7 +4482,7 @@ class xt(Exchange, ImplicitAPI):
|
|
4419
4482
|
body['clientMedia'] = id
|
4420
4483
|
else:
|
4421
4484
|
body['media'] = id
|
4422
|
-
isUndefinedBody = ((method == 'GET') or (path == 'order/{orderId}'))
|
4485
|
+
isUndefinedBody = ((method == 'GET') or (path == 'order/{orderId}') or (path == 'ws-token'))
|
4423
4486
|
body = None if isUndefinedBody else self.json(body)
|
4424
4487
|
payloadString = None
|
4425
4488
|
if (endpoint == 'spot') or (endpoint == 'user'):
|
ccxt/base/errors.py
CHANGED
@@ -17,9 +17,6 @@ error_hierarchy = {
|
|
17
17
|
},
|
18
18
|
'MarketClosed': {},
|
19
19
|
},
|
20
|
-
'BadResponse': {
|
21
|
-
'NullResponse': {},
|
22
|
-
},
|
23
20
|
'InsufficientFunds': {},
|
24
21
|
'InvalidAddress': {
|
25
22
|
'AddressPending': {},
|
@@ -27,14 +24,13 @@ error_hierarchy = {
|
|
27
24
|
'InvalidOrder': {
|
28
25
|
'OrderNotFound': {},
|
29
26
|
'OrderNotCached': {},
|
30
|
-
'CancelPending': {},
|
31
27
|
'OrderImmediatelyFillable': {},
|
32
28
|
'OrderNotFillable': {},
|
33
29
|
'DuplicateOrderId': {},
|
34
30
|
'ContractUnavailable': {},
|
35
31
|
},
|
36
32
|
'NotSupported': {},
|
37
|
-
'
|
33
|
+
'InvalidProxySettings': {},
|
38
34
|
'ExchangeClosedByUser': {},
|
39
35
|
},
|
40
36
|
'OperationFailed': {
|
@@ -47,6 +43,10 @@ error_hierarchy = {
|
|
47
43
|
'InvalidNonce': {},
|
48
44
|
'RequestTimeout': {},
|
49
45
|
},
|
46
|
+
'BadResponse': {
|
47
|
+
'NullResponse': {},
|
48
|
+
},
|
49
|
+
'CancelPending': {},
|
50
50
|
},
|
51
51
|
},
|
52
52
|
}
|
@@ -104,14 +104,6 @@ class MarketClosed(OperationRejected):
|
|
104
104
|
pass
|
105
105
|
|
106
106
|
|
107
|
-
class BadResponse(ExchangeError):
|
108
|
-
pass
|
109
|
-
|
110
|
-
|
111
|
-
class NullResponse(BadResponse):
|
112
|
-
pass
|
113
|
-
|
114
|
-
|
115
107
|
class InsufficientFunds(ExchangeError):
|
116
108
|
pass
|
117
109
|
|
@@ -136,10 +128,6 @@ class OrderNotCached(InvalidOrder):
|
|
136
128
|
pass
|
137
129
|
|
138
130
|
|
139
|
-
class CancelPending(InvalidOrder):
|
140
|
-
pass
|
141
|
-
|
142
|
-
|
143
131
|
class OrderImmediatelyFillable(InvalidOrder):
|
144
132
|
pass
|
145
133
|
|
@@ -160,7 +148,7 @@ class NotSupported(ExchangeError):
|
|
160
148
|
pass
|
161
149
|
|
162
150
|
|
163
|
-
class
|
151
|
+
class InvalidProxySettings(ExchangeError):
|
164
152
|
pass
|
165
153
|
|
166
154
|
|
@@ -200,6 +188,18 @@ class RequestTimeout(NetworkError):
|
|
200
188
|
pass
|
201
189
|
|
202
190
|
|
191
|
+
class BadResponse(OperationFailed):
|
192
|
+
pass
|
193
|
+
|
194
|
+
|
195
|
+
class NullResponse(BadResponse):
|
196
|
+
pass
|
197
|
+
|
198
|
+
|
199
|
+
class CancelPending(OperationFailed):
|
200
|
+
pass
|
201
|
+
|
202
|
+
|
203
203
|
__all__ = [
|
204
204
|
'error_hierarchy',
|
205
205
|
'BaseError',
|
@@ -215,21 +215,18 @@ __all__ = [
|
|
215
215
|
'NoChange',
|
216
216
|
'MarginModeAlreadySet',
|
217
217
|
'MarketClosed',
|
218
|
-
'BadResponse',
|
219
|
-
'NullResponse',
|
220
218
|
'InsufficientFunds',
|
221
219
|
'InvalidAddress',
|
222
220
|
'AddressPending',
|
223
221
|
'InvalidOrder',
|
224
222
|
'OrderNotFound',
|
225
223
|
'OrderNotCached',
|
226
|
-
'CancelPending',
|
227
224
|
'OrderImmediatelyFillable',
|
228
225
|
'OrderNotFillable',
|
229
226
|
'DuplicateOrderId',
|
230
227
|
'ContractUnavailable',
|
231
228
|
'NotSupported',
|
232
|
-
'
|
229
|
+
'InvalidProxySettings',
|
233
230
|
'ExchangeClosedByUser',
|
234
231
|
'OperationFailed',
|
235
232
|
'NetworkError',
|
@@ -238,5 +235,8 @@ __all__ = [
|
|
238
235
|
'ExchangeNotAvailable',
|
239
236
|
'OnMaintenance',
|
240
237
|
'InvalidNonce',
|
241
|
-
'RequestTimeout'
|
238
|
+
'RequestTimeout',
|
239
|
+
'BadResponse',
|
240
|
+
'NullResponse',
|
241
|
+
'CancelPending'
|
242
242
|
]
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.60'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -23,7 +23,7 @@ from ccxt.base.errors import NullResponse
|
|
23
23
|
from ccxt.base.errors import RateLimitExceeded
|
24
24
|
from ccxt.base.errors import BadRequest
|
25
25
|
from ccxt.base.errors import BadResponse
|
26
|
-
from ccxt.base.errors import
|
26
|
+
from ccxt.base.errors import InvalidProxySettings
|
27
27
|
|
28
28
|
# -----------------------------------------------------------------------------
|
29
29
|
|
@@ -1943,7 +1943,7 @@ class Exchange(object):
|
|
1943
1943
|
length = len(usedProxies)
|
1944
1944
|
if length > 1:
|
1945
1945
|
joinedProxyNames = ','.join(usedProxies)
|
1946
|
-
raise
|
1946
|
+
raise InvalidProxySettings(self.id + ' you have multiple conflicting proxy settings(' + joinedProxyNames + '), please use only one from : proxyUrl, proxy_url, proxyUrlCallback, proxy_url_callback')
|
1947
1947
|
return proxyUrl
|
1948
1948
|
|
1949
1949
|
def check_proxy_settings(self, url: Str = None, method: Str = None, headers=None, body=None):
|
@@ -1994,7 +1994,7 @@ class Exchange(object):
|
|
1994
1994
|
length = len(usedProxies)
|
1995
1995
|
if length > 1:
|
1996
1996
|
joinedProxyNames = ','.join(usedProxies)
|
1997
|
-
raise
|
1997
|
+
raise InvalidProxySettings(self.id + ' you have multiple conflicting proxy settings(' + joinedProxyNames + '), please use only one from: httpProxy, httpsProxy, httpProxyCallback, httpsProxyCallback, socksProxy, socksProxyCallback')
|
1998
1998
|
return [httpProxy, httpsProxy, socksProxy]
|
1999
1999
|
|
2000
2000
|
def check_ws_proxy_settings(self):
|
@@ -2027,12 +2027,12 @@ class Exchange(object):
|
|
2027
2027
|
length = len(usedProxies)
|
2028
2028
|
if length > 1:
|
2029
2029
|
joinedProxyNames = ','.join(usedProxies)
|
2030
|
-
raise
|
2030
|
+
raise InvalidProxySettings(self.id + ' you have multiple conflicting proxy settings(' + joinedProxyNames + '), please use only one from: wsProxy, wssProxy, wsSocksProxy')
|
2031
2031
|
return [wsProxy, wssProxy, wsSocksProxy]
|
2032
2032
|
|
2033
2033
|
def check_conflicting_proxies(self, proxyAgentSet, proxyUrlSet):
|
2034
2034
|
if proxyAgentSet and proxyUrlSet:
|
2035
|
-
raise
|
2035
|
+
raise InvalidProxySettings(self.id + ' you have multiple conflicting proxy settings, please use only one from : proxyUrl, httpProxy, httpsProxy, socksProxy')
|
2036
2036
|
|
2037
2037
|
def find_message_hashes(self, client, element: str):
|
2038
2038
|
result = []
|
@@ -2258,13 +2258,13 @@ class Exchange(object):
|
|
2258
2258
|
def parse_isolated_borrow_rate(self, info: dict, market: Market = None):
|
2259
2259
|
raise NotSupported(self.id + ' parseIsolatedBorrowRate() is not supported yet')
|
2260
2260
|
|
2261
|
-
def parse_ws_trade(self, trade, market: Market = None):
|
2261
|
+
def parse_ws_trade(self, trade: dict, market: Market = None):
|
2262
2262
|
raise NotSupported(self.id + ' parseWsTrade() is not supported yet')
|
2263
2263
|
|
2264
|
-
def parse_ws_order(self, order, market: Market = None):
|
2264
|
+
def parse_ws_order(self, order: dict, market: Market = None):
|
2265
2265
|
raise NotSupported(self.id + ' parseWsOrder() is not supported yet')
|
2266
2266
|
|
2267
|
-
def parse_ws_order_trade(self, trade, market: Market = None):
|
2267
|
+
def parse_ws_order_trade(self, trade: dict, market: Market = None):
|
2268
2268
|
raise NotSupported(self.id + ' parseWsOrderTrade() is not supported yet')
|
2269
2269
|
|
2270
2270
|
def parse_ws_ohlcv(self, ohlcv, market: Market = None):
|
ccxt/binance.py
CHANGED
@@ -19,7 +19,6 @@ from ccxt.base.errors import BadSymbol
|
|
19
19
|
from ccxt.base.errors import OperationRejected
|
20
20
|
from ccxt.base.errors import MarginModeAlreadySet
|
21
21
|
from ccxt.base.errors import MarketClosed
|
22
|
-
from ccxt.base.errors import BadResponse
|
23
22
|
from ccxt.base.errors import InsufficientFunds
|
24
23
|
from ccxt.base.errors import InvalidOrder
|
25
24
|
from ccxt.base.errors import OrderNotFound
|
@@ -32,6 +31,7 @@ from ccxt.base.errors import RateLimitExceeded
|
|
32
31
|
from ccxt.base.errors import OnMaintenance
|
33
32
|
from ccxt.base.errors import InvalidNonce
|
34
33
|
from ccxt.base.errors import RequestTimeout
|
34
|
+
from ccxt.base.errors import BadResponse
|
35
35
|
from ccxt.base.decimal_to_precision import TRUNCATE
|
36
36
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
37
37
|
from ccxt.base.precise import Precise
|
@@ -6647,22 +6647,64 @@ class binance(Exchange, ImplicitAPI):
|
|
6647
6647
|
response = None
|
6648
6648
|
if market['option']:
|
6649
6649
|
response = self.eapiPrivateDeleteAllOpenOrders(self.extend(request, params))
|
6650
|
+
#
|
6651
|
+
# {
|
6652
|
+
# "code": 0,
|
6653
|
+
# "msg": "success"
|
6654
|
+
# }
|
6655
|
+
#
|
6650
6656
|
elif market['linear']:
|
6651
6657
|
if isPortfolioMargin:
|
6652
6658
|
if isConditional:
|
6653
6659
|
response = self.papiDeleteUmConditionalAllOpenOrders(self.extend(request, params))
|
6660
|
+
#
|
6661
|
+
# {
|
6662
|
+
# "code": "200",
|
6663
|
+
# "msg": "The operation of cancel all conditional open order is done."
|
6664
|
+
# }
|
6665
|
+
#
|
6654
6666
|
else:
|
6655
6667
|
response = self.papiDeleteUmAllOpenOrders(self.extend(request, params))
|
6668
|
+
#
|
6669
|
+
# {
|
6670
|
+
# "code": 200,
|
6671
|
+
# "msg": "The operation of cancel all open order is done."
|
6672
|
+
# }
|
6673
|
+
#
|
6656
6674
|
else:
|
6657
6675
|
response = self.fapiPrivateDeleteAllOpenOrders(self.extend(request, params))
|
6676
|
+
#
|
6677
|
+
# {
|
6678
|
+
# "code": 200,
|
6679
|
+
# "msg": "The operation of cancel all open order is done."
|
6680
|
+
# }
|
6681
|
+
#
|
6658
6682
|
elif market['inverse']:
|
6659
6683
|
if isPortfolioMargin:
|
6660
6684
|
if isConditional:
|
6661
6685
|
response = self.papiDeleteCmConditionalAllOpenOrders(self.extend(request, params))
|
6686
|
+
#
|
6687
|
+
# {
|
6688
|
+
# "code": "200",
|
6689
|
+
# "msg": "The operation of cancel all conditional open order is done."
|
6690
|
+
# }
|
6691
|
+
#
|
6662
6692
|
else:
|
6663
6693
|
response = self.papiDeleteCmAllOpenOrders(self.extend(request, params))
|
6694
|
+
#
|
6695
|
+
# {
|
6696
|
+
# "code": 200,
|
6697
|
+
# "msg": "The operation of cancel all open order is done."
|
6698
|
+
# }
|
6699
|
+
#
|
6664
6700
|
else:
|
6665
6701
|
response = self.dapiPrivateDeleteAllOpenOrders(self.extend(request, params))
|
6702
|
+
#
|
6703
|
+
# {
|
6704
|
+
# "code": 200,
|
6705
|
+
# "msg": "The operation of cancel all open order is done."
|
6706
|
+
# }
|
6707
|
+
#
|
6666
6708
|
elif (type == 'margin') or (marginMode is not None) or isPortfolioMargin:
|
6667
6709
|
if isPortfolioMargin:
|
6668
6710
|
response = self.papiDeleteMarginAllOpenOrders(self.extend(request, params))
|
@@ -6670,12 +6712,59 @@ class binance(Exchange, ImplicitAPI):
|
|
6670
6712
|
if marginMode == 'isolated':
|
6671
6713
|
request['isIsolated'] = True
|
6672
6714
|
response = self.sapiDeleteMarginOpenOrders(self.extend(request, params))
|
6715
|
+
#
|
6716
|
+
# [
|
6717
|
+
# {
|
6718
|
+
# "symbol": "BTCUSDT",
|
6719
|
+
# "isIsolated": True, # if isolated margin
|
6720
|
+
# "origClientOrderId": "E6APeyTJvkMvLMYMqu1KQ4",
|
6721
|
+
# "orderId": 11,
|
6722
|
+
# "orderListId": -1,
|
6723
|
+
# "clientOrderId": "pXLV6Hz6mprAcVYpVMTGgx",
|
6724
|
+
# "price": "0.089853",
|
6725
|
+
# "origQty": "0.178622",
|
6726
|
+
# "executedQty": "0.000000",
|
6727
|
+
# "cummulativeQuoteQty": "0.000000",
|
6728
|
+
# "status": "CANCELED",
|
6729
|
+
# "timeInForce": "GTC",
|
6730
|
+
# "type": "LIMIT",
|
6731
|
+
# "side": "BUY",
|
6732
|
+
# "selfTradePreventionMode": "NONE"
|
6733
|
+
# },
|
6734
|
+
# ...
|
6735
|
+
# ]
|
6736
|
+
#
|
6673
6737
|
else:
|
6674
6738
|
response = self.privateDeleteOpenOrders(self.extend(request, params))
|
6739
|
+
#
|
6740
|
+
# [
|
6741
|
+
# {
|
6742
|
+
# "symbol": "ADAUSDT",
|
6743
|
+
# "origClientOrderId": "x-R4BD3S82662cde7a90114475b86e21",
|
6744
|
+
# "orderId": 3935107,
|
6745
|
+
# "orderListId": -1,
|
6746
|
+
# "clientOrderId": "bqM2w1oTlugfRAjnTIFBE8",
|
6747
|
+
# "transactTime": 1720589016657,
|
6748
|
+
# "price": "0.35000000",
|
6749
|
+
# "origQty": "30.00000000",
|
6750
|
+
# "executedQty": "0.00000000",
|
6751
|
+
# "cummulativeQuoteQty": "0.00000000",
|
6752
|
+
# "status": "CANCELED",
|
6753
|
+
# "timeInForce": "GTC",
|
6754
|
+
# "type": "LIMIT",
|
6755
|
+
# "side": "BUY",
|
6756
|
+
# "selfTradePreventionMode": "EXPIRE_MAKER"
|
6757
|
+
# }
|
6758
|
+
# ]
|
6759
|
+
#
|
6675
6760
|
if isinstance(response, list):
|
6676
6761
|
return self.parse_orders(response, market)
|
6677
6762
|
else:
|
6678
|
-
return
|
6763
|
+
return [
|
6764
|
+
self.safe_order({
|
6765
|
+
'info': response,
|
6766
|
+
}),
|
6767
|
+
]
|
6679
6768
|
|
6680
6769
|
def cancel_orders(self, ids: List[str], symbol: Str = None, params={}):
|
6681
6770
|
"""
|