ccxt 4.2.87__py2.py3-none-any.whl → 4.2.89__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.
Potentially problematic release.
This version of ccxt might be problematic. Click here for more details.
- ccxt/__init__.py +1 -1
- ccxt/ascendex.py +5 -3
- ccxt/async_support/__init__.py +1 -1
- ccxt/async_support/ascendex.py +5 -3
- ccxt/async_support/base/exchange.py +3 -2
- ccxt/async_support/bigone.py +2 -2
- ccxt/async_support/binance.py +17 -11
- ccxt/async_support/bingx.py +2 -2
- ccxt/async_support/bit2c.py +2 -2
- ccxt/async_support/bitbank.py +2 -2
- ccxt/async_support/bitfinex.py +2 -2
- ccxt/async_support/bitfinex2.py +3 -3
- ccxt/async_support/bitflyer.py +4 -2
- ccxt/async_support/bitget.py +27 -21
- ccxt/async_support/bitmart.py +6 -4
- ccxt/async_support/bitmex.py +2 -2
- ccxt/async_support/bitopro.py +3 -3
- ccxt/async_support/bitrue.py +2 -2
- ccxt/async_support/bitso.py +2 -2
- ccxt/async_support/bitstamp.py +89 -97
- ccxt/async_support/bitteam.py +2 -2
- ccxt/async_support/bitvavo.py +3 -3
- ccxt/async_support/bl3p.py +2 -2
- ccxt/async_support/blockchaincom.py +2 -2
- ccxt/async_support/blofin.py +4 -2
- ccxt/async_support/bybit.py +7 -5
- ccxt/async_support/cex.py +3 -3
- ccxt/async_support/coinbase.py +2 -2
- ccxt/async_support/coinbaseinternational.py +2 -2
- ccxt/async_support/coinbasepro.py +3 -3
- ccxt/async_support/coincheck.py +2 -2
- ccxt/async_support/coinex.py +5 -5
- ccxt/async_support/coinlist.py +3 -3
- ccxt/async_support/coinmate.py +2 -2
- ccxt/async_support/coinmetro.py +2 -2
- ccxt/async_support/coinone.py +2 -2
- ccxt/async_support/coinsph.py +6 -4
- ccxt/async_support/cryptocom.py +1 -1
- ccxt/async_support/currencycom.py +3 -3
- ccxt/async_support/delta.py +2 -2
- ccxt/async_support/deribit.py +3 -3
- ccxt/async_support/digifinex.py +6 -4
- ccxt/async_support/exmo.py +3 -3
- ccxt/async_support/gate.py +20 -18
- ccxt/async_support/gemini.py +3 -3
- ccxt/async_support/hitbtc.py +7 -5
- ccxt/async_support/hollaex.py +3 -3
- ccxt/async_support/htx.py +6 -4
- ccxt/async_support/huobijp.py +2 -2
- ccxt/async_support/hyperliquid.py +2 -2
- ccxt/async_support/idex.py +3 -3
- ccxt/async_support/independentreserve.py +2 -2
- ccxt/async_support/kraken.py +3 -3
- ccxt/async_support/krakenfutures.py +2 -1
- ccxt/async_support/kucoin.py +49 -22
- ccxt/async_support/kuna.py +2 -2
- ccxt/async_support/latoken.py +7 -3
- ccxt/async_support/lbank.py +7 -5
- ccxt/async_support/luno.py +4 -2
- ccxt/async_support/lykke.py +2 -2
- ccxt/async_support/mexc.py +57 -10
- ccxt/async_support/ndax.py +2 -2
- ccxt/async_support/oceanex.py +2 -2
- ccxt/async_support/okcoin.py +2 -2
- ccxt/async_support/okx.py +6 -4
- ccxt/async_support/onetrading.py +3 -3
- ccxt/async_support/phemex.py +2 -2
- ccxt/async_support/poloniex.py +3 -3
- ccxt/async_support/probit.py +2 -2
- ccxt/async_support/timex.py +6 -4
- ccxt/async_support/upbit.py +2 -2
- ccxt/async_support/wazirx.py +2 -2
- ccxt/async_support/whitebit.py +3 -3
- ccxt/async_support/woo.py +3 -3
- ccxt/async_support/yobit.py +2 -2
- ccxt/base/exchange.py +35 -9
- ccxt/base/types.py +32 -0
- ccxt/bigone.py +2 -2
- ccxt/binance.py +17 -11
- ccxt/bingx.py +2 -2
- ccxt/bit2c.py +2 -2
- ccxt/bitbank.py +2 -2
- ccxt/bitfinex.py +2 -2
- ccxt/bitfinex2.py +3 -3
- ccxt/bitflyer.py +4 -2
- ccxt/bitget.py +27 -21
- ccxt/bitmart.py +6 -4
- ccxt/bitmex.py +2 -2
- ccxt/bitopro.py +3 -3
- ccxt/bitrue.py +2 -2
- ccxt/bitso.py +2 -2
- ccxt/bitstamp.py +89 -97
- ccxt/bitteam.py +2 -2
- ccxt/bitvavo.py +3 -3
- ccxt/bl3p.py +2 -2
- ccxt/blockchaincom.py +2 -2
- ccxt/blofin.py +4 -2
- ccxt/bybit.py +7 -5
- ccxt/cex.py +3 -3
- ccxt/coinbase.py +2 -2
- ccxt/coinbaseinternational.py +2 -2
- ccxt/coinbasepro.py +3 -3
- ccxt/coincheck.py +2 -2
- ccxt/coinex.py +5 -5
- ccxt/coinlist.py +3 -3
- ccxt/coinmate.py +2 -2
- ccxt/coinmetro.py +2 -2
- ccxt/coinone.py +2 -2
- ccxt/coinsph.py +6 -4
- ccxt/cryptocom.py +1 -1
- ccxt/currencycom.py +3 -3
- ccxt/delta.py +2 -2
- ccxt/deribit.py +3 -3
- ccxt/digifinex.py +6 -4
- ccxt/exmo.py +3 -3
- ccxt/gate.py +20 -18
- ccxt/gemini.py +3 -3
- ccxt/hitbtc.py +7 -5
- ccxt/hollaex.py +3 -3
- ccxt/htx.py +6 -4
- ccxt/huobijp.py +2 -2
- ccxt/hyperliquid.py +2 -2
- ccxt/idex.py +3 -3
- ccxt/independentreserve.py +2 -2
- ccxt/kraken.py +3 -3
- ccxt/krakenfutures.py +2 -1
- ccxt/kucoin.py +49 -22
- ccxt/kuna.py +2 -2
- ccxt/latoken.py +7 -3
- ccxt/lbank.py +7 -5
- ccxt/luno.py +4 -2
- ccxt/lykke.py +2 -2
- ccxt/mexc.py +57 -10
- ccxt/ndax.py +2 -2
- ccxt/oceanex.py +2 -2
- ccxt/okcoin.py +2 -2
- ccxt/okx.py +6 -4
- ccxt/onetrading.py +3 -3
- ccxt/phemex.py +2 -2
- ccxt/poloniex.py +3 -3
- ccxt/pro/__init__.py +1 -1
- ccxt/pro/bitget.py +2 -0
- ccxt/pro/bitvavo.py +2 -2
- ccxt/probit.py +2 -2
- ccxt/timex.py +6 -4
- ccxt/upbit.py +2 -2
- ccxt/wazirx.py +2 -2
- ccxt/whitebit.py +3 -3
- ccxt/woo.py +3 -3
- ccxt/yobit.py +2 -2
- {ccxt-4.2.87.dist-info → ccxt-4.2.89.dist-info}/METADATA +5 -6
- {ccxt-4.2.87.dist-info → ccxt-4.2.89.dist-info}/RECORD +154 -154
- {ccxt-4.2.87.dist-info → ccxt-4.2.89.dist-info}/WHEEL +0 -0
- {ccxt-4.2.87.dist-info → ccxt-4.2.89.dist-info}/top_level.txt +0 -0
ccxt/gate.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.gate import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, FundingHistory, Greeks, Int, Leverage, Leverages, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -1520,7 +1520,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1520
1520
|
defaultSettle = ['usdt'] if (type == 'swap') else ['btc']
|
1521
1521
|
return self.safe_value(fetchMarketsContractOptions, 'settlementCurrencies', defaultSettle)
|
1522
1522
|
|
1523
|
-
def fetch_currencies(self, params={}):
|
1523
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
1524
1524
|
"""
|
1525
1525
|
fetches all available currencies on an exchange
|
1526
1526
|
:see: https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
|
@@ -1823,7 +1823,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1823
1823
|
self.load_markets()
|
1824
1824
|
currency = self.currency(code)
|
1825
1825
|
request = {
|
1826
|
-
'currency': currency['id'],
|
1826
|
+
'currency': currency['id'], # todo: currencies have network-junctions
|
1827
1827
|
}
|
1828
1828
|
response = self.privateWalletGetDepositAddress(self.extend(request, params))
|
1829
1829
|
addresses = self.safe_value(response, 'multichain_addresses')
|
@@ -1870,7 +1870,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1870
1870
|
rawNetwork = self.safe_string_upper(params, 'network')
|
1871
1871
|
params = self.omit(params, 'network')
|
1872
1872
|
request = {
|
1873
|
-
'currency': currency['id'],
|
1873
|
+
'currency': currency['id'], # todo: currencies have network-junctions
|
1874
1874
|
}
|
1875
1875
|
response = self.privateWalletGetDepositAddress(self.extend(request, params))
|
1876
1876
|
#
|
@@ -1928,7 +1928,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1928
1928
|
'network': network,
|
1929
1929
|
}
|
1930
1930
|
|
1931
|
-
def fetch_trading_fee(self, symbol: str, params={}):
|
1931
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
1932
1932
|
"""
|
1933
1933
|
fetch the trading fees for a market
|
1934
1934
|
:see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
@@ -1958,7 +1958,7 @@ class gate(Exchange, ImplicitAPI):
|
|
1958
1958
|
#
|
1959
1959
|
return self.parse_trading_fee(response, market)
|
1960
1960
|
|
1961
|
-
def fetch_trading_fees(self, params={}):
|
1961
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
1962
1962
|
"""
|
1963
1963
|
fetch the trading fees for multiple markets
|
1964
1964
|
:see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
@@ -2017,6 +2017,8 @@ class gate(Exchange, ImplicitAPI):
|
|
2017
2017
|
'symbol': self.safe_string(market, 'symbol'),
|
2018
2018
|
'maker': self.safe_number(info, makerKey),
|
2019
2019
|
'taker': self.safe_number(info, takerKey),
|
2020
|
+
'percentage': None,
|
2021
|
+
'tierBased': None,
|
2020
2022
|
}
|
2021
2023
|
|
2022
2024
|
def fetch_transaction_fees(self, codes: List[str] = None, params={}):
|
@@ -3345,7 +3347,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3345
3347
|
currency = None
|
3346
3348
|
if code is not None:
|
3347
3349
|
currency = self.currency(code)
|
3348
|
-
request['currency'] = currency['id']
|
3350
|
+
request['currency'] = currency['id'] # todo: currencies have network-junctions
|
3349
3351
|
if limit is not None:
|
3350
3352
|
request['limit'] = limit
|
3351
3353
|
if since is not None:
|
@@ -3377,7 +3379,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3377
3379
|
currency = None
|
3378
3380
|
if code is not None:
|
3379
3381
|
currency = self.currency(code)
|
3380
|
-
request['currency'] = currency['id']
|
3382
|
+
request['currency'] = currency['id'] # todo: currencies have network-junctions
|
3381
3383
|
if limit is not None:
|
3382
3384
|
request['limit'] = limit
|
3383
3385
|
if since is not None:
|
@@ -3404,7 +3406,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3404
3406
|
self.load_markets()
|
3405
3407
|
currency = self.currency(code)
|
3406
3408
|
request = {
|
3407
|
-
'currency': currency['id'],
|
3409
|
+
'currency': currency['id'], # todo: currencies have network-junctions
|
3408
3410
|
'address': address,
|
3409
3411
|
'amount': self.currency_to_precision(code, amount),
|
3410
3412
|
}
|
@@ -3417,7 +3419,7 @@ class gate(Exchange, ImplicitAPI):
|
|
3417
3419
|
request['chain'] = network
|
3418
3420
|
params = self.omit(params, 'network')
|
3419
3421
|
else:
|
3420
|
-
request['chain'] = currency['id']
|
3422
|
+
request['chain'] = currency['id'] # todo: currencies have network-junctions
|
3421
3423
|
response = self.privateWithdrawalsPostWithdrawals(self.extend(request, params))
|
3422
3424
|
#
|
3423
3425
|
# {
|
@@ -4761,7 +4763,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4761
4763
|
toId = self.convert_type_to_account(toAccount)
|
4762
4764
|
truncated = self.currency_to_precision(code, amount)
|
4763
4765
|
request = {
|
4764
|
-
'currency': currency['id'],
|
4766
|
+
'currency': currency['id'], # todo: currencies have network-junctions
|
4765
4767
|
'amount': truncated,
|
4766
4768
|
}
|
4767
4769
|
if not (fromId in self.options['accountsByType']):
|
@@ -4782,7 +4784,7 @@ class gate(Exchange, ImplicitAPI):
|
|
4782
4784
|
request['currency_pair'] = market['id']
|
4783
4785
|
params = self.omit(params, 'symbol')
|
4784
4786
|
if (toId == 'futures') or (toId == 'delivery') or (fromId == 'futures') or (fromId == 'delivery'):
|
4785
|
-
request['settle'] = currency['id']
|
4787
|
+
request['settle'] = currency['id'] # todo: currencies have network-junctions
|
4786
4788
|
response = self.privateWalletPostTransfers(self.extend(request, params))
|
4787
4789
|
#
|
4788
4790
|
# according to the docs(however actual response seems to be an empty string '')
|
@@ -5395,7 +5397,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5395
5397
|
self.load_markets()
|
5396
5398
|
currency = self.currency(code)
|
5397
5399
|
request = {
|
5398
|
-
'currency': currency['id'].upper(),
|
5400
|
+
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5399
5401
|
'amount': self.currency_to_precision(code, amount),
|
5400
5402
|
}
|
5401
5403
|
market = self.market(symbol)
|
@@ -5422,7 +5424,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5422
5424
|
self.load_markets()
|
5423
5425
|
currency = self.currency(code)
|
5424
5426
|
request = {
|
5425
|
-
'currency': currency['id'].upper(),
|
5427
|
+
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5426
5428
|
'amount': self.currency_to_precision(code, amount),
|
5427
5429
|
}
|
5428
5430
|
response = self.privateMarginPostCrossRepayments(self.extend(request, params))
|
@@ -5459,7 +5461,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5459
5461
|
self.load_markets()
|
5460
5462
|
currency = self.currency(code)
|
5461
5463
|
request = {
|
5462
|
-
'currency': currency['id'].upper(),
|
5464
|
+
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5463
5465
|
'amount': self.currency_to_precision(code, amount),
|
5464
5466
|
}
|
5465
5467
|
response = None
|
@@ -5502,7 +5504,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5502
5504
|
self.load_markets()
|
5503
5505
|
currency = self.currency(code)
|
5504
5506
|
request = {
|
5505
|
-
'currency': currency['id'].upper(),
|
5507
|
+
'currency': currency['id'].upper(), # todo: currencies have network-junctions
|
5506
5508
|
'amount': self.currency_to_precision(code, amount),
|
5507
5509
|
}
|
5508
5510
|
response = self.privateMarginPostCrossLoans(self.extend(request, params))
|
@@ -5995,7 +5997,7 @@ class gate(Exchange, ImplicitAPI):
|
|
5995
5997
|
if (type == 'spot') or (type == 'margin'):
|
5996
5998
|
if code is not None:
|
5997
5999
|
currency = self.currency(code)
|
5998
|
-
request['currency'] = currency['id']
|
6000
|
+
request['currency'] = currency['id'] # todo: currencies have network-junctions
|
5999
6001
|
if (type == 'swap') or (type == 'future'):
|
6000
6002
|
defaultSettle = 'usdt' if (type == 'swap') else 'btc'
|
6001
6003
|
settle = self.safe_string_lower(params, 'settle', defaultSettle)
|
@@ -6753,7 +6755,7 @@ class gate(Exchange, ImplicitAPI):
|
|
6753
6755
|
self.load_markets()
|
6754
6756
|
currency = self.currency(code)
|
6755
6757
|
request = {
|
6756
|
-
'underlying': currency['code'] + '_USDT',
|
6758
|
+
'underlying': currency['code'] + '_USDT', # todo: currency['id'].upper() & network junctions
|
6757
6759
|
}
|
6758
6760
|
response = self.publicOptionsGetContracts(self.extend(request, params))
|
6759
6761
|
#
|
ccxt/gemini.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.gemini import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -302,7 +302,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
302
302
|
},
|
303
303
|
})
|
304
304
|
|
305
|
-
def fetch_currencies(self, params={}):
|
305
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
306
306
|
"""
|
307
307
|
fetches all available currencies on an exchange
|
308
308
|
:param dict [params]: extra parameters specific to the endpoint
|
@@ -1048,7 +1048,7 @@ class gemini(Exchange, ImplicitAPI):
|
|
1048
1048
|
result[code] = account
|
1049
1049
|
return self.safe_balance(result)
|
1050
1050
|
|
1051
|
-
def fetch_trading_fees(self, params={}):
|
1051
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
1052
1052
|
"""
|
1053
1053
|
fetch the trading fees for multiple markets
|
1054
1054
|
:see: https://docs.gemini.com/rest-api/#get-notional-volume
|
ccxt/hitbtc.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hitbtc import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Leverage, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -802,7 +802,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
802
802
|
})
|
803
803
|
return result
|
804
804
|
|
805
|
-
def fetch_currencies(self, params={}):
|
805
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
806
806
|
"""
|
807
807
|
fetches all available currencies on an exchange
|
808
808
|
:see: https://api.hitbtc.com/#currencies
|
@@ -1547,7 +1547,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
1547
1547
|
timestamp = self.parse8601(self.safe_string(response, 'timestamp'))
|
1548
1548
|
return self.parse_order_book(response, symbol, timestamp, 'bid', 'ask')
|
1549
1549
|
|
1550
|
-
def parse_trading_fee(self, fee, market: Market = None):
|
1550
|
+
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
1551
1551
|
#
|
1552
1552
|
# {
|
1553
1553
|
# "symbol":"ARVUSDT", # returned from fetchTradingFees only
|
@@ -1564,9 +1564,11 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
1564
1564
|
'symbol': symbol,
|
1565
1565
|
'taker': taker,
|
1566
1566
|
'maker': maker,
|
1567
|
+
'percentage': None,
|
1568
|
+
'tierBased': None,
|
1567
1569
|
}
|
1568
1570
|
|
1569
|
-
def fetch_trading_fee(self, symbol: str, params={}):
|
1571
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
1570
1572
|
"""
|
1571
1573
|
fetch the trading fees for a market
|
1572
1574
|
:see: https://api.hitbtc.com/#get-trading-commission
|
@@ -1595,7 +1597,7 @@ class hitbtc(Exchange, ImplicitAPI):
|
|
1595
1597
|
#
|
1596
1598
|
return self.parse_trading_fee(response, market)
|
1597
1599
|
|
1598
|
-
def fetch_trading_fees(self, params={}):
|
1600
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
1599
1601
|
"""
|
1600
1602
|
fetch the trading fees for multiple markets
|
1601
1603
|
:see: https://api.hitbtc.com/#get-all-trading-commissions
|
ccxt/hollaex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hollaex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
12
12
|
from ccxt.base.errors import BadRequest
|
@@ -328,7 +328,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
328
328
|
})
|
329
329
|
return result
|
330
330
|
|
331
|
-
def fetch_currencies(self, params={}):
|
331
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
332
332
|
"""
|
333
333
|
fetches all available currencies on an exchange
|
334
334
|
:see: https://apidocs.hollaex.com/#constants
|
@@ -679,7 +679,7 @@ class hollaex(Exchange, ImplicitAPI):
|
|
679
679
|
'fee': fee,
|
680
680
|
}, market)
|
681
681
|
|
682
|
-
def fetch_trading_fees(self, params={}):
|
682
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
683
683
|
"""
|
684
684
|
fetch the trading fees for multiple markets
|
685
685
|
:see: https://apidocs.hollaex.com/#tiers
|
ccxt/htx.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.htx import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -1485,7 +1485,7 @@ class htx(Exchange, ImplicitAPI):
|
|
1485
1485
|
#
|
1486
1486
|
return self.safe_integer_2(response, 'data', 'ts')
|
1487
1487
|
|
1488
|
-
def parse_trading_fee(self, fee, market: Market = None):
|
1488
|
+
def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
|
1489
1489
|
#
|
1490
1490
|
# {
|
1491
1491
|
# "symbol":"btcusdt",
|
@@ -1501,9 +1501,11 @@ class htx(Exchange, ImplicitAPI):
|
|
1501
1501
|
'symbol': self.safe_symbol(marketId, market),
|
1502
1502
|
'maker': self.safe_number(fee, 'actualMakerRate'),
|
1503
1503
|
'taker': self.safe_number(fee, 'actualTakerRate'),
|
1504
|
+
'percentage': None,
|
1505
|
+
'tierBased': None,
|
1504
1506
|
}
|
1505
1507
|
|
1506
|
-
def fetch_trading_fee(self, symbol: str, params={}):
|
1508
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
1507
1509
|
"""
|
1508
1510
|
fetch the trading fees for a market
|
1509
1511
|
:param str symbol: unified market symbol
|
@@ -2986,7 +2988,7 @@ class htx(Exchange, ImplicitAPI):
|
|
2986
2988
|
defaultAccount = self.safe_value(accounts, 0, {})
|
2987
2989
|
return self.safe_string(defaultAccount, 'id')
|
2988
2990
|
|
2989
|
-
def fetch_currencies(self, params={}):
|
2991
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
2990
2992
|
"""
|
2991
2993
|
fetches all available currencies on an exchange
|
2992
2994
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/huobijp.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.huobijp import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -954,7 +954,7 @@ class huobijp(Exchange, ImplicitAPI):
|
|
954
954
|
response = self.privateGetAccountAccounts(params)
|
955
955
|
return response['data']
|
956
956
|
|
957
|
-
def fetch_currencies(self, params={}):
|
957
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
958
958
|
"""
|
959
959
|
fetches all available currencies on an exchange
|
960
960
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/hyperliquid.py
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.hyperliquid import ImplicitAPI
|
8
|
-
from ccxt.base.types import Balances, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
|
8
|
+
from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
|
9
9
|
from typing import List
|
10
10
|
from ccxt.base.errors import ExchangeError
|
11
11
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -207,7 +207,7 @@ class hyperliquid(Exchange, ImplicitAPI):
|
|
207
207
|
super(hyperliquid, self).set_sandbox_mode(enabled)
|
208
208
|
self.options['sandboxMode'] = enabled
|
209
209
|
|
210
|
-
def fetch_currencies(self, params={}):
|
210
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
211
211
|
"""
|
212
212
|
fetches all available currencies on an exchange
|
213
213
|
:see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-exchange-metadata
|
ccxt/idex.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.idex import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import BadRequest
|
@@ -609,7 +609,7 @@ class idex(Exchange, ImplicitAPI):
|
|
609
609
|
'fee': fee,
|
610
610
|
}, market)
|
611
611
|
|
612
|
-
def fetch_trading_fees(self, params={}):
|
612
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
613
613
|
"""
|
614
614
|
fetch the trading fees for multiple markets
|
615
615
|
:see: https://api-docs-v3.idex.io/#get-api-account
|
@@ -712,7 +712,7 @@ class idex(Exchange, ImplicitAPI):
|
|
712
712
|
descending = side == 'bids'
|
713
713
|
return self.sort_by(result, 0, descending)
|
714
714
|
|
715
|
-
def fetch_currencies(self, params={}):
|
715
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
716
716
|
"""
|
717
717
|
fetches all available currencies on an exchange
|
718
718
|
:see: https://api-docs-v3.idex.io/#get-assets
|
ccxt/independentreserve.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.independentreserve import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade
|
9
|
+
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.decimal_to_precision import TICK_SIZE
|
12
12
|
from ccxt.base.precise import Precise
|
@@ -586,7 +586,7 @@ class independentreserve(Exchange, ImplicitAPI):
|
|
586
586
|
response = self.publicGetGetRecentTrades(self.extend(request, params))
|
587
587
|
return self.parse_trades(response['Trades'], market, since, limit)
|
588
588
|
|
589
|
-
def fetch_trading_fees(self, params={}):
|
589
|
+
def fetch_trading_fees(self, params={}) -> TradingFees:
|
590
590
|
"""
|
591
591
|
fetch the trading fees for multiple markets
|
592
592
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
ccxt/kraken.py
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
from ccxt.base.exchange import Exchange
|
7
7
|
from ccxt.abstract.kraken import ImplicitAPI
|
8
8
|
import hashlib
|
9
|
-
from ccxt.base.types import Balances, Currency, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
9
|
+
from ccxt.base.types import Balances, Currencies, Currency, IndexType, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
10
10
|
from typing import List
|
11
11
|
from ccxt.base.errors import ExchangeError
|
12
12
|
from ccxt.base.errors import PermissionDenied
|
@@ -641,7 +641,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
641
641
|
result.append(self.extend(defaults, markets[i]))
|
642
642
|
return result
|
643
643
|
|
644
|
-
def fetch_currencies(self, params={}):
|
644
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
645
645
|
"""
|
646
646
|
fetches all available currencies on an exchange
|
647
647
|
:see: https://docs.kraken.com/rest/#tag/Spot-Market-Data/operation/getAssetInfo
|
@@ -697,7 +697,7 @@ class kraken(Exchange, ImplicitAPI):
|
|
697
697
|
}
|
698
698
|
return result
|
699
699
|
|
700
|
-
def fetch_trading_fee(self, symbol: str, params={}):
|
700
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
701
701
|
"""
|
702
702
|
fetch the trading fees for a market
|
703
703
|
:see: https://docs.kraken.com/rest/#tag/Account-Data/operation/getTradeVolume
|
ccxt/krakenfutures.py
CHANGED
@@ -363,7 +363,8 @@ class krakenfutures(Exchange, ImplicitAPI):
|
|
363
363
|
# swap == perpetual
|
364
364
|
settle = None
|
365
365
|
settleId = None
|
366
|
-
|
366
|
+
cvtp = self.safe_string(market, 'contractValueTradePrecision')
|
367
|
+
amountPrecision = self.parse_number(self.integer_precision_to_amount(cvtp))
|
367
368
|
pricePrecision = self.safe_number(market, 'tickSize')
|
368
369
|
contract = (swap or future or index)
|
369
370
|
swapOrFutures = (swap or future)
|
ccxt/kucoin.py
CHANGED
@@ -8,7 +8,7 @@ from ccxt.abstract.kucoin import ImplicitAPI
|
|
8
8
|
import hashlib
|
9
9
|
import math
|
10
10
|
import json
|
11
|
-
from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
|
11
|
+
from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction, TransferEntry
|
12
12
|
from typing import List
|
13
13
|
from ccxt.base.errors import ExchangeError
|
14
14
|
from ccxt.base.errors import PermissionDenied
|
@@ -1130,7 +1130,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
1130
1130
|
})
|
1131
1131
|
return result
|
1132
1132
|
|
1133
|
-
def fetch_currencies(self, params={}):
|
1133
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
1134
1134
|
"""
|
1135
1135
|
fetches all available currencies on an exchange
|
1136
1136
|
:see: https://docs.kucoin.com/#get-currencies
|
@@ -2960,7 +2960,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
2960
2960
|
'fee': fee,
|
2961
2961
|
}, market)
|
2962
2962
|
|
2963
|
-
def fetch_trading_fee(self, symbol: str, params={}):
|
2963
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
2964
2964
|
"""
|
2965
2965
|
fetch the trading fees for a market
|
2966
2966
|
:see: https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
|
@@ -3314,9 +3314,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3314
3314
|
|
3315
3315
|
def parse_balance_helper(self, entry):
|
3316
3316
|
account = self.account()
|
3317
|
-
account['used'] = self.
|
3318
|
-
account['free'] = self.
|
3319
|
-
account['total'] = self.
|
3317
|
+
account['used'] = self.safe_string_2(entry, 'holdBalance', 'hold')
|
3318
|
+
account['free'] = self.safe_string_2(entry, 'availableBalance', 'available')
|
3319
|
+
account['total'] = self.safe_string_2(entry, 'totalBalance', 'total')
|
3320
3320
|
debt = self.safe_string(entry, 'liability')
|
3321
3321
|
interest = self.safe_string(entry, 'interest')
|
3322
3322
|
account['debt'] = Precise.string_add(debt, interest)
|
@@ -3325,9 +3325,9 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3325
3325
|
def fetch_balance(self, params={}) -> Balances:
|
3326
3326
|
"""
|
3327
3327
|
query for balance and get the amount of funds available for trading or funds locked in orders
|
3328
|
-
:see: https://docs.kucoin.com/#list-accounts
|
3329
3328
|
:see: https://www.kucoin.com/docs/rest/account/basic-info/get-account-list-spot-margin-trade_hf
|
3330
|
-
:see: https://
|
3329
|
+
:see: https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-margin
|
3330
|
+
:see: https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-isolated-margin
|
3331
3331
|
:param dict [params]: extra parameters specific to the exchange API endpoint
|
3332
3332
|
:param dict [params.marginMode]: 'cross' or 'isolated', margin type for fetching margin balance
|
3333
3333
|
:param dict [params.type]: extra parameters specific to the exchange API endpoint
|
@@ -3352,7 +3352,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3352
3352
|
response = None
|
3353
3353
|
request = {}
|
3354
3354
|
isolated = (marginMode == 'isolated') or (type == 'isolated')
|
3355
|
-
cross = (marginMode == 'cross') or (type == '
|
3355
|
+
cross = (marginMode == 'cross') or (type == 'margin')
|
3356
3356
|
if isolated:
|
3357
3357
|
if currency is not None:
|
3358
3358
|
request['balanceCurrency'] = currency['id']
|
@@ -3365,7 +3365,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3365
3365
|
request['type'] = type
|
3366
3366
|
response = self.privateGetAccounts(self.extend(request, query))
|
3367
3367
|
#
|
3368
|
-
# Spot
|
3368
|
+
# Spot
|
3369
3369
|
#
|
3370
3370
|
# {
|
3371
3371
|
# "code": "200000",
|
@@ -3381,35 +3381,59 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3381
3381
|
# ]
|
3382
3382
|
# }
|
3383
3383
|
#
|
3384
|
+
# Cross
|
3385
|
+
#
|
3386
|
+
# {
|
3387
|
+
# "code": "200000",
|
3388
|
+
# "data": {
|
3389
|
+
# "debtRatio": "0",
|
3390
|
+
# "accounts": [
|
3391
|
+
# {
|
3392
|
+
# "currency": "USDT",
|
3393
|
+
# "totalBalance": "5",
|
3394
|
+
# "availableBalance": "5",
|
3395
|
+
# "holdBalance": "0",
|
3396
|
+
# "liability": "0",
|
3397
|
+
# "maxBorrowSize": "20"
|
3398
|
+
# },
|
3399
|
+
# ]
|
3400
|
+
# }
|
3401
|
+
# }
|
3402
|
+
#
|
3384
3403
|
# Isolated
|
3385
3404
|
#
|
3386
3405
|
# {
|
3387
3406
|
# "code": "200000",
|
3388
3407
|
# "data": {
|
3389
|
-
# "
|
3390
|
-
# "
|
3408
|
+
# "totalAssetOfQuoteCurrency": "0",
|
3409
|
+
# "totalLiabilityOfQuoteCurrency": "0",
|
3410
|
+
# "timestamp": 1712085661155,
|
3391
3411
|
# "assets": [
|
3392
3412
|
# {
|
3393
3413
|
# "symbol": "MANA-USDT",
|
3394
|
-
# "status": "
|
3414
|
+
# "status": "EFFECTIVE",
|
3395
3415
|
# "debtRatio": "0",
|
3396
3416
|
# "baseAsset": {
|
3397
3417
|
# "currency": "MANA",
|
3398
|
-
# "
|
3399
|
-
# "
|
3400
|
-
# "
|
3418
|
+
# "borrowEnabled": True,
|
3419
|
+
# "transferInEnabled": True,
|
3420
|
+
# "total": "0",
|
3421
|
+
# "hold": "0",
|
3422
|
+
# "available": "0",
|
3401
3423
|
# "liability": "0",
|
3402
3424
|
# "interest": "0",
|
3403
|
-
# "
|
3425
|
+
# "maxBorrowSize": "0"
|
3404
3426
|
# },
|
3405
3427
|
# "quoteAsset": {
|
3406
3428
|
# "currency": "USDT",
|
3407
|
-
# "
|
3408
|
-
# "
|
3409
|
-
# "
|
3429
|
+
# "borrowEnabled": True,
|
3430
|
+
# "transferInEnabled": True,
|
3431
|
+
# "total": "0",
|
3432
|
+
# "hold": "0",
|
3433
|
+
# "available": "0",
|
3410
3434
|
# "liability": "0",
|
3411
3435
|
# "interest": "0",
|
3412
|
-
# "
|
3436
|
+
# "maxBorrowSize": "0"
|
3413
3437
|
# }
|
3414
3438
|
# },
|
3415
3439
|
# ...
|
@@ -3417,13 +3441,14 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3417
3441
|
# }
|
3418
3442
|
# }
|
3419
3443
|
#
|
3420
|
-
data =
|
3444
|
+
data = None
|
3421
3445
|
result = {
|
3422
3446
|
'info': response,
|
3423
3447
|
'timestamp': None,
|
3424
3448
|
'datetime': None,
|
3425
3449
|
}
|
3426
3450
|
if isolated:
|
3451
|
+
data = self.safe_dict(response, 'data', {})
|
3427
3452
|
assets = self.safe_value(data, 'assets', data)
|
3428
3453
|
for i in range(0, len(assets)):
|
3429
3454
|
entry = assets[i]
|
@@ -3438,6 +3463,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3438
3463
|
subResult[quoteCode] = self.parse_balance_helper(quote)
|
3439
3464
|
result[symbol] = self.safe_balance(subResult)
|
3440
3465
|
elif cross:
|
3466
|
+
data = self.safe_dict(response, 'data', {})
|
3441
3467
|
accounts = self.safe_list(data, 'accounts', [])
|
3442
3468
|
for i in range(0, len(accounts)):
|
3443
3469
|
balance = accounts[i]
|
@@ -3445,6 +3471,7 @@ class kucoin(Exchange, ImplicitAPI):
|
|
3445
3471
|
codeInner = self.safe_currency_code(currencyId)
|
3446
3472
|
result[codeInner] = self.parse_balance_helper(balance)
|
3447
3473
|
else:
|
3474
|
+
data = self.safe_list(response, 'data', [])
|
3448
3475
|
for i in range(0, len(data)):
|
3449
3476
|
balance = data[i]
|
3450
3477
|
balanceType = self.safe_string(balance, 'type')
|
ccxt/kuna.py
CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
|
|
7
7
|
from ccxt.abstract.kuna import ImplicitAPI
|
8
8
|
import hashlib
|
9
9
|
import json
|
10
|
-
from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
10
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
|
11
11
|
from typing import List
|
12
12
|
from ccxt.base.errors import ExchangeError
|
13
13
|
from ccxt.base.errors import ArgumentsRequired
|
@@ -425,7 +425,7 @@ class kuna(Exchange, ImplicitAPI):
|
|
425
425
|
data = self.safe_value(response, 'data', {})
|
426
426
|
return self.safe_integer(data, 'timestamp_miliseconds')
|
427
427
|
|
428
|
-
def fetch_currencies(self, params={}):
|
428
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
429
429
|
"""
|
430
430
|
fetches all available currencies on an exchange
|
431
431
|
:see: https://docs.kuna.io/docs/get-information-about-available-currencies
|