ccxt 4.4.28__py2.py3-none-any.whl → 4.4.30__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 (162) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/alpaca.py +1 -0
  3. ccxt/abstract/binance.py +9 -0
  4. ccxt/abstract/binancecoinm.py +9 -0
  5. ccxt/abstract/binanceus.py +9 -0
  6. ccxt/abstract/binanceusdm.py +9 -0
  7. ccxt/abstract/bybit.py +0 -13
  8. ccxt/alpaca.py +53 -8
  9. ccxt/async_support/__init__.py +1 -1
  10. ccxt/async_support/alpaca.py +53 -8
  11. ccxt/async_support/base/exchange.py +4 -1
  12. ccxt/async_support/bigone.py +1 -1
  13. ccxt/async_support/binance.py +10 -1
  14. ccxt/async_support/bingx.py +1 -1
  15. ccxt/async_support/bitbank.py +1 -1
  16. ccxt/async_support/bitbns.py +12 -12
  17. ccxt/async_support/bitfinex.py +10 -10
  18. ccxt/async_support/bitfinex2.py +1 -1
  19. ccxt/async_support/bitflyer.py +1 -1
  20. ccxt/async_support/bitget.py +96 -8
  21. ccxt/async_support/bithumb.py +1 -1
  22. ccxt/async_support/bitmart.py +54 -54
  23. ccxt/async_support/bitmex.py +1 -1
  24. ccxt/async_support/bitopro.py +22 -22
  25. ccxt/async_support/bitrue.py +29 -29
  26. ccxt/async_support/bitso.py +1 -1
  27. ccxt/async_support/bitstamp.py +1 -1
  28. ccxt/async_support/bitvavo.py +4 -1
  29. ccxt/async_support/blockchaincom.py +1 -1
  30. ccxt/async_support/btcmarkets.py +1 -1
  31. ccxt/async_support/bybit.py +50 -585
  32. ccxt/async_support/coinbase.py +1 -1
  33. ccxt/async_support/coinbaseexchange.py +1 -1
  34. ccxt/async_support/coinbaseinternational.py +1 -1
  35. ccxt/async_support/coincatch.py +25 -5
  36. ccxt/async_support/coinex.py +1 -1
  37. ccxt/async_support/coinlist.py +1 -1
  38. ccxt/async_support/coinmate.py +1 -1
  39. ccxt/async_support/coinsph.py +1 -1
  40. ccxt/async_support/cryptocom.py +1 -1
  41. ccxt/async_support/deribit.py +8 -4
  42. ccxt/async_support/digifinex.py +1 -1
  43. ccxt/async_support/exmo.py +1 -1
  44. ccxt/async_support/gate.py +1 -1
  45. ccxt/async_support/gemini.py +1 -1
  46. ccxt/async_support/hashkey.py +1 -1
  47. ccxt/async_support/hitbtc.py +1 -1
  48. ccxt/async_support/hollaex.py +1 -1
  49. ccxt/async_support/htx.py +1 -1
  50. ccxt/async_support/huobijp.py +1 -1
  51. ccxt/async_support/hyperliquid.py +110 -5
  52. ccxt/async_support/idex.py +1 -1
  53. ccxt/async_support/independentreserve.py +1 -1
  54. ccxt/async_support/indodax.py +1 -1
  55. ccxt/async_support/kraken.py +1 -1
  56. ccxt/async_support/kucoin.py +1 -1
  57. ccxt/async_support/kuna.py +1 -1
  58. ccxt/async_support/lbank.py +6 -1
  59. ccxt/async_support/lykke.py +1 -1
  60. ccxt/async_support/mercado.py +1 -1
  61. ccxt/async_support/mexc.py +1 -1
  62. ccxt/async_support/ndax.py +1 -1
  63. ccxt/async_support/novadax.py +1 -1
  64. ccxt/async_support/okcoin.py +1 -1
  65. ccxt/async_support/okx.py +1 -1
  66. ccxt/async_support/onetrading.py +1 -1
  67. ccxt/async_support/oxfun.py +1 -1
  68. ccxt/async_support/phemex.py +1 -1
  69. ccxt/async_support/poloniex.py +1 -1
  70. ccxt/async_support/probit.py +1 -1
  71. ccxt/async_support/tokocrypto.py +1 -1
  72. ccxt/async_support/upbit.py +1 -1
  73. ccxt/async_support/vertex.py +52 -8
  74. ccxt/async_support/wavesexchange.py +1 -1
  75. ccxt/async_support/whitebit.py +1 -1
  76. ccxt/async_support/woo.py +1 -1
  77. ccxt/async_support/woofipro.py +1 -1
  78. ccxt/async_support/xt.py +1 -1
  79. ccxt/async_support/yobit.py +2 -2
  80. ccxt/async_support/zaif.py +1 -1
  81. ccxt/async_support/zonda.py +1 -1
  82. ccxt/base/exchange.py +4 -1
  83. ccxt/bigone.py +1 -1
  84. ccxt/binance.py +10 -1
  85. ccxt/bingx.py +1 -1
  86. ccxt/bitbank.py +1 -1
  87. ccxt/bitbns.py +12 -12
  88. ccxt/bitfinex.py +10 -10
  89. ccxt/bitfinex2.py +1 -1
  90. ccxt/bitflyer.py +1 -1
  91. ccxt/bitget.py +96 -8
  92. ccxt/bithumb.py +1 -1
  93. ccxt/bitmart.py +54 -54
  94. ccxt/bitmex.py +1 -1
  95. ccxt/bitopro.py +22 -22
  96. ccxt/bitrue.py +29 -29
  97. ccxt/bitso.py +1 -1
  98. ccxt/bitstamp.py +1 -1
  99. ccxt/bitvavo.py +4 -1
  100. ccxt/blockchaincom.py +1 -1
  101. ccxt/btcmarkets.py +1 -1
  102. ccxt/bybit.py +50 -585
  103. ccxt/coinbase.py +1 -1
  104. ccxt/coinbaseexchange.py +1 -1
  105. ccxt/coinbaseinternational.py +1 -1
  106. ccxt/coincatch.py +25 -5
  107. ccxt/coinex.py +1 -1
  108. ccxt/coinlist.py +1 -1
  109. ccxt/coinmate.py +1 -1
  110. ccxt/coinsph.py +1 -1
  111. ccxt/cryptocom.py +1 -1
  112. ccxt/deribit.py +8 -4
  113. ccxt/digifinex.py +1 -1
  114. ccxt/exmo.py +1 -1
  115. ccxt/gate.py +1 -1
  116. ccxt/gemini.py +1 -1
  117. ccxt/hashkey.py +1 -1
  118. ccxt/hitbtc.py +1 -1
  119. ccxt/hollaex.py +1 -1
  120. ccxt/htx.py +1 -1
  121. ccxt/huobijp.py +1 -1
  122. ccxt/hyperliquid.py +110 -5
  123. ccxt/idex.py +1 -1
  124. ccxt/independentreserve.py +1 -1
  125. ccxt/indodax.py +1 -1
  126. ccxt/kraken.py +1 -1
  127. ccxt/kucoin.py +1 -1
  128. ccxt/kuna.py +1 -1
  129. ccxt/lbank.py +6 -1
  130. ccxt/lykke.py +1 -1
  131. ccxt/mercado.py +1 -1
  132. ccxt/mexc.py +1 -1
  133. ccxt/ndax.py +1 -1
  134. ccxt/novadax.py +1 -1
  135. ccxt/okcoin.py +1 -1
  136. ccxt/okx.py +1 -1
  137. ccxt/onetrading.py +1 -1
  138. ccxt/oxfun.py +1 -1
  139. ccxt/phemex.py +1 -1
  140. ccxt/poloniex.py +1 -1
  141. ccxt/pro/__init__.py +1 -1
  142. ccxt/pro/bitvavo.py +2 -1
  143. ccxt/pro/blofin.py +2 -1
  144. ccxt/pro/mexc.py +187 -30
  145. ccxt/probit.py +1 -1
  146. ccxt/test/tests_helpers.py +2 -2
  147. ccxt/tokocrypto.py +1 -1
  148. ccxt/upbit.py +1 -1
  149. ccxt/vertex.py +52 -8
  150. ccxt/wavesexchange.py +1 -1
  151. ccxt/whitebit.py +1 -1
  152. ccxt/woo.py +1 -1
  153. ccxt/woofipro.py +1 -1
  154. ccxt/xt.py +1 -1
  155. ccxt/yobit.py +2 -2
  156. ccxt/zaif.py +1 -1
  157. ccxt/zonda.py +1 -1
  158. {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/METADATA +4 -4
  159. {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/RECORD +162 -162
  160. {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/LICENSE.txt +0 -0
  161. {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/WHEEL +0 -0
  162. {ccxt-4.4.28.dist-info → ccxt-4.4.30.dist-info}/top_level.txt +0 -0
ccxt/bitmart.py CHANGED
@@ -723,7 +723,7 @@ class bitmart(Exchange, ImplicitAPI):
723
723
  # }
724
724
  # }
725
725
  #
726
- data = self.safe_value(response, 'data', {})
726
+ data = self.safe_dict(response, 'data', {})
727
727
  return self.safe_integer(data, 'server_time')
728
728
 
729
729
  def fetch_status(self, params={}):
@@ -732,7 +732,7 @@ class bitmart(Exchange, ImplicitAPI):
732
732
  :param dict [params]: extra parameters specific to the exchange API endpoint
733
733
  :returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
734
734
  """
735
- options = self.safe_value(self.options, 'fetchStatus', {})
735
+ options = self.safe_dict(self.options, 'fetchStatus', {})
736
736
  defaultType = self.safe_string(self.options, 'defaultType')
737
737
  type = self.safe_string(options, 'type', defaultType)
738
738
  type = self.safe_string(params, 'type', type)
@@ -763,12 +763,12 @@ class bitmart(Exchange, ImplicitAPI):
763
763
  # }
764
764
  # }
765
765
  #
766
- data = self.safe_value(response, 'data', {})
767
- services = self.safe_value(data, 'service', [])
766
+ data = self.safe_dict(response, 'data', {})
767
+ services = self.safe_list(data, 'service', [])
768
768
  servicesByType = self.index_by(services, 'service_type')
769
769
  if type == 'swap':
770
770
  type = 'contract'
771
- service = self.safe_value(servicesByType, type)
771
+ service = self.safe_string(servicesByType, type)
772
772
  status = None
773
773
  eta = None
774
774
  if service is not None:
@@ -814,8 +814,8 @@ class bitmart(Exchange, ImplicitAPI):
814
814
  # }
815
815
  # }
816
816
  #
817
- data = self.safe_value(response, 'data', {})
818
- symbols = self.safe_value(data, 'symbols', [])
817
+ data = self.safe_dict(response, 'data', {})
818
+ symbols = self.safe_list(data, 'symbols', [])
819
819
  result = []
820
820
  for i in range(0, len(symbols)):
821
821
  market = symbols[i]
@@ -923,8 +923,8 @@ class bitmart(Exchange, ImplicitAPI):
923
923
  # }
924
924
  # }
925
925
  #
926
- data = self.safe_value(response, 'data', {})
927
- symbols = self.safe_value(data, 'symbols', [])
926
+ data = self.safe_dict(response, 'data', {})
927
+ symbols = self.safe_list(data, 'symbols', [])
928
928
  result = []
929
929
  for i in range(0, len(symbols)):
930
930
  market = symbols[i]
@@ -1026,16 +1026,16 @@ class bitmart(Exchange, ImplicitAPI):
1026
1026
  # }
1027
1027
  # }
1028
1028
  #
1029
- data = self.safe_value(response, 'data', {})
1030
- currencies = self.safe_value(data, 'currencies', [])
1029
+ data = self.safe_dict(response, 'data', {})
1030
+ currencies = self.safe_list(data, 'currencies', [])
1031
1031
  result: dict = {}
1032
1032
  for i in range(0, len(currencies)):
1033
1033
  currency = currencies[i]
1034
1034
  id = self.safe_string(currency, 'id')
1035
1035
  code = self.safe_currency_code(id)
1036
1036
  name = self.safe_string(currency, 'name')
1037
- withdrawEnabled = self.safe_value(currency, 'withdraw_enabled')
1038
- depositEnabled = self.safe_value(currency, 'deposit_enabled')
1037
+ withdrawEnabled = self.safe_bool(currency, 'withdraw_enabled')
1038
+ depositEnabled = self.safe_bool(currency, 'deposit_enabled')
1039
1039
  active = withdrawEnabled and depositEnabled
1040
1040
  result[code] = {
1041
1041
  'id': id,
@@ -1386,7 +1386,7 @@ class bitmart(Exchange, ImplicitAPI):
1386
1386
  else:
1387
1387
  data = self.safe_dict(response, 'data', {})
1388
1388
  tickers = self.safe_list(data, 'symbols', [])
1389
- ticker = self.safe_value(tickers, 0, {})
1389
+ ticker = self.safe_dict(tickers, 0, {})
1390
1390
  return self.parse_ticker(ticker, market)
1391
1391
 
1392
1392
  def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1403,7 +1403,7 @@ class bitmart(Exchange, ImplicitAPI):
1403
1403
  type = None
1404
1404
  market = None
1405
1405
  if symbols is not None:
1406
- symbol = self.safe_value(symbols, 0)
1406
+ symbol = self.safe_string(symbols, 0)
1407
1407
  market = self.market(symbol)
1408
1408
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
1409
1409
  response = None
@@ -1563,7 +1563,7 @@ class bitmart(Exchange, ImplicitAPI):
1563
1563
  # "trace": "4cad855074664097ac6ba5258c47305d.72.16952643834721135"
1564
1564
  # }
1565
1565
  #
1566
- data = self.safe_value(response, 'data', {})
1566
+ data = self.safe_dict(response, 'data', {})
1567
1567
  timestamp = self.safe_integer_2(data, 'ts', 'timestamp')
1568
1568
  return self.parse_order_book(data, market['symbol'], timestamp)
1569
1569
 
@@ -1891,7 +1891,7 @@ class bitmart(Exchange, ImplicitAPI):
1891
1891
  marginMode, params = self.handle_margin_mode_and_params('fetchMyTrades', params)
1892
1892
  if marginMode == 'isolated':
1893
1893
  request['orderMode'] = 'iso_margin'
1894
- options = self.safe_value(self.options, 'fetchMyTrades', {})
1894
+ options = self.safe_dict(self.options, 'fetchMyTrades', {})
1895
1895
  defaultLimit = self.safe_integer(options, 'limit', 200)
1896
1896
  if limit is None:
1897
1897
  limit = defaultLimit
@@ -1985,22 +1985,22 @@ class bitmart(Exchange, ImplicitAPI):
1985
1985
  return self.parse_trades(data, None, since, limit)
1986
1986
 
1987
1987
  def custom_parse_balance(self, response, marketType) -> Balances:
1988
- data = self.safe_value(response, 'data', {})
1988
+ data = self.safe_dict(response, 'data', {})
1989
1989
  wallet = None
1990
1990
  if marketType == 'swap':
1991
- wallet = self.safe_value(response, 'data', [])
1991
+ wallet = self.safe_list(response, 'data', [])
1992
1992
  elif marketType == 'margin':
1993
- wallet = self.safe_value(data, 'symbols', [])
1993
+ wallet = self.safe_list(data, 'symbols', [])
1994
1994
  else:
1995
- wallet = self.safe_value(data, 'wallet', [])
1995
+ wallet = self.safe_list(data, 'wallet', [])
1996
1996
  result = {'info': response}
1997
1997
  if marketType == 'margin':
1998
1998
  for i in range(0, len(wallet)):
1999
1999
  entry = wallet[i]
2000
2000
  marketId = self.safe_string(entry, 'symbol')
2001
2001
  symbol = self.safe_symbol(marketId, None, '_')
2002
- base = self.safe_value(entry, 'base', {})
2003
- quote = self.safe_value(entry, 'quote', {})
2002
+ base = self.safe_dict(entry, 'base', {})
2003
+ quote = self.safe_dict(entry, 'quote', {})
2004
2004
  baseCode = self.safe_currency_code(self.safe_string(base, 'currency'))
2005
2005
  quoteCode = self.safe_currency_code(self.safe_string(quote, 'currency'))
2006
2006
  subResult: dict = {}
@@ -2202,7 +2202,7 @@ class bitmart(Exchange, ImplicitAPI):
2202
2202
  # }
2203
2203
  # }
2204
2204
  #
2205
- data = self.safe_value(response, 'data')
2205
+ data = self.safe_dict(response, 'data', {})
2206
2206
  return self.parse_trading_fee(data)
2207
2207
 
2208
2208
  def parse_order(self, order: dict, market: Market = None) -> Order:
@@ -2361,7 +2361,7 @@ class bitmart(Exchange, ImplicitAPI):
2361
2361
  '4': 'closed', # Completed
2362
2362
  },
2363
2363
  }
2364
- statuses = self.safe_value(statusesByType, type, {})
2364
+ statuses = self.safe_dict(statusesByType, type, {})
2365
2365
  return self.safe_string(statuses, status, status)
2366
2366
 
2367
2367
  def create_market_buy_order_with_cost(self, symbol: str, cost: float, params={}):
@@ -2451,7 +2451,7 @@ class bitmart(Exchange, ImplicitAPI):
2451
2451
  # swap
2452
2452
  # {"code":1000,"message":"Ok","data":{"order_id":231116359426639,"price":"market price"},"trace":"7f9c94e10f9d4513bc08a7bfc2a5559a.62.16996369620521911"}
2453
2453
  #
2454
- data = self.safe_value(response, 'data', {})
2454
+ data = self.safe_dict(response, 'data', {})
2455
2455
  order = self.parse_order(data, market)
2456
2456
  order['type'] = type
2457
2457
  order['side'] = side
@@ -2739,7 +2739,7 @@ class bitmart(Exchange, ImplicitAPI):
2739
2739
  if market['spot']:
2740
2740
  response = self.privatePostSpotV3CancelOrder(self.extend(request, params))
2741
2741
  else:
2742
- stop = self.safe_value_2(params, 'stop', 'trigger')
2742
+ stop = self.safe_bool_2(params, 'stop', 'trigger')
2743
2743
  params = self.omit(params, ['stop', 'trigger'])
2744
2744
  if not stop:
2745
2745
  response = self.privatePostContractPrivateCancelOrder(self.extend(request, params))
@@ -2935,7 +2935,7 @@ class bitmart(Exchange, ImplicitAPI):
2935
2935
  # }
2936
2936
  # }
2937
2937
  #
2938
- data = self.safe_value(response, 'data', {})
2938
+ data = self.safe_dict(response, 'data', {})
2939
2939
  orders = self.safe_list(data, 'orders', [])
2940
2940
  return self.parse_orders(orders, market, since, limit)
2941
2941
 
@@ -2982,7 +2982,7 @@ class bitmart(Exchange, ImplicitAPI):
2982
2982
  request['endTime'] = until
2983
2983
  response = self.privatePostSpotV4QueryOpenOrders(self.extend(request, params))
2984
2984
  elif type == 'swap':
2985
- isStop = self.safe_value_2(params, 'stop', 'trigger')
2985
+ isStop = self.safe_bool_2(params, 'stop', 'trigger')
2986
2986
  params = self.omit(params, ['stop', 'trigger'])
2987
2987
  if isStop:
2988
2988
  response = self.privateGetContractPrivateCurrentPlanOrder(self.extend(request, params))
@@ -3223,7 +3223,7 @@ class bitmart(Exchange, ImplicitAPI):
3223
3223
  if code == 'USDT':
3224
3224
  defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
3225
3225
  defaultNetwork = self.safe_string_upper(defaultNetworks, code)
3226
- networks = self.safe_value(self.options, 'networks', {})
3226
+ networks = self.safe_dict(self.options, 'networks', {})
3227
3227
  networkInner = self.safe_string_upper(params, 'network', defaultNetwork) # self line allows the user to specify either ERC20 or ETH
3228
3228
  networkInner = self.safe_string(networks, networkInner, networkInner) # handle ERC20>ETH alias
3229
3229
  if networkInner is not None:
@@ -3277,7 +3277,7 @@ class bitmart(Exchange, ImplicitAPI):
3277
3277
  'tag': self.safe_string(depositAddress, 'address_memo'),
3278
3278
  }
3279
3279
 
3280
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
3280
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
3281
3281
  """
3282
3282
  make a withdrawal
3283
3283
  :param str code: unified currency code
@@ -3302,7 +3302,7 @@ class bitmart(Exchange, ImplicitAPI):
3302
3302
  if code == 'USDT':
3303
3303
  defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
3304
3304
  defaultNetwork = self.safe_string_upper(defaultNetworks, code)
3305
- networks = self.safe_value(self.options, 'networks', {})
3305
+ networks = self.safe_dict(self.options, 'networks', {})
3306
3306
  network = self.safe_string_upper(params, 'network', defaultNetwork) # self line allows the user to specify either ERC20 or ETH
3307
3307
  network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
3308
3308
  if network is not None:
@@ -3319,7 +3319,7 @@ class bitmart(Exchange, ImplicitAPI):
3319
3319
  # }
3320
3320
  # }
3321
3321
  #
3322
- data = self.safe_value(response, 'data')
3322
+ data = self.safe_dict(response, 'data', {})
3323
3323
  transaction = self.parse_transaction(data, currency)
3324
3324
  return self.extend(transaction, {
3325
3325
  'code': code,
@@ -3343,7 +3343,7 @@ class bitmart(Exchange, ImplicitAPI):
3343
3343
  if code == 'USDT':
3344
3344
  defaultNetworks = self.safe_value(self.options, 'defaultNetworks')
3345
3345
  defaultNetwork = self.safe_string_upper(defaultNetworks, code)
3346
- networks = self.safe_value(self.options, 'networks', {})
3346
+ networks = self.safe_dict(self.options, 'networks', {})
3347
3347
  network = self.safe_string_upper(params, 'network', defaultNetwork) # self line allows the user to specify either ERC20 or ETH
3348
3348
  network = self.safe_string(networks, network, network) # handle ERC20>ETH alias
3349
3349
  if network is not None:
@@ -3375,7 +3375,7 @@ class bitmart(Exchange, ImplicitAPI):
3375
3375
  # }
3376
3376
  # }
3377
3377
  #
3378
- data = self.safe_value(response, 'data', {})
3378
+ data = self.safe_dict(response, 'data', {})
3379
3379
  records = self.safe_list(data, 'records', [])
3380
3380
  return self.parse_transactions(records, currency, since, limit)
3381
3381
 
@@ -3414,7 +3414,7 @@ class bitmart(Exchange, ImplicitAPI):
3414
3414
  # }
3415
3415
  # }
3416
3416
  #
3417
- data = self.safe_value(response, 'data', {})
3417
+ data = self.safe_dict(response, 'data', {})
3418
3418
  record = self.safe_dict(data, 'record', {})
3419
3419
  return self.parse_transaction(record)
3420
3420
 
@@ -3464,7 +3464,7 @@ class bitmart(Exchange, ImplicitAPI):
3464
3464
  # }
3465
3465
  # }
3466
3466
  #
3467
- data = self.safe_value(response, 'data', {})
3467
+ data = self.safe_dict(response, 'data', {})
3468
3468
  record = self.safe_dict(data, 'record', {})
3469
3469
  return self.parse_transaction(record)
3470
3470
 
@@ -3591,7 +3591,7 @@ class bitmart(Exchange, ImplicitAPI):
3591
3591
  # }
3592
3592
  # }
3593
3593
  #
3594
- data = self.safe_value(response, 'data', {})
3594
+ data = self.safe_dict(response, 'data', {})
3595
3595
  transaction = self.parse_margin_loan(data, currency)
3596
3596
  return self.extend(transaction, {
3597
3597
  'amount': amount,
@@ -3627,7 +3627,7 @@ class bitmart(Exchange, ImplicitAPI):
3627
3627
  # }
3628
3628
  # }
3629
3629
  #
3630
- data = self.safe_value(response, 'data', {})
3630
+ data = self.safe_dict(response, 'data', {})
3631
3631
  transaction = self.parse_margin_loan(data, currency)
3632
3632
  return self.extend(transaction, {
3633
3633
  'amount': amount,
@@ -3704,9 +3704,9 @@ class bitmart(Exchange, ImplicitAPI):
3704
3704
  # }
3705
3705
  # }
3706
3706
  #
3707
- data = self.safe_value(response, 'data', {})
3708
- symbols = self.safe_value(data, 'symbols', [])
3709
- borrowRate = self.safe_value(symbols, 0)
3707
+ data = self.safe_dict(response, 'data', {})
3708
+ symbols = self.safe_list(data, 'symbols', [])
3709
+ borrowRate = self.safe_dict(symbols, 0, [])
3710
3710
  return self.parse_isolated_borrow_rate(borrowRate, market)
3711
3711
 
3712
3712
  def parse_isolated_borrow_rate(self, info: dict, market: Market = None) -> IsolatedBorrowRate:
@@ -3735,8 +3735,8 @@ class bitmart(Exchange, ImplicitAPI):
3735
3735
  #
3736
3736
  marketId = self.safe_string(info, 'symbol')
3737
3737
  symbol = self.safe_symbol(marketId, market)
3738
- baseData = self.safe_value(info, 'base', {})
3739
- quoteData = self.safe_value(info, 'quote', {})
3738
+ baseData = self.safe_dict(info, 'base', {})
3739
+ quoteData = self.safe_dict(info, 'quote', {})
3740
3740
  baseId = self.safe_string(baseData, 'currency')
3741
3741
  quoteId = self.safe_string(quoteData, 'currency')
3742
3742
  return {
@@ -3792,8 +3792,8 @@ class bitmart(Exchange, ImplicitAPI):
3792
3792
  # }
3793
3793
  # }
3794
3794
  #
3795
- data = self.safe_value(response, 'data', {})
3796
- symbols = self.safe_value(data, 'symbols', [])
3795
+ data = self.safe_dict(response, 'data', {})
3796
+ symbols = self.safe_list(data, 'symbols', [])
3797
3797
  return self.parse_isolated_borrow_rates(symbols)
3798
3798
 
3799
3799
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -3861,7 +3861,7 @@ class bitmart(Exchange, ImplicitAPI):
3861
3861
  # }
3862
3862
  # }
3863
3863
  #
3864
- data = self.safe_value(response, 'data', {})
3864
+ data = self.safe_dict(response, 'data', {})
3865
3865
  return self.extend(self.parse_transfer(data, currency), {
3866
3866
  'status': self.parse_transfer_status(self.safe_string_2(response, 'code', 'message')),
3867
3867
  })
@@ -3979,7 +3979,7 @@ class bitmart(Exchange, ImplicitAPI):
3979
3979
  # }
3980
3980
  # }
3981
3981
  #
3982
- data = self.safe_value(response, 'data', {})
3982
+ data = self.safe_dict(response, 'data', {})
3983
3983
  records = self.safe_list(data, 'records', [])
3984
3984
  return self.parse_transfers(records, currency, since, limit)
3985
3985
 
@@ -4027,8 +4027,8 @@ class bitmart(Exchange, ImplicitAPI):
4027
4027
  # }
4028
4028
  # }
4029
4029
  #
4030
- data = self.safe_value(response, 'data', {})
4031
- rows = self.safe_value(data, 'records', [])
4030
+ data = self.safe_dict(response, 'data', {})
4031
+ rows = self.safe_list(data, 'records', [])
4032
4032
  interest = self.parse_borrow_interests(rows, market)
4033
4033
  return self.filter_by_currency_since_limit(interest, code, since, limit)
4034
4034
 
@@ -4168,7 +4168,7 @@ class bitmart(Exchange, ImplicitAPI):
4168
4168
  # "trace": "4cad855074654097ac7ba5257c47305d.54.16951844206655589"
4169
4169
  # }
4170
4170
  #
4171
- data = self.safe_value(response, 'data', {})
4171
+ data = self.safe_dict(response, 'data', {})
4172
4172
  return self.parse_funding_rate(data, market)
4173
4173
 
4174
4174
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
@@ -4247,7 +4247,7 @@ class bitmart(Exchange, ImplicitAPI):
4247
4247
  # "trace":"4cad855074664097ac5ba5257c47305d.67.16963925142065945"
4248
4248
  # }
4249
4249
  #
4250
- data = self.safe_value(response, 'data', [])
4250
+ data = self.safe_list(response, 'data', [])
4251
4251
  first = self.safe_dict(data, 0, {})
4252
4252
  return self.parse_position(first, market)
4253
4253
 
@@ -4301,7 +4301,7 @@ class bitmart(Exchange, ImplicitAPI):
4301
4301
  # "trace":"4cad855074664097ac5ba5257c47305d.67.16963925142065945"
4302
4302
  # }
4303
4303
  #
4304
- positions = self.safe_value(response, 'data', [])
4304
+ positions = self.safe_list(response, 'data', [])
4305
4305
  result = []
4306
4306
  for i in range(0, len(positions)):
4307
4307
  result.append(self.parse_position(positions[i]))
@@ -4421,7 +4421,7 @@ class bitmart(Exchange, ImplicitAPI):
4421
4421
  # "trace": "4cad855074664097ac6ba4257c47305d.71.16965658195443021"
4422
4422
  # }
4423
4423
  #
4424
- data = self.safe_value(response, 'data', [])
4424
+ data = self.safe_list(response, 'data', [])
4425
4425
  result = []
4426
4426
  for i in range(0, len(data)):
4427
4427
  entry = data[i]
ccxt/bitmex.py CHANGED
@@ -2285,7 +2285,7 @@ class bitmex(Exchange, ImplicitAPI):
2285
2285
  'takeProfitPrice': None,
2286
2286
  })
2287
2287
 
2288
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2288
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2289
2289
  """
2290
2290
  make a withdrawal
2291
2291
  :see: https://www.bitmex.com/api/explorer/#not /User/User_requestWithdrawal
ccxt/bitopro.py CHANGED
@@ -233,7 +233,7 @@ class bitopro(Exchange, ImplicitAPI):
233
233
  :returns dict: an associative dictionary of currencies
234
234
  """
235
235
  response = self.publicGetProvisioningCurrencies(params)
236
- currencies = self.safe_value(response, 'data', [])
236
+ currencies = self.safe_list(response, 'data', [])
237
237
  #
238
238
  # {
239
239
  # "data":[
@@ -255,8 +255,8 @@ class bitopro(Exchange, ImplicitAPI):
255
255
  currency = currencies[i]
256
256
  currencyId = self.safe_string(currency, 'currency')
257
257
  code = self.safe_currency_code(currencyId)
258
- deposit = self.safe_value(currency, 'deposit')
259
- withdraw = self.safe_value(currency, 'withdraw')
258
+ deposit = self.safe_bool(currency, 'deposit')
259
+ withdraw = self.safe_bool(currency, 'withdraw')
260
260
  fee = self.safe_number(currency, 'withdrawFee')
261
261
  withdrawMin = self.safe_number(currency, 'minWithdraw')
262
262
  withdrawMax = self.safe_number(currency, 'maxWithdraw')
@@ -293,7 +293,7 @@ class bitopro(Exchange, ImplicitAPI):
293
293
  :returns dict[]: an array of objects representing market data
294
294
  """
295
295
  response = self.publicGetProvisioningTradingPairs()
296
- markets = self.safe_value(response, 'data', [])
296
+ markets = self.safe_list(response, 'data', [])
297
297
  #
298
298
  # {
299
299
  # "data":[
@@ -317,7 +317,7 @@ class bitopro(Exchange, ImplicitAPI):
317
317
  return self.parse_markets(markets)
318
318
 
319
319
  def parse_market(self, market: dict) -> Market:
320
- active = not self.safe_value(market, 'maintain')
320
+ active = not self.safe_bool(market, 'maintain')
321
321
  id = self.safe_string(market, 'pair')
322
322
  uppercaseId = id.upper()
323
323
  baseId = self.safe_string(market, 'base')
@@ -429,7 +429,7 @@ class bitopro(Exchange, ImplicitAPI):
429
429
  'pair': market['id'],
430
430
  }
431
431
  response = self.publicGetTickersPair(self.extend(request, params))
432
- ticker = self.safe_value(response, 'data', {})
432
+ ticker = self.safe_dict(response, 'data', {})
433
433
  #
434
434
  # {
435
435
  # "data":{
@@ -455,7 +455,7 @@ class bitopro(Exchange, ImplicitAPI):
455
455
  """
456
456
  self.load_markets()
457
457
  response = self.publicGetTickers()
458
- tickers = self.safe_value(response, 'data', [])
458
+ tickers = self.safe_list(response, 'data', [])
459
459
  #
460
460
  # {
461
461
  # "data":[
@@ -551,7 +551,7 @@ class bitopro(Exchange, ImplicitAPI):
551
551
  type = self.safe_string_lower(trade, 'type')
552
552
  side = self.safe_string_lower(trade, 'action')
553
553
  if side is None:
554
- isBuyer = self.safe_value(trade, 'isBuyer')
554
+ isBuyer = self.safe_bool(trade, 'isBuyer')
555
555
  if isBuyer:
556
556
  side = 'buy'
557
557
  else:
@@ -568,7 +568,7 @@ class bitopro(Exchange, ImplicitAPI):
568
568
  'currency': feeSymbol,
569
569
  'rate': None,
570
570
  }
571
- isTaker = self.safe_value(trade, 'isTaker')
571
+ isTaker = self.safe_bool(trade, 'isTaker')
572
572
  takerOrMaker = None
573
573
  if isTaker is not None:
574
574
  if isTaker:
@@ -607,7 +607,7 @@ class bitopro(Exchange, ImplicitAPI):
607
607
  'pair': market['id'],
608
608
  }
609
609
  response = self.publicGetTradesPair(self.extend(request, params))
610
- trades = self.safe_value(response, 'data', [])
610
+ trades = self.safe_list(response, 'data', [])
611
611
  #
612
612
  # {
613
613
  # "data":[
@@ -631,7 +631,7 @@ class bitopro(Exchange, ImplicitAPI):
631
631
  """
632
632
  self.load_markets()
633
633
  response = self.publicGetProvisioningLimitationsAndFees(params)
634
- tradingFeeRate = self.safe_value(response, 'tradingFeeRate', {})
634
+ tradingFeeRate = self.safe_dict(response, 'tradingFeeRate', {})
635
635
  first = self.safe_value(tradingFeeRate, 0)
636
636
  #
637
637
  # {
@@ -753,7 +753,7 @@ class bitopro(Exchange, ImplicitAPI):
753
753
  request['from'] = int(math.floor(since / 1000))
754
754
  request['to'] = self.sum(request['from'], limit * timeframeInSeconds)
755
755
  response = self.publicGetTradingHistoryPair(self.extend(request, params))
756
- data = self.safe_value(response, 'data', [])
756
+ data = self.safe_list(response, 'data', [])
757
757
  #
758
758
  # {
759
759
  # "data":[
@@ -841,7 +841,7 @@ class bitopro(Exchange, ImplicitAPI):
841
841
  """
842
842
  self.load_markets()
843
843
  response = self.privateGetAccountsBalance(params)
844
- balances = self.safe_value(response, 'data', [])
844
+ balances = self.safe_list(response, 'data', [])
845
845
  #
846
846
  # {
847
847
  # "data":[
@@ -1101,7 +1101,7 @@ class bitopro(Exchange, ImplicitAPI):
1101
1101
  response = self.privateDeleteOrdersPair(self.extend(request, params))
1102
1102
  else:
1103
1103
  response = self.privateDeleteOrdersAll(self.extend(request, params))
1104
- data = self.safe_value(response, 'data', {})
1104
+ data = self.safe_dict(response, 'data', {})
1105
1105
  #
1106
1106
  # {
1107
1107
  # "data":{
@@ -1183,7 +1183,7 @@ class bitopro(Exchange, ImplicitAPI):
1183
1183
  if limit is not None:
1184
1184
  request['limit'] = limit
1185
1185
  response = self.privateGetOrdersAllPair(self.extend(request, params))
1186
- orders = self.safe_value(response, 'data')
1186
+ orders = self.safe_list(response, 'data', [])
1187
1187
  if orders is None:
1188
1188
  orders = []
1189
1189
  #
@@ -1253,7 +1253,7 @@ class bitopro(Exchange, ImplicitAPI):
1253
1253
  'pair': market['id'],
1254
1254
  }
1255
1255
  response = self.privateGetOrdersTradesPair(self.extend(request, params))
1256
- trades = self.safe_value(response, 'data', [])
1256
+ trades = self.safe_list(response, 'data', [])
1257
1257
  #
1258
1258
  # {
1259
1259
  # "data":[
@@ -1395,7 +1395,7 @@ class bitopro(Exchange, ImplicitAPI):
1395
1395
  if limit is not None:
1396
1396
  request['limit'] = limit
1397
1397
  response = self.privateGetWalletDepositHistoryCurrency(self.extend(request, params))
1398
- result = self.safe_value(response, 'data', [])
1398
+ result = self.safe_list(response, 'data', [])
1399
1399
  #
1400
1400
  # {
1401
1401
  # "data":[
@@ -1442,7 +1442,7 @@ class bitopro(Exchange, ImplicitAPI):
1442
1442
  if limit is not None:
1443
1443
  request['limit'] = limit
1444
1444
  response = self.privateGetWalletWithdrawHistoryCurrency(self.extend(request, params))
1445
- result = self.safe_value(response, 'data', [])
1445
+ result = self.safe_list(response, 'data', [])
1446
1446
  #
1447
1447
  # {
1448
1448
  # "data":[
@@ -1481,7 +1481,7 @@ class bitopro(Exchange, ImplicitAPI):
1481
1481
  'currency': currency['id'],
1482
1482
  }
1483
1483
  response = self.privateGetWalletWithdrawCurrencySerial(self.extend(request, params))
1484
- result = self.safe_value(response, 'data', {})
1484
+ result = self.safe_dict(response, 'data', {})
1485
1485
  #
1486
1486
  # {
1487
1487
  # "data":{
@@ -1500,7 +1500,7 @@ class bitopro(Exchange, ImplicitAPI):
1500
1500
  #
1501
1501
  return self.parse_transaction(result, currency)
1502
1502
 
1503
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
1503
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1504
1504
  """
1505
1505
  make a withdrawal
1506
1506
  :see: https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/create_an_withdraw_invoice.md
@@ -1521,7 +1521,7 @@ class bitopro(Exchange, ImplicitAPI):
1521
1521
  'address': address,
1522
1522
  }
1523
1523
  if 'network' in params:
1524
- networks = self.safe_value(self.options, 'networks', {})
1524
+ networks = self.safe_dict(self.options, 'networks', {})
1525
1525
  requestedNetwork = self.safe_string_upper(params, 'network')
1526
1526
  params = self.omit(params, ['network'])
1527
1527
  networkId = self.safe_string(networks, requestedNetwork)
@@ -1531,7 +1531,7 @@ class bitopro(Exchange, ImplicitAPI):
1531
1531
  if tag is not None:
1532
1532
  request['message'] = tag
1533
1533
  response = self.privatePostWalletWithdrawCurrency(self.extend(request, params))
1534
- result = self.safe_value(response, 'data', {})
1534
+ result = self.safe_dict(response, 'data', {})
1535
1535
  #
1536
1536
  # {
1537
1537
  # "data":{