Add yadio.io api to exchange rate
This commit is contained in:
committed by
accumulator
parent
444dc7fb7f
commit
7de1c604c6
@@ -900,5 +900,96 @@
|
|||||||
],
|
],
|
||||||
"Walltime": [
|
"Walltime": [
|
||||||
"BRL"
|
"BRL"
|
||||||
|
],
|
||||||
|
"Yadio": [
|
||||||
|
"AED",
|
||||||
|
"ANG",
|
||||||
|
"AOA",
|
||||||
|
"ARS",
|
||||||
|
"AUD",
|
||||||
|
"AZN",
|
||||||
|
"BDT",
|
||||||
|
"BHD",
|
||||||
|
"BMD",
|
||||||
|
"BOB",
|
||||||
|
"BRL",
|
||||||
|
"BTC",
|
||||||
|
"BWP",
|
||||||
|
"BYN",
|
||||||
|
"CAD",
|
||||||
|
"CDF",
|
||||||
|
"CHF",
|
||||||
|
"CLP",
|
||||||
|
"CNY",
|
||||||
|
"COP",
|
||||||
|
"CRC",
|
||||||
|
"CUP",
|
||||||
|
"CZK",
|
||||||
|
"DKK",
|
||||||
|
"DOP",
|
||||||
|
"DZD",
|
||||||
|
"EGP",
|
||||||
|
"ETB",
|
||||||
|
"EUR",
|
||||||
|
"GBP",
|
||||||
|
"GEL",
|
||||||
|
"GHS",
|
||||||
|
"GTQ",
|
||||||
|
"HKD",
|
||||||
|
"HNL",
|
||||||
|
"HUF",
|
||||||
|
"IDR",
|
||||||
|
"ILS",
|
||||||
|
"INR",
|
||||||
|
"JMD",
|
||||||
|
"JOD",
|
||||||
|
"JPY",
|
||||||
|
"KES",
|
||||||
|
"KGS",
|
||||||
|
"KRW",
|
||||||
|
"KZT",
|
||||||
|
"LBP",
|
||||||
|
"LKR",
|
||||||
|
"MAD",
|
||||||
|
"MLC",
|
||||||
|
"MXN",
|
||||||
|
"MYR",
|
||||||
|
"NAD",
|
||||||
|
"NGN",
|
||||||
|
"NOK",
|
||||||
|
"NPR",
|
||||||
|
"NZD",
|
||||||
|
"PAB",
|
||||||
|
"PEN",
|
||||||
|
"PHP",
|
||||||
|
"PKR",
|
||||||
|
"PLN",
|
||||||
|
"PYG",
|
||||||
|
"QAR",
|
||||||
|
"RON",
|
||||||
|
"RSD",
|
||||||
|
"RUB",
|
||||||
|
"SAR",
|
||||||
|
"SEK",
|
||||||
|
"SGD",
|
||||||
|
"THB",
|
||||||
|
"TND",
|
||||||
|
"TRY",
|
||||||
|
"TTD",
|
||||||
|
"TWD",
|
||||||
|
"TZS",
|
||||||
|
"UAH",
|
||||||
|
"UGX",
|
||||||
|
"USD",
|
||||||
|
"UYU",
|
||||||
|
"UZS",
|
||||||
|
"VES",
|
||||||
|
"VND",
|
||||||
|
"XAF",
|
||||||
|
"XAG",
|
||||||
|
"XAU",
|
||||||
|
"XOF",
|
||||||
|
"XPT",
|
||||||
|
"ZAR"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -181,6 +181,15 @@ class ExchangeBase(Logger):
|
|||||||
return Decimal('NaN')
|
return Decimal('NaN')
|
||||||
return Decimal(rate)
|
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):
|
class BitcoinAverage(ExchangeBase):
|
||||||
# note: historical rates used to be freely available
|
# note: historical rates used to be freely available
|
||||||
|
|||||||
Reference in New Issue
Block a user