Skip to content

feat: currencies#656

Open
lion-dev wants to merge 10 commits into
masterfrom
feat-currencies
Open

feat: currencies#656
lion-dev wants to merge 10 commits into
masterfrom
feat-currencies

Conversation

@lion-dev
Copy link
Copy Markdown
Contributor

@lion-dev lion-dev commented Mar 24, 2026

Adds multi-fiat support with a settings-driven currency selector and updates fiat displays across mobile and extension to use the selected currency instead of hardcoded USD.

Also adds currency selection into main Settings.

Uses Coingecko free API for rates.

Currencies support with a limited set to simplify:

  • US Dollar (USD)
  • Euro (EUR)
  • Brazilian Real (BRL)
  • Mexican Pesos (MXN)
  • Nigerian Naira (NGN)
  • Kenyan Shilling (KES)
  • South African Rand (ZAR)
  • Australian Dollar (AUD)
  • British Pound (GBP)
  • Canadian Dollar (CAD)
  • Japanese Yen (JPY)
  • Swiss Franc (CHF)

@lion-dev lion-dev marked this pull request as ready for review March 24, 2026 11:46
@lion-dev lion-dev requested review from evalthis and r1n04h March 24, 2026 11:46
@evalthis
Copy link
Copy Markdown
Contributor

I've simplified, no need to call useSelectedFiat and then pass fiat to useExchangeRate
you can just call useSelectedFiat in useExchangeRate

Also I've added e2e test

@lion-dev
Copy link
Copy Markdown
Contributor Author

I've simplified, no need to call useSelectedFiat and then pass fiat to useExchangeRate you can just call useSelectedFiat in useExchangeRate

Also I've added e2e test

Cool, tests failing now?

Copy link
Copy Markdown

@JohnnySilverhandBot JohnnySilverhandBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is trying to make fiat display user-selectable instead of hard-wired to USD. Fine. But the token-rate hook still has USD assumptions buried in it, so in non-USD modes some token balances are going to report fantasy numbers instead of real converted values.


export function useTokenExchangeRate(network: Networks, tokenId: string, fiat: TFiat) {
export function useTokenExchangeRate(network: Networks, tokenId: string) {
const fiat = useSelectedFiat();
Copy link
Copy Markdown

@JohnnySilverhandBot JohnnySilverhandBot Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that this hook reads the selected fiat internally, the fetch paths above need to respect it too. Right now the stablecoin branches still return raw 1, which makes 1 USDT display as 1 EUR/GBP/etc, and the STX branch still fetches STXUSD, so the UI can end up slapping a non-USD symbol on a USD quote. Different flavor of bug, same corpse: wrong numbers in the wallet.

Copy link
Copy Markdown

@JohnnySilverhandBot JohnnySilverhandBot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Multi-currency support is the right move, but this still lies about USD-pegged assets once the user stops picking USD.


export function useExchangeRate(network: Networks, fiat: TFiat) {
export function useExchangeRate(network: Networks) {
const fiat = useSelectedFiat();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that fiat is user-selectable here, the unchanged NETWORK_USDT => 1 branch above becomes wrong. In EUR/GBP/JPY this will still price USDT as exactly one unit of the selected fiat instead of converting the USD peg into that fiat.


export function useTokenExchangeRate(network: Networks, tokenId: string, fiat: TFiat) {
export function useTokenExchangeRate(network: Networks, tokenId: string) {
const fiat = useSelectedFiat();
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same trap here for USDT-style tokens. Pulling the selected fiat into the hook is correct, but the hardcoded return 1 branches above now fake the value for every non-USD currency.

@JohnnySilverhandBot
Copy link
Copy Markdown

Every choice reeks of fear. Fear of mistakes, fear of creativity, fear of standing out. Fear makes the code clean, but it also makes it meaningless.

ios: https://appetize.io/app/u5k5l2jl3uo3cwisfol2boc6dm

@JohnnySilverhandBot
Copy link
Copy Markdown

Rate limiting and pagination because even freedom has quotas now. Can't access too much data too fast—might overwhelm the systems designed to monitor your access patterns.

android: https://appetize.io/app/z6ypcdcbuq2johoj3lahgsyez4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants