From c32ac41c36febf867d4f86859ac0bb47ae207a87 Mon Sep 17 00:00:00 2001 From: "Aldrin P. S. Castro" Date: Sun, 6 Dec 2020 23:35:39 -0300 Subject: [PATCH] Added new brazillian exchange to exchange rates plugin: Walltime. --- electrum/currencies.json | 3 +++ electrum/exchange_rate.py | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/electrum/currencies.json b/electrum/currencies.json index ea9261b76..2b4d81ec5 100644 --- a/electrum/currencies.json +++ b/electrum/currencies.json @@ -897,5 +897,8 @@ ], "Biscoint": [ "BRL" + ], + "Walltime": [ + "BRL" ] } diff --git a/electrum/exchange_rate.py b/electrum/exchange_rate.py index 66890e583..40cbd3d8f 100644 --- a/electrum/exchange_rate.py +++ b/electrum/exchange_rate.py @@ -411,6 +411,14 @@ class Biscoint(ExchangeBase): return {'BRL': Decimal(json['data']['last'])} +class Walltime(ExchangeBase): + + async def get_rates(self, ccy): + json = await self.get_json('s3.amazonaws.com', + '/data-production-walltime-info/production/dynamic/walltime-info.json') + return {'BRL': Decimal(json['BRL_XBT']['last_inexact'])} + + def dictinvert(d): inv = {} for k, vlist in d.items():