ccxt 4.3.30__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/bigone.py +32 -32
- ccxt/async_support/binance.py +105 -96
- ccxt/async_support/bingx.py +21 -21
- 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 +168 -139
- 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 +37 -37
- 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 +35 -35
- ccxt/base/types.py +13 -0
- ccxt/bigone.py +32 -32
- ccxt/binance.py +105 -96
- ccxt/bingx.py +21 -21
- 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 +168 -139
- 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 +37 -37
- 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.30.dist-info → ccxt-4.3.31.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/RECORD +258 -258
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.31.dist-info}/top_level.txt +0 -0
ccxt/pro/hitbtc.py
CHANGED
@@ -92,7 +92,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
92
92
|
if authenticated is None:
|
93
93
|
timestamp = self.milliseconds()
|
94
94
|
signature = self.hmac(self.encode(self.number_to_string(timestamp)), self.encode(self.secret), hashlib.sha256, 'hex')
|
95
|
-
request = {
|
95
|
+
request: dict = {
|
96
96
|
'method': 'login',
|
97
97
|
'params': {
|
98
98
|
'type': 'HS256',
|
@@ -133,7 +133,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
133
133
|
messageHash = messageHashPrefix
|
134
134
|
if symbols is not None:
|
135
135
|
messageHash = messageHash + '::' + ','.join(symbols)
|
136
|
-
subscribe = {
|
136
|
+
subscribe: dict = {
|
137
137
|
'method': 'subscribe',
|
138
138
|
'id': self.nonce(),
|
139
139
|
'ch': name,
|
@@ -155,7 +155,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
155
155
|
messageHash = self.safe_string(splitName, 0)
|
156
156
|
if symbol is not None:
|
157
157
|
messageHash = messageHash + '::' + symbol
|
158
|
-
subscribe = {
|
158
|
+
subscribe: dict = {
|
159
159
|
'method': name,
|
160
160
|
'params': params,
|
161
161
|
'id': self.nonce(),
|
@@ -173,7 +173,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
173
173
|
await self.authenticate()
|
174
174
|
url = self.urls['api']['ws']['private']
|
175
175
|
messageHash = str(self.nonce())
|
176
|
-
subscribe = {
|
176
|
+
subscribe: dict = {
|
177
177
|
'method': name,
|
178
178
|
'params': params,
|
179
179
|
'id': messageHash,
|
@@ -210,7 +210,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
210
210
|
elif name == 'orderbook/top/{speed}/batch':
|
211
211
|
name = 'orderbook/top/' + speed + 'ms/batch'
|
212
212
|
market = self.market(symbol)
|
213
|
-
request = {
|
213
|
+
request: dict = {
|
214
214
|
'params': {
|
215
215
|
'symbols': [market['id']],
|
216
216
|
},
|
@@ -304,7 +304,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
304
304
|
name = self.implode_params(method, {'speed': speed})
|
305
305
|
params = self.omit(params, ['method', 'speed'])
|
306
306
|
market = self.market(symbol)
|
307
|
-
request = {
|
307
|
+
request: dict = {
|
308
308
|
'params': {
|
309
309
|
'symbols': [market['id']],
|
310
310
|
},
|
@@ -335,7 +335,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
335
335
|
for i in range(0, len(symbols)):
|
336
336
|
marketId = self.market_id(symbols[i])
|
337
337
|
marketIds.append(marketId)
|
338
|
-
request = {
|
338
|
+
request: dict = {
|
339
339
|
'params': {
|
340
340
|
'symbols': marketIds,
|
341
341
|
},
|
@@ -386,7 +386,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
386
386
|
#
|
387
387
|
data = self.safe_value(message, 'data', {})
|
388
388
|
marketIds = list(data.keys())
|
389
|
-
newTickers = {}
|
389
|
+
newTickers: dict = {}
|
390
390
|
for i in range(0, len(marketIds)):
|
391
391
|
marketId = marketIds[i]
|
392
392
|
market = self.safe_market(marketId)
|
@@ -475,7 +475,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
475
475
|
"""
|
476
476
|
await self.load_markets()
|
477
477
|
market = self.market(symbol)
|
478
|
-
request = {
|
478
|
+
request: dict = {
|
479
479
|
'params': {
|
480
480
|
'symbols': [market['id']],
|
481
481
|
},
|
@@ -597,7 +597,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
597
597
|
period = self.safe_string(self.timeframes, timeframe, timeframe)
|
598
598
|
name = 'candles/' + period
|
599
599
|
market = self.market(symbol)
|
600
|
-
request = {
|
600
|
+
request: dict = {
|
601
601
|
'params': {
|
602
602
|
'symbols': [market['id']],
|
603
603
|
},
|
@@ -939,7 +939,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
939
939
|
})
|
940
940
|
mode = self.safe_string(params, 'mode', 'batches')
|
941
941
|
params = self.omit(params, 'mode')
|
942
|
-
request = {
|
942
|
+
request: dict = {
|
943
943
|
'mode': mode,
|
944
944
|
}
|
945
945
|
return await self.subscribe_private(name, None, self.extend(request, params))
|
@@ -1052,7 +1052,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
1052
1052
|
"""
|
1053
1053
|
await self.load_markets()
|
1054
1054
|
market = None
|
1055
|
-
request = {}
|
1055
|
+
request: dict = {}
|
1056
1056
|
if symbol is not None:
|
1057
1057
|
market = self.market(symbol)
|
1058
1058
|
request['symbol'] = market['id']
|
@@ -1142,7 +1142,7 @@ class hitbtc(ccxt.async_support.hitbtc):
|
|
1142
1142
|
if channel is not None:
|
1143
1143
|
splitChannel = channel.split('/')
|
1144
1144
|
channel = self.safe_string(splitChannel, 0)
|
1145
|
-
methods = {
|
1145
|
+
methods: dict = {
|
1146
1146
|
'candles': self.handle_ohlcv,
|
1147
1147
|
'ticker': self.handle_ticker,
|
1148
1148
|
'trades': self.handle_trades,
|
ccxt/pro/hollaex.py
CHANGED
@@ -218,7 +218,7 @@ class hollaex(ccxt.async_support.hollaex):
|
|
218
218
|
limit = self.safe_integer(self.options, 'tradesLimit', 1000)
|
219
219
|
self.myTrades = ArrayCache(limit)
|
220
220
|
stored = self.myTrades
|
221
|
-
marketIds = {}
|
221
|
+
marketIds: dict = {}
|
222
222
|
for i in range(0, len(rawTrades)):
|
223
223
|
trade = rawTrades[i]
|
224
224
|
parsed = self.parse_trade(trade)
|
@@ -329,7 +329,7 @@ class hollaex(ccxt.async_support.hollaex):
|
|
329
329
|
rawOrders = [data]
|
330
330
|
else:
|
331
331
|
rawOrders = data
|
332
|
-
marketIds = {}
|
332
|
+
marketIds: dict = {}
|
333
333
|
for i in range(0, len(rawOrders)):
|
334
334
|
order = rawOrders[i]
|
335
335
|
parsed = self.parse_order(order)
|
@@ -394,7 +394,7 @@ class hollaex(ccxt.async_support.hollaex):
|
|
394
394
|
|
395
395
|
async def watch_public(self, messageHash, params={}):
|
396
396
|
url = self.urls['api']['ws']
|
397
|
-
request = {
|
397
|
+
request: dict = {
|
398
398
|
'op': 'subscribe',
|
399
399
|
'args': [messageHash],
|
400
400
|
}
|
@@ -414,13 +414,13 @@ class hollaex(ccxt.async_support.hollaex):
|
|
414
414
|
url = self.urls['api']['ws']
|
415
415
|
auth = 'CONNECT' + '/stream' + expires
|
416
416
|
signature = self.hmac(self.encode(auth), self.encode(self.secret), hashlib.sha256)
|
417
|
-
authParams = {
|
417
|
+
authParams: dict = {
|
418
418
|
'api-key': self.apiKey,
|
419
419
|
'api-signature': signature,
|
420
420
|
'api-expires': expires,
|
421
421
|
}
|
422
422
|
signedUrl = url + '?' + self.urlencode(authParams)
|
423
|
-
request = {
|
423
|
+
request: dict = {
|
424
424
|
'op': 'subscribe',
|
425
425
|
'args': [messageHash],
|
426
426
|
}
|
@@ -534,7 +534,7 @@ class hollaex(ccxt.async_support.hollaex):
|
|
534
534
|
if content == 'pong':
|
535
535
|
self.handle_pong(client, message)
|
536
536
|
return
|
537
|
-
methods = {
|
537
|
+
methods: dict = {
|
538
538
|
'trade': self.handle_trades,
|
539
539
|
'orderbook': self.handle_order_book,
|
540
540
|
'order': self.handle_order,
|
ccxt/pro/htx.py
CHANGED
@@ -432,13 +432,13 @@ class htx(ccxt.async_support.htx):
|
|
432
432
|
market = self.market(symbol)
|
433
433
|
url = self.get_url_by_market_type(market['type'], market['linear'], False, True)
|
434
434
|
requestId = self.request_id()
|
435
|
-
request = {
|
435
|
+
request: dict = {
|
436
436
|
'req': messageHash,
|
437
437
|
'id': requestId,
|
438
438
|
}
|
439
439
|
# self is a temporary subscription by a specific requestId
|
440
440
|
# it has a very short lifetime until the snapshot is received over ws
|
441
|
-
snapshotSubscription = {
|
441
|
+
snapshotSubscription: dict = {
|
442
442
|
'id': requestId,
|
443
443
|
'messageHash': messageHash,
|
444
444
|
'symbol': symbol,
|
@@ -886,7 +886,7 @@ class htx(ccxt.async_support.htx):
|
|
886
886
|
status = self.parse_order_status(self.safe_string_2(data, 'orderStatus', 'status', 'closed'))
|
887
887
|
filled = self.safe_string(data, 'execAmt')
|
888
888
|
remaining = self.safe_string(data, 'remainAmt')
|
889
|
-
order = {
|
889
|
+
order: dict = {
|
890
890
|
'id': orderId,
|
891
891
|
'trades': trades,
|
892
892
|
'status': status,
|
@@ -903,13 +903,13 @@ class htx(ccxt.async_support.htx):
|
|
903
903
|
rawTrades = self.safe_value(message, 'trade', [])
|
904
904
|
tradesLength = len(rawTrades)
|
905
905
|
if tradesLength > 0:
|
906
|
-
tradesObject = {
|
906
|
+
tradesObject: dict = {
|
907
907
|
'trades': rawTrades,
|
908
908
|
'ch': messageHash,
|
909
909
|
'symbol': marketId,
|
910
910
|
}
|
911
911
|
# inject order params in every trade
|
912
|
-
extendTradeParams = {
|
912
|
+
extendTradeParams: dict = {
|
913
913
|
'order': self.safe_string(parsedOrder, 'id'),
|
914
914
|
'type': self.safe_string(parsedOrder, 'type'),
|
915
915
|
'side': self.safe_string(parsedOrder, 'side'),
|
@@ -1334,7 +1334,7 @@ class htx(ccxt.async_support.htx):
|
|
1334
1334
|
else:
|
1335
1335
|
# subscribe to all
|
1336
1336
|
channel = prefix + '.' + '*'
|
1337
|
-
subscriptionParams = {
|
1337
|
+
subscriptionParams: dict = {
|
1338
1338
|
'type': type,
|
1339
1339
|
'subType': subType,
|
1340
1340
|
'margin': marginMode,
|
@@ -1541,7 +1541,7 @@ class htx(ccxt.async_support.htx):
|
|
1541
1541
|
account = self.account()
|
1542
1542
|
account['free'] = self.safe_string_2(balance, 'margin_balance', 'margin_available')
|
1543
1543
|
account['used'] = self.safe_string(balance, 'margin_frozen')
|
1544
|
-
accountsByCode = {}
|
1544
|
+
accountsByCode: dict = {}
|
1545
1545
|
accountsByCode[code] = account
|
1546
1546
|
symbol = market['symbol']
|
1547
1547
|
self.balance[symbol] = self.safe_balance(accountsByCode)
|
@@ -1687,7 +1687,7 @@ class htx(ccxt.async_support.htx):
|
|
1687
1687
|
type = self.safe_string(parts, 0)
|
1688
1688
|
if type == 'market':
|
1689
1689
|
methodName = self.safe_string(parts, 2)
|
1690
|
-
methods = {
|
1690
|
+
methods: dict = {
|
1691
1691
|
'depth': self.handle_order_book,
|
1692
1692
|
'mbp': self.handle_order_book,
|
1693
1693
|
'detail': self.handle_ticker,
|
@@ -2083,7 +2083,7 @@ class htx(ccxt.async_support.htx):
|
|
2083
2083
|
|
2084
2084
|
def get_url_by_market_type(self, type, isLinear=True, isPrivate=False, isFeed=False):
|
2085
2085
|
api = self.safe_string(self.options, 'api', 'api')
|
2086
|
-
hostname = {'hostname': self.hostname}
|
2086
|
+
hostname: dict = {'hostname': self.hostname}
|
2087
2087
|
hostnameURL = None
|
2088
2088
|
url = None
|
2089
2089
|
if type == 'spot':
|
@@ -2103,11 +2103,11 @@ class htx(ccxt.async_support.htx):
|
|
2103
2103
|
|
2104
2104
|
async def subscribe_public(self, url, symbol, messageHash, method=None, params={}):
|
2105
2105
|
requestId = self.request_id()
|
2106
|
-
request = {
|
2106
|
+
request: dict = {
|
2107
2107
|
'sub': messageHash,
|
2108
2108
|
'id': requestId,
|
2109
2109
|
}
|
2110
|
-
subscription = {
|
2110
|
+
subscription: dict = {
|
2111
2111
|
'id': requestId,
|
2112
2112
|
'messageHash': messageHash,
|
2113
2113
|
'symbol': symbol,
|
@@ -2119,7 +2119,7 @@ class htx(ccxt.async_support.htx):
|
|
2119
2119
|
|
2120
2120
|
async def subscribe_private(self, channel, messageHash, type, subtype, params={}, subscriptionParams={}):
|
2121
2121
|
requestId = self.request_id()
|
2122
|
-
subscription = {
|
2122
|
+
subscription: dict = {
|
2123
2123
|
'id': requestId,
|
2124
2124
|
'messageHash': messageHash,
|
2125
2125
|
'params': params,
|
@@ -2140,7 +2140,7 @@ class htx(ccxt.async_support.htx):
|
|
2140
2140
|
isLinear = subtype == 'linear'
|
2141
2141
|
url = self.get_url_by_market_type(type, isLinear, True)
|
2142
2142
|
hostname = self.urls['hostnames']['spot'] if (type == 'spot') else self.urls['hostnames']['contract']
|
2143
|
-
authParams = {
|
2143
|
+
authParams: dict = {
|
2144
2144
|
'type': type,
|
2145
2145
|
'url': url,
|
2146
2146
|
'hostname': hostname,
|
@@ -2183,7 +2183,7 @@ class htx(ccxt.async_support.htx):
|
|
2183
2183
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha256, 'base64')
|
2184
2184
|
request = None
|
2185
2185
|
if type == 'spot':
|
2186
|
-
newParams = {
|
2186
|
+
newParams: dict = {
|
2187
2187
|
'authType': 'api',
|
2188
2188
|
'accessKey': self.apiKey,
|
2189
2189
|
'signatureMethod': 'HmacSHA256',
|
@@ -2207,7 +2207,7 @@ class htx(ccxt.async_support.htx):
|
|
2207
2207
|
'Signature': signature,
|
2208
2208
|
}
|
2209
2209
|
requestId = self.request_id()
|
2210
|
-
subscription = {
|
2210
|
+
subscription: dict = {
|
2211
2211
|
'id': requestId,
|
2212
2212
|
'messageHash': messageHash,
|
2213
2213
|
'params': params,
|
ccxt/pro/huobijp.py
CHANGED
@@ -62,14 +62,14 @@ class huobijp(ccxt.async_support.huobijp):
|
|
62
62
|
# only supports a limit of 150 at self time
|
63
63
|
messageHash = 'market.' + market['id'] + '.detail'
|
64
64
|
api = self.safe_string(self.options, 'api', 'api')
|
65
|
-
hostname = {'hostname': self.hostname}
|
65
|
+
hostname: dict = {'hostname': self.hostname}
|
66
66
|
url = self.implode_params(self.urls['api']['ws'][api]['public'], hostname)
|
67
67
|
requestId = self.request_id()
|
68
|
-
request = {
|
68
|
+
request: dict = {
|
69
69
|
'sub': messageHash,
|
70
70
|
'id': requestId,
|
71
71
|
}
|
72
|
-
subscription = {
|
72
|
+
subscription: dict = {
|
73
73
|
'id': requestId,
|
74
74
|
'messageHash': messageHash,
|
75
75
|
'symbol': symbol,
|
@@ -124,14 +124,14 @@ class huobijp(ccxt.async_support.huobijp):
|
|
124
124
|
# only supports a limit of 150 at self time
|
125
125
|
messageHash = 'market.' + market['id'] + '.trade.detail'
|
126
126
|
api = self.safe_string(self.options, 'api', 'api')
|
127
|
-
hostname = {'hostname': self.hostname}
|
127
|
+
hostname: dict = {'hostname': self.hostname}
|
128
128
|
url = self.implode_params(self.urls['api']['ws'][api]['public'], hostname)
|
129
129
|
requestId = self.request_id()
|
130
|
-
request = {
|
130
|
+
request: dict = {
|
131
131
|
'sub': messageHash,
|
132
132
|
'id': requestId,
|
133
133
|
}
|
134
|
-
subscription = {
|
134
|
+
subscription: dict = {
|
135
135
|
'id': requestId,
|
136
136
|
'messageHash': messageHash,
|
137
137
|
'symbol': symbol,
|
@@ -197,14 +197,14 @@ class huobijp(ccxt.async_support.huobijp):
|
|
197
197
|
interval = self.safe_string(self.timeframes, timeframe, timeframe)
|
198
198
|
messageHash = 'market.' + market['id'] + '.kline.' + interval
|
199
199
|
api = self.safe_string(self.options, 'api', 'api')
|
200
|
-
hostname = {'hostname': self.hostname}
|
200
|
+
hostname: dict = {'hostname': self.hostname}
|
201
201
|
url = self.implode_params(self.urls['api']['ws'][api]['public'], hostname)
|
202
202
|
requestId = self.request_id()
|
203
|
-
request = {
|
203
|
+
request: dict = {
|
204
204
|
'sub': messageHash,
|
205
205
|
'id': requestId,
|
206
206
|
}
|
207
|
-
subscription = {
|
207
|
+
subscription: dict = {
|
208
208
|
'id': requestId,
|
209
209
|
'messageHash': messageHash,
|
210
210
|
'symbol': symbol,
|
@@ -268,14 +268,14 @@ class huobijp(ccxt.async_support.huobijp):
|
|
268
268
|
limit = 150 if (limit is None) else limit
|
269
269
|
messageHash = 'market.' + market['id'] + '.mbp.' + str(limit)
|
270
270
|
api = self.safe_string(self.options, 'api', 'api')
|
271
|
-
hostname = {'hostname': self.hostname}
|
271
|
+
hostname: dict = {'hostname': self.hostname}
|
272
272
|
url = self.implode_params(self.urls['api']['ws'][api]['public'], hostname)
|
273
273
|
requestId = self.request_id()
|
274
|
-
request = {
|
274
|
+
request: dict = {
|
275
275
|
'sub': messageHash,
|
276
276
|
'id': requestId,
|
277
277
|
}
|
278
|
-
subscription = {
|
278
|
+
subscription: dict = {
|
279
279
|
'id': requestId,
|
280
280
|
'messageHash': messageHash,
|
281
281
|
'symbol': symbol,
|
@@ -328,16 +328,16 @@ class huobijp(ccxt.async_support.huobijp):
|
|
328
328
|
limit = self.safe_integer(subscription, 'limit')
|
329
329
|
params = self.safe_value(subscription, 'params')
|
330
330
|
api = self.safe_string(self.options, 'api', 'api')
|
331
|
-
hostname = {'hostname': self.hostname}
|
331
|
+
hostname: dict = {'hostname': self.hostname}
|
332
332
|
url = self.implode_params(self.urls['api']['ws'][api]['public'], hostname)
|
333
333
|
requestId = self.request_id()
|
334
|
-
request = {
|
334
|
+
request: dict = {
|
335
335
|
'req': messageHash,
|
336
336
|
'id': requestId,
|
337
337
|
}
|
338
338
|
# self is a temporary subscription by a specific requestId
|
339
339
|
# it has a very short lifetime until the snapshot is received over ws
|
340
|
-
snapshotSubscription = {
|
340
|
+
snapshotSubscription: dict = {
|
341
341
|
'id': requestId,
|
342
342
|
'messageHash': messageHash,
|
343
343
|
'symbol': symbol,
|
@@ -500,7 +500,7 @@ class huobijp(ccxt.async_support.huobijp):
|
|
500
500
|
type = self.safe_string(parts, 0)
|
501
501
|
if type == 'market':
|
502
502
|
methodName = self.safe_string(parts, 2)
|
503
|
-
methods = {
|
503
|
+
methods: dict = {
|
504
504
|
'mbp': self.handle_order_book,
|
505
505
|
'detail': self.handle_ticker,
|
506
506
|
'trade': self.handle_trades,
|
ccxt/pro/hyperliquid.py
CHANGED
@@ -66,7 +66,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
66
66
|
symbol = market['symbol']
|
67
67
|
messageHash = 'orderbook:' + symbol
|
68
68
|
url = self.urls['api']['ws']['public']
|
69
|
-
request = {
|
69
|
+
request: dict = {
|
70
70
|
'method': 'subscribe',
|
71
71
|
'subscription': {
|
72
72
|
'type': 'l2Book',
|
@@ -109,7 +109,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
109
109
|
market = self.market(marketId)
|
110
110
|
symbol = market['symbol']
|
111
111
|
rawData = self.safe_list(entry, 'levels', [])
|
112
|
-
data = {
|
112
|
+
data: dict = {
|
113
113
|
'bids': self.safe_list(rawData, 0, []),
|
114
114
|
'asks': self.safe_list(rawData, 1, []),
|
115
115
|
}
|
@@ -141,7 +141,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
141
141
|
symbol = self.symbol(symbol)
|
142
142
|
messageHash += ':' + symbol
|
143
143
|
url = self.urls['api']['ws']['public']
|
144
|
-
request = {
|
144
|
+
request: dict = {
|
145
145
|
'method': 'subscribe',
|
146
146
|
'subscription': {
|
147
147
|
'type': 'userFills',
|
@@ -188,7 +188,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
188
188
|
limit = self.safe_integer(self.options, 'tradesLimit', 1000)
|
189
189
|
self.myTrades = ArrayCacheBySymbolById(limit)
|
190
190
|
trades = self.myTrades
|
191
|
-
symbols = {}
|
191
|
+
symbols: dict = {}
|
192
192
|
data = self.safe_list(entry, 'fills', [])
|
193
193
|
dataLength = len(data)
|
194
194
|
if dataLength == 0:
|
@@ -221,7 +221,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
221
221
|
symbol = market['symbol']
|
222
222
|
messageHash = 'trade:' + symbol
|
223
223
|
url = self.urls['api']['ws']['public']
|
224
|
-
request = {
|
224
|
+
request: dict = {
|
225
225
|
'method': 'subscribe',
|
226
226
|
'subscription': {
|
227
227
|
'type': 'trades',
|
@@ -345,7 +345,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
345
345
|
market = self.market(symbol)
|
346
346
|
symbol = market['symbol']
|
347
347
|
url = self.urls['api']['ws']['public']
|
348
|
-
request = {
|
348
|
+
request: dict = {
|
349
349
|
'method': 'subscribe',
|
350
350
|
'subscription': {
|
351
351
|
'type': 'candle',
|
@@ -415,7 +415,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
415
415
|
symbol = market['symbol']
|
416
416
|
messageHash = messageHash + ':' + symbol
|
417
417
|
url = self.urls['api']['ws']['public']
|
418
|
-
request = {
|
418
|
+
request: dict = {
|
419
419
|
'method': 'subscribe',
|
420
420
|
'subscription': {
|
421
421
|
'type': 'orderUpdates',
|
@@ -458,7 +458,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
458
458
|
return
|
459
459
|
stored = self.orders
|
460
460
|
messageHash = 'order'
|
461
|
-
marketSymbols = {}
|
461
|
+
marketSymbols: dict = {}
|
462
462
|
for i in range(0, len(data)):
|
463
463
|
rawOrder = data[i]
|
464
464
|
order = self.parse_order(rawOrder)
|
@@ -490,7 +490,7 @@ class hyperliquid(ccxt.async_support.hyperliquid):
|
|
490
490
|
if self.handle_error_message(client, message):
|
491
491
|
return
|
492
492
|
topic = self.safe_string(message, 'channel', '')
|
493
|
-
methods = {
|
493
|
+
methods: dict = {
|
494
494
|
'pong': self.handle_pong,
|
495
495
|
'trades': self.handle_trades,
|
496
496
|
'l2Book': self.handle_order_book,
|
ccxt/pro/idex.py
CHANGED
@@ -49,7 +49,7 @@ class idex(ccxt.async_support.idex):
|
|
49
49
|
|
50
50
|
async def subscribe(self, subscribeObject, messageHash, subscription=True):
|
51
51
|
url = self.urls['test']['ws']
|
52
|
-
request = {
|
52
|
+
request: dict = {
|
53
53
|
'method': 'subscribe',
|
54
54
|
'subscriptions': [
|
55
55
|
subscribeObject,
|
@@ -60,7 +60,7 @@ class idex(ccxt.async_support.idex):
|
|
60
60
|
async def subscribe_private(self, subscribeObject, messageHash):
|
61
61
|
token = await self.authenticate()
|
62
62
|
url = self.urls['test']['ws']
|
63
|
-
request = {
|
63
|
+
request: dict = {
|
64
64
|
'method': 'subscribe',
|
65
65
|
'token': token,
|
66
66
|
'subscriptions': [
|
@@ -79,7 +79,7 @@ class idex(ccxt.async_support.idex):
|
|
79
79
|
await self.load_markets()
|
80
80
|
market = self.market(symbol)
|
81
81
|
name = 'tickers'
|
82
|
-
subscribeObject = {
|
82
|
+
subscribeObject: dict = {
|
83
83
|
'name': name,
|
84
84
|
'markets': [market['id']],
|
85
85
|
}
|
@@ -151,7 +151,7 @@ class idex(ccxt.async_support.idex):
|
|
151
151
|
market = self.market(symbol)
|
152
152
|
symbol = market['symbol']
|
153
153
|
name = 'trades'
|
154
|
-
subscribeObject = {
|
154
|
+
subscribeObject: dict = {
|
155
155
|
'name': name,
|
156
156
|
'markets': [market['id']],
|
157
157
|
}
|
@@ -243,7 +243,7 @@ class idex(ccxt.async_support.idex):
|
|
243
243
|
symbol = market['symbol']
|
244
244
|
name = 'candles'
|
245
245
|
interval = self.safe_string(self.timeframes, timeframe, timeframe)
|
246
|
-
subscribeObject = {
|
246
|
+
subscribeObject: dict = {
|
247
247
|
'name': name,
|
248
248
|
'markets': [market['id']],
|
249
249
|
'interval': interval,
|
@@ -391,12 +391,12 @@ class idex(ccxt.async_support.idex):
|
|
391
391
|
await self.load_markets()
|
392
392
|
market = self.market(symbol)
|
393
393
|
name = 'l2orderbook'
|
394
|
-
subscribeObject = {
|
394
|
+
subscribeObject: dict = {
|
395
395
|
'name': name,
|
396
396
|
'markets': [market['id']],
|
397
397
|
}
|
398
398
|
messageHash = name + ':' + market['id']
|
399
|
-
subscription = {
|
399
|
+
subscription: dict = {
|
400
400
|
'fetchingOrderBookSnapshot': False,
|
401
401
|
'numAttempts': 0,
|
402
402
|
'startTime': None,
|
@@ -466,7 +466,7 @@ class idex(ccxt.async_support.idex):
|
|
466
466
|
time = self.seconds()
|
467
467
|
lastAuthenticatedTime = self.safe_integer(self.options, 'lastAuthenticatedTime', 0)
|
468
468
|
if time - lastAuthenticatedTime > 900:
|
469
|
-
request = {
|
469
|
+
request: dict = {
|
470
470
|
'wallet': self.walletAddress,
|
471
471
|
'nonce': self.uuidv1(),
|
472
472
|
}
|
@@ -486,7 +486,7 @@ class idex(ccxt.async_support.idex):
|
|
486
486
|
"""
|
487
487
|
await self.load_markets()
|
488
488
|
name = 'orders'
|
489
|
-
subscribeObject = {
|
489
|
+
subscribeObject: dict = {
|
490
490
|
'name': name,
|
491
491
|
}
|
492
492
|
messageHash = name
|
@@ -602,7 +602,7 @@ class idex(ccxt.async_support.idex):
|
|
602
602
|
async def watch_transactions(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
603
603
|
await self.load_markets()
|
604
604
|
name = 'balances'
|
605
|
-
subscribeObject = {
|
605
|
+
subscribeObject: dict = {
|
606
606
|
'name': name,
|
607
607
|
}
|
608
608
|
messageHash = name
|
@@ -629,7 +629,7 @@ class idex(ccxt.async_support.idex):
|
|
629
629
|
messageHash = type + ':' + currencyId
|
630
630
|
code = self.safe_currency_code(currencyId)
|
631
631
|
address = self.safe_string(data, 'w')
|
632
|
-
transaction = {
|
632
|
+
transaction: dict = {
|
633
633
|
'info': message,
|
634
634
|
'id': None,
|
635
635
|
'currency': code,
|
@@ -658,7 +658,7 @@ class idex(ccxt.async_support.idex):
|
|
658
658
|
|
659
659
|
def handle_message(self, client: Client, message):
|
660
660
|
type = self.safe_string(message, 'type')
|
661
|
-
methods = {
|
661
|
+
methods: dict = {
|
662
662
|
'tickers': self.handle_ticker,
|
663
663
|
'trades': self.handle_trade,
|
664
664
|
'subscriptions': self.handle_subscribe_message,
|
ccxt/pro/independentreserve.py
CHANGED
@@ -138,7 +138,7 @@ class independentreserve(ccxt.async_support.independentreserve):
|
|
138
138
|
limitString = self.number_to_string(limit)
|
139
139
|
url = self.urls['api']['ws'] + '/orderbook/' + limitString + '?subscribe=' + market['base'] + '-' + market['quote']
|
140
140
|
messageHash = 'orderbook:' + symbol + ':' + limitString
|
141
|
-
subscription = {
|
141
|
+
subscription: dict = {
|
142
142
|
'receivedSnapshot': False,
|
143
143
|
}
|
144
144
|
orderbook = await self.watch(url, messageHash, None, messageHash, subscription)
|
@@ -256,7 +256,7 @@ class independentreserve(ccxt.async_support.independentreserve):
|
|
256
256
|
|
257
257
|
def handle_message(self, client: Client, message):
|
258
258
|
event = self.safe_string(message, 'Event')
|
259
|
-
handlers = {
|
259
|
+
handlers: dict = {
|
260
260
|
'Subscriptions': self.handle_subscriptions,
|
261
261
|
'Heartbeat': self.handle_heartbeat,
|
262
262
|
'Trade': self.handle_trades,
|