From c67eef6e405f964f483d5fccd4e3f3bc5571e359 Mon Sep 17 00:00:00 2001 From: Cointrader Monitor <68483439+cointradermonitor@users.noreply.github.com> Date: Sun, 19 Jul 2020 01:52:31 +0000 Subject: [PATCH] Brazilian Bitcoin index source included. Added Brazilian Bitcoin Index from Cointrader Monitor (https://cointradermonitor.com/api/pbb/v1/ticker) as a "BRL" Fiat source. The index is calculated from the last price and volume from 30 brazilian exchanges. It is a well-known price index used by bitcoin brazilian users. More information at https://cointradermonitor.com/ --- 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 ee04e65b7..3170c52b4 100644 --- a/electrum/currencies.json +++ b/electrum/currencies.json @@ -793,6 +793,9 @@ "ZRX", "ZWL" ], + "CointraderMonitor": [ + "BRL" + ], "Kraken": [ "CAD", "EUR", diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index 8faccf7a5..033647ea3 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -315,6 +315,13 @@ class CoinGecko(ExchangeBase): for h in history['prices']]) +class CointraderMonitor(ExchangeBase): + + async def get_rates(self, ccy): + json = await self.get_json('cointradermonitor.com', '/api/pbb/v1/ticker') + return {'BRL': Decimal(json['last'])} + + class itBit(ExchangeBase): async def get_rates(self, ccy):