ccxt 4.4.15__py2.py3-none-any.whl → 4.4.17__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.
Files changed (149) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/mexc.py +1 -0
  3. ccxt/ascendex.py +5 -5
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/ascendex.py +5 -5
  6. ccxt/async_support/base/exchange.py +1 -1
  7. ccxt/async_support/bigone.py +6 -4
  8. ccxt/async_support/binance.py +66 -10
  9. ccxt/async_support/bingx.py +61 -6
  10. ccxt/async_support/bit2c.py +6 -4
  11. ccxt/async_support/bitbank.py +6 -4
  12. ccxt/async_support/bitbns.py +6 -4
  13. ccxt/async_support/bitfinex.py +4 -2
  14. ccxt/async_support/bitfinex2.py +4 -2
  15. ccxt/async_support/bitget.py +6 -5
  16. ccxt/async_support/bitmart.py +5 -4
  17. ccxt/async_support/bitmex.py +4 -4
  18. ccxt/async_support/bitso.py +5 -4
  19. ccxt/async_support/bitstamp.py +6 -4
  20. ccxt/async_support/bitvavo.py +8 -6
  21. ccxt/async_support/blockchaincom.py +11 -8
  22. ccxt/async_support/blofin.py +21 -0
  23. ccxt/async_support/bybit.py +12 -9
  24. ccxt/async_support/cex.py +5 -4
  25. ccxt/async_support/coinbase.py +4 -4
  26. ccxt/async_support/coinbaseinternational.py +4 -8
  27. ccxt/async_support/coinex.py +5 -5
  28. ccxt/async_support/coinone.py +6 -3
  29. ccxt/async_support/coinsph.py +5 -5
  30. ccxt/async_support/cryptocom.py +5 -4
  31. ccxt/async_support/currencycom.py +5 -5
  32. ccxt/async_support/delta.py +7 -5
  33. ccxt/async_support/deribit.py +6 -4
  34. ccxt/async_support/digifinex.py +6 -4
  35. ccxt/async_support/exmo.py +6 -4
  36. ccxt/async_support/gate.py +5 -4
  37. ccxt/async_support/gemini.py +4 -3
  38. ccxt/async_support/hashkey.py +7 -5
  39. ccxt/async_support/hitbtc.py +6 -5
  40. ccxt/async_support/hollaex.py +6 -5
  41. ccxt/async_support/htx.py +15 -5
  42. ccxt/async_support/hyperliquid.py +8 -7
  43. ccxt/async_support/idex.py +4 -4
  44. ccxt/async_support/independentreserve.py +4 -4
  45. ccxt/async_support/indodax.py +3 -3
  46. ccxt/async_support/kraken.py +7 -5
  47. ccxt/async_support/kucoin.py +6 -5
  48. ccxt/async_support/kucoinfutures.py +5 -3
  49. ccxt/async_support/kuna.py +9 -15
  50. ccxt/async_support/lbank.py +14 -12
  51. ccxt/async_support/lykke.py +6 -4
  52. ccxt/async_support/mexc.py +7 -6
  53. ccxt/async_support/ndax.py +33 -5
  54. ccxt/async_support/oceanex.py +4 -4
  55. ccxt/async_support/okcoin.py +8 -6
  56. ccxt/async_support/okx.py +50 -7
  57. ccxt/async_support/onetrading.py +6 -5
  58. ccxt/async_support/oxfun.py +6 -6
  59. ccxt/async_support/paymium.py +6 -5
  60. ccxt/async_support/phemex.py +8 -6
  61. ccxt/async_support/poloniex.py +6 -4
  62. ccxt/async_support/probit.py +7 -6
  63. ccxt/async_support/timex.py +8 -12
  64. ccxt/async_support/tokocrypto.py +5 -5
  65. ccxt/async_support/upbit.py +7 -6
  66. ccxt/async_support/wavesexchange.py +9 -9
  67. ccxt/async_support/wazirx.py +24 -4
  68. ccxt/async_support/whitebit.py +6 -4
  69. ccxt/async_support/woo.py +6 -4
  70. ccxt/async_support/xt.py +7 -5
  71. ccxt/async_support/yobit.py +32 -23
  72. ccxt/async_support/zonda.py +31 -6
  73. ccxt/base/exchange.py +14 -2
  74. ccxt/base/types.py +8 -0
  75. ccxt/bigone.py +6 -4
  76. ccxt/binance.py +66 -10
  77. ccxt/bingx.py +61 -6
  78. ccxt/bit2c.py +6 -4
  79. ccxt/bitbank.py +6 -4
  80. ccxt/bitbns.py +6 -4
  81. ccxt/bitfinex.py +4 -2
  82. ccxt/bitfinex2.py +4 -2
  83. ccxt/bitget.py +6 -5
  84. ccxt/bitmart.py +5 -4
  85. ccxt/bitmex.py +4 -4
  86. ccxt/bitso.py +5 -4
  87. ccxt/bitstamp.py +6 -4
  88. ccxt/bitvavo.py +8 -6
  89. ccxt/blockchaincom.py +11 -8
  90. ccxt/blofin.py +21 -0
  91. ccxt/bybit.py +12 -9
  92. ccxt/cex.py +5 -4
  93. ccxt/coinbase.py +4 -4
  94. ccxt/coinbaseinternational.py +4 -8
  95. ccxt/coinex.py +5 -5
  96. ccxt/coinone.py +6 -3
  97. ccxt/coinsph.py +5 -5
  98. ccxt/cryptocom.py +5 -4
  99. ccxt/currencycom.py +5 -5
  100. ccxt/delta.py +7 -5
  101. ccxt/deribit.py +6 -4
  102. ccxt/digifinex.py +6 -4
  103. ccxt/exmo.py +6 -4
  104. ccxt/gate.py +5 -4
  105. ccxt/gemini.py +4 -3
  106. ccxt/hashkey.py +7 -5
  107. ccxt/hitbtc.py +6 -5
  108. ccxt/hollaex.py +6 -5
  109. ccxt/htx.py +15 -5
  110. ccxt/hyperliquid.py +8 -7
  111. ccxt/idex.py +4 -4
  112. ccxt/independentreserve.py +4 -4
  113. ccxt/indodax.py +3 -3
  114. ccxt/kraken.py +7 -5
  115. ccxt/kucoin.py +6 -5
  116. ccxt/kucoinfutures.py +5 -3
  117. ccxt/kuna.py +9 -15
  118. ccxt/lbank.py +14 -12
  119. ccxt/lykke.py +6 -4
  120. ccxt/mexc.py +7 -6
  121. ccxt/ndax.py +33 -5
  122. ccxt/oceanex.py +4 -4
  123. ccxt/okcoin.py +8 -6
  124. ccxt/okx.py +50 -7
  125. ccxt/onetrading.py +6 -5
  126. ccxt/oxfun.py +6 -6
  127. ccxt/paymium.py +6 -5
  128. ccxt/phemex.py +8 -6
  129. ccxt/poloniex.py +6 -4
  130. ccxt/pro/__init__.py +1 -1
  131. ccxt/pro/bitvavo.py +1 -1
  132. ccxt/probit.py +7 -6
  133. ccxt/test/tests_async.py +1 -0
  134. ccxt/test/tests_sync.py +1 -0
  135. ccxt/timex.py +8 -12
  136. ccxt/tokocrypto.py +5 -5
  137. ccxt/upbit.py +7 -6
  138. ccxt/wavesexchange.py +9 -9
  139. ccxt/wazirx.py +24 -4
  140. ccxt/whitebit.py +6 -4
  141. ccxt/woo.py +6 -4
  142. ccxt/xt.py +7 -5
  143. ccxt/yobit.py +32 -23
  144. ccxt/zonda.py +31 -6
  145. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/METADATA +4 -4
  146. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/RECORD +149 -149
  147. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/LICENSE.txt +0 -0
  148. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/WHEEL +0 -0
  149. {ccxt-4.4.15.dist-info → ccxt-4.4.17.dist-info}/top_level.txt +0 -0
ccxt/async_support/okx.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.okx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Balances, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, Greeks, Int, LedgerEntry, Leverage, LeverageTier, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Balances, Conversion, CrossBorrowRate, CrossBorrowRates, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, MarginModification, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from typing import Any
13
13
  from ccxt.base.errors import ExchangeError
@@ -123,6 +123,7 @@ class okx(Exchange, ImplicitAPI):
123
123
  'fetchMarketLeverageTiers': True,
124
124
  'fetchMarkets': True,
125
125
  'fetchMarkOHLCV': True,
126
+ 'fetchMarkPrice': True,
126
127
  'fetchMarkPrices': True,
127
128
  'fetchMySettlementHistory': False,
128
129
  'fetchMyTrades': True,
@@ -1814,6 +1815,16 @@ class okx(Exchange, ImplicitAPI):
1814
1815
  # "sodUtc0": "0.07872",
1815
1816
  # "sodUtc8": "0.07345"
1816
1817
  # }
1818
+ # {
1819
+ # instId: 'LTC-USDT',
1820
+ # idxPx: '65.74',
1821
+ # open24h: '65.37',
1822
+ # high24h: '66.15',
1823
+ # low24h: '64.97',
1824
+ # sodUtc0: '65.68',
1825
+ # sodUtc8: '65.54',
1826
+ # ts: '1728467346900'
1827
+ # },
1817
1828
  #
1818
1829
  timestamp = self.safe_integer(ticker, 'ts')
1819
1830
  marketId = self.safe_string(ticker, 'instId')
@@ -1847,6 +1858,7 @@ class okx(Exchange, ImplicitAPI):
1847
1858
  'baseVolume': baseVolume,
1848
1859
  'quoteVolume': quoteVolume,
1849
1860
  'markPrice': self.safe_string(ticker, 'markPx'),
1861
+ 'indexPrice': self.safe_string(ticker, 'idxPx'),
1850
1862
  'info': ticker,
1851
1863
  }, market)
1852
1864
 
@@ -1947,6 +1959,37 @@ class okx(Exchange, ImplicitAPI):
1947
1959
  tickers = self.safe_list(response, 'data', [])
1948
1960
  return self.parse_tickers(tickers, symbols)
1949
1961
 
1962
+ async def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
1963
+ """
1964
+ fetches mark price for the market
1965
+ :see: https://www.okx.com/docs-v5/en/#public-data-rest-api-get-mark-price
1966
+ :param str symbol: unified symbol of the market to fetch the ticker for
1967
+ :param dict [params]: extra parameters specific to the exchange API endpoint
1968
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
1969
+ """
1970
+ await self.load_markets()
1971
+ market = self.market(symbol)
1972
+ request: dict = {
1973
+ 'instId': market['id'],
1974
+ }
1975
+ response = await self.publicGetPublicMarkPrice(self.extend(request, params))
1976
+ #
1977
+ # {
1978
+ # "code": "0",
1979
+ # "data": [
1980
+ # {
1981
+ # "instId": "ETH-USDT",
1982
+ # "instType": "MARGIN",
1983
+ # "markPx": "2403.98",
1984
+ # "ts": "1728578500703"
1985
+ # }
1986
+ # ],
1987
+ # "msg": ""
1988
+ # }
1989
+ #
1990
+ data = self.safe_list(response, 'data')
1991
+ return self.parse_ticker(self.safe_dict(data, 0), market)
1992
+
1950
1993
  async def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
1951
1994
  """
1952
1995
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
@@ -1967,7 +2010,7 @@ class okx(Exchange, ImplicitAPI):
1967
2010
  defaultUnderlying = self.safe_string(self.options, 'defaultUnderlying', 'BTC-USD')
1968
2011
  currencyId = self.safe_string_2(params, 'uly', 'marketId', defaultUnderlying)
1969
2012
  if currencyId is None:
1970
- raise ArgumentsRequired(self.id + ' fetchTickers() requires an underlying uly or marketId parameter for options markets')
2013
+ raise ArgumentsRequired(self.id + ' fetchMarkPrices() requires an underlying uly or marketId parameter for options markets')
1971
2014
  else:
1972
2015
  request['uly'] = currencyId
1973
2016
  response = await self.publicGetPublicMarkPrice(self.extend(request, params))
@@ -4425,7 +4468,7 @@ class okx(Exchange, ImplicitAPI):
4425
4468
  'fee': fee,
4426
4469
  }, currency)
4427
4470
 
4428
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4471
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4429
4472
  #
4430
4473
  # {
4431
4474
  # "addr": "okbtothemoon",
@@ -4513,14 +4556,14 @@ class okx(Exchange, ImplicitAPI):
4513
4556
  networkCode = self.network_id_to_code(network, code)
4514
4557
  self.check_address(address)
4515
4558
  return {
4559
+ 'info': depositAddress,
4516
4560
  'currency': code,
4561
+ 'network': networkCode,
4517
4562
  'address': address,
4518
4563
  'tag': tag,
4519
- 'network': networkCode,
4520
- 'info': depositAddress,
4521
4564
  }
4522
4565
 
4523
- async def fetch_deposit_addresses_by_network(self, code: str, params={}):
4566
+ async def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4524
4567
  """
4525
4568
  fetch a dictionary of addresses for a currency, indexed by network
4526
4569
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -4560,7 +4603,7 @@ class okx(Exchange, ImplicitAPI):
4560
4603
  parsed = self.parse_deposit_addresses(filtered, [currency['code']], False)
4561
4604
  return self.index_by(parsed, 'network')
4562
4605
 
4563
- async def fetch_deposit_address(self, code: str, params={}):
4606
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4564
4607
  """
4565
4608
  fetch the deposit address for a currency associated with self account
4566
4609
  :see: https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-deposit-address
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.onetrading import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
8
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -63,6 +63,7 @@ class onetrading(Exchange, ImplicitAPI):
63
63
  'fetchDeposit': False,
64
64
  'fetchDepositAddress': True,
65
65
  'fetchDepositAddresses': False,
66
+ 'fetchDepositAddressesByNetwork': False,
66
67
  'fetchDeposits': True,
67
68
  'fetchDepositsWithdrawals': False,
68
69
  'fetchFundingHistory': False,
@@ -1003,7 +1004,7 @@ class onetrading(Exchange, ImplicitAPI):
1003
1004
  #
1004
1005
  return self.parse_balance(response)
1005
1006
 
1006
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1007
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1007
1008
  code = None
1008
1009
  if currency is not None:
1009
1010
  code = currency['code']
@@ -1011,11 +1012,11 @@ class onetrading(Exchange, ImplicitAPI):
1011
1012
  tag = self.safe_string(depositAddress, 'destination_tag')
1012
1013
  self.check_address(address)
1013
1014
  return {
1015
+ 'info': depositAddress,
1014
1016
  'currency': code,
1017
+ 'network': None,
1015
1018
  'address': address,
1016
1019
  'tag': tag,
1017
- 'network': None,
1018
- 'info': depositAddress,
1019
1020
  }
1020
1021
 
1021
1022
  async def create_deposit_address(self, code: str, params={}):
@@ -1041,7 +1042,7 @@ class onetrading(Exchange, ImplicitAPI):
1041
1042
  #
1042
1043
  return self.parse_deposit_address(response, currency)
1043
1044
 
1044
- async def fetch_deposit_address(self, code: str, params={}):
1045
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1045
1046
  """
1046
1047
  fetch the deposit address for a currency associated with self account
1047
1048
  :param str code: unified currency code
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.oxfun import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -77,7 +77,7 @@ class oxfun(Exchange, ImplicitAPI):
77
77
  'fetchCrossBorrowRates': False,
78
78
  'fetchCurrencies': True,
79
79
  'fetchDeposit': False,
80
- 'fetchDepositAddress': False,
80
+ 'fetchDepositAddress': True,
81
81
  'fetchDepositAddresses': False,
82
82
  'fetchDepositAddressesByNetwork': False,
83
83
  'fetchDeposits': True,
@@ -1710,7 +1710,7 @@ class oxfun(Exchange, ImplicitAPI):
1710
1710
  }
1711
1711
  return self.safe_string(statuses, status, status)
1712
1712
 
1713
- async def fetch_deposit_address(self, code: str, params={}):
1713
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1714
1714
  """
1715
1715
  fetch the deposit address for a currency associated with self account
1716
1716
  :see: https://docs.ox.fun/?json#get-v3-deposit-addresses
@@ -1737,18 +1737,18 @@ class oxfun(Exchange, ImplicitAPI):
1737
1737
  data = self.safe_dict(response, 'data', {})
1738
1738
  return self.parse_deposit_address(data, currency)
1739
1739
 
1740
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1740
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1741
1741
  #
1742
1742
  # {"address":"0x998dEc76151FB723963Bd8AFD517687b38D33dE8"}
1743
1743
  #
1744
1744
  address = self.safe_string(depositAddress, 'address')
1745
1745
  self.check_address(address)
1746
1746
  return {
1747
+ 'info': depositAddress,
1747
1748
  'currency': currency['code'],
1749
+ 'network': None,
1748
1750
  'address': address,
1749
1751
  'tag': None,
1750
- 'network': None,
1751
- 'info': depositAddress,
1752
1752
  }
1753
1753
 
1754
1754
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.paymium import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TransferEntry
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.decimal_to_precision import TICK_SIZE
@@ -35,6 +35,7 @@ class paymium(Exchange, ImplicitAPI):
35
35
  'fetchBalance': True,
36
36
  'fetchDepositAddress': True,
37
37
  'fetchDepositAddresses': True,
38
+ 'fetchDepositAddressesByNetwork': False,
38
39
  'fetchFundingHistory': False,
39
40
  'fetchFundingRate': False,
40
41
  'fetchFundingRateHistory': False,
@@ -302,7 +303,7 @@ class paymium(Exchange, ImplicitAPI):
302
303
  #
303
304
  return self.parse_deposit_address(response)
304
305
 
305
- async def fetch_deposit_address(self, code: str, params={}):
306
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
306
307
  """
307
308
  fetch the deposit address for a currency associated with self account
308
309
  :see: https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses~1%7Baddress%7D/get
@@ -325,7 +326,7 @@ class paymium(Exchange, ImplicitAPI):
325
326
  #
326
327
  return self.parse_deposit_address(response)
327
328
 
328
- async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
329
+ async def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
329
330
  """
330
331
  fetch deposit addresses for multiple currencies and chain types
331
332
  :see: https://paymium.github.io/api-documentation/#tag/User/paths/~1user~1addresses/get
@@ -347,7 +348,7 @@ class paymium(Exchange, ImplicitAPI):
347
348
  #
348
349
  return self.parse_deposit_addresses(response, codes)
349
350
 
350
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
351
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
351
352
  #
352
353
  # {
353
354
  # "address": "1HdjGr6WCTcnmW1tNNsHX7fh4Jr5C2PeKe",
@@ -361,9 +362,9 @@ class paymium(Exchange, ImplicitAPI):
361
362
  return {
362
363
  'info': depositAddress,
363
364
  'currency': self.safe_currency_code(currencyId, currency),
365
+ 'network': None,
364
366
  'address': address,
365
367
  'tag': None,
366
- 'network': None,
367
368
  }
368
369
 
369
370
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.phemex import ImplicitAPI
8
8
  import hashlib
9
9
  import numbers
10
- from ccxt.base.types import Balances, Currencies, Currency, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -64,6 +64,8 @@ class phemex(Exchange, ImplicitAPI):
64
64
  'fetchCrossBorrowRates': False,
65
65
  'fetchCurrencies': True,
66
66
  'fetchDepositAddress': True,
67
+ 'fetchDepositAddresses': False,
68
+ 'fetchDepositAddressesByNetwork': False,
67
69
  'fetchDeposits': True,
68
70
  'fetchFundingHistory': True,
69
71
  'fetchFundingRate': True,
@@ -3145,7 +3147,7 @@ class phemex(Exchange, ImplicitAPI):
3145
3147
  data = self.safe_value(data, 'rows', [])
3146
3148
  return self.parse_trades(data, market, since, limit)
3147
3149
 
3148
- async def fetch_deposit_address(self, code: str, params={}):
3150
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
3149
3151
  """
3150
3152
  fetch the deposit address for a currency associated with self account
3151
3153
  :param str code: unified currency code
@@ -3157,9 +3159,9 @@ class phemex(Exchange, ImplicitAPI):
3157
3159
  request: dict = {
3158
3160
  'currency': currency['id'],
3159
3161
  }
3160
- defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
3162
+ defaultNetworks = self.safe_dict(self.options, 'defaultNetworks')
3161
3163
  defaultNetwork = self.safe_string_upper(defaultNetworks, code)
3162
- networks = self.safe_value(self.options, 'networks', {})
3164
+ networks = self.safe_dict(self.options, 'networks', {})
3163
3165
  network = self.safe_string_upper(params, 'network', defaultNetwork)
3164
3166
  network = self.safe_string(networks, network, network)
3165
3167
  if network is None:
@@ -3182,11 +3184,11 @@ class phemex(Exchange, ImplicitAPI):
3182
3184
  tag = self.safe_string(data, 'tag')
3183
3185
  self.check_address(address)
3184
3186
  return {
3187
+ 'info': response,
3185
3188
  'currency': code,
3189
+ 'network': None,
3186
3190
  'address': address,
3187
3191
  'tag': tag,
3188
- 'network': None,
3189
- 'info': response,
3190
3192
  }
3191
3193
 
3192
3194
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.poloniex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, 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 AuthenticationError
@@ -56,6 +56,8 @@ class poloniex(Exchange, ImplicitAPI):
56
56
  'fetchClosedOrder': False,
57
57
  'fetchCurrencies': True,
58
58
  'fetchDepositAddress': True,
59
+ 'fetchDepositAddresses': False,
60
+ 'fetchDepositAddressesByNetwork': False,
59
61
  'fetchDeposits': True,
60
62
  'fetchDepositsWithdrawals': True,
61
63
  'fetchDepositWithdrawFee': 'emulated',
@@ -1700,7 +1702,7 @@ class poloniex(Exchange, ImplicitAPI):
1700
1702
  'info': response,
1701
1703
  }
1702
1704
 
1703
- async def fetch_deposit_address(self, code: str, params={}):
1705
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1704
1706
  """
1705
1707
  fetch the deposit address for a currency associated with self account
1706
1708
  :see: https://api-docs.poloniex.com/spot/api/private/wallet#deposit-addresses
@@ -1737,11 +1739,11 @@ class poloniex(Exchange, ImplicitAPI):
1737
1739
  tag = address
1738
1740
  address = depositAddress
1739
1741
  return {
1742
+ 'info': response,
1740
1743
  'currency': code,
1744
+ 'network': network,
1741
1745
  'address': address,
1742
1746
  'tag': tag,
1743
- 'network': network,
1744
- 'info': response,
1745
1747
  }
1746
1748
 
1747
1749
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.probit import ImplicitAPI
8
8
  import math
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, 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 AuthenticationError
@@ -62,6 +62,7 @@ class probit(Exchange, ImplicitAPI):
62
62
  'fetchCurrencies': True,
63
63
  'fetchDepositAddress': True,
64
64
  'fetchDepositAddresses': True,
65
+ 'fetchDepositAddressesByNetwork': False,
65
66
  'fetchDeposits': True,
66
67
  'fetchDepositsWithdrawals': True,
67
68
  'fetchFundingHistory': False,
@@ -1232,7 +1233,7 @@ class probit(Exchange, ImplicitAPI):
1232
1233
  data = self.safe_dict(response, 'data')
1233
1234
  return self.parse_order(data)
1234
1235
 
1235
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1236
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1236
1237
  address = self.safe_string(depositAddress, 'address')
1237
1238
  tag = self.safe_string(depositAddress, 'destination_tag')
1238
1239
  currencyId = self.safe_string(depositAddress, 'currency_id')
@@ -1241,14 +1242,14 @@ class probit(Exchange, ImplicitAPI):
1241
1242
  network = self.safe_string(depositAddress, 'platform_id')
1242
1243
  self.check_address(address)
1243
1244
  return {
1245
+ 'info': depositAddress,
1244
1246
  'currency': code,
1247
+ 'network': network,
1245
1248
  'address': address,
1246
1249
  'tag': tag,
1247
- 'network': network,
1248
- 'info': depositAddress,
1249
1250
  }
1250
1251
 
1251
- async def fetch_deposit_address(self, code: str, params={}):
1252
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1252
1253
  """
1253
1254
  :see: https://docs-en.probit.com/reference/deposit_address
1254
1255
  fetch the deposit address for a currency associated with self account
@@ -1298,7 +1299,7 @@ class probit(Exchange, ImplicitAPI):
1298
1299
  raise InvalidAddress(self.id + ' fetchDepositAddress() returned an empty response')
1299
1300
  return self.parse_deposit_address(firstAddress, currency)
1300
1301
 
1301
- async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
1302
+ async def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
1302
1303
  """
1303
1304
  :see: https://docs-en.probit.com/reference/deposit_address
1304
1305
  fetch deposit addresses for multiple currencies and chain types
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.timex import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
8
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -359,11 +359,7 @@ class timex(Exchange, ImplicitAPI):
359
359
  # },
360
360
  # ]
361
361
  #
362
- result = []
363
- for i in range(0, len(response)):
364
- currency = response[i]
365
- result.append(self.parse_currency(currency))
366
- return self.index_by(result, 'code')
362
+ return self.parse_currencies(response)
367
363
 
368
364
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
369
365
  """
@@ -1239,7 +1235,7 @@ class timex(Exchange, ImplicitAPI):
1239
1235
  'info': market,
1240
1236
  }
1241
1237
 
1242
- def parse_currency(self, currency: dict):
1238
+ def parse_currency(self, currency: dict) -> Currency:
1243
1239
  #
1244
1240
  # {
1245
1241
  # "symbol": "BTC",
@@ -1300,7 +1296,7 @@ class timex(Exchange, ImplicitAPI):
1300
1296
  for i in range(0, -dotIndex):
1301
1297
  fraction += '0'
1302
1298
  fee = self.parse_number(fraction + feeString)
1303
- return {
1299
+ return self.safe_currency_structure({
1304
1300
  'id': code,
1305
1301
  'code': code,
1306
1302
  'info': currency,
@@ -1316,7 +1312,7 @@ class timex(Exchange, ImplicitAPI):
1316
1312
  'amount': {'min': None, 'max': None},
1317
1313
  },
1318
1314
  'networks': {},
1319
- }
1315
+ })
1320
1316
 
1321
1317
  def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
1322
1318
  #
@@ -1514,7 +1510,7 @@ class timex(Exchange, ImplicitAPI):
1514
1510
  'trades': rawTrades,
1515
1511
  }, market)
1516
1512
 
1517
- async def fetch_deposit_address(self, code: str, params={}):
1513
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1518
1514
  """
1519
1515
  fetch the deposit address for a currency associated with self account, does not accept params["network"]
1520
1516
  :see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Currency/selectCurrencyBySymbol
@@ -1548,7 +1544,7 @@ class timex(Exchange, ImplicitAPI):
1548
1544
  data = self.safe_dict(response, 'currency', {})
1549
1545
  return self.parse_deposit_address(data, currency)
1550
1546
 
1551
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1547
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1552
1548
  #
1553
1549
  # {
1554
1550
  # symbol: 'BTC',
@@ -1567,9 +1563,9 @@ class timex(Exchange, ImplicitAPI):
1567
1563
  return {
1568
1564
  'info': depositAddress,
1569
1565
  'currency': self.safe_currency_code(currencyId, currency),
1566
+ 'network': None,
1570
1567
  'address': self.safe_string(depositAddress, 'address'),
1571
1568
  'tag': None,
1572
- 'network': None,
1573
1569
  }
1574
1570
 
1575
1571
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.tokocrypto 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, Currency, DepositAddress, 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 AuthenticationError
@@ -1950,10 +1950,10 @@ class tokocrypto(Exchange, ImplicitAPI):
1950
1950
  trades = self.safe_list(data, 'list', [])
1951
1951
  return self.parse_trades(trades, market, since, limit)
1952
1952
 
1953
- async def fetch_deposit_address(self, code: str, params={}):
1953
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1954
1954
  """
1955
- :see: https://www.tokocrypto.com/apidocs/#deposit-address-signed
1956
1955
  fetch the deposit address for a currency associated with self account
1956
+ :see: https://www.tokocrypto.com/apidocs/#deposit-address-signed
1957
1957
  :param str code: unified currency code
1958
1958
  :param dict [params]: extra parameters specific to the exchange API endpoint
1959
1959
  :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
@@ -1995,11 +1995,11 @@ class tokocrypto(Exchange, ImplicitAPI):
1995
1995
  tag = None
1996
1996
  self.check_address(address)
1997
1997
  return {
1998
+ 'info': response,
1998
1999
  'currency': code,
2000
+ 'network': self.safe_string(data, 'network'),
1999
2001
  'address': address,
2000
2002
  'tag': tag,
2001
- 'network': self.safe_string(data, 'network'),
2002
- 'info': response,
2003
2003
  }
2004
2004
 
2005
2005
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.upbit import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
8
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -51,6 +51,7 @@ class upbit(Exchange, ImplicitAPI):
51
51
  'fetchDeposit': True,
52
52
  'fetchDepositAddress': True,
53
53
  'fetchDepositAddresses': True,
54
+ 'fetchDepositAddressesByNetwork': False,
54
55
  'fetchDeposits': True,
55
56
  'fetchFundingHistory': False,
56
57
  'fetchFundingRate': False,
@@ -1696,7 +1697,7 @@ class upbit(Exchange, ImplicitAPI):
1696
1697
  #
1697
1698
  return self.parse_order(response)
1698
1699
 
1699
- async def fetch_deposit_addresses(self, codes: Strings = None, params={}):
1700
+ async def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
1700
1701
  """
1701
1702
  :see: https://docs.upbit.com/reference/%EC%A0%84%EC%B2%B4-%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%A1%B0%ED%9A%8C
1702
1703
  fetch deposit addresses for multiple currencies and chain types
@@ -1727,7 +1728,7 @@ class upbit(Exchange, ImplicitAPI):
1727
1728
  #
1728
1729
  return self.parse_deposit_addresses(response, codes)
1729
1730
 
1730
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1731
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1731
1732
  #
1732
1733
  # {
1733
1734
  # currency: 'XRP',
@@ -1743,14 +1744,14 @@ class upbit(Exchange, ImplicitAPI):
1743
1744
  networkId = self.safe_string(depositAddress, 'net_type')
1744
1745
  self.check_address(address)
1745
1746
  return {
1747
+ 'info': depositAddress,
1746
1748
  'currency': code,
1749
+ 'network': self.network_id_to_code(networkId),
1747
1750
  'address': address,
1748
1751
  'tag': tag,
1749
- 'network': self.network_id_to_code(networkId),
1750
- 'info': depositAddress,
1751
1752
  }
1752
1753
 
1753
- async def fetch_deposit_address(self, code: str, params={}):
1754
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1754
1755
  """
1755
1756
  :see: https://docs.upbit.com/reference/%EC%A0%84%EC%B2%B4-%EC%9E%85%EA%B8%88-%EC%A3%BC%EC%86%8C-%EC%A1%B0%ED%9A%8C
1756
1757
  fetch the deposit address for a currency associated with self account
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.wavesexchange import ImplicitAPI
8
8
  import asyncio
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, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction
11
11
  from typing import List
12
12
  from typing import Any
13
13
  from ccxt.base.errors import ExchangeError
@@ -59,6 +59,8 @@ class wavesexchange(Exchange, ImplicitAPI):
59
59
  'fetchCrossBorrowRate': False,
60
60
  'fetchCrossBorrowRates': False,
61
61
  'fetchDepositAddress': True,
62
+ 'fetchDepositAddresses': None,
63
+ 'fetchDepositAddressesByNetwork': None,
62
64
  'fetchDepositWithdrawFee': 'emulated',
63
65
  'fetchDepositWithdrawFees': True,
64
66
  'fetchFundingHistory': False,
@@ -1019,7 +1021,7 @@ class wavesexchange(Exchange, ImplicitAPI):
1019
1021
  self.safe_number(data, 'volume', 0),
1020
1022
  ]
1021
1023
 
1022
- async def fetch_deposit_address(self, code: str, params={}):
1024
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1023
1025
  """
1024
1026
  fetch the deposit address for a currency associated with self account
1025
1027
  :param str code: unified currency code
@@ -1098,12 +1100,11 @@ class wavesexchange(Exchange, ImplicitAPI):
1098
1100
  responseInner = await self.nodeGetAddressesPublicKeyPublicKey(self.extend(request, request))
1099
1101
  addressInner = self.safe_string(response, 'address')
1100
1102
  return {
1101
- 'address': addressInner,
1102
- 'code': code, # kept here for backward-compatibility, but will be removed soon
1103
+ 'info': responseInner,
1103
1104
  'currency': code,
1104
1105
  'network': network,
1106
+ 'address': addressInner,
1105
1107
  'tag': None,
1106
- 'info': responseInner,
1107
1108
  }
1108
1109
  else:
1109
1110
  request: dict = {
@@ -1141,12 +1142,11 @@ class wavesexchange(Exchange, ImplicitAPI):
1141
1142
  addresses = self.safe_value(response, 'deposit_addresses')
1142
1143
  address = self.safe_string(addresses, 0)
1143
1144
  return {
1144
- 'address': address,
1145
- 'code': code, # kept here for backward-compatibility, but will be removed soon
1145
+ 'info': response,
1146
1146
  'currency': code,
1147
- 'tag': None,
1148
1147
  'network': unifiedNetwork,
1149
- 'info': response,
1148
+ 'address': address,
1149
+ 'tag': None,
1150
1150
  }
1151
1151
 
1152
1152
  async def get_matcher_public_key(self):