ccxt 4.2.88__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.

Files changed (150) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/ascendex.py +5 -3
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/ascendex.py +5 -3
  5. ccxt/async_support/base/exchange.py +3 -2
  6. ccxt/async_support/bigone.py +2 -2
  7. ccxt/async_support/binance.py +7 -5
  8. ccxt/async_support/bingx.py +2 -2
  9. ccxt/async_support/bit2c.py +2 -2
  10. ccxt/async_support/bitbank.py +2 -2
  11. ccxt/async_support/bitfinex.py +2 -2
  12. ccxt/async_support/bitfinex2.py +3 -3
  13. ccxt/async_support/bitflyer.py +4 -2
  14. ccxt/async_support/bitget.py +10 -5
  15. ccxt/async_support/bitmart.py +6 -4
  16. ccxt/async_support/bitmex.py +2 -2
  17. ccxt/async_support/bitopro.py +3 -3
  18. ccxt/async_support/bitrue.py +2 -2
  19. ccxt/async_support/bitso.py +2 -2
  20. ccxt/async_support/bitstamp.py +89 -97
  21. ccxt/async_support/bitteam.py +2 -2
  22. ccxt/async_support/bitvavo.py +3 -3
  23. ccxt/async_support/bl3p.py +2 -2
  24. ccxt/async_support/blockchaincom.py +2 -2
  25. ccxt/async_support/blofin.py +4 -2
  26. ccxt/async_support/bybit.py +7 -5
  27. ccxt/async_support/cex.py +3 -3
  28. ccxt/async_support/coinbase.py +2 -2
  29. ccxt/async_support/coinbaseinternational.py +2 -2
  30. ccxt/async_support/coinbasepro.py +3 -3
  31. ccxt/async_support/coincheck.py +2 -2
  32. ccxt/async_support/coinex.py +5 -5
  33. ccxt/async_support/coinlist.py +3 -3
  34. ccxt/async_support/coinmate.py +2 -2
  35. ccxt/async_support/coinmetro.py +2 -2
  36. ccxt/async_support/coinone.py +2 -2
  37. ccxt/async_support/coinsph.py +6 -4
  38. ccxt/async_support/currencycom.py +3 -3
  39. ccxt/async_support/delta.py +2 -2
  40. ccxt/async_support/deribit.py +3 -3
  41. ccxt/async_support/digifinex.py +6 -4
  42. ccxt/async_support/exmo.py +3 -3
  43. ccxt/async_support/gate.py +6 -4
  44. ccxt/async_support/gemini.py +3 -3
  45. ccxt/async_support/hitbtc.py +7 -5
  46. ccxt/async_support/hollaex.py +3 -3
  47. ccxt/async_support/htx.py +6 -4
  48. ccxt/async_support/huobijp.py +2 -2
  49. ccxt/async_support/hyperliquid.py +2 -2
  50. ccxt/async_support/idex.py +3 -3
  51. ccxt/async_support/independentreserve.py +2 -2
  52. ccxt/async_support/kraken.py +3 -3
  53. ccxt/async_support/kucoin.py +42 -18
  54. ccxt/async_support/kuna.py +2 -2
  55. ccxt/async_support/latoken.py +7 -3
  56. ccxt/async_support/lbank.py +7 -5
  57. ccxt/async_support/luno.py +4 -2
  58. ccxt/async_support/lykke.py +2 -2
  59. ccxt/async_support/mexc.py +56 -9
  60. ccxt/async_support/ndax.py +2 -2
  61. ccxt/async_support/oceanex.py +2 -2
  62. ccxt/async_support/okcoin.py +2 -2
  63. ccxt/async_support/okx.py +6 -4
  64. ccxt/async_support/onetrading.py +3 -3
  65. ccxt/async_support/phemex.py +2 -2
  66. ccxt/async_support/poloniex.py +3 -3
  67. ccxt/async_support/probit.py +2 -2
  68. ccxt/async_support/timex.py +6 -4
  69. ccxt/async_support/upbit.py +2 -2
  70. ccxt/async_support/wazirx.py +2 -2
  71. ccxt/async_support/whitebit.py +3 -3
  72. ccxt/async_support/woo.py +3 -3
  73. ccxt/async_support/yobit.py +2 -2
  74. ccxt/base/exchange.py +14 -7
  75. ccxt/base/types.py +32 -0
  76. ccxt/bigone.py +2 -2
  77. ccxt/binance.py +7 -5
  78. ccxt/bingx.py +2 -2
  79. ccxt/bit2c.py +2 -2
  80. ccxt/bitbank.py +2 -2
  81. ccxt/bitfinex.py +2 -2
  82. ccxt/bitfinex2.py +3 -3
  83. ccxt/bitflyer.py +4 -2
  84. ccxt/bitget.py +10 -5
  85. ccxt/bitmart.py +6 -4
  86. ccxt/bitmex.py +2 -2
  87. ccxt/bitopro.py +3 -3
  88. ccxt/bitrue.py +2 -2
  89. ccxt/bitso.py +2 -2
  90. ccxt/bitstamp.py +89 -97
  91. ccxt/bitteam.py +2 -2
  92. ccxt/bitvavo.py +3 -3
  93. ccxt/bl3p.py +2 -2
  94. ccxt/blockchaincom.py +2 -2
  95. ccxt/blofin.py +4 -2
  96. ccxt/bybit.py +7 -5
  97. ccxt/cex.py +3 -3
  98. ccxt/coinbase.py +2 -2
  99. ccxt/coinbaseinternational.py +2 -2
  100. ccxt/coinbasepro.py +3 -3
  101. ccxt/coincheck.py +2 -2
  102. ccxt/coinex.py +5 -5
  103. ccxt/coinlist.py +3 -3
  104. ccxt/coinmate.py +2 -2
  105. ccxt/coinmetro.py +2 -2
  106. ccxt/coinone.py +2 -2
  107. ccxt/coinsph.py +6 -4
  108. ccxt/currencycom.py +3 -3
  109. ccxt/delta.py +2 -2
  110. ccxt/deribit.py +3 -3
  111. ccxt/digifinex.py +6 -4
  112. ccxt/exmo.py +3 -3
  113. ccxt/gate.py +6 -4
  114. ccxt/gemini.py +3 -3
  115. ccxt/hitbtc.py +7 -5
  116. ccxt/hollaex.py +3 -3
  117. ccxt/htx.py +6 -4
  118. ccxt/huobijp.py +2 -2
  119. ccxt/hyperliquid.py +2 -2
  120. ccxt/idex.py +3 -3
  121. ccxt/independentreserve.py +2 -2
  122. ccxt/kraken.py +3 -3
  123. ccxt/kucoin.py +42 -18
  124. ccxt/kuna.py +2 -2
  125. ccxt/latoken.py +7 -3
  126. ccxt/lbank.py +7 -5
  127. ccxt/luno.py +4 -2
  128. ccxt/lykke.py +2 -2
  129. ccxt/mexc.py +56 -9
  130. ccxt/ndax.py +2 -2
  131. ccxt/oceanex.py +2 -2
  132. ccxt/okcoin.py +2 -2
  133. ccxt/okx.py +6 -4
  134. ccxt/onetrading.py +3 -3
  135. ccxt/phemex.py +2 -2
  136. ccxt/poloniex.py +3 -3
  137. ccxt/pro/__init__.py +1 -1
  138. ccxt/pro/bitget.py +2 -0
  139. ccxt/pro/bitvavo.py +2 -2
  140. ccxt/probit.py +2 -2
  141. ccxt/timex.py +6 -4
  142. ccxt/upbit.py +2 -2
  143. ccxt/wazirx.py +2 -2
  144. ccxt/whitebit.py +3 -3
  145. ccxt/woo.py +3 -3
  146. ccxt/yobit.py +2 -2
  147. {ccxt-4.2.88.dist-info → ccxt-4.2.89.dist-info}/METADATA +4 -4
  148. {ccxt-4.2.88.dist-info → ccxt-4.2.89.dist-info}/RECORD +150 -150
  149. {ccxt-4.2.88.dist-info → ccxt-4.2.89.dist-info}/WHEEL +0 -0
  150. {ccxt-4.2.88.dist-info → ccxt-4.2.89.dist-info}/top_level.txt +0 -0
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinone import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Balances, Currencies, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -205,7 +205,7 @@ class coinone(Exchange, ImplicitAPI):
205
205
  },
206
206
  })
207
207
 
208
- async def fetch_currencies(self, params={}):
208
+ async def fetch_currencies(self, params={}) -> Currencies:
209
209
  """
210
210
  fetches all available currencies on an exchange
211
211
  :see: https://docs.coinone.co.kr/reference/currencies
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.coinsph 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, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import PermissionDenied
@@ -1421,7 +1421,7 @@ class coinsph(Exchange, ImplicitAPI):
1421
1421
  }
1422
1422
  return self.safe_string(statuses, status, status)
1423
1423
 
1424
- async def fetch_trading_fee(self, symbol: str, params={}):
1424
+ async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
1425
1425
  """
1426
1426
  fetch the trading fees for a market
1427
1427
  :see: https://coins-docs.github.io/rest-api/#trade-fee-user_data
@@ -1447,7 +1447,7 @@ class coinsph(Exchange, ImplicitAPI):
1447
1447
  tradingFee = self.safe_value(response, 0, {})
1448
1448
  return self.parse_trading_fee(tradingFee, market)
1449
1449
 
1450
- async def fetch_trading_fees(self, params={}):
1450
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
1451
1451
  """
1452
1452
  fetch the trading fees for multiple markets
1453
1453
  :see: https://coins-docs.github.io/rest-api/#trade-fee-user_data
@@ -1477,7 +1477,7 @@ class coinsph(Exchange, ImplicitAPI):
1477
1477
  result[symbol] = fee
1478
1478
  return result
1479
1479
 
1480
- def parse_trading_fee(self, fee, market: Market = None):
1480
+ def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
1481
1481
  #
1482
1482
  # {
1483
1483
  # "symbol": "ETHUSDT",
@@ -1493,6 +1493,8 @@ class coinsph(Exchange, ImplicitAPI):
1493
1493
  'symbol': symbol,
1494
1494
  'maker': self.safe_number(fee, 'makerCommission'),
1495
1495
  'taker': self.safe_number(fee, 'takerCommission'),
1496
+ 'percentage': None,
1497
+ 'tierBased': None,
1496
1498
  }
1497
1499
 
1498
1500
  async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.currencycom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currency, Int, Leverage, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Leverage, 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 ArgumentsRequired
@@ -326,7 +326,7 @@ class currencycom(Exchange, ImplicitAPI):
326
326
  #
327
327
  return self.safe_integer(response, 'serverTime')
328
328
 
329
- async def fetch_currencies(self, params={}):
329
+ async def fetch_currencies(self, params={}) -> Currencies:
330
330
  """
331
331
  fetches all available currencies on an exchange
332
332
  :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getCurrenciesUsingGET
@@ -628,7 +628,7 @@ class currencycom(Exchange, ImplicitAPI):
628
628
  })
629
629
  return result
630
630
 
631
- async def fetch_trading_fees(self, params={}):
631
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
632
632
  """
633
633
  fetch the trading fees for multiple markets
634
634
  :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.delta import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Greeks, Int, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Balances, Currencies, Currency, Greeks, Int, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, Trade
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -409,7 +409,7 @@ class delta(Exchange, ImplicitAPI):
409
409
  'info': response,
410
410
  }
411
411
 
412
- async def fetch_currencies(self, params={}):
412
+ async def fetch_currencies(self, params={}) -> Currencies:
413
413
  """
414
414
  fetches all available currencies on an exchange
415
415
  :see: https://docs.delta.exchange/#get-list-of-all-assets
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.deribit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currency, Greeks, Int, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, Greeks, Int, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, 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
@@ -518,7 +518,7 @@ class deribit(Exchange, ImplicitAPI):
518
518
  #
519
519
  return self.safe_integer(response, 'result')
520
520
 
521
- async def fetch_currencies(self, params={}):
521
+ async def fetch_currencies(self, params={}) -> Currencies:
522
522
  """
523
523
  fetches all available currencies on an exchange
524
524
  :see: https://docs.deribit.com/#public-get_currencies
@@ -1435,7 +1435,7 @@ class deribit(Exchange, ImplicitAPI):
1435
1435
  trades = self.safe_list(result, 'trades', [])
1436
1436
  return self.parse_trades(trades, market, since, limit)
1437
1437
 
1438
- async def fetch_trading_fees(self, params={}):
1438
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
1439
1439
  """
1440
1440
  fetch the trading fees for multiple markets
1441
1441
  :see: https://docs.deribit.com/#private-get_account_summary
@@ -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, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
11
+ from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, 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
@@ -366,7 +366,7 @@ class digifinex(Exchange, ImplicitAPI):
366
366
  },
367
367
  })
368
368
 
369
- async def fetch_currencies(self, params={}):
369
+ async def fetch_currencies(self, params={}) -> Currencies:
370
370
  """
371
371
  fetches all available currencies on an exchange
372
372
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -3076,7 +3076,7 @@ class digifinex(Exchange, ImplicitAPI):
3076
3076
  sorted = self.sort_by(rates, 'timestamp')
3077
3077
  return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
3078
3078
 
3079
- async def fetch_trading_fee(self, symbol: str, params={}):
3079
+ async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
3080
3080
  """
3081
3081
  fetch the trading fees for a market
3082
3082
  :see: https://docs.digifinex.com/en-ww/swap/v2/rest.html#tradingfee
@@ -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):
3108
+ def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
3109
3109
  #
3110
3110
  # {
3111
3111
  # "instrument_id": "BTCUSDTPERP",
@@ -3120,6 +3120,8 @@ class digifinex(Exchange, ImplicitAPI):
3120
3120
  'symbol': symbol,
3121
3121
  'maker': self.safe_number(fee, 'maker_fee_rate'),
3122
3122
  'taker': self.safe_number(fee, 'taker_fee_rate'),
3123
+ 'percentage': None,
3124
+ 'tierBased': None,
3123
3125
  }
3124
3126
 
3125
3127
  async def fetch_positions(self, symbols: Strings = None, params={}):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.exmo import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currencies, Currency, Int, MarginModification, 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
@@ -303,7 +303,7 @@ class exmo(Exchange, ImplicitAPI):
303
303
  """
304
304
  return await self.modify_margin_helper(symbol, amount, 'add', params)
305
305
 
306
- async def fetch_trading_fees(self, params={}):
306
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
307
307
  """
308
308
  fetch the trading fees for multiple markets
309
309
  :see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#90927062-256c-4b03-900f-2b99131f9a54
@@ -573,7 +573,7 @@ class exmo(Exchange, ImplicitAPI):
573
573
  }
574
574
  return self.assign_default_deposit_withdraw_fees(result)
575
575
 
576
- async def fetch_currencies(self, params={}):
576
+ async def fetch_currencies(self, params={}) -> Currencies:
577
577
  """
578
578
  fetches all available currencies on an exchange
579
579
  :see: https://documenter.getpostman.com/view/10287440/SzYXWKPi#7cdf0ca8-9ff6-4cf3-aa33-bcec83155c49
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.gate import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- 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
10
+ 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
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import PermissionDenied
@@ -1521,7 +1521,7 @@ class gate(Exchange, ImplicitAPI):
1521
1521
  defaultSettle = ['usdt'] if (type == 'swap') else ['btc']
1522
1522
  return self.safe_value(fetchMarketsContractOptions, 'settlementCurrencies', defaultSettle)
1523
1523
 
1524
- async def fetch_currencies(self, params={}):
1524
+ async def fetch_currencies(self, params={}) -> Currencies:
1525
1525
  """
1526
1526
  fetches all available currencies on an exchange
1527
1527
  :see: https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
@@ -1929,7 +1929,7 @@ class gate(Exchange, ImplicitAPI):
1929
1929
  'network': network,
1930
1930
  }
1931
1931
 
1932
- async def fetch_trading_fee(self, symbol: str, params={}):
1932
+ async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
1933
1933
  """
1934
1934
  fetch the trading fees for a market
1935
1935
  :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
@@ -1959,7 +1959,7 @@ class gate(Exchange, ImplicitAPI):
1959
1959
  #
1960
1960
  return self.parse_trading_fee(response, market)
1961
1961
 
1962
- async def fetch_trading_fees(self, params={}):
1962
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
1963
1963
  """
1964
1964
  fetch the trading fees for multiple markets
1965
1965
  :see: https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
@@ -2018,6 +2018,8 @@ class gate(Exchange, ImplicitAPI):
2018
2018
  'symbol': self.safe_string(market, 'symbol'),
2019
2019
  'maker': self.safe_number(info, makerKey),
2020
2020
  'taker': self.safe_number(info, takerKey),
2021
+ 'percentage': None,
2022
+ 'tierBased': None,
2021
2023
  }
2022
2024
 
2023
2025
  async def fetch_transaction_fees(self, codes: List[str] = None, params={}):
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.gemini import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
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, TradingFees, Transaction
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import PermissionDenied
@@ -303,7 +303,7 @@ class gemini(Exchange, ImplicitAPI):
303
303
  },
304
304
  })
305
305
 
306
- async def fetch_currencies(self, params={}):
306
+ async def fetch_currencies(self, params={}) -> Currencies:
307
307
  """
308
308
  fetches all available currencies on an exchange
309
309
  :param dict [params]: extra parameters specific to the endpoint
@@ -1049,7 +1049,7 @@ class gemini(Exchange, ImplicitAPI):
1049
1049
  result[code] = account
1050
1050
  return self.safe_balance(result)
1051
1051
 
1052
- async def fetch_trading_fees(self, params={}):
1052
+ async def fetch_trading_fees(self, params={}) -> TradingFees:
1053
1053
  """
1054
1054
  fetch the trading fees for multiple markets
1055
1055
  :see: https://docs.gemini.com/rest-api/#get-notional-volume
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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
- async def fetch_currencies(self, params={}):
805
+ async 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
- async def fetch_trading_fee(self, symbol: str, params={}):
1571
+ async 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
- async def fetch_trading_fees(self, params={}):
1600
+ async 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
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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
- async def fetch_currencies(self, params={}):
331
+ async 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
- async def fetch_trading_fees(self, params={}):
682
+ async 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/async_support/htx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.htx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
10
+ 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
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import PermissionDenied
@@ -1486,7 +1486,7 @@ class htx(Exchange, ImplicitAPI):
1486
1486
  #
1487
1487
  return self.safe_integer_2(response, 'data', 'ts')
1488
1488
 
1489
- def parse_trading_fee(self, fee, market: Market = None):
1489
+ def parse_trading_fee(self, fee, market: Market = None) -> TradingFeeInterface:
1490
1490
  #
1491
1491
  # {
1492
1492
  # "symbol":"btcusdt",
@@ -1502,9 +1502,11 @@ class htx(Exchange, ImplicitAPI):
1502
1502
  'symbol': self.safe_symbol(marketId, market),
1503
1503
  'maker': self.safe_number(fee, 'actualMakerRate'),
1504
1504
  'taker': self.safe_number(fee, 'actualTakerRate'),
1505
+ 'percentage': None,
1506
+ 'tierBased': None,
1505
1507
  }
1506
1508
 
1507
- async def fetch_trading_fee(self, symbol: str, params={}):
1509
+ async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
1508
1510
  """
1509
1511
  fetch the trading fees for a market
1510
1512
  :param str symbol: unified market symbol
@@ -2987,7 +2989,7 @@ class htx(Exchange, ImplicitAPI):
2987
2989
  defaultAccount = self.safe_value(accounts, 0, {})
2988
2990
  return self.safe_string(defaultAccount, 'id')
2989
2991
 
2990
- async def fetch_currencies(self, params={}):
2992
+ async def fetch_currencies(self, params={}) -> Currencies:
2991
2993
  """
2992
2994
  fetches all available currencies on an exchange
2993
2995
  :param dict [params]: extra parameters specific to the exchange API endpoint
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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 = await self.privateGetAccountAccounts(params)
955
955
  return response['data']
956
956
 
957
- async def fetch_currencies(self, params={}):
957
+ async 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
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.hyperliquid import ImplicitAPI
8
8
  import asyncio
9
- from ccxt.base.types import Balances, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Int, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Trade, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import ArgumentsRequired
@@ -208,7 +208,7 @@ class hyperliquid(Exchange, ImplicitAPI):
208
208
  super(hyperliquid, self).set_sandbox_mode(enabled)
209
209
  self.options['sandboxMode'] = enabled
210
210
 
211
- async def fetch_currencies(self, params={}):
211
+ async def fetch_currencies(self, params={}) -> Currencies:
212
212
  """
213
213
  fetches all available currencies on an exchange
214
214
  :see: https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-exchange-metadata
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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
- async def fetch_trading_fees(self, params={}):
612
+ async 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
- async def fetch_currencies(self, params={}):
715
+ async 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
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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 = await self.publicGetGetRecentTrades(self.extend(request, params))
587
587
  return self.parse_trades(response['Trades'], market, since, limit)
588
588
 
589
- async def fetch_trading_fees(self, params={}):
589
+ async 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
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.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
- async def fetch_currencies(self, params={}):
644
+ async 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
- async def fetch_trading_fee(self, symbol: str, params={}):
700
+ async 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
@@ -9,7 +9,7 @@ import asyncio
9
9
  import hashlib
10
10
  import math
11
11
  import json
12
- from ccxt.base.types import Account, Balances, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
12
+ 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
13
13
  from typing import List
14
14
  from ccxt.base.errors import ExchangeError
15
15
  from ccxt.base.errors import PermissionDenied
@@ -1131,7 +1131,7 @@ class kucoin(Exchange, ImplicitAPI):
1131
1131
  })
1132
1132
  return result
1133
1133
 
1134
- async def fetch_currencies(self, params={}):
1134
+ async def fetch_currencies(self, params={}) -> Currencies:
1135
1135
  """
1136
1136
  fetches all available currencies on an exchange
1137
1137
  :see: https://docs.kucoin.com/#get-currencies
@@ -2961,7 +2961,7 @@ class kucoin(Exchange, ImplicitAPI):
2961
2961
  'fee': fee,
2962
2962
  }, market)
2963
2963
 
2964
- async def fetch_trading_fee(self, symbol: str, params={}):
2964
+ async def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
2965
2965
  """
2966
2966
  fetch the trading fees for a market
2967
2967
  :see: https://docs.kucoin.com/#actual-fee-rate-of-the-trading-pair
@@ -3315,9 +3315,9 @@ class kucoin(Exchange, ImplicitAPI):
3315
3315
 
3316
3316
  def parse_balance_helper(self, entry):
3317
3317
  account = self.account()
3318
- account['used'] = self.safe_string(entry, 'holdBalance')
3319
- account['free'] = self.safe_string(entry, 'availableBalance')
3320
- account['total'] = self.safe_string(entry, 'totalBalance')
3318
+ account['used'] = self.safe_string_2(entry, 'holdBalance', 'hold')
3319
+ account['free'] = self.safe_string_2(entry, 'availableBalance', 'available')
3320
+ account['total'] = self.safe_string_2(entry, 'totalBalance', 'total')
3321
3321
  debt = self.safe_string(entry, 'liability')
3322
3322
  interest = self.safe_string(entry, 'interest')
3323
3323
  account['debt'] = Precise.string_add(debt, interest)
@@ -3366,7 +3366,7 @@ class kucoin(Exchange, ImplicitAPI):
3366
3366
  request['type'] = type
3367
3367
  response = await self.privateGetAccounts(self.extend(request, query))
3368
3368
  #
3369
- # Spot and Cross
3369
+ # Spot
3370
3370
  #
3371
3371
  # {
3372
3372
  # "code": "200000",
@@ -3382,35 +3382,59 @@ class kucoin(Exchange, ImplicitAPI):
3382
3382
  # ]
3383
3383
  # }
3384
3384
  #
3385
+ # Cross
3386
+ #
3387
+ # {
3388
+ # "code": "200000",
3389
+ # "data": {
3390
+ # "debtRatio": "0",
3391
+ # "accounts": [
3392
+ # {
3393
+ # "currency": "USDT",
3394
+ # "totalBalance": "5",
3395
+ # "availableBalance": "5",
3396
+ # "holdBalance": "0",
3397
+ # "liability": "0",
3398
+ # "maxBorrowSize": "20"
3399
+ # },
3400
+ # ]
3401
+ # }
3402
+ # }
3403
+ #
3385
3404
  # Isolated
3386
3405
  #
3387
3406
  # {
3388
3407
  # "code": "200000",
3389
3408
  # "data": {
3390
- # "totalConversionBalance": "0",
3391
- # "liabilityConversionBalance": "0",
3409
+ # "totalAssetOfQuoteCurrency": "0",
3410
+ # "totalLiabilityOfQuoteCurrency": "0",
3411
+ # "timestamp": 1712085661155,
3392
3412
  # "assets": [
3393
3413
  # {
3394
3414
  # "symbol": "MANA-USDT",
3395
- # "status": "CLEAR",
3415
+ # "status": "EFFECTIVE",
3396
3416
  # "debtRatio": "0",
3397
3417
  # "baseAsset": {
3398
3418
  # "currency": "MANA",
3399
- # "totalBalance": "0",
3400
- # "holdBalance": "0",
3401
- # "availableBalance": "0",
3419
+ # "borrowEnabled": True,
3420
+ # "transferInEnabled": True,
3421
+ # "total": "0",
3422
+ # "hold": "0",
3423
+ # "available": "0",
3402
3424
  # "liability": "0",
3403
3425
  # "interest": "0",
3404
- # "borrowableAmount": "0"
3426
+ # "maxBorrowSize": "0"
3405
3427
  # },
3406
3428
  # "quoteAsset": {
3407
3429
  # "currency": "USDT",
3408
- # "totalBalance": "0",
3409
- # "holdBalance": "0",
3410
- # "availableBalance": "0",
3430
+ # "borrowEnabled": True,
3431
+ # "transferInEnabled": True,
3432
+ # "total": "0",
3433
+ # "hold": "0",
3434
+ # "available": "0",
3411
3435
  # "liability": "0",
3412
3436
  # "interest": "0",
3413
- # "borrowableAmount": "0"
3437
+ # "maxBorrowSize": "0"
3414
3438
  # }
3415
3439
  # },
3416
3440
  # ...
@@ -7,7 +7,7 @@ from ccxt.async_support.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
- async def fetch_currencies(self, params={}):
428
+ async 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