fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for all markets https://api.docs.extended.exchange/#get-markets :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are retu
(self, symbols: Strings = None, params={})
| 748 | return self.parse_ticker(data, market) |
| 749 | |
| 750 | def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers: |
| 751 | """ |
| 752 | fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for all markets |
| 753 | |
| 754 | https://api.docs.extended.exchange/#get-markets |
| 755 | |
| 756 | :param str[] [symbols]: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| 757 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 758 | :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/?id=ticker-structure>` |
| 759 | """ |
| 760 | self.load_markets() |
| 761 | symbols = self.market_symbols(symbols) |
| 762 | request = {} |
| 763 | if symbols is not None: |
| 764 | marketIds = [] |
| 765 | for i in range(0, len(symbols)): |
| 766 | market = self.market(symbols[i]) |
| 767 | marketIds.append(market['id']) |
| 768 | request['market'] = marketIds |
| 769 | response = self.v1PublicGetInfoMarkets(self.extend(request, params)) |
| 770 | # |
| 771 | # { |
| 772 | # "status": "OK", |
| 773 | # "data": [ |
| 774 | # { |
| 775 | # "name": "BTC-USD", |
| 776 | # "assetName": "BTC", |
| 777 | # "collateralAssetName": "USD", |
| 778 | # "marketStats": { |
| 779 | # "dailyVolume": "231016077.512960", |
| 780 | # ... |
| 781 | # }, |
| 782 | # ... |
| 783 | # } |
| 784 | # ] |
| 785 | # } |
| 786 | # |
| 787 | data = self.safe_list(response, 'data', []) |
| 788 | tickers = {} |
| 789 | for i in range(0, len(data)): |
| 790 | marketData = data[i] |
| 791 | marketId = self.safe_string(marketData, 'name') |
| 792 | market = self.safe_market(marketId) |
| 793 | stats = self.safe_dict(marketData, 'marketStats', {}) |
| 794 | ticker = self.parse_ticker(stats, market) |
| 795 | symbol = ticker['symbol'] |
| 796 | tickers[symbol] = ticker |
| 797 | return self.filter_by_array_tickers(tickers, 'symbol', symbols) |
| 798 | |
| 799 | def parse_ticker(self, ticker, market: Market = None) -> Ticker: |
| 800 | # |
nothing calls this directly
no test coverage detected