ccxt 4.3.30__py2.py3-none-any.whl → 4.3.32__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 +208 -175
- 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 +48 -36
- 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 +208 -175
- 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 +20 -20
- ccxt/pro/coinbase.py +32 -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/test/test_async.py +1 -1
- ccxt/test/test_sync.py +1 -1
- 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.32.dist-info}/METADATA +4 -4
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/RECORD +260 -260
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/WHEEL +0 -0
- {ccxt-4.3.30.dist-info → ccxt-4.3.32.dist-info}/top_level.txt +0 -0
ccxt/async_support/coinex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.async_support.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.coinex import ImplicitAPI
|
8
8
|
import asyncio
|
9
|
-
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage,
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry, TransferEntries
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import AuthenticationError
|
@@ -82,8 +82,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
82
82
|
'fetchDepositAddressByNetwork': False,
|
83
83
|
'fetchDepositAddresses': False,
|
84
84
|
'fetchDeposits': True,
|
85
|
-
'fetchDepositWithdrawFee':
|
86
|
-
'fetchDepositWithdrawFees':
|
85
|
+
'fetchDepositWithdrawFee': True,
|
86
|
+
'fetchDepositWithdrawFees': False,
|
87
87
|
'fetchFundingHistory': True,
|
88
88
|
'fetchFundingRate': True,
|
89
89
|
'fetchFundingRateHistory': True,
|
@@ -91,8 +91,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
91
91
|
'fetchIndexOHLCV': False,
|
92
92
|
'fetchIsolatedBorrowRate': True,
|
93
93
|
'fetchIsolatedBorrowRates': False,
|
94
|
-
'fetchLeverage':
|
95
|
-
'fetchLeverages':
|
94
|
+
'fetchLeverage': True,
|
95
|
+
'fetchLeverages': False,
|
96
96
|
'fetchLeverageTiers': True,
|
97
97
|
'fetchMarginAdjustmentHistory': True,
|
98
98
|
'fetchMarketLeverageTiers': 'emulated',
|
@@ -567,7 +567,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
567
567
|
#
|
568
568
|
data = self.safe_value(response, 'data', [])
|
569
569
|
coins = list(data.keys())
|
570
|
-
result = {}
|
570
|
+
result: dict = {}
|
571
571
|
for i in range(0, len(coins)):
|
572
572
|
coin = coins[i]
|
573
573
|
currency = data[coin]
|
@@ -628,7 +628,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
628
628
|
if precisionString is not None:
|
629
629
|
minPrecisionString = precisionString if (minPrecisionString is None) else Precise.string_min(precisionString, minPrecisionString)
|
630
630
|
networks = self.safe_value(result[code], 'networks', {})
|
631
|
-
network = {
|
631
|
+
network: dict = {
|
632
632
|
'info': currency,
|
633
633
|
'id': networkId,
|
634
634
|
'network': networkId,
|
@@ -936,7 +936,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
936
936
|
"""
|
937
937
|
await self.load_markets()
|
938
938
|
market = self.market(symbol)
|
939
|
-
request = {
|
939
|
+
request: dict = {
|
940
940
|
'market': market['id'],
|
941
941
|
}
|
942
942
|
response = None
|
@@ -1100,7 +1100,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1100
1100
|
market = self.market(symbol)
|
1101
1101
|
if limit is None:
|
1102
1102
|
limit = 20 # default
|
1103
|
-
request = {
|
1103
|
+
request: dict = {
|
1104
1104
|
'market': market['id'],
|
1105
1105
|
'limit': limit,
|
1106
1106
|
'interval': '0',
|
@@ -1165,7 +1165,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1165
1165
|
timestamp = self.safe_integer(depth, 'updated_at')
|
1166
1166
|
return self.parse_order_book(depth, symbol, timestamp)
|
1167
1167
|
|
1168
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1168
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1169
1169
|
#
|
1170
1170
|
# Spot and Swap fetchTrades(public)
|
1171
1171
|
#
|
@@ -1237,7 +1237,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1237
1237
|
"""
|
1238
1238
|
await self.load_markets()
|
1239
1239
|
market = self.market(symbol)
|
1240
|
-
request = {
|
1240
|
+
request: dict = {
|
1241
1241
|
'market': market['id'],
|
1242
1242
|
# 'last_id': 0,
|
1243
1243
|
}
|
@@ -1278,7 +1278,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1278
1278
|
"""
|
1279
1279
|
await self.load_markets()
|
1280
1280
|
market = self.market(symbol)
|
1281
|
-
request = {
|
1281
|
+
request: dict = {
|
1282
1282
|
'market': market['id'],
|
1283
1283
|
}
|
1284
1284
|
response = None
|
@@ -1389,7 +1389,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1389
1389
|
# }
|
1390
1390
|
#
|
1391
1391
|
data = self.safe_list(response, 'data', [])
|
1392
|
-
result = {}
|
1392
|
+
result: dict = {}
|
1393
1393
|
for i in range(0, len(data)):
|
1394
1394
|
entry = data[i]
|
1395
1395
|
marketId = self.safe_string(entry, 'market')
|
@@ -1398,7 +1398,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1398
1398
|
result[symbol] = self.parse_trading_fee(entry, market)
|
1399
1399
|
return result
|
1400
1400
|
|
1401
|
-
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
1401
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
1402
1402
|
marketId = self.safe_value(fee, 'market')
|
1403
1403
|
symbol = self.safe_symbol(marketId, market)
|
1404
1404
|
return {
|
@@ -1446,7 +1446,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1446
1446
|
"""
|
1447
1447
|
await self.load_markets()
|
1448
1448
|
market = self.market(symbol)
|
1449
|
-
request = {
|
1449
|
+
request: dict = {
|
1450
1450
|
'market': market['id'],
|
1451
1451
|
'period': self.safe_string(self.timeframes, timeframe, timeframe),
|
1452
1452
|
}
|
@@ -1514,7 +1514,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1514
1514
|
# "message": "OK"
|
1515
1515
|
# }
|
1516
1516
|
#
|
1517
|
-
result = {'info': response}
|
1517
|
+
result: dict = {'info': response}
|
1518
1518
|
balances = self.safe_list(response, 'data', [])
|
1519
1519
|
for i in range(0, len(balances)):
|
1520
1520
|
entry = balances[i]
|
@@ -1549,7 +1549,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1549
1549
|
# "message": "OK"
|
1550
1550
|
# }
|
1551
1551
|
#
|
1552
|
-
result = {'info': response}
|
1552
|
+
result: dict = {'info': response}
|
1553
1553
|
balances = self.safe_list(response, 'data', [])
|
1554
1554
|
for i in range(0, len(balances)):
|
1555
1555
|
entry = balances[i]
|
@@ -1580,7 +1580,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1580
1580
|
# "message": "OK"
|
1581
1581
|
# }
|
1582
1582
|
#
|
1583
|
-
result = {'info': response}
|
1583
|
+
result: dict = {'info': response}
|
1584
1584
|
balances = self.safe_list(response, 'data', [])
|
1585
1585
|
for i in range(0, len(balances)):
|
1586
1586
|
entry = balances[i]
|
@@ -1608,7 +1608,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1608
1608
|
# "message": "OK"
|
1609
1609
|
# }
|
1610
1610
|
#
|
1611
|
-
result = {'info': response}
|
1611
|
+
result: dict = {'info': response}
|
1612
1612
|
balances = self.safe_list(response, 'data', [])
|
1613
1613
|
for i in range(0, len(balances)):
|
1614
1614
|
entry = balances[i]
|
@@ -1646,8 +1646,8 @@ class coinex(Exchange, ImplicitAPI):
|
|
1646
1646
|
else:
|
1647
1647
|
return await self.fetch_spot_balance(params)
|
1648
1648
|
|
1649
|
-
def parse_order_status(self, status):
|
1650
|
-
statuses = {
|
1649
|
+
def parse_order_status(self, status: Str):
|
1650
|
+
statuses: dict = {
|
1651
1651
|
'rejected': 'rejected',
|
1652
1652
|
'open': 'open',
|
1653
1653
|
'not_deal': 'open',
|
@@ -1657,7 +1657,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1657
1657
|
}
|
1658
1658
|
return self.safe_string(statuses, status, status)
|
1659
1659
|
|
1660
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1660
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1661
1661
|
#
|
1662
1662
|
# Spot and Margin createOrder, createOrders, editOrder, cancelOrders, cancelOrder, fetchOpenOrders
|
1663
1663
|
#
|
@@ -1952,7 +1952,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
1952
1952
|
if reduceOnly:
|
1953
1953
|
if not market['swap']:
|
1954
1954
|
raise InvalidOrder(self.id + ' createOrder() does not support reduceOnly for ' + market['type'] + ' orders, reduceOnly orders are supported for swap markets only')
|
1955
|
-
request = {
|
1955
|
+
request: dict = {
|
1956
1956
|
'market': market['id'],
|
1957
1957
|
}
|
1958
1958
|
if clientOrderId is None:
|
@@ -2298,7 +2298,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2298
2298
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
2299
2299
|
ordersRequests.append(orderRequest)
|
2300
2300
|
market = self.market(symbol)
|
2301
|
-
request = {
|
2301
|
+
request: dict = {
|
2302
2302
|
'market': market['id'],
|
2303
2303
|
'orders': ordersRequests,
|
2304
2304
|
}
|
@@ -2457,7 +2457,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2457
2457
|
raise ArgumentsRequired(self.id + ' cancelOrders() requires a symbol argument')
|
2458
2458
|
await self.load_markets()
|
2459
2459
|
market = self.market(symbol)
|
2460
|
-
request = {
|
2460
|
+
request: dict = {
|
2461
2461
|
'market': market['id'],
|
2462
2462
|
}
|
2463
2463
|
stop = self.safe_bool_2(params, 'stop', 'trigger')
|
@@ -2632,7 +2632,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2632
2632
|
raise ArgumentsRequired(self.id + ' editOrder() requires a symbol argument')
|
2633
2633
|
await self.load_markets()
|
2634
2634
|
market = self.market(symbol)
|
2635
|
-
request = {
|
2635
|
+
request: dict = {
|
2636
2636
|
'market': market['id'],
|
2637
2637
|
}
|
2638
2638
|
if amount is not None:
|
@@ -2768,7 +2768,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
2768
2768
|
market = self.market(symbol)
|
2769
2769
|
isTriggerOrder = self.safe_bool_2(params, 'stop', 'trigger')
|
2770
2770
|
swap = market['swap']
|
2771
|
-
request = {
|
2771
|
+
request: dict = {
|
2772
2772
|
'market': market['id'],
|
2773
2773
|
}
|
2774
2774
|
marginMode = None
|
@@ -3039,7 +3039,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3039
3039
|
raise ArgumentsRequired(self.id + ' cancelAllOrders() requires a symbol argument')
|
3040
3040
|
await self.load_markets()
|
3041
3041
|
market = self.market(symbol)
|
3042
|
-
request = {
|
3042
|
+
request: dict = {
|
3043
3043
|
'market': market['id'],
|
3044
3044
|
}
|
3045
3045
|
response = None
|
@@ -3075,7 +3075,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3075
3075
|
raise ArgumentsRequired(self.id + ' fetchOrder() requires a symbol argument')
|
3076
3076
|
await self.load_markets()
|
3077
3077
|
market = self.market(symbol)
|
3078
|
-
request = {
|
3078
|
+
request: dict = {
|
3079
3079
|
'market': market['id'],
|
3080
3080
|
'order_id': self.parse_to_numeric(id),
|
3081
3081
|
}
|
@@ -3161,7 +3161,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3161
3161
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
3162
3162
|
"""
|
3163
3163
|
await self.load_markets()
|
3164
|
-
request = {}
|
3164
|
+
request: dict = {}
|
3165
3165
|
market = None
|
3166
3166
|
if symbol is not None:
|
3167
3167
|
market = self.market(symbol)
|
@@ -3497,7 +3497,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3497
3497
|
if network is None:
|
3498
3498
|
raise ArgumentsRequired(self.id + ' createDepositAddress() requires a network parameter')
|
3499
3499
|
params = self.omit(params, 'network')
|
3500
|
-
request = {
|
3500
|
+
request: dict = {
|
3501
3501
|
'ccy': currency['id'],
|
3502
3502
|
'chain': self.network_code_to_id(network, currency['code']),
|
3503
3503
|
}
|
@@ -3536,7 +3536,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3536
3536
|
raise ArgumentsRequired(self.id + ' fetchDepositAddress() ' + code + ' requires a network parameter')
|
3537
3537
|
if not (network in networks):
|
3538
3538
|
raise ExchangeError(self.id + ' fetchDepositAddress() ' + network + ' network not supported for ' + code)
|
3539
|
-
request = {
|
3539
|
+
request: dict = {
|
3540
3540
|
'ccy': currency['id'],
|
3541
3541
|
'chain': network,
|
3542
3542
|
}
|
@@ -3616,7 +3616,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3616
3616
|
raise ArgumentsRequired(self.id + ' fetchMyTrades() requires a symbol argument')
|
3617
3617
|
await self.load_markets()
|
3618
3618
|
market = self.market(symbol)
|
3619
|
-
request = {
|
3619
|
+
request: dict = {
|
3620
3620
|
'market': market['id'],
|
3621
3621
|
}
|
3622
3622
|
if limit is not None:
|
@@ -3694,7 +3694,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3694
3694
|
defaultMethod = None
|
3695
3695
|
defaultMethod, params = self.handle_option_and_params(params, 'fetchPositions', 'method', 'v2PrivateGetFuturesPendingPosition')
|
3696
3696
|
symbols = self.market_symbols(symbols)
|
3697
|
-
request = {
|
3697
|
+
request: dict = {
|
3698
3698
|
'market_type': 'FUTURES',
|
3699
3699
|
}
|
3700
3700
|
market = None
|
@@ -3773,7 +3773,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3773
3773
|
"""
|
3774
3774
|
await self.load_markets()
|
3775
3775
|
market = self.market(symbol)
|
3776
|
-
request = {
|
3776
|
+
request: dict = {
|
3777
3777
|
'market_type': 'FUTURES',
|
3778
3778
|
'market': market['id'],
|
3779
3779
|
}
|
@@ -3824,7 +3824,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3824
3824
|
data = self.safe_list(response, 'data', [])
|
3825
3825
|
return self.parse_position(data[0], market)
|
3826
3826
|
|
3827
|
-
def parse_position(self, position, market: Market = None):
|
3827
|
+
def parse_position(self, position: dict, market: Market = None):
|
3828
3828
|
#
|
3829
3829
|
# {
|
3830
3830
|
# "position_id": 305891033,
|
@@ -3918,7 +3918,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3918
3918
|
raise ArgumentsRequired(self.id + ' setMarginMode() requires a leverage parameter')
|
3919
3919
|
if (leverage < 1) or (leverage > maxLeverage):
|
3920
3920
|
raise BadRequest(self.id + ' setMarginMode() leverage should be between 1 and ' + str(maxLeverage) + ' for ' + symbol)
|
3921
|
-
request = {
|
3921
|
+
request: dict = {
|
3922
3922
|
'market': market['id'],
|
3923
3923
|
'market_type': 'FUTURES',
|
3924
3924
|
'margin_mode': marginMode,
|
@@ -3958,7 +3958,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3958
3958
|
maxLeverage = self.safe_integer(market['limits']['leverage'], 'max', 100)
|
3959
3959
|
if (leverage < minLeverage) or (leverage > maxLeverage):
|
3960
3960
|
raise BadRequest(self.id + ' setLeverage() leverage should be between ' + str(minLeverage) + ' and ' + str(maxLeverage) + ' for ' + symbol)
|
3961
|
-
request = {
|
3961
|
+
request: dict = {
|
3962
3962
|
'market': market['id'],
|
3963
3963
|
'market_type': 'FUTURES',
|
3964
3964
|
'margin_mode': marginMode,
|
@@ -3976,7 +3976,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3976
3976
|
# }
|
3977
3977
|
#
|
3978
3978
|
|
3979
|
-
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
3979
|
+
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
3980
3980
|
"""
|
3981
3981
|
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
3982
3982
|
:see: https://docs.coinex.com/api/v2/futures/market/http/list-market-position-level
|
@@ -3985,7 +3985,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
3985
3985
|
:returns dict: a dictionary of `leverage tiers structures <https://docs.ccxt.com/#/?id=leverage-tiers-structure>`, indexed by market symbols
|
3986
3986
|
"""
|
3987
3987
|
await self.load_markets()
|
3988
|
-
request = {}
|
3988
|
+
request: dict = {}
|
3989
3989
|
if symbols is not None:
|
3990
3990
|
marketIds = self.market_ids(symbols)
|
3991
3991
|
request['market'] = ','.join(marketIds)
|
@@ -4018,7 +4018,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4018
4018
|
data = self.safe_list(response, 'data', [])
|
4019
4019
|
return self.parse_leverage_tiers(data, symbols, 'market')
|
4020
4020
|
|
4021
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
4021
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
4022
4022
|
tiers = []
|
4023
4023
|
brackets = self.safe_list(info, 'level', [])
|
4024
4024
|
minNotional = 0
|
@@ -4046,7 +4046,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4046
4046
|
requestAmount = rawAmount
|
4047
4047
|
if addOrReduce == 'reduce':
|
4048
4048
|
requestAmount = Precise.string_neg(rawAmount)
|
4049
|
-
request = {
|
4049
|
+
request: dict = {
|
4050
4050
|
'market': market['id'],
|
4051
4051
|
'market_type': 'FUTURES',
|
4052
4052
|
'amount': requestAmount,
|
@@ -4205,7 +4205,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4205
4205
|
raise ArgumentsRequired(self.id + ' fetchFundingHistory() requires a symbol argument')
|
4206
4206
|
await self.load_markets()
|
4207
4207
|
market = self.market(symbol)
|
4208
|
-
request = {
|
4208
|
+
request: dict = {
|
4209
4209
|
'market': market['id'],
|
4210
4210
|
'market_type': 'FUTURES',
|
4211
4211
|
}
|
@@ -4266,7 +4266,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4266
4266
|
market = self.market(symbol)
|
4267
4267
|
if not market['swap']:
|
4268
4268
|
raise BadSymbol(self.id + ' fetchFundingRate() supports swap contracts only')
|
4269
|
-
request = {
|
4269
|
+
request: dict = {
|
4270
4270
|
'market': market['id'],
|
4271
4271
|
}
|
4272
4272
|
response = await self.v2PublicGetFuturesFundingRate(self.extend(request, params))
|
@@ -4340,7 +4340,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4340
4340
|
"""
|
4341
4341
|
await self.load_markets()
|
4342
4342
|
symbols = self.market_symbols(symbols)
|
4343
|
-
request = {}
|
4343
|
+
request: dict = {}
|
4344
4344
|
market = None
|
4345
4345
|
if symbols is not None:
|
4346
4346
|
symbol = self.safe_value(symbols, 0)
|
@@ -4392,7 +4392,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4392
4392
|
params = self.omit(params, 'network')
|
4393
4393
|
if tag:
|
4394
4394
|
address = address + ':' + tag
|
4395
|
-
request = {
|
4395
|
+
request: dict = {
|
4396
4396
|
'coin_type': currency['id'],
|
4397
4397
|
'coin_address': address, # must be authorized, inter-user transfer by a registered mobile phone number or an email address is supported
|
4398
4398
|
'actual_amount': float(self.number_to_string(amount)), # the actual amount without fees, https://www.coinex.com/fees
|
@@ -4423,7 +4423,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4423
4423
|
return self.parse_transaction(transaction, currency)
|
4424
4424
|
|
4425
4425
|
def parse_transaction_status(self, status):
|
4426
|
-
statuses = {
|
4426
|
+
statuses: dict = {
|
4427
4427
|
'audit': 'pending',
|
4428
4428
|
'pass': 'pending',
|
4429
4429
|
'processing': 'pending',
|
@@ -4455,7 +4455,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4455
4455
|
if paginate:
|
4456
4456
|
return await self.fetch_paginated_call_deterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 1000)
|
4457
4457
|
market = self.market(symbol)
|
4458
|
-
request = {
|
4458
|
+
request: dict = {
|
4459
4459
|
'market': market['id'],
|
4460
4460
|
}
|
4461
4461
|
if since is not None:
|
@@ -4498,7 +4498,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4498
4498
|
sorted = self.sort_by(rates, 'timestamp')
|
4499
4499
|
return self.filter_by_symbol_since_limit(sorted, market['symbol'], since, limit)
|
4500
4500
|
|
4501
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
4501
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
4502
4502
|
#
|
4503
4503
|
# fetchDeposits
|
4504
4504
|
#
|
@@ -4615,7 +4615,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4615
4615
|
accountsByType = self.safe_dict(self.options, 'accountsById', {})
|
4616
4616
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
4617
4617
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
4618
|
-
request = {
|
4618
|
+
request: dict = {
|
4619
4619
|
'ccy': currency['id'],
|
4620
4620
|
'amount': amountToPrecision,
|
4621
4621
|
'from_account_type': fromId,
|
@@ -4644,7 +4644,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4644
4644
|
})
|
4645
4645
|
|
4646
4646
|
def parse_transfer_status(self, status):
|
4647
|
-
statuses = {
|
4647
|
+
statuses: dict = {
|
4648
4648
|
'0': 'ok',
|
4649
4649
|
'SUCCESS': 'ok',
|
4650
4650
|
'OK': 'ok',
|
@@ -4685,7 +4685,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4685
4685
|
if code is None:
|
4686
4686
|
raise ArgumentsRequired(self.id + ' fetchTransfers() requires a code argument')
|
4687
4687
|
currency = self.currency(code)
|
4688
|
-
request = {
|
4688
|
+
request: dict = {
|
4689
4689
|
'ccy': currency['id'],
|
4690
4690
|
}
|
4691
4691
|
marginMode = None
|
@@ -4734,7 +4734,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4734
4734
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
4735
4735
|
"""
|
4736
4736
|
await self.load_markets()
|
4737
|
-
request = {}
|
4737
|
+
request: dict = {}
|
4738
4738
|
currency = None
|
4739
4739
|
if code is not None:
|
4740
4740
|
currency = self.currency(code)
|
@@ -4788,7 +4788,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4788
4788
|
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
4789
4789
|
"""
|
4790
4790
|
await self.load_markets()
|
4791
|
-
request = {}
|
4791
|
+
request: dict = {}
|
4792
4792
|
currency = None
|
4793
4793
|
if code is not None:
|
4794
4794
|
currency = self.currency(code)
|
@@ -4877,7 +4877,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4877
4877
|
params = self.omit(params, 'code')
|
4878
4878
|
currency = self.currency(code)
|
4879
4879
|
market = self.market(symbol)
|
4880
|
-
request = {
|
4880
|
+
request: dict = {
|
4881
4881
|
'market': market['id'],
|
4882
4882
|
'ccy': currency['id'],
|
4883
4883
|
}
|
@@ -4911,7 +4911,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4911
4911
|
:returns dict[]: a list of `borrow interest structures <https://docs.ccxt.com/#/?id=borrow-interest-structure>`
|
4912
4912
|
"""
|
4913
4913
|
await self.load_markets()
|
4914
|
-
request = {}
|
4914
|
+
request: dict = {}
|
4915
4915
|
market = None
|
4916
4916
|
if symbol is not None:
|
4917
4917
|
market = self.market(symbol)
|
@@ -4947,7 +4947,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4947
4947
|
interest = self.parse_borrow_interests(rows, market)
|
4948
4948
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
4949
4949
|
|
4950
|
-
def parse_borrow_interest(self, info, market: Market = None):
|
4950
|
+
def parse_borrow_interest(self, info: dict, market: Market = None):
|
4951
4951
|
#
|
4952
4952
|
# {
|
4953
4953
|
# "borrow_id": 2642934,
|
@@ -4995,7 +4995,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
4995
4995
|
currency = self.currency(code)
|
4996
4996
|
isAutoRenew = self.safe_bool_2(params, 'isAutoRenew', 'is_auto_renew', False)
|
4997
4997
|
params = self.omit(params, 'isAutoRenew')
|
4998
|
-
request = {
|
4998
|
+
request: dict = {
|
4999
4999
|
'market': market['id'],
|
5000
5000
|
'ccy': currency['id'],
|
5001
5001
|
'borrow_amount': self.currency_to_precision(code, amount),
|
@@ -5039,7 +5039,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5039
5039
|
await self.load_markets()
|
5040
5040
|
market = self.market(symbol)
|
5041
5041
|
currency = self.currency(code)
|
5042
|
-
request = {
|
5042
|
+
request: dict = {
|
5043
5043
|
'market': market['id'],
|
5044
5044
|
'ccy': currency['id'],
|
5045
5045
|
'amount': self.currency_to_precision(code, amount),
|
@@ -5085,143 +5085,176 @@ class coinex(Exchange, ImplicitAPI):
|
|
5085
5085
|
'info': info,
|
5086
5086
|
}
|
5087
5087
|
|
5088
|
-
async def
|
5088
|
+
async def fetch_deposit_withdraw_fee(self, code: str, params={}):
|
5089
5089
|
"""
|
5090
|
-
fetch
|
5091
|
-
:see: https://
|
5092
|
-
:param str
|
5090
|
+
fetch the fee for deposits and withdrawals
|
5091
|
+
:see: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-withdrawal-config
|
5092
|
+
:param str code: unified currency code
|
5093
5093
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5094
|
-
:returns dict
|
5094
|
+
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
5095
5095
|
"""
|
5096
5096
|
await self.load_markets()
|
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
|
-
#
|
5129
|
-
|
5097
|
+
currency = self.currency(code)
|
5098
|
+
request: dict = {
|
5099
|
+
'ccy': currency['id'],
|
5100
|
+
}
|
5101
|
+
response = await self.v2PrivateGetAssetsDepositWithdrawConfig(self.extend(request, params))
|
5102
|
+
#
|
5103
|
+
# {
|
5104
|
+
# "code": 0,
|
5105
|
+
# "data": {
|
5106
|
+
# "asset": {
|
5107
|
+
# "ccy": "USDT",
|
5108
|
+
# "deposit_enabled": True,
|
5109
|
+
# "withdraw_enabled": True,
|
5110
|
+
# "inter_transfer_enabled": True,
|
5111
|
+
# "is_st": False
|
5112
|
+
# },
|
5113
|
+
# "chains": [
|
5114
|
+
# {
|
5115
|
+
# "chain": "TRC20",
|
5116
|
+
# "min_deposit_amount": "2.4",
|
5117
|
+
# "min_withdraw_amount": "2.4",
|
5118
|
+
# "deposit_enabled": True,
|
5119
|
+
# "withdraw_enabled": True,
|
5120
|
+
# "deposit_delay_minutes": 0,
|
5121
|
+
# "safe_confirmations": 10,
|
5122
|
+
# "irreversible_confirmations": 20,
|
5123
|
+
# "deflation_rate": "0",
|
5124
|
+
# "withdrawal_fee": "2.4",
|
5125
|
+
# "withdrawal_precision": 6,
|
5126
|
+
# "memo": "",
|
5127
|
+
# "is_memo_required_for_deposit": False,
|
5128
|
+
# "explorer_asset_url": "https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
|
5129
|
+
# },
|
5130
|
+
# ]
|
5131
|
+
# },
|
5132
|
+
# "message": "OK"
|
5133
|
+
# }
|
5134
|
+
#
|
5135
|
+
data = self.safe_dict(response, 'data', {})
|
5136
|
+
return self.parse_deposit_withdraw_fee(data, currency)
|
5130
5137
|
|
5131
|
-
def
|
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
|
-
|
5162
|
-
|
5138
|
+
def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):
|
5139
|
+
#
|
5140
|
+
# {
|
5141
|
+
# "asset": {
|
5142
|
+
# "ccy": "USDT",
|
5143
|
+
# "deposit_enabled": True,
|
5144
|
+
# "withdraw_enabled": True,
|
5145
|
+
# "inter_transfer_enabled": True,
|
5146
|
+
# "is_st": False
|
5147
|
+
# },
|
5148
|
+
# "chains": [
|
5149
|
+
# {
|
5150
|
+
# "chain": "TRC20",
|
5151
|
+
# "min_deposit_amount": "2.4",
|
5152
|
+
# "min_withdraw_amount": "2.4",
|
5153
|
+
# "deposit_enabled": True,
|
5154
|
+
# "withdraw_enabled": True,
|
5155
|
+
# "deposit_delay_minutes": 0,
|
5156
|
+
# "safe_confirmations": 10,
|
5157
|
+
# "irreversible_confirmations": 20,
|
5158
|
+
# "deflation_rate": "0",
|
5159
|
+
# "withdrawal_fee": "2.4",
|
5160
|
+
# "withdrawal_precision": 6,
|
5161
|
+
# "memo": "",
|
5162
|
+
# "is_memo_required_for_deposit": False,
|
5163
|
+
# "explorer_asset_url": "https://tronscan.org/#/token20/TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t"
|
5164
|
+
# },
|
5165
|
+
# ]
|
5166
|
+
# }
|
5167
|
+
#
|
5168
|
+
result: dict = {
|
5169
|
+
'info': fee,
|
5170
|
+
'withdraw': {
|
5171
|
+
'fee': None,
|
5172
|
+
'percentage': None,
|
5173
|
+
},
|
5174
|
+
'deposit': {
|
5175
|
+
'fee': None,
|
5176
|
+
'percentage': None,
|
5177
|
+
},
|
5178
|
+
'networks': {},
|
5179
|
+
}
|
5180
|
+
chains = self.safe_list(fee, 'chains', [])
|
5181
|
+
asset = self.safe_dict(fee, 'asset', {})
|
5182
|
+
for i in range(0, len(chains)):
|
5183
|
+
entry = chains[i]
|
5184
|
+
isWithdrawEnabled = self.safe_bool(entry, 'withdraw_enabled')
|
5185
|
+
if isWithdrawEnabled:
|
5186
|
+
result['withdraw']['fee'] = self.safe_number(entry, 'withdrawal_fee')
|
5187
|
+
result['withdraw']['percentage'] = False
|
5188
|
+
networkId = self.safe_string(entry, 'chain')
|
5189
|
+
if networkId:
|
5190
|
+
networkCode = self.network_id_to_code(networkId, self.safe_string(asset, 'ccy'))
|
5191
|
+
result['networks'][networkCode] = {
|
5192
|
+
'withdraw': {
|
5193
|
+
'fee': self.safe_number(entry, 'withdrawal_fee'),
|
5194
|
+
'percentage': False,
|
5195
|
+
},
|
5196
|
+
'deposit': {
|
5197
|
+
'fee': None,
|
5198
|
+
'percentage': None,
|
5199
|
+
},
|
5163
5200
|
}
|
5164
|
-
|
5165
|
-
depositWithdrawFees[code]['withdraw'] = withdrawResult
|
5166
|
-
depositWithdrawFees[code]['deposit'] = depositResult
|
5167
|
-
depositWithdrawCodes = list(depositWithdrawFees.keys())
|
5168
|
-
for i in range(0, len(depositWithdrawCodes)):
|
5169
|
-
code = depositWithdrawCodes[i]
|
5170
|
-
currency = self.currency(code)
|
5171
|
-
depositWithdrawFees[code] = self.assign_default_deposit_withdraw_fees(depositWithdrawFees[code], currency)
|
5172
|
-
return depositWithdrawFees
|
5201
|
+
return result
|
5173
5202
|
|
5174
|
-
async def
|
5203
|
+
async def fetch_leverage(self, symbol: str, params={}) -> Leverage:
|
5175
5204
|
"""
|
5176
|
-
fetch the set leverage for
|
5177
|
-
:see: https://
|
5178
|
-
:param str
|
5205
|
+
fetch the set leverage for a market
|
5206
|
+
:see: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-interest-limit
|
5207
|
+
:param str symbol: unified market symbol
|
5179
5208
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
5180
|
-
:
|
5209
|
+
:param str params['code']: unified currency code
|
5210
|
+
:returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
|
5181
5211
|
"""
|
5182
5212
|
await self.load_markets()
|
5183
|
-
|
5184
|
-
|
5185
|
-
|
5186
|
-
|
5187
|
-
|
5188
|
-
|
5189
|
-
|
5190
|
-
|
5191
|
-
|
5192
|
-
|
5213
|
+
code = self.safe_string(params, 'code')
|
5214
|
+
if code is None:
|
5215
|
+
raise ArgumentsRequired(self.id + ' fetchLeverage() requires a code parameter')
|
5216
|
+
params = self.omit(params, 'code')
|
5217
|
+
currency = self.currency(code)
|
5218
|
+
market = self.market(symbol)
|
5219
|
+
request: dict = {
|
5220
|
+
'market': market['id'],
|
5221
|
+
'ccy': currency['id'],
|
5222
|
+
}
|
5223
|
+
response = await self.v2PrivateGetAssetsMarginInterestLimit(self.extend(request, params))
|
5193
5224
|
#
|
5194
5225
|
# {
|
5195
5226
|
# "code": 0,
|
5196
|
-
# "data":
|
5197
|
-
#
|
5198
|
-
#
|
5199
|
-
#
|
5200
|
-
#
|
5201
|
-
#
|
5202
|
-
#
|
5203
|
-
#
|
5204
|
-
#
|
5205
|
-
# "USDT": {
|
5206
|
-
# "min_amount": "50",
|
5207
|
-
# "max_amount": "500000",
|
5208
|
-
# "day_rate": "0.001"
|
5209
|
-
# }
|
5210
|
-
# },
|
5211
|
-
# ],
|
5212
|
-
# "message": "Success"
|
5227
|
+
# "data": {
|
5228
|
+
# "market": "BTCUSDT",
|
5229
|
+
# "ccy": "USDT",
|
5230
|
+
# "leverage": 10,
|
5231
|
+
# "min_amount": "50",
|
5232
|
+
# "max_amount": "500000",
|
5233
|
+
# "daily_interest_rate": "0.001"
|
5234
|
+
# },
|
5235
|
+
# "message": "OK"
|
5213
5236
|
# }
|
5214
5237
|
#
|
5215
|
-
|
5216
|
-
return self.
|
5238
|
+
data = self.safe_dict(response, 'data', {})
|
5239
|
+
return self.parse_leverage(data, market)
|
5217
5240
|
|
5218
5241
|
def parse_leverage(self, leverage: dict, market: Market = None) -> Leverage:
|
5242
|
+
#
|
5243
|
+
# {
|
5244
|
+
# "market": "BTCUSDT",
|
5245
|
+
# "ccy": "USDT",
|
5246
|
+
# "leverage": 10,
|
5247
|
+
# "min_amount": "50",
|
5248
|
+
# "max_amount": "500000",
|
5249
|
+
# "daily_interest_rate": "0.001"
|
5250
|
+
# }
|
5251
|
+
#
|
5219
5252
|
marketId = self.safe_string(leverage, 'market')
|
5220
5253
|
leverageValue = self.safe_integer(leverage, 'leverage')
|
5221
5254
|
return {
|
5222
5255
|
'info': leverage,
|
5223
5256
|
'symbol': self.safe_symbol(marketId, market, None, 'spot'),
|
5224
|
-
'marginMode':
|
5257
|
+
'marginMode': 'isolated',
|
5225
5258
|
'longLeverage': leverageValue,
|
5226
5259
|
'shortLeverage': leverageValue,
|
5227
5260
|
}
|
@@ -5239,7 +5272,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5239
5272
|
"""
|
5240
5273
|
await self.load_markets()
|
5241
5274
|
market = self.market(symbol)
|
5242
|
-
request = {
|
5275
|
+
request: dict = {
|
5243
5276
|
'market_type': 'FUTURES',
|
5244
5277
|
'market': market['id'],
|
5245
5278
|
}
|
@@ -5442,7 +5475,7 @@ class coinex(Exchange, ImplicitAPI):
|
|
5442
5475
|
if positionId is None:
|
5443
5476
|
raise ArgumentsRequired(self.id + ' fetchMarginAdjustmentHistory() requires a positionId parameter')
|
5444
5477
|
market = self.market(symbol)
|
5445
|
-
request = {
|
5478
|
+
request: dict = {
|
5446
5479
|
'market': market['id'],
|
5447
5480
|
'market_type': 'FUTURES',
|
5448
5481
|
'position_id': positionId,
|