(self, params={})
| 1319 | return self.fetch_markets_v2(params) |
| 1320 | |
| 1321 | def fetch_markets_v2(self, params={}) -> List[Market]: |
| 1322 | response = self.fetch_currencies_from_cache(params) |
| 1323 | currencies = self.safe_dict(response, 'currencies', {}) |
| 1324 | exchangeRates = self.safe_dict(response, 'exchangeRates', {}) |
| 1325 | data = self.safe_list(currencies, 'data', []) |
| 1326 | dataById = self.index_by(data, 'id') |
| 1327 | rates = self.safe_dict(self.safe_dict(exchangeRates, 'data', {}), 'rates', {}) |
| 1328 | baseIds = list(rates.keys()) |
| 1329 | result = [] |
| 1330 | for i in range(0, len(baseIds)): |
| 1331 | baseId = baseIds[i] |
| 1332 | base = self.safe_currency_code(baseId) |
| 1333 | type = 'fiat' if (baseId in dataById) else 'crypto' |
| 1334 | # https://github.com/ccxt/ccxt/issues/6066 |
| 1335 | if type == 'crypto': |
| 1336 | for j in range(0, len(data)): |
| 1337 | quoteCurrency = data[j] |
| 1338 | quoteId = self.safe_string(quoteCurrency, 'id') |
| 1339 | quote = self.safe_currency_code(quoteId) |
| 1340 | result.append(self.safe_market_structure({ |
| 1341 | 'id': baseId + '-' + quoteId, |
| 1342 | 'symbol': base + '/' + quote, |
| 1343 | 'base': base, |
| 1344 | 'quote': quote, |
| 1345 | 'settle': None, |
| 1346 | 'baseId': baseId, |
| 1347 | 'quoteId': quoteId, |
| 1348 | 'settleId': None, |
| 1349 | 'type': 'spot', |
| 1350 | 'spot': True, |
| 1351 | 'margin': False, |
| 1352 | 'swap': False, |
| 1353 | 'future': False, |
| 1354 | 'option': False, |
| 1355 | 'active': None, |
| 1356 | 'contract': False, |
| 1357 | 'linear': None, |
| 1358 | 'inverse': None, |
| 1359 | 'contractSize': None, |
| 1360 | 'expiry': None, |
| 1361 | 'expiryDatetime': None, |
| 1362 | 'strike': None, |
| 1363 | 'optionType': None, |
| 1364 | 'precision': { |
| 1365 | 'amount': None, |
| 1366 | 'price': None, |
| 1367 | }, |
| 1368 | 'limits': { |
| 1369 | 'leverage': { |
| 1370 | 'min': None, |
| 1371 | 'max': None, |
| 1372 | }, |
| 1373 | 'amount': { |
| 1374 | 'min': None, |
| 1375 | 'max': None, |
| 1376 | }, |
| 1377 | 'price': { |
| 1378 | 'min': None, |
no test coverage detected