Add yadio.io api to exchange rate
This commit is contained in:
committed by
accumulator
parent
444dc7fb7f
commit
7de1c604c6
@@ -181,6 +181,15 @@ class ExchangeBase(Logger):
|
||||
return Decimal('NaN')
|
||||
return Decimal(rate)
|
||||
|
||||
class Yadio(ExchangeBase):
|
||||
|
||||
async def get_currencies(self):
|
||||
dicts = await self.get_json('api.yadio.io', '/currencies')
|
||||
return list(dicts.keys())
|
||||
|
||||
async def get_rates(self, ccy: str) -> Mapping[str, Optional[Decimal]]:
|
||||
json = await self.get_json('api.yadio.io', '/rate/%s/BTC' % ccy)
|
||||
return {ccy: to_decimal(json['rate'])}
|
||||
|
||||
class BitcoinAverage(ExchangeBase):
|
||||
# note: historical rates used to be freely available
|
||||
|
||||
Reference in New Issue
Block a user