get_pair¶
-
async
ExchangeAdapter.
get_pair
(from_coin: str, to_coin: str) → privex.exchange.base.PriceData[source]¶ Instantiate an exchange class and get a ticker asynchronously:
>>> from privex.exchange import Binance >>> b = Binance() >>> ticker = await b.get_pair('LTC', 'BTC') >>> ticker.last Decimal('0.00607100') >>> ticker.volume Decimal('89557.57000000')
Can use synchronously in non-async applications:
>>> from privex.exchange import Binance >>> b = Binance() >>> ticker = b.get_pair('LTC', 'BTC') >>> ticker.last Decimal('0.00607100')
- Parameters
from_coin –
to_coin –
- Returns