From fbbf1970b601fe29a8d3a83df144527affea1a94 Mon Sep 17 00:00:00 2001 From: Michael Wozniak Date: Wed, 5 Mar 2014 17:13:34 -0500 Subject: [PATCH] BitcoinVenezeula Rates Rates are taken from CoinDesk, modified for the true blackmarket rates, not the "government approved" rates. --- plugins/exchange_rate.py | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/plugins/exchange_rate.py b/plugins/exchange_rate.py index 4e57d17..6be1610 100644 --- a/plugins/exchange_rate.py +++ b/plugins/exchange_rate.py @@ -14,6 +14,7 @@ from electrum_gui.qt.util import * EXCHANGES = ["BitcoinAverage", + "BitcoinVenezuela", "BitPay", "Blockchain", "BTCChina", @@ -78,6 +79,7 @@ class Exchanger(threading.Thread): self.use_exchange = self.parent.config.get('use_exchange', "Blockchain") update_rates = { "BitcoinAverage": self.update_ba, + "BitcoinVenezuela": self.update_bv, "BitPay": self.update_bp, "Blockchain": self.update_bc, "BTCChina": self.update_CNY, @@ -226,6 +228,22 @@ class Exchanger(threading.Thread): self.parent.set_currencies(quote_currencies) + def update_bv(self): + try: + jsonresp = self.get_json('api.bitcoinvenezuela.com', "/") + except Exception: + return + quote_currencies = {} + try: + for r in jsonresp["BTC"]: + quote_currencies[r] = Decimal(jsonresp["BTC"][r]) + with self.lock: + self.quote_currencies = quote_currencies + except KeyError: + pass + self.parent.set_currencies(quote_currencies) + + def update_ba(self): try: jsonresp = self.get_json('api.bitcoinaverage.com', "/ticker/global/all") -- 1.7.1