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/coinex.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinex import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage, Leverages, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry, TransferEntries
|
8
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage, Leverages, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry, TransferEntries
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import AuthenticationError
|
@@ -81,8 +81,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
81
81
|
'fetchDepositAddressByNetwork': False,
|
82
82
|
'fetchDepositAddresses': False,
|
83
83
|
'fetchDeposits': True,
|
84
|
-
'fetchDepositWithdrawFee':
|
85
|
-
'fetchDepositWithdrawFees':
|
84
|
+
'fetchDepositWithdrawFee': True,
|
85
|
+
'fetchDepositWithdrawFees': False,
|
86
86
|
'fetchFundingHistory': True,
|
87
87
|
'fetchFundingRate': True,
|
88
88
|
'fetchFundingRateHistory': True,
|
@@ -566,7 +566,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
566
566
|
#
|
567
567
|
data = self.safe_value(response, 'data', [])
|
568
568
|
coins = list(data.keys())
|
569
|
-
result = {}
|
569
|
+
result: dict = {}
|
570
570
|
for i in range(0, len(coins)):
|
571
571
|
coin = coins[i]
|
572
572
|
currency = data[coin]
|
@@ -627,7 +627,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
627
627
|
if precisionString is not None:
|
628
628
|
minPrecisionString = precisionString if (minPrecisionString is None) else Precise.string_min(precisionString, minPrecisionString)
|
629
629
|
networks = self.safe_value(result[code], 'networks', {})
|
630
|
-
network = {
|
630
|
+
network: dict = {
|
631
631
|
'info': currency,
|
632
632
|
'id': networkId,
|
633
633
|
'network': networkId,
|
@@ -935,7 +935,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
935
935
|
"""
|
936
936
|
self.load_markets()
|
937
937
|
market = self.market(symbol)
|
938
|
-
request = {
|
938
|
+
request: dict = {
|
939
939
|
'market': market['id'],
|
940
940
|
}
|
941
941
|
response = None
|
@@ -1099,7 +1099,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1099
1099
|
market = self.market(symbol)
|
1100
1100
|
if limit is None:
|
1101
1101
|
limit = 20 # default
|
1102
|
-
request = {
|
1102
|
+
request: dict = {
|
1103
1103
|
'market': market['id'],
|
1104
1104
|
'limit': limit,
|
1105
1105
|
'interval': '0',
|
@@ -1164,7 +1164,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1164
1164
|
timestamp = self.safe_integer(depth, 'updated_at')
|
1165
1165
|
return self.parse_order_book(depth, symbol, timestamp)
|
1166
1166
|
|
1167
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1167
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1168
1168
|
#
|
1169
1169
|
# Spot and Swap fetchTrades(public)
|
1170
1170
|
#
|
@@ -1236,7 +1236,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1236
1236
|
"""
|
1237
1237
|
self.load_markets()
|
1238
1238
|
market = self.market(symbol)
|
1239
|
-
request = {
|
1239
|
+
request: dict = {
|
1240
1240
|
'market': market['id'],
|
1241
1241
|
# 'last_id': 0,
|
1242
1242
|
}
|
@@ -1277,7 +1277,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1277
1277
|
"""
|
1278
1278
|
self.load_markets()
|
1279
1279
|
market = self.market(symbol)
|
1280
|
-
request = {
|
1280
|
+
request: dict = {
|
1281
1281
|
'market': market['id'],
|
1282
1282
|
}
|
1283
1283
|
response = None
|
@@ -1388,7 +1388,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1388
1388
|
# }
|
1389
1389
|
#
|
1390
1390
|
data = self.safe_list(response, 'data', [])
|
1391
|
-
result = {}
|
1391
|
+
result: dict = {}
|
1392
1392
|
for i in range(0, len(data)):
|
1393
1393
|
entry = data[i]
|
1394
1394
|
marketId = self.safe_string(entry, 'market')
|
@@ -1397,7 +1397,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1397
1397
|
result[symbol] = self.parse_trading_fee(entry, market)
|
1398
1398
|
return result
|
1399
1399
|
|
1400
|
-
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
1400
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
1401
1401
|
marketId = self.safe_value(fee, 'market')
|
1402
1402
|
symbol = self.safe_symbol(marketId, market)
|
1403
1403
|
return {
|
@@ -1445,7 +1445,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1445
1445
|
"""
|
1446
1446
|
self.load_markets()
|
1447
1447
|
market = self.market(symbol)
|
1448
|
-
request = {
|
1448
|
+
request: dict = {
|
1449
1449
|
'market': market['id'],
|
1450
1450
|
'period': self.safe_string(self.timeframes, timeframe, timeframe),
|
1451
1451
|
}
|
@@ -1513,7 +1513,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1513
1513
|
# "message": "OK"
|
1514
1514
|
# }
|
1515
1515
|
#
|
1516
|
-
result = {'info': response}
|
1516
|
+
result: dict = {'info': response}
|
1517
1517
|
balances = self.safe_list(response, 'data', [])
|
1518
1518
|
for i in range(0, len(balances)):
|
1519
1519
|
entry = balances[i]
|
@@ -1548,7 +1548,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1548
1548
|
# "message": "OK"
|
1549
1549
|
# }
|
1550
1550
|
#
|
1551
|
-
result = {'info': response}
|
1551
|
+
result: dict = {'info': response}
|
1552
1552
|
balances = self.safe_list(response, 'data', [])
|
1553
1553
|
for i in range(0, len(balances)):
|
1554
1554
|
entry = balances[i]
|
@@ -1579,7 +1579,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1579
1579
|
# "message": "OK"
|
1580
1580
|
# }
|
1581
1581
|
#
|
1582
|
-
result = {'info': response}
|
1582
|
+
result: dict = {'info': response}
|
1583
1583
|
balances = self.safe_list(response, 'data', [])
|
1584
1584
|
for i in range(0, len(balances)):
|
1585
1585
|
entry = balances[i]
|
@@ -1607,7 +1607,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1607
1607
|
# "message": "OK"
|
1608
1608
|
# }
|
1609
1609
|
#
|
1610
|
-
result = {'info': response}
|
1610
|
+
result: dict = {'info': response}
|
1611
1611
|
balances = self.safe_list(response, 'data', [])
|
1612
1612
|
for i in range(0, len(balances)):
|
1613
1613
|
entry = balances[i]
|
@@ -1645,8 +1645,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
1645
1645
|
else:
|
1646
1646
|
return self.fetch_spot_balance(params)
|
1647
1647
|
|
1648
|
-
def parse_order_status(self, status):
|
1649
|
-
statuses = {
|
1648
|
+
def parse_order_status(self, status: Str):
|
1649
|
+
statuses: dict = {
|
1650
1650
|
'rejected': 'rejected',
|
1651
1651
|
'open': 'open',
|
1652
1652
|
'not_deal': 'open',
|
@@ -1656,7 +1656,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1656
1656
|
}
|
1657
1657
|
return self.safe_string(statuses, status, status)
|
1658
1658
|
|
1659
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1659
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1660
1660
|
#
|
1661
1661
|
# Spot and Margin createOrder, createOrders, editOrder, cancelOrders, cancelOrder, fetchOpenOrders
|
1662
1662
|
#
|
@@ -1951,7 +1951,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1951
1951
|
if reduceOnly:
|
1952
1952
|
if not market['swap']:
|
1953
1953
|
raise InvalidOrder(self.id + ' createOrder() does not support reduceOnly for ' + market['type'] + ' orders, reduceOnly orders are supported for swap markets only')
|
1954
|
-
request = {
|
1954
|
+
request: dict = {
|
1955
1955
|
'market': market['id'],
|
1956
1956
|
}
|
1957
1957
|
if clientOrderId is None:
|
@@ -2297,7 +2297,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2297
2297
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
2298
2298
|
ordersRequests.append(orderRequest)
|
2299
2299
|
market = self.market(symbol)
|
2300
|
-
request = {
|
2300
|
+
request: dict = {
|
2301
2301
|
'market': market['id'],
|
2302
2302
|
'orders': ordersRequests,
|
2303
2303
|
}
|
@@ -2456,7 +2456,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2456
2456
|
raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
|
2457
2457
|
self.load_markets()
|
2458
2458
|
market = self.market(symbol)
|
2459
|
-
request = {
|
2459
|
+
request: dict = {
|
2460
2460
|
'market': market['id'],
|
2461
2461
|
}
|
2462
2462
|
stop = self.safe_bool_2(params, 'stop', 'trigger')
|
@@ -2631,7 +2631,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2631
2631
|
raise ArgumentsRequired(self.id + ' editOrder() requires a symbol argument')
|
2632
2632
|
self.load_markets()
|
2633
2633
|
market = self.market(symbol)
|
2634
|
-
request = {
|
2634
|
+
request: dict = {
|
2635
2635
|
'market': market['id'],
|
2636
2636
|
}
|
2637
2637
|
if amount is not None:
|
@@ -2767,7 +2767,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2767
2767
|
market = self.market(symbol)
|
2768
2768
|
isTriggerOrder = self.safe_bool_2(params, 'stop', 'trigger')
|
2769
2769
|
swap = market['swap']
|
2770
|
-
request = {
|
2770
|
+
request: dict = {
|
2771
2771
|
'market': market['id'],
|
2772
2772
|
}
|
2773
2773
|
marginMode = None
|
@@ -3038,7 +3038,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3038
3038
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
3039
3039
|
self.load_markets()
|
3040
3040
|
market = self.market(symbol)
|
3041
|
-
request = {
|
3041
|
+
request: dict = {
|
3042
3042
|
'market': market['id'],
|
3043
3043
|
}
|
3044
3044
|
response = None
|
@@ -3074,7 +3074,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3074
3074
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
3075
3075
|
self.load_markets()
|
3076
3076
|
market = self.market(symbol)
|
3077
|
-
request = {
|
3077
|
+
request: dict = {
|
3078
3078
|
'market': market['id'],
|
3079
3079
|
'order_id': self.parse_to_numeric(id),
|
3080
3080
|
}
|
@@ -3160,7 +3160,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3160
3160
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
3161
3161
|
"""
|
3162
3162
|
self.load_markets()
|
3163
|
-
request = {}
|
3163
|
+
request: dict = {}
|
3164
3164
|
market = None
|
3165
3165
|
if symbol is not None:
|
3166
3166
|
market = self.market(symbol)
|
@@ -3496,7 +3496,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3496
3496
|
if network is None:
|
3497
3497
|
raise ArgumentsRequired(self.id + ' createDepositAddress() requires a network parameter')
|
3498
3498
|
params = self.omit(params, 'network')
|
3499
|
-
request = {
|
3499
|
+
request: dict = {
|
3500
3500
|
'ccy': currency['id'],
|
3501
3501
|
'chain': self.network_code_to_id(network, currency['code']),
|
3502
3502
|
}
|
@@ -3535,7 +3535,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3535
3535
|
raise ArgumentsRequired(self.id + ' fetchDepositAddress() ' + code + ' requires a network parameter')
|
3536
3536
|
if not (network in networks):
|
3537
3537
|
raise ExchangeError(self.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code)
|
3538
|
-
request = {
|
3538
|
+
request: dict = {
|
3539
3539
|
'ccy': currency['id'],
|
3540
3540
|
'chain': network,
|
3541
3541
|
}
|
@@ -3615,7 +3615,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3615
3615
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
3616
3616
|
self.load_markets()
|
3617
3617
|
market = self.market(symbol)
|
3618
|
-
request = {
|
3618
|
+
request: dict = {
|
3619
3619
|
'market': market['id'],
|
3620
3620
|
}
|
3621
3621
|
if limit is not None:
|
@@ -3693,7 +3693,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3693
3693
|
defaultMethod = None
|
3694
3694
|
defaultMethod, params = self.handle_option_and_params(params, 'fetchPositions', 'method', 'v2PrivateGetFuturesPendingPosition')
|
3695
3695
|
symbols = self.market_symbols(symbols)
|
3696
|
-
request = {
|
3696
|
+
request: dict = {
|
3697
3697
|
'market_type': 'FUTURES',
|
3698
3698
|
}
|
3699
3699
|
market = None
|
@@ -3772,7 +3772,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3772
3772
|
"""
|
3773
3773
|
self.load_markets()
|
3774
3774
|
market = self.market(symbol)
|
3775
|
-
request = {
|
3775
|
+
request: dict = {
|
3776
3776
|
'market_type': 'FUTURES',
|
3777
3777
|
'market': market['id'],
|
3778
3778
|
}
|
@@ -3823,7 +3823,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3823
3823
|
data = self.safe_list(response, 'data', [])
|
3824
3824
|
return self.parse_position(data[0], market)
|
3825
3825
|
|
3826
|
-
def parse_position(self, position, market: Market = None):
|
3826
|
+
def parse_position(self, position: dict, market: Market = None):
|
3827
3827
|
#
|
3828
3828
|
# {
|
3829
3829
|
# "position_id": 305891033,
|
@@ -3917,7 +3917,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3917
3917
|
raise ArgumentsRequired(self.id + ' setMarginMode() requires a leverage parameter')
|
3918
3918
|
if (leverage < 1) or (leverage > maxLeverage):
|
3919
3919
|
raise BadRequest(self.id + ' setMarginMode() leverage should be between 1 and ' + str(maxLeverage) + ' for ' + symbol)
|
3920
|
-
request = {
|
3920
|
+
request: dict = {
|
3921
3921
|
'market': market['id'],
|
3922
3922
|
'market_type': 'FUTURES',
|
3923
3923
|
'margin_mode': marginMode,
|
@@ -3957,7 +3957,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3957
3957
|
maxLeverage = self.safe_integer(market['limits']['leverage'], 'max', 100)
|
3958
3958
|
if (leverage < minLeverage) or (leverage > maxLeverage):
|
3959
3959
|
raise BadRequest(self.id + ' setLeverage() leverage should be between ' + str(minLeverage) + ' and ' + str(maxLeverage) + ' for ' + symbol)
|
3960
|
-
request = {
|
3960
|
+
request: dict = {
|
3961
3961
|
'market': market['id'],
|
3962
3962
|
'market_type': 'FUTURES',
|
3963
3963
|
'margin_mode': marginMode,
|
@@ -3975,7 +3975,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3975
3975
|
# }
|
3976
3976
|
#
|
3977
3977
|
|
3978
|
-
def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
3978
|
+
def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
3979
3979
|
"""
|
3980
3980
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
3981
3981
|
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market-position-level
|
@@ -3984,7 +3984,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3984
3984
|
:returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
|
3985
3985
|
"""
|
3986
3986
|
self.load_markets()
|
3987
|
-
request = {}
|
3987
|
+
request: dict = {}
|
3988
3988
|
if symbols is not None:
|
3989
3989
|
marketIds = self.market_ids(symbols)
|
3990
3990
|
request['market'] = ','.join(marketIds)
|
@@ -4017,7 +4017,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4017
4017
|
data = self.safe_list(response, 'data', [])
|
4018
4018
|
return self.parse_leverage_tiers(data, symbols, 'market')
|
4019
4019
|
|
4020
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
4020
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
4021
4021
|
tiers = []
|
4022
4022
|
brackets = self.safe_list(info, 'level', [])
|
4023
4023
|
minNotional = 0
|
@@ -4045,7 +4045,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4045
4045
|
requestAmount = rawAmount
|
4046
4046
|
if addOrReduce == 'reduce':
|
4047
4047
|
requestAmount = Precise.string_neg(rawAmount)
|
4048
|
-
request = {
|
4048
|
+
request: dict = {
|
4049
4049
|
'market': market['id'],
|
4050
4050
|
'market_type': 'FUTURES',
|
4051
4051
|
'amount': requestAmount,
|
@@ -4204,7 +4204,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4204
4204
|
raise ArgumentsRequired(self.id + ' fetchFundingHistory() requires a symbol argument')
|
4205
4205
|
self.load_markets()
|
4206
4206
|
market = self.market(symbol)
|
4207
|
-
request = {
|
4207
|
+
request: dict = {
|
4208
4208
|
'market': market['id'],
|
4209
4209
|
'market_type': 'FUTURES',
|
4210
4210
|
}
|
@@ -4265,7 +4265,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4265
4265
|
market = self.market(symbol)
|
4266
4266
|
if not market['swap']:
|
4267
4267
|
raise BadSymbol(self.id + ' fetchFundingRate() supports swap contracts only')
|
4268
|
-
request = {
|
4268
|
+
request: dict = {
|
4269
4269
|
'market': market['id'],
|
4270
4270
|
}
|
4271
4271
|
response = self.v2PublicGetFuturesFundingRate(self.extend(request, params))
|
@@ -4339,7 +4339,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4339
4339
|
"""
|
4340
4340
|
self.load_markets()
|
4341
4341
|
symbols = self.market_symbols(symbols)
|
4342
|
-
request = {}
|
4342
|
+
request: dict = {}
|
4343
4343
|
market = None
|
4344
4344
|
if symbols is not None:
|
4345
4345
|
symbol = self.safe_value(symbols, 0)
|
@@ -4391,7 +4391,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4391
4391
|
params = self.omit(params, 'network')
|
4392
4392
|
if tag:
|
4393
4393
|
address = address + ':' + tag
|
4394
|
-
request = {
|
4394
|
+
request: dict = {
|
4395
4395
|
'coin_type': currency['id'],
|
4396
4396
|
'coin_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
|
4397
4397
|
'actual_amount': float(self.number_to_string(amount)), # the actual amount without fees, https://www.coinex.com/fees
|
@@ -4422,7 +4422,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4422
4422
|
return self.parse_transaction(transaction, currency)
|
4423
4423
|
|
4424
4424
|
def parse_transaction_status(self, status):
|
4425
|
-
statuses = {
|
4425
|
+
statuses: dict = {
|
4426
4426
|
'audit': 'pending',
|
4427
4427
|
'pass': 'pending',
|
4428
4428
|
'processing': 'pending',
|
@@ -4454,7 +4454,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4454
4454
|
if paginate:
|
4455
4455
|
return self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 1000)
|
4456
4456
|
market = self.market(symbol)
|
4457
|
-
request = {
|
4457
|
+
request: dict = {
|
4458
4458
|
'market': market['id'],
|
4459
4459
|
}
|
4460
4460
|
if since is not None:
|
@@ -4497,7 +4497,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4497
4497
|
sorted = self.sort_by(rates, 'timestamp')
|
4498
4498
|
return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
|
4499
4499
|
|
4500
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
4500
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
4501
4501
|
#
|
4502
4502
|
# fetchDeposits
|
4503
4503
|
#
|
@@ -4614,7 +4614,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4614
4614
|
accountsByType = self.safe_dict(self.options, 'accountsById', {})
|
4615
4615
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
4616
4616
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
4617
|
-
request = {
|
4617
|
+
request: dict = {
|
4618
4618
|
'ccy': currency['id'],
|
4619
4619
|
'amount': amountToPrecision,
|
4620
4620
|
'from_account_type': fromId,
|
@@ -4643,7 +4643,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4643
4643
|
})
|
4644
4644
|
|
4645
4645
|
def parse_transfer_status(self, status):
|
4646
|
-
statuses = {
|
4646
|
+
statuses: dict = {
|
4647
4647
|
'0': 'ok',
|
4648
4648
|
'SUCCESS': 'ok',
|
4649
4649
|
'OK': 'ok',
|
@@ -4684,7 +4684,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4684
4684
|
if code is None:
|
4685
4685
|
raise ArgumentsRequired(self.id + ' fetchTransfers() requires a code argument')
|
4686
4686
|
currency = self.currency(code)
|
4687
|
-
request = {
|
4687
|
+
request: dict = {
|
4688
4688
|
'ccy': currency['id'],
|
4689
4689
|
}
|
4690
4690
|
marginMode = None
|
@@ -4733,7 +4733,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4733
4733
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
4734
4734
|
"""
|
4735
4735
|
self.load_markets()
|
4736
|
-
request = {}
|
4736
|
+
request: dict = {}
|
4737
4737
|
currency = None
|
4738
4738
|
if code is not None:
|
4739
4739
|
currency = self.currency(code)
|
@@ -4787,7 +4787,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4787
4787
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
4788
4788
|
"""
|
4789
4789
|
self.load_markets()
|
4790
|
-
request = {}
|
4790
|
+
request: dict = {}
|
4791
4791
|
currency = None
|
4792
4792
|
if code is not None:
|
4793
4793
|
currency = self.currency(code)
|
@@ -4876,7 +4876,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4876
4876
|
params = self.omit(params, 'code')
|
4877
4877
|
currency = self.currency(code)
|
4878
4878
|
market = self.market(symbol)
|
4879
|
-
request = {
|
4879
|
+
request: dict = {
|
4880
4880
|
'market': market['id'],
|
4881
4881
|
'ccy': currency['id'],
|
4882
4882
|
}
|
@@ -4910,7 +4910,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4910
4910
|
:returns dict[]: a list of `borrow interest structures <https://docs.ccxt.com/#/?id=borrow-interest-structure>`
|
4911
4911
|
"""
|
4912
4912
|
self.load_markets()
|
4913
|
-
request = {}
|
4913
|
+
request: dict = {}
|
4914
4914
|
market = None
|
4915
4915
|
if symbol is not None:
|
4916
4916
|
market = self.market(symbol)
|
@@ -4946,7 +4946,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4946
4946
|
interest = self.parse_borrow_interests(rows, market)
|
4947
4947
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
4948
4948
|
|
4949
|
-
def parse_borrow_interest(self, info, market: Market = None):
|
4949
|
+
def parse_borrow_interest(self, info: dict, market: Market = None):
|
4950
4950
|
#
|
4951
4951
|
# {
|
4952
4952
|
# "borrow_id": 2642934,
|
@@ -4994,7 +4994,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4994
4994
|
currency = self.currency(code)
|
4995
4995
|
isAutoRenew = self.safe_bool_2(params, 'isAutoRenew', 'is_auto_renew', False)
|
4996
4996
|
params = self.omit(params, 'isAutoRenew')
|
4997
|
-
request = {
|
4997
|
+
request: dict = {
|
4998
4998
|
'market': market['id'],
|
4999
4999
|
'ccy': currency['id'],
|
5000
5000
|
'borrow_amount': self.currency_to_precision(code, amount),
|
@@ -5038,7 +5038,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5038
5038
|
self.load_markets()
|
5039
5039
|
market = self.market(symbol)
|
5040
5040
|
currency = self.currency(code)
|
5041
|
-
request = {
|
5041
|
+
request: dict = {
|
5042
5042
|
'market': market['id'],
|
5043
5043
|
'ccy': currency['id'],
|
5044
5044
|
'amount': self.currency_to_precision(code, amount),
|
@@ -5084,93 +5084,122 @@ class coinex(Exchange, ImplicitAPI):
|
|
5084
5084
|
'info': info,
|
5085
5085
|
}
|
5086
5086
|
|
5087
|
-
def
|
5087
|
+
def fetch_deposit_withdraw_fee(self, code: str, params={}):
|
5088
5088
|
"""
|
5089
|
-
fetch
|
5090
|
-
:see: https://
|
5091
|
-
:param str
|
5089
|
+
fetch the fee for deposits and withdrawals
|
5090
|
+
:see: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-withdrawal-config
|
5091
|
+
:param str code: unified currency code
|
5092
5092
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5093
|
-
:returns dict
|
5093
|
+
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
5094
5094
|
"""
|
5095
5095
|
self.load_markets()
|
5096
|
-
|
5097
|
-
|
5098
|
-
|
5099
|
-
|
5100
|
-
|
5101
|
-
|
5102
|
-
#
|
5103
|
-
#
|
5104
|
-
#
|
5105
|
-
#
|
5106
|
-
#
|
5107
|
-
#
|
5108
|
-
#
|
5109
|
-
#
|
5110
|
-
#
|
5111
|
-
#
|
5112
|
-
#
|
5113
|
-
#
|
5114
|
-
#
|
5115
|
-
#
|
5116
|
-
#
|
5117
|
-
#
|
5118
|
-
#
|
5119
|
-
#
|
5120
|
-
#
|
5121
|
-
#
|
5122
|
-
#
|
5123
|
-
#
|
5124
|
-
#
|
5125
|
-
#
|
5126
|
-
#
|
5127
|
-
#
|
5128
|
-
|
5096
|
+
currency = self.currency(code)
|
5097
|
+
request: dict = {
|
5098
|
+
'ccy': currency['id'],
|
5099
|
+
}
|
5100
|
+
response = self.v2PrivateGetAssetsDepositWithdrawConfig(self.extend(request, params))
|
5101
|
+
#
|
5102
|
+
# {
|
5103
|
+
# "code": 0,
|
5104
|
+
# "data": {
|
5105
|
+
# "asset": {
|
5106
|
+
# "ccy": "USDT",
|
5107
|
+
# "deposit_enabled": True,
|
5108
|
+
# "withdraw_enabled": True,
|
5109
|
+
# "inter_transfer_enabled": True,
|
5110
|
+
# "is_st": False
|
5111
|
+
# },
|
5112
|
+
# "chains": [
|
5113
|
+
# {
|
5114
|
+
# "chain": "TRC20",
|
5115
|
+
# "min_deposit_amount": "2.4",
|
5116
|
+
# "min_withdraw_amount": "2.4",
|
5117
|
+
# "deposit_enabled": True,
|
5118
|
+
# "withdraw_enabled": True,
|
5119
|
+
# "deposit_delay_minutes": 0,
|
5120
|
+
# "safe_confirmations": 10,
|
5121
|
+
# "irreversible_confirmations": 20,
|
5122
|
+
# "deflation_rate": "0",
|
5123
|
+
# "withdrawal_fee": "2.4",
|
5124
|
+
# "withdrawal_precision": 6,
|
5125
|
+
# "memo": "",
|
5126
|
+
# "is_memo_required_for_deposit": False,
|
5127
|
+
# "explorer_asset_url": "https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
|
5128
|
+
# },
|
5129
|
+
# ]
|
5130
|
+
# },
|
5131
|
+
# "message": "OK"
|
5132
|
+
# }
|
5133
|
+
#
|
5134
|
+
data = self.safe_dict(response, 'data', {})
|
5135
|
+
return self.parse_deposit_withdraw_fee(data, currency)
|
5129
5136
|
|
5130
|
-
def
|
5131
|
-
|
5132
|
-
|
5133
|
-
|
5134
|
-
|
5135
|
-
|
5136
|
-
|
5137
|
-
|
5138
|
-
|
5139
|
-
|
5140
|
-
|
5141
|
-
|
5142
|
-
|
5143
|
-
|
5144
|
-
|
5145
|
-
|
5146
|
-
|
5147
|
-
|
5148
|
-
|
5149
|
-
|
5150
|
-
|
5151
|
-
|
5152
|
-
|
5153
|
-
|
5154
|
-
|
5155
|
-
|
5156
|
-
|
5157
|
-
|
5158
|
-
|
5159
|
-
|
5160
|
-
|
5161
|
-
|
5137
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
5138
|
+
#
|
5139
|
+
# {
|
5140
|
+
# "asset": {
|
5141
|
+
# "ccy": "USDT",
|
5142
|
+
# "deposit_enabled": True,
|
5143
|
+
# "withdraw_enabled": True,
|
5144
|
+
# "inter_transfer_enabled": True,
|
5145
|
+
# "is_st": False
|
5146
|
+
# },
|
5147
|
+
# "chains": [
|
5148
|
+
# {
|
5149
|
+
# "chain": "TRC20",
|
5150
|
+
# "min_deposit_amount": "2.4",
|
5151
|
+
# "min_withdraw_amount": "2.4",
|
5152
|
+
# "deposit_enabled": True,
|
5153
|
+
# "withdraw_enabled": True,
|
5154
|
+
# "deposit_delay_minutes": 0,
|
5155
|
+
# "safe_confirmations": 10,
|
5156
|
+
# "irreversible_confirmations": 20,
|
5157
|
+
# "deflation_rate": "0",
|
5158
|
+
# "withdrawal_fee": "2.4",
|
5159
|
+
# "withdrawal_precision": 6,
|
5160
|
+
# "memo": "",
|
5161
|
+
# "is_memo_required_for_deposit": False,
|
5162
|
+
# "explorer_asset_url": "https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
|
5163
|
+
# },
|
5164
|
+
# ]
|
5165
|
+
# }
|
5166
|
+
#
|
5167
|
+
result: dict = {
|
5168
|
+
'info': fee,
|
5169
|
+
'withdraw': {
|
5170
|
+
'fee': None,
|
5171
|
+
'percentage': None,
|
5172
|
+
},
|
5173
|
+
'deposit': {
|
5174
|
+
'fee': None,
|
5175
|
+
'percentage': None,
|
5176
|
+
},
|
5177
|
+
'networks': {},
|
5178
|
+
}
|
5179
|
+
chains = self.safe_list(fee, 'chains', [])
|
5180
|
+
asset = self.safe_dict(fee, 'asset', {})
|
5181
|
+
for i in range(0, len(chains)):
|
5182
|
+
entry = chains[i]
|
5183
|
+
isWithdrawEnabled = self.safe_bool(entry, 'withdraw_enabled')
|
5184
|
+
if isWithdrawEnabled:
|
5185
|
+
result['withdraw']['fee'] = self.safe_number(entry, 'withdrawal_fee')
|
5186
|
+
result['withdraw']['percentage'] = False
|
5187
|
+
networkId = self.safe_string(entry, 'chain')
|
5188
|
+
if networkId:
|
5189
|
+
networkCode = self.network_id_to_code(networkId, self.safe_string(asset, 'ccy'))
|
5190
|
+
result['networks'][networkCode] = {
|
5191
|
+
'withdraw': {
|
5192
|
+
'fee': self.safe_number(entry, 'withdrawal_fee'),
|
5193
|
+
'percentage': False,
|
5194
|
+
},
|
5195
|
+
'deposit': {
|
5196
|
+
'fee': None,
|
5197
|
+
'percentage': None,
|
5198
|
+
},
|
5162
5199
|
}
|
5163
|
-
|
5164
|
-
depositWithdrawFees[code]['withdraw'] = withdrawResult
|
5165
|
-
depositWithdrawFees[code]['deposit'] = depositResult
|
5166
|
-
depositWithdrawCodes = list(depositWithdrawFees.keys())
|
5167
|
-
for i in range(0, len(depositWithdrawCodes)):
|
5168
|
-
code = depositWithdrawCodes[i]
|
5169
|
-
currency = self.currency(code)
|
5170
|
-
depositWithdrawFees[code] = self.assign_default_deposit_withdraw_fees(depositWithdrawFees[code], currency)
|
5171
|
-
return depositWithdrawFees
|
5200
|
+
return result
|
5172
5201
|
|
5173
|
-
def fetch_leverages(self, symbols:
|
5202
|
+
def fetch_leverages(self, symbols: Strings = None, params={}) -> Leverages:
|
5174
5203
|
"""
|
5175
5204
|
fetch the set leverage for all contract and margin markets
|
5176
5205
|
:see: https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot002_account007_margin_account_settings
|
@@ -5238,7 +5267,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5238
5267
|
"""
|
5239
5268
|
self.load_markets()
|
5240
5269
|
market = self.market(symbol)
|
5241
|
-
request = {
|
5270
|
+
request: dict = {
|
5242
5271
|
'market_type': 'FUTURES',
|
5243
5272
|
'market': market['id'],
|
5244
5273
|
}
|
@@ -5441,7 +5470,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5441
5470
|
if positionId is None:
|
5442
5471
|
raise ArgumentsRequired(self.id + ' fetchMarginAdjustmentHistory() requires a positionId parameter')
|
5443
5472
|
market = self.market(symbol)
|
5444
|
-
request = {
|
5473
|
+
request: dict = {
|
5445
5474
|
'market': market['id'],
|
5446
5475
|
'market_type': 'FUTURES',
|
5447
5476
|
'position_id': positionId,
|