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/poloniex.py
CHANGED
@@ -441,7 +441,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
441
441
|
if paginate:
|
442
442
|
return self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 500)
|
443
443
|
market = self.market(symbol)
|
444
|
-
request = {
|
444
|
+
request: dict = {
|
445
445
|
'symbol': market['id'],
|
446
446
|
'interval': self.safe_string(self.timeframes, timeframe, timeframe),
|
447
447
|
}
|
@@ -705,7 +705,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
705
705
|
# }
|
706
706
|
# ]
|
707
707
|
#
|
708
|
-
result = {}
|
708
|
+
result: dict = {}
|
709
709
|
for i in range(0, len(response)):
|
710
710
|
item = self.safe_value(response, i)
|
711
711
|
ids = list(item.keys())
|
@@ -789,7 +789,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
789
789
|
}
|
790
790
|
result[code]['networks'] = networks
|
791
791
|
info = self.safe_value(result[code], 'info', [])
|
792
|
-
rawInfo = {}
|
792
|
+
rawInfo: dict = {}
|
793
793
|
rawInfo[id] = currency
|
794
794
|
info.append(rawInfo)
|
795
795
|
result[code]['info'] = info
|
@@ -812,7 +812,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
812
812
|
"""
|
813
813
|
self.load_markets()
|
814
814
|
market = self.market(symbol)
|
815
|
-
request = {
|
815
|
+
request: dict = {
|
816
816
|
'symbol': market['id'],
|
817
817
|
}
|
818
818
|
response = self.publicGetMarketsSymbolTicker24h(self.extend(request, params))
|
@@ -840,7 +840,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
840
840
|
#
|
841
841
|
return self.parse_ticker(response, market)
|
842
842
|
|
843
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
843
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
844
844
|
#
|
845
845
|
# fetchTrades
|
846
846
|
#
|
@@ -942,7 +942,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
942
942
|
"""
|
943
943
|
self.load_markets()
|
944
944
|
market = self.market(symbol)
|
945
|
-
request = {
|
945
|
+
request: dict = {
|
946
946
|
'symbol': market['id'],
|
947
947
|
}
|
948
948
|
if limit is not None:
|
@@ -983,7 +983,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
983
983
|
market: Market = None
|
984
984
|
if symbol is not None:
|
985
985
|
market = self.market(symbol)
|
986
|
-
request = {
|
986
|
+
request: dict = {
|
987
987
|
# 'from': 12345678, # A 'trade Id'. The query begins at ‘from'.
|
988
988
|
# 'direction': 'PRE', # PRE, NEXT The direction before or after ‘from'.
|
989
989
|
}
|
@@ -1017,8 +1017,8 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1017
1017
|
result = self.parse_trades(response, market, since, limit)
|
1018
1018
|
return result
|
1019
1019
|
|
1020
|
-
def parse_order_status(self, status):
|
1021
|
-
statuses = {
|
1020
|
+
def parse_order_status(self, status: Str):
|
1021
|
+
statuses: dict = {
|
1022
1022
|
'NEW': 'open',
|
1023
1023
|
'PARTIALLY_FILLED': 'open',
|
1024
1024
|
'FILLED': 'closed',
|
@@ -1029,7 +1029,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1029
1029
|
}
|
1030
1030
|
return self.safe_string(statuses, status, status)
|
1031
1031
|
|
1032
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1032
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1033
1033
|
#
|
1034
1034
|
# fetchOpenOrder
|
1035
1035
|
#
|
@@ -1142,7 +1142,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1142
1142
|
}, market)
|
1143
1143
|
|
1144
1144
|
def parse_order_type(self, status):
|
1145
|
-
statuses = {
|
1145
|
+
statuses: dict = {
|
1146
1146
|
'MARKET': 'market',
|
1147
1147
|
'LIMIT': 'limit',
|
1148
1148
|
'STOP-LIMIT': 'limit',
|
@@ -1176,7 +1176,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1176
1176
|
"""
|
1177
1177
|
self.load_markets()
|
1178
1178
|
market: Market = None
|
1179
|
-
request = {}
|
1179
|
+
request: dict = {}
|
1180
1180
|
if symbol is not None:
|
1181
1181
|
market = self.market(symbol)
|
1182
1182
|
request['symbol'] = market['id']
|
@@ -1212,7 +1212,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1212
1212
|
# }
|
1213
1213
|
# ]
|
1214
1214
|
#
|
1215
|
-
extension = {'status': 'open'}
|
1215
|
+
extension: dict = {'status': 'open'}
|
1216
1216
|
return self.parse_orders(response, market, since, limit, extension)
|
1217
1217
|
|
1218
1218
|
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
@@ -1234,7 +1234,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1234
1234
|
market = self.market(symbol)
|
1235
1235
|
if not market['spot']:
|
1236
1236
|
raise NotSupported(self.id + ' createOrder() does not support ' + market['type'] + ' orders, only spot orders are accepted')
|
1237
|
-
request = {
|
1237
|
+
request: dict = {
|
1238
1238
|
'symbol': market['id'],
|
1239
1239
|
'side': side,
|
1240
1240
|
# 'timeInForce': timeInForce,
|
@@ -1322,7 +1322,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1322
1322
|
market = self.market(symbol)
|
1323
1323
|
if not market['spot']:
|
1324
1324
|
raise NotSupported(self.id + ' editOrder() does not support ' + market['type'] + ' orders, only spot orders are accepted')
|
1325
|
-
request = {
|
1325
|
+
request: dict = {
|
1326
1326
|
'id': id,
|
1327
1327
|
# 'timeInForce': timeInForce,
|
1328
1328
|
}
|
@@ -1358,7 +1358,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1358
1358
|
# @returns {object} An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1359
1359
|
#
|
1360
1360
|
self.load_markets()
|
1361
|
-
request = {}
|
1361
|
+
request: dict = {}
|
1362
1362
|
clientOrderId = self.safe_value(params, 'clientOrderId')
|
1363
1363
|
if clientOrderId is not None:
|
1364
1364
|
id = clientOrderId
|
@@ -1392,7 +1392,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1392
1392
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1393
1393
|
"""
|
1394
1394
|
self.load_markets()
|
1395
|
-
request = {
|
1395
|
+
request: dict = {
|
1396
1396
|
# 'accountTypes': 'SPOT',
|
1397
1397
|
'symbols': [],
|
1398
1398
|
}
|
@@ -1441,7 +1441,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1441
1441
|
"""
|
1442
1442
|
self.load_markets()
|
1443
1443
|
id = str(id)
|
1444
|
-
request = {
|
1444
|
+
request: dict = {
|
1445
1445
|
'id': id,
|
1446
1446
|
}
|
1447
1447
|
isTrigger = self.safe_value_2(params, 'trigger', 'stop')
|
@@ -1495,7 +1495,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1495
1495
|
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
1496
1496
|
"""
|
1497
1497
|
self.load_markets()
|
1498
|
-
request = {
|
1498
|
+
request: dict = {
|
1499
1499
|
'id': id,
|
1500
1500
|
}
|
1501
1501
|
trades = self.privateGetOrdersIdTrades(self.extend(request, params))
|
@@ -1523,7 +1523,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1523
1523
|
return self.parse_trades(trades)
|
1524
1524
|
|
1525
1525
|
def parse_balance(self, response) -> Balances:
|
1526
|
-
result = {
|
1526
|
+
result: dict = {
|
1527
1527
|
'info': response,
|
1528
1528
|
'timestamp': None,
|
1529
1529
|
'datetime': None,
|
@@ -1549,7 +1549,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1549
1549
|
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
1550
1550
|
"""
|
1551
1551
|
self.load_markets()
|
1552
|
-
request = {
|
1552
|
+
request: dict = {
|
1553
1553
|
'accountType': 'SPOT',
|
1554
1554
|
}
|
1555
1555
|
response = self.privateGetAccountsBalances(self.extend(request, params))
|
@@ -1588,7 +1588,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1588
1588
|
# "volume30D" : "0.00"
|
1589
1589
|
# }
|
1590
1590
|
#
|
1591
|
-
result = {}
|
1591
|
+
result: dict = {}
|
1592
1592
|
for i in range(0, len(self.symbols)):
|
1593
1593
|
symbol = self.symbols[i]
|
1594
1594
|
result[symbol] = {
|
@@ -1612,7 +1612,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1612
1612
|
"""
|
1613
1613
|
self.load_markets()
|
1614
1614
|
market = self.market(symbol)
|
1615
|
-
request = {
|
1615
|
+
request: dict = {
|
1616
1616
|
'symbol': market['id'],
|
1617
1617
|
}
|
1618
1618
|
if limit is not None:
|
@@ -1661,7 +1661,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1661
1661
|
"""
|
1662
1662
|
self.load_markets()
|
1663
1663
|
currency = self.currency(code)
|
1664
|
-
request = {
|
1664
|
+
request: dict = {
|
1665
1665
|
'currency': currency['id'],
|
1666
1666
|
}
|
1667
1667
|
networks = self.safe_value(self.options, 'networks', {})
|
@@ -1705,7 +1705,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1705
1705
|
"""
|
1706
1706
|
self.load_markets()
|
1707
1707
|
currency = self.currency(code)
|
1708
|
-
request = {
|
1708
|
+
request: dict = {
|
1709
1709
|
'currency': currency['id'],
|
1710
1710
|
}
|
1711
1711
|
networks = self.safe_value(self.options, 'networks', {})
|
@@ -1755,7 +1755,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1755
1755
|
accountsByType = self.safe_value(self.options, 'accountsByType', {})
|
1756
1756
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
1757
1757
|
toId = self.safe_string(accountsByType, toAccount, fromAccount)
|
1758
|
-
request = {
|
1758
|
+
request: dict = {
|
1759
1759
|
'amount': self.currency_to_precision(code, amount),
|
1760
1760
|
'currency': currency['id'],
|
1761
1761
|
'fromAccount': fromId,
|
@@ -1802,7 +1802,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1802
1802
|
self.check_address(address)
|
1803
1803
|
self.load_markets()
|
1804
1804
|
currency = self.currency(code)
|
1805
|
-
request = {
|
1805
|
+
request: dict = {
|
1806
1806
|
'currency': currency['id'],
|
1807
1807
|
'amount': amount,
|
1808
1808
|
'address': address,
|
@@ -1830,7 +1830,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1830
1830
|
year = 31104000 # 60 * 60 * 24 * 30 * 12 = one year of history, why not
|
1831
1831
|
now = self.seconds()
|
1832
1832
|
start = self.parse_to_int(since / 1000) if (since is not None) else now - 10 * year
|
1833
|
-
request = {
|
1833
|
+
request: dict = {
|
1834
1834
|
'start': start, # UNIX timestamp, required
|
1835
1835
|
'end': now, # UNIX timestamp, required
|
1836
1836
|
}
|
@@ -1981,7 +1981,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
1981
1981
|
# }
|
1982
1982
|
# ]
|
1983
1983
|
#
|
1984
|
-
data = {}
|
1984
|
+
data: dict = {}
|
1985
1985
|
for i in range(0, len(response)):
|
1986
1986
|
entry = response[i]
|
1987
1987
|
currencies = list(entry.keys())
|
@@ -2011,7 +2011,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2011
2011
|
# },
|
2012
2012
|
# }
|
2013
2013
|
#
|
2014
|
-
depositWithdrawFees = {}
|
2014
|
+
depositWithdrawFees: dict = {}
|
2015
2015
|
codes = self.market_codes(codes)
|
2016
2016
|
responseKeys = list(response.keys())
|
2017
2017
|
for i in range(0, len(responseKeys)):
|
@@ -2029,7 +2029,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2029
2029
|
networkId = networkId.replace(code, '')
|
2030
2030
|
networkCode = self.network_id_to_code(networkId)
|
2031
2031
|
networkInfo = self.safe_value(response, networkId)
|
2032
|
-
networkObject = {}
|
2032
|
+
networkObject: dict = {}
|
2033
2033
|
withdrawFee = self.safe_number(networkInfo, 'withdrawalFee')
|
2034
2034
|
networkObject[networkCode] = {
|
2035
2035
|
'withdraw': {
|
@@ -2049,11 +2049,11 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2049
2049
|
depositWithdrawFee['info'][currency['code']] = fee
|
2050
2050
|
networkId = self.safe_string(fee, 'blockchain')
|
2051
2051
|
withdrawFee = self.safe_number(fee, 'withdrawalFee')
|
2052
|
-
withdrawResult = {
|
2052
|
+
withdrawResult: dict = {
|
2053
2053
|
'fee': withdrawFee,
|
2054
2054
|
'percentage': False if (withdrawFee is not None) else None,
|
2055
2055
|
}
|
2056
|
-
depositResult = {
|
2056
|
+
depositResult: dict = {
|
2057
2057
|
'fee': None,
|
2058
2058
|
'percentage': None,
|
2059
2059
|
}
|
@@ -2085,7 +2085,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2085
2085
|
return self.filter_by_currency_since_limit(transactions, code, since, limit)
|
2086
2086
|
|
2087
2087
|
def parse_transaction_status(self, status):
|
2088
|
-
statuses = {
|
2088
|
+
statuses: dict = {
|
2089
2089
|
'COMPLETE': 'ok',
|
2090
2090
|
'COMPLETED': 'ok',
|
2091
2091
|
'AWAITING APPROVAL': 'pending',
|
@@ -2097,7 +2097,7 @@ class poloniex(Exchange, ImplicitAPI):
|
|
2097
2097
|
}
|
2098
2098
|
return self.safe_string(statuses, status, status)
|
2099
2099
|
|
2100
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2100
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
2101
2101
|
#
|
2102
2102
|
# deposits
|
2103
2103
|
#
|
ccxt/poloniexfutures.py
CHANGED
@@ -383,9 +383,12 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
383
383
|
marketId = self.safe_string(ticker, 'symbol')
|
384
384
|
symbol = self.safe_symbol(marketId, market)
|
385
385
|
timestampString = self.safe_string(ticker, 'ts')
|
386
|
-
# check timestamp bcz bug: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011 and also 17 digits occured
|
387
386
|
multiplier = None
|
388
|
-
if len(timestampString) ==
|
387
|
+
if len(timestampString) == 16:
|
388
|
+
# 16 digits: https://app.travis-ci.com/github/ccxt/ccxt/builds/270587157#L5454
|
389
|
+
multiplier = 0.001
|
390
|
+
elif len(timestampString) == 17:
|
391
|
+
# 17 digits: https://app.travis-ci.com/github/ccxt/ccxt/builds/269959181#L4011
|
389
392
|
multiplier = 0.0001
|
390
393
|
elif len(timestampString) == 18:
|
391
394
|
multiplier = 0.00001
|
@@ -428,7 +431,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
428
431
|
"""
|
429
432
|
self.load_markets()
|
430
433
|
market = self.market(symbol)
|
431
|
-
request = {
|
434
|
+
request: dict = {
|
432
435
|
'symbol': market['id'],
|
433
436
|
}
|
434
437
|
response = self.publicGetTicker(self.extend(request, params))
|
@@ -462,7 +465,8 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
462
465
|
"""
|
463
466
|
self.load_markets()
|
464
467
|
response = self.publicGetTickers(params)
|
465
|
-
|
468
|
+
data = self.safe_list(response, 'data', [])
|
469
|
+
return self.parse_tickers(data, symbols)
|
466
470
|
|
467
471
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
468
472
|
"""
|
@@ -480,7 +484,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
480
484
|
if level is not None and level != 2 and level != 3:
|
481
485
|
raise BadRequest(self.id + ' fetchOrderBook() can only return level 2 & 3')
|
482
486
|
market = self.market(symbol)
|
483
|
-
request = {
|
487
|
+
request: dict = {
|
484
488
|
'symbol': market['id'],
|
485
489
|
}
|
486
490
|
response = None
|
@@ -557,7 +561,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
557
561
|
market = self.market(symbol)
|
558
562
|
return self.fetch_order_book(market['id'], None, {'level': 3})
|
559
563
|
|
560
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
564
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
561
565
|
#
|
562
566
|
# fetchTrades(public)
|
563
567
|
#
|
@@ -655,7 +659,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
655
659
|
"""
|
656
660
|
self.load_markets()
|
657
661
|
market = self.market(symbol)
|
658
|
-
request = {
|
662
|
+
request: dict = {
|
659
663
|
'symbol': market['id'],
|
660
664
|
}
|
661
665
|
response = self.publicGetTradeHistory(self.extend(request, params))
|
@@ -710,7 +714,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
710
714
|
market = self.market(symbol)
|
711
715
|
marketId = market['id']
|
712
716
|
parsedTimeframe = self.safe_integer(self.timeframes, timeframe)
|
713
|
-
request = {
|
717
|
+
request: dict = {
|
714
718
|
'symbol': marketId,
|
715
719
|
}
|
716
720
|
if parsedTimeframe is not None:
|
@@ -743,7 +747,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
743
747
|
return self.parse_ohlcvs(data, market, timeframe, since, limit)
|
744
748
|
|
745
749
|
def parse_balance(self, response) -> Balances:
|
746
|
-
result = {
|
750
|
+
result: dict = {
|
747
751
|
'info': response,
|
748
752
|
'timestamp': None,
|
749
753
|
'datetime': None,
|
@@ -766,7 +770,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
766
770
|
"""
|
767
771
|
self.load_markets()
|
768
772
|
currencyId = self.safe_string(params, 'currency')
|
769
|
-
request = {}
|
773
|
+
request: dict = {}
|
770
774
|
if currencyId is not None:
|
771
775
|
currency = self.currency(currencyId)
|
772
776
|
request = {
|
@@ -821,7 +825,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
821
825
|
if amount < 1:
|
822
826
|
raise InvalidOrder(self.id + ' createOrder() minimum contract order amount is 1')
|
823
827
|
preciseAmount = int(self.amount_to_precision(symbol, amount))
|
824
|
-
request = {
|
828
|
+
request: dict = {
|
825
829
|
'clientOid': clientOrderId,
|
826
830
|
'side': side,
|
827
831
|
'symbol': market['id'],
|
@@ -897,7 +901,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
897
901
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
898
902
|
"""
|
899
903
|
self.load_markets()
|
900
|
-
request = {
|
904
|
+
request: dict = {
|
901
905
|
'order-id': id,
|
902
906
|
}
|
903
907
|
response = self.privateDeleteOrdersOrderId(self.extend(request, params))
|
@@ -983,7 +987,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
983
987
|
data = self.safe_list(response, 'data')
|
984
988
|
return self.parse_positions(data, symbols)
|
985
989
|
|
986
|
-
def parse_position(self, position, market: Market = None):
|
990
|
+
def parse_position(self, position: dict, market: Market = None):
|
987
991
|
#
|
988
992
|
# {
|
989
993
|
# "code": "200000",
|
@@ -1088,7 +1092,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1088
1092
|
raise ArgumentsRequired(self.id + ' fetchFundingHistory() requires a symbol argument')
|
1089
1093
|
self.load_markets()
|
1090
1094
|
market = self.market(symbol)
|
1091
|
-
request = {
|
1095
|
+
request: dict = {
|
1092
1096
|
'symbol': market['id'],
|
1093
1097
|
}
|
1094
1098
|
if since is not None:
|
@@ -1150,7 +1154,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1150
1154
|
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
1151
1155
|
"""
|
1152
1156
|
self.load_markets()
|
1153
|
-
request = {}
|
1157
|
+
request: dict = {}
|
1154
1158
|
if symbol is not None:
|
1155
1159
|
request['symbol'] = self.market_id(symbol)
|
1156
1160
|
stop = self.safe_value_2(params, 'stop', 'trigger')
|
@@ -1223,7 +1227,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1223
1227
|
params = self.omit(params, ['trigger', 'stop', 'until'])
|
1224
1228
|
if status == 'closed':
|
1225
1229
|
status = 'done'
|
1226
|
-
request = {}
|
1230
|
+
request: dict = {}
|
1227
1231
|
if not stop:
|
1228
1232
|
request['status'] = 'active' if (status == 'open') else 'done'
|
1229
1233
|
elif status != 'open':
|
@@ -1341,7 +1345,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1341
1345
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
1342
1346
|
"""
|
1343
1347
|
self.load_markets()
|
1344
|
-
request = {}
|
1348
|
+
request: dict = {}
|
1345
1349
|
response = None
|
1346
1350
|
if id is None:
|
1347
1351
|
clientOrderId = self.safe_string_2(params, 'clientOid', 'clientOrderId')
|
@@ -1402,7 +1406,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1402
1406
|
responseData = self.safe_dict(response, 'data')
|
1403
1407
|
return self.parse_order(responseData, market)
|
1404
1408
|
|
1405
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1409
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1406
1410
|
#
|
1407
1411
|
# createOrder
|
1408
1412
|
#
|
@@ -1532,7 +1536,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1532
1536
|
"""
|
1533
1537
|
self.load_markets()
|
1534
1538
|
market = self.market(symbol)
|
1535
|
-
request = {
|
1539
|
+
request: dict = {
|
1536
1540
|
'symbol': market['id'],
|
1537
1541
|
}
|
1538
1542
|
response = self.publicGetFundingRateSymbolCurrent(self.extend(request, params))
|
@@ -1583,7 +1587,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1583
1587
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
1584
1588
|
"""
|
1585
1589
|
self.load_markets()
|
1586
|
-
request = {
|
1590
|
+
request: dict = {
|
1587
1591
|
}
|
1588
1592
|
market = None
|
1589
1593
|
if symbol is not None:
|
@@ -1648,7 +1652,7 @@ class poloniexfutures(Exchange, ImplicitAPI):
|
|
1648
1652
|
if marginMode == 'cross':
|
1649
1653
|
marginMode = '1'
|
1650
1654
|
market = self.market(symbol)
|
1651
|
-
request = {
|
1655
|
+
request: dict = {
|
1652
1656
|
'symbol': market['id'],
|
1653
1657
|
'marginType': self.parse_to_int(marginMode),
|
1654
1658
|
}
|
ccxt/pro/__init__.py
CHANGED
ccxt/pro/alpaca.py
CHANGED
@@ -65,7 +65,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
65
65
|
await self.load_markets()
|
66
66
|
market = self.market(symbol)
|
67
67
|
messageHash = 'ticker:' + market['symbol']
|
68
|
-
request = {
|
68
|
+
request: dict = {
|
69
69
|
'action': 'subscribe',
|
70
70
|
'quotes': [market['id']],
|
71
71
|
}
|
@@ -141,7 +141,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
141
141
|
await self.load_markets()
|
142
142
|
market = self.market(symbol)
|
143
143
|
symbol = market['symbol']
|
144
|
-
request = {
|
144
|
+
request: dict = {
|
145
145
|
'action': 'subscribe',
|
146
146
|
'bars': [market['id']],
|
147
147
|
}
|
@@ -192,7 +192,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
192
192
|
market = self.market(symbol)
|
193
193
|
symbol = market['symbol']
|
194
194
|
messageHash = 'orderbook' + ':' + symbol
|
195
|
-
request = {
|
195
|
+
request: dict = {
|
196
196
|
'action': 'subscribe',
|
197
197
|
'orderbooks': [market['id']],
|
198
198
|
}
|
@@ -266,7 +266,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
266
266
|
market = self.market(symbol)
|
267
267
|
symbol = market['symbol']
|
268
268
|
messageHash = 'trade:' + symbol
|
269
|
-
request = {
|
269
|
+
request: dict = {
|
270
270
|
'action': 'subscribe',
|
271
271
|
'trades': [market['id']],
|
272
272
|
}
|
@@ -316,7 +316,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
316
316
|
if symbol is not None:
|
317
317
|
symbol = self.symbol(symbol)
|
318
318
|
messageHash += ':' + symbol
|
319
|
-
request = {
|
319
|
+
request: dict = {
|
320
320
|
'action': 'listen',
|
321
321
|
'data': {
|
322
322
|
'streams': ['trade_updates'],
|
@@ -344,7 +344,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
344
344
|
market = self.market(symbol)
|
345
345
|
symbol = market['symbol']
|
346
346
|
messageHash = 'orders:' + symbol
|
347
|
-
request = {
|
347
|
+
request: dict = {
|
348
348
|
'action': 'listen',
|
349
349
|
'data': {
|
350
350
|
'streams': ['trade_updates'],
|
@@ -599,7 +599,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
599
599
|
if T == 'success' and msg == 'authenticated':
|
600
600
|
self.handle_authenticate(client, data)
|
601
601
|
return
|
602
|
-
methods = {
|
602
|
+
methods: dict = {
|
603
603
|
'error': self.handle_error_message,
|
604
604
|
'b': self.handle_ohlcv,
|
605
605
|
'q': self.handle_ticker,
|
@@ -612,7 +612,7 @@ class alpaca(ccxt.async_support.alpaca):
|
|
612
612
|
|
613
613
|
def handle_trading_message(self, client: Client, message):
|
614
614
|
stream = self.safe_string(message, 'stream')
|
615
|
-
methods = {
|
615
|
+
methods: dict = {
|
616
616
|
'authorization': self.handle_authenticate,
|
617
617
|
'listening': self.handle_subscription,
|
618
618
|
'trade_updates': self.handle_trade_update,
|
ccxt/pro/ascendex.py
CHANGED
@@ -55,7 +55,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
55
55
|
async def watch_public(self, messageHash, params={}):
|
56
56
|
url = self.urls['api']['ws']['public']
|
57
57
|
id = self.nonce()
|
58
|
-
request = {
|
58
|
+
request: dict = {
|
59
59
|
'id': str(id),
|
60
60
|
'op': 'sub',
|
61
61
|
}
|
@@ -68,7 +68,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
68
68
|
url = self.urls['api']['ws']['private']
|
69
69
|
url = self.implode_params(url, {'accountGroup': accountGroup})
|
70
70
|
id = self.nonce()
|
71
|
-
request = {
|
71
|
+
request: dict = {
|
72
72
|
'id': str(id),
|
73
73
|
'op': 'sub',
|
74
74
|
'ch': channel,
|
@@ -830,7 +830,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
830
830
|
# }
|
831
831
|
#
|
832
832
|
subject = self.safe_string(message, 'm')
|
833
|
-
methods = {
|
833
|
+
methods: dict = {
|
834
834
|
'ping': self.handle_ping,
|
835
835
|
'auth': self.handle_authenticate,
|
836
836
|
'sub': self.handle_subscription_status,
|
@@ -904,7 +904,7 @@ class ascendex(ccxt.async_support.ascendex):
|
|
904
904
|
auth = timestamp + '+' + version + '/' + path
|
905
905
|
secret = self.base64_to_binary(self.secret)
|
906
906
|
signature = self.hmac(self.encode(auth), secret, hashlib.sha256, 'base64')
|
907
|
-
request = {
|
907
|
+
request: dict = {
|
908
908
|
'op': 'auth',
|
909
909
|
'id': str(self.nonce()),
|
910
910
|
't': timestamp,
|