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/bitvavo.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitvavo 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
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, 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 AuthenticationError
@@ -65,6 +65,8 @@ class bitvavo(Exchange, ImplicitAPI):
65
65
  'fetchCrossBorrowRates': False,
66
66
  'fetchCurrencies': True,
67
67
  'fetchDepositAddress': True,
68
+ 'fetchDepositAddresses': False,
69
+ 'fetchDepositAddressesByNetwork': False,
68
70
  'fetchDeposits': True,
69
71
  'fetchDepositWithdrawFee': 'emulated',
70
72
  'fetchDepositWithdrawFees': True,
@@ -456,9 +458,9 @@ class bitvavo(Exchange, ImplicitAPI):
456
458
  # },
457
459
  # ]
458
460
  #
459
- return self.parse_currencies(response)
461
+ return self.parse_currencies_custom(response)
460
462
 
461
- def parse_currencies(self, currencies):
463
+ def parse_currencies_custom(self, currencies):
462
464
  #
463
465
  # [
464
466
  # {
@@ -998,7 +1000,7 @@ class bitvavo(Exchange, ImplicitAPI):
998
1000
  #
999
1001
  return self.parse_balance(response)
1000
1002
 
1001
- def fetch_deposit_address(self, code: str, params={}):
1003
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1002
1004
  """
1003
1005
  fetch the deposit address for a currency associated with self account
1004
1006
  :param str code: unified currency code
@@ -1021,11 +1023,11 @@ class bitvavo(Exchange, ImplicitAPI):
1021
1023
  tag = self.safe_string(response, 'paymentId')
1022
1024
  self.check_address(address)
1023
1025
  return {
1026
+ 'info': response,
1024
1027
  'currency': code,
1028
+ 'network': None,
1025
1029
  'address': address,
1026
1030
  'tag': tag,
1027
- 'network': None,
1028
- 'info': response,
1029
1031
  }
1030
1032
 
1031
1033
  def create_order_request(self, symbol: Str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
ccxt/blockchaincom.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.blockchaincom import ImplicitAPI
8
- from ccxt.base.types import Balances, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
8
+ from ccxt.base.types import Balances, 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
@@ -45,6 +45,8 @@ class blockchaincom(Exchange, ImplicitAPI):
45
45
  'fetchClosedOrders': True,
46
46
  'fetchDeposit': True,
47
47
  'fetchDepositAddress': True,
48
+ 'fetchDepositAddresses': False,
49
+ 'fetchDepositAddressesByNetwork': False,
48
50
  'fetchDeposits': True,
49
51
  'fetchFundingHistory': False,
50
52
  'fetchFundingRate': False,
@@ -770,7 +772,7 @@ class blockchaincom(Exchange, ImplicitAPI):
770
772
  trades = self.privateGetFills(self.extend(request, params))
771
773
  return self.parse_trades(trades, market, since, limit, params) # need to define
772
774
 
773
- def fetch_deposit_address(self, code: str, params={}):
775
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
774
776
  """
775
777
  fetch the deposit address for a currency associated with self account
776
778
  :see: https://api.blockchain.com/v3/#getdepositaddress
@@ -792,12 +794,13 @@ class blockchaincom(Exchange, ImplicitAPI):
792
794
  # if a tag or memo is used it is separated by a colon in the 'address' value
793
795
  tag = self.safe_string(addressParts, 0)
794
796
  address = self.safe_string(addressParts, 1)
795
- result: dict = {'info': response}
796
- result['currency'] = currency['code']
797
- result['address'] = address
798
- if tag is not None:
799
- result['tag'] = tag
800
- return result
797
+ return {
798
+ 'info': response,
799
+ 'currency': currency['code'],
800
+ 'network': None,
801
+ 'address': address,
802
+ 'tag': tag,
803
+ }
801
804
 
802
805
  def parse_transaction_state(self, state):
803
806
  states: dict = {
ccxt/blofin.py CHANGED
@@ -543,6 +543,8 @@ class blofin(Exchange, ImplicitAPI):
543
543
  'average': None,
544
544
  'baseVolume': baseVolume,
545
545
  'quoteVolume': quoteVolume,
546
+ 'indexPrice': self.safe_string(ticker, 'indexPrice'),
547
+ 'markPrice': self.safe_string(ticker, 'markPrice'),
546
548
  'info': ticker,
547
549
  }, market)
548
550
 
@@ -564,6 +566,25 @@ class blofin(Exchange, ImplicitAPI):
564
566
  first = self.safe_dict(data, 0, {})
565
567
  return self.parse_ticker(first, market)
566
568
 
569
+ def fetch_mark_price(self, symbol: str, params={}) -> Ticker:
570
+ """
571
+ fetches mark price for the market
572
+ :see: https://docs.blofin.com/index.html#get-mark-price
573
+ :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
574
+ :param dict [params]: extra parameters specific to the exchange API endpoint
575
+ :param str [params.subType]: "linear" or "inverse"
576
+ :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
577
+ """
578
+ self.load_markets()
579
+ market = self.market(symbol)
580
+ request = {
581
+ 'symbol': market['id'],
582
+ }
583
+ response = self.publicGetMarketMarkPrice(self.extend(request, params))
584
+ data = self.safe_list(response, 'data', [])
585
+ first = self.safe_dict(data, 0, {})
586
+ return self.parse_ticker(first, market)
587
+
567
588
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
568
589
  """
569
590
  fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
ccxt/bybit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bybit import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LeverageTiers, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Balances, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, LeverageTier, LeverageTiers, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, 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 AuthenticationError
@@ -4538,7 +4538,7 @@ class bybit(Exchange, ImplicitAPI):
4538
4538
  length = len(result)
4539
4539
  if length == 0:
4540
4540
  isTrigger = self.safe_bool_n(params, ['trigger', 'stop'], False)
4541
- extra = '' if isTrigger else 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4541
+ extra = '' if isTrigger else ' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4542
4542
  raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
4543
4543
  if length > 1:
4544
4544
  raise InvalidOrder(self.id + ' returned more than one order')
@@ -4627,6 +4627,9 @@ class bybit(Exchange, ImplicitAPI):
4627
4627
  #
4628
4628
  result = self.safe_dict(response, 'result', {})
4629
4629
  innerList = self.safe_list(result, 'list', [])
4630
+ if len(innerList) == 0:
4631
+ extra = '' if isTrigger else ' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4632
+ raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
4630
4633
  order = self.safe_dict(innerList, 0, {})
4631
4634
  return self.parse_order(order, market)
4632
4635
 
@@ -4777,7 +4780,7 @@ class bybit(Exchange, ImplicitAPI):
4777
4780
  length = len(result)
4778
4781
  if length == 0:
4779
4782
  isTrigger = self.safe_bool_n(params, ['trigger', 'stop'], False)
4780
- extra = '' if isTrigger else 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4783
+ extra = '' if isTrigger else ' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4781
4784
  raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
4782
4785
  if length > 1:
4783
4786
  raise InvalidOrder(self.id + ' returned more than one order')
@@ -4806,7 +4809,7 @@ class bybit(Exchange, ImplicitAPI):
4806
4809
  length = len(result)
4807
4810
  if length == 0:
4808
4811
  isTrigger = self.safe_bool_n(params, ['trigger', 'stop'], False)
4809
- extra = '' if isTrigger else 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4812
+ extra = '' if isTrigger else ' If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = True'
4810
4813
  raise OrderNotFound('Order ' + str(id) + ' was not found.' + extra)
4811
4814
  if length > 1:
4812
4815
  raise InvalidOrder(self.id + ' returned more than one order')
@@ -5247,7 +5250,7 @@ class bybit(Exchange, ImplicitAPI):
5247
5250
  trades = self.add_pagination_cursor_to_result(response)
5248
5251
  return self.parse_trades(trades, market, since, limit)
5249
5252
 
5250
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
5253
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
5251
5254
  #
5252
5255
  # {
5253
5256
  # "chainType": "ERC20",
@@ -5262,14 +5265,14 @@ class bybit(Exchange, ImplicitAPI):
5262
5265
  chain = self.safe_string(depositAddress, 'chain')
5263
5266
  self.check_address(address)
5264
5267
  return {
5268
+ 'info': depositAddress,
5265
5269
  'currency': code,
5270
+ 'network': chain,
5266
5271
  'address': address,
5267
5272
  'tag': tag,
5268
- 'network': chain,
5269
- 'info': depositAddress,
5270
5273
  }
5271
5274
 
5272
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
5275
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
5273
5276
  """
5274
5277
  fetch a dictionary of addresses for a currency, indexed by network
5275
5278
  :see: https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
@@ -5311,7 +5314,7 @@ class bybit(Exchange, ImplicitAPI):
5311
5314
  })
5312
5315
  return self.index_by(parsed, 'network')
5313
5316
 
5314
- def fetch_deposit_address(self, code: str, params={}):
5317
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
5315
5318
  """
5316
5319
  fetch the deposit address for a currency associated with self account
5317
5320
  :see: https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
ccxt/cex.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.cex import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, Currencies, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
10
+ from ccxt.base.types import Balances, Currencies, DepositAddress, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -59,6 +59,7 @@ class cex(Exchange, ImplicitAPI):
59
59
  'fetchDeposit': False,
60
60
  'fetchDepositAddress': True,
61
61
  'fetchDepositAddresses': False,
62
+ 'fetchDepositAddressesByNetwork': False,
62
63
  'fetchDeposits': False,
63
64
  'fetchDepositsWithdrawals': False,
64
65
  'fetchFundingHistory': False,
@@ -1511,7 +1512,7 @@ class cex(Exchange, ImplicitAPI):
1511
1512
  response = self.privatePostCancelReplaceOrderPair(self.extend(request, params))
1512
1513
  return self.parse_order(response, market)
1513
1514
 
1514
- def fetch_deposit_address(self, code: str, params={}):
1515
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1515
1516
  """
1516
1517
  :see: https://docs.cex.io/#get-crypto-address
1517
1518
  fetch the deposit address for a currency associated with self account
@@ -1555,11 +1556,11 @@ class cex(Exchange, ImplicitAPI):
1555
1556
  address = self.safe_string_2(addressObject, 'address', 'destination')
1556
1557
  self.check_address(address)
1557
1558
  return {
1559
+ 'info': data,
1558
1560
  'currency': code,
1561
+ 'network': self.network_id_to_code(selectedNetworkId),
1559
1562
  'address': address,
1560
1563
  'tag': self.safe_string_2(addressObject, 'destinationTag', 'memo'),
1561
- 'network': self.network_id_to_code(selectedNetworkId),
1562
- 'info': data,
1563
1564
  }
1564
1565
 
1565
1566
  def nonce(self):
ccxt/coinbase.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.coinbase import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Conversion, Currencies, Currency, Int, LedgerEntry, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
9
+ from ccxt.base.types import Account, Balances, Conversion, Currencies, Currency, DepositAddress, Int, LedgerEntry, Market, MarketInterface, 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 AuthenticationError
@@ -3714,7 +3714,7 @@ class coinbase(Exchange, ImplicitAPI):
3714
3714
  data = self.safe_dict(response, 'data', {})
3715
3715
  return self.parse_transaction(data, currency)
3716
3716
 
3717
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
3717
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
3718
3718
  """
3719
3719
  fetch the deposit address for a currency associated with self account
3720
3720
  :see: https://docs.cloud.coinbase.com/exchange/reference/exchangerestapi_postcoinbaseaccountaddresses
@@ -3786,7 +3786,7 @@ class coinbase(Exchange, ImplicitAPI):
3786
3786
  addressStructures = self.parse_deposit_addresses(data, None, False)
3787
3787
  return self.index_by(addressStructures, 'network')
3788
3788
 
3789
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
3789
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
3790
3790
  #
3791
3791
  # {
3792
3792
  # id: '64ceb5f1-5fa2-5310-a4ff-9fd46271003d',
@@ -3841,9 +3841,9 @@ class coinbase(Exchange, ImplicitAPI):
3841
3841
  return {
3842
3842
  'info': depositAddress,
3843
3843
  'currency': self.safe_currency_code(marketId, currency),
3844
+ 'network': self.network_id_to_code(networkId, code),
3844
3845
  'address': address,
3845
3846
  'tag': self.safe_string(addressInfo, 'destination_tag'),
3846
- 'network': self.network_id_to_code(networkId, code),
3847
3847
  }
3848
3848
 
3849
3849
  def deposit(self, code: str, amount: float, id: str, params={}):
@@ -1315,13 +1315,9 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1315
1315
  # ...
1316
1316
  # ]
1317
1317
  #
1318
- result: dict = {}
1319
- for i in range(0, len(currencies)):
1320
- currency = self.parse_currency(currencies[i])
1321
- result[currency['code']] = currency
1322
- return result
1318
+ return self.parse_currencies(currencies)
1323
1319
 
1324
- def parse_currency(self, currency: dict):
1320
+ def parse_currency(self, currency: dict) -> Currency:
1325
1321
  #
1326
1322
  # {
1327
1323
  # "asset_id":"1",
@@ -1335,7 +1331,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1335
1331
  id = self.safe_string(currency, 'asset_name')
1336
1332
  code = self.safe_currency_code(id)
1337
1333
  statusId = self.safe_string(currency, 'status')
1338
- return {
1334
+ return self.safe_currency_structure({
1339
1335
  'id': id,
1340
1336
  'name': code,
1341
1337
  'code': code,
@@ -1348,7 +1344,7 @@ class coinbaseinternational(Exchange, ImplicitAPI):
1348
1344
  'fee': None,
1349
1345
  'fees': None,
1350
1346
  'limits': self.limits,
1351
- }
1347
+ })
1352
1348
 
1353
1349
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
1354
1350
  """
ccxt/coinex.py CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.coinex import ImplicitAPI
8
- from ccxt.base.types import Balances, Currencies, Currency, Int, IsolatedBorrowRate, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
8
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Int, IsolatedBorrowRate, Leverage, LeverageTier, LeverageTiers, MarginModification, Market, Num, Order, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
9
9
  from typing import List
10
10
  from ccxt.base.errors import ExchangeError
11
11
  from ccxt.base.errors import AuthenticationError
@@ -78,8 +78,8 @@ class coinex(Exchange, ImplicitAPI):
78
78
  'fetchCrossBorrowRates': False,
79
79
  'fetchCurrencies': True,
80
80
  'fetchDepositAddress': True,
81
- 'fetchDepositAddressByNetwork': False,
82
81
  'fetchDepositAddresses': False,
82
+ 'fetchDepositAddressesByNetwork': False,
83
83
  'fetchDeposits': True,
84
84
  'fetchDepositWithdrawFee': True,
85
85
  'fetchDepositWithdrawFees': False,
@@ -3533,7 +3533,7 @@ class coinex(Exchange, ImplicitAPI):
3533
3533
  data = self.safe_dict(response, 'data', {})
3534
3534
  return self.parse_deposit_address(data, currency)
3535
3535
 
3536
- def fetch_deposit_address(self, code: str, params={}):
3536
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
3537
3537
  """
3538
3538
  fetch the deposit address for a currency associated with self account
3539
3539
  :see: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-address
@@ -3577,7 +3577,7 @@ class coinex(Exchange, ImplicitAPI):
3577
3577
  depositAddress['network'] = self.network_id_to_code(network, currency).upper()
3578
3578
  return depositAddress
3579
3579
 
3580
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
3580
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
3581
3581
  #
3582
3582
  # {
3583
3583
  # "address": "1P1JqozxioQwaqPwgMAQdNDYNyaVSqgARq",
@@ -3597,9 +3597,9 @@ class coinex(Exchange, ImplicitAPI):
3597
3597
  return {
3598
3598
  'info': depositAddress,
3599
3599
  'currency': self.safe_currency_code(None, currency),
3600
+ 'network': None,
3600
3601
  'address': address,
3601
3602
  'tag': tag,
3602
- 'network': None,
3603
3603
  }
3604
3604
 
3605
3605
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
ccxt/coinone.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.coinone import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade
9
+ from ccxt.base.types import Balances, Currencies, DepositAddress, 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
@@ -52,7 +52,9 @@ class coinone(Exchange, ImplicitAPI):
52
52
  'fetchCrossBorrowRate': False,
53
53
  'fetchCrossBorrowRates': False,
54
54
  'fetchCurrencies': True,
55
+ 'fetchDepositAddress': False,
55
56
  'fetchDepositAddresses': True,
57
+ 'fetchDepositAddressesByNetwork': False,
56
58
  'fetchFundingHistory': False,
57
59
  'fetchFundingRate': False,
58
60
  'fetchFundingRateHistory': False,
@@ -1021,7 +1023,7 @@ class coinone(Exchange, ImplicitAPI):
1021
1023
  #
1022
1024
  return self.safe_order(response)
1023
1025
 
1024
- def fetch_deposit_addresses(self, codes: Strings = None, params={}):
1026
+ def fetch_deposit_addresses(self, codes: Strings = None, params={}) -> List[DepositAddress]:
1025
1027
  """
1026
1028
  fetch deposit addresses for multiple currencies and chain types
1027
1029
  :param str[]|None codes: list of unified currency codes, default is None
@@ -1059,10 +1061,11 @@ class coinone(Exchange, ImplicitAPI):
1059
1061
  depositAddress = self.safe_value(result, code)
1060
1062
  if depositAddress is None:
1061
1063
  depositAddress = {
1064
+ 'info': value,
1062
1065
  'currency': code,
1066
+ 'network': None,
1063
1067
  'address': None,
1064
1068
  'tag': None,
1065
- 'info': value,
1066
1069
  }
1067
1070
  address = self.safe_string(depositAddress, 'address', value)
1068
1071
  self.check_address(address)
ccxt/coinsph.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.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, TradingFeeInterface, TradingFees, Transaction
9
+ from ccxt.base.types import Balances, Currency, DepositAddress, 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 AuthenticationError
@@ -1740,7 +1740,7 @@ class coinsph(Exchange, ImplicitAPI):
1740
1740
  }
1741
1741
  return self.safe_string(statuses, status, status)
1742
1742
 
1743
- def fetch_deposit_address(self, code: str, params={}):
1743
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1744
1744
  """
1745
1745
  fetch the deposit address for a currency associated with self account
1746
1746
  :see: https://coins-docs.github.io/rest-api/#deposit-address-user_data
@@ -1770,7 +1770,7 @@ class coinsph(Exchange, ImplicitAPI):
1770
1770
  #
1771
1771
  return self.parse_deposit_address(response, currency)
1772
1772
 
1773
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1773
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1774
1774
  #
1775
1775
  # {
1776
1776
  # "coin": "ETH",
@@ -1781,11 +1781,11 @@ class coinsph(Exchange, ImplicitAPI):
1781
1781
  currencyId = self.safe_string(depositAddress, 'coin')
1782
1782
  parsedCurrency = self.safe_currency_code(currencyId, currency)
1783
1783
  return {
1784
+ 'info': depositAddress,
1784
1785
  'currency': parsedCurrency,
1786
+ 'network': None,
1785
1787
  'address': self.safe_string(depositAddress, 'address'),
1786
1788
  'tag': self.safe_string(depositAddress, 'addressTag'),
1787
- 'network': None,
1788
- 'info': depositAddress,
1789
1789
  }
1790
1790
 
1791
1791
  def url_encode_query(self, query={}):
ccxt/cryptocom.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.cryptocom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currency, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, TradingFees, Transaction
9
+ from ccxt.base.types import Account, Balances, Currency, DepositAddress, Int, LedgerEntry, Market, Num, Order, OrderBook, OrderRequest, CancellationRequest, 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 AuthenticationError
@@ -69,6 +69,7 @@ class cryptocom(Exchange, ImplicitAPI):
69
69
  'fetchCrossBorrowRates': False,
70
70
  'fetchCurrencies': False,
71
71
  'fetchDepositAddress': True,
72
+ 'fetchDepositAddresses': False,
72
73
  'fetchDepositAddressesByNetwork': True,
73
74
  'fetchDeposits': True,
74
75
  'fetchDepositsWithdrawals': False,
@@ -1601,7 +1602,7 @@ class cryptocom(Exchange, ImplicitAPI):
1601
1602
  result = self.safe_dict(response, 'result')
1602
1603
  return self.parse_transaction(result, currency)
1603
1604
 
1604
- def fetch_deposit_addresses_by_network(self, code: str, params={}):
1605
+ def fetch_deposit_addresses_by_network(self, code: str, params={}) -> List[DepositAddress]:
1605
1606
  """
1606
1607
  fetch a dictionary of addresses for a currency, indexed by network
1607
1608
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-deposit-address
@@ -1652,13 +1653,13 @@ class cryptocom(Exchange, ImplicitAPI):
1652
1653
  result[network] = {
1653
1654
  'info': value,
1654
1655
  'currency': responseCode,
1656
+ 'network': network,
1655
1657
  'address': address,
1656
1658
  'tag': tag,
1657
- 'network': network,
1658
1659
  }
1659
1660
  return result
1660
1661
 
1661
- def fetch_deposit_address(self, code: str, params={}):
1662
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1662
1663
  """
1663
1664
  fetch the deposit address for a currency associated with self account
1664
1665
  :see: https://exchange-docs.crypto.com/exchange/v1/rest-ws/index.html#private-get-deposit-address
ccxt/currencycom.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.currencycom import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Account, Balances, Currencies, Currency, Int, LedgerEntry, Leverage, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Int, LedgerEntry, 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 AuthenticationError
@@ -1747,7 +1747,7 @@ class currencycom(Exchange, ImplicitAPI):
1747
1747
  'shortLeverage': leverageValue,
1748
1748
  }
1749
1749
 
1750
- def fetch_deposit_address(self, code: str, params={}):
1750
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
1751
1751
  """
1752
1752
  fetch the deposit address for a currency associated with self account
1753
1753
  :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getDepositAddressUsingGET
@@ -1766,16 +1766,16 @@ class currencycom(Exchange, ImplicitAPI):
1766
1766
  #
1767
1767
  return self.parse_deposit_address(response, currency)
1768
1768
 
1769
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
1769
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
1770
1770
  address = self.safe_string(depositAddress, 'address')
1771
1771
  self.check_address(address)
1772
1772
  currency = self.safe_currency(None, currency)
1773
1773
  return {
1774
+ 'info': depositAddress,
1774
1775
  'currency': currency['code'],
1776
+ 'network': None,
1775
1777
  'address': address,
1776
1778
  'tag': None,
1777
- 'network': None,
1778
- 'info': depositAddress,
1779
1779
  }
1780
1780
 
1781
1781
  def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
ccxt/delta.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.delta import ImplicitAPI
8
8
  import hashlib
9
- from ccxt.base.types import Balances, Currencies, Currency, Greeks, Int, LedgerEntry, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade
9
+ from ccxt.base.types import Balances, Currencies, Currency, DepositAddress, Greeks, Int, LedgerEntry, Leverage, MarginMode, MarginModification, Market, MarketInterface, Num, Option, Order, OrderBook, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade
10
10
  from typing import List
11
11
  from ccxt.base.errors import ExchangeError
12
12
  from ccxt.base.errors import AuthenticationError
@@ -51,6 +51,8 @@ class delta(Exchange, ImplicitAPI):
51
51
  'fetchCurrencies': True,
52
52
  'fetchDeposit': None,
53
53
  'fetchDepositAddress': True,
54
+ 'fetchDepositAddresses': False,
55
+ 'fetchDepositAddressesByNetwork': False,
54
56
  'fetchDeposits': None,
55
57
  'fetchFundingHistory': False,
56
58
  'fetchFundingRate': True,
@@ -2225,7 +2227,7 @@ class delta(Exchange, ImplicitAPI):
2225
2227
  'fee': None,
2226
2228
  }, currency)
2227
2229
 
2228
- def fetch_deposit_address(self, code: str, params={}):
2230
+ def fetch_deposit_address(self, code: str, params={}) -> DepositAddress:
2229
2231
  """
2230
2232
  fetch the deposit address for a currency associated with self account
2231
2233
  :param str code: unified currency code
@@ -2263,7 +2265,7 @@ class delta(Exchange, ImplicitAPI):
2263
2265
  result = self.safe_dict(response, 'result', {})
2264
2266
  return self.parse_deposit_address(result, currency)
2265
2267
 
2266
- def parse_deposit_address(self, depositAddress, currency: Currency = None):
2268
+ def parse_deposit_address(self, depositAddress, currency: Currency = None) -> DepositAddress:
2267
2269
  #
2268
2270
  # {
2269
2271
  # "id": 1915615,
@@ -2283,11 +2285,11 @@ class delta(Exchange, ImplicitAPI):
2283
2285
  networkId = self.safe_string(depositAddress, 'network')
2284
2286
  self.check_address(address)
2285
2287
  return {
2288
+ 'info': depositAddress,
2286
2289
  'currency': self.safe_currency_code(marketId, currency),
2290
+ 'network': self.network_id_to_code(networkId),
2287
2291
  'address': address,
2288
2292
  'tag': self.safe_string(depositAddress, 'memo'),
2289
- 'network': self.network_id_to_code(networkId),
2290
- 'info': depositAddress,
2291
2293
  }
2292
2294
 
2293
2295
  def fetch_funding_rate(self, symbol: str, params={}) -> FundingRate:
ccxt/deribit.py CHANGED
@@ -6,7 +6,7 @@
6
6
  from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.deribit import ImplicitAPI
8
8
  import hashlib
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, FundingRate, Trade, TradingFees, Transaction, TransferEntry
9
+ from ccxt.base.types import Account, Balances, Currencies, Currency, DepositAddress, Greeks, Int, Market, MarketInterface, Num, Option, OptionChain, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, FundingRate, 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
@@ -65,6 +65,8 @@ class deribit(Exchange, ImplicitAPI):
65
65
  'fetchCurrencies': True,
66
66
  'fetchDeposit': False,
67
67
  'fetchDepositAddress': True,
68
+ 'fetchDepositAddresses': False,
69
+ 'fetchDepositAddressesByNetwork': False,
68
70
  'fetchDeposits': True,
69
71
  'fetchDepositWithdrawFees': True,
70
72
  'fetchFundingRate': True,
@@ -1019,7 +1021,7 @@ class deribit(Exchange, ImplicitAPI):
1019
1021
  'info': response,
1020
1022
  }
1021
1023
 
1022
- def fetch_deposit_address(self, code: str, params={}):
1024
+ 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
  :see: https://docs.deribit.com/#private-get_current_deposit_address
@@ -1054,11 +1056,11 @@ class deribit(Exchange, ImplicitAPI):
1054
1056
  address = self.safe_string(result, 'address')
1055
1057
  self.check_address(address)
1056
1058
  return {
1059
+ 'info': response,
1057
1060
  'currency': code,
1061
+ 'network': None,
1058
1062
  'address': address,
1059
1063
  'tag': None,
1060
- 'network': None,
1061
- 'info': response,
1062
1064
  }
1063
1065
 
1064
1066
  def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker: