ccxt 4.3.29__py2.py3-none-any.whl → 4.3.31__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/abstract/binance.py +2 -0
- ccxt/abstract/binancecoinm.py +2 -0
- ccxt/abstract/binanceus.py +2 -0
- ccxt/abstract/binanceusdm.py +2 -0
- ccxt/ace.py +14 -14
- ccxt/alpaca.py +16 -16
- ccxt/ascendex.py +46 -46
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ace.py +14 -14
- ccxt/async_support/alpaca.py +16 -16
- ccxt/async_support/ascendex.py +46 -46
- ccxt/async_support/base/exchange.py +23 -23
- ccxt/async_support/base/ws/aiohttp_client.py +1 -0
- ccxt/async_support/base/ws/future.py +27 -29
- ccxt/async_support/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +22 -22
- ccxt/async_support/bit2c.py +13 -13
- ccxt/async_support/bitbank.py +19 -19
- ccxt/async_support/bitbns.py +17 -17
- ccxt/async_support/bitfinex.py +24 -24
- ccxt/async_support/bitfinex2.py +142 -109
- ccxt/async_support/bitflyer.py +23 -23
- ccxt/async_support/bitget.py +76 -76
- ccxt/async_support/bithumb.py +20 -20
- ccxt/async_support/bitmart.py +55 -55
- ccxt/async_support/bitmex.py +41 -41
- ccxt/async_support/bitopro.py +30 -30
- ccxt/async_support/bitrue.py +37 -37
- ccxt/async_support/bitso.py +30 -30
- ccxt/async_support/bitstamp.py +31 -31
- ccxt/async_support/bitteam.py +26 -26
- ccxt/async_support/bitvavo.py +27 -27
- ccxt/async_support/bl3p.py +8 -8
- ccxt/async_support/blockchaincom.py +24 -24
- ccxt/async_support/blofin.py +37 -37
- ccxt/async_support/btcalpha.py +19 -19
- ccxt/async_support/btcbox.py +11 -11
- ccxt/async_support/btcmarkets.py +22 -22
- ccxt/async_support/btcturk.py +13 -13
- ccxt/async_support/bybit.py +96 -96
- ccxt/async_support/cex.py +21 -21
- ccxt/async_support/coinbase.py +53 -53
- ccxt/async_support/coinbaseexchange.py +29 -29
- ccxt/async_support/coinbaseinternational.py +32 -32
- ccxt/async_support/coincheck.py +14 -14
- ccxt/async_support/coinex.py +424 -448
- ccxt/async_support/coinlist.py +35 -35
- ccxt/async_support/coinmate.py +22 -22
- ccxt/async_support/coinmetro.py +22 -22
- ccxt/async_support/coinone.py +18 -18
- ccxt/async_support/coinsph.py +32 -32
- ccxt/async_support/coinspot.py +8 -8
- ccxt/async_support/cryptocom.py +43 -43
- ccxt/async_support/currencycom.py +33 -33
- ccxt/async_support/delta.py +35 -35
- ccxt/async_support/deribit.py +54 -54
- ccxt/async_support/digifinex.py +56 -56
- ccxt/async_support/exmo.py +34 -34
- ccxt/async_support/gate.py +60 -60
- ccxt/async_support/gemini.py +24 -24
- ccxt/async_support/hitbtc.py +51 -51
- ccxt/async_support/hollaex.py +29 -29
- ccxt/async_support/htx.py +73 -73
- ccxt/async_support/huobijp.py +30 -30
- ccxt/async_support/hyperliquid.py +58 -58
- ccxt/async_support/idex.py +33 -33
- ccxt/async_support/independentreserve.py +12 -12
- ccxt/async_support/indodax.py +21 -21
- ccxt/async_support/kraken.py +46 -51
- ccxt/async_support/krakenfutures.py +29 -29
- ccxt/async_support/kucoin.py +51 -51
- ccxt/async_support/kucoinfutures.py +33 -33
- ccxt/async_support/kuna.py +27 -27
- ccxt/async_support/latoken.py +27 -27
- ccxt/async_support/lbank.py +35 -35
- ccxt/async_support/luno.py +19 -19
- ccxt/async_support/lykke.py +20 -20
- ccxt/async_support/mercado.py +17 -17
- ccxt/async_support/mexc.py +64 -64
- ccxt/async_support/ndax.py +38 -38
- ccxt/async_support/novadax.py +26 -26
- ccxt/async_support/oceanex.py +21 -21
- ccxt/async_support/okcoin.py +35 -35
- ccxt/async_support/okx.py +85 -85
- ccxt/async_support/onetrading.py +32 -32
- ccxt/async_support/p2b.py +14 -14
- ccxt/async_support/paymium.py +12 -12
- ccxt/async_support/phemex.py +50 -50
- ccxt/async_support/poloniex.py +35 -35
- ccxt/async_support/poloniexfutures.py +25 -21
- ccxt/async_support/probit.py +30 -30
- ccxt/async_support/timex.py +22 -22
- ccxt/async_support/tokocrypto.py +26 -26
- ccxt/async_support/tradeogre.py +12 -12
- ccxt/async_support/upbit.py +28 -28
- ccxt/async_support/wavesexchange.py +33 -33
- ccxt/async_support/wazirx.py +21 -21
- ccxt/async_support/whitebit.py +80 -40
- ccxt/async_support/woo.py +51 -51
- ccxt/async_support/woofipro.py +46 -46
- ccxt/async_support/yobit.py +20 -20
- ccxt/async_support/zaif.py +12 -12
- ccxt/async_support/zonda.py +22 -22
- ccxt/base/exchange.py +39 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +22 -22
- ccxt/bit2c.py +13 -13
- ccxt/bitbank.py +19 -19
- ccxt/bitbns.py +17 -17
- ccxt/bitfinex.py +24 -24
- ccxt/bitfinex2.py +142 -109
- ccxt/bitflyer.py +23 -23
- ccxt/bitget.py +76 -76
- ccxt/bithumb.py +20 -20
- ccxt/bitmart.py +55 -55
- ccxt/bitmex.py +41 -41
- ccxt/bitopro.py +30 -30
- ccxt/bitrue.py +37 -37
- ccxt/bitso.py +30 -30
- ccxt/bitstamp.py +31 -31
- ccxt/bitteam.py +26 -26
- ccxt/bitvavo.py +27 -27
- ccxt/bl3p.py +8 -8
- ccxt/blockchaincom.py +24 -24
- ccxt/blofin.py +37 -37
- ccxt/btcalpha.py +19 -19
- ccxt/btcbox.py +11 -11
- ccxt/btcmarkets.py +22 -22
- ccxt/btcturk.py +13 -13
- ccxt/bybit.py +96 -96
- ccxt/cex.py +21 -21
- ccxt/coinbase.py +53 -53
- ccxt/coinbaseexchange.py +29 -29
- ccxt/coinbaseinternational.py +32 -32
- ccxt/coincheck.py +14 -14
- ccxt/coinex.py +424 -448
- ccxt/coinlist.py +35 -35
- ccxt/coinmate.py +22 -22
- ccxt/coinmetro.py +22 -22
- ccxt/coinone.py +18 -18
- ccxt/coinsph.py +32 -32
- ccxt/coinspot.py +8 -8
- ccxt/cryptocom.py +43 -43
- ccxt/currencycom.py +33 -33
- ccxt/delta.py +35 -35
- ccxt/deribit.py +54 -54
- ccxt/digifinex.py +56 -56
- ccxt/exmo.py +34 -34
- ccxt/gate.py +60 -60
- ccxt/gemini.py +24 -24
- ccxt/hitbtc.py +51 -51
- ccxt/hollaex.py +29 -29
- ccxt/htx.py +73 -73
- ccxt/huobijp.py +30 -30
- ccxt/hyperliquid.py +58 -58
- ccxt/idex.py +33 -33
- ccxt/independentreserve.py +12 -12
- ccxt/indodax.py +21 -21
- ccxt/kraken.py +46 -51
- ccxt/krakenfutures.py +29 -29
- ccxt/kucoin.py +51 -51
- ccxt/kucoinfutures.py +33 -33
- ccxt/kuna.py +27 -27
- ccxt/latoken.py +27 -27
- ccxt/lbank.py +35 -35
- ccxt/luno.py +19 -19
- ccxt/lykke.py +20 -20
- ccxt/mercado.py +17 -17
- ccxt/mexc.py +64 -64
- ccxt/ndax.py +38 -38
- ccxt/novadax.py +26 -26
- ccxt/oceanex.py +21 -21
- ccxt/okcoin.py +35 -35
- ccxt/okx.py +85 -85
- ccxt/onetrading.py +32 -32
- ccxt/p2b.py +14 -14
- ccxt/paymium.py +12 -12
- ccxt/phemex.py +50 -50
- ccxt/poloniex.py +35 -35
- ccxt/poloniexfutures.py +25 -21
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/alpaca.py +8 -8
- ccxt/pro/ascendex.py +4 -4
- ccxt/pro/binance.py +56 -56
- ccxt/pro/bingx.py +5 -5
- ccxt/pro/bitfinex.py +6 -6
- ccxt/pro/bitfinex2.py +10 -10
- ccxt/pro/bitget.py +17 -17
- ccxt/pro/bithumb.py +6 -6
- ccxt/pro/bitmart.py +8 -8
- ccxt/pro/bitmex.py +16 -16
- ccxt/pro/bitopro.py +4 -4
- ccxt/pro/bitrue.py +8 -8
- ccxt/pro/bitstamp.py +5 -5
- ccxt/pro/bitvavo.py +14 -14
- ccxt/pro/blockchaincom.py +7 -7
- ccxt/pro/bybit.py +12 -12
- ccxt/pro/cex.py +19 -19
- ccxt/pro/coinbase.py +2 -2
- ccxt/pro/coinbaseexchange.py +10 -10
- ccxt/pro/coinbaseinternational.py +4 -4
- ccxt/pro/coincheck.py +2 -2
- ccxt/pro/coinex.py +15 -15
- ccxt/pro/coinone.py +4 -4
- ccxt/pro/cryptocom.py +11 -11
- ccxt/pro/currencycom.py +4 -4
- ccxt/pro/deribit.py +9 -9
- ccxt/pro/exmo.py +9 -9
- ccxt/pro/gate.py +12 -12
- ccxt/pro/gemini.py +11 -11
- ccxt/pro/hitbtc.py +13 -13
- ccxt/pro/hollaex.py +6 -6
- ccxt/pro/htx.py +15 -15
- ccxt/pro/huobijp.py +16 -16
- ccxt/pro/hyperliquid.py +9 -9
- ccxt/pro/idex.py +12 -12
- ccxt/pro/independentreserve.py +2 -2
- ccxt/pro/kraken.py +14 -14
- ccxt/pro/krakenfutures.py +12 -12
- ccxt/pro/kucoin.py +12 -12
- ccxt/pro/kucoinfutures.py +16 -16
- ccxt/pro/lbank.py +12 -12
- ccxt/pro/luno.py +4 -4
- ccxt/pro/mexc.py +14 -14
- ccxt/pro/ndax.py +12 -12
- ccxt/pro/okcoin.py +6 -6
- ccxt/pro/okx.py +30 -30
- ccxt/pro/onetrading.py +13 -13
- ccxt/pro/p2b.py +2 -2
- ccxt/pro/phemex.py +9 -9
- ccxt/pro/poloniex.py +9 -9
- ccxt/pro/poloniexfutures.py +10 -10
- ccxt/pro/probit.py +8 -8
- ccxt/pro/upbit.py +1 -1
- ccxt/pro/wazirx.py +10 -10
- ccxt/pro/whitebit.py +8 -8
- ccxt/pro/woo.py +14 -14
- ccxt/pro/woofipro.py +14 -14
- ccxt/probit.py +30 -30
- ccxt/test/base/test_shared_methods.py +1 -0
- ccxt/timex.py +22 -22
- ccxt/tokocrypto.py +26 -26
- ccxt/tradeogre.py +12 -12
- ccxt/upbit.py +28 -28
- ccxt/wavesexchange.py +33 -33
- ccxt/wazirx.py +21 -21
- ccxt/whitebit.py +80 -40
- ccxt/woo.py +51 -51
- ccxt/woofipro.py +46 -46
- ccxt/yobit.py +20 -20
- ccxt/zaif.py +12 -12
- ccxt/zonda.py +22 -22
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/RECORD +260 -260
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.29.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/pro/bitget.py
CHANGED
@@ -122,7 +122,7 @@ class bitget(ccxt.async_support.bitget):
|
|
122
122
|
messageHash = 'ticker:' + symbol
|
123
123
|
instType = None
|
124
124
|
instType, params = self.get_inst_type(market, params)
|
125
|
-
args = {
|
125
|
+
args: dict = {
|
126
126
|
'instType': instType,
|
127
127
|
'channel': 'ticker',
|
128
128
|
'instId': market['id'],
|
@@ -148,7 +148,7 @@ class bitget(ccxt.async_support.bitget):
|
|
148
148
|
for i in range(0, len(symbols)):
|
149
149
|
symbol = symbols[i]
|
150
150
|
marketInner = self.market(symbol)
|
151
|
-
args = {
|
151
|
+
args: dict = {
|
152
152
|
'instType': instType,
|
153
153
|
'channel': 'ticker',
|
154
154
|
'instId': marketInner['id'],
|
@@ -157,7 +157,7 @@ class bitget(ccxt.async_support.bitget):
|
|
157
157
|
messageHashes.append('ticker:' + symbol)
|
158
158
|
tickers = await self.watch_public_multiple(messageHashes, topics, params)
|
159
159
|
if self.newUpdates:
|
160
|
-
result = {}
|
160
|
+
result: dict = {}
|
161
161
|
result[tickers['symbol']] = tickers
|
162
162
|
return result
|
163
163
|
return self.filter_by_array(self.tickers, 'symbol', symbols)
|
@@ -324,7 +324,7 @@ class bitget(ccxt.async_support.bitget):
|
|
324
324
|
messageHash = 'candles:' + timeframe + ':' + symbol
|
325
325
|
instType = None
|
326
326
|
instType, params = self.get_inst_type(market, params)
|
327
|
-
args = {
|
327
|
+
args: dict = {
|
328
328
|
'instType': instType,
|
329
329
|
'channel': 'candle' + interval,
|
330
330
|
'instId': market['id'],
|
@@ -450,7 +450,7 @@ class bitget(ccxt.async_support.bitget):
|
|
450
450
|
market = self.market(symbol)
|
451
451
|
instType = None
|
452
452
|
instType, params = self.get_inst_type(market, params)
|
453
|
-
args = {
|
453
|
+
args: dict = {
|
454
454
|
'instType': instType,
|
455
455
|
'channel': channel,
|
456
456
|
'instId': market['id'],
|
@@ -598,7 +598,7 @@ class bitget(ccxt.async_support.bitget):
|
|
598
598
|
market = self.market(symbol)
|
599
599
|
instType = None
|
600
600
|
instType, params = self.get_inst_type(market, params)
|
601
|
-
args = {
|
601
|
+
args: dict = {
|
602
602
|
'instType': instType,
|
603
603
|
'channel': 'trade',
|
604
604
|
'instId': market['id'],
|
@@ -760,7 +760,7 @@ class bitget(ccxt.async_support.bitget):
|
|
760
760
|
market = self.get_market_from_symbols(symbols)
|
761
761
|
instType, params = self.get_inst_type(market, params)
|
762
762
|
messageHash = instType + ':positions' + messageHash
|
763
|
-
args = {
|
763
|
+
args: dict = {
|
764
764
|
'instType': instType,
|
765
765
|
'channel': 'positions',
|
766
766
|
'instId': 'default',
|
@@ -952,7 +952,7 @@ class bitget(ccxt.async_support.bitget):
|
|
952
952
|
channel = 'orders-isolated'
|
953
953
|
else:
|
954
954
|
channel = 'orders-crossed'
|
955
|
-
args = {
|
955
|
+
args: dict = {
|
956
956
|
'instType': instType,
|
957
957
|
'channel': channel,
|
958
958
|
'instId': instId,
|
@@ -1015,7 +1015,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1015
1015
|
isTrigger = (channel == 'orders-algo') or (channel == 'ordersAlgo')
|
1016
1016
|
stored = self.triggerOrders if isTrigger else self.orders
|
1017
1017
|
messageHash = 'triggerOrder' if isTrigger else 'order'
|
1018
|
-
marketSymbols = {}
|
1018
|
+
marketSymbols: dict = {}
|
1019
1019
|
for i in range(0, len(data)):
|
1020
1020
|
order = data[i]
|
1021
1021
|
marketId = self.safe_string(order, 'instId')
|
@@ -1231,7 +1231,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1231
1231
|
}, market)
|
1232
1232
|
|
1233
1233
|
def parse_ws_order_status(self, status):
|
1234
|
-
statuses = {
|
1234
|
+
statuses: dict = {
|
1235
1235
|
'live': 'open',
|
1236
1236
|
'partially_filled': 'open',
|
1237
1237
|
'filled': 'closed',
|
@@ -1260,7 +1260,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1260
1260
|
instType = None
|
1261
1261
|
instType, params = self.get_inst_type(market, params)
|
1262
1262
|
subscriptionHash = 'fill:' + instType
|
1263
|
-
args = {
|
1263
|
+
args: dict = {
|
1264
1264
|
'instType': instType,
|
1265
1265
|
'channel': 'fill',
|
1266
1266
|
'instId': 'default',
|
@@ -1388,7 +1388,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1388
1388
|
else:
|
1389
1389
|
instType = 'SPOT'
|
1390
1390
|
instType, params = self.handle_option_and_params(params, 'watchBalance', 'instType', instType)
|
1391
|
-
args = {
|
1391
|
+
args: dict = {
|
1392
1392
|
'instType': instType,
|
1393
1393
|
'channel': channel,
|
1394
1394
|
'coin': 'default',
|
@@ -1478,7 +1478,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1478
1478
|
|
1479
1479
|
async def watch_public(self, messageHash, args, params={}):
|
1480
1480
|
url = self.urls['api']['ws']['public']
|
1481
|
-
request = {
|
1481
|
+
request: dict = {
|
1482
1482
|
'op': 'subscribe',
|
1483
1483
|
'args': [args],
|
1484
1484
|
}
|
@@ -1487,7 +1487,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1487
1487
|
|
1488
1488
|
async def watch_public_multiple(self, messageHashes, argsArray, params={}):
|
1489
1489
|
url = self.urls['api']['ws']['public']
|
1490
|
-
request = {
|
1490
|
+
request: dict = {
|
1491
1491
|
'op': 'subscribe',
|
1492
1492
|
'args': argsArray,
|
1493
1493
|
}
|
@@ -1506,7 +1506,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1506
1506
|
auth = timestamp + 'GET' + '/user/verify'
|
1507
1507
|
signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256, 'base64')
|
1508
1508
|
operation = 'login'
|
1509
|
-
request = {
|
1509
|
+
request: dict = {
|
1510
1510
|
'op': operation,
|
1511
1511
|
'args': [
|
1512
1512
|
{
|
@@ -1524,7 +1524,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1524
1524
|
async def watch_private(self, messageHash, subscriptionHash, args, params={}):
|
1525
1525
|
await self.authenticate()
|
1526
1526
|
url = self.urls['api']['ws']['private']
|
1527
|
-
request = {
|
1527
|
+
request: dict = {
|
1528
1528
|
'op': 'subscribe',
|
1529
1529
|
'args': [args],
|
1530
1530
|
}
|
@@ -1615,7 +1615,7 @@ class bitget(ccxt.async_support.bitget):
|
|
1615
1615
|
if event == 'subscribe':
|
1616
1616
|
self.handle_subscription_status(client, message)
|
1617
1617
|
return
|
1618
|
-
methods = {
|
1618
|
+
methods: dict = {
|
1619
1619
|
'ticker': self.handle_ticker,
|
1620
1620
|
'trade': self.handle_trades,
|
1621
1621
|
'fill': self.handle_my_trades,
|
ccxt/pro/bithumb.py
CHANGED
@@ -46,7 +46,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
46
46
|
await self.load_markets()
|
47
47
|
market = self.market(symbol)
|
48
48
|
messageHash = 'ticker:' + market['symbol']
|
49
|
-
request = {
|
49
|
+
request: dict = {
|
50
50
|
'type': 'ticker',
|
51
51
|
'symbols': [market['base'] + '_' + market['quote']],
|
52
52
|
'tickTypes': [self.safe_string(params, 'tickTypes', '24H')],
|
@@ -70,7 +70,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
70
70
|
market = self.market(symbol)
|
71
71
|
marketIds.append(market['base'] + '_' + market['quote'])
|
72
72
|
messageHashes.append('ticker:' + market['symbol'])
|
73
|
-
request = {
|
73
|
+
request: dict = {
|
74
74
|
'type': 'ticker',
|
75
75
|
'symbols': marketIds,
|
76
76
|
'tickTypes': [self.safe_string(params, 'tickTypes', '24H')],
|
@@ -78,7 +78,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
78
78
|
message = self.extend(request, params)
|
79
79
|
newTicker = await self.watch_multiple(url, messageHashes, message, messageHashes)
|
80
80
|
if self.newUpdates:
|
81
|
-
result = {}
|
81
|
+
result: dict = {}
|
82
82
|
result[newTicker['symbol']] = newTicker
|
83
83
|
return result
|
84
84
|
return self.filter_by_array(self.tickers, 'symbol', symbols)
|
@@ -176,7 +176,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
176
176
|
market = self.market(symbol)
|
177
177
|
symbol = market['symbol']
|
178
178
|
messageHash = 'orderbook' + ':' + symbol
|
179
|
-
request = {
|
179
|
+
request: dict = {
|
180
180
|
'type': 'orderbookdepth',
|
181
181
|
'symbols': [market['base'] + '_' + market['quote']],
|
182
182
|
}
|
@@ -259,7 +259,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
259
259
|
market = self.market(symbol)
|
260
260
|
symbol = market['symbol']
|
261
261
|
messageHash = 'trade:' + symbol
|
262
|
-
request = {
|
262
|
+
request: dict = {
|
263
263
|
'type': 'transaction',
|
264
264
|
'symbols': [market['base'] + '_' + market['quote']],
|
265
265
|
}
|
@@ -358,7 +358,7 @@ class bithumb(ccxt.async_support.bithumb):
|
|
358
358
|
return
|
359
359
|
topic = self.safe_string(message, 'type')
|
360
360
|
if topic is not None:
|
361
|
-
methods = {
|
361
|
+
methods: dict = {
|
362
362
|
'ticker': self.handle_ticker,
|
363
363
|
'orderbookdepth': self.handle_order_book,
|
364
364
|
'transaction': self.handle_trades,
|
ccxt/pro/bitmart.py
CHANGED
@@ -129,7 +129,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
129
129
|
# exclusion, futures "tickers" need one generic request for all symbols
|
130
130
|
if (type != 'spot') and (channel == 'ticker'):
|
131
131
|
rawSubscriptions = [channelType + '/' + channel]
|
132
|
-
request = {
|
132
|
+
request: dict = {
|
133
133
|
'args': rawSubscriptions,
|
134
134
|
}
|
135
135
|
request[actionType] = 'subscribe'
|
@@ -326,7 +326,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
326
326
|
marketType, params = self.handle_market_type_and_params('watchTickers', market, params)
|
327
327
|
ticker = await self.subscribe_multiple('ticker', marketType, symbols, params)
|
328
328
|
if self.newUpdates:
|
329
|
-
tickers = {}
|
329
|
+
tickers: dict = {}
|
330
330
|
tickers[ticker['symbol']] = ticker
|
331
331
|
return tickers
|
332
332
|
return self.filter_by_array(self.tickers, 'symbol', symbols)
|
@@ -430,7 +430,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
430
430
|
return
|
431
431
|
ordersLength = len(orders)
|
432
432
|
newOrders = []
|
433
|
-
symbols = {}
|
433
|
+
symbols: dict = {}
|
434
434
|
if ordersLength > 0:
|
435
435
|
limit = self.safe_integer(self.options, 'ordersLimit', 1000)
|
436
436
|
if self.orders is None:
|
@@ -578,7 +578,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
578
578
|
}, market)
|
579
579
|
|
580
580
|
def parse_ws_order_status(self, statusId):
|
581
|
-
statuses = {
|
581
|
+
statuses: dict = {
|
582
582
|
'1': 'closed', # match deal
|
583
583
|
'2': 'open', # submit order
|
584
584
|
'3': 'canceled', # cancel order
|
@@ -592,7 +592,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
592
592
|
return self.safe_string(statuses, statusId, statusId)
|
593
593
|
|
594
594
|
def parse_ws_order_side(self, sideId):
|
595
|
-
sides = {
|
595
|
+
sides: dict = {
|
596
596
|
'1': 'buy', # buy_open_long
|
597
597
|
'2': 'buy', # buy_close_short
|
598
598
|
'3': 'sell', # sell_close_long
|
@@ -616,7 +616,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
616
616
|
if symbols is not None:
|
617
617
|
messageHash += '::' + ','.join(symbols)
|
618
618
|
subscriptionHash = 'futures/position'
|
619
|
-
request = {
|
619
|
+
request: dict = {
|
620
620
|
'action': 'subscribe',
|
621
621
|
'args': ['futures/position'],
|
622
622
|
}
|
@@ -1418,7 +1418,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
1418
1418
|
if not isDataUpdate:
|
1419
1419
|
event = self.safe_string_2(message, 'event', 'action')
|
1420
1420
|
if event is not None:
|
1421
|
-
methods = {
|
1421
|
+
methods: dict = {
|
1422
1422
|
# 'info': self.handleSystemStatus,
|
1423
1423
|
'login': self.handle_authenticate,
|
1424
1424
|
'access': self.handle_authenticate,
|
@@ -1429,7 +1429,7 @@ class bitmart(ccxt.async_support.bitmart):
|
|
1429
1429
|
method(client, message)
|
1430
1430
|
else:
|
1431
1431
|
channel = self.safe_string_2(message, 'table', 'group')
|
1432
|
-
methods = {
|
1432
|
+
methods: dict = {
|
1433
1433
|
'depth': self.handle_order_book,
|
1434
1434
|
'ticker': self.handle_ticker,
|
1435
1435
|
'trade': self.handle_trade,
|
ccxt/pro/bitmex.py
CHANGED
@@ -95,13 +95,13 @@ class bitmex(ccxt.async_support.bitmex):
|
|
95
95
|
else:
|
96
96
|
rawSubscriptions.append(name)
|
97
97
|
messageHashes.append('alltickers')
|
98
|
-
request = {
|
98
|
+
request: dict = {
|
99
99
|
'op': 'subscribe',
|
100
100
|
'args': rawSubscriptions,
|
101
101
|
}
|
102
102
|
ticker = await self.watch_multiple(url, messageHashes, self.extend(request, params), rawSubscriptions)
|
103
103
|
if self.newUpdates:
|
104
|
-
result = {}
|
104
|
+
result: dict = {}
|
105
105
|
result[ticker['symbol']] = ticker
|
106
106
|
return result
|
107
107
|
return self.filter_by_array(self.tickers, 'symbol', symbols)
|
@@ -334,7 +334,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
334
334
|
# }
|
335
335
|
#
|
336
336
|
data = self.safe_list(message, 'data', [])
|
337
|
-
tickers = {}
|
337
|
+
tickers: dict = {}
|
338
338
|
for i in range(0, len(data)):
|
339
339
|
update = data[i]
|
340
340
|
marketId = self.safe_string(update, 'symbol')
|
@@ -360,7 +360,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
360
360
|
await self.authenticate()
|
361
361
|
messageHash = 'margin'
|
362
362
|
url = self.urls['api']['ws']
|
363
|
-
request = {
|
363
|
+
request: dict = {
|
364
364
|
'op': 'subscribe',
|
365
365
|
'args': [
|
366
366
|
messageHash,
|
@@ -574,7 +574,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
574
574
|
timestamp = self.milliseconds()
|
575
575
|
payload = 'GET' + '/realtime' + str(timestamp)
|
576
576
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha256)
|
577
|
-
request = {
|
577
|
+
request: dict = {
|
578
578
|
'op': 'authKeyExpires',
|
579
579
|
'args': [
|
580
580
|
self.apiKey,
|
@@ -614,7 +614,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
614
614
|
if not self.is_empty(symbols):
|
615
615
|
messageHash = '::' + ','.join(symbols)
|
616
616
|
url = self.urls['api']['ws']
|
617
|
-
request = {
|
617
|
+
request: dict = {
|
618
618
|
'op': 'subscribe',
|
619
619
|
'args': [
|
620
620
|
subscriptionHash,
|
@@ -813,7 +813,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
813
813
|
symbol = self.symbol(symbol)
|
814
814
|
messageHash += ':' + symbol
|
815
815
|
url = self.urls['api']['ws']
|
816
|
-
request = {
|
816
|
+
request: dict = {
|
817
817
|
'op': 'subscribe',
|
818
818
|
'args': [
|
819
819
|
subscriptionHash,
|
@@ -983,7 +983,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
983
983
|
limit = self.safe_integer(self.options, 'ordersLimit', 1000)
|
984
984
|
self.orders = ArrayCacheBySymbolById(limit)
|
985
985
|
stored = self.orders
|
986
|
-
symbols = {}
|
986
|
+
symbols: dict = {}
|
987
987
|
for i in range(0, dataLength):
|
988
988
|
currentOrder = data[i]
|
989
989
|
orderId = self.safe_string(currentOrder, 'orderID')
|
@@ -1019,7 +1019,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1019
1019
|
symbol = self.symbol(symbol)
|
1020
1020
|
messageHash += ':' + symbol
|
1021
1021
|
url = self.urls['api']['ws']
|
1022
|
-
request = {
|
1022
|
+
request: dict = {
|
1023
1023
|
'op': 'subscribe',
|
1024
1024
|
'args': [
|
1025
1025
|
subscriptionHash,
|
@@ -1097,7 +1097,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1097
1097
|
limit = self.safe_integer(self.options, 'tradesLimit', 1000)
|
1098
1098
|
self.myTrades = ArrayCacheBySymbolById(limit)
|
1099
1099
|
stored = self.myTrades
|
1100
|
-
symbols = {}
|
1100
|
+
symbols: dict = {}
|
1101
1101
|
for j in range(0, len(trades)):
|
1102
1102
|
trade = trades[j]
|
1103
1103
|
symbol = trade['symbol']
|
@@ -1149,7 +1149,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1149
1149
|
messageHash = table + ':' + symbol
|
1150
1150
|
messageHashes.append(messageHash)
|
1151
1151
|
url = self.urls['api']['ws']
|
1152
|
-
request = {
|
1152
|
+
request: dict = {
|
1153
1153
|
'op': 'subscribe',
|
1154
1154
|
'args': topics,
|
1155
1155
|
}
|
@@ -1178,7 +1178,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1178
1178
|
messageHash = table + ':' + symbol
|
1179
1179
|
messageHashes.append(messageHash)
|
1180
1180
|
url = self.urls['api']['ws']
|
1181
|
-
request = {
|
1181
|
+
request: dict = {
|
1182
1182
|
'op': 'subscribe',
|
1183
1183
|
'args': topics,
|
1184
1184
|
}
|
@@ -1205,7 +1205,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1205
1205
|
table = 'tradeBin' + self.safe_string(self.timeframes, timeframe, timeframe)
|
1206
1206
|
messageHash = table + ':' + market['id']
|
1207
1207
|
url = self.urls['api']['ws']
|
1208
|
-
request = {
|
1208
|
+
request: dict = {
|
1209
1209
|
'op': 'subscribe',
|
1210
1210
|
'args': [
|
1211
1211
|
messageHash,
|
@@ -1287,7 +1287,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1287
1287
|
timeframe = self.find_timeframe(interval)
|
1288
1288
|
duration = self.parse_timeframe(timeframe)
|
1289
1289
|
candles = self.safe_value(message, 'data', [])
|
1290
|
-
results = {}
|
1290
|
+
results: dict = {}
|
1291
1291
|
for i in range(0, len(candles)):
|
1292
1292
|
candle = candles[i]
|
1293
1293
|
marketId = self.safe_string(candle, 'symbol')
|
@@ -1402,7 +1402,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1402
1402
|
messageHash = table + ':' + symbol
|
1403
1403
|
client.resolve(orderbook, messageHash)
|
1404
1404
|
else:
|
1405
|
-
numUpdatesByMarketId = {}
|
1405
|
+
numUpdatesByMarketId: dict = {}
|
1406
1406
|
for i in range(0, len(data)):
|
1407
1407
|
marketId = self.safe_value(data[i], 'symbol')
|
1408
1408
|
if not (marketId in numUpdatesByMarketId):
|
@@ -1528,7 +1528,7 @@ class bitmex(ccxt.async_support.bitmex):
|
|
1528
1528
|
#
|
1529
1529
|
if self.handle_error_message(client, message):
|
1530
1530
|
table = self.safe_string(message, 'table')
|
1531
|
-
methods = {
|
1531
|
+
methods: dict = {
|
1532
1532
|
'orderBookL2': self.handle_order_book,
|
1533
1533
|
'orderBookL2_25': self.handle_order_book,
|
1534
1534
|
'orderBook10': self.handle_order_book,
|
ccxt/pro/bitopro.py
CHANGED
@@ -357,7 +357,7 @@ class bitopro(ccxt.async_support.bitopro):
|
|
357
357
|
})
|
358
358
|
payload = self.string_to_base64(rawData)
|
359
359
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha384)
|
360
|
-
defaultOptions = {
|
360
|
+
defaultOptions: dict = {
|
361
361
|
'ws': {
|
362
362
|
'options': {
|
363
363
|
'headers': {},
|
@@ -367,7 +367,7 @@ class bitopro(ccxt.async_support.bitopro):
|
|
367
367
|
# self.options = self.extend(defaultOptions, self.options)
|
368
368
|
self.extend_exchange_options(defaultOptions)
|
369
369
|
originalHeaders = self.options['ws']['options']['headers']
|
370
|
-
headers = {
|
370
|
+
headers: dict = {
|
371
371
|
'X-BITOPRO-API': 'ccxt',
|
372
372
|
'X-BITOPRO-APIKEY': self.apiKey,
|
373
373
|
'X-BITOPRO-PAYLOAD': payload,
|
@@ -414,7 +414,7 @@ class bitopro(ccxt.async_support.bitopro):
|
|
414
414
|
timestamp = self.safe_integer(message, 'timestamp')
|
415
415
|
datetime = self.safe_string(message, 'datetime')
|
416
416
|
currencies = list(data.keys())
|
417
|
-
result = {
|
417
|
+
result: dict = {
|
418
418
|
'info': data,
|
419
419
|
'timestamp': timestamp,
|
420
420
|
'datetime': datetime,
|
@@ -432,7 +432,7 @@ class bitopro(ccxt.async_support.bitopro):
|
|
432
432
|
client.resolve(self.balance, event)
|
433
433
|
|
434
434
|
def handle_message(self, client: Client, message):
|
435
|
-
methods = {
|
435
|
+
methods: dict = {
|
436
436
|
'TRADE': self.handle_trade,
|
437
437
|
'TICKER': self.handle_ticker,
|
438
438
|
'ORDER_BOOK': self.handle_order_book,
|
ccxt/pro/bitrue.py
CHANGED
@@ -66,7 +66,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
66
66
|
"""
|
67
67
|
url = await self.authenticate()
|
68
68
|
messageHash = 'balance'
|
69
|
-
message = {
|
69
|
+
message: dict = {
|
70
70
|
'event': 'sub',
|
71
71
|
'params': {
|
72
72
|
'channel': 'user_balance_update',
|
@@ -179,7 +179,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
179
179
|
symbol = market['symbol']
|
180
180
|
url = await self.authenticate()
|
181
181
|
messageHash = 'orders'
|
182
|
-
message = {
|
182
|
+
message: dict = {
|
183
183
|
'event': 'sub',
|
184
184
|
'params': {
|
185
185
|
'channel': 'user_order_update',
|
@@ -291,7 +291,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
291
291
|
marketIdLowercase = market['id'].lower()
|
292
292
|
channel = 'market_' + marketIdLowercase + '_simple_depth_step0'
|
293
293
|
url = self.urls['api']['ws']['public']
|
294
|
-
message = {
|
294
|
+
message: dict = {
|
295
295
|
'event': 'sub',
|
296
296
|
'params': {
|
297
297
|
'cb_id': marketIdLowercase,
|
@@ -351,7 +351,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
351
351
|
client.resolve(orderbook, messageHash)
|
352
352
|
|
353
353
|
def parse_ws_order_type(self, typeId):
|
354
|
-
types = {
|
354
|
+
types: dict = {
|
355
355
|
'1': 'limit',
|
356
356
|
'2': 'market',
|
357
357
|
'3': 'limit',
|
@@ -359,7 +359,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
359
359
|
return self.safe_string(types, typeId, typeId)
|
360
360
|
|
361
361
|
def parse_ws_order_status(self, status):
|
362
|
-
statuses = {
|
362
|
+
statuses: dict = {
|
363
363
|
'0': 'open', # The order has not been accepted by the engine.
|
364
364
|
'1': 'open', # The order has been accepted by the engine.
|
365
365
|
'2': 'closed', # The order has been completed.
|
@@ -379,7 +379,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
379
379
|
# }
|
380
380
|
#
|
381
381
|
time = self.safe_integer(message, 'ping')
|
382
|
-
pong = {
|
382
|
+
pong: dict = {
|
383
383
|
'pong': time,
|
384
384
|
}
|
385
385
|
await client.send(pong)
|
@@ -391,7 +391,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
391
391
|
self.handle_ping(client, message)
|
392
392
|
else:
|
393
393
|
event = self.safe_string(message, 'e')
|
394
|
-
handlers = {
|
394
|
+
handlers: dict = {
|
395
395
|
'BALANCE': self.handle_balance,
|
396
396
|
'ORDER': self.handle_order,
|
397
397
|
}
|
@@ -428,7 +428,7 @@ class bitrue(ccxt.async_support.bitrue):
|
|
428
428
|
|
429
429
|
async def keep_alive_listen_key(self, params={}):
|
430
430
|
listenKey = self.safe_string(self.options, 'listenKey')
|
431
|
-
request = {
|
431
|
+
request: dict = {
|
432
432
|
'listenKey': listenKey,
|
433
433
|
}
|
434
434
|
try:
|
ccxt/pro/bitstamp.py
CHANGED
@@ -62,7 +62,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
62
62
|
messageHash = 'orderbook:' + symbol
|
63
63
|
channel = 'diff_order_book_' + market['id']
|
64
64
|
url = self.urls['api']['ws']
|
65
|
-
request = {
|
65
|
+
request: dict = {
|
66
66
|
'event': 'bts:subscribe',
|
67
67
|
'data': {
|
68
68
|
'channel': channel,
|
@@ -165,7 +165,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
165
165
|
messageHash = 'trades:' + symbol
|
166
166
|
url = self.urls['api']['ws']
|
167
167
|
channel = 'live_trades_' + market['id']
|
168
|
-
request = {
|
168
|
+
request: dict = {
|
169
169
|
'event': 'bts:subscribe',
|
170
170
|
'data': {
|
171
171
|
'channel': channel,
|
@@ -269,7 +269,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
269
269
|
symbol = market['symbol']
|
270
270
|
channel = 'private-my_orders'
|
271
271
|
messageHash = channel + '_' + market['id']
|
272
|
-
subscription = {
|
272
|
+
subscription: dict = {
|
273
273
|
'symbol': symbol,
|
274
274
|
'limit': limit,
|
275
275
|
'type': channel,
|
@@ -419,7 +419,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
419
419
|
# }
|
420
420
|
#
|
421
421
|
channel = self.safe_string(message, 'channel')
|
422
|
-
methods = {
|
422
|
+
methods: dict = {
|
423
423
|
'live_trades': self.handle_trade,
|
424
424
|
'diff_order_book': self.handle_order_book,
|
425
425
|
'private-my_orders': self.handle_orders,
|
@@ -511,7 +511,7 @@ class bitstamp(ccxt.async_support.bitstamp):
|
|
511
511
|
url = self.urls['api']['ws']
|
512
512
|
await self.authenticate()
|
513
513
|
messageHash += '-' + self.options['userId']
|
514
|
-
request = {
|
514
|
+
request: dict = {
|
515
515
|
'event': 'bts:subscribe',
|
516
516
|
'data': {
|
517
517
|
'channel': messageHash,
|