ccxt 4.3.58__py2.py3-none-any.whl → 4.3.59__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 +5 -5
- 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 +1 -1
- ccxt/async_support/bingx.py +47 -7
- ccxt/async_support/bitget.py +1 -1
- ccxt/async_support/bitmart.py +1 -0
- ccxt/async_support/btcbox.py +145 -8
- ccxt/async_support/bybit.py +2 -2
- ccxt/async_support/cex.py +1 -1
- ccxt/async_support/coinsph.py +1 -1
- ccxt/async_support/deribit.py +15 -1
- ccxt/async_support/digifinex.py +30 -7
- ccxt/async_support/gate.py +16 -16
- ccxt/async_support/htx.py +7 -7
- ccxt/async_support/hyperliquid.py +106 -2
- ccxt/async_support/kraken.py +1 -1
- 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 +1 -1
- ccxt/async_support/phemex.py +1 -1
- ccxt/async_support/probit.py +1 -1
- ccxt/async_support/tokocrypto.py +1 -1
- ccxt/async_support/upbit.py +139 -45
- ccxt/async_support/xt.py +70 -7
- ccxt/base/errors.py +23 -23
- ccxt/base/exchange.py +9 -9
- ccxt/binance.py +1 -1
- ccxt/bingx.py +47 -7
- ccxt/bitget.py +1 -1
- ccxt/bitmart.py +1 -0
- ccxt/btcbox.py +145 -8
- ccxt/bybit.py +2 -2
- ccxt/cex.py +1 -1
- ccxt/coinsph.py +1 -1
- ccxt/deribit.py +15 -1
- ccxt/digifinex.py +30 -7
- ccxt/gate.py +16 -16
- ccxt/htx.py +7 -7
- ccxt/hyperliquid.py +106 -2
- ccxt/kraken.py +1 -1
- ccxt/mexc.py +11 -11
- ccxt/novadax.py +1 -1
- ccxt/okcoin.py +1 -1
- ccxt/okx.py +1 -1
- 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/coincheck.py +1 -1
- ccxt/pro/coinone.py +1 -1
- ccxt/pro/hyperliquid.py +1 -1
- ccxt/pro/xt.py +1043 -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/tokocrypto.py +1 -1
- ccxt/upbit.py +139 -45
- ccxt/xt.py +70 -7
- {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/METADATA +5 -5
- {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/RECORD +72 -71
- {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/LICENSE.txt +0 -0
- {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/WHEEL +0 -0
- {ccxt-4.3.58.dist-info → ccxt-4.3.59.dist-info}/top_level.txt +0 -0
ccxt/pro/__init__.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# ----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.59'
|
8
8
|
|
9
9
|
# ----------------------------------------------------------------------------
|
10
10
|
|
@@ -79,6 +79,7 @@ from ccxt.pro.wazirx import wazirx # noqa
|
|
79
79
|
from ccxt.pro.whitebit import whitebit # noqa: F401
|
80
80
|
from ccxt.pro.woo import woo # noqa: F401
|
81
81
|
from ccxt.pro.woofipro import woofipro # noqa: F401
|
82
|
+
from ccxt.pro.xt import xt # noqa: F401
|
82
83
|
|
83
84
|
exchanges = [
|
84
85
|
'alpaca',
|
@@ -148,4 +149,5 @@ exchanges = [
|
|
148
149
|
'whitebit',
|
149
150
|
'woo',
|
150
151
|
'woofipro',
|
152
|
+
'xt',
|
151
153
|
]
|
ccxt/pro/binance.py
CHANGED
@@ -584,9 +584,9 @@ class binance(ccxt.async_support.binance):
|
|
584
584
|
for i in range(0, len(symbols)):
|
585
585
|
symbol = symbols[i]
|
586
586
|
market = self.market(symbol)
|
587
|
-
|
588
|
-
|
589
|
-
symbolHash =
|
587
|
+
messageHashes.append('orderbook::' + symbol)
|
588
|
+
subscriptionHash = market['lowercaseId'] + '@' + name
|
589
|
+
symbolHash = subscriptionHash + '@' + watchOrderBookRate + 'ms'
|
590
590
|
subParams.append(symbolHash)
|
591
591
|
messageHashesLength = len(messageHashes)
|
592
592
|
url = self.urls['api']['ws'][type] + '/' + self.stream(type, streamHash, messageHashesLength)
|
@@ -605,8 +605,7 @@ class binance(ccxt.async_support.binance):
|
|
605
605
|
'type': type,
|
606
606
|
'params': params,
|
607
607
|
}
|
608
|
-
|
609
|
-
orderbook = await self.watch_multiple(url, messageHashes, message, messageHashes, subscription)
|
608
|
+
orderbook = await self.watch_multiple(url, messageHashes, self.extend(request, params), messageHashes, subscription)
|
610
609
|
return orderbook.limit()
|
611
610
|
|
612
611
|
async def fetch_order_book_ws(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
@@ -770,8 +769,7 @@ class binance(ccxt.async_support.binance):
|
|
770
769
|
marketId = self.safe_string(message, 's')
|
771
770
|
market = self.safe_market(marketId, None, None, marketType)
|
772
771
|
symbol = market['symbol']
|
773
|
-
|
774
|
-
messageHash = market['lowercaseId'] + '@' + name
|
772
|
+
messageHash = 'orderbook::' + symbol
|
775
773
|
if not (symbol in self.orderbooks):
|
776
774
|
#
|
777
775
|
# https://github.com/ccxt/ccxt/issues/6672
|
@@ -887,12 +885,14 @@ class binance(ccxt.async_support.binance):
|
|
887
885
|
type = firstMarket['type']
|
888
886
|
if firstMarket['contract']:
|
889
887
|
type = 'future' if firstMarket['linear'] else 'delivery'
|
888
|
+
messageHashes = []
|
890
889
|
subParams = []
|
891
890
|
for i in range(0, len(symbols)):
|
892
891
|
symbol = symbols[i]
|
893
892
|
market = self.market(symbol)
|
894
|
-
|
895
|
-
|
893
|
+
messageHashes.append('trade::' + symbol)
|
894
|
+
rawHash = market['lowercaseId'] + '@' + name
|
895
|
+
subParams.append(rawHash)
|
896
896
|
query = self.omit(params, 'type')
|
897
897
|
subParamsLength = len(subParams)
|
898
898
|
url = self.urls['api']['ws'][type] + '/' + self.stream(type, streamHash, subParamsLength)
|
@@ -905,7 +905,7 @@ class binance(ccxt.async_support.binance):
|
|
905
905
|
subscribe: dict = {
|
906
906
|
'id': requestId,
|
907
907
|
}
|
908
|
-
trades = await self.watch_multiple(url,
|
908
|
+
trades = await self.watch_multiple(url, messageHashes, self.extend(request, query), messageHashes, subscribe)
|
909
909
|
if self.newUpdates:
|
910
910
|
first = self.safe_value(trades, 0)
|
911
911
|
tradeSymbol = self.safe_string(first, 'symbol')
|
@@ -1086,9 +1086,7 @@ class binance(ccxt.async_support.binance):
|
|
1086
1086
|
marketId = self.safe_string(message, 's')
|
1087
1087
|
market = self.safe_market(marketId, None, None, marketType)
|
1088
1088
|
symbol = market['symbol']
|
1089
|
-
|
1090
|
-
event = self.safe_string(message, 'e')
|
1091
|
-
messageHash = lowerCaseId + '@' + event
|
1089
|
+
messageHash = 'trade::' + symbol
|
1092
1090
|
trade = self.parse_ws_trade(message, market)
|
1093
1091
|
tradesArray = self.safe_value(self.trades, symbol)
|
1094
1092
|
if tradesArray is None:
|
ccxt/pro/bingx.py
CHANGED
@@ -101,10 +101,10 @@ class bingx(ccxt.async_support.bingx):
|
|
101
101
|
"""
|
102
102
|
await self.load_markets()
|
103
103
|
market = self.market(symbol)
|
104
|
-
marketType, query = self.handle_market_type_and_params('
|
104
|
+
marketType, query = self.handle_market_type_and_params('watchTicker', market, params)
|
105
105
|
url = self.safe_value(self.urls['api']['ws'], marketType)
|
106
106
|
if url is None:
|
107
|
-
raise BadRequest(self.id + '
|
107
|
+
raise BadRequest(self.id + ' watchTicker is not supported for ' + marketType + ' markets.')
|
108
108
|
subscriptionHash = market['id'] + '@ticker'
|
109
109
|
messageHash = self.get_message_hash('ticker', market['symbol'])
|
110
110
|
uuid = self.uuid()
|
@@ -413,19 +413,21 @@ class bingx(ccxt.async_support.bingx):
|
|
413
413
|
"""
|
414
414
|
await self.load_markets()
|
415
415
|
market = self.market(symbol)
|
416
|
-
marketType
|
416
|
+
marketType = None
|
417
|
+
marketType, params = self.handle_market_type_and_params('watchTrades', market, params)
|
417
418
|
url = self.safe_value(self.urls['api']['ws'], marketType)
|
418
419
|
if url is None:
|
419
420
|
raise BadRequest(self.id + ' watchTrades is not supported for ' + marketType + ' markets.')
|
420
|
-
|
421
|
+
rawHash = market['id'] + '@trade'
|
422
|
+
messageHash = 'trade::' + symbol
|
421
423
|
uuid = self.uuid()
|
422
424
|
request: dict = {
|
423
425
|
'id': uuid,
|
424
|
-
'dataType':
|
426
|
+
'dataType': rawHash,
|
425
427
|
}
|
426
428
|
if marketType == 'swap':
|
427
429
|
request['reqType'] = 'sub'
|
428
|
-
trades = await self.watch(url, messageHash, self.extend(request,
|
430
|
+
trades = await self.watch(url, messageHash, self.extend(request, params), messageHash)
|
429
431
|
if self.newUpdates:
|
430
432
|
limit = trades.getLimit(symbol, limit)
|
431
433
|
return self.filter_by_since_limit(trades, since, limit, 'timestamp', True)
|
@@ -491,12 +493,13 @@ class bingx(ccxt.async_support.bingx):
|
|
491
493
|
# }
|
492
494
|
#
|
493
495
|
data = self.safe_value(message, 'data', [])
|
494
|
-
|
495
|
-
marketId =
|
496
|
+
rawHash = self.safe_string(message, 'dataType')
|
497
|
+
marketId = rawHash.split('@')[0]
|
496
498
|
isSwap = client.url.find('swap') >= 0
|
497
499
|
marketType = 'swap' if isSwap else 'spot'
|
498
500
|
market = self.safe_market(marketId, None, None, marketType)
|
499
501
|
symbol = market['symbol']
|
502
|
+
messageHash = 'trade::' + symbol
|
500
503
|
trades = None
|
501
504
|
if isinstance(data, list):
|
502
505
|
trades = self.parse_trades(data, market)
|
ccxt/pro/bitmart.py
CHANGED
@@ -452,7 +452,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
452
452
|
client.resolve(newOrders, symbolSpecificMessageHash)
|
453
453
|
client.resolve(newOrders, messageHash)
|
454
454
|
|
455
|
-
def parse_ws_order(self, order, market: Market = None):
|
455
|
+
def parse_ws_order(self, order: dict, market: Market = None):
|
456
456
|
#
|
457
457
|
# spot
|
458
458
|
# {
|
@@ -802,7 +802,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
802
802
|
stored.append(trade)
|
803
803
|
return symbol
|
804
804
|
|
805
|
-
def parse_ws_trade(self, trade, market: Market = None):
|
805
|
+
def parse_ws_trade(self, trade: dict, market: Market = None):
|
806
806
|
# spot
|
807
807
|
# {
|
808
808
|
# "price": "52700.50",
|
ccxt/pro/bitopro.py
CHANGED
@@ -231,7 +231,7 @@ class bitopro(ccxt.async_support.bitopro):
|
|
231
231
|
client.resolve(trades, messageHash)
|
232
232
|
client.resolve(trades, messageHash + ':' + symbol)
|
233
233
|
|
234
|
-
def parse_ws_trade(self, trade, market: Market = None) -> Trade:
|
234
|
+
def parse_ws_trade(self, trade: dict, market: Market = None) -> Trade:
|
235
235
|
#
|
236
236
|
# {
|
237
237
|
# "base": "usdt",
|
ccxt/pro/coincheck.py
CHANGED
@@ -157,7 +157,7 @@ class coincheck(ccxt.async_support.coincheck):
|
|
157
157
|
messageHash = 'trade:' + symbol
|
158
158
|
client.resolve(stored, messageHash)
|
159
159
|
|
160
|
-
def parse_ws_trade(self, trade, market: Market = None) -> Trade:
|
160
|
+
def parse_ws_trade(self, trade: dict, market: Market = None) -> Trade:
|
161
161
|
#
|
162
162
|
# [
|
163
163
|
# "1663318663", # transaction timestamp(unix time)
|
ccxt/pro/coinone.py
CHANGED
@@ -300,7 +300,7 @@ class coinone(ccxt.async_support.coinone):
|
|
300
300
|
messageHash = 'trade:' + symbol
|
301
301
|
client.resolve(stored, messageHash)
|
302
302
|
|
303
|
-
def parse_ws_trade(self, trade, market: Market = None) -> Trade:
|
303
|
+
def parse_ws_trade(self, trade: dict, market: Market = None) -> Trade:
|
304
304
|
#
|
305
305
|
# {
|
306
306
|
# "quote_currency": "KRW",
|
ccxt/pro/hyperliquid.py
CHANGED
@@ -269,7 +269,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
269
269
|
messageHash = 'trade:' + symbol
|
270
270
|
client.resolve(trades, messageHash)
|
271
271
|
|
272
|
-
def parse_ws_trade(self, trade, market: Market = None) -> Trade:
|
272
|
+
def parse_ws_trade(self, trade: dict, market: Market = None) -> Trade:
|
273
273
|
#
|
274
274
|
# fetchMyTrades
|
275
275
|
#
|