commit
7f96001463
|
@ -14,6 +14,7 @@ from electrum_gui.qt.util import *
|
||||||
|
|
||||||
|
|
||||||
EXCHANGES = ["BitcoinAverage",
|
EXCHANGES = ["BitcoinAverage",
|
||||||
|
"BitcoinVenezuela",
|
||||||
"BitPay",
|
"BitPay",
|
||||||
"Blockchain",
|
"Blockchain",
|
||||||
"BTCChina",
|
"BTCChina",
|
||||||
|
@ -78,6 +79,7 @@ class Exchanger(threading.Thread):
|
||||||
self.use_exchange = self.parent.config.get('use_exchange', "Blockchain")
|
self.use_exchange = self.parent.config.get('use_exchange', "Blockchain")
|
||||||
update_rates = {
|
update_rates = {
|
||||||
"BitcoinAverage": self.update_ba,
|
"BitcoinAverage": self.update_ba,
|
||||||
|
"BitcoinVenezuela": self.update_bv,
|
||||||
"BitPay": self.update_bp,
|
"BitPay": self.update_bp,
|
||||||
"Blockchain": self.update_bc,
|
"Blockchain": self.update_bc,
|
||||||
"BTCChina": self.update_CNY,
|
"BTCChina": self.update_CNY,
|
||||||
|
@ -226,6 +228,22 @@ class Exchanger(threading.Thread):
|
||||||
self.parent.set_currencies(quote_currencies)
|
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):
|
def update_ba(self):
|
||||||
try:
|
try:
|
||||||
jsonresp = self.get_json('api.bitcoinaverage.com', "/ticker/global/all")
|
jsonresp = self.get_json('api.bitcoinaverage.com', "/ticker/global/all")
|
||||||
|
|
Loading…
Reference in New Issue