ccxt 4.2.84__py2.py3-none-any.whl → 4.2.86__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.

Potentially problematic release.


This version of ccxt might be problematic. Click here for more details.

Files changed (152) hide show
  1. ccxt/__init__.py +1 -1
  2. ccxt/abstract/coinex.py +232 -123
  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 +45 -28
  12. ccxt/async_support/bit2c.py +1 -1
  13. ccxt/async_support/bitbank.py +27 -29
  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 +29 -24
  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 +30 -83
  28. ccxt/async_support/coincheck.py +4 -4
  29. ccxt/async_support/coinex.py +404 -262
  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 +7 -7
  45. ccxt/async_support/huobijp.py +3 -3
  46. ccxt/async_support/idex.py +12 -12
  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 +4 -1
  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 +15 -14
  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 +45 -28
  80. ccxt/bit2c.py +1 -1
  81. ccxt/bitbank.py +27 -29
  82. ccxt/bitbns.py +5 -5
  83. ccxt/bitfinex.py +1 -1
  84. ccxt/bitfinex2.py +1 -1
  85. ccxt/bitget.py +29 -24
  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 +30 -83
  96. ccxt/coincheck.py +4 -4
  97. ccxt/coinex.py +404 -262
  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 +7 -7
  113. ccxt/huobijp.py +3 -3
  114. ccxt/idex.py +12 -12
  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 +4 -1
  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 +15 -14
  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/bitget.py +1 -0
  139. ccxt/pro/kucoin.py +6 -7
  140. ccxt/pro/okx.py +12 -1
  141. ccxt/probit.py +11 -11
  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.84.dist-info → ccxt-4.2.86.dist-info}/METADATA +6 -6
  150. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/RECORD +152 -152
  151. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/WHEEL +0 -0
  152. {ccxt-4.2.84.dist-info → ccxt-4.2.86.dist-info}/top_level.txt +0 -0
@@ -1203,7 +1203,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1203
1203
  }
1204
1204
  response = await self.binanceGetTicker24hr(self.extend(request, params))
1205
1205
  if isinstance(response, list):
1206
- firstTicker = self.safe_value(response, 0, {})
1206
+ firstTicker = self.safe_dict(response, 0, {})
1207
1207
  return self.parse_ticker(firstTicker, market)
1208
1208
  return self.parse_ticker(response, market)
1209
1209
 
@@ -1311,7 +1311,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1311
1311
  # [1591478640000,"0.02500800","0.02501100","0.02500300","0.02500800","154.14200000",1591478699999,"3.85405839",97,"5.32300000","0.13312641","0"],
1312
1312
  # ]
1313
1313
  #
1314
- data = self.safe_value(response, 'data', response)
1314
+ data = self.safe_list(response, 'data', response)
1315
1315
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1316
1316
 
1317
1317
  async def fetch_balance(self, params={}) -> Balances:
@@ -1712,7 +1712,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1712
1712
  # "timestamp": 1662710994975
1713
1713
  # }
1714
1714
  #
1715
- rawOrder = self.safe_value(response, 'data', {})
1715
+ rawOrder = self.safe_dict(response, 'data', {})
1716
1716
  return self.parse_order(rawOrder, market)
1717
1717
 
1718
1718
  async def fetch_order(self, id: str, symbol: Str = None, params={}):
@@ -1759,7 +1759,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1759
1759
  #
1760
1760
  data = self.safe_value(response, 'data', {})
1761
1761
  list = self.safe_value(data, 'list', [])
1762
- rawOrder = self.safe_value(list, 0, {})
1762
+ rawOrder = self.safe_dict(list, 0, {})
1763
1763
  return self.parse_order(rawOrder)
1764
1764
 
1765
1765
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1825,7 +1825,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1825
1825
  # }
1826
1826
  #
1827
1827
  data = self.safe_value(response, 'data', {})
1828
- orders = self.safe_value(data, 'list', [])
1828
+ orders = self.safe_list(data, 'list', [])
1829
1829
  return self.parse_orders(orders, market, since, limit)
1830
1830
 
1831
1831
  async def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1894,7 +1894,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1894
1894
  # "timestamp": 1662710683634
1895
1895
  # }
1896
1896
  #
1897
- rawOrder = self.safe_value(response, 'data', {})
1897
+ rawOrder = self.safe_dict(response, 'data', {})
1898
1898
  return self.parse_order(rawOrder)
1899
1899
 
1900
1900
  async def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1949,7 +1949,7 @@ class tokocrypto(Exchange, ImplicitAPI):
1949
1949
  # }
1950
1950
  #
1951
1951
  data = self.safe_value(response, 'data', {})
1952
- trades = self.safe_value(data, 'list', [])
1952
+ trades = self.safe_list(data, 'list', [])
1953
1953
  return self.parse_trades(trades, market, since, limit)
1954
1954
 
1955
1955
  async def fetch_deposit_address(self, code: str, params={}):
@@ -2056,7 +2056,7 @@ class tokocrypto(Exchange, ImplicitAPI):
2056
2056
  # }
2057
2057
  #
2058
2058
  data = self.safe_value(response, 'data', {})
2059
- deposits = self.safe_value(data, 'list', [])
2059
+ deposits = self.safe_list(data, 'list', [])
2060
2060
  return self.parse_transactions(deposits, currency, since, limit)
2061
2061
 
2062
2062
  async def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -2108,7 +2108,7 @@ class tokocrypto(Exchange, ImplicitAPI):
2108
2108
  # }
2109
2109
  #
2110
2110
  data = self.safe_value(response, 'data', {})
2111
- withdrawals = self.safe_value(data, 'list', [])
2111
+ withdrawals = self.safe_list(data, 'list', [])
2112
2112
  return self.parse_transactions(withdrawals, currency, since, limit)
2113
2113
 
2114
2114
  def parse_transaction_status_by_type(self, status, type=None):
@@ -861,7 +861,7 @@ class wavesexchange(Exchange, ImplicitAPI):
861
861
  #
862
862
  data = self.safe_value(response, 'data', [])
863
863
  ticker = self.safe_value(data, 0, {})
864
- dataTicker = self.safe_value(ticker, 'data', {})
864
+ dataTicker = self.safe_dict(ticker, 'data', {})
865
865
  return self.parse_ticker(dataTicker, market)
866
866
 
867
867
  async def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
@@ -1386,11 +1386,11 @@ class wavesexchange(Exchange, ImplicitAPI):
1386
1386
  #
1387
1387
  if isMarketOrder:
1388
1388
  response = await self.matcherPostMatcherOrderbookMarket(body)
1389
- value = self.safe_value(response, 'message')
1389
+ value = self.safe_dict(response, 'message')
1390
1390
  return self.parse_order(value, market)
1391
1391
  else:
1392
1392
  response = await self.matcherPostMatcherOrderbook(body)
1393
- value = self.safe_value(response, 'message')
1393
+ value = self.safe_dict(response, 'message')
1394
1394
  return self.parse_order(value, market)
1395
1395
 
1396
1396
  async def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -728,7 +728,7 @@ class whitebit(Exchange, ImplicitAPI):
728
728
  # },
729
729
  # }
730
730
  #
731
- ticker = self.safe_value(response, 'result', {})
731
+ ticker = self.safe_dict(response, 'result', {})
732
732
  return self.parse_ticker(ticker, market)
733
733
 
734
734
  def parse_ticker(self, ticker, market: Market = None) -> Ticker:
@@ -1069,7 +1069,7 @@ class whitebit(Exchange, ImplicitAPI):
1069
1069
  # ]
1070
1070
  # }
1071
1071
  #
1072
- result = self.safe_value(response, 'result', [])
1072
+ result = self.safe_list(response, 'result', [])
1073
1073
  return self.parse_ohlcvs(result, market, timeframe, since, limit)
1074
1074
 
1075
1075
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1523,7 +1523,7 @@ class whitebit(Exchange, ImplicitAPI):
1523
1523
  # "limit": 100
1524
1524
  # }
1525
1525
  #
1526
- data = self.safe_value(response, 'records', [])
1526
+ data = self.safe_list(response, 'records', [])
1527
1527
  return self.parse_trades(data, market)
1528
1528
 
1529
1529
  async def fetch_deposit_address(self, code: str, params={}):
@@ -1842,7 +1842,7 @@ class whitebit(Exchange, ImplicitAPI):
1842
1842
  # }
1843
1843
  #
1844
1844
  records = self.safe_value(response, 'records', [])
1845
- first = self.safe_value(records, 0, {})
1845
+ first = self.safe_dict(records, 0, {})
1846
1846
  return self.parse_transaction(first, currency)
1847
1847
 
1848
1848
  async def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1905,7 +1905,7 @@ class whitebit(Exchange, ImplicitAPI):
1905
1905
  # "total": 300 # total number of transactions, use self for calculating ‘limit’ and ‘offset'
1906
1906
  # }
1907
1907
  #
1908
- records = self.safe_value(response, 'records', [])
1908
+ records = self.safe_list(response, 'records', [])
1909
1909
  return self.parse_transactions(records, currency, since, limit)
1910
1910
 
1911
1911
  async def fetch_borrow_interest(self, code: Str = None, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
ccxt/async_support/woo.py CHANGED
@@ -1258,7 +1258,7 @@ class woo(Exchange, ImplicitAPI):
1258
1258
  # ]
1259
1259
  # }
1260
1260
  #
1261
- orders = self.safe_value(response, 'data', response)
1261
+ orders = self.safe_dict(response, 'data', response)
1262
1262
  return self.parse_order(orders, market)
1263
1263
 
1264
1264
  async def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -600,7 +600,7 @@ class zaif(Exchange, ImplicitAPI):
600
600
  # }
601
601
  # }
602
602
  #
603
- returnData = self.safe_value(result, 'return')
603
+ returnData = self.safe_dict(result, 'return')
604
604
  return self.parse_transaction(returnData, currency)
605
605
 
606
606
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
@@ -421,7 +421,7 @@ class zonda(Exchange, ImplicitAPI):
421
421
  await self.load_markets()
422
422
  request = {}
423
423
  response = await self.v1_01PrivateGetTradingOffer(self.extend(request, params))
424
- items = self.safe_value(response, 'items', [])
424
+ items = self.safe_list(response, 'items', [])
425
425
  return self.parse_orders(items, None, since, limit, {'status': 'open'})
426
426
 
427
427
  def parse_order(self, order, market: Market = None) -> Order:
@@ -788,7 +788,7 @@ class zonda(Exchange, ImplicitAPI):
788
788
  #
789
789
  else:
790
790
  raise BadRequest(self.id + ' fetchTickers params["method"] must be "v1_01PublicGetTradingTicker" or "v1_01PublicGetTradingStats"')
791
- items = self.safe_value(response, 'items')
791
+ items = self.safe_dict(response, 'items')
792
792
  return self.parse_tickers(items, symbols)
793
793
 
794
794
  async def fetch_ledger(self, code: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1200,7 +1200,7 @@ class zonda(Exchange, ImplicitAPI):
1200
1200
  # ]
1201
1201
  # }
1202
1202
  #
1203
- items = self.safe_value(response, 'items', [])
1203
+ items = self.safe_list(response, 'items', [])
1204
1204
  return self.parse_ohlcvs(items, market, timeframe, since, limit)
1205
1205
 
1206
1206
  def parse_trade(self, trade, market: Market = None) -> Trade:
@@ -1298,7 +1298,7 @@ class zonda(Exchange, ImplicitAPI):
1298
1298
  if limit is not None:
1299
1299
  request['limit'] = limit # default - 10, max - 300
1300
1300
  response = await self.v1_01PublicGetTradingTransactionsSymbol(self.extend(request, params))
1301
- items = self.safe_value(response, 'items')
1301
+ items = self.safe_list(response, 'items')
1302
1302
  return self.parse_trades(items, market, since, limit)
1303
1303
 
1304
1304
  async def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -1509,7 +1509,7 @@ class zonda(Exchange, ImplicitAPI):
1509
1509
  # }
1510
1510
  #
1511
1511
  data = self.safe_value(response, 'data')
1512
- first = self.safe_value(data, 0)
1512
+ first = self.safe_dict(data, 0)
1513
1513
  return self.parse_deposit_address(first, currency)
1514
1514
 
1515
1515
  async def fetch_deposit_addresses(self, codes: List[str] = None, params={}):
@@ -1535,7 +1535,7 @@ class zonda(Exchange, ImplicitAPI):
1535
1535
  # ]
1536
1536
  # }
1537
1537
  #
1538
- data = self.safe_value(response, 'data')
1538
+ data = self.safe_list(response, 'data')
1539
1539
  return self.parse_deposit_addresses(data, codes)
1540
1540
 
1541
1541
  async def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -1684,7 +1684,7 @@ class zonda(Exchange, ImplicitAPI):
1684
1684
  # }
1685
1685
  # }
1686
1686
  #
1687
- data = self.safe_value(response, 'data')
1687
+ data = self.safe_dict(response, 'data')
1688
1688
  return self.parse_transaction(data, currency)
1689
1689
 
1690
1690
  def parse_transaction(self, transaction, currency: Currency = None) -> Transaction:
ccxt/base/exchange.py CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # -----------------------------------------------------------------------------
6
6
 
7
- __version__ = '4.2.84'
7
+ __version__ = '4.2.86'
8
8
 
9
9
  # -----------------------------------------------------------------------------
10
10
 
@@ -321,8 +321,6 @@ class Exchange(object):
321
321
  'fetchDepositAddresses': None,
322
322
  'fetchDepositAddressesByNetwork': None,
323
323
  'fetchDeposits': None,
324
- 'fetchFundingFee': None,
325
- 'fetchFundingFees': None,
326
324
  'fetchFundingHistory': None,
327
325
  'fetchFundingRate': None,
328
326
  'fetchFundingRateHistory': None,
@@ -1497,13 +1495,6 @@ class Exchange(object):
1497
1495
  markets = self.fetch_markets(params)
1498
1496
  return self.set_markets(markets, currencies)
1499
1497
 
1500
- def load_fees(self, reload=False):
1501
- if not reload:
1502
- if self.loaded_fees != Exchange.loaded_fees:
1503
- return self.loaded_fees
1504
- self.loaded_fees = self.deep_extend(self.loaded_fees, self.fetch_fees())
1505
- return self.loaded_fees
1506
-
1507
1498
  def fetch_markets(self, params={}):
1508
1499
  # markets are returned as a list
1509
1500
  # currencies are returned as a dict
@@ -3834,18 +3825,6 @@ class Exchange(object):
3834
3825
  def fetch_status(self, params={}):
3835
3826
  raise NotSupported(self.id + ' fetchStatus() is not supported yet')
3836
3827
 
3837
- def fetch_funding_fee(self, code: str, params={}):
3838
- warnOnFetchFundingFee = self.safe_bool(self.options, 'warnOnFetchFundingFee', True)
3839
- if warnOnFetchFundingFee:
3840
- 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')
3841
- return self.fetch_transaction_fee(code, params)
3842
-
3843
- def fetch_funding_fees(self, codes: List[str] = None, params={}):
3844
- warnOnFetchFundingFees = self.safe_bool(self.options, 'warnOnFetchFundingFees', True)
3845
- if warnOnFetchFundingFees:
3846
- 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')
3847
- return self.fetch_transaction_fees(codes, params)
3848
-
3849
3828
  def fetch_transaction_fee(self, code: str, params={}):
3850
3829
  if not self.has['fetchTransactionFees']:
3851
3830
  raise NotSupported(self.id + ' fetchTransactionFee() is not supported yet')
@@ -4031,7 +4010,7 @@ class Exchange(object):
4031
4010
  def fetch_order_books(self, symbols: List[str] = None, limit: Int = None, params={}):
4032
4011
  raise NotSupported(self.id + ' fetchOrderBooks() is not supported yet')
4033
4012
 
4034
- def watch_bids_asks(self, symbols: List[str] = None, params={}):
4013
+ def watch_bids_asks(self, symbols: Strings = None, params={}):
4035
4014
  raise NotSupported(self.id + ' watchBidsAsks() is not supported yet')
4036
4015
 
4037
4016
  def watch_tickers(self, symbols: List[str] = None, params={}):
@@ -5378,3 +5357,67 @@ class Exchange(object):
5378
5357
 
5379
5358
  def parse_leverage(self, leverage, market: Market = None):
5380
5359
  raise NotSupported(self.id + ' parseLeverage() is not supported yet')
5360
+
5361
+ def convert_expire_date(self, date: str):
5362
+ # parse YYMMDD to datetime string
5363
+ year = date[0:2]
5364
+ month = date[2:4]
5365
+ day = date[4:6]
5366
+ reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
5367
+ return reconstructedDate
5368
+
5369
+ def convert_expire_date_to_market_id_date(self, date: str):
5370
+ # parse 240119 to 19JAN24
5371
+ year = date[0:2]
5372
+ monthRaw = date[2:4]
5373
+ month = None
5374
+ day = date[4:6]
5375
+ if monthRaw == '01':
5376
+ month = 'JAN'
5377
+ elif monthRaw == '02':
5378
+ month = 'FEB'
5379
+ elif monthRaw == '03':
5380
+ month = 'MAR'
5381
+ elif monthRaw == '04':
5382
+ month = 'APR'
5383
+ elif monthRaw == '05':
5384
+ month = 'MAY'
5385
+ elif monthRaw == '06':
5386
+ month = 'JUN'
5387
+ elif monthRaw == '07':
5388
+ month = 'JUL'
5389
+ elif monthRaw == '08':
5390
+ month = 'AUG'
5391
+ elif monthRaw == '09':
5392
+ month = 'SEP'
5393
+ elif monthRaw == '10':
5394
+ month = 'OCT'
5395
+ elif monthRaw == '11':
5396
+ month = 'NOV'
5397
+ elif monthRaw == '12':
5398
+ month = 'DEC'
5399
+ reconstructedDate = day + month + year
5400
+ return reconstructedDate
5401
+
5402
+ def convert_market_id_expire_date(self, date: str):
5403
+ # parse 19JAN24 to 240119
5404
+ monthMappping = {
5405
+ 'JAN': '01',
5406
+ 'FEB': '02',
5407
+ 'MAR': '03',
5408
+ 'APR': '04',
5409
+ 'MAY': '05',
5410
+ 'JUN': '06',
5411
+ 'JUL': '07',
5412
+ 'AUG': '08',
5413
+ 'SEP': '09',
5414
+ 'OCT': '10',
5415
+ 'NOV': '11',
5416
+ 'DEC': '12',
5417
+ }
5418
+ year = date[0:2]
5419
+ monthName = date[2:5]
5420
+ month = self.safe_string(monthMappping, monthName)
5421
+ day = date[5:7]
5422
+ reconstructedDate = day + month + year
5423
+ return reconstructedDate
ccxt/bigone.py CHANGED
@@ -810,7 +810,7 @@ class bigone(Exchange, ImplicitAPI):
810
810
  # }
811
811
  # }
812
812
  #
813
- ticker = self.safe_value(response, 'data', {})
813
+ ticker = self.safe_dict(response, 'data', {})
814
814
  return self.parse_ticker(ticker, market)
815
815
  else:
816
816
  tickers = self.fetch_tickers([symbol], params)
@@ -983,7 +983,7 @@ class bigone(Exchange, ImplicitAPI):
983
983
  # }
984
984
  # }
985
985
  #
986
- orderbook = self.safe_value(response, 'data', {})
986
+ orderbook = self.safe_dict(response, 'data', {})
987
987
  return self.parse_order_book(orderbook, market['symbol'], None, 'bids', 'asks', 'price', 'quantity')
988
988
 
989
989
  def parse_contract_bids_asks(self, bidsAsks):
@@ -1171,7 +1171,7 @@ class bigone(Exchange, ImplicitAPI):
1171
1171
  # ]
1172
1172
  # }
1173
1173
  #
1174
- trades = self.safe_value(response, 'data', [])
1174
+ trades = self.safe_list(response, 'data', [])
1175
1175
  return self.parse_trades(trades, market, since, limit)
1176
1176
 
1177
1177
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -1245,7 +1245,7 @@ class bigone(Exchange, ImplicitAPI):
1245
1245
  # ]
1246
1246
  # }
1247
1247
  #
1248
- data = self.safe_value(response, 'data', [])
1248
+ data = self.safe_list(response, 'data', [])
1249
1249
  return self.parse_ohlcvs(data, market, timeframe, since, limit)
1250
1250
 
1251
1251
  def parse_balance(self, response) -> Balances:
@@ -1483,7 +1483,7 @@ class bigone(Exchange, ImplicitAPI):
1483
1483
  # "updated_at":"2019-01-29T06:05:56Z"
1484
1484
  # }
1485
1485
  #
1486
- order = self.safe_value(response, 'data')
1486
+ order = self.safe_dict(response, 'data')
1487
1487
  return self.parse_order(order, market)
1488
1488
 
1489
1489
  def cancel_order(self, id: str, symbol: Str = None, params={}):
@@ -1510,7 +1510,7 @@ class bigone(Exchange, ImplicitAPI):
1510
1510
  # "created_at":"2019-01-29T06:05:56Z",
1511
1511
  # "updated_at":"2019-01-29T06:05:56Z"
1512
1512
  # }
1513
- order = self.safe_value(response, 'data')
1513
+ order = self.safe_dict(response, 'data')
1514
1514
  return self.parse_order(order)
1515
1515
 
1516
1516
  def cancel_all_orders(self, symbol: Str = None, params={}):
@@ -1552,7 +1552,7 @@ class bigone(Exchange, ImplicitAPI):
1552
1552
  self.load_markets()
1553
1553
  request = {'id': id}
1554
1554
  response = self.privateGetOrdersId(self.extend(request, params))
1555
- order = self.safe_value(response, 'data', {})
1555
+ order = self.safe_dict(response, 'data', {})
1556
1556
  return self.parse_order(order)
1557
1557
 
1558
1558
  def fetch_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
@@ -1599,7 +1599,7 @@ class bigone(Exchange, ImplicitAPI):
1599
1599
  # "page_token":"dxzef",
1600
1600
  # }
1601
1601
  #
1602
- orders = self.safe_value(response, 'data', [])
1602
+ orders = self.safe_list(response, 'data', [])
1603
1603
  return self.parse_orders(orders, market, since, limit)
1604
1604
 
1605
1605
  def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
@@ -1657,7 +1657,7 @@ class bigone(Exchange, ImplicitAPI):
1657
1657
  # "page_token":"dxfv"
1658
1658
  # }
1659
1659
  #
1660
- trades = self.safe_value(response, 'data', [])
1660
+ trades = self.safe_list(response, 'data', [])
1661
1661
  return self.parse_trades(trades, market, since, limit)
1662
1662
 
1663
1663
  def parse_order_status(self, status):
@@ -1923,7 +1923,7 @@ class bigone(Exchange, ImplicitAPI):
1923
1923
  # ]
1924
1924
  # }
1925
1925
  #
1926
- deposits = self.safe_value(response, 'data', [])
1926
+ deposits = self.safe_list(response, 'data', [])
1927
1927
  return self.parse_transactions(deposits, currency, since, limit)
1928
1928
 
1929
1929
  def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
@@ -1971,7 +1971,7 @@ class bigone(Exchange, ImplicitAPI):
1971
1971
  # "page_token":"dxvf"
1972
1972
  # }
1973
1973
  #
1974
- withdrawals = self.safe_value(response, 'data', [])
1974
+ withdrawals = self.safe_list(response, 'data', [])
1975
1975
  return self.parse_transactions(withdrawals, currency, since, limit)
1976
1976
 
1977
1977
  def transfer(self, code: str, amount: float, fromAccount: str, toAccount: str, params={}) -> TransferEntry:
@@ -2091,7 +2091,7 @@ class bigone(Exchange, ImplicitAPI):
2091
2091
  # }
2092
2092
  # }
2093
2093
  #
2094
- data = self.safe_value(response, 'data', {})
2094
+ data = self.safe_dict(response, 'data', {})
2095
2095
  return self.parse_transaction(data, currency)
2096
2096
 
2097
2097
  def handle_errors(self, httpCode, reason, url, method, headers, body, response, requestHeaders, requestBody):
ccxt/binance.py CHANGED
@@ -2440,14 +2440,6 @@ class binance(Exchange, ImplicitAPI):
2440
2440
  super(binance, self).set_sandbox_mode(enable)
2441
2441
  self.options['sandboxMode'] = enable
2442
2442
 
2443
- def convert_expire_date(self, date):
2444
- # parse YYMMDD to timestamp
2445
- year = date[0:2]
2446
- month = date[2:4]
2447
- day = date[4:6]
2448
- reconstructedDate = '20' + year + '-' + month + '-' + day + 'T00:00:00Z'
2449
- return reconstructedDate
2450
-
2451
2443
  def create_expired_option_market(self, symbol: str):
2452
2444
  # support expired option contracts
2453
2445
  settle = 'USDT'
@@ -3859,26 +3851,24 @@ class binance(Exchange, ImplicitAPI):
3859
3851
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3860
3852
  """
3861
3853
  self.load_markets()
3862
- symbols = self.market_symbols(symbols)
3863
- market = None
3864
- if symbols is not None:
3865
- first = self.safe_string(symbols, 0)
3866
- market = self.market(first)
3854
+ symbols = self.market_symbols(symbols, None, True, True, True)
3855
+ market = self.get_market_from_symbols(symbols)
3867
3856
  type = None
3857
+ type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
3868
3858
  subType = None
3869
3859
  subType, params = self.handle_sub_type_and_params('fetchBidsAsks', market, params)
3870
- type, params = self.handle_market_type_and_params('fetchBidsAsks', market, params)
3871
3860
  response = None
3872
3861
  if self.is_linear(type, subType):
3873
3862
  response = self.fapiPublicGetTickerBookTicker(params)
3874
3863
  elif self.is_inverse(type, subType):
3875
3864
  response = self.dapiPublicGetTickerBookTicker(params)
3876
- else:
3865
+ elif type == 'spot':
3877
3866
  request = {}
3878
3867
  if symbols is not None:
3879
- marketIds = self.market_ids(symbols)
3880
- request['symbols'] = self.json(marketIds)
3868
+ request['symbols'] = self.json(self.market_ids(symbols))
3881
3869
  response = self.publicGetTickerBookTicker(self.extend(request, params))
3870
+ else:
3871
+ raise NotSupported(self.id + ' fetchBidsAsks() does not support ' + type + ' markets yet')
3882
3872
  return self.parse_tickers(response, symbols)
3883
3873
 
3884
3874
  def fetch_last_prices(self, symbols: Strings = None, params={}):
@@ -3893,12 +3883,12 @@ class binance(Exchange, ImplicitAPI):
3893
3883
  :returns dict: a dictionary of lastprices structures
3894
3884
  """
3895
3885
  self.load_markets()
3896
- symbols = self.market_symbols(symbols)
3886
+ symbols = self.market_symbols(symbols, None, True, True, True)
3897
3887
  market = self.get_market_from_symbols(symbols)
3898
3888
  type = None
3889
+ type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
3899
3890
  subType = None
3900
3891
  subType, params = self.handle_sub_type_and_params('fetchLastPrices', market, params)
3901
- type, params = self.handle_market_type_and_params('fetchLastPrices', market, params)
3902
3892
  response = None
3903
3893
  if self.is_linear(type, subType):
3904
3894
  response = self.fapiPublicV2GetTickerPrice(params)
@@ -3993,28 +3983,26 @@ class binance(Exchange, ImplicitAPI):
3993
3983
  :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
3994
3984
  """
3995
3985
  self.load_markets()
3996
- type = None
3997
- market = None
3998
3986
  symbols = self.market_symbols(symbols, None, True, True, True)
3999
- if symbols is not None:
4000
- first = self.safe_string(symbols, 0)
4001
- market = self.market(first)
3987
+ market = self.get_market_from_symbols(symbols)
3988
+ type = None
4002
3989
  type, params = self.handle_market_type_and_params('fetchTickers', market, params)
4003
3990
  subType = None
4004
3991
  subType, params = self.handle_sub_type_and_params('fetchTickers', market, params)
4005
3992
  response = None
4006
- if type == 'option':
4007
- response = self.eapiPublicGetTicker(params)
4008
- elif self.is_linear(type, subType):
3993
+ if self.is_linear(type, subType):
4009
3994
  response = self.fapiPublicGetTicker24hr(params)
4010
3995
  elif self.is_inverse(type, subType):
4011
3996
  response = self.dapiPublicGetTicker24hr(params)
4012
- else:
3997
+ elif type == 'spot':
4013
3998
  request = {}
4014
3999
  if symbols is not None:
4015
- marketIds = self.market_ids(symbols)
4016
- request['symbols'] = self.json(marketIds)
4000
+ request['symbols'] = self.json(self.market_ids(symbols))
4017
4001
  response = self.publicGetTicker24hr(self.extend(request, params))
4002
+ elif type == 'option':
4003
+ response = self.eapiPublicGetTicker(params)
4004
+ else:
4005
+ raise NotSupported(self.id + ' fetchTickers() does not support ' + type + ' markets yet')
4018
4006
  return self.parse_tickers(response, symbols)
4019
4007
 
4020
4008
  def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
@@ -4635,7 +4623,7 @@ class binance(Exchange, ImplicitAPI):
4635
4623
  # }
4636
4624
  # }
4637
4625
  #
4638
- data = self.safe_value(response, 'newOrderResponse')
4626
+ data = self.safe_dict(response, 'newOrderResponse')
4639
4627
  return self.parse_order(data, market)
4640
4628
 
4641
4629
  def edit_spot_order_request(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
@@ -11400,7 +11388,7 @@ class binance(Exchange, ImplicitAPI):
11400
11388
  #
11401
11389
  else:
11402
11390
  raise BadRequest(self.id + ' fetchMarginModes() supports linear and inverse subTypes only')
11403
- assets = self.safe_value(response, 'positions', [])
11391
+ assets = self.safe_list(response, 'positions', [])
11404
11392
  return self.parse_margin_modes(assets, symbols, 'symbol', 'swap')
11405
11393
 
11406
11394
  def parse_margin_mode(self, marginMode, market=None) -> MarginMode: