Previously if the user disabled FX rates in the settings, the UI
would keep showing the fiat amounts everywhere until the next time
the program was started. (and the rates would not even refresh anymore)
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/
In kivy, if the user enabled fx rates but did not touch the fx history settings,
the GUI would show that history rates are enabled but in fact they would be disabled:
the GUI called fx.get_history_config(default=True) when displaying the checkbox,
but exchange_rate.py would not fetch history rates.
(it would only get fixed if the user touched the fx history checkbox)
Note: FxThread.run() calls fx.show_history(), which calls fx.get_history_config() without arguments.
somewhat based on
Electron-Cash/Electron-Cash@b3c76cd31125368f8c216531291c56e188f84245
Electron-Cash/Electron-Cash@adf8f943a1713c21230bb318a3045119c68c241d
Electron-Cash/Electron-Cash@8879e41fa0205b8ff74f359e5477f89185aa0077
and if they had already been saved, treat them as if nothing was saved
context: BitcoinAverage started restricting the historical API endpoints.
they now deny unauthenticated requests. :/
- BitcoinAverage seems to have historical rates for all currencies it supports
(as in, if there is spot price, there is also history).
- BitStamp now uses v2 API, also has support for EUR.
- Bitcointoyou does not seem to actually offer histories
(and `request_history` was undefined anyway)
- regenerate currencies.json
As this project is currently structured, absolute
imports have the drawback that they'll load modules
from installed paths rather then from the local repo
when running unit tests. This somehow breaks the main
idea of unit tests which is being able to quickly test
newest development changes. Therefore, use a relative
import here.