def getMarketInfo(self): result = [] service = PdexService() tradingPairs = service.getTradingPairs() for pair in tradingPairs: keys = list(pair.keys()) token1 = pair[keys[0]] token2 = pair[keys[1]] item = { "id": token1["id"] + "_" + token2["id"], "type": "spot", "base": token1["name"], "quote": token2["name"], "active": True, # "subtypes": [], # "settlement": "USDT", # "market_url": "https://www.binance.com/en/futures/BTCUSDT", # "description": "Binance perpetual futures market for BTC quoted in USDT" } result.append(item) return result
def getTradingPair(self): service = PdexService() data = service.getTradingPairs() return data