ccxt 4.4.15__py2.py3-none-any.whl → 4.4.16__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 (145) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/ascendex.py +5 -5
  3. ccxt/async_support/__init__.py +1 -1
  4. ccxt/async_support/ascendex.py +5 -5
  5. ccxt/async_support/base/exchange.py +1 -1
  6. ccxt/async_support/bigone.py +6 -4
  7. ccxt/async_support/binance.py +58 -7
  8. ccxt/async_support/bingx.py +7 -6
  9. ccxt/async_support/bit2c.py +6 -4
  10. ccxt/async_support/bitbank.py +6 -4
  11. ccxt/async_support/bitbns.py +6 -4
  12. ccxt/async_support/bitfinex.py +4 -2
  13. ccxt/async_support/bitfinex2.py +4 -2
  14. ccxt/async_support/bitget.py +6 -5
  15. ccxt/async_support/bitmart.py +5 -4
  16. ccxt/async_support/bitmex.py +4 -4
  17. ccxt/async_support/bitso.py +5 -4
  18. ccxt/async_support/bitstamp.py +6 -4
  19. ccxt/async_support/bitvavo.py +6 -4
  20. ccxt/async_support/blockchaincom.py +11 -8
  21. ccxt/async_support/blofin.py +21 -0
  22. ccxt/async_support/bybit.py +6 -6
  23. ccxt/async_support/cex.py +5 -4
  24. ccxt/async_support/coinbase.py +4 -4
  25. ccxt/async_support/coinex.py +5 -5
  26. ccxt/async_support/coinone.py +6 -3
  27. ccxt/async_support/coinsph.py +5 -5
  28. ccxt/async_support/cryptocom.py +5 -4
  29. ccxt/async_support/currencycom.py +5 -5
  30. ccxt/async_support/delta.py +7 -5
  31. ccxt/async_support/deribit.py +6 -4
  32. ccxt/async_support/digifinex.py +6 -4
  33. ccxt/async_support/exmo.py +6 -4
  34. ccxt/async_support/gate.py +5 -4
  35. ccxt/async_support/gemini.py +4 -3
  36. ccxt/async_support/hashkey.py +7 -5
  37. ccxt/async_support/hitbtc.py +6 -5
  38. ccxt/async_support/hollaex.py +6 -5
  39. ccxt/async_support/htx.py +15 -5
  40. ccxt/async_support/hyperliquid.py +8 -7
  41. ccxt/async_support/idex.py +4 -4
  42. ccxt/async_support/independentreserve.py +4 -4
  43. ccxt/async_support/indodax.py +3 -3
  44. ccxt/async_support/kraken.py +7 -5
  45. ccxt/async_support/kucoin.py +6 -5
  46. ccxt/async_support/kucoinfutures.py +5 -3
  47. ccxt/async_support/kuna.py +5 -3
  48. ccxt/async_support/lbank.py +14 -12
  49. ccxt/async_support/lykke.py +6 -4
  50. ccxt/async_support/mexc.py +6 -6
  51. ccxt/async_support/ndax.py +33 -5
  52. ccxt/async_support/oceanex.py +4 -4
  53. ccxt/async_support/okcoin.py +8 -6
  54. ccxt/async_support/okx.py +17 -6
  55. ccxt/async_support/onetrading.py +6 -5
  56. ccxt/async_support/oxfun.py +6 -6
  57. ccxt/async_support/paymium.py +6 -5
  58. ccxt/async_support/phemex.py +8 -6
  59. ccxt/async_support/poloniex.py +6 -4
  60. ccxt/async_support/probit.py +7 -6
  61. ccxt/async_support/timex.py +4 -4
  62. ccxt/async_support/tokocrypto.py +5 -5
  63. ccxt/async_support/upbit.py +7 -6
  64. ccxt/async_support/wavesexchange.py +9 -9
  65. ccxt/async_support/wazirx.py +24 -4
  66. ccxt/async_support/whitebit.py +6 -4
  67. ccxt/async_support/woo.py +6 -4
  68. ccxt/async_support/xt.py +7 -5
  69. ccxt/async_support/yobit.py +32 -23
  70. ccxt/async_support/zonda.py +31 -6
  71. ccxt/base/exchange.py +2 -2
  72. ccxt/base/types.py +8 -0
  73. ccxt/bigone.py +6 -4
  74. ccxt/binance.py +58 -7
  75. ccxt/bingx.py +7 -6
  76. ccxt/bit2c.py +6 -4
  77. ccxt/bitbank.py +6 -4
  78. ccxt/bitbns.py +6 -4
  79. ccxt/bitfinex.py +4 -2
  80. ccxt/bitfinex2.py +4 -2
  81. ccxt/bitget.py +6 -5
  82. ccxt/bitmart.py +5 -4
  83. ccxt/bitmex.py +4 -4
  84. ccxt/bitso.py +5 -4
  85. ccxt/bitstamp.py +6 -4
  86. ccxt/bitvavo.py +6 -4
  87. ccxt/blockchaincom.py +11 -8
  88. ccxt/blofin.py +21 -0
  89. ccxt/bybit.py +6 -6
  90. ccxt/cex.py +5 -4
  91. ccxt/coinbase.py +4 -4
  92. ccxt/coinex.py +5 -5
  93. ccxt/coinone.py +6 -3
  94. ccxt/coinsph.py +5 -5
  95. ccxt/cryptocom.py +5 -4
  96. ccxt/currencycom.py +5 -5
  97. ccxt/delta.py +7 -5
  98. ccxt/deribit.py +6 -4
  99. ccxt/digifinex.py +6 -4
  100. ccxt/exmo.py +6 -4
  101. ccxt/gate.py +5 -4
  102. ccxt/gemini.py +4 -3
  103. ccxt/hashkey.py +7 -5
  104. ccxt/hitbtc.py +6 -5
  105. ccxt/hollaex.py +6 -5
  106. ccxt/htx.py +15 -5
  107. ccxt/hyperliquid.py +8 -7
  108. ccxt/idex.py +4 -4
  109. ccxt/independentreserve.py +4 -4
  110. ccxt/indodax.py +3 -3
  111. ccxt/kraken.py +7 -5
  112. ccxt/kucoin.py +6 -5
  113. ccxt/kucoinfutures.py +5 -3
  114. ccxt/kuna.py +5 -3
  115. ccxt/lbank.py +14 -12
  116. ccxt/lykke.py +6 -4
  117. ccxt/mexc.py +6 -6
  118. ccxt/ndax.py +33 -5
  119. ccxt/oceanex.py +4 -4
  120. ccxt/okcoin.py +8 -6
  121. ccxt/okx.py +17 -6
  122. ccxt/onetrading.py +6 -5
  123. ccxt/oxfun.py +6 -6
  124. ccxt/paymium.py +6 -5
  125. ccxt/phemex.py +8 -6
  126. ccxt/poloniex.py +6 -4
  127. ccxt/pro/__init__.py +1 -1
  128. ccxt/probit.py +7 -6
  129. ccxt/test/tests_async.py +1 -0
  130. ccxt/test/tests_sync.py +1 -0
  131. ccxt/timex.py +4 -4
  132. ccxt/tokocrypto.py +5 -5
  133. ccxt/upbit.py +7 -6
  134. ccxt/wavesexchange.py +9 -9
  135. ccxt/wazirx.py +24 -4
  136. ccxt/whitebit.py +6 -4
  137. ccxt/woo.py +6 -4
  138. ccxt/xt.py +7 -5
  139. ccxt/yobit.py +32 -23
  140. ccxt/zonda.py +31 -6
  141. {ccxt-4.4.15.dist-info → ccxt-4.4.16.dist-info}/METADATA +4 -4
  142. {ccxt-4.4.15.dist-info → ccxt-4.4.16.dist-info}/RECORD +145 -145
  143. {ccxt-4.4.15.dist-info → ccxt-4.4.16.dist-info}/LICENSE.txt +0 -0
  144. {ccxt-4.4.15.dist-info → ccxt-4.4.16.dist-info}/WHEEL +0 -0
  145. {ccxt-4.4.15.dist-info → ccxt-4.4.16.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.4.15'
25
+ __version__ = '4.4.16'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/ascendex.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.ascendex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, 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
@@ -2246,7 +2246,7 @@ class ascendex(Exchange, ImplicitAPI):
2246
2246
  'info': response,
2247
2247
  })
2248
2248
 
2249
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
2249
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
2250
2250
  #
2251
2251
  # {
2252
2252
  # "address": "0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722",
@@ -2268,14 +2268,14 @@ class ascendex(Exchange, ImplicitAPI):
2268
2268
  chainName = self.safe_string(depositAddress, 'blockchain')
2269
2269
  network = self.network_id_to_code(chainName, code)
2270
2270
  return {
2271
+ 'info': depositAddress,
2271
2272
  'currency': code,
2273
+ 'network': network,
2272
2274
  'address': address,
2273
2275
  'tag': tag,
2274
- 'network': network,
2275
- 'info': depositAddress,
2276
2276
  }
2277
2277
 
2278
- def fetch_deposit_address(self, code: str, params={}):
2278
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2279
2279
  """
2280
2280
  fetch the deposit address for a currency associated with self account
2281
2281
  :see: https://ascendex.github.io/ascendex-pro-api/#query-deposit-addresses
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.15'
7
+ __version__ = '4.4.16'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.ascendex import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Account, Balances, Currencies, Currency, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Int, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -2247,7 +2247,7 @@ class ascendex(Exchange, ImplicitAPI):
2247
2247
  'info': response,
2248
2248
  })
2249
2249
 
2250
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
2250
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
2251
2251
  #
2252
2252
  # {
2253
2253
  # "address": "0xe7c70b4e73b6b450ee46c3b5c0f5fb127ca55722",
@@ -2269,14 +2269,14 @@ class ascendex(Exchange, ImplicitAPI):
2269
2269
  chainName = self.safe_string(depositAddress, 'blockchain')
2270
2270
  network = self.network_id_to_code(chainName, code)
2271
2271
  return {
2272
+ 'info': depositAddress,
2272
2273
  'currency': code,
2274
+ 'network': network,
2273
2275
  'address': address,
2274
2276
  'tag': tag,
2275
- 'network': network,
2276
- 'info': depositAddress,
2277
2277
  }
2278
2278
 
2279
- async def fetch_deposit_address(self, code: str, params={}):
2279
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2280
2280
  """
2281
2281
  fetch the deposit address for a currency associated with self account
2282
2282
  :see: https://ascendex.github.io/ascendex-pro-api/#query-deposit-addresses
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.4.15'
5
+ __version__ = '4.4.16'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bigone import ImplicitAPI
8
8
  import asyncio
9
- from ccxt.base.types import Balances, Bool, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Bool, Currencies, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -52,6 +52,8 @@ class bigone(Exchange, ImplicitAPI):
52
52
  'fetchClosedOrders': True,
53
53
  'fetchCurrencies': True,
54
54
  'fetchDepositAddress': True,
55
+ 'fetchDepositAddresses': False,
56
+ 'fetchDepositAddressesByNetwork': False,
55
57
  'fetchDeposits': True,
56
58
  'fetchFundingRate': False,
57
59
  'fetchMarkets': True,
@@ -1701,7 +1703,7 @@ class bigone(Exchange, ImplicitAPI):
1701
1703
  headers['User-Agent'] = 'ccxt/' + self.id + '-' + self.version
1702
1704
  return {'url': url, 'method': method, 'body': body, 'headers': headers}
1703
1705
 
1704
- async def fetch_deposit_address(self, code: str, params={}):
1706
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1705
1707
  """
1706
1708
  fetch the deposit address for a currency associated with self account
1707
1709
  :see: https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user
@@ -1744,11 +1746,11 @@ class bigone(Exchange, ImplicitAPI):
1744
1746
  tag = self.safe_string(addressObject, 'memo')
1745
1747
  self.check_address(address)
1746
1748
  return {
1749
+ 'info': response,
1747
1750
  'currency': code,
1751
+ 'network': self.network_id_to_code(selectedNetworkId),
1748
1752
  'address': address,
1749
1753
  'tag': tag,
1750
- 'network': self.network_id_to_code(selectedNetworkId),
1751
- 'info': response,
1752
1754
  }
1753
1755
 
1754
1756
  def parse_transaction_status(self, status: Str):
@@ -8,7 +8,7 @@ from ccxt.abstract.binance import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, IsolatedBorrowRate, IsolatedBorrowRates, LedgerEntry, Leverage, Leverages, LeverageTier, LeverageTiers, MarginMode, MarginModes, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -135,6 +135,7 @@ class binance(Exchange, ImplicitAPI):
135
135
  'fetchMarketLeverageTiers': 'emulated',
136
136
  'fetchMarkets': True,
137
137
  'fetchMarkOHLCV': True,
138
+ 'fetchMarkPrice': True,
138
139
  'fetchMarkPrices': True,
139
140
  'fetchMyLiquidations': True,
140
141
  'fetchMySettlementHistory': True,
@@ -4109,10 +4110,41 @@ class binance(Exchange, ImplicitAPI):
4109
4110
  raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets yet')
4110
4111
  return self.parse_tickers(response, symbols)
4111
4112
 
4113
+ async def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
4114
+ """
4115
+ fetches mark price for the market
4116
+ :see: https://binance-docs.github.io/apidocs/futures/en/#mark-price
4117
+ :see: https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
4118
+ :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
4119
+ :param dict [params]: extra parameters specific to the exchange API endpoint
4120
+ :param str [params.subType]: "linear" or "inverse"
4121
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
4122
+ """
4123
+ await self.load_markets()
4124
+ market = self.market(symbol)
4125
+ type = None
4126
+ type, params = self.handle_market_type_and_params('fetchMarkPrice', market, params, 'swap')
4127
+ subType = None
4128
+ subType, params = self.handle_sub_type_and_params('fetchMarkPrice', market, params, 'linear')
4129
+ request = {
4130
+ 'symbol': market['id'],
4131
+ }
4132
+ response = None
4133
+ if self.is_linear(type, subType):
4134
+ response = await self.fapiPublicGetPremiumIndex(self.extend(request, params))
4135
+ elif self.is_inverse(type, subType):
4136
+ response = await self.dapiPublicGetPremiumIndex(self.extend(request, params))
4137
+ else:
4138
+ raise NotSupported(self.id + ' fetchMarkPrice() does not support ' + type + ' markets yet')
4139
+ if isinstance(response, list):
4140
+ return self.parse_ticker(self.safe_dict(response, 0, {}), market)
4141
+ return self.parse_ticker(response, market)
4142
+
4112
4143
  async def fetch_mark_prices(self, symbols: Strings = None, params={}) -> Tickers:
4113
4144
  """
4114
4145
  fetches mark prices for multiple markets
4115
4146
  :see: https://binance-docs.github.io/apidocs/futures/en/#mark-price
4147
+ :see: https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
4116
4148
  :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
4117
4149
  :param dict [params]: extra parameters specific to the exchange API endpoint
4118
4150
  :param str [params.subType]: "linear" or "inverse"
@@ -4122,9 +4154,9 @@ class binance(Exchange, ImplicitAPI):
4122
4154
  symbols = self.market_symbols(symbols, None, True, True, True)
4123
4155
  market = self.get_market_from_symbols(symbols)
4124
4156
  type = None
4125
- type, params = self.handle_market_type_and_params('fetchTickers', market, params, 'swap')
4157
+ type, params = self.handle_market_type_and_params('fetchMarkPrices', market, params, 'swap')
4126
4158
  subType = None
4127
- subType, params = self.handle_sub_type_and_params('fetchTickers', market, params, 'linear')
4159
+ subType, params = self.handle_sub_type_and_params('fetchMarkPrices', market, params, 'linear')
4128
4160
  response = None
4129
4161
  if self.is_linear(type, subType):
4130
4162
  response = await self.fapiPublicGetPremiumIndex(params)
@@ -8079,7 +8111,7 @@ class binance(Exchange, ImplicitAPI):
8079
8111
  rows = self.safe_list_2(response, 'rows', 'data', [])
8080
8112
  return self.parse_transfers(rows, currency, since, limit)
8081
8113
 
8082
- async def fetch_deposit_address(self, code: str, params={}):
8114
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
8083
8115
  """
8084
8116
  fetch the deposit address for a currency associated with self account
8085
8117
  :see: https://developers.binance.com/docs/wallet/capital/deposite-address
@@ -8114,8 +8146,27 @@ class binance(Exchange, ImplicitAPI):
8114
8146
  # }
8115
8147
  # }
8116
8148
  #
8149
+ return self.parse_deposit_address(response, currency)
8150
+
8151
+ def parse_deposit_address(self, response, currency: Currency = None) -> DepositAddress:
8152
+ #
8153
+ # {
8154
+ # "currency": "XRP",
8155
+ # "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
8156
+ # "tag": "108618262",
8157
+ # "info": {
8158
+ # "coin": "XRP",
8159
+ # "address": "rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh",
8160
+ # "tag": "108618262",
8161
+ # "url": "https://bithomp.com/explorer/rEb8TK3gBgk5auZkwc6sHnwrGVJH8DuaLh"
8162
+ # }
8163
+ # }
8164
+ #
8165
+ info = self.safe_dict(response, 'info', {})
8166
+ url = self.safe_string(info, 'url')
8117
8167
  address = self.safe_string(response, 'address')
8118
- url = self.safe_string(response, 'url')
8168
+ currencyId = self.safe_string(response, 'currency')
8169
+ code = self.safe_currency_code(currencyId, currency)
8119
8170
  impliedNetwork = None
8120
8171
  if url is not None:
8121
8172
  reverseNetworks = self.safe_dict(self.options, 'reverseNetworks', {})
@@ -8138,11 +8189,11 @@ class binance(Exchange, ImplicitAPI):
8138
8189
  tag = None
8139
8190
  self.check_address(address)
8140
8191
  return {
8192
+ 'info': response,
8141
8193
  'currency': code,
8194
+ 'network': impliedNetwork,
8142
8195
  'address': address,
8143
8196
  'tag': tag,
8144
- 'network': impliedNetwork,
8145
- 'info': response,
8146
8197
  }
8147
8198
 
8148
8199
  async def fetch_transaction_fees(self, codes: Strings = None, params={}):
@@ -8,7 +8,7 @@ from ccxt.abstract.bingx import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import numbers
11
- from ccxt.base.types import Balances, Currencies, Currency, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, Transaction, TransferEntry
11
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, Leverage, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, 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 AuthenticationError
@@ -68,6 +68,7 @@ class bingx(Exchange, ImplicitAPI):
68
68
  'fetchClosedOrders': True,
69
69
  'fetchCurrencies': True,
70
70
  'fetchDepositAddress': True,
71
+ 'fetchDepositAddresses': False,
71
72
  'fetchDepositAddressesByNetwork': True,
72
73
  'fetchDeposits': True,
73
74
  'fetchDepositWithdrawFee': 'emulated',
@@ -4171,7 +4172,7 @@ class bingx(Exchange, ImplicitAPI):
4171
4172
  'status': status,
4172
4173
  }
4173
4174
 
4174
- async def fetch_deposit_addresses_by_network(self, code: str, params={}):
4175
+ async def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
4175
4176
  """
4176
4177
  fetch the deposit addresses for a currency associated with self account
4177
4178
  :see: https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
@@ -4212,7 +4213,7 @@ class bingx(Exchange, ImplicitAPI):
4212
4213
  parsed = self.parse_deposit_addresses(data, [currency['code']], False)
4213
4214
  return self.index_by(parsed, 'network')
4214
4215
 
4215
- async def fetch_deposit_address(self, code: str, params={}):
4216
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
4216
4217
  """
4217
4218
  fetch the deposit address for a currency associated with self account
4218
4219
  :see: https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
@@ -4236,7 +4237,7 @@ class bingx(Exchange, ImplicitAPI):
4236
4237
  key = self.safe_string(keys, 0)
4237
4238
  return self.safe_dict(addressStructures, key)
4238
4239
 
4239
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
4240
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
4240
4241
  #
4241
4242
  # {
4242
4243
  # "coinId": "799",
@@ -4266,11 +4267,11 @@ class bingx(Exchange, ImplicitAPI):
4266
4267
  address = '0x' + address
4267
4268
  self.check_address(address)
4268
4269
  return {
4270
+ 'info': depositAddress,
4269
4271
  'currency': code,
4272
+ 'network': networkCode,
4270
4273
  'address': address,
4271
4274
  'tag': tag,
4272
- 'network': networkCode,
4273
- 'info': depositAddress,
4274
4275
  }
4275
4276
 
4276
4277
  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.bit2c import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -48,6 +48,8 @@ class bit2c(Exchange, ImplicitAPI):
48
48
  'fetchCrossBorrowRate': False,
49
49
  'fetchCrossBorrowRates': False,
50
50
  'fetchDepositAddress': True,
51
+ 'fetchDepositAddresses': False,
52
+ 'fetchDepositAddressesByNetwork': False,
51
53
  'fetchFundingHistory': False,
52
54
  'fetchFundingRate': False,
53
55
  'fetchFundingRateHistory': False,
@@ -779,7 +781,7 @@ class bit2c(Exchange, ImplicitAPI):
779
781
  def is_fiat(self, code):
780
782
  return code == 'NIS'
781
783
 
782
- async def fetch_deposit_address(self, code: str, params={}):
784
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
783
785
  """
784
786
  fetch the deposit address for a currency associated with self account
785
787
  :see: https://bit2c.co.il/home/api#addc
@@ -803,7 +805,7 @@ class bit2c(Exchange, ImplicitAPI):
803
805
  #
804
806
  return self.parse_deposit_address(response, currency)
805
807
 
806
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
808
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
807
809
  #
808
810
  # {
809
811
  # "address": "0xf14b94518d74aff2b1a6d3429471bcfcd3881d42",
@@ -814,11 +816,11 @@ class bit2c(Exchange, ImplicitAPI):
814
816
  self.check_address(address)
815
817
  code = self.safe_currency_code(None, currency)
816
818
  return {
819
+ 'info': depositAddress,
817
820
  'currency': code,
818
821
  'network': None,
819
822
  'address': address,
820
823
  'tag': None,
821
- 'info': depositAddress,
822
824
  }
823
825
 
824
826
  def nonce(self):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitbank import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -46,6 +46,8 @@ class bitbank(Exchange, ImplicitAPI):
46
46
  'fetchCrossBorrowRate': False,
47
47
  'fetchCrossBorrowRates': False,
48
48
  'fetchDepositAddress': True,
49
+ 'fetchDepositAddresses': False,
50
+ 'fetchDepositAddressesByNetwork': False,
49
51
  'fetchFundingHistory': False,
50
52
  'fetchFundingRate': False,
51
53
  'fetchFundingRateHistory': False,
@@ -785,7 +787,7 @@ class bitbank(Exchange, ImplicitAPI):
785
787
  trades = self.safe_list(data, 'trades', [])
786
788
  return self.parse_trades(trades, market, since, limit)
787
789
 
788
- async def fetch_deposit_address(self, code: str, params={}):
790
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
789
791
  """
790
792
  fetch the deposit address for a currency associated with self account
791
793
  :see: https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#get-withdrawal-accounts
@@ -805,11 +807,11 @@ class bitbank(Exchange, ImplicitAPI):
805
807
  firstAccount = self.safe_value(accounts, 0, {})
806
808
  address = self.safe_string(firstAccount, 'address')
807
809
  return {
810
+ 'info': response,
808
811
  'currency': currency,
812
+ 'network': None,
809
813
  'address': address,
810
814
  'tag': None,
811
- 'network': None,
812
- 'info': response,
813
815
  }
814
816
 
815
817
  async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitbns 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, 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 ArgumentsRequired
@@ -41,6 +41,8 @@ class bitbns(Exchange, ImplicitAPI):
41
41
  'createOrder': True,
42
42
  'fetchBalance': True,
43
43
  'fetchDepositAddress': True,
44
+ 'fetchDepositAddresses': False,
45
+ 'fetchDepositAddressesByNetwork': False,
44
46
  'fetchDeposits': True,
45
47
  'fetchFundingHistory': False,
46
48
  'fetchFundingRate': False,
@@ -1065,7 +1067,7 @@ class bitbns(Exchange, ImplicitAPI):
1065
1067
  'fee': fee,
1066
1068
  }
1067
1069
 
1068
- async def fetch_deposit_address(self, code: str, params={}):
1070
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1069
1071
  """
1070
1072
  fetch the deposit address for a currency associated with self account
1071
1073
  :param str code: unified currency code
@@ -1093,11 +1095,11 @@ class bitbns(Exchange, ImplicitAPI):
1093
1095
  tag = self.safe_string(data, 'tag')
1094
1096
  self.check_address(address)
1095
1097
  return {
1098
+ 'info': response,
1096
1099
  'currency': code,
1100
+ 'network': None,
1097
1101
  'address': address,
1098
1102
  'tag': tag,
1099
- 'network': None,
1100
- 'info': response,
1101
1103
  }
1102
1104
 
1103
1105
  def nonce(self):
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitfinex 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, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currency, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -55,6 +55,8 @@ class bitfinex(Exchange, ImplicitAPI):
55
55
  'fetchBalance': True,
56
56
  'fetchClosedOrders': True,
57
57
  'fetchDepositAddress': True,
58
+ 'fetchDepositAddresses': False,
59
+ 'fetchDepositAddressesByNetwork': False,
58
60
  'fetchDeposits': False,
59
61
  'fetchDepositsWithdrawals': True,
60
62
  'fetchDepositWithdrawFee': 'emulated',
@@ -1362,7 +1364,7 @@ class bitfinex(Exchange, ImplicitAPI):
1362
1364
  }
1363
1365
  return await self.fetch_deposit_address(code, self.extend(request, params))
1364
1366
 
1365
- async def fetch_deposit_address(self, code: str, params={}):
1367
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1366
1368
  """
1367
1369
  fetch the deposit address for a currency associated with self account
1368
1370
  :see: https://docs.bitfinex.com/v1/reference/rest-auth-deposit
@@ -7,7 +7,7 @@ from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitfinex2 import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
- from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -81,6 +81,8 @@ class bitfinex2(Exchange, ImplicitAPI):
81
81
  'fetchCrossBorrowRates': False,
82
82
  'fetchCurrencies': True,
83
83
  'fetchDepositAddress': True,
84
+ 'fetchDepositAddresses': False,
85
+ 'fetchDepositAddressesByNetwork': False,
84
86
  'fetchDepositsWithdrawals': True,
85
87
  'fetchFundingHistory': False,
86
88
  'fetchFundingRate': 'emulated', # emulated in exchange
@@ -2090,7 +2092,7 @@ class bitfinex2(Exchange, ImplicitAPI):
2090
2092
  }
2091
2093
  return await self.fetch_deposit_address(code, self.extend(request, params))
2092
2094
 
2093
- async def fetch_deposit_address(self, code: str, params={}):
2095
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2094
2096
  """
2095
2097
  fetch the deposit address for a currency associated with self account
2096
2098
  :see: https://docs.bitfinex.com/reference/rest-auth-deposit-address
@@ -8,7 +8,7 @@ from ccxt.abstract.bitget import ImplicitAPI
8
8
  import asyncio
9
9
  import hashlib
10
10
  import json
11
- from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
12
12
  from typing import List
13
13
  from ccxt.base.errors import ExchangeError
14
14
  from ccxt.base.errors import AuthenticationError
@@ -96,6 +96,7 @@ class bitget(Exchange, ImplicitAPI):
96
96
  'fetchDeposit': False,
97
97
  'fetchDepositAddress': True,
98
98
  'fetchDepositAddresses': False,
99
+ 'fetchDepositAddressesByNetwork': False,
99
100
  'fetchDeposits': True,
100
101
  'fetchDepositsWithdrawals': False,
101
102
  'fetchDepositWithdrawFee': 'emulated',
@@ -2359,7 +2360,7 @@ class bitget(Exchange, ImplicitAPI):
2359
2360
  }
2360
2361
  return self.safe_string(statuses, status, status)
2361
2362
 
2362
- async def fetch_deposit_address(self, code: str, params={}):
2363
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2363
2364
  """
2364
2365
  fetch the deposit address for a currency associated with self account
2365
2366
  :see: https://www.bitget.com/api-doc/spot/account/Get-Deposit-Address
@@ -2397,7 +2398,7 @@ class bitget(Exchange, ImplicitAPI):
2397
2398
  data = self.safe_dict(response, 'data', {})
2398
2399
  return self.parse_deposit_address(data, currency)
2399
2400
 
2400
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
2401
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
2401
2402
  #
2402
2403
  # {
2403
2404
  # "coin": "BTC",
@@ -2414,11 +2415,11 @@ class bitget(Exchange, ImplicitAPI):
2414
2415
  if networkId is not None:
2415
2416
  network = self.network_id_to_code(networkId, parsedCurrency)
2416
2417
  return {
2418
+ 'info': depositAddress,
2417
2419
  'currency': parsedCurrency,
2420
+ 'network': network,
2418
2421
  'address': self.safe_string(depositAddress, 'address'),
2419
2422
  'tag': self.safe_string(depositAddress, 'tag'),
2420
- 'network': network,
2421
- 'info': depositAddress,
2422
2423
  }
2423
2424
 
2424
2425
  async def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitmart import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, IsolatedBorrowRate, IsolatedBorrowRates, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, 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 AuthenticationError
@@ -1292,6 +1292,7 @@ class bitmart(Exchange, ImplicitAPI):
1292
1292
  'average': average,
1293
1293
  'baseVolume': baseVolume,
1294
1294
  'quoteVolume': quoteVolume,
1295
+ 'indexPrice': self.safe_string(ticker, 'index_price'),
1295
1296
  'info': ticker,
1296
1297
  }, market)
1297
1298
 
@@ -3206,7 +3207,7 @@ class bitmart(Exchange, ImplicitAPI):
3206
3207
  data = self.safe_dict(response, 'data', {})
3207
3208
  return self.parse_order(data, market)
3208
3209
 
3209
- async def fetch_deposit_address(self, code: str, params={}):
3210
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
3210
3211
  """
3211
3212
  fetch the deposit address for a currency associated with self account
3212
3213
  :see: https://developer-pro.bitmart.com/en/spot/#deposit-address-keyed
@@ -3245,7 +3246,7 @@ class bitmart(Exchange, ImplicitAPI):
3245
3246
  data = self.safe_dict(response, 'data', {})
3246
3247
  return self.parse_deposit_address(data, currency)
3247
3248
 
3248
- def parse_deposit_address(self, depositAddress, currency=None):
3249
+ def parse_deposit_address(self, depositAddress, currency=None) -> DepositAddress:
3249
3250
  #
3250
3251
  # {
3251
3252
  # currency: 'ETH',
@@ -3271,9 +3272,9 @@ class bitmart(Exchange, ImplicitAPI):
3271
3272
  return {
3272
3273
  'info': depositAddress,
3273
3274
  'currency': self.safe_string(currency, 'code'),
3275
+ 'network': network,
3274
3276
  'address': address,
3275
3277
  'tag': self.safe_string(depositAddress, 'address_memo'),
3276
- 'network': network,
3277
3278
  }
3278
3279
 
3279
3280
  async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
@@ -6,7 +6,7 @@
6
6
  from ccxt.async_support.base.exchange import Exchange
7
7
  from ccxt.abstract.bitmex import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Leverages, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, Leverage, Leverages, Market, MarketType, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, Transaction
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -2505,7 +2505,7 @@ class bitmex(Exchange, ImplicitAPI):
2505
2505
  }
2506
2506
  return await self.privatePostPositionIsolate(self.extend(request, params))
2507
2507
 
2508
- async def fetch_deposit_address(self, code: str, params={}):
2508
+ async def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2509
2509
  """
2510
2510
  fetch the deposit address for a currency associated with self account
2511
2511
  :see: https://www.bitmex.com/api/explorer/#not /User/User_getDepositAddress
@@ -2530,11 +2530,11 @@ class bitmex(Exchange, ImplicitAPI):
2530
2530
  # '"bc1qmex3puyrzn2gduqcnlu70c2uscpyaa9nm2l2j9le2lt2wkgmw33sy7ndjg"'
2531
2531
  #
2532
2532
  return {
2533
+ 'info': response,
2533
2534
  'currency': code,
2535
+ 'network': networkCode,
2534
2536
  'address': response.replace('"', '').replace('"', ''), # Done twice because some languages only replace the first instance
2535
2537
  'tag': None,
2536
- 'network': networkCode,
2537
- 'info': response,
2538
2538
  }
2539
2539
 
2540
2540
  def parse_deposit_withdraw_fee(self, fee, currency: Currency = None):