electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit c3deb16a7d546e4e234d66159629e528c2b7ccce
parent cc0db418797b469abe684beb1a8208c51c3e5e25
Author: SomberNight <somber.night@protonmail.com>
Date:   Wed,  5 Dec 2018 12:26:03 +0100

exchange rate: fix coinbase

closes #4897

Diffstat:
Melectrum/exchange_rate.py | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py @@ -246,10 +246,9 @@ class BTCParalelo(ExchangeBase): class Coinbase(ExchangeBase): async def get_rates(self, ccy): - json = await self.get_json('coinbase.com', - '/api/v1/currencies/exchange_rates') - return dict([(r[7:].upper(), Decimal(json[r])) - for r in json if r.startswith('btc_to_')]) + json = await self.get_json('api.coinbase.com', + '/v2/exchange-rates?currency=BTC') + return {ccy: Decimal(rate) for (ccy, rate) in json["data"]["rates"].items()} class CoinDesk(ExchangeBase):