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/zonda.py
CHANGED
@@ -419,12 +419,12 @@ class zonda(Exchange, ImplicitAPI):
|
|
419
419
|
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
420
420
|
"""
|
421
421
|
await self.load_markets()
|
422
|
-
request = {}
|
422
|
+
request: dict = {}
|
423
423
|
response = await self.v1_01PrivateGetTradingOffer(self.extend(request, params))
|
424
424
|
items = self.safe_list(response, 'items', [])
|
425
425
|
return self.parse_orders(items, None, since, limit, {'status': 'open'})
|
426
426
|
|
427
|
-
def parse_order(self, order, market: Market = None) -> Order:
|
427
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
428
428
|
#
|
429
429
|
# {
|
430
430
|
# "market": "ETH-EUR",
|
@@ -485,12 +485,12 @@ class zonda(Exchange, ImplicitAPI):
|
|
485
485
|
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
486
486
|
"""
|
487
487
|
await self.load_markets()
|
488
|
-
request = {}
|
488
|
+
request: dict = {}
|
489
489
|
if symbol:
|
490
490
|
markets = [self.market_id(symbol)]
|
491
491
|
symbol = self.symbol(symbol)
|
492
492
|
request['markets'] = markets
|
493
|
-
query = {'query': self.json(self.extend(request, params))}
|
493
|
+
query: dict = {'query': self.json(self.extend(request, params))}
|
494
494
|
response = await self.v1_01PrivateGetTradingHistoryTransactions(query)
|
495
495
|
#
|
496
496
|
# {
|
@@ -522,7 +522,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
522
522
|
balances = self.safe_value(response, 'balances')
|
523
523
|
if balances is None:
|
524
524
|
raise ExchangeError(self.id + ' empty balance response ' + self.json(response))
|
525
|
-
result = {'info': response}
|
525
|
+
result: dict = {'info': response}
|
526
526
|
for i in range(0, len(balances)):
|
527
527
|
balance = balances[i]
|
528
528
|
currencyId = self.safe_string(balance, 'currency')
|
@@ -555,7 +555,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
555
555
|
"""
|
556
556
|
await self.load_markets()
|
557
557
|
market = self.market(symbol)
|
558
|
-
request = {
|
558
|
+
request: dict = {
|
559
559
|
'symbol': market['id'],
|
560
560
|
}
|
561
561
|
response = await self.v1_01PublicGetTradingOrderbookSymbol(self.extend(request, params))
|
@@ -665,7 +665,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
665
665
|
"""
|
666
666
|
await self.load_markets()
|
667
667
|
market = self.market(symbol)
|
668
|
-
request = {
|
668
|
+
request: dict = {
|
669
669
|
'symbol': market['id'],
|
670
670
|
}
|
671
671
|
method = 'v1_01PublicGetTradingTickerSymbol'
|
@@ -805,7 +805,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
805
805
|
if code is not None:
|
806
806
|
currency = self.currency(code)
|
807
807
|
balanceCurrencies.append(currency['id'])
|
808
|
-
request = {
|
808
|
+
request: dict = {
|
809
809
|
'balanceCurrencies': balanceCurrencies,
|
810
810
|
}
|
811
811
|
if since is not None:
|
@@ -817,7 +817,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
817
817
|
items = response['items']
|
818
818
|
return self.parse_ledger(items, None, since, limit)
|
819
819
|
|
820
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
820
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
821
821
|
#
|
822
822
|
# FUNDS_MIGRATION
|
823
823
|
# {
|
@@ -1117,7 +1117,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1117
1117
|
}
|
1118
1118
|
|
1119
1119
|
def parse_ledger_entry_type(self, type):
|
1120
|
-
types = {
|
1120
|
+
types: dict = {
|
1121
1121
|
'ADD_FUNDS': 'transaction',
|
1122
1122
|
'BITCOIN_GOLD_FORK': 'transaction',
|
1123
1123
|
'CREATE_BALANCE': 'transaction',
|
@@ -1173,7 +1173,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1173
1173
|
await self.load_markets()
|
1174
1174
|
market = self.market(symbol)
|
1175
1175
|
tradingSymbol = market['baseId'] + '-' + market['quoteId']
|
1176
|
-
request = {
|
1176
|
+
request: dict = {
|
1177
1177
|
'symbol': tradingSymbol,
|
1178
1178
|
'resolution': self.safe_string(self.timeframes, timeframe, timeframe),
|
1179
1179
|
# 'from': 1574709092000, # unix timestamp in milliseconds, required
|
@@ -1205,7 +1205,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1205
1205
|
items = self.safe_list(response, 'items', [])
|
1206
1206
|
return self.parse_ohlcvs(items, market, timeframe, since, limit)
|
1207
1207
|
|
1208
|
-
def parse_trade(self, trade, market: Market = None) -> Trade:
|
1208
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
1209
1209
|
#
|
1210
1210
|
# createOrder trades
|
1211
1211
|
#
|
@@ -1292,7 +1292,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1292
1292
|
await self.load_markets()
|
1293
1293
|
market = self.market(symbol)
|
1294
1294
|
tradingSymbol = market['baseId'] + '-' + market['quoteId']
|
1295
|
-
request = {
|
1295
|
+
request: dict = {
|
1296
1296
|
'symbol': tradingSymbol,
|
1297
1297
|
}
|
1298
1298
|
if since is not None:
|
@@ -1318,7 +1318,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1318
1318
|
market = self.market(symbol)
|
1319
1319
|
tradingSymbol = market['baseId'] + '-' + market['quoteId']
|
1320
1320
|
amount = float(self.amount_to_precision(symbol, amount))
|
1321
|
-
request = {
|
1321
|
+
request: dict = {
|
1322
1322
|
'symbol': tradingSymbol,
|
1323
1323
|
'offerType': side.upper(),
|
1324
1324
|
'amount': amount,
|
@@ -1443,7 +1443,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1443
1443
|
await self.load_markets()
|
1444
1444
|
market = self.market(symbol)
|
1445
1445
|
tradingSymbol = market['baseId'] + '-' + market['quoteId']
|
1446
|
-
request = {
|
1446
|
+
request: dict = {
|
1447
1447
|
'symbol': tradingSymbol,
|
1448
1448
|
'id': id,
|
1449
1449
|
'side': side,
|
@@ -1454,7 +1454,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1454
1454
|
return await self.v1_01PrivateDeleteTradingOfferSymbolIdSidePrice(self.extend(request, params))
|
1455
1455
|
|
1456
1456
|
def is_fiat(self, currency):
|
1457
|
-
fiatCurrencies = {
|
1457
|
+
fiatCurrencies: dict = {
|
1458
1458
|
'USD': True,
|
1459
1459
|
'EUR': True,
|
1460
1460
|
'PLN': True,
|
@@ -1493,7 +1493,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1493
1493
|
"""
|
1494
1494
|
await self.load_markets()
|
1495
1495
|
currency = self.currency(code)
|
1496
|
-
request = {
|
1496
|
+
request: dict = {
|
1497
1497
|
'currency': currency['id'],
|
1498
1498
|
}
|
1499
1499
|
response = await self.v1_01PrivateGetApiPaymentsDepositsCryptoAddresses(self.extend(request, params))
|
@@ -1514,7 +1514,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1514
1514
|
first = self.safe_dict(data, 0)
|
1515
1515
|
return self.parse_deposit_address(first, currency)
|
1516
1516
|
|
1517
|
-
async def fetch_deposit_addresses(self, codes:
|
1517
|
+
async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
|
1518
1518
|
"""
|
1519
1519
|
:see: https://docs.zondacrypto.exchange/reference/deposit-addresses-for-crypto
|
1520
1520
|
fetch deposit addresses for multiple currencies and chain types
|
@@ -1553,7 +1553,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1553
1553
|
"""
|
1554
1554
|
await self.load_markets()
|
1555
1555
|
currency = self.currency(code)
|
1556
|
-
request = {
|
1556
|
+
request: dict = {
|
1557
1557
|
'source': fromAccount,
|
1558
1558
|
'destination': toAccount,
|
1559
1559
|
'currency': code,
|
@@ -1643,7 +1643,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1643
1643
|
}
|
1644
1644
|
|
1645
1645
|
def parse_transfer_status(self, status: Str) -> Str:
|
1646
|
-
statuses = {
|
1646
|
+
statuses: dict = {
|
1647
1647
|
'Ok': 'ok',
|
1648
1648
|
'Fail': 'failed',
|
1649
1649
|
}
|
@@ -1665,7 +1665,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1665
1665
|
await self.load_markets()
|
1666
1666
|
response = None
|
1667
1667
|
currency = self.currency(code)
|
1668
|
-
request = {
|
1668
|
+
request: dict = {
|
1669
1669
|
'currency': currency['id'],
|
1670
1670
|
'amount': amount,
|
1671
1671
|
'address': address,
|
@@ -1689,7 +1689,7 @@ class zonda(Exchange, ImplicitAPI):
|
|
1689
1689
|
data = self.safe_dict(response, 'data')
|
1690
1690
|
return self.parse_transaction(data, currency)
|
1691
1691
|
|
1692
|
-
def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
|
1692
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
1693
1693
|
#
|
1694
1694
|
# withdraw
|
1695
1695
|
#
|
ccxt/base/exchange.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
# -----------------------------------------------------------------------------
|
6
6
|
|
7
|
-
__version__ = '4.3.
|
7
|
+
__version__ = '4.3.32'
|
8
8
|
|
9
9
|
# -----------------------------------------------------------------------------
|
10
10
|
|
@@ -31,7 +31,7 @@ from ccxt.base.decimal_to_precision import decimal_to_precision
|
|
31
31
|
from ccxt.base.decimal_to_precision import DECIMAL_PLACES, TICK_SIZE, NO_PADDING, TRUNCATE, ROUND, ROUND_UP, ROUND_DOWN, SIGNIFICANT_DIGITS
|
32
32
|
from ccxt.base.decimal_to_precision import number_to_string
|
33
33
|
from ccxt.base.precise import Precise
|
34
|
-
from ccxt.base.types import BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest
|
34
|
+
from ccxt.base.types import BalanceAccount, Currency, IndexType, OrderSide, OrderType, Trade, OrderRequest, Market, MarketType, Str, Num, Strings, CancellationRequest, Bool
|
35
35
|
|
36
36
|
# -----------------------------------------------------------------------------
|
37
37
|
|
@@ -2143,7 +2143,7 @@ class Exchange(object):
|
|
2143
2143
|
def watch_order_book_for_symbols(self, symbols: List[str], limit: Int = None, params={}):
|
2144
2144
|
raise NotSupported(self.id + ' watchOrderBookForSymbols() is not supported yet')
|
2145
2145
|
|
2146
|
-
def fetch_deposit_addresses(self, codes:
|
2146
|
+
def fetch_deposit_addresses(self, codes: Strings = None, params={}):
|
2147
2147
|
raise NotSupported(self.id + ' fetchDepositAddresses() is not supported yet')
|
2148
2148
|
|
2149
2149
|
def fetch_order_book(self, symbol: str, limit: Int = None, params={}):
|
@@ -2156,7 +2156,7 @@ class Exchange(object):
|
|
2156
2156
|
else:
|
2157
2157
|
raise NotSupported(self.id + ' fetchMarginMode() is not supported yet')
|
2158
2158
|
|
2159
|
-
def fetch_margin_modes(self, symbols:
|
2159
|
+
def fetch_margin_modes(self, symbols: Strings = None, params={}):
|
2160
2160
|
raise NotSupported(self.id + ' fetchMarginModes() is not supported yet')
|
2161
2161
|
|
2162
2162
|
def fetch_rest_order_book_safe(self, symbol, limit=None, params={}):
|
@@ -2176,7 +2176,7 @@ class Exchange(object):
|
|
2176
2176
|
def fetch_time(self, params={}):
|
2177
2177
|
raise NotSupported(self.id + ' fetchTime() is not supported yet')
|
2178
2178
|
|
2179
|
-
def fetch_trading_limits(self, symbols:
|
2179
|
+
def fetch_trading_limits(self, symbols: Strings = None, params={}):
|
2180
2180
|
raise NotSupported(self.id + ' fetchTradingLimits() is not supported yet')
|
2181
2181
|
|
2182
2182
|
def parse_market(self, market):
|
@@ -2194,10 +2194,10 @@ class Exchange(object):
|
|
2194
2194
|
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
2195
2195
|
raise NotSupported(self.id + ' parseDepositAddress() is not supported yet')
|
2196
2196
|
|
2197
|
-
def parse_trade(self, trade:
|
2197
|
+
def parse_trade(self, trade: dict, market: Market = None):
|
2198
2198
|
raise NotSupported(self.id + ' parseTrade() is not supported yet')
|
2199
2199
|
|
2200
|
-
def parse_transaction(self, transaction, currency: Currency = None):
|
2200
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None):
|
2201
2201
|
raise NotSupported(self.id + ' parseTransaction() is not supported yet')
|
2202
2202
|
|
2203
2203
|
def parse_transfer(self, transfer: dict, currency: Currency = None):
|
@@ -2206,10 +2206,10 @@ class Exchange(object):
|
|
2206
2206
|
def parse_account(self, account):
|
2207
2207
|
raise NotSupported(self.id + ' parseAccount() is not supported yet')
|
2208
2208
|
|
2209
|
-
def parse_ledger_entry(self, item, currency: Currency = None):
|
2209
|
+
def parse_ledger_entry(self, item: dict, currency: Currency = None):
|
2210
2210
|
raise NotSupported(self.id + ' parseLedgerEntry() is not supported yet')
|
2211
2211
|
|
2212
|
-
def parse_order(self, order, market: Market = None):
|
2212
|
+
def parse_order(self, order: dict, market: Market = None):
|
2213
2213
|
raise NotSupported(self.id + ' parseOrder() is not supported yet')
|
2214
2214
|
|
2215
2215
|
def fetch_cross_borrow_rates(self, params={}):
|
@@ -2221,16 +2221,16 @@ class Exchange(object):
|
|
2221
2221
|
def parse_market_leverage_tiers(self, info, market: Market = None):
|
2222
2222
|
raise NotSupported(self.id + ' parseMarketLeverageTiers() is not supported yet')
|
2223
2223
|
|
2224
|
-
def fetch_leverage_tiers(self, symbols:
|
2224
|
+
def fetch_leverage_tiers(self, symbols: Strings = None, params={}):
|
2225
2225
|
raise NotSupported(self.id + ' fetchLeverageTiers() is not supported yet')
|
2226
2226
|
|
2227
|
-
def parse_position(self, position, market: Market = None):
|
2227
|
+
def parse_position(self, position: dict, market: Market = None):
|
2228
2228
|
raise NotSupported(self.id + ' parsePosition() is not supported yet')
|
2229
2229
|
|
2230
2230
|
def parse_funding_rate_history(self, info, market: Market = None):
|
2231
2231
|
raise NotSupported(self.id + ' parseFundingRateHistory() is not supported yet')
|
2232
2232
|
|
2233
|
-
def parse_borrow_interest(self, info, market: Market = None):
|
2233
|
+
def parse_borrow_interest(self, info: dict, market: Market = None):
|
2234
2234
|
raise NotSupported(self.id + ' parseBorrowInterest() is not supported yet')
|
2235
2235
|
|
2236
2236
|
def parse_isolated_borrow_rate(self, info, market: Market = None):
|
@@ -2248,7 +2248,7 @@ class Exchange(object):
|
|
2248
2248
|
def parse_ws_ohlcv(self, ohlcv, market: Market = None):
|
2249
2249
|
return self.parse_ohlcv(ohlcv, market)
|
2250
2250
|
|
2251
|
-
def fetch_funding_rates(self, symbols:
|
2251
|
+
def fetch_funding_rates(self, symbols: Strings = None, params={}):
|
2252
2252
|
raise NotSupported(self.id + ' fetchFundingRates() is not supported yet')
|
2253
2253
|
|
2254
2254
|
def watch_funding_rate(self, symbol: str, params={}):
|
@@ -2279,7 +2279,7 @@ class Exchange(object):
|
|
2279
2279
|
else:
|
2280
2280
|
raise NotSupported(self.id + ' fetchLeverage() is not supported yet')
|
2281
2281
|
|
2282
|
-
def fetch_leverages(self, symbols:
|
2282
|
+
def fetch_leverages(self, symbols: Strings = None, params={}):
|
2283
2283
|
raise NotSupported(self.id + ' fetchLeverages() is not supported yet')
|
2284
2284
|
|
2285
2285
|
def set_position_mode(self, hedged: bool, symbol: Str = None, params={}):
|
@@ -3509,7 +3509,7 @@ class Exchange(object):
|
|
3509
3509
|
tiers[symbol] = self.parse_market_leverage_tiers(item, market)
|
3510
3510
|
return tiers
|
3511
3511
|
|
3512
|
-
def load_trading_limits(self, symbols:
|
3512
|
+
def load_trading_limits(self, symbols: Strings = None, reload=False, params={}):
|
3513
3513
|
if self.has['fetchTradingLimits']:
|
3514
3514
|
if reload or not ('limitsLoaded' in self.options):
|
3515
3515
|
response = self.fetch_trading_limits(symbols)
|
@@ -3643,6 +3643,18 @@ class Exchange(object):
|
|
3643
3643
|
params = self.omit(params, [paramName1, paramName2])
|
3644
3644
|
return [value, params]
|
3645
3645
|
|
3646
|
+
def handle_param_bool(self, params: object, paramName: str, defaultValue: Bool = None):
|
3647
|
+
value = self.safe_bool(params, paramName, defaultValue)
|
3648
|
+
if value is not None:
|
3649
|
+
params = self.omit(params, paramName)
|
3650
|
+
return [value, params]
|
3651
|
+
|
3652
|
+
def handle_param_bool_2(self, params: object, paramName1: str, paramName2: str, defaultValue: Bool = None):
|
3653
|
+
value = self.safe_bool_2(params, paramName1, paramName2, defaultValue)
|
3654
|
+
if value is not None:
|
3655
|
+
params = self.omit(params, [paramName1, paramName2])
|
3656
|
+
return [value, params]
|
3657
|
+
|
3646
3658
|
def resolve_path(self, path, params):
|
3647
3659
|
return [
|
3648
3660
|
self.implode_params(path, params),
|
@@ -3784,10 +3796,10 @@ class Exchange(object):
|
|
3784
3796
|
def watch_position(self, symbol: Str = None, params={}):
|
3785
3797
|
raise NotSupported(self.id + ' watchPosition() is not supported yet')
|
3786
3798
|
|
3787
|
-
def watch_positions(self, symbols:
|
3799
|
+
def watch_positions(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}):
|
3788
3800
|
raise NotSupported(self.id + ' watchPositions() is not supported yet')
|
3789
3801
|
|
3790
|
-
def watch_position_for_symbols(self, symbols:
|
3802
|
+
def watch_position_for_symbols(self, symbols: Strings = None, since: Int = None, limit: Int = None, params={}):
|
3791
3803
|
return self.watchPositions(symbols, since, limit, params)
|
3792
3804
|
|
3793
3805
|
def fetch_positions_for_symbol(self, symbol: str, params={}):
|
@@ -3808,13 +3820,13 @@ class Exchange(object):
|
|
3808
3820
|
"""
|
3809
3821
|
raise NotSupported(self.id + ' fetchPositionsForSymbol() is not supported yet')
|
3810
3822
|
|
3811
|
-
def fetch_positions(self, symbols:
|
3823
|
+
def fetch_positions(self, symbols: Strings = None, params={}):
|
3812
3824
|
raise NotSupported(self.id + ' fetchPositions() is not supported yet')
|
3813
3825
|
|
3814
|
-
def fetch_positions_ws(self, symbols:
|
3826
|
+
def fetch_positions_ws(self, symbols: Strings = None, params={}):
|
3815
3827
|
raise NotSupported(self.id + ' fetchPositions() is not supported yet')
|
3816
3828
|
|
3817
|
-
def fetch_positions_risk(self, symbols:
|
3829
|
+
def fetch_positions_risk(self, symbols: Strings = None, params={}):
|
3818
3830
|
raise NotSupported(self.id + ' fetchPositionsRisk() is not supported yet')
|
3819
3831
|
|
3820
3832
|
def fetch_bids_asks(self, symbols: Strings = None, params={}):
|
@@ -3944,10 +3956,10 @@ class Exchange(object):
|
|
3944
3956
|
raise NotSupported(self.id + ' fetchTransactionFee() is not supported yet')
|
3945
3957
|
return self.fetch_transaction_fees([code], params)
|
3946
3958
|
|
3947
|
-
def fetch_transaction_fees(self, codes:
|
3959
|
+
def fetch_transaction_fees(self, codes: Strings = None, params={}):
|
3948
3960
|
raise NotSupported(self.id + ' fetchTransactionFees() is not supported yet')
|
3949
3961
|
|
3950
|
-
def fetch_deposit_withdraw_fees(self, codes:
|
3962
|
+
def fetch_deposit_withdraw_fees(self, codes: Strings = None, params={}):
|
3951
3963
|
raise NotSupported(self.id + ' fetchDepositWithdrawFees() is not supported yet')
|
3952
3964
|
|
3953
3965
|
def fetch_deposit_withdraw_fee(self, code: str, params={}):
|
@@ -4132,19 +4144,19 @@ class Exchange(object):
|
|
4132
4144
|
def watch_ticker(self, symbol: str, params={}):
|
4133
4145
|
raise NotSupported(self.id + ' watchTicker() is not supported yet')
|
4134
4146
|
|
4135
|
-
def fetch_tickers(self, symbols:
|
4147
|
+
def fetch_tickers(self, symbols: Strings = None, params={}):
|
4136
4148
|
raise NotSupported(self.id + ' fetchTickers() is not supported yet')
|
4137
4149
|
|
4138
|
-
def fetch_tickers_ws(self, symbols:
|
4150
|
+
def fetch_tickers_ws(self, symbols: Strings = None, params={}):
|
4139
4151
|
raise NotSupported(self.id + ' fetchTickers() is not supported yet')
|
4140
4152
|
|
4141
|
-
def fetch_order_books(self, symbols:
|
4153
|
+
def fetch_order_books(self, symbols: Strings = None, limit: Int = None, params={}):
|
4142
4154
|
raise NotSupported(self.id + ' fetchOrderBooks() is not supported yet')
|
4143
4155
|
|
4144
4156
|
def watch_bids_asks(self, symbols: Strings = None, params={}):
|
4145
4157
|
raise NotSupported(self.id + ' watchBidsAsks() is not supported yet')
|
4146
4158
|
|
4147
|
-
def watch_tickers(self, symbols:
|
4159
|
+
def watch_tickers(self, symbols: Strings = None, params={}):
|
4148
4160
|
raise NotSupported(self.id + ' watchTickers() is not supported yet')
|
4149
4161
|
|
4150
4162
|
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
@@ -4803,7 +4815,7 @@ class Exchange(object):
|
|
4803
4815
|
def is_significant_precision(self):
|
4804
4816
|
return self.precisionMode == SIGNIFICANT_DIGITS
|
4805
4817
|
|
4806
|
-
def safe_number(self, obj
|
4818
|
+
def safe_number(self, obj, key: IndexType, defaultNumber: Num = None):
|
4807
4819
|
value = self.safe_string(obj, key)
|
4808
4820
|
return self.parse_number(value, defaultNumber)
|
4809
4821
|
|
@@ -5016,7 +5028,7 @@ class Exchange(object):
|
|
5016
5028
|
symbols = self.market_symbols(symbols)
|
5017
5029
|
return self.filter_by_array(results, 'symbol', symbols)
|
5018
5030
|
|
5019
|
-
def parse_deposit_addresses(self, addresses, codes:
|
5031
|
+
def parse_deposit_addresses(self, addresses, codes: Strings = None, indexed=True, params={}):
|
5020
5032
|
result = []
|
5021
5033
|
for i in range(0, len(addresses)):
|
5022
5034
|
address = self.extend(self.parse_deposit_address(addresses[i]), params)
|
@@ -5127,7 +5139,7 @@ class Exchange(object):
|
|
5127
5139
|
return [True, params]
|
5128
5140
|
return [False, params]
|
5129
5141
|
|
5130
|
-
def fetch_last_prices(self, symbols:
|
5142
|
+
def fetch_last_prices(self, symbols: Strings = None, params={}):
|
5131
5143
|
raise NotSupported(self.id + ' fetchLastPrices() is not supported yet')
|
5132
5144
|
|
5133
5145
|
def fetch_trading_fees(self, params={}):
|
@@ -5185,7 +5197,7 @@ class Exchange(object):
|
|
5185
5197
|
:returns float[][]: A list of candles ordered, open, high, low, close, None
|
5186
5198
|
"""
|
5187
5199
|
if self.has['fetchMarkOHLCV']:
|
5188
|
-
request = {
|
5200
|
+
request: dict = {
|
5189
5201
|
'price': 'mark',
|
5190
5202
|
}
|
5191
5203
|
return self.fetch_ohlcv(symbol, timeframe, since, limit, self.extend(request, params))
|
@@ -5203,7 +5215,7 @@ class Exchange(object):
|
|
5203
5215
|
* @returns {} A list of candles ordered, open, high, low, close, None
|
5204
5216
|
"""
|
5205
5217
|
if self.has['fetchIndexOHLCV']:
|
5206
|
-
request = {
|
5218
|
+
request: dict = {
|
5207
5219
|
'price': 'index',
|
5208
5220
|
}
|
5209
5221
|
return self.fetch_ohlcv(symbol, timeframe, since, limit, self.extend(request, params))
|
@@ -5221,7 +5233,7 @@ class Exchange(object):
|
|
5221
5233
|
:returns float[][]: A list of candles ordered, open, high, low, close, None
|
5222
5234
|
"""
|
5223
5235
|
if self.has['fetchPremiumIndexOHLCV']:
|
5224
|
-
request = {
|
5236
|
+
request: dict = {
|
5225
5237
|
'price': 'premiumIndex',
|
5226
5238
|
}
|
5227
5239
|
return self.fetch_ohlcv(symbol, timeframe, since, limit, self.extend(request, params))
|
@@ -5288,7 +5300,7 @@ class Exchange(object):
|
|
5288
5300
|
elif (marginMode == 'cross') and (symbol is not None):
|
5289
5301
|
raise ArgumentsRequired(self.id + ' ' + methodName + '() cannot have a symbol argument for cross margin')
|
5290
5302
|
|
5291
|
-
def parse_deposit_withdraw_fees(self, response, codes:
|
5303
|
+
def parse_deposit_withdraw_fees(self, response, codes: Strings = None, currencyIdKey=None):
|
5292
5304
|
"""
|
5293
5305
|
* @ignore
|
5294
5306
|
:param object[]|dict response: unparsed response from the exchange
|
@@ -5371,7 +5383,7 @@ class Exchange(object):
|
|
5371
5383
|
sorted = self.sort_by(result, 'timestamp')
|
5372
5384
|
return self.filter_by_since_limit(sorted, since, limit)
|
5373
5385
|
|
5374
|
-
def get_market_from_symbols(self, symbols:
|
5386
|
+
def get_market_from_symbols(self, symbols: Strings = None):
|
5375
5387
|
if symbols is None:
|
5376
5388
|
return None
|
5377
5389
|
firstMarket = self.safe_string(symbols, 0)
|
@@ -5674,7 +5686,7 @@ class Exchange(object):
|
|
5674
5686
|
def parse_liquidation(self, liquidation, market: Market = None):
|
5675
5687
|
raise NotSupported(self.id + ' parseLiquidation() is not supported yet')
|
5676
5688
|
|
5677
|
-
def parse_liquidations(self, liquidations, market=None, since: Int = None, limit: Int = None):
|
5689
|
+
def parse_liquidations(self, liquidations: List[dict], market: Market = None, since: Int = None, limit: Int = None):
|
5678
5690
|
"""
|
5679
5691
|
* @ignore
|
5680
5692
|
parses liquidation info from the exchange response
|
@@ -5722,7 +5734,7 @@ class Exchange(object):
|
|
5722
5734
|
marginModeStructures[market['symbol']] = self.parse_margin_mode(info, market)
|
5723
5735
|
return marginModeStructures
|
5724
5736
|
|
5725
|
-
def parse_margin_mode(self, marginMode, market: Market = None):
|
5737
|
+
def parse_margin_mode(self, marginMode: dict, market: Market = None):
|
5726
5738
|
raise NotSupported(self.id + ' parseMarginMode() is not supported yet')
|
5727
5739
|
|
5728
5740
|
def parse_leverages(self, response: List[object], symbols: List[str] = None, symbolKey: Str = None, marketType: MarketType = None):
|
ccxt/base/types.py
CHANGED
@@ -459,6 +459,7 @@ class IsolatedBorrowRate(TypedDict):
|
|
459
459
|
timestamp: Int
|
460
460
|
datetime: Str
|
461
461
|
|
462
|
+
|
462
463
|
class FundingRate(TypedDict):
|
463
464
|
symbol: Str
|
464
465
|
timestamp: Int
|
@@ -478,6 +479,17 @@ class FundingRate(TypedDict):
|
|
478
479
|
previousFundingRate: Num
|
479
480
|
info: Dict[str, Any]
|
480
481
|
|
482
|
+
|
483
|
+
class LeverageTier:
|
484
|
+
tier: Num
|
485
|
+
currency: Str
|
486
|
+
minNotional: Num
|
487
|
+
maxNotional: Num
|
488
|
+
maintenanceMarginRate: Num
|
489
|
+
maxLeverage: Num
|
490
|
+
info: Dict[str, Any]
|
491
|
+
|
492
|
+
|
481
493
|
FundingRates = Dict[Str, FundingRate]
|
482
494
|
LastPrices = Dict[Str, LastPrice]
|
483
495
|
Currencies = Dict[Str, CurrencyInterface]
|
@@ -485,6 +497,7 @@ TradingFees = Dict[Str, TradingFeeInterface]
|
|
485
497
|
IsolatedBorrowRates = Dict[Str, IsolatedBorrowRate]
|
486
498
|
CrossBorrowRates = Dict[Str, CrossBorrowRate]
|
487
499
|
TransferEntries = Dict[Str, TransferEntry]
|
500
|
+
LeverageTiers = Dict[Str, List[LeverageTier]]
|
488
501
|
|
489
502
|
Market = Optional[MarketInterface]
|
490
503
|
Currency = Optional[CurrencyInterface]
|