gateio / gateapi-python

247 stars 92 forks source link

How to get all list_currency #60

Closed fmsimsek closed 3 years ago

fmsimsek commented 3 years ago

Hello sir,

i can use list_currencies function but i can'nt get only currency name. How can i get only all list currency name ? example btc_usdt, ltc_usdt, bnb_usdt etc.. thank you.

revilwang commented 3 years ago

I think you means list_currency_pairs

fmsimsek commented 3 years ago

I think you means list_currency_pairs

No , list_currency_pairs output as bellow but i get wanna only 'id' value

{'amount_precision': 4, 'base': 'ALPHR', 'buy_start': 0, 'fee': '0.2', 'id': 'ALPHR_USDT', 'min_base_amount': None, 'min_quote_amount': '1', 'precision': 4, 'quote': 'USDT', 'sell_start': 0, 'trade_status': 'tradable'}]

fmsimsek commented 3 years ago

i solved this problem thank you

 api_response = api_instance.list_currency_pairs()
     for i in api_response:
        print(i.id)
revilwang commented 3 years ago

one line code for python

currency_pairs = [x.id for x in api_instance.list_currency_pairs() if x.trade_status != 'untradable']