Skip to content

Add NGN and ZAR fiat currencies #2214

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased
- Display the wallet root fingerprint in the account info and device settings
- Add support for Nigerian Naira (NGN)
- Add support for South African Rand (ZAR)

## 4.38.0
- Bundle BitBox02 firmware version v9.14.1
Expand Down
4 changes: 4 additions & 0 deletions backend/rates/gecko.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ var (
"SEK": "sek",
"PLN": "pln",
"CZK": "czk",
"NGN": "ngn",
"ZAR": "zar",
}

// Copied from https://api.coingecko.com/api/v3/simple/supported_vs_currencies.
Expand All @@ -125,5 +127,7 @@ var (
"sek": "SEK",
"pln": "PLN",
"czk": "CZK",
"ngn": "NGN",
"zar": "ZAR",
}
)
4 changes: 3 additions & 1 deletion backend/rates/rates.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import (
const (
// Latest rates are fetched for all these (coin, fiat) pairs.
simplePriceAllIDs = "bitcoin,litecoin,ethereum,basic-attention-token,dai,chainlink,maker,sai,usd-coin,tether,0x,wrapped-bitcoin,pax-gold"
simplePriceAllCurrencies = "usd,eur,chf,gbp,jpy,krw,cny,rub,cad,aud,ils,btc,sgd,hkd,brl,nok,sek,pln,czk"
simplePriceAllCurrencies = "usd,eur,chf,gbp,jpy,krw,cny,rub,cad,aud,ils,btc,sgd,hkd,brl,nok,sek,pln,czk,ngn,zar"
// RatesEventSubject is the Subject of the event generated by new rates fetching.
RatesEventSubject = "rates"
)
Expand Down Expand Up @@ -73,11 +73,13 @@ const (
ILS Fiat = "ILS"
JPY Fiat = "JPY"
KRW Fiat = "KRW"
NGN Fiat = "NGN"
NOK Fiat = "NOK"
PLN Fiat = "PLN"
RUB Fiat = "RUB"
SEK Fiat = "SEK"
SGD Fiat = "SGD"
ZAR Fiat = "ZAR"
USD Fiat = "USD"
BTC Fiat = "BTC"
)
Expand Down
2 changes: 1 addition & 1 deletion frontends/web/src/api/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export type CoinCode = 'btc' | 'tbtc' | 'ltc' | 'tltc' | 'eth' | 'goeth';

export type AccountCode = string;

export type Fiat = 'AUD' | 'BRL' | 'BTC' | 'CAD' | 'CHF' | 'CNY' | 'CZK' | 'EUR' | 'GBP' | 'HKD' | 'ILS' | 'JPY' | 'KRW' | 'NOK' | 'PLN' | 'RUB' | 'SEK' | 'SGD' | 'USD';
export type Fiat = 'AUD' | 'BRL' | 'BTC' | 'CAD' | 'CHF' | 'CNY' | 'CZK' | 'EUR' | 'GBP' | 'HKD' | 'ILS' | 'JPY' | 'KRW' | 'NGN' | 'NOK' | 'PLN' | 'RUB' | 'SEK' | 'SGD' | 'ZAR' | 'USD';

export type ConversionUnit = Fiat | 'sat'

Expand Down
2 changes: 2 additions & 0 deletions frontends/web/src/components/balance/balance.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ describe('components/balance/balance', () => {
ILS: '512',
JPY: '512',
KRW: '512',
NGN: '512',
NOK: '512',
PLN: '512',
RUB: '512',
SEK: '512',
SGD: '512',
ZAR: '512',
USD: '512',
}
}
Expand Down
4 changes: 3 additions & 1 deletion frontends/web/src/components/rates/rates.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,17 @@ export const currenciesWithDisplayName: FiatWithDisplayName[] = [
{ currency: 'ILS', displayName: 'Israeli New Shekel' },
{ currency: 'JPY', displayName: 'Japanese Yen' },
{ currency: 'KRW', displayName: 'South Korean Won' },
{ currency: 'NGN', displayName: 'Nigerian Naira' },
{ currency: 'NOK', displayName: 'Norwegian Krone' },
{ currency: 'PLN', displayName: 'Polish Zloty' },
{ currency: 'RUB', displayName: 'Russian ruble' },
{ currency: 'SEK', displayName: 'Swedish Krona' },
{ currency: 'SGD', displayName: 'Singapore Dollar' },
{ currency: 'ZAR', displayName: 'South African Rand' },
{ currency: 'USD', displayName: 'United States Dollar' },
{ currency: 'BTC', displayName: 'Bitcoin' }
];
export const currencies: Fiat[] = ['AUD', 'BRL', 'CAD', 'CHF', 'CNY', 'CZK', 'EUR', 'GBP', 'HKD', 'ILS', 'JPY', 'KRW', 'NOK', 'PLN', 'RUB', 'SEK', 'SGD', 'USD', 'BTC'];
export const currencies: Fiat[] = ['AUD', 'BRL', 'CAD', 'CHF', 'CNY', 'CZK', 'EUR', 'GBP', 'HKD', 'ILS', 'JPY', 'KRW', 'NGN', 'NOK', 'PLN', 'RUB', 'SEK', 'SGD', 'ZAR', 'USD', 'BTC'];

export const store = new Store<SharedProps>({
active: 'USD',
Expand Down
2 changes: 2 additions & 0 deletions frontends/web/src/routes/account/send/feetargets.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ describe('routes/account/send/feetargets', () => {
EUR: '0.02',
GBP: '0.02',
HKD: '19880',
NGN: '0.0013',
NOK: '0.02',
ILS: '0.02',
JPY: '1.30',
Expand All @@ -76,6 +77,7 @@ describe('routes/account/send/feetargets', () => {
RUB: '0.88',
SEK: '0.1',
SGD: '32233',
ZAR: '0.06',
USD: '0.02',
BTC: '0.02',
},
Expand Down