feat: currencies#656
Conversation
|
I've simplified, no need to call Also I've added e2e test |
Cool, tests failing now? |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
JohnnySilverhandBot
left a comment
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
Made-with: Cursor # Conflicts: # mobile/app/TransactionDetails.tsx
|
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. |
|
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. |
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: