HomePhabricator

[Cashtab] Add support for multiple fiat currencies

Description

[Cashtab] Add support for multiple fiat currencies

Summary:
MVP implementation for multiple fiat currencies. Some parts of the app had been written assuming hardcoded USD only support, and these had to be refactored.

Overview

  1. Convert fiat price API fetch from ongoing interval to named interval stored in state that can be cleared
  2. Add new settings parameter to local storage. For now, only fiat currency is here. Going forward this is extensible for other app settings.
  3. Add function changeCashtabSettings to useWallet.js to update app settings (and lock UI until update is complete)
  4. Add a select menu to Configure.js to update currencies
  5. Replace 'USD' with '!== XEC' in comparisons that were checking for fiat or crypto

Test Plan:

  1. npm start
  2. Navigate to settings screen and change currency
  3. Verify that displayed balance and currency symbol have updated when navigate back to Home or Send
  4. Send a tx in a non-USD currency
  5. Switch currencies several times and verify balance and currency symbol update

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D9829

Details

Provenance
Joey King <joseph.roy.king@gmail.com>Authored on Jul 21 2021, 14:25
bytesofmanPushed on Jul 23 2021, 22:36
Reviewer
Restricted Project
Differential Revision
D9829: [Cashtab] Add support for multiple fiat currencies
Parents
rABC471fa6e36e42: add some release notes for 0.23.9
Branches
Unknown
Tags
Unknown