retrieves data on all markets for gate https://www.gate.com/docs/developers/apiv4/#query-all-supported-currency-pairs # spot https://www.gate.com/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading
(self, params={})
| 1308 | return super(gate, self).safe_market(marketId, market, delimiter, marketType) |
| 1309 | |
| 1310 | async def fetch_markets(self, params={}) -> List[Market]: |
| 1311 | """ |
| 1312 | retrieves data on all markets for gate |
| 1313 | |
| 1314 | https://www.gate.com/docs/developers/apiv4/#query-all-supported-currency-pairs # spot |
| 1315 | https://www.gate.com/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading # margin |
| 1316 | https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts # swap |
| 1317 | https://www.gate.com/docs/developers/apiv4/en/#query-all-futures-contracts-2 # future |
| 1318 | https://www.gate.com/docs/developers/apiv4/en/#list-all-contracts-for-specified-underlying-and-expiration-date # option |
| 1319 | |
| 1320 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 1321 | :returns dict[]: an array of objects representing market data |
| 1322 | """ |
| 1323 | if self.options['adjustForTimeDifference']: |
| 1324 | await self.load_time_difference() |
| 1325 | if self.check_required_credentials(False): |
| 1326 | await self.load_unified_status() |
| 1327 | rawPromises = [] |
| 1328 | fetchMarketsOptions = self.safe_dict(self.options, 'fetchMarkets') |
| 1329 | types = self.safe_list(fetchMarketsOptions, 'types', ['spot', 'swap', 'future', 'option']) |
| 1330 | for i in range(0, len(types)): |
| 1331 | marketType = types[i] |
| 1332 | if marketType == 'spot': |
| 1333 | # if not sandboxMode: |
| 1334 | # gate doesn't have a sandbox for spot markets |
| 1335 | rawPromises.append(self.fetch_spot_markets(params)) |
| 1336 | # } |
| 1337 | elif marketType == 'swap': |
| 1338 | rawPromises.append(self.fetch_swap_markets(params)) |
| 1339 | elif marketType == 'future': |
| 1340 | rawPromises.append(self.fetch_future_markets(params)) |
| 1341 | elif marketType == 'option': |
| 1342 | rawPromises.append(self.fetch_option_markets(params)) |
| 1343 | results = await asyncio.gather(*rawPromises) |
| 1344 | return self.arrays_concat(results) |
| 1345 | |
| 1346 | async def fetch_spot_markets(self, params={}): |
| 1347 | marginPromise = self.publicMarginGetCurrencyPairs(params) |
nothing calls this directly
no test coverage detected