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/binance.py
CHANGED
@@ -263,12 +263,12 @@ class binance(ccxt.async_support.binance):
|
|
263
263
|
messageHashesLength = len(messageHashes)
|
264
264
|
url = self.urls['api']['ws'][type] + '/' + self.stream(type, streamHash, messageHashesLength)
|
265
265
|
requestId = self.request_id(url)
|
266
|
-
request = {
|
266
|
+
request: dict = {
|
267
267
|
'method': 'SUBSCRIBE',
|
268
268
|
'params': subParams,
|
269
269
|
'id': requestId,
|
270
270
|
}
|
271
|
-
subscription = {
|
271
|
+
subscription: dict = {
|
272
272
|
'id': str(requestId),
|
273
273
|
'name': name,
|
274
274
|
'symbols': symbols,
|
@@ -292,7 +292,7 @@ class binance(ccxt.async_support.binance):
|
|
292
292
|
"""
|
293
293
|
await self.load_markets()
|
294
294
|
market = self.market(symbol)
|
295
|
-
payload = {
|
295
|
+
payload: dict = {
|
296
296
|
'symbol': market['id'],
|
297
297
|
}
|
298
298
|
if limit is not None:
|
@@ -307,12 +307,12 @@ class binance(ccxt.async_support.binance):
|
|
307
307
|
returnRateLimits, params = self.handle_option_and_params(params, 'createOrderWs', 'returnRateLimits', False)
|
308
308
|
payload['returnRateLimits'] = returnRateLimits
|
309
309
|
params = self.omit(params, 'test')
|
310
|
-
message = {
|
310
|
+
message: dict = {
|
311
311
|
'id': messageHash,
|
312
312
|
'method': 'depth',
|
313
313
|
'params': self.sign_params(self.extend(payload, params)),
|
314
314
|
}
|
315
|
-
subscription = {
|
315
|
+
subscription: dict = {
|
316
316
|
'method': self.handle_fetch_order_book,
|
317
317
|
}
|
318
318
|
orderbook = await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -568,12 +568,12 @@ class binance(ccxt.async_support.binance):
|
|
568
568
|
subParamsLength = len(subParams)
|
569
569
|
url = self.urls['api']['ws'][type] + '/' + self.stream(type, streamHash, subParamsLength)
|
570
570
|
requestId = self.request_id(url)
|
571
|
-
request = {
|
571
|
+
request: dict = {
|
572
572
|
'method': 'SUBSCRIBE',
|
573
573
|
'params': subParams,
|
574
574
|
'id': requestId,
|
575
575
|
}
|
576
|
-
subscribe = {
|
576
|
+
subscribe: dict = {
|
577
577
|
'id': requestId,
|
578
578
|
}
|
579
579
|
trades = await self.watch_multiple(url, subParams, self.extend(request, query), subParams, subscribe)
|
@@ -796,14 +796,14 @@ class binance(ccxt.async_support.binance):
|
|
796
796
|
type = 'future' if market['linear'] else 'delivery'
|
797
797
|
url = self.urls['api']['ws'][type] + '/' + self.stream(type, messageHash)
|
798
798
|
requestId = self.request_id(url)
|
799
|
-
request = {
|
799
|
+
request: dict = {
|
800
800
|
'method': 'SUBSCRIBE',
|
801
801
|
'params': [
|
802
802
|
messageHash,
|
803
803
|
],
|
804
804
|
'id': requestId,
|
805
805
|
}
|
806
|
-
subscribe = {
|
806
|
+
subscribe: dict = {
|
807
807
|
'id': requestId,
|
808
808
|
}
|
809
809
|
ohlcv = await self.watch(url, messageHash, self.extend(request, params), messageHash, subscribe)
|
@@ -839,7 +839,7 @@ class binance(ccxt.async_support.binance):
|
|
839
839
|
# }
|
840
840
|
#
|
841
841
|
event = self.safe_string(message, 'e')
|
842
|
-
eventMap = {
|
842
|
+
eventMap: dict = {
|
843
843
|
'indexPrice_kline': 'indexPriceKline',
|
844
844
|
'markPrice_kline': 'markPriceKline',
|
845
845
|
}
|
@@ -886,7 +886,7 @@ class binance(ccxt.async_support.binance):
|
|
886
886
|
"""
|
887
887
|
await self.load_markets()
|
888
888
|
market = self.market(symbol)
|
889
|
-
payload = {
|
889
|
+
payload: dict = {
|
890
890
|
'symbol': market['id'],
|
891
891
|
}
|
892
892
|
type = self.get_market_type('fetchTickerWs', market, params)
|
@@ -895,7 +895,7 @@ class binance(ccxt.async_support.binance):
|
|
895
895
|
url = self.urls['api']['ws']['ws-api'][type]
|
896
896
|
requestId = self.request_id(url)
|
897
897
|
messageHash = str(requestId)
|
898
|
-
subscription = {
|
898
|
+
subscription: dict = {
|
899
899
|
'method': self.handle_ticker_ws,
|
900
900
|
}
|
901
901
|
returnRateLimits = False
|
@@ -904,7 +904,7 @@ class binance(ccxt.async_support.binance):
|
|
904
904
|
params = self.omit(params, 'test')
|
905
905
|
method = None
|
906
906
|
method, params = self.handle_option_and_params(params, 'fetchTickerWs', 'method', 'ticker.book')
|
907
|
-
message = {
|
907
|
+
message: dict = {
|
908
908
|
'id': messageHash,
|
909
909
|
'method': method,
|
910
910
|
'params': self.sign_params(self.extend(payload, params)),
|
@@ -937,7 +937,7 @@ class binance(ccxt.async_support.binance):
|
|
937
937
|
messageHash = str(requestId)
|
938
938
|
returnRateLimits = False
|
939
939
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchOHLCVWs', 'returnRateLimits', False)
|
940
|
-
payload = {
|
940
|
+
payload: dict = {
|
941
941
|
'symbol': self.market_id(symbol),
|
942
942
|
'returnRateLimits': returnRateLimits,
|
943
943
|
'interval': self.timeframes[timeframe],
|
@@ -950,12 +950,12 @@ class binance(ccxt.async_support.binance):
|
|
950
950
|
payload['limit'] = limit
|
951
951
|
if until is not None:
|
952
952
|
payload['endTime'] = until
|
953
|
-
message = {
|
953
|
+
message: dict = {
|
954
954
|
'id': messageHash,
|
955
955
|
'method': 'klines',
|
956
956
|
'params': self.extend(payload, params),
|
957
957
|
}
|
958
|
-
subscription = {
|
958
|
+
subscription: dict = {
|
959
959
|
'method': self.handle_fetch_ohlcv,
|
960
960
|
}
|
961
961
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -1084,12 +1084,12 @@ class binance(ccxt.async_support.binance):
|
|
1084
1084
|
streamHash = channelName + '::' + ','.join(symbols)
|
1085
1085
|
url = self.urls['api']['ws'][rawMarketType] + '/' + self.stream(rawMarketType, streamHash)
|
1086
1086
|
requestId = self.request_id(url)
|
1087
|
-
request = {
|
1087
|
+
request: dict = {
|
1088
1088
|
'method': 'SUBSCRIBE',
|
1089
1089
|
'params': subscriptionArgs,
|
1090
1090
|
'id': requestId,
|
1091
1091
|
}
|
1092
|
-
subscribe = {
|
1092
|
+
subscribe: dict = {
|
1093
1093
|
'id': requestId,
|
1094
1094
|
}
|
1095
1095
|
result = await self.watch_multiple(url, messageHashes, self.deep_extend(request, params), subscriptionArgs, subscribe)
|
@@ -1098,7 +1098,7 @@ class binance(ccxt.async_support.binance):
|
|
1098
1098
|
if not symbolsDefined:
|
1099
1099
|
return result
|
1100
1100
|
else:
|
1101
|
-
newDict = {}
|
1101
|
+
newDict: dict = {}
|
1102
1102
|
newDict[result['symbol']] = result
|
1103
1103
|
return newDict
|
1104
1104
|
|
@@ -1283,7 +1283,7 @@ class binance(ccxt.async_support.binance):
|
|
1283
1283
|
channelName = None
|
1284
1284
|
resolvedMessageHashes = []
|
1285
1285
|
rawTickers = []
|
1286
|
-
newTickers = {}
|
1286
|
+
newTickers: dict = {}
|
1287
1287
|
if isinstance(message, list):
|
1288
1288
|
rawTickers = message
|
1289
1289
|
else:
|
@@ -1407,7 +1407,7 @@ class binance(ccxt.async_support.binance):
|
|
1407
1407
|
if listenKey is None:
|
1408
1408
|
# A network error happened: we can't renew a listen key that does not exist.
|
1409
1409
|
return
|
1410
|
-
request = {}
|
1410
|
+
request: dict = {}
|
1411
1411
|
symbol = self.safe_string(params, 'symbol')
|
1412
1412
|
params = self.omit(params, ['type', 'symbol'])
|
1413
1413
|
time = self.milliseconds()
|
@@ -1470,7 +1470,7 @@ class binance(ccxt.async_support.binance):
|
|
1470
1470
|
self.balance[type] = {}
|
1471
1471
|
|
1472
1472
|
async def load_balance_snapshot(self, client, messageHash, type, isPortfolioMargin):
|
1473
|
-
params = {
|
1473
|
+
params: dict = {
|
1474
1474
|
'type': type,
|
1475
1475
|
}
|
1476
1476
|
if isPortfolioMargin:
|
@@ -1504,17 +1504,17 @@ class binance(ccxt.async_support.binance):
|
|
1504
1504
|
messageHash = str(requestId)
|
1505
1505
|
returnRateLimits = False
|
1506
1506
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchBalanceWs', 'returnRateLimits', False)
|
1507
|
-
payload = {
|
1507
|
+
payload: dict = {
|
1508
1508
|
'returnRateLimits': returnRateLimits,
|
1509
1509
|
}
|
1510
1510
|
method = None
|
1511
1511
|
method, params = self.handle_option_and_params(params, 'fetchBalanceWs', 'method', 'account.status')
|
1512
|
-
message = {
|
1512
|
+
message: dict = {
|
1513
1513
|
'id': messageHash,
|
1514
1514
|
'method': method,
|
1515
1515
|
'params': self.sign_params(self.extend(payload, params)),
|
1516
1516
|
}
|
1517
|
-
subscription = {
|
1517
|
+
subscription: dict = {
|
1518
1518
|
'method': self.handle_account_status_ws if (method == 'account.status') else self.handle_balance_ws,
|
1519
1519
|
}
|
1520
1520
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -1604,7 +1604,7 @@ class binance(ccxt.async_support.binance):
|
|
1604
1604
|
url = self.urls['api']['ws']['ws-api']['future']
|
1605
1605
|
requestId = self.request_id(url)
|
1606
1606
|
messageHash = str(requestId)
|
1607
|
-
payload = {}
|
1607
|
+
payload: dict = {}
|
1608
1608
|
if symbols is not None:
|
1609
1609
|
symbolsLength = len(symbols)
|
1610
1610
|
if symbolsLength == 1:
|
@@ -1612,12 +1612,12 @@ class binance(ccxt.async_support.binance):
|
|
1612
1612
|
returnRateLimits = False
|
1613
1613
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchPositionsWs', 'returnRateLimits', False)
|
1614
1614
|
payload['returnRateLimits'] = returnRateLimits
|
1615
|
-
message = {
|
1615
|
+
message: dict = {
|
1616
1616
|
'id': messageHash,
|
1617
1617
|
'method': 'account.position',
|
1618
1618
|
'params': self.sign_params(self.extend(payload, params)),
|
1619
1619
|
}
|
1620
|
-
subscription = {
|
1620
|
+
subscription: dict = {
|
1621
1621
|
'method': self.handle_positions_ws,
|
1622
1622
|
}
|
1623
1623
|
result = await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -1840,7 +1840,7 @@ class binance(ccxt.async_support.binance):
|
|
1840
1840
|
payload['returnRateLimits'] = returnRateLimits
|
1841
1841
|
test = self.safe_bool(params, 'test', False)
|
1842
1842
|
params = self.omit(params, 'test')
|
1843
|
-
message = {
|
1843
|
+
message: dict = {
|
1844
1844
|
'id': messageHash,
|
1845
1845
|
'method': 'order.place',
|
1846
1846
|
'params': self.sign_params(self.extend(payload, params)),
|
@@ -1850,7 +1850,7 @@ class binance(ccxt.async_support.binance):
|
|
1850
1850
|
message['method'] = 'sor.order.test'
|
1851
1851
|
else:
|
1852
1852
|
message['method'] = 'order.test'
|
1853
|
-
subscription = {
|
1853
|
+
subscription: dict = {
|
1854
1854
|
'method': self.handle_order_ws,
|
1855
1855
|
}
|
1856
1856
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -1981,12 +1981,12 @@ class binance(ccxt.async_support.binance):
|
|
1981
1981
|
returnRateLimits = False
|
1982
1982
|
returnRateLimits, params = self.handle_option_and_params(params, 'editOrderWs', 'returnRateLimits', False)
|
1983
1983
|
payload['returnRateLimits'] = returnRateLimits
|
1984
|
-
message = {
|
1984
|
+
message: dict = {
|
1985
1985
|
'id': messageHash,
|
1986
1986
|
'method': 'order.modify' if (marketType == 'future') else 'order.cancelReplace',
|
1987
1987
|
'params': self.sign_params(self.extend(payload, params)),
|
1988
1988
|
}
|
1989
|
-
subscription = {
|
1989
|
+
subscription: dict = {
|
1990
1990
|
'method': self.handle_edit_order_ws,
|
1991
1991
|
}
|
1992
1992
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2121,7 +2121,7 @@ class binance(ccxt.async_support.binance):
|
|
2121
2121
|
messageHash = str(requestId)
|
2122
2122
|
returnRateLimits = False
|
2123
2123
|
returnRateLimits, params = self.handle_option_and_params(params, 'cancelOrderWs', 'returnRateLimits', False)
|
2124
|
-
payload = {
|
2124
|
+
payload: dict = {
|
2125
2125
|
'symbol': self.market_id(symbol),
|
2126
2126
|
'returnRateLimits': returnRateLimits,
|
2127
2127
|
}
|
@@ -2131,12 +2131,12 @@ class binance(ccxt.async_support.binance):
|
|
2131
2131
|
else:
|
2132
2132
|
payload['orderId'] = self.parse_to_int(id)
|
2133
2133
|
params = self.omit(params, ['origClientOrderId', 'clientOrderId'])
|
2134
|
-
message = {
|
2134
|
+
message: dict = {
|
2135
2135
|
'id': messageHash,
|
2136
2136
|
'method': 'order.cancel',
|
2137
2137
|
'params': self.sign_params(self.extend(payload, params)),
|
2138
2138
|
}
|
2139
|
-
subscription = {
|
2139
|
+
subscription: dict = {
|
2140
2140
|
'method': self.handle_order_ws,
|
2141
2141
|
}
|
2142
2142
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2159,16 +2159,16 @@ class binance(ccxt.async_support.binance):
|
|
2159
2159
|
messageHash = str(requestId)
|
2160
2160
|
returnRateLimits = False
|
2161
2161
|
returnRateLimits, params = self.handle_option_and_params(params, 'cancelAllOrdersWs', 'returnRateLimits', False)
|
2162
|
-
payload = {
|
2162
|
+
payload: dict = {
|
2163
2163
|
'symbol': self.market_id(symbol),
|
2164
2164
|
'returnRateLimits': returnRateLimits,
|
2165
2165
|
}
|
2166
|
-
message = {
|
2166
|
+
message: dict = {
|
2167
2167
|
'id': messageHash,
|
2168
2168
|
'method': 'order.cancel',
|
2169
2169
|
'params': self.sign_params(self.extend(payload, params)),
|
2170
2170
|
}
|
2171
|
-
subscription = {
|
2171
|
+
subscription: dict = {
|
2172
2172
|
'method': self.handle_orders_ws,
|
2173
2173
|
}
|
2174
2174
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2194,7 +2194,7 @@ class binance(ccxt.async_support.binance):
|
|
2194
2194
|
messageHash = str(requestId)
|
2195
2195
|
returnRateLimits = False
|
2196
2196
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchOrderWs', 'returnRateLimits', False)
|
2197
|
-
payload = {
|
2197
|
+
payload: dict = {
|
2198
2198
|
'symbol': self.market_id(symbol),
|
2199
2199
|
'returnRateLimits': returnRateLimits,
|
2200
2200
|
}
|
@@ -2203,12 +2203,12 @@ class binance(ccxt.async_support.binance):
|
|
2203
2203
|
payload['origClientOrderId'] = clientOrderId
|
2204
2204
|
else:
|
2205
2205
|
payload['orderId'] = self.parse_to_int(id)
|
2206
|
-
message = {
|
2206
|
+
message: dict = {
|
2207
2207
|
'id': messageHash,
|
2208
2208
|
'method': 'order.status',
|
2209
2209
|
'params': self.sign_params(self.extend(payload, params)),
|
2210
2210
|
}
|
2211
|
-
subscription = {
|
2211
|
+
subscription: dict = {
|
2212
2212
|
'method': self.handle_order_ws,
|
2213
2213
|
}
|
2214
2214
|
return await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2239,16 +2239,16 @@ class binance(ccxt.async_support.binance):
|
|
2239
2239
|
messageHash = str(requestId)
|
2240
2240
|
returnRateLimits = False
|
2241
2241
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchOrderWs', 'returnRateLimits', False)
|
2242
|
-
payload = {
|
2242
|
+
payload: dict = {
|
2243
2243
|
'symbol': self.market_id(symbol),
|
2244
2244
|
'returnRateLimits': returnRateLimits,
|
2245
2245
|
}
|
2246
|
-
message = {
|
2246
|
+
message: dict = {
|
2247
2247
|
'id': messageHash,
|
2248
2248
|
'method': 'allOrders',
|
2249
2249
|
'params': self.sign_params(self.extend(payload, params)),
|
2250
2250
|
}
|
2251
|
-
subscription = {
|
2251
|
+
subscription: dict = {
|
2252
2252
|
'method': self.handle_orders_ws,
|
2253
2253
|
}
|
2254
2254
|
orders = await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2292,17 +2292,17 @@ class binance(ccxt.async_support.binance):
|
|
2292
2292
|
messageHash = str(requestId)
|
2293
2293
|
returnRateLimits = False
|
2294
2294
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchOrderWs', 'returnRateLimits', False)
|
2295
|
-
payload = {
|
2295
|
+
payload: dict = {
|
2296
2296
|
'returnRateLimits': returnRateLimits,
|
2297
2297
|
}
|
2298
2298
|
if symbol is not None:
|
2299
2299
|
payload['symbol'] = self.market_id(symbol)
|
2300
|
-
message = {
|
2300
|
+
message: dict = {
|
2301
2301
|
'id': messageHash,
|
2302
2302
|
'method': 'openOrders.status',
|
2303
2303
|
'params': self.sign_params(self.extend(payload, params)),
|
2304
2304
|
}
|
2305
|
-
subscription = {
|
2305
|
+
subscription: dict = {
|
2306
2306
|
'method': self.handle_orders_ws,
|
2307
2307
|
}
|
2308
2308
|
orders = await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2606,7 +2606,7 @@ class binance(ccxt.async_support.binance):
|
|
2606
2606
|
if not self.is_empty(symbols):
|
2607
2607
|
market = self.get_market_from_symbols(symbols)
|
2608
2608
|
messageHash = '::' + ','.join(symbols)
|
2609
|
-
marketTypeObject = {}
|
2609
|
+
marketTypeObject: dict = {}
|
2610
2610
|
if market is not None:
|
2611
2611
|
marketTypeObject['type'] = market['type']
|
2612
2612
|
marketTypeObject['subType'] = market['subType']
|
@@ -2659,7 +2659,7 @@ class binance(ccxt.async_support.binance):
|
|
2659
2659
|
self.positions[type] = ArrayCacheBySymbolBySide()
|
2660
2660
|
|
2661
2661
|
async def load_positions_snapshot(self, client, messageHash, type, isPortfolioMargin):
|
2662
|
-
params = {
|
2662
|
+
params: dict = {
|
2663
2663
|
'type': type,
|
2664
2664
|
}
|
2665
2665
|
if isPortfolioMargin:
|
@@ -2811,7 +2811,7 @@ class binance(ccxt.async_support.binance):
|
|
2811
2811
|
messageHash = str(requestId)
|
2812
2812
|
returnRateLimits = False
|
2813
2813
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchMyTradesWs', 'returnRateLimits', False)
|
2814
|
-
payload = {
|
2814
|
+
payload: dict = {
|
2815
2815
|
'symbol': self.market_id(symbol),
|
2816
2816
|
'returnRateLimits': returnRateLimits,
|
2817
2817
|
}
|
@@ -2822,12 +2822,12 @@ class binance(ccxt.async_support.binance):
|
|
2822
2822
|
fromId = self.safe_integer(params, 'fromId')
|
2823
2823
|
if fromId is not None and since is not None:
|
2824
2824
|
raise BadRequest(self.id + 'fetchMyTradesWs does not support fetching by both fromId and since parameters at the same time')
|
2825
|
-
message = {
|
2825
|
+
message: dict = {
|
2826
2826
|
'id': messageHash,
|
2827
2827
|
'method': 'myTrades',
|
2828
2828
|
'params': self.sign_params(self.extend(payload, params)),
|
2829
2829
|
}
|
2830
|
-
subscription = {
|
2830
|
+
subscription: dict = {
|
2831
2831
|
'method': self.handle_trades_ws,
|
2832
2832
|
}
|
2833
2833
|
trades = await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -2858,18 +2858,18 @@ class binance(ccxt.async_support.binance):
|
|
2858
2858
|
messageHash = str(requestId)
|
2859
2859
|
returnRateLimits = False
|
2860
2860
|
returnRateLimits, params = self.handle_option_and_params(params, 'fetchTradesWs', 'returnRateLimits', False)
|
2861
|
-
payload = {
|
2861
|
+
payload: dict = {
|
2862
2862
|
'symbol': self.market_id(symbol),
|
2863
2863
|
'returnRateLimits': returnRateLimits,
|
2864
2864
|
}
|
2865
2865
|
if limit is not None:
|
2866
2866
|
payload['limit'] = limit
|
2867
|
-
message = {
|
2867
|
+
message: dict = {
|
2868
2868
|
'id': messageHash,
|
2869
2869
|
'method': 'trades.historical',
|
2870
2870
|
'params': self.extend(payload, params),
|
2871
2871
|
}
|
2872
|
-
subscription = {
|
2872
|
+
subscription: dict = {
|
2873
2873
|
'method': self.handle_trades_ws,
|
2874
2874
|
}
|
2875
2875
|
trades = await self.watch(url, messageHash, message, messageHash, subscription)
|
@@ -3108,7 +3108,7 @@ class binance(ccxt.async_support.binance):
|
|
3108
3108
|
method(client, message)
|
3109
3109
|
return
|
3110
3110
|
# handle other APIs
|
3111
|
-
methods = {
|
3111
|
+
methods: dict = {
|
3112
3112
|
'depthUpdate': self.handle_order_book,
|
3113
3113
|
'trade': self.handle_trade,
|
3114
3114
|
'aggTrade': self.handle_trade,
|
ccxt/pro/bingx.py
CHANGED
@@ -95,7 +95,7 @@ class bingx(ccxt.async_support.bingx):
|
|
95
95
|
raise BadRequest(self.id + ' watchTrades is not supported for ' + marketType + ' markets.')
|
96
96
|
messageHash = market['id'] + '@ticker'
|
97
97
|
uuid = self.uuid()
|
98
|
-
request = {
|
98
|
+
request: dict = {
|
99
99
|
'id': uuid,
|
100
100
|
'dataType': messageHash,
|
101
101
|
}
|
@@ -193,7 +193,7 @@ class bingx(ccxt.async_support.bingx):
|
|
193
193
|
# "b": "2.5747"
|
194
194
|
# }
|
195
195
|
#
|
196
|
-
timestamp = self.safe_integer(message, '
|
196
|
+
timestamp = self.safe_integer(message, 'C')
|
197
197
|
marketId = self.safe_string(message, 's')
|
198
198
|
market = self.safe_market(marketId, market)
|
199
199
|
close = self.safe_string(message, 'c')
|
@@ -239,7 +239,7 @@ class bingx(ccxt.async_support.bingx):
|
|
239
239
|
raise BadRequest(self.id + ' watchTrades is not supported for ' + marketType + ' markets.')
|
240
240
|
messageHash = market['id'] + '@trade'
|
241
241
|
uuid = self.uuid()
|
242
|
-
request = {
|
242
|
+
request: dict = {
|
243
243
|
'id': uuid,
|
244
244
|
'dataType': messageHash,
|
245
245
|
}
|
@@ -358,7 +358,7 @@ class bingx(ccxt.async_support.bingx):
|
|
358
358
|
raise BadRequest(self.id + ' watchOrderBook is not supported for ' + marketType + ' markets.')
|
359
359
|
messageHash = market['id'] + '@depth' + str(limit)
|
360
360
|
uuid = self.uuid()
|
361
|
-
request = {
|
361
|
+
request: dict = {
|
362
362
|
'id': uuid,
|
363
363
|
'dataType': messageHash,
|
364
364
|
}
|
@@ -544,7 +544,7 @@ class bingx(ccxt.async_support.bingx):
|
|
544
544
|
interval = self.safe_string(timeframes, timeframe, timeframe)
|
545
545
|
messageHash = market['id'] + '@kline_' + interval
|
546
546
|
uuid = self.uuid()
|
547
|
-
request = {
|
547
|
+
request: dict = {
|
548
548
|
'id': uuid,
|
549
549
|
'dataType': messageHash,
|
550
550
|
}
|
ccxt/pro/bitfinex.py
CHANGED
@@ -51,7 +51,7 @@ class bitfinex(ccxt.async_support.bitfinex):
|
|
51
51
|
url = self.urls['api']['ws']['public']
|
52
52
|
messageHash = channel + ':' + marketId
|
53
53
|
# channel = 'trades'
|
54
|
-
request = {
|
54
|
+
request: dict = {
|
55
55
|
'event': 'subscribe',
|
56
56
|
'channel': channel,
|
57
57
|
'symbol': marketId,
|
@@ -249,7 +249,7 @@ class bitfinex(ccxt.async_support.bitfinex):
|
|
249
249
|
options = self.safe_value(self.options, 'watchOrderBook', {})
|
250
250
|
prec = self.safe_string(options, 'prec', 'P0')
|
251
251
|
freq = self.safe_string(options, 'freq', 'F0')
|
252
|
-
request = {
|
252
|
+
request: dict = {
|
253
253
|
# "event": "subscribe", # added in subscribe()
|
254
254
|
# "channel": channel, # added in subscribe()
|
255
255
|
# "symbol": marketId, # added in subscribe()
|
@@ -393,7 +393,7 @@ class bitfinex(ccxt.async_support.bitfinex):
|
|
393
393
|
nonce = self.milliseconds()
|
394
394
|
payload = 'AUTH' + str(nonce)
|
395
395
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha384, 'hex')
|
396
|
-
request = {
|
396
|
+
request: dict = {
|
397
397
|
'apiKey': self.apiKey,
|
398
398
|
'authSig': signature,
|
399
399
|
'authNonce': nonce,
|
@@ -504,7 +504,7 @@ class bitfinex(ccxt.async_support.bitfinex):
|
|
504
504
|
client.resolve(self.orders, 'os')
|
505
505
|
|
506
506
|
def parse_ws_order_status(self, status):
|
507
|
-
statuses = {
|
507
|
+
statuses: dict = {
|
508
508
|
'ACTIVE': 'open',
|
509
509
|
'CANCELED': 'canceled',
|
510
510
|
}
|
@@ -586,7 +586,7 @@ class bitfinex(ccxt.async_support.bitfinex):
|
|
586
586
|
subscription = self.safe_value(client.subscriptions, channelId, {})
|
587
587
|
channel = self.safe_string(subscription, 'channel')
|
588
588
|
name = self.safe_string(message, 1)
|
589
|
-
methods = {
|
589
|
+
methods: dict = {
|
590
590
|
'book': self.handle_order_book,
|
591
591
|
# 'ohlc': self.handleOHLCV,
|
592
592
|
'ticker': self.handle_ticker,
|
@@ -610,7 +610,7 @@ class bitfinex(ccxt.async_support.bitfinex):
|
|
610
610
|
#
|
611
611
|
event = self.safe_string(message, 'event')
|
612
612
|
if event is not None:
|
613
|
-
methods = {
|
613
|
+
methods: dict = {
|
614
614
|
'info': self.handle_system_status,
|
615
615
|
# 'book': 'handleOrderBook',
|
616
616
|
'subscribed': self.handle_subscription_status,
|
ccxt/pro/bitfinex2.py
CHANGED
@@ -55,7 +55,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
55
55
|
url = self.urls['api']['ws']['public']
|
56
56
|
client = self.client(url)
|
57
57
|
messageHash = channel + ':' + marketId
|
58
|
-
request = {
|
58
|
+
request: dict = {
|
59
59
|
'event': 'subscribe',
|
60
60
|
'channel': channel,
|
61
61
|
'symbol': marketId,
|
@@ -93,7 +93,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
93
93
|
channel = 'candles'
|
94
94
|
key = 'trade:' + interval + ':' + market['id']
|
95
95
|
messageHash = channel + ':' + interval + ':' + market['id']
|
96
|
-
request = {
|
96
|
+
request: dict = {
|
97
97
|
'event': 'subscribe',
|
98
98
|
'channel': channel,
|
99
99
|
'key': key,
|
@@ -508,7 +508,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
508
508
|
options = self.safe_value(self.options, 'watchOrderBook', {})
|
509
509
|
prec = self.safe_string(options, 'prec', 'P0')
|
510
510
|
freq = self.safe_string(options, 'freq', 'F0')
|
511
|
-
request = {
|
511
|
+
request: dict = {
|
512
512
|
'prec': prec, # string, level of price aggregation, 'P0', 'P1', 'P2', 'P3', 'P4', default P0
|
513
513
|
'freq': freq, # string, frequency of updates 'F0' = realtime, 'F1' = 2 seconds, default is 'F0'
|
514
514
|
}
|
@@ -728,7 +728,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
728
728
|
data = self.safe_value(message, 2)
|
729
729
|
else:
|
730
730
|
data = [self.safe_value(message, 2)]
|
731
|
-
updatedTypes = {}
|
731
|
+
updatedTypes: dict = {}
|
732
732
|
for i in range(0, len(data)):
|
733
733
|
rawBalance = data[i]
|
734
734
|
currencyId = self.safe_string(rawBalance, 1)
|
@@ -805,7 +805,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
805
805
|
payload = 'AUTH' + str(nonce)
|
806
806
|
signature = self.hmac(self.encode(payload), self.encode(self.secret), hashlib.sha384, 'hex')
|
807
807
|
event = 'auth'
|
808
|
-
request = {
|
808
|
+
request: dict = {
|
809
809
|
'apiKey': self.apiKey,
|
810
810
|
'authSig': signature,
|
811
811
|
'authNonce': nonce,
|
@@ -896,7 +896,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
896
896
|
limit = self.safe_integer(self.options, 'ordersLimit', 1000)
|
897
897
|
self.orders = ArrayCacheBySymbolById(limit)
|
898
898
|
orders = self.orders
|
899
|
-
symbolIds = {}
|
899
|
+
symbolIds: dict = {}
|
900
900
|
if messageType == 'os':
|
901
901
|
snapshotLength = len(data)
|
902
902
|
if snapshotLength == 0:
|
@@ -922,7 +922,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
922
922
|
client.resolve(self.orders, messageHash)
|
923
923
|
|
924
924
|
def parse_ws_order_status(self, status):
|
925
|
-
statuses = {
|
925
|
+
statuses: dict = {
|
926
926
|
'ACTIVE': 'open',
|
927
927
|
'CANCELED': 'canceled',
|
928
928
|
'EXECUTED': 'closed',
|
@@ -1047,14 +1047,14 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
1047
1047
|
subscription = self.safe_value(client.subscriptions, channelId, {})
|
1048
1048
|
channel = self.safe_string(subscription, 'channel')
|
1049
1049
|
name = self.safe_string(message, 1)
|
1050
|
-
publicMethods = {
|
1050
|
+
publicMethods: dict = {
|
1051
1051
|
'book': self.handle_order_book,
|
1052
1052
|
'cs': self.handle_checksum,
|
1053
1053
|
'candles': self.handle_ohlcv,
|
1054
1054
|
'ticker': self.handle_ticker,
|
1055
1055
|
'trades': self.handle_trades,
|
1056
1056
|
}
|
1057
|
-
privateMethods = {
|
1057
|
+
privateMethods: dict = {
|
1058
1058
|
'os': self.handle_orders,
|
1059
1059
|
'ou': self.handle_orders,
|
1060
1060
|
'on': self.handle_orders,
|
@@ -1073,7 +1073,7 @@ class bitfinex2(ccxt.async_support.bitfinex2):
|
|
1073
1073
|
else:
|
1074
1074
|
event = self.safe_string(message, 'event')
|
1075
1075
|
if event is not None:
|
1076
|
-
methods = {
|
1076
|
+
methods: dict = {
|
1077
1077
|
'info': self.handle_system_status,
|
1078
1078
|
'subscribed': self.handle_subscription_status,
|
1079
1079
|
'auth': self.handle_authentication_message,
|