From a9c13d66418accc0fa3c21762272c478fa651dee Mon Sep 17 00:00:00 2001 From: Francis Pouliot Date: Thu, 17 Jan 2019 00:51:15 +0100 Subject: [PATCH 1/2] exchange_rate: add Bylls BTC/CAD rates --- electrum/currencies.json | 3 +++ electrum/exchange_rate.py | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/electrum/currencies.json b/electrum/currencies.json index ec9240015..657072bef 100644 --- a/electrum/currencies.json +++ b/electrum/currencies.json @@ -386,6 +386,9 @@ "TWD", "USD" ], + "Bylls": [ + "CAD" + ], "CoinCap": [ "USD" ], diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index 228d020ed..cf7840ec4 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -238,6 +238,13 @@ class BlockchainInfo(ExchangeBase): return dict([(r, Decimal(json[r]['15m'])) for r in json]) +class Bylls(ExchangeBase): + + async def get_rates(self, ccy): + json = await self.get_json('bylls.com', 'api/price?from_currency=BTC&to_currency=CAD') + return {'CAD': Decimal(json['public_price']['to_price'])} + + class Coinbase(ExchangeBase): async def get_rates(self, ccy): From 4374b809faad1dad6386714a7cb2279f60b7094c Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 27 Mar 2019 19:01:38 +0100 Subject: [PATCH 2/2] fix-up prev --- electrum/exchange_rate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index cf7840ec4..6d710e0c9 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -241,7 +241,7 @@ class BlockchainInfo(ExchangeBase): class Bylls(ExchangeBase): async def get_rates(self, ccy): - json = await self.get_json('bylls.com', 'api/price?from_currency=BTC&to_currency=CAD') + json = await self.get_json('bylls.com', '/api/price?from_currency=BTC&to_currency=CAD') return {'CAD': Decimal(json['public_price']['to_price'])}