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/digifinex.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.digifinex import ImplicitAPI
|
|
8
8
|
import asyncio
|
9
9
|
import hashlib
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry, TransferEntries
|
11
|
+
from ccxt.base.types import Balances, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry, TransferEntries
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import AuthenticationError
|
@@ -411,7 +411,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
411
411
|
# }
|
412
412
|
#
|
413
413
|
data = self.safe_value(response, 'data', [])
|
414
|
-
result = {}
|
414
|
+
result: dict = {}
|
415
415
|
for i in range(0, len(data)):
|
416
416
|
currency = data[i]
|
417
417
|
id = self.safe_string(currency, 'currency')
|
@@ -434,7 +434,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
434
434
|
networkCode = None
|
435
435
|
if networkId is not None:
|
436
436
|
networkCode = self.network_id_to_code(networkId)
|
437
|
-
network = {
|
437
|
+
network: dict = {
|
438
438
|
'info': currency,
|
439
439
|
'id': networkId,
|
440
440
|
'network': networkCode,
|
@@ -789,7 +789,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
789
789
|
# "time_stamp": 1661487402396
|
790
790
|
# }
|
791
791
|
#
|
792
|
-
result = {'info': response}
|
792
|
+
result: dict = {'info': response}
|
793
793
|
for i in range(0, len(response)):
|
794
794
|
balance = response[i]
|
795
795
|
currencyId = self.safe_string(balance, 'currency')
|
@@ -879,7 +879,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
879
879
|
await self.load_markets()
|
880
880
|
market = self.market(symbol)
|
881
881
|
marketType, query = self.handle_market_type_and_params('fetchOrderBook', market, params)
|
882
|
-
request = {}
|
882
|
+
request: dict = {}
|
883
883
|
if limit is not None:
|
884
884
|
request['limit'] = limit
|
885
885
|
response = None
|
@@ -954,7 +954,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
954
954
|
market = self.market(first)
|
955
955
|
type = None
|
956
956
|
type, params = self.handle_market_type_and_params('fetchTickers', market, params)
|
957
|
-
request = {}
|
957
|
+
request: dict = {}
|
958
958
|
response = None
|
959
959
|
if type == 'swap':
|
960
960
|
response = await self.publicSwapGetPublicTickers(self.extend(request, params))
|
@@ -1008,7 +1008,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1008
1008
|
# ]
|
1009
1009
|
# }
|
1010
1010
|
#
|
1011
|
-
result = {}
|
1011
|
+
result: dict = {}
|
1012
1012
|
tickers = self.safe_value_2(response, 'ticker', 'data', [])
|
1013
1013
|
date = self.safe_integer(response, 'date')
|
1014
1014
|
for i in range(0, len(tickers)):
|
@@ -1031,7 +1031,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1031
1031
|
"""
|
1032
1032
|
await self.load_markets()
|
1033
1033
|
market = self.market(symbol)
|
1034
|
-
request = {}
|
1034
|
+
request: dict = {}
|
1035
1035
|
response = None
|
1036
1036
|
if market['swap']:
|
1037
1037
|
request['instrument_id'] = market['id']
|
@@ -1167,7 +1167,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1167
1167
|
'info': ticker,
|
1168
1168
|
}, market)
|
1169
1169
|
|
1170
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1170
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1171
1171
|
#
|
1172
1172
|
# spot: fetchTrades
|
1173
1173
|
#
|
@@ -1346,7 +1346,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1346
1346
|
"""
|
1347
1347
|
await self.load_markets()
|
1348
1348
|
market = self.market(symbol)
|
1349
|
-
request = {}
|
1349
|
+
request: dict = {}
|
1350
1350
|
if limit is not None:
|
1351
1351
|
request['limit'] = min(limit, 100) if market['swap'] else limit
|
1352
1352
|
response = None
|
@@ -1444,7 +1444,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1444
1444
|
"""
|
1445
1445
|
await self.load_markets()
|
1446
1446
|
market = self.market(symbol)
|
1447
|
-
request = {}
|
1447
|
+
request: dict = {}
|
1448
1448
|
response = None
|
1449
1449
|
if market['swap']:
|
1450
1450
|
request['instrument_id'] = market['id']
|
@@ -1593,7 +1593,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1593
1593
|
orderRequest = self.create_order_request(marketId, type, side, amount, price, orderParams)
|
1594
1594
|
ordersRequests.append(orderRequest)
|
1595
1595
|
market = self.market(symbol)
|
1596
|
-
request = {}
|
1596
|
+
request: dict = {}
|
1597
1597
|
response = None
|
1598
1598
|
if market['swap']:
|
1599
1599
|
response = await self.privateSwapPostTradeBatchOrder(ordersRequests)
|
@@ -1631,7 +1631,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1631
1631
|
result = []
|
1632
1632
|
for i in range(0, len(orders)):
|
1633
1633
|
rawOrder = orders[i]
|
1634
|
-
individualOrder = {}
|
1634
|
+
individualOrder: dict = {}
|
1635
1635
|
individualOrder['order_id'] = data[i]
|
1636
1636
|
individualOrder['instrument_id'] = market['id']
|
1637
1637
|
individualOrder['amount'] = self.safe_number(rawOrder, 'amount')
|
@@ -1658,7 +1658,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1658
1658
|
marginMode, params = self.handle_margin_mode_and_params('createOrderRequest', params)
|
1659
1659
|
if marginMode is not None:
|
1660
1660
|
marketType = 'margin'
|
1661
|
-
request = {}
|
1661
|
+
request: dict = {}
|
1662
1662
|
swap = (marketType == 'swap')
|
1663
1663
|
isMarketOrder = (type == 'market')
|
1664
1664
|
isLimitOrder = (type == 'limit')
|
@@ -1763,7 +1763,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1763
1763
|
id = str(id)
|
1764
1764
|
marketType = None
|
1765
1765
|
marketType, params = self.handle_market_type_and_params('cancelOrder', market, params)
|
1766
|
-
request = {
|
1766
|
+
request: dict = {
|
1767
1767
|
'order_id': id,
|
1768
1768
|
}
|
1769
1769
|
if marketType == 'swap':
|
@@ -1823,7 +1823,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1823
1823
|
defaultType = self.safe_string(self.options, 'defaultType', 'spot')
|
1824
1824
|
orderType = self.safe_string(params, 'type', defaultType)
|
1825
1825
|
params = self.omit(params, 'type')
|
1826
|
-
request = {
|
1826
|
+
request: dict = {
|
1827
1827
|
'market': orderType,
|
1828
1828
|
'order_id': ','.join(ids),
|
1829
1829
|
}
|
@@ -1846,8 +1846,8 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1846
1846
|
raise OrderNotFound(self.id + ' cancelOrders() error')
|
1847
1847
|
return response
|
1848
1848
|
|
1849
|
-
def parse_order_status(self, status):
|
1850
|
-
statuses = {
|
1849
|
+
def parse_order_status(self, status: Str):
|
1850
|
+
statuses: dict = {
|
1851
1851
|
'0': 'open',
|
1852
1852
|
'1': 'open', # partially filled
|
1853
1853
|
'2': 'closed',
|
@@ -1856,7 +1856,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
1856
1856
|
}
|
1857
1857
|
return self.safe_string(statuses, status, status)
|
1858
1858
|
|
1859
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
1859
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
1860
1860
|
#
|
1861
1861
|
# spot: createOrder
|
1862
1862
|
#
|
@@ -2007,7 +2007,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2007
2007
|
marketType = None
|
2008
2008
|
marketType, params = self.handle_market_type_and_params('fetchOpenOrders', market, params)
|
2009
2009
|
marginMode, query = self.handle_margin_mode_and_params('fetchOpenOrders', params)
|
2010
|
-
request = {}
|
2010
|
+
request: dict = {}
|
2011
2011
|
swap = (marketType == 'swap')
|
2012
2012
|
if swap:
|
2013
2013
|
if since is not None:
|
@@ -2101,7 +2101,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2101
2101
|
marketType = None
|
2102
2102
|
marketType, params = self.handle_market_type_and_params('fetchOrders', market, params)
|
2103
2103
|
marginMode, query = self.handle_margin_mode_and_params('fetchOrders', params)
|
2104
|
-
request = {}
|
2104
|
+
request: dict = {}
|
2105
2105
|
if marketType == 'swap':
|
2106
2106
|
if since is not None:
|
2107
2107
|
request['start_timestamp'] = since
|
@@ -2195,7 +2195,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2195
2195
|
marketType = None
|
2196
2196
|
marketType, params = self.handle_market_type_and_params('fetchOrder', market, params)
|
2197
2197
|
marginMode, query = self.handle_margin_mode_and_params('fetchOrder', params)
|
2198
|
-
request = {
|
2198
|
+
request: dict = {
|
2199
2199
|
'order_id': id,
|
2200
2200
|
}
|
2201
2201
|
if marketType == 'swap':
|
@@ -2280,7 +2280,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2280
2280
|
"""
|
2281
2281
|
await self.load_markets()
|
2282
2282
|
market = None
|
2283
|
-
request = {}
|
2283
|
+
request: dict = {}
|
2284
2284
|
if symbol is not None:
|
2285
2285
|
market = self.market(symbol)
|
2286
2286
|
marketType = None
|
@@ -2358,10 +2358,10 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2358
2358
|
return self.parse_trades(data, market, since, limit)
|
2359
2359
|
|
2360
2360
|
def parse_ledger_entry_type(self, type):
|
2361
|
-
types = {}
|
2361
|
+
types: dict = {}
|
2362
2362
|
return self.safe_string(types, type, type)
|
2363
2363
|
|
2364
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
2364
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2365
2365
|
#
|
2366
2366
|
# spot and margin
|
2367
2367
|
#
|
@@ -2419,7 +2419,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2419
2419
|
:returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
|
2420
2420
|
"""
|
2421
2421
|
await self.load_markets()
|
2422
|
-
request = {}
|
2422
|
+
request: dict = {}
|
2423
2423
|
marketType = None
|
2424
2424
|
marketType, params = self.handle_market_type_and_params('fetchLedger', None, params)
|
2425
2425
|
marginMode, query = self.handle_margin_mode_and_params('fetchLedger', params)
|
@@ -2518,7 +2518,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2518
2518
|
"""
|
2519
2519
|
await self.load_markets()
|
2520
2520
|
currency = self.currency(code)
|
2521
|
-
request = {
|
2521
|
+
request: dict = {
|
2522
2522
|
'currency': currency['id'],
|
2523
2523
|
}
|
2524
2524
|
response = await self.privateSpotGetDepositAddress(self.extend(request, params))
|
@@ -2545,7 +2545,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2545
2545
|
async def fetch_transactions_by_type(self, type, code: Str = None, since: Int = None, limit: Int = None, params={}):
|
2546
2546
|
await self.load_markets()
|
2547
2547
|
currency = None
|
2548
|
-
request = {
|
2548
|
+
request: dict = {
|
2549
2549
|
# 'currency': currency['id'],
|
2550
2550
|
# 'from': 'fromId', # When direct is' prev ', from is 1, returning from old to new ascending, when direct is' next ', from is the ID of the most recent record, returned from the old descending order
|
2551
2551
|
# 'size': 100, # default 100, max 500
|
@@ -2609,7 +2609,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2609
2609
|
def parse_transaction_status(self, status):
|
2610
2610
|
# deposit state includes: 1(in deposit), 2(to be confirmed), 3(successfully deposited), 4(stopped)
|
2611
2611
|
# withdrawal state includes: 1(application in progress), 2(to be confirmed), 3(completed), 4(rejected)
|
2612
|
-
statuses = {
|
2612
|
+
statuses: dict = {
|
2613
2613
|
'1': 'pending', # in Progress
|
2614
2614
|
'2': 'pending', # to be confirmed
|
2615
2615
|
'3': 'ok', # Completed
|
@@ -2617,7 +2617,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2617
2617
|
}
|
2618
2618
|
return self.safe_string(statuses, status, status)
|
2619
2619
|
|
2620
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
2620
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
2621
2621
|
#
|
2622
2622
|
# withdraw
|
2623
2623
|
#
|
@@ -2681,7 +2681,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2681
2681
|
}
|
2682
2682
|
|
2683
2683
|
def parse_transfer_status(self, status: Str) -> Str:
|
2684
|
-
statuses = {
|
2684
|
+
statuses: dict = {
|
2685
2685
|
'0': 'ok',
|
2686
2686
|
}
|
2687
2687
|
return self.safe_string(statuses, status, status)
|
@@ -2741,7 +2741,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2741
2741
|
accountsByType = self.safe_value(self.options, 'accountsByType', {})
|
2742
2742
|
fromId = self.safe_string(accountsByType, fromAccount, fromAccount)
|
2743
2743
|
toId = self.safe_string(accountsByType, toAccount, toAccount)
|
2744
|
-
request = {
|
2744
|
+
request: dict = {
|
2745
2745
|
'currency_mark': currency['id'],
|
2746
2746
|
'num': self.currency_to_precision(code, amount),
|
2747
2747
|
'from': fromId, # 1 = SPOT, 2 = MARGIN, 3 = OTC
|
@@ -2769,7 +2769,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2769
2769
|
self.check_address(address)
|
2770
2770
|
await self.load_markets()
|
2771
2771
|
currency = self.currency(code)
|
2772
|
-
request = {
|
2772
|
+
request: dict = {
|
2773
2773
|
# 'chain': 'ERC20', 'OMNI', 'TRC20', # required for USDT
|
2774
2774
|
'address': address,
|
2775
2775
|
'amount': self.currency_to_precision(code, amount),
|
@@ -2788,7 +2788,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2788
2788
|
|
2789
2789
|
async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
2790
2790
|
await self.load_markets()
|
2791
|
-
request = {}
|
2791
|
+
request: dict = {}
|
2792
2792
|
market = None
|
2793
2793
|
if symbol is not None:
|
2794
2794
|
market = self.market(symbol)
|
@@ -2819,7 +2819,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2819
2819
|
interest = self.parse_borrow_interests(rows, market)
|
2820
2820
|
return self.filter_by_currency_since_limit(interest, code, since, limit)
|
2821
2821
|
|
2822
|
-
def parse_borrow_interest(self, info, market: Market = None):
|
2822
|
+
def parse_borrow_interest(self, info: dict, market: Market = None):
|
2823
2823
|
#
|
2824
2824
|
# {
|
2825
2825
|
# "amount": 0.0006103,
|
@@ -2861,7 +2861,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2861
2861
|
:returns dict: a `borrow rate structure <https://github.com/ccxt/ccxt/wiki/Manual#borrow-rate-structure>`
|
2862
2862
|
"""
|
2863
2863
|
await self.load_markets()
|
2864
|
-
request = {}
|
2864
|
+
request: dict = {}
|
2865
2865
|
response = await self.privateSpotGetMarginAssets(self.extend(request, params))
|
2866
2866
|
#
|
2867
2867
|
# {
|
@@ -2947,7 +2947,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2947
2947
|
# "currency": "USDT"
|
2948
2948
|
# },
|
2949
2949
|
#
|
2950
|
-
result = {}
|
2950
|
+
result: dict = {}
|
2951
2951
|
for i in range(0, len(info)):
|
2952
2952
|
item = info[i]
|
2953
2953
|
currency = self.safe_string(item, codeKey)
|
@@ -2968,7 +2968,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
2968
2968
|
market = self.market(symbol)
|
2969
2969
|
if not market['swap']:
|
2970
2970
|
raise BadSymbol(self.id + ' fetchFundingRate() supports swap contracts only')
|
2971
|
-
request = {
|
2971
|
+
request: dict = {
|
2972
2972
|
'instrument_id': market['id'],
|
2973
2973
|
}
|
2974
2974
|
response = await self.publicSwapGetPublicFundingRate(self.extend(request, params))
|
@@ -3035,7 +3035,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3035
3035
|
market = self.market(symbol)
|
3036
3036
|
if not market['swap']:
|
3037
3037
|
raise BadSymbol(self.id + ' fetchFundingRateHistory() supports swap contracts only')
|
3038
|
-
request = {
|
3038
|
+
request: dict = {
|
3039
3039
|
'instrument_id': market['id'],
|
3040
3040
|
}
|
3041
3041
|
if since is not None:
|
@@ -3088,7 +3088,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3088
3088
|
market = self.market(symbol)
|
3089
3089
|
if not market['swap']:
|
3090
3090
|
raise BadRequest(self.id + ' fetchTradingFee() supports swap markets only')
|
3091
|
-
request = {
|
3091
|
+
request: dict = {
|
3092
3092
|
'instrument_id': market['id'],
|
3093
3093
|
}
|
3094
3094
|
response = await self.privateSwapGetAccountTradingFeeRate(self.extend(request, params))
|
@@ -3105,7 +3105,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3105
3105
|
data = self.safe_value(response, 'data', {})
|
3106
3106
|
return self.parse_trading_fee(data, market)
|
3107
3107
|
|
3108
|
-
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
3108
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
3109
3109
|
#
|
3110
3110
|
# {
|
3111
3111
|
# "instrument_id": "BTCUSDTPERP",
|
@@ -3135,7 +3135,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3135
3135
|
"""
|
3136
3136
|
await self.load_markets()
|
3137
3137
|
symbols = self.market_symbols(symbols)
|
3138
|
-
request = {}
|
3138
|
+
request: dict = {}
|
3139
3139
|
market = None
|
3140
3140
|
marketType = None
|
3141
3141
|
if symbols is not None:
|
@@ -3233,7 +3233,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3233
3233
|
"""
|
3234
3234
|
await self.load_markets()
|
3235
3235
|
market = self.market(symbol)
|
3236
|
-
request = {}
|
3236
|
+
request: dict = {}
|
3237
3237
|
marketType = None
|
3238
3238
|
marketType, params = self.handle_market_type_and_params('fetchPosition', market, params)
|
3239
3239
|
marginMode, query = self.handle_margin_mode_and_params('fetchPosition', params)
|
@@ -3309,7 +3309,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3309
3309
|
position['marginRatio'] = self.safe_number(response, 'margin_rate')
|
3310
3310
|
return position
|
3311
3311
|
|
3312
|
-
def parse_position(self, position, market: Market = None):
|
3312
|
+
def parse_position(self, position: dict, market: Market = None):
|
3313
3313
|
#
|
3314
3314
|
# swap
|
3315
3315
|
#
|
@@ -3409,7 +3409,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3409
3409
|
raise BadSymbol(self.id + ' setLeverage() supports swap contracts only')
|
3410
3410
|
if (leverage < 1) or (leverage > 100):
|
3411
3411
|
raise BadRequest(self.id + ' leverage should be between 1 and 100')
|
3412
|
-
request = {
|
3412
|
+
request: dict = {
|
3413
3413
|
'instrument_id': market['id'],
|
3414
3414
|
'leverage': leverage,
|
3415
3415
|
}
|
@@ -3451,7 +3451,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3451
3451
|
"""
|
3452
3452
|
await self.load_markets()
|
3453
3453
|
currency = None
|
3454
|
-
request = {}
|
3454
|
+
request: dict = {}
|
3455
3455
|
if code is not None:
|
3456
3456
|
currency = self.safe_currency_code(code)
|
3457
3457
|
request['currency'] = currency['id']
|
@@ -3478,7 +3478,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3478
3478
|
transfers = self.safe_list(response, 'data', [])
|
3479
3479
|
return self.parse_transfers(transfers, currency, since, limit)
|
3480
3480
|
|
3481
|
-
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
3481
|
+
async def fetch_leverage_tiers(self, symbols: Strings = None, params={}) -> LeverageTiers:
|
3482
3482
|
"""
|
3483
3483
|
:see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#instruments
|
3484
3484
|
retrieve information on the maximum leverage, for different trade sizes
|
@@ -3521,7 +3521,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3521
3521
|
symbols = self.market_symbols(symbols)
|
3522
3522
|
return self.parse_leverage_tiers(data, symbols, 'instrument_id')
|
3523
3523
|
|
3524
|
-
async def fetch_market_leverage_tiers(self, symbol: str, params={}):
|
3524
|
+
async def fetch_market_leverage_tiers(self, symbol: str, params={}) -> List[LeverageTier]:
|
3525
3525
|
"""
|
3526
3526
|
:see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#instrument
|
3527
3527
|
retrieve information on the maximum leverage, for different trade sizes for a single market
|
@@ -3533,7 +3533,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3533
3533
|
market = self.market(symbol)
|
3534
3534
|
if not market['swap']:
|
3535
3535
|
raise BadRequest(self.id + ' fetchMarketLeverageTiers() supports swap markets only')
|
3536
|
-
request = {
|
3536
|
+
request: dict = {
|
3537
3537
|
'instrument_id': market['id'],
|
3538
3538
|
}
|
3539
3539
|
response = await self.publicSwapGetPublicInstrument(self.extend(request, params))
|
@@ -3567,7 +3567,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3567
3567
|
data = self.safe_value(response, 'data', {})
|
3568
3568
|
return self.parse_market_leverage_tiers(data, market)
|
3569
3569
|
|
3570
|
-
def parse_market_leverage_tiers(self, info, market: Market = None):
|
3570
|
+
def parse_market_leverage_tiers(self, info, market: Market = None) -> List[LeverageTier]:
|
3571
3571
|
#
|
3572
3572
|
# {
|
3573
3573
|
# "instrument_id": "BTCUSDTPERP",
|
@@ -3697,7 +3697,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3697
3697
|
# },
|
3698
3698
|
# ]
|
3699
3699
|
#
|
3700
|
-
depositWithdrawFees = {}
|
3700
|
+
depositWithdrawFees: dict = {}
|
3701
3701
|
codes = self.market_codes(codes)
|
3702
3702
|
for i in range(0, len(response)):
|
3703
3703
|
entry = response[i]
|
@@ -3711,11 +3711,11 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3711
3711
|
depositWithdrawFees[code]['info'].append(entry)
|
3712
3712
|
networkId = self.safe_string(entry, 'chain')
|
3713
3713
|
withdrawFee = self.safe_value(entry, 'min_withdraw_fee')
|
3714
|
-
withdrawResult = {
|
3714
|
+
withdrawResult: dict = {
|
3715
3715
|
'fee': withdrawFee,
|
3716
3716
|
'percentage': False if (withdrawFee is not None) else None,
|
3717
3717
|
}
|
3718
|
-
depositResult = {
|
3718
|
+
depositResult: dict = {
|
3719
3719
|
'fee': None,
|
3720
3720
|
'percentage': None,
|
3721
3721
|
}
|
@@ -3767,7 +3767,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3767
3767
|
await self.load_markets()
|
3768
3768
|
side = self.safe_string(params, 'side')
|
3769
3769
|
market = self.market(symbol)
|
3770
|
-
request = {
|
3770
|
+
request: dict = {
|
3771
3771
|
'instrument_id': market['id'],
|
3772
3772
|
'amount': self.number_to_string(amount),
|
3773
3773
|
'type': type,
|
@@ -3828,7 +3828,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3828
3828
|
:returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
|
3829
3829
|
"""
|
3830
3830
|
await self.load_markets()
|
3831
|
-
request = {}
|
3831
|
+
request: dict = {}
|
3832
3832
|
request, params = self.handle_until_option('end_timestamp', request, params)
|
3833
3833
|
market = None
|
3834
3834
|
if symbol is not None:
|
@@ -3893,7 +3893,7 @@ class digifinex(Exchange, ImplicitAPI):
|
|
3893
3893
|
marginMode = marginMode.lower()
|
3894
3894
|
if marginMode == 'cross':
|
3895
3895
|
marginMode = 'crossed'
|
3896
|
-
request = {
|
3896
|
+
request: dict = {
|
3897
3897
|
'instrument_id': market['id'],
|
3898
3898
|
'margin_mode': marginMode,
|
3899
3899
|
}
|