ccxt 4.2.83__py2.py3-none-any.whl → 4.2.85__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 (152) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bybit.py +1 -1
  3. ccxt/ace.py +5 -5
  4. ccxt/ascendex.py +8 -8
  5. ccxt/async_support/__init__.py +1 -1
  6. ccxt/async_support/ace.py +5 -5
  7. ccxt/async_support/ascendex.py +8 -8
  8. ccxt/async_support/base/exchange.py +3 -27
  9. ccxt/async_support/bigone.py +12 -12
  10. ccxt/async_support/binance.py +20 -32
  11. ccxt/async_support/bingx.py +12 -9
  12. ccxt/async_support/bit2c.py +1 -1
  13. ccxt/async_support/bitbank.py +8 -8
  14. ccxt/async_support/bitbns.py +5 -5
  15. ccxt/async_support/bitfinex.py +1 -1
  16. ccxt/async_support/bitfinex2.py +1 -1
  17. ccxt/async_support/bitget.py +39 -28
  18. ccxt/async_support/bithumb.py +5 -5
  19. ccxt/async_support/bitmart.py +16 -16
  20. ccxt/async_support/bitopro.py +1 -1
  21. ccxt/async_support/bitrue.py +4 -4
  22. ccxt/async_support/bitso.py +5 -5
  23. ccxt/async_support/bitstamp.py +1 -1
  24. ccxt/async_support/bitteam.py +8 -8
  25. ccxt/async_support/bl3p.py +1 -1
  26. ccxt/async_support/btcturk.py +6 -6
  27. ccxt/async_support/bybit.py +34 -87
  28. ccxt/async_support/coincheck.py +4 -4
  29. ccxt/async_support/coinex.py +12 -13
  30. ccxt/async_support/coinlist.py +7 -7
  31. ccxt/async_support/coinmate.py +4 -4
  32. ccxt/async_support/coinmetro.py +3 -3
  33. ccxt/async_support/coinone.py +5 -5
  34. ccxt/async_support/coinspot.py +2 -2
  35. ccxt/async_support/cryptocom.py +17 -17
  36. ccxt/async_support/currencycom.py +1 -1
  37. ccxt/async_support/delta.py +0 -8
  38. ccxt/async_support/deribit.py +16 -80
  39. ccxt/async_support/digifinex.py +8 -8
  40. ccxt/async_support/exmo.py +8 -8
  41. ccxt/async_support/gate.py +0 -8
  42. ccxt/async_support/hitbtc.py +5 -4
  43. ccxt/async_support/hollaex.py +7 -7
  44. ccxt/async_support/htx.py +12 -34
  45. ccxt/async_support/huobijp.py +3 -3
  46. ccxt/async_support/idex.py +2 -2
  47. ccxt/async_support/independentreserve.py +2 -2
  48. ccxt/async_support/indodax.py +2 -2
  49. ccxt/async_support/kraken.py +8 -8
  50. ccxt/async_support/krakenfutures.py +6 -6
  51. ccxt/async_support/kucoin.py +14 -2
  52. ccxt/async_support/kucoinfutures.py +8 -8
  53. ccxt/async_support/kuna.py +16 -16
  54. ccxt/async_support/latoken.py +2 -2
  55. ccxt/async_support/lbank.py +10 -10
  56. ccxt/async_support/luno.py +4 -4
  57. ccxt/async_support/mercado.py +5 -5
  58. ccxt/async_support/mexc.py +6 -6
  59. ccxt/async_support/ndax.py +1 -1
  60. ccxt/async_support/novadax.py +9 -9
  61. ccxt/async_support/oceanex.py +7 -7
  62. ccxt/async_support/okcoin.py +13 -13
  63. ccxt/async_support/okx.py +23 -31
  64. ccxt/async_support/onetrading.py +4 -4
  65. ccxt/async_support/p2b.py +7 -7
  66. ccxt/async_support/phemex.py +12 -12
  67. ccxt/async_support/poloniexfutures.py +5 -5
  68. ccxt/async_support/probit.py +11 -11
  69. ccxt/async_support/timex.py +7 -7
  70. ccxt/async_support/tokocrypto.py +9 -9
  71. ccxt/async_support/wavesexchange.py +3 -3
  72. ccxt/async_support/whitebit.py +5 -5
  73. ccxt/async_support/woo.py +1 -1
  74. ccxt/async_support/zaif.py +1 -1
  75. ccxt/async_support/zonda.py +7 -7
  76. ccxt/base/exchange.py +66 -23
  77. ccxt/bigone.py +12 -12
  78. ccxt/binance.py +20 -32
  79. ccxt/bingx.py +12 -9
  80. ccxt/bit2c.py +1 -1
  81. ccxt/bitbank.py +8 -8
  82. ccxt/bitbns.py +5 -5
  83. ccxt/bitfinex.py +1 -1
  84. ccxt/bitfinex2.py +1 -1
  85. ccxt/bitget.py +39 -28
  86. ccxt/bithumb.py +5 -5
  87. ccxt/bitmart.py +16 -16
  88. ccxt/bitopro.py +1 -1
  89. ccxt/bitrue.py +4 -4
  90. ccxt/bitso.py +5 -5
  91. ccxt/bitstamp.py +1 -1
  92. ccxt/bitteam.py +8 -8
  93. ccxt/bl3p.py +1 -1
  94. ccxt/btcturk.py +6 -6
  95. ccxt/bybit.py +34 -87
  96. ccxt/coincheck.py +4 -4
  97. ccxt/coinex.py +12 -13
  98. ccxt/coinlist.py +7 -7
  99. ccxt/coinmate.py +4 -4
  100. ccxt/coinmetro.py +3 -3
  101. ccxt/coinone.py +5 -5
  102. ccxt/coinspot.py +2 -2
  103. ccxt/cryptocom.py +17 -17
  104. ccxt/currencycom.py +1 -1
  105. ccxt/delta.py +0 -8
  106. ccxt/deribit.py +16 -80
  107. ccxt/digifinex.py +8 -8
  108. ccxt/exmo.py +8 -8
  109. ccxt/gate.py +0 -8
  110. ccxt/hitbtc.py +5 -4
  111. ccxt/hollaex.py +7 -7
  112. ccxt/htx.py +12 -34
  113. ccxt/huobijp.py +3 -3
  114. ccxt/idex.py +2 -2
  115. ccxt/independentreserve.py +2 -2
  116. ccxt/indodax.py +2 -2
  117. ccxt/kraken.py +8 -8
  118. ccxt/krakenfutures.py +6 -6
  119. ccxt/kucoin.py +14 -2
  120. ccxt/kucoinfutures.py +8 -8
  121. ccxt/kuna.py +16 -16
  122. ccxt/latoken.py +2 -2
  123. ccxt/lbank.py +10 -10
  124. ccxt/luno.py +4 -4
  125. ccxt/mercado.py +5 -5
  126. ccxt/mexc.py +6 -6
  127. ccxt/ndax.py +1 -1
  128. ccxt/novadax.py +9 -9
  129. ccxt/oceanex.py +7 -7
  130. ccxt/okcoin.py +13 -13
  131. ccxt/okx.py +23 -31
  132. ccxt/onetrading.py +4 -4
  133. ccxt/p2b.py +7 -7
  134. ccxt/phemex.py +12 -12
  135. ccxt/poloniexfutures.py +5 -5
  136. ccxt/pro/__init__.py +1 -1
  137. ccxt/pro/binance.py +150 -112
  138. ccxt/pro/kucoin.py +6 -7
  139. ccxt/pro/okx.py +12 -1
  140. ccxt/probit.py +11 -11
  141. ccxt/test/base/test_market.py +3 -0
  142. ccxt/timex.py +7 -7
  143. ccxt/tokocrypto.py +9 -9
  144. ccxt/wavesexchange.py +3 -3
  145. ccxt/whitebit.py +5 -5
  146. ccxt/woo.py +1 -1
  147. ccxt/zaif.py +1 -1
  148. ccxt/zonda.py +7 -7
  149. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/METADATA +4 -4
  150. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/RECORD +152 -152
  151. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/WHEEL +0 -0
  152. {ccxt-4.2.83.dist-info → ccxt-4.2.85.dist-info}/top_level.txt +0 -0
ccxt/__init__.py CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # ----------------------------------------------------------------------------
24
24
 
25
- __version__ = '4.2.83'
25
+ __version__ = '4.2.85'
26
26
 
27
27
  # ----------------------------------------------------------------------------
28
28
 
ccxt/abstract/bybit.py CHANGED
@@ -265,7 +265,7 @@ class ImplicitAPI:
265
265
  private_post_v5_account_set_hedging_mode = privatePostV5AccountSetHedgingMode = Entry('v5/account/set-hedging-mode', 'private', 'POST', {'cost': 5})
266
266
  private_post_v5_account_mmp_modify = privatePostV5AccountMmpModify = Entry('v5/account/mmp-modify', 'private', 'POST', {'cost': 5})
267
267
  private_post_v5_account_mmp_reset = privatePostV5AccountMmpReset = Entry('v5/account/mmp-reset', 'private', 'POST', {'cost': 5})
268
- private_post_v5_asset_transfer_inter_transfer = privatePostV5AssetTransferInterTransfer = Entry('v5/asset/transfer/inter-transfer', 'private', 'POST', {'cost': 150})
268
+ private_post_v5_asset_transfer_inter_transfer = privatePostV5AssetTransferInterTransfer = Entry('v5/asset/transfer/inter-transfer', 'private', 'POST', {'cost': 50})
269
269
  private_post_v5_asset_transfer_save_transfer_sub_member = privatePostV5AssetTransferSaveTransferSubMember = Entry('v5/asset/transfer/save-transfer-sub-member', 'private', 'POST', {'cost': 150})
270
270
  private_post_v5_asset_transfer_universal_transfer = privatePostV5AssetTransferUniversalTransfer = Entry('v5/asset/transfer/universal-transfer', 'private', 'POST', {'cost': 10})
271
271
  private_post_v5_asset_deposit_deposit_to_account = privatePostV5AssetDepositDepositToAccount = Entry('v5/asset/deposit/deposit-to-account', 'private', 'POST', {'cost': 5})
ccxt/ace.py CHANGED
@@ -395,7 +395,7 @@ class ace(Exchange, ImplicitAPI):
395
395
  # "status": 200
396
396
  # }
397
397
  #
398
- orderBook = self.safe_value(response, 'attachment')
398
+ orderBook = self.safe_dict(response, 'attachment')
399
399
  return self.parse_order_book(orderBook, market['symbol'], None, 'bids', 'asks')
400
400
 
401
401
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -602,7 +602,7 @@ class ace(Exchange, ImplicitAPI):
602
602
  # "status": 200
603
603
  # }
604
604
  #
605
- data = self.safe_value(response, 'attachment')
605
+ data = self.safe_dict(response, 'attachment')
606
606
  return self.parse_order(data, market)
607
607
 
608
608
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -664,7 +664,7 @@ class ace(Exchange, ImplicitAPI):
664
664
  # "status": 200
665
665
  # }
666
666
  #
667
- data = self.safe_value(response, 'attachment')
667
+ data = self.safe_dict(response, 'attachment')
668
668
  return self.parse_order(data, None)
669
669
 
670
670
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -847,7 +847,7 @@ class ace(Exchange, ImplicitAPI):
847
847
  # }
848
848
  #
849
849
  data = self.safe_value(response, 'attachment')
850
- trades = self.safe_value(data, 'trades', [])
850
+ trades = self.safe_list(data, 'trades', [])
851
851
  return self.parse_trades(trades, market, since, limit)
852
852
 
853
853
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -902,7 +902,7 @@ class ace(Exchange, ImplicitAPI):
902
902
  # "status": 200
903
903
  # }
904
904
  #
905
- trades = self.safe_value(response, 'attachment', [])
905
+ trades = self.safe_list(response, 'attachment', [])
906
906
  return self.parse_trades(trades, market, since, limit)
907
907
 
908
908
  def parse_balance(self, response) -> Balances:
ccxt/ascendex.py CHANGED
@@ -1011,7 +1011,7 @@ class ascendex(Exchange, ImplicitAPI):
1011
1011
  # }
1012
1012
  # }
1013
1013
  #
1014
- data = self.safe_value(response, 'data', {})
1014
+ data = self.safe_dict(response, 'data', {})
1015
1015
  return self.parse_ticker(data, market)
1016
1016
 
1017
1017
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1138,7 +1138,7 @@ class ascendex(Exchange, ImplicitAPI):
1138
1138
  # ]
1139
1139
  # }
1140
1140
  #
1141
- data = self.safe_value(response, 'data', [])
1141
+ data = self.safe_list(response, 'data', [])
1142
1142
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1143
1143
 
1144
1144
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -1208,7 +1208,7 @@ class ascendex(Exchange, ImplicitAPI):
1208
1208
  # }
1209
1209
  #
1210
1210
  records = self.safe_value(response, 'data', [])
1211
- trades = self.safe_value(records, 'data', [])
1211
+ trades = self.safe_list(records, 'data', [])
1212
1212
  return self.parse_trades(trades, market, since, limit)
1213
1213
 
1214
1214
  def parse_order_status(self, status):
@@ -1691,7 +1691,7 @@ class ascendex(Exchange, ImplicitAPI):
1691
1691
  # }
1692
1692
  #
1693
1693
  data = self.safe_value(response, 'data', {})
1694
- info = self.safe_value(data, 'info', [])
1694
+ info = self.safe_list(data, 'info', [])
1695
1695
  return self.parse_orders(info, market)
1696
1696
 
1697
1697
  def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -1793,7 +1793,7 @@ class ascendex(Exchange, ImplicitAPI):
1793
1793
  # }
1794
1794
  # }
1795
1795
  #
1796
- data = self.safe_value(response, 'data', {})
1796
+ data = self.safe_dict(response, 'data', {})
1797
1797
  return self.parse_order(data, market)
1798
1798
 
1799
1799
  def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2433,7 +2433,7 @@ class ascendex(Exchange, ImplicitAPI):
2433
2433
  # }
2434
2434
  #
2435
2435
  data = self.safe_value(response, 'data', {})
2436
- transactions = self.safe_value(data, 'data', [])
2436
+ transactions = self.safe_list(data, 'data', [])
2437
2437
  return self.parse_transactions(transactions, currency, since, limit)
2438
2438
 
2439
2439
  def parse_transaction_status(self, status):
@@ -2962,7 +2962,7 @@ class ascendex(Exchange, ImplicitAPI):
2962
2962
  """
2963
2963
  self.load_markets()
2964
2964
  response = self.v2PublicGetAssets(params)
2965
- data = self.safe_value(response, 'data')
2965
+ data = self.safe_list(response, 'data')
2966
2966
  return self.parse_deposit_withdraw_fees(data, codes, 'assetCode')
2967
2967
 
2968
2968
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -3078,7 +3078,7 @@ class ascendex(Exchange, ImplicitAPI):
3078
3078
  # }
3079
3079
  #
3080
3080
  data = self.safe_value(response, 'data', {})
3081
- rows = self.safe_value(data, 'data', [])
3081
+ rows = self.safe_list(data, 'data', [])
3082
3082
  return self.parse_incomes(rows, market, since, limit)
3083
3083
 
3084
3084
  def parse_income(self, income, market: Market = None):
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.83'
7
+ __version__ = '4.2.85'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
ccxt/async_support/ace.py CHANGED
@@ -395,7 +395,7 @@ class ace(Exchange, ImplicitAPI):
395
395
  # "status": 200
396
396
  # }
397
397
  #
398
- orderBook = self.safe_value(response, 'attachment')
398
+ orderBook = self.safe_dict(response, 'attachment')
399
399
  return self.parse_order_book(orderBook, market['symbol'], None, 'bids', 'asks')
400
400
 
401
401
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -602,7 +602,7 @@ class ace(Exchange, ImplicitAPI):
602
602
  # "status": 200
603
603
  # }
604
604
  #
605
- data = self.safe_value(response, 'attachment')
605
+ data = self.safe_dict(response, 'attachment')
606
606
  return self.parse_order(data, market)
607
607
 
608
608
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -664,7 +664,7 @@ class ace(Exchange, ImplicitAPI):
664
664
  # "status": 200
665
665
  # }
666
666
  #
667
- data = self.safe_value(response, 'attachment')
667
+ data = self.safe_dict(response, 'attachment')
668
668
  return self.parse_order(data, None)
669
669
 
670
670
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -847,7 +847,7 @@ class ace(Exchange, ImplicitAPI):
847
847
  # }
848
848
  #
849
849
  data = self.safe_value(response, 'attachment')
850
- trades = self.safe_value(data, 'trades', [])
850
+ trades = self.safe_list(data, 'trades', [])
851
851
  return self.parse_trades(trades, market, since, limit)
852
852
 
853
853
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -902,7 +902,7 @@ class ace(Exchange, ImplicitAPI):
902
902
  # "status": 200
903
903
  # }
904
904
  #
905
- trades = self.safe_value(response, 'attachment', [])
905
+ trades = self.safe_list(response, 'attachment', [])
906
906
  return self.parse_trades(trades, market, since, limit)
907
907
 
908
908
  def parse_balance(self, response) -> Balances:
@@ -1011,7 +1011,7 @@ class ascendex(Exchange, ImplicitAPI):
1011
1011
  # }
1012
1012
  # }
1013
1013
  #
1014
- data = self.safe_value(response, 'data', {})
1014
+ data = self.safe_dict(response, 'data', {})
1015
1015
  return self.parse_ticker(data, market)
1016
1016
 
1017
1017
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1138,7 +1138,7 @@ class ascendex(Exchange, ImplicitAPI):
1138
1138
  # ]
1139
1139
  # }
1140
1140
  #
1141
- data = self.safe_value(response, 'data', [])
1141
+ data = self.safe_list(response, 'data', [])
1142
1142
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1143
1143
 
1144
1144
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -1208,7 +1208,7 @@ class ascendex(Exchange, ImplicitAPI):
1208
1208
  # }
1209
1209
  #
1210
1210
  records = self.safe_value(response, 'data', [])
1211
- trades = self.safe_value(records, 'data', [])
1211
+ trades = self.safe_list(records, 'data', [])
1212
1212
  return self.parse_trades(trades, market, since, limit)
1213
1213
 
1214
1214
  def parse_order_status(self, status):
@@ -1691,7 +1691,7 @@ class ascendex(Exchange, ImplicitAPI):
1691
1691
  # }
1692
1692
  #
1693
1693
  data = self.safe_value(response, 'data', {})
1694
- info = self.safe_value(data, 'info', [])
1694
+ info = self.safe_list(data, 'info', [])
1695
1695
  return self.parse_orders(info, market)
1696
1696
 
1697
1697
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -1793,7 +1793,7 @@ class ascendex(Exchange, ImplicitAPI):
1793
1793
  # }
1794
1794
  # }
1795
1795
  #
1796
- data = self.safe_value(response, 'data', {})
1796
+ data = self.safe_dict(response, 'data', {})
1797
1797
  return self.parse_order(data, market)
1798
1798
 
1799
1799
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2433,7 +2433,7 @@ class ascendex(Exchange, ImplicitAPI):
2433
2433
  # }
2434
2434
  #
2435
2435
  data = self.safe_value(response, 'data', {})
2436
- transactions = self.safe_value(data, 'data', [])
2436
+ transactions = self.safe_list(data, 'data', [])
2437
2437
  return self.parse_transactions(transactions, currency, since, limit)
2438
2438
 
2439
2439
  def parse_transaction_status(self, status):
@@ -2962,7 +2962,7 @@ class ascendex(Exchange, ImplicitAPI):
2962
2962
  """
2963
2963
  await self.load_markets()
2964
2964
  response = await self.v2PublicGetAssets(params)
2965
- data = self.safe_value(response, 'data')
2965
+ data = self.safe_list(response, 'data')
2966
2966
  return self.parse_deposit_withdraw_fees(data, codes, 'assetCode')
2967
2967
 
2968
2968
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -3078,7 +3078,7 @@ class ascendex(Exchange, ImplicitAPI):
3078
3078
  # }
3079
3079
  #
3080
3080
  data = self.safe_value(response, 'data', {})
3081
- rows = self.safe_value(data, 'data', [])
3081
+ rows = self.safe_list(data, 'data', [])
3082
3082
  return self.parse_incomes(rows, market, since, limit)
3083
3083
 
3084
3084
  def parse_income(self, income, market: Market = None):
@@ -2,7 +2,7 @@
2
2
 
3
3
  # -----------------------------------------------------------------------------
4
4
 
5
- __version__ = '4.2.83'
5
+ __version__ = '4.2.85'
6
6
 
7
7
  # -----------------------------------------------------------------------------
8
8
 
@@ -16,7 +16,7 @@ import sys
16
16
  import yarl
17
17
  import math
18
18
  from typing import Any, List
19
- from ccxt.base.types import Int, Str, Num
19
+ from ccxt.base.types import Int, Str, Num, Strings
20
20
 
21
21
  # -----------------------------------------------------------------------------
22
22
 
@@ -277,18 +277,6 @@ class Exchange(BaseExchange):
277
277
  self.reloading_markets = False
278
278
  return result
279
279
 
280
- async def fetch_fees(self):
281
- trading = {}
282
- funding = {}
283
- if self.has['fetchTradingFees']:
284
- trading = await self.fetch_trading_fees()
285
- if self.has['fetchFundingFees']:
286
- funding = await self.fetch_funding_fees()
287
- return {
288
- 'trading': trading,
289
- 'funding': funding,
290
- }
291
-
292
280
  async def load_fees(self, reload=False):
293
281
  if not reload:
294
282
  if self.loaded_fees != Exchange.loaded_fees:
@@ -910,18 +898,6 @@ class Exchange(BaseExchange):
910
898
  async def fetch_status(self, params={}):
911
899
  raise NotSupported(self.id + ' fetchStatus() is not supported yet')
912
900
 
913
- async def fetch_funding_fee(self, code: str, params={}):
914
- warnOnFetchFundingFee = self.safe_bool(self.options, 'warnOnFetchFundingFee', True)
915
- if warnOnFetchFundingFee:
916
- raise NotSupported(self.id + ' fetchFundingFee() method is deprecated, it will be removed in July 2022, please, use fetchTransactionFee() or set exchange.options["warnOnFetchFundingFee"] = False to suppress self warning')
917
- return await self.fetch_transaction_fee(code, params)
918
-
919
- async def fetch_funding_fees(self, codes: List[str] = None, params={}):
920
- warnOnFetchFundingFees = self.safe_bool(self.options, 'warnOnFetchFundingFees', True)
921
- if warnOnFetchFundingFees:
922
- raise NotSupported(self.id + ' fetchFundingFees() method is deprecated, it will be removed in July 2022. Please, use fetchTransactionFees() or set exchange.options["warnOnFetchFundingFees"] = False to suppress self warning')
923
- return await self.fetch_transaction_fees(codes, params)
924
-
925
901
  async def fetch_transaction_fee(self, code: str, params={}):
926
902
  if not self.has['fetchTransactionFees']:
927
903
  raise NotSupported(self.id + ' fetchTransactionFee() is not supported yet')
@@ -982,7 +958,7 @@ class Exchange(BaseExchange):
982
958
  async def fetch_order_books(self, symbols: List[str] = None, limit: Int = None, params={}):
983
959
  raise NotSupported(self.id + ' fetchOrderBooks() is not supported yet')
984
960
 
985
- async def watch_bids_asks(self, symbols: List[str] = None, params={}):
961
+ async def watch_bids_asks(self, symbols: Strings = None, params={}):
986
962
  raise NotSupported(self.id + ' watchBidsAsks() is not supported yet')
987
963
 
988
964
  async def watch_tickers(self, symbols: List[str] = None, params={}):
@@ -811,7 +811,7 @@ class bigone(Exchange, ImplicitAPI):
811
811
  # }
812
812
  # }
813
813
  #
814
- ticker = self.safe_value(response, 'data', {})
814
+ ticker = self.safe_dict(response, 'data', {})
815
815
  return self.parse_ticker(ticker, market)
816
816
  else:
817
817
  tickers = await self.fetch_tickers([symbol], params)
@@ -984,7 +984,7 @@ class bigone(Exchange, ImplicitAPI):
984
984
  # }
985
985
  # }
986
986
  #
987
- orderbook = self.safe_value(response, 'data', {})
987
+ orderbook = self.safe_dict(response, 'data', {})
988
988
  return self.parse_order_book(orderbook, market['symbol'], None, 'bids', 'asks', 'price', 'quantity')
989
989
 
990
990
  def parse_contract_bids_asks(self, bidsAsks):
@@ -1172,7 +1172,7 @@ class bigone(Exchange, ImplicitAPI):
1172
1172
  # ]
1173
1173
  # }
1174
1174
  #
1175
- trades = self.safe_value(response, 'data', [])
1175
+ trades = self.safe_list(response, 'data', [])
1176
1176
  return self.parse_trades(trades, market, since, limit)
1177
1177
 
1178
1178
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1246,7 +1246,7 @@ class bigone(Exchange, ImplicitAPI):
1246
1246
  # ]
1247
1247
  # }
1248
1248
  #
1249
- data = self.safe_value(response, 'data', [])
1249
+ data = self.safe_list(response, 'data', [])
1250
1250
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1251
1251
 
1252
1252
  def parse_balance(self, response) -> Balances:
@@ -1484,7 +1484,7 @@ class bigone(Exchange, ImplicitAPI):
1484
1484
  # "updated_at":"2019-01-29T06:05:56Z"
1485
1485
  # }
1486
1486
  #
1487
- order = self.safe_value(response, 'data')
1487
+ order = self.safe_dict(response, 'data')
1488
1488
  return self.parse_order(order, market)
1489
1489
 
1490
1490
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -1511,7 +1511,7 @@ class bigone(Exchange, ImplicitAPI):
1511
1511
  # "created_at":"2019-01-29T06:05:56Z",
1512
1512
  # "updated_at":"2019-01-29T06:05:56Z"
1513
1513
  # }
1514
- order = self.safe_value(response, 'data')
1514
+ order = self.safe_dict(response, 'data')
1515
1515
  return self.parse_order(order)
1516
1516
 
1517
1517
  async def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -1553,7 +1553,7 @@ class bigone(Exchange, ImplicitAPI):
1553
1553
  await self.load_markets()
1554
1554
  request = {'id': id}
1555
1555
  response = await self.privateGetOrdersId(self.extend(request, params))
1556
- order = self.safe_value(response, 'data', {})
1556
+ order = self.safe_dict(response, 'data', {})
1557
1557
  return self.parse_order(order)
1558
1558
 
1559
1559
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1600,7 +1600,7 @@ class bigone(Exchange, ImplicitAPI):
1600
1600
  # "page_token":"dxzef",
1601
1601
  # }
1602
1602
  #
1603
- orders = self.safe_value(response, 'data', [])
1603
+ orders = self.safe_list(response, 'data', [])
1604
1604
  return self.parse_orders(orders, market, since, limit)
1605
1605
 
1606
1606
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1658,7 +1658,7 @@ class bigone(Exchange, ImplicitAPI):
1658
1658
  # "page_token":"dxfv"
1659
1659
  # }
1660
1660
  #
1661
- trades = self.safe_value(response, 'data', [])
1661
+ trades = self.safe_list(response, 'data', [])
1662
1662
  return self.parse_trades(trades, market, since, limit)
1663
1663
 
1664
1664
  def parse_order_status(self, status):
@@ -1924,7 +1924,7 @@ class bigone(Exchange, ImplicitAPI):
1924
1924
  # ]
1925
1925
  # }
1926
1926
  #
1927
- deposits = self.safe_value(response, 'data', [])
1927
+ deposits = self.safe_list(response, 'data', [])
1928
1928
  return self.parse_transactions(deposits, currency, since, limit)
1929
1929
 
1930
1930
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1972,7 +1972,7 @@ class bigone(Exchange, ImplicitAPI):
1972
1972
  # "page_token":"dxvf"
1973
1973
  # }
1974
1974
  #
1975
- withdrawals = self.safe_value(response, 'data', [])
1975
+ withdrawals = self.safe_list(response, 'data', [])
1976
1976
  return self.parse_transactions(withdrawals, currency, since, limit)
1977
1977
 
1978
1978
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -2092,7 +2092,7 @@ class bigone(Exchange, ImplicitAPI):
2092
2092
  # }
2093
2093
  # }
2094
2094
  #
2095
- data = self.safe_value(response, 'data', {})
2095
+ data = self.safe_dict(response, 'data', {})
2096
2096
  return self.parse_transaction(data, currency)
2097
2097
 
2098
2098
  def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
@@ -2441,14 +2441,6 @@ class binance(Exchange, ImplicitAPI):
2441
2441
  super(binance, self).set_sandbox_mode(enable)
2442
2442
  self.options['sandboxMode'] = enable
2443
2443
 
2444
- def convert_expire_date(self, date):
2445
- # parse YYMMDD to timestamp
2446
- year = date[0:2]
2447
- month = date[2:4]
2448
- day = date[4:6]
2449
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
2450
- return reconstructedDate
2451
-
2452
2444
  def create_expired_option_market(self, symbol: str):
2453
2445
  # support expired option contracts
2454
2446
  settle = 'USDT'
@@ -3860,26 +3852,24 @@ class binance(Exchange, ImplicitAPI):
3860
3852
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3861
3853
  """
3862
3854
  await self.load_markets()
3863
- symbols = self.market_symbols(symbols)
3864
- market = None
3865
- if symbols is not None:
3866
- first = self.safe_string(symbols, 0)
3867
- market = self.market(first)
3855
+ symbols = self.market_symbols(symbols, None, True, True, True)
3856
+ market = self.get_market_from_symbols(symbols)
3868
3857
  type = None
3858
+ type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
3869
3859
  subType = None
3870
3860
  subType, params = self.handle_sub_type_and_params('fetchBidsAsks', market, params)
3871
- type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
3872
3861
  response = None
3873
3862
  if self.is_linear(type, subType):
3874
3863
  response = await self.fapiPublicGetTickerBookTicker(params)
3875
3864
  elif self.is_inverse(type, subType):
3876
3865
  response = await self.dapiPublicGetTickerBookTicker(params)
3877
- else:
3866
+ elif type == 'spot':
3878
3867
  request = {}
3879
3868
  if symbols is not None:
3880
- marketIds = self.market_ids(symbols)
3881
- request['symbols'] = self.json(marketIds)
3869
+ request['symbols'] = self.json(self.market_ids(symbols))
3882
3870
  response = await self.publicGetTickerBookTicker(self.extend(request, params))
3871
+ else:
3872
+ raise NotSupported(self.id + ' fetchBidsAsks() does not support ' + type + ' markets yet')
3883
3873
  return self.parse_tickers(response, symbols)
3884
3874
 
3885
3875
  async def fetch_last_prices(self, symbols: Strings = None, params={}):
@@ -3894,12 +3884,12 @@ class binance(Exchange, ImplicitAPI):
3894
3884
  :returns dict: a dictionary of lastprices structures
3895
3885
  """
3896
3886
  await self.load_markets()
3897
- symbols = self.market_symbols(symbols)
3887
+ symbols = self.market_symbols(symbols, None, True, True, True)
3898
3888
  market = self.get_market_from_symbols(symbols)
3899
3889
  type = None
3890
+ type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
3900
3891
  subType = None
3901
3892
  subType, params = self.handle_sub_type_and_params('fetchLastPrices', market, params)
3902
- type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
3903
3893
  response = None
3904
3894
  if self.is_linear(type, subType):
3905
3895
  response = await self.fapiPublicV2GetTickerPrice(params)
@@ -3994,28 +3984,26 @@ class binance(Exchange, ImplicitAPI):
3994
3984
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3995
3985
  """
3996
3986
  await self.load_markets()
3997
- type = None
3998
- market = None
3999
3987
  symbols = self.market_symbols(symbols, None, True, True, True)
4000
- if symbols is not None:
4001
- first = self.safe_string(symbols, 0)
4002
- market = self.market(first)
3988
+ market = self.get_market_from_symbols(symbols)
3989
+ type = None
4003
3990
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
4004
3991
  subType = None
4005
3992
  subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
4006
3993
  response = None
4007
- if type == 'option':
4008
- response = await self.eapiPublicGetTicker(params)
4009
- elif self.is_linear(type, subType):
3994
+ if self.is_linear(type, subType):
4010
3995
  response = await self.fapiPublicGetTicker24hr(params)
4011
3996
  elif self.is_inverse(type, subType):
4012
3997
  response = await self.dapiPublicGetTicker24hr(params)
4013
- else:
3998
+ elif type == 'spot':
4014
3999
  request = {}
4015
4000
  if symbols is not None:
4016
- marketIds = self.market_ids(symbols)
4017
- request['symbols'] = self.json(marketIds)
4001
+ request['symbols'] = self.json(self.market_ids(symbols))
4018
4002
  response = await self.publicGetTicker24hr(self.extend(request, params))
4003
+ elif type == 'option':
4004
+ response = await self.eapiPublicGetTicker(params)
4005
+ else:
4006
+ raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets yet')
4019
4007
  return self.parse_tickers(response, symbols)
4020
4008
 
4021
4009
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -4636,7 +4624,7 @@ class binance(Exchange, ImplicitAPI):
4636
4624
  # }
4637
4625
  # }
4638
4626
  #
4639
- data = self.safe_value(response, 'newOrderResponse')
4627
+ data = self.safe_dict(response, 'newOrderResponse')
4640
4628
  return self.parse_order(data, market)
4641
4629
 
4642
4630
  def edit_spot_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -11401,7 +11389,7 @@ class binance(Exchange, ImplicitAPI):
11401
11389
  #
11402
11390
  else:
11403
11391
  raise BadRequest(self.id + ' fetchMarginModes() supports linear and inverse subTypes only')
11404
- assets = self.safe_value(response, 'positions', [])
11392
+ assets = self.safe_list(response, 'positions', [])
11405
11393
  return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
11406
11394
 
11407
11395
  def parse_margin_mode(self, marginMode, market=None) -> MarginMode:
@@ -1334,9 +1334,12 @@ class bingx(Exchange, ImplicitAPI):
1334
1334
  response = await self.spotV1PublicGetTicker24hr(self.extend(request, params))
1335
1335
  else:
1336
1336
  response = await self.swapV2PublicGetQuoteTicker(self.extend(request, params))
1337
- data = self.safe_value(response, 'data')
1338
- ticker = self.safe_value(data, 0, data)
1339
- return self.parse_ticker(ticker, market)
1337
+ data = self.safe_list(response, 'data')
1338
+ if data is not None:
1339
+ first = self.safe_dict(data, 0, {})
1340
+ return self.parse_ticker(first, market)
1341
+ dataDict = self.safe_dict(response, 'data', {})
1342
+ return self.parse_ticker(dataDict, market)
1340
1343
 
1341
1344
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
1342
1345
  """
@@ -1360,7 +1363,7 @@ class bingx(Exchange, ImplicitAPI):
1360
1363
  response = await self.spotV1PublicGetTicker24hr(params)
1361
1364
  else:
1362
1365
  response = await self.swapV2PublicGetQuoteTicker(params)
1363
- tickers = self.safe_value(response, 'data')
1366
+ tickers = self.safe_list(response, 'data')
1364
1367
  return self.parse_tickers(tickers, symbols)
1365
1368
 
1366
1369
  def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
@@ -1939,7 +1942,7 @@ class bingx(Exchange, ImplicitAPI):
1939
1942
  response = self.fix_stringified_json_members(response)
1940
1943
  response = self.parse_json(response)
1941
1944
  data = self.safe_value(response, 'data', {})
1942
- order = self.safe_value(data, 'order', data)
1945
+ order = self.safe_dict(data, 'order', data)
1943
1946
  return self.parse_order(order, market)
1944
1947
 
1945
1948
  async def create_orders(self, orders: List[OrderRequest], params={}):
@@ -2408,7 +2411,7 @@ class bingx(Exchange, ImplicitAPI):
2408
2411
  # }
2409
2412
  #
2410
2413
  data = self.safe_value(response, 'data')
2411
- first = self.safe_value(data, 'order', data)
2414
+ first = self.safe_dict(data, 'order', data)
2412
2415
  return self.parse_order(first, market)
2413
2416
 
2414
2417
  async def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -2633,7 +2636,7 @@ class bingx(Exchange, ImplicitAPI):
2633
2636
  # }
2634
2637
  #
2635
2638
  data = self.safe_value(response, 'data')
2636
- first = self.safe_value(data, 'order', data)
2639
+ first = self.safe_dict(data, 'order', data)
2637
2640
  return self.parse_order(first, market)
2638
2641
 
2639
2642
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -2805,7 +2808,7 @@ class bingx(Exchange, ImplicitAPI):
2805
2808
  # }
2806
2809
  #
2807
2810
  data = self.safe_value(response, 'data', [])
2808
- orders = self.safe_value(data, 'orders', [])
2811
+ orders = self.safe_list(data, 'orders', [])
2809
2812
  return self.parse_orders(orders, market, since, limit)
2810
2813
 
2811
2814
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -3493,7 +3496,7 @@ class bingx(Exchange, ImplicitAPI):
3493
3496
  """
3494
3497
  await self.load_markets()
3495
3498
  response = await self.walletsV1PrivateGetCapitalConfigGetall(params)
3496
- coins = self.safe_value(response, 'data')
3499
+ coins = self.safe_list(response, 'data')
3497
3500
  return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
3498
3501
 
3499
3502
  async def withdraw(self, code: str, amount: float, address, tag=None, params={}):
@@ -470,7 +470,7 @@ class bit2c(Exchange, ImplicitAPI):
470
470
  response = await self.privateGetOrderMyOrders(self.extend(request, params))
471
471
  orders = self.safe_value(response, market['id'], {})
472
472
  asks = self.safe_value(orders, 'ask', [])
473
- bids = self.safe_value(orders, 'bid', [])
473
+ bids = self.safe_list(orders, 'bid', [])
474
474
  return self.parse_orders(self.array_concat(asks, bids), market, since, limit)
475
475
 
476
476
  async def fetch_order(self, id: str, symbol: Str = None, params={}):