From a073ea60508fff137e70b8e23627ed48cee0721c Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 17 Jul 2020 15:27:36 -0300 Subject: [PATCH 1/3] more price sources --- electrum/currencies.json | 8 +++++++- electrum/exchange_rate.py | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/electrum/currencies.json b/electrum/currencies.json index ee04e65b7..cdf74d6c2 100644 --- a/electrum/currencies.json +++ b/electrum/currencies.json @@ -891,5 +891,11 @@ "Zaif": [ "JPY" ], - "itBit": [] + "itBit": [], + "Bitragem": [ + "BRL" + ], + "Biscoint": [ + "BRL" + ] } diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index 8faccf7a5..233e18494 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -389,6 +389,20 @@ class Zaif(ExchangeBase): return {'JPY': Decimal(json['last_price'])} +class Bitragem(ExchangeBase): + + async def get_rates(self,ccy): + json = await self.get_json('api.bitragem.com', '/v1/index?asset=BTC&market=BRL') + return {'BRL': Decimal(json['response']['index'])} + + +class Biscoint(ExchangeBase): + + async def get_rates(self,ccy): + json = await self.get_json('api.biscoint.io', '/v1/ticker?base=BTC"e=BRL') + return {'BRL': Decimal(json['data']['last']['last'])} + + def dictinvert(d): inv = {} for k, vlist in d.items(): From edef0cd4b6b7c8404e9946e3b6dc0947020452fa Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 17 Jul 2020 15:30:48 -0300 Subject: [PATCH 2/3] fix biscoint ticker path --- 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 233e18494..7df66ad58 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -400,7 +400,7 @@ class Biscoint(ExchangeBase): async def get_rates(self,ccy): json = await self.get_json('api.biscoint.io', '/v1/ticker?base=BTC"e=BRL') - return {'BRL': Decimal(json['data']['last']['last'])} + return {'BRL': Decimal(json['data']['last'])} def dictinvert(d): From 396eabc623851ed24acd54db7de3bf9f5f3f2ace Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 17 Jul 2020 16:23:15 -0300 Subject: [PATCH 3/3] removed scam exchange --- electrum/currencies.json | 3 --- electrum/exchange_rate.py | 6 ------ 2 files changed, 9 deletions(-) diff --git a/electrum/currencies.json b/electrum/currencies.json index cdf74d6c2..097e40631 100644 --- a/electrum/currencies.json +++ b/electrum/currencies.json @@ -882,9 +882,6 @@ "MercadoBitcoin": [ "BRL" ], - "NegocieCoins": [ - "BRL" - ], "TheRockTrading": [ "EUR" ], diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index 7df66ad58..8380689fe 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -352,12 +352,6 @@ class MercadoBitcoin(ExchangeBase): return {'BRL': Decimal(json['ticker_1h']['exchanges']['MBT']['last'])} -class NegocieCoins(ExchangeBase): - - async def get_rates(self,ccy): - json = await self.get_json('api.bitvalor.com', '/v1/ticker.json') - return {'BRL': Decimal(json['ticker_1h']['exchanges']['NEG']['last'])} - class TheRockTrading(ExchangeBase): async def get_rates(self, ccy):