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/blofin.py
CHANGED
@@ -458,7 +458,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
458
458
|
"""
|
459
459
|
self.load_markets()
|
460
460
|
market = self.market(symbol)
|
461
|
-
request = {
|
461
|
+
request: dict = {
|
462
462
|
'instId': market['id'],
|
463
463
|
}
|
464
464
|
limit = 50 if (limit is None) else limit
|
@@ -536,7 +536,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
536
536
|
"""
|
537
537
|
self.load_markets()
|
538
538
|
market = self.market(symbol)
|
539
|
-
request = {
|
539
|
+
request: dict = {
|
540
540
|
'instId': market['id'],
|
541
541
|
}
|
542
542
|
response = self.publicGetMarketTickers(self.extend(request, params))
|
@@ -558,7 +558,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
558
558
|
tickers = self.safe_list(response, 'data', [])
|
559
559
|
return self.parse_tickers(tickers, symbols)
|
560
560
|
|
561
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
561
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
562
562
|
#
|
563
563
|
# fetch trades
|
564
564
|
# {
|
@@ -633,7 +633,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
633
633
|
if paginate:
|
634
634
|
return self.fetch_paginated_call_cursor('fetchTrades', symbol, since, limit, params, 'tradeId', 'after', None, 100)
|
635
635
|
market = self.market(symbol)
|
636
|
-
request = {
|
636
|
+
request: dict = {
|
637
637
|
'instId': market['id'],
|
638
638
|
}
|
639
639
|
response = None
|
@@ -690,7 +690,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
690
690
|
return self.fetch_paginated_call_deterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 100)
|
691
691
|
if limit is None:
|
692
692
|
limit = 100 # default 100, max 100
|
693
|
-
request = {
|
693
|
+
request: dict = {
|
694
694
|
'instId': market['id'],
|
695
695
|
'bar': self.safe_string(self.timeframes, timeframe, timeframe),
|
696
696
|
'limit': limit,
|
@@ -723,7 +723,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
723
723
|
if paginate:
|
724
724
|
return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params)
|
725
725
|
market = self.market(symbol)
|
726
|
-
request = {
|
726
|
+
request: dict = {
|
727
727
|
'instId': market['id'],
|
728
728
|
}
|
729
729
|
if since is not None:
|
@@ -797,7 +797,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
797
797
|
market = self.market(symbol)
|
798
798
|
if not market['swap']:
|
799
799
|
raise ExchangeError(self.id + ' fetchFundingRate() is only valid for swap markets')
|
800
|
-
request = {
|
800
|
+
request: dict = {
|
801
801
|
'instId': market['id'],
|
802
802
|
}
|
803
803
|
response = self.publicGetMarketFundingRate(self.extend(request, params))
|
@@ -855,7 +855,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
855
855
|
# }
|
856
856
|
# }
|
857
857
|
#
|
858
|
-
result = {'info': response}
|
858
|
+
result: dict = {'info': response}
|
859
859
|
data = self.safe_dict(response, 'data', {})
|
860
860
|
timestamp = self.safe_integer(data, 'ts')
|
861
861
|
details = self.safe_list(data, 'details', [])
|
@@ -894,7 +894,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
894
894
|
# ]
|
895
895
|
# }
|
896
896
|
#
|
897
|
-
result = {'info': response}
|
897
|
+
result: dict = {'info': response}
|
898
898
|
data = self.safe_list(response, 'data', [])
|
899
899
|
for i in range(0, len(data)):
|
900
900
|
balance = data[i]
|
@@ -908,7 +908,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
908
908
|
result[code] = account
|
909
909
|
return self.safe_balance(result)
|
910
910
|
|
911
|
-
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
911
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
912
912
|
return {
|
913
913
|
'info': fee,
|
914
914
|
'symbol': self.safe_symbol(None, market),
|
@@ -931,7 +931,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
931
931
|
self.load_markets()
|
932
932
|
accountType = self.safe_string_2(params, 'accountType', 'type')
|
933
933
|
params = self.omit(params, ['accountType', 'type'])
|
934
|
-
request = {
|
934
|
+
request: dict = {
|
935
935
|
}
|
936
936
|
response = None
|
937
937
|
if accountType is not None:
|
@@ -945,7 +945,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
945
945
|
|
946
946
|
def create_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
947
947
|
market = self.market(symbol)
|
948
|
-
request = {
|
948
|
+
request: dict = {
|
949
949
|
'instId': market['id'],
|
950
950
|
'side': side,
|
951
951
|
'orderType': type,
|
@@ -986,8 +986,8 @@ class blofin(Exchange, ImplicitAPI):
|
|
986
986
|
request['tpOrderPrice'] = self.price_to_precision(symbol, tpPrice)
|
987
987
|
return self.extend(request, params)
|
988
988
|
|
989
|
-
def parse_order_status(self, status):
|
990
|
-
statuses = {
|
989
|
+
def parse_order_status(self, status: Str):
|
990
|
+
statuses: dict = {
|
991
991
|
'canceled': 'canceled',
|
992
992
|
'order_failed': 'canceled',
|
993
993
|
'live': 'open',
|
@@ -997,7 +997,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
997
997
|
}
|
998
998
|
return self.safe_string(statuses, status, status)
|
999
999
|
|
1000
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1000
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1001
1001
|
#
|
1002
1002
|
# {
|
1003
1003
|
# "orderId": "2075628533",
|
@@ -1161,7 +1161,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1161
1161
|
def create_tpsl_order_request(self, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
1162
1162
|
market = self.market(symbol)
|
1163
1163
|
positionSide = self.safe_string(params, 'positionSide', 'net')
|
1164
|
-
request = {
|
1164
|
+
request: dict = {
|
1165
1165
|
'instId': market['id'],
|
1166
1166
|
'side': side,
|
1167
1167
|
'positionSide': positionSide,
|
@@ -1205,7 +1205,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1205
1205
|
raise ArgumentsRequired(self.id + ' cancelOrder() requires a symbol argument')
|
1206
1206
|
self.load_markets()
|
1207
1207
|
market = self.market(symbol)
|
1208
|
-
request = {
|
1208
|
+
request: dict = {
|
1209
1209
|
'instId': market['id'],
|
1210
1210
|
}
|
1211
1211
|
isTrigger = self.safe_bool_n(params, ['stop', 'trigger', 'tpsl'], False)
|
@@ -1269,7 +1269,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1269
1269
|
paginate, params = self.handle_option_and_params(params, 'fetchOpenOrders', 'paginate')
|
1270
1270
|
if paginate:
|
1271
1271
|
return self.fetch_paginated_call_dynamic('fetchOpenOrders', symbol, since, limit, params)
|
1272
|
-
request = {
|
1272
|
+
request: dict = {
|
1273
1273
|
}
|
1274
1274
|
market = None
|
1275
1275
|
if symbol is not None:
|
@@ -1306,7 +1306,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1306
1306
|
paginate, params = self.handle_option_and_params(params, 'fetchMyTrades', 'paginate')
|
1307
1307
|
if paginate:
|
1308
1308
|
return self.fetch_paginated_call_dynamic('fetchMyTrades', symbol, since, limit, params)
|
1309
|
-
request = {
|
1309
|
+
request: dict = {
|
1310
1310
|
}
|
1311
1311
|
market = None
|
1312
1312
|
if symbol is not None:
|
@@ -1336,7 +1336,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1336
1336
|
paginate, params = self.handle_option_and_params(params, 'fetchDeposits', 'paginate')
|
1337
1337
|
if paginate:
|
1338
1338
|
return self.fetch_paginated_call_dynamic('fetchDeposits', code, since, limit, params)
|
1339
|
-
request = {
|
1339
|
+
request: dict = {
|
1340
1340
|
}
|
1341
1341
|
currency = None
|
1342
1342
|
if code is not None:
|
@@ -1368,7 +1368,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1368
1368
|
paginate, params = self.handle_option_and_params(params, 'fetchWithdrawals', 'paginate')
|
1369
1369
|
if paginate:
|
1370
1370
|
return self.fetch_paginated_call_dynamic('fetchWithdrawals', code, since, limit, params)
|
1371
|
-
request = {
|
1371
|
+
request: dict = {
|
1372
1372
|
}
|
1373
1373
|
currency = None
|
1374
1374
|
if code is not None:
|
@@ -1401,7 +1401,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1401
1401
|
paginate, params = self.handle_option_and_params(params, 'fetchLedger', 'paginate')
|
1402
1402
|
if paginate:
|
1403
1403
|
return self.fetch_paginated_call_dynamic('fetchLedger', code, since, limit, params)
|
1404
|
-
request = {
|
1404
|
+
request: dict = {
|
1405
1405
|
}
|
1406
1406
|
if limit is not None:
|
1407
1407
|
request['limit'] = limit
|
@@ -1415,7 +1415,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1415
1415
|
data = self.safe_list(response, 'data', [])
|
1416
1416
|
return self.parse_ledger(data, currency, since, limit)
|
1417
1417
|
|
1418
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1418
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1419
1419
|
#
|
1420
1420
|
#
|
1421
1421
|
# fetchDeposits
|
@@ -1500,7 +1500,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1500
1500
|
}
|
1501
1501
|
|
1502
1502
|
def parse_transaction_status(self, status):
|
1503
|
-
statuses = {
|
1503
|
+
statuses: dict = {
|
1504
1504
|
'0': 'pending',
|
1505
1505
|
'1': 'ok',
|
1506
1506
|
'2': 'failed',
|
@@ -1509,7 +1509,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1509
1509
|
return self.safe_string(statuses, status, status)
|
1510
1510
|
|
1511
1511
|
def parse_ledger_entry_type(self, type):
|
1512
|
-
types = {
|
1512
|
+
types: dict = {
|
1513
1513
|
'1': 'transfer', # transfer
|
1514
1514
|
'2': 'trade', # trade
|
1515
1515
|
'3': 'trade', # delivery
|
@@ -1524,7 +1524,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1524
1524
|
}
|
1525
1525
|
return self.safe_string(types, type, type)
|
1526
1526
|
|
1527
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
1527
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
1528
1528
|
id = self.safe_string(item, 'transferId')
|
1529
1529
|
referenceId = self.safe_string(item, 'clientId')
|
1530
1530
|
fromAccount = self.safe_string(item, 'fromAccount')
|
@@ -1633,7 +1633,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1633
1633
|
accountsByType = self.safe_dict(self.options, 'accountsByType', {})
|
1634
1634
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
1635
1635
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
1636
|
-
request = {
|
1636
|
+
request: dict = {
|
1637
1637
|
'currency': currency['id'],
|
1638
1638
|
'amount': self.currency_to_precision(code, amount),
|
1639
1639
|
'fromAccount': fromId,
|
@@ -1668,7 +1668,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1668
1668
|
"""
|
1669
1669
|
self.load_markets()
|
1670
1670
|
market = self.market(symbol)
|
1671
|
-
request = {
|
1671
|
+
request: dict = {
|
1672
1672
|
'instId': market['id'],
|
1673
1673
|
}
|
1674
1674
|
response = self.privateGetAccountPositions(self.extend(request, params))
|
@@ -1678,7 +1678,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1678
1678
|
return None
|
1679
1679
|
return self.parse_position(position, market)
|
1680
1680
|
|
1681
|
-
def fetch_positions(self, symbols:
|
1681
|
+
def fetch_positions(self, symbols: Strings = None, params={}) -> List[Position]:
|
1682
1682
|
"""
|
1683
1683
|
fetch data on a single open contract trade position
|
1684
1684
|
:see: https://blofin.com/docs#get-positions
|
@@ -1694,7 +1694,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1694
1694
|
result = self.parse_positions(data)
|
1695
1695
|
return self.filter_by_array_positions(result, 'symbol', symbols, False)
|
1696
1696
|
|
1697
|
-
def parse_position(self, position, market: Market = None):
|
1697
|
+
def parse_position(self, position: dict, market: Market = None):
|
1698
1698
|
marketId = self.safe_string(position, 'instId')
|
1699
1699
|
market = self.safe_market(marketId, market)
|
1700
1700
|
symbol = market['symbol']
|
@@ -1775,7 +1775,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1775
1775
|
'takeProfitPrice': None,
|
1776
1776
|
})
|
1777
1777
|
|
1778
|
-
def fetch_leverages(self, symbols:
|
1778
|
+
def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
1779
1779
|
"""
|
1780
1780
|
fetch the set leverage for all contract markets
|
1781
1781
|
:see: https://docs.blofin.com/index.html#get-multiple-leverage
|
@@ -1802,7 +1802,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1802
1802
|
instIds = instIds + ',' + entryMarket['id']
|
1803
1803
|
else:
|
1804
1804
|
instIds = instIds + entryMarket['id']
|
1805
|
-
request = {
|
1805
|
+
request: dict = {
|
1806
1806
|
'instId': instIds,
|
1807
1807
|
'marginMode': marginMode,
|
1808
1808
|
}
|
@@ -1840,7 +1840,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1840
1840
|
if (marginMode != 'cross') and (marginMode != 'isolated'):
|
1841
1841
|
raise BadRequest(self.id + ' fetchLeverage() requires a marginMode parameter that must be either cross or isolated')
|
1842
1842
|
market = self.market(symbol)
|
1843
|
-
request = {
|
1843
|
+
request: dict = {
|
1844
1844
|
'instId': market['id'],
|
1845
1845
|
'marginMode': marginMode,
|
1846
1846
|
}
|
@@ -1892,7 +1892,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1892
1892
|
marginMode, params = self.handle_margin_mode_and_params('setLeverage', params, 'cross')
|
1893
1893
|
if (marginMode != 'cross') and (marginMode != 'isolated'):
|
1894
1894
|
raise BadRequest(self.id + ' setLeverage() requires a marginMode parameter that must be either cross or isolated')
|
1895
|
-
request = {
|
1895
|
+
request: dict = {
|
1896
1896
|
'leverage': leverage,
|
1897
1897
|
'marginMode': marginMode,
|
1898
1898
|
'instId': market['id'],
|
@@ -1921,7 +1921,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1921
1921
|
clientOrderId = self.safe_string(params, 'clientOrderId')
|
1922
1922
|
marginMode = None
|
1923
1923
|
marginMode, params = self.handle_margin_mode_and_params('closePosition', params, 'cross')
|
1924
|
-
request = {
|
1924
|
+
request: dict = {
|
1925
1925
|
'instId': market['id'],
|
1926
1926
|
'marginMode': marginMode,
|
1927
1927
|
}
|
@@ -1948,7 +1948,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1948
1948
|
paginate, params = self.handle_option_and_params(params, 'fetchClosedOrders', 'paginate')
|
1949
1949
|
if paginate:
|
1950
1950
|
return self.fetch_paginated_call_dynamic('fetchClosedOrders', symbol, since, limit, params)
|
1951
|
-
request = {
|
1951
|
+
request: dict = {
|
1952
1952
|
}
|
1953
1953
|
market = None
|
1954
1954
|
if symbol is not None:
|
@@ -1993,7 +1993,7 @@ class blofin(Exchange, ImplicitAPI):
|
|
1993
1993
|
data = self.safe_dict(response, 'data', {})
|
1994
1994
|
return self.parse_margin_mode(data, market)
|
1995
1995
|
|
1996
|
-
def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
|
1996
|
+
def parse_margin_mode(self, marginMode: dict, market=None) -> MarginMode:
|
1997
1997
|
return {
|
1998
1998
|
'info': marginMode,
|
1999
1999
|
'symbol': market['symbol'],
|
ccxt/btcalpha.py
CHANGED
@@ -283,7 +283,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
283
283
|
"""
|
284
284
|
self.load_markets()
|
285
285
|
market = self.market(symbol)
|
286
|
-
request = {
|
286
|
+
request: dict = {
|
287
287
|
'pair': market['id'],
|
288
288
|
}
|
289
289
|
response = self.publicGetTicker(self.extend(request, params))
|
@@ -355,7 +355,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
355
355
|
"""
|
356
356
|
self.load_markets()
|
357
357
|
market = self.market(symbol)
|
358
|
-
request = {
|
358
|
+
request: dict = {
|
359
359
|
'pair_name': market['id'],
|
360
360
|
}
|
361
361
|
if limit:
|
@@ -372,7 +372,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
372
372
|
result.append(self.parse_bid_ask(bidask, priceKey, amountKey))
|
373
373
|
return result
|
374
374
|
|
375
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
375
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
376
376
|
#
|
377
377
|
# fetchTrades(public)
|
378
378
|
#
|
@@ -433,7 +433,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
433
433
|
"""
|
434
434
|
self.load_markets()
|
435
435
|
market = None
|
436
|
-
request = {}
|
436
|
+
request: dict = {}
|
437
437
|
if symbol is not None:
|
438
438
|
market = self.market(symbol)
|
439
439
|
request['pair'] = market['id']
|
@@ -481,7 +481,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
481
481
|
"""
|
482
482
|
self.load_markets()
|
483
483
|
currency = None
|
484
|
-
request = {}
|
484
|
+
request: dict = {}
|
485
485
|
if code is not None:
|
486
486
|
currency = self.currency(code)
|
487
487
|
request['currency_id'] = currency['id']
|
@@ -499,7 +499,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
499
499
|
#
|
500
500
|
return self.parse_transactions(response, currency, since, limit, {'type': 'withdrawal'})
|
501
501
|
|
502
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
502
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
503
503
|
#
|
504
504
|
# deposit
|
505
505
|
# {
|
@@ -545,7 +545,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
545
545
|
}
|
546
546
|
|
547
547
|
def parse_transaction_status(self, status):
|
548
|
-
statuses = {
|
548
|
+
statuses: dict = {
|
549
549
|
'10': 'pending', # New
|
550
550
|
'20': 'pending', # Verified, waiting for approving
|
551
551
|
'30': 'ok', # Approved by moderator
|
@@ -587,7 +587,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
587
587
|
"""
|
588
588
|
self.load_markets()
|
589
589
|
market = self.market(symbol)
|
590
|
-
request = {
|
590
|
+
request: dict = {
|
591
591
|
'pair': market['id'],
|
592
592
|
'type': self.safe_string(self.timeframes, timeframe, timeframe),
|
593
593
|
}
|
@@ -606,7 +606,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
606
606
|
return self.parse_ohlcvs(response, market, timeframe, since, limit)
|
607
607
|
|
608
608
|
def parse_balance(self, response) -> Balances:
|
609
|
-
result = {'info': response}
|
609
|
+
result: dict = {'info': response}
|
610
610
|
for i in range(0, len(response)):
|
611
611
|
balance = response[i]
|
612
612
|
currencyId = self.safe_string(balance, 'currency')
|
@@ -628,15 +628,15 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
628
628
|
response = self.privateGetWallets(params)
|
629
629
|
return self.parse_balance(response)
|
630
630
|
|
631
|
-
def parse_order_status(self, status):
|
632
|
-
statuses = {
|
631
|
+
def parse_order_status(self, status: Str):
|
632
|
+
statuses: dict = {
|
633
633
|
'1': 'open',
|
634
634
|
'2': 'canceled',
|
635
635
|
'3': 'closed',
|
636
636
|
}
|
637
637
|
return self.safe_string(statuses, status, status)
|
638
638
|
|
639
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
639
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
640
640
|
#
|
641
641
|
# fetchClosedOrders / fetchOrder
|
642
642
|
# {
|
@@ -723,7 +723,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
723
723
|
raise InvalidOrder(self.id + ' only limits orders are supported')
|
724
724
|
self.load_markets()
|
725
725
|
market = self.market(symbol)
|
726
|
-
request = {
|
726
|
+
request: dict = {
|
727
727
|
'pair': market['id'],
|
728
728
|
'type': side,
|
729
729
|
'amount': amount,
|
@@ -747,7 +747,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
747
747
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
748
748
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
749
749
|
"""
|
750
|
-
request = {
|
750
|
+
request: dict = {
|
751
751
|
'order': id,
|
752
752
|
}
|
753
753
|
response = self.privatePostOrderCancel(self.extend(request, params))
|
@@ -762,7 +762,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
762
762
|
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
763
763
|
"""
|
764
764
|
self.load_markets()
|
765
|
-
request = {
|
765
|
+
request: dict = {
|
766
766
|
'id': id,
|
767
767
|
}
|
768
768
|
order = self.privateGetOrderId(self.extend(request, params))
|
@@ -779,7 +779,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
779
779
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
780
780
|
"""
|
781
781
|
self.load_markets()
|
782
|
-
request = {}
|
782
|
+
request: dict = {}
|
783
783
|
market = None
|
784
784
|
if symbol is not None:
|
785
785
|
market = self.market(symbol)
|
@@ -799,7 +799,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
799
799
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
800
800
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
801
801
|
"""
|
802
|
-
request = {
|
802
|
+
request: dict = {
|
803
803
|
'status': '1',
|
804
804
|
}
|
805
805
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -814,7 +814,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
814
814
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
815
815
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
816
816
|
"""
|
817
|
-
request = {
|
817
|
+
request: dict = {
|
818
818
|
'status': '3',
|
819
819
|
}
|
820
820
|
return self.fetch_orders(symbol, since, limit, self.extend(request, params))
|
@@ -830,7 +830,7 @@ class btcalpha(Exchange, ImplicitAPI):
|
|
830
830
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
831
831
|
"""
|
832
832
|
self.load_markets()
|
833
|
-
request = {}
|
833
|
+
request: dict = {}
|
834
834
|
if symbol is not None:
|
835
835
|
market = self.market(symbol)
|
836
836
|
request['pair'] = market['id']
|
ccxt/btcbox.py
CHANGED
@@ -137,7 +137,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
137
137
|
})
|
138
138
|
|
139
139
|
def parse_balance(self, response) -> Balances:
|
140
|
-
result = {'info': response}
|
140
|
+
result: dict = {'info': response}
|
141
141
|
codes = list(self.currencies.keys())
|
142
142
|
for i in range(0, len(codes)):
|
143
143
|
code = codes[i]
|
@@ -174,7 +174,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
174
174
|
"""
|
175
175
|
self.load_markets()
|
176
176
|
market = self.market(symbol)
|
177
|
-
request = {}
|
177
|
+
request: dict = {}
|
178
178
|
numSymbols = len(self.symbols)
|
179
179
|
if numSymbols > 1:
|
180
180
|
request['coin'] = market['baseId']
|
@@ -217,14 +217,14 @@ class btcbox(Exchange, ImplicitAPI):
|
|
217
217
|
"""
|
218
218
|
self.load_markets()
|
219
219
|
market = self.market(symbol)
|
220
|
-
request = {}
|
220
|
+
request: dict = {}
|
221
221
|
numSymbols = len(self.symbols)
|
222
222
|
if numSymbols > 1:
|
223
223
|
request['coin'] = market['baseId']
|
224
224
|
response = self.publicGetTicker(self.extend(request, params))
|
225
225
|
return self.parse_ticker(response, market)
|
226
226
|
|
227
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
227
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
228
228
|
#
|
229
229
|
# fetchTrades(public)
|
230
230
|
#
|
@@ -271,7 +271,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
271
271
|
"""
|
272
272
|
self.load_markets()
|
273
273
|
market = self.market(symbol)
|
274
|
-
request = {}
|
274
|
+
request: dict = {}
|
275
275
|
numSymbols = len(self.symbols)
|
276
276
|
if numSymbols > 1:
|
277
277
|
request['coin'] = market['baseId']
|
@@ -303,7 +303,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
303
303
|
"""
|
304
304
|
self.load_markets()
|
305
305
|
market = self.market(symbol)
|
306
|
-
request = {
|
306
|
+
request: dict = {
|
307
307
|
'amount': amount,
|
308
308
|
'price': price,
|
309
309
|
'type': side,
|
@@ -332,7 +332,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
332
332
|
if symbol is None:
|
333
333
|
symbol = 'BTC/JPY'
|
334
334
|
market = self.market(symbol)
|
335
|
-
request = {
|
335
|
+
request: dict = {
|
336
336
|
'id': id,
|
337
337
|
'coin': market['baseId'],
|
338
338
|
}
|
@@ -342,8 +342,8 @@ class btcbox(Exchange, ImplicitAPI):
|
|
342
342
|
#
|
343
343
|
return self.parse_order(response, market)
|
344
344
|
|
345
|
-
def parse_order_status(self, status):
|
346
|
-
statuses = {
|
345
|
+
def parse_order_status(self, status: Str):
|
346
|
+
statuses: dict = {
|
347
347
|
# TODO: complete list
|
348
348
|
'part': 'open', # partially or not at all executed
|
349
349
|
'all': 'closed', # fully executed
|
@@ -353,7 +353,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
353
353
|
}
|
354
354
|
return self.safe_string(statuses, status, status)
|
355
355
|
|
356
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
356
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
357
357
|
#
|
358
358
|
# {
|
359
359
|
# "id":11,
|
@@ -446,7 +446,7 @@ class btcbox(Exchange, ImplicitAPI):
|
|
446
446
|
if symbol is None:
|
447
447
|
symbol = 'BTC/JPY'
|
448
448
|
market = self.market(symbol)
|
449
|
-
request = {
|
449
|
+
request: dict = {
|
450
450
|
'type': type, # 'open' or 'all'
|
451
451
|
'coin': market['baseId'],
|
452
452
|
}
|