ccxt 4.4.28__py2.py3-none-any.whl → 4.4.29__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 (151) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/bybit.py +0 -13
  3. ccxt/alpaca.py +1 -1
  4. ccxt/async_support/__init__.py +1 -1
  5. ccxt/async_support/alpaca.py +1 -1
  6. ccxt/async_support/base/exchange.py +4 -1
  7. ccxt/async_support/bigone.py +1 -1
  8. ccxt/async_support/binance.py +1 -1
  9. ccxt/async_support/bingx.py +1 -1
  10. ccxt/async_support/bitbank.py +1 -1
  11. ccxt/async_support/bitfinex.py +1 -1
  12. ccxt/async_support/bitfinex2.py +1 -1
  13. ccxt/async_support/bitflyer.py +1 -1
  14. ccxt/async_support/bitget.py +96 -8
  15. ccxt/async_support/bithumb.py +1 -1
  16. ccxt/async_support/bitmart.py +1 -1
  17. ccxt/async_support/bitmex.py +1 -1
  18. ccxt/async_support/bitopro.py +22 -22
  19. ccxt/async_support/bitrue.py +29 -29
  20. ccxt/async_support/bitso.py +1 -1
  21. ccxt/async_support/bitstamp.py +1 -1
  22. ccxt/async_support/bitvavo.py +4 -1
  23. ccxt/async_support/blockchaincom.py +1 -1
  24. ccxt/async_support/btcmarkets.py +1 -1
  25. ccxt/async_support/bybit.py +50 -585
  26. ccxt/async_support/coinbase.py +1 -1
  27. ccxt/async_support/coinbaseexchange.py +1 -1
  28. ccxt/async_support/coinbaseinternational.py +1 -1
  29. ccxt/async_support/coincatch.py +25 -5
  30. ccxt/async_support/coinex.py +1 -1
  31. ccxt/async_support/coinlist.py +1 -1
  32. ccxt/async_support/coinmate.py +1 -1
  33. ccxt/async_support/coinsph.py +1 -1
  34. ccxt/async_support/cryptocom.py +1 -1
  35. ccxt/async_support/deribit.py +1 -1
  36. ccxt/async_support/digifinex.py +1 -1
  37. ccxt/async_support/exmo.py +1 -1
  38. ccxt/async_support/gate.py +1 -1
  39. ccxt/async_support/gemini.py +1 -1
  40. ccxt/async_support/hashkey.py +1 -1
  41. ccxt/async_support/hitbtc.py +1 -1
  42. ccxt/async_support/hollaex.py +1 -1
  43. ccxt/async_support/htx.py +1 -1
  44. ccxt/async_support/huobijp.py +1 -1
  45. ccxt/async_support/idex.py +1 -1
  46. ccxt/async_support/independentreserve.py +1 -1
  47. ccxt/async_support/indodax.py +1 -1
  48. ccxt/async_support/kraken.py +1 -1
  49. ccxt/async_support/kucoin.py +1 -1
  50. ccxt/async_support/kuna.py +1 -1
  51. ccxt/async_support/lbank.py +6 -1
  52. ccxt/async_support/lykke.py +1 -1
  53. ccxt/async_support/mercado.py +1 -1
  54. ccxt/async_support/mexc.py +1 -1
  55. ccxt/async_support/ndax.py +1 -1
  56. ccxt/async_support/novadax.py +1 -1
  57. ccxt/async_support/okcoin.py +1 -1
  58. ccxt/async_support/okx.py +1 -1
  59. ccxt/async_support/onetrading.py +1 -1
  60. ccxt/async_support/oxfun.py +1 -1
  61. ccxt/async_support/phemex.py +1 -1
  62. ccxt/async_support/poloniex.py +1 -1
  63. ccxt/async_support/probit.py +1 -1
  64. ccxt/async_support/tokocrypto.py +1 -1
  65. ccxt/async_support/upbit.py +1 -1
  66. ccxt/async_support/vertex.py +52 -8
  67. ccxt/async_support/wavesexchange.py +1 -1
  68. ccxt/async_support/whitebit.py +1 -1
  69. ccxt/async_support/woo.py +1 -1
  70. ccxt/async_support/woofipro.py +1 -1
  71. ccxt/async_support/xt.py +1 -1
  72. ccxt/async_support/yobit.py +2 -2
  73. ccxt/async_support/zaif.py +1 -1
  74. ccxt/async_support/zonda.py +1 -1
  75. ccxt/base/exchange.py +4 -1
  76. ccxt/bigone.py +1 -1
  77. ccxt/binance.py +1 -1
  78. ccxt/bingx.py +1 -1
  79. ccxt/bitbank.py +1 -1
  80. ccxt/bitfinex.py +1 -1
  81. ccxt/bitfinex2.py +1 -1
  82. ccxt/bitflyer.py +1 -1
  83. ccxt/bitget.py +96 -8
  84. ccxt/bithumb.py +1 -1
  85. ccxt/bitmart.py +1 -1
  86. ccxt/bitmex.py +1 -1
  87. ccxt/bitopro.py +22 -22
  88. ccxt/bitrue.py +29 -29
  89. ccxt/bitso.py +1 -1
  90. ccxt/bitstamp.py +1 -1
  91. ccxt/bitvavo.py +4 -1
  92. ccxt/blockchaincom.py +1 -1
  93. ccxt/btcmarkets.py +1 -1
  94. ccxt/bybit.py +50 -585
  95. ccxt/coinbase.py +1 -1
  96. ccxt/coinbaseexchange.py +1 -1
  97. ccxt/coinbaseinternational.py +1 -1
  98. ccxt/coincatch.py +25 -5
  99. ccxt/coinex.py +1 -1
  100. ccxt/coinlist.py +1 -1
  101. ccxt/coinmate.py +1 -1
  102. ccxt/coinsph.py +1 -1
  103. ccxt/cryptocom.py +1 -1
  104. ccxt/deribit.py +1 -1
  105. ccxt/digifinex.py +1 -1
  106. ccxt/exmo.py +1 -1
  107. ccxt/gate.py +1 -1
  108. ccxt/gemini.py +1 -1
  109. ccxt/hashkey.py +1 -1
  110. ccxt/hitbtc.py +1 -1
  111. ccxt/hollaex.py +1 -1
  112. ccxt/htx.py +1 -1
  113. ccxt/huobijp.py +1 -1
  114. ccxt/idex.py +1 -1
  115. ccxt/independentreserve.py +1 -1
  116. ccxt/indodax.py +1 -1
  117. ccxt/kraken.py +1 -1
  118. ccxt/kucoin.py +1 -1
  119. ccxt/kuna.py +1 -1
  120. ccxt/lbank.py +6 -1
  121. ccxt/lykke.py +1 -1
  122. ccxt/mercado.py +1 -1
  123. ccxt/mexc.py +1 -1
  124. ccxt/ndax.py +1 -1
  125. ccxt/novadax.py +1 -1
  126. ccxt/okcoin.py +1 -1
  127. ccxt/okx.py +1 -1
  128. ccxt/onetrading.py +1 -1
  129. ccxt/oxfun.py +1 -1
  130. ccxt/phemex.py +1 -1
  131. ccxt/poloniex.py +1 -1
  132. ccxt/pro/__init__.py +1 -1
  133. ccxt/pro/bitvavo.py +2 -1
  134. ccxt/pro/mexc.py +187 -30
  135. ccxt/probit.py +1 -1
  136. ccxt/tokocrypto.py +1 -1
  137. ccxt/upbit.py +1 -1
  138. ccxt/vertex.py +52 -8
  139. ccxt/wavesexchange.py +1 -1
  140. ccxt/whitebit.py +1 -1
  141. ccxt/woo.py +1 -1
  142. ccxt/woofipro.py +1 -1
  143. ccxt/xt.py +1 -1
  144. ccxt/yobit.py +2 -2
  145. ccxt/zaif.py +1 -1
  146. ccxt/zonda.py +1 -1
  147. {ccxt-4.4.28.dist-info → ccxt-4.4.29.dist-info}/METADATA +4 -4
  148. {ccxt-4.4.28.dist-info → ccxt-4.4.29.dist-info}/RECORD +151 -151
  149. {ccxt-4.4.28.dist-info → ccxt-4.4.29.dist-info}/LICENSE.txt +0 -0
  150. {ccxt-4.4.28.dist-info → ccxt-4.4.29.dist-info}/WHEEL +0 -0
  151. {ccxt-4.4.28.dist-info → ccxt-4.4.29.dist-info}/top_level.txt +0 -0
@@ -585,7 +585,7 @@ class zaif(Exchange, ImplicitAPI):
585
585
  response = await self.privatePostTradeHistory(self.extend(request, params))
586
586
  return self.parse_orders(response['return'], market, since, limit)
587
587
 
588
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
588
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
589
589
  """
590
590
  :see: https://zaif-api-document.readthedocs.io/ja/latest/TradingAPI.html#id41
591
591
  make a withdrawal
@@ -1689,7 +1689,7 @@ class zonda(Exchange, ImplicitAPI):
1689
1689
  }
1690
1690
  return self.safe_string(statuses, status, status)
1691
1691
 
1692
- async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
1692
+ async def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1693
1693
  """
1694
1694
  :see: https://docs.zondacrypto.exchange/reference/crypto-withdrawal-1
1695
1695
  make a withdrawal
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.4.28'
7
+ __version__ = '4.4.29'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -2480,6 +2480,9 @@ class Exchange(object):
2480
2480
  def fetch_order_book(self, symbol: str, limit: Int = None, params={}):
2481
2481
  raise NotSupported(self.id + ' fetchOrderBook() is not supported yet')
2482
2482
 
2483
+ def fetch_order_book_ws(self, symbol: str, limit: Int = None, params={}):
2484
+ raise NotSupported(self.id + ' fetchOrderBookWs() is not supported yet')
2485
+
2483
2486
  def fetch_margin_mode(self, symbol: str, params={}):
2484
2487
  if self.has['fetchMarginModes']:
2485
2488
  marginModes = self.fetch_margin_modes([symbol], params)
ccxt/bigone.py CHANGED
@@ -2018,7 +2018,7 @@ class bigone(Exchange, ImplicitAPI):
2018
2018
  }
2019
2019
  return self.safe_string(statuses, status, 'failed')
2020
2020
 
2021
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2021
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2022
2022
  """
2023
2023
  make a withdrawal
2024
2024
  :see: https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user
ccxt/binance.py CHANGED
@@ -8480,7 +8480,7 @@ class binance(Exchange, ImplicitAPI):
8480
8480
  }
8481
8481
  return result
8482
8482
 
8483
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
8483
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
8484
8484
  """
8485
8485
  make a withdrawal
8486
8486
  :see: https://developers.binance.com/docs/wallet/capital/withdraw
ccxt/bingx.py CHANGED
@@ -4977,7 +4977,7 @@ class bingx(Exchange, ImplicitAPI):
4977
4977
  coins = self.safe_list(response, 'data')
4978
4978
  return self.parse_deposit_withdraw_fees(coins, codes, 'coin')
4979
4979
 
4980
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
4980
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
4981
4981
  """
4982
4982
  make a withdrawal
4983
4983
  :see: https://bingx-api.github.io/docs/#/en-us/spot/wallet-api.html#Withdraw
ccxt/bitbank.py CHANGED
@@ -814,7 +814,7 @@ class bitbank(Exchange, ImplicitAPI):
814
814
  'tag': None,
815
815
  }
816
816
 
817
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
817
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
818
818
  """
819
819
  make a withdrawal
820
820
  :see: https://github.com/bitbankinc/bitbank-api-docs/blob/38d6d7c6f486c793872fd4b4087a0d090a04cd0a/rest-api.md#new-withdrawal-request
ccxt/bitfinex.py CHANGED
@@ -1528,7 +1528,7 @@ class bitfinex(Exchange, ImplicitAPI):
1528
1528
  }
1529
1529
  return self.safe_string(statuses, status, status)
1530
1530
 
1531
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
1531
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
1532
1532
  """
1533
1533
  make a withdrawal
1534
1534
  :see: https://docs.bitfinex.com/v1/reference/rest-auth-withdrawal
ccxt/bitfinex2.py CHANGED
@@ -2458,7 +2458,7 @@ class bitfinex2(Exchange, ImplicitAPI):
2458
2458
  #
2459
2459
  return self.parse_transactions(response, currency, since, limit)
2460
2460
 
2461
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2461
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2462
2462
  """
2463
2463
  make a withdrawal
2464
2464
  :see: https://docs.bitfinex.com/reference/rest-auth-withdraw
ccxt/bitflyer.py CHANGED
@@ -775,7 +775,7 @@ class bitflyer(Exchange, ImplicitAPI):
775
775
  # todo unify parsePosition/parsePositions
776
776
  return response
777
777
 
778
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
778
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
779
779
  """
780
780
  make a withdrawal
781
781
  :see: https://lightning.bitflyer.com/docs?lang=en#withdrawing-funds
ccxt/bitget.py CHANGED
@@ -7,7 +7,7 @@ from ccxt.base.exchange import Exchange
7
7
  from ccxt.abstract.bitget import ImplicitAPI
8
8
  import hashlib
9
9
  import json
10
- from ccxt.base.types import Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, LongShortRatio, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
10
+ from ccxt.base.types import Balances, BorrowInterest, Conversion, CrossBorrowRate, Currencies, Currency, DepositAddress, FundingHistory, Int, IsolatedBorrowRate, LedgerEntry, Leverage, LeverageTier, Liquidation, LongShortRatio, MarginMode, MarginModification, Market, Num, Order, OrderBook, OrderRequest, OrderSide, OrderType, Position, Str, Strings, Ticker, Tickers, FundingRate, FundingRates, Trade, TradingFeeInterface, TradingFees, Transaction, TransferEntry
11
11
  from typing import List
12
12
  from ccxt.base.errors import ExchangeError
13
13
  from ccxt.base.errors import AuthenticationError
@@ -105,7 +105,7 @@ class bitget(Exchange, ImplicitAPI):
105
105
  'fetchFundingIntervals': False,
106
106
  'fetchFundingRate': True,
107
107
  'fetchFundingRateHistory': True,
108
- 'fetchFundingRates': False,
108
+ 'fetchFundingRates': True,
109
109
  'fetchIndexOHLCV': True,
110
110
  'fetchIsolatedBorrowRate': True,
111
111
  'fetchIsolatedBorrowRates': False,
@@ -2142,7 +2142,7 @@ class bitget(Exchange, ImplicitAPI):
2142
2142
  rawTransactions = self.safe_list(response, 'data', [])
2143
2143
  return self.parse_transactions(rawTransactions, currency, since, limit)
2144
2144
 
2145
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
2145
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
2146
2146
  """
2147
2147
  make a withdrawal
2148
2148
  :see: https://www.bitget.com/api-doc/spot/account/Wallet-Withdrawal
@@ -6350,6 +6350,66 @@ class bitget(Exchange, ImplicitAPI):
6350
6350
  data = self.safe_value(response, 'data', [])
6351
6351
  return self.parse_funding_rate(data[0], market)
6352
6352
 
6353
+ def fetch_funding_rates(self, symbols: Strings = None, params={}) -> FundingRates:
6354
+ """
6355
+ fetch the current funding rates for all markets
6356
+ :see: https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
6357
+ :param str[] [symbols]: list of unified market symbols
6358
+ :param dict [params]: extra parameters specific to the exchange API endpoint
6359
+ :param str [params.subType]: *contract only* 'linear', 'inverse'
6360
+ :param str [params.productType]: *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
6361
+ :returns dict: a dictionary of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
6362
+ """
6363
+ self.load_markets()
6364
+ market = None
6365
+ if symbols is not None:
6366
+ symbol = self.safe_value(symbols, 0)
6367
+ sandboxMode = self.safe_bool(self.options, 'sandboxMode', False)
6368
+ if sandboxMode:
6369
+ sandboxSymbol = self.convert_symbol_for_sandbox(symbol)
6370
+ market = self.market(sandboxSymbol)
6371
+ else:
6372
+ market = self.market(symbol)
6373
+ request: dict = {}
6374
+ productType = None
6375
+ productType, params = self.handle_product_type_and_params(market, params)
6376
+ request['productType'] = productType
6377
+ response = self.publicMixGetV2MixMarketTickers(self.extend(request, params))
6378
+ # {
6379
+ # "code": "00000",
6380
+ # "msg": "success",
6381
+ # "requestTime": 1700533773477,
6382
+ # "data": [
6383
+ # {
6384
+ # "symbol": "BTCUSD",
6385
+ # "lastPr": "29904.5",
6386
+ # "askPr": "29904.5",
6387
+ # "bidPr": "29903.5",
6388
+ # "bidSz": "0.5091",
6389
+ # "askSz": "2.2694",
6390
+ # "high24h": "0",
6391
+ # "low24h": "0",
6392
+ # "ts": "1695794271400",
6393
+ # "change24h": "0",
6394
+ # "baseVolume": "0",
6395
+ # "quoteVolume": "0",
6396
+ # "usdtVolume": "0",
6397
+ # "openUtc": "0",
6398
+ # "changeUtc24h": "0",
6399
+ # "indexPrice": "29132.353333",
6400
+ # "fundingRate": "-0.0007",
6401
+ # "holdingAmount": "125.6844",
6402
+ # "deliveryStartTime": null,
6403
+ # "deliveryTime": null,
6404
+ # "deliveryStatus": "delivery_normal",
6405
+ # "open24h": "0",
6406
+ # "markPrice": "12345"
6407
+ # },
6408
+ # ]
6409
+ # }
6410
+ data = self.safe_list(response, 'data', [])
6411
+ return self.parse_funding_rates(data, market)
6412
+
6353
6413
  def parse_funding_rate(self, contract, market: Market = None) -> FundingRate:
6354
6414
  #
6355
6415
  # fetchFundingRate
@@ -6366,23 +6426,51 @@ class bitget(Exchange, ImplicitAPI):
6366
6426
  # "nextFundingTime": "1727942400000",
6367
6427
  # "ratePeriod": "8"
6368
6428
  # }
6369
- #
6429
+ # fetchFundingRates
6430
+ # {
6431
+ # "symbol": "BTCUSD",
6432
+ # "lastPr": "29904.5",
6433
+ # "askPr": "29904.5",
6434
+ # "bidPr": "29903.5",
6435
+ # "bidSz": "0.5091",
6436
+ # "askSz": "2.2694",
6437
+ # "high24h": "0",
6438
+ # "low24h": "0",
6439
+ # "ts": "1695794271400",
6440
+ # "change24h": "0",
6441
+ # "baseVolume": "0",
6442
+ # "quoteVolume": "0",
6443
+ # "usdtVolume": "0",
6444
+ # "openUtc": "0",
6445
+ # "changeUtc24h": "0",
6446
+ # "indexPrice": "29132.353333",
6447
+ # "fundingRate": "-0.0007",
6448
+ # "holdingAmount": "125.6844",
6449
+ # "deliveryStartTime": null,
6450
+ # "deliveryTime": null,
6451
+ # "deliveryStatus": "delivery_normal",
6452
+ # "open24h": "0",
6453
+ # "markPrice": "12345"
6454
+ # }
6370
6455
  marketId = self.safe_string(contract, 'symbol')
6371
6456
  symbol = self.safe_symbol(marketId, market, None, 'swap')
6372
6457
  fundingTimestamp = self.safe_integer(contract, 'nextFundingTime')
6373
6458
  interval = self.safe_string(contract, 'ratePeriod')
6459
+ timestamp = self.safe_integer(contract, 'ts')
6460
+ markPrice = self.safe_number(contract, 'markPrice')
6461
+ indexPrice = self.safe_number(contract, 'indexPrice')
6374
6462
  intervalString = None
6375
6463
  if interval is not None:
6376
6464
  intervalString = interval + 'h'
6377
6465
  return {
6378
6466
  'info': contract,
6379
6467
  'symbol': symbol,
6380
- 'markPrice': None,
6381
- 'indexPrice': None,
6468
+ 'markPrice': markPrice,
6469
+ 'indexPrice': indexPrice,
6382
6470
  'interestRate': None,
6383
6471
  'estimatedSettlePrice': None,
6384
- 'timestamp': None,
6385
- 'datetime': None,
6472
+ 'timestamp': timestamp,
6473
+ 'datetime': self.iso8601(timestamp),
6386
6474
  'fundingRate': self.safe_number(contract, 'fundingRate'),
6387
6475
  'fundingTimestamp': fundingTimestamp,
6388
6476
  'fundingDatetime': self.iso8601(fundingTimestamp),
ccxt/bithumb.py CHANGED
@@ -982,7 +982,7 @@ class bithumb(Exchange, ImplicitAPI):
982
982
  }
983
983
  return self.cancel_order(order['id'], order['symbol'], self.extend(request, params))
984
984
 
985
- def withdraw(self, code: str, amount: float, address: str, tag=None, params={}):
985
+ def withdraw(self, code: str, amount: float, address: str, tag=None, params={}) -> Transaction:
986
986
  """
987
987
  make a withdrawal
988
988
  :see: https://apidocs.bithumb.com/v1.2.0/reference/%EC%BD%94%EC%9D%B8-%EC%B6%9C%EA%B8%88%ED%95%98%EA%B8%B0-%EA%B0%9C%EC%9D%B8
ccxt/bitmart.py CHANGED
@@ -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
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":{