Skip to content

Conversation

@aryanraj45
Copy link

@aryanraj45 aryanraj45 commented Jan 25, 2026

Description

This PR addresses issue #3384 by allowing users to select multiple fiat currencies simultaneously.

Key Changes:

  • SettingsStore: Added fiats array to persist multiple currency selections.
  • SelectCurrency View: Updated the UI to allow multi-select toggling with checkmarks.
  • FiatStore: Updated fetching logic to retrieve rates for all selected currencies (supports Yadio and Zeus sources).
  • Conversion Component: Refactored to loop through and display all active fiat conversions in the balance panes and headers.
  • AmountUtils: Extended unit handling to support specific fiat codes (e.g., 'USD', 'INR') alongside 'sats' and 'BTC'.

Why this is useful?

Users no longer need to switch settings back and forth to see their balance in different currencies. This is particularly useful for users dealing with multiple regional currencies or stablecoins.

Visuals

| Currency Selection |
|---|---|

Screen.Recording.2026-01-25.at.08.mp4

Fixes

Fixes #3384

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @aryanraj45, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a significant enhancement by allowing users to select and display multiple fiat currencies concurrently. This change eliminates the need for users to constantly switch between currencies to view their balances, providing a more convenient and comprehensive financial overview, especially for those managing funds across different regional currencies or stablecoins. The underlying architecture has been updated to support this multi-selection, from persistent storage of selected currencies to dynamic fetching and display of their respective exchange rates.

Highlights

  • Multi-Fiat Currency Selection: Users can now select and view multiple fiat currencies simultaneously, enhancing flexibility for international users and those dealing with various regional currencies or stablecoins.
  • Persistent Currency Settings: The SettingsStore has been updated to store an array of selected fiat currencies, ensuring that user selections persist across sessions.
  • Dynamic Rate Fetching: The FiatStore now fetches exchange rates for all selected fiat currencies from configured sources (Yadio or Zeus), rather than just a single one.
  • Refactored Conversion Display: The Conversion component has been updated to iterate through and display all active fiat conversions in balance panes and headers, providing a comprehensive overview.
  • Enhanced Amount Utility: AmountUtils now supports specific fiat codes (e.g., 'USD', 'INR') in addition to 'sats' and 'BTC' for more accurate and flexible unit handling.
  • Gradle Version Update: The Gradle wrapper version has been updated from 9.0.0 to 8.13 in android/gradle/wrapper/gradle-wrapper.properties.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request primarily introduces support for displaying multiple fiat currencies simultaneously within the application. Key changes include updating the Conversion.tsx component to iterate and display rates for a list of fiat currencies stored in SettingsStore.settings.fiats. The FiatStore.ts was modified to fetch rates for multiple fiats using Promise.all and its getSymbol and getRate methods now accept an optional currencyCode argument. The SettingsStore.ts was updated to include a fiats array in its settings, ensuring backward compatibility by initializing it from the single fiat setting if missing. Related utility functions in AmountUtils.ts and UnitsUtils.ts were adjusted to handle dynamic currency codes. The SelectCurrency.tsx view was refactored to allow users to select multiple fiat currencies, adding or removing them from the fiats array, and the display in Currency.tsx now shows all selected fiats. Review comments suggest improving type safety in FiatStore.ts by using a type guard instead of as any when filtering fiat rates, and refactoring the currency selection logic in SelectCurrency.tsx to use a single isSelected variable for clarity and to reduce code duplication.

} else if (rate) {
this.fiatRates = [rate];
}
this.fiatRates = rates.filter((r) => r != null) as any;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

Using as any bypasses TypeScript's type safety. A type guard would be a better approach to ensure the filtered array is correctly typed.

Suggested change
this.fiatRates = rates.filter((r) => r != null) as any;
this.fiatRates = rates.filter((r): r is { name?: string; cryptoCode: string; currencyPair: string; code: string; rate: number; } => r != null);

Comment on lines 169 to 196
(!currencyConverter &&
selectedCurrency ===
item.value) ||
(!selectedCurrency &&
item.value === DEFAULT_FIAT)
SettingsStore.settings.fiats.includes(
item.value
)) ||
(!SettingsStore.settings
.fiats &&
item.value === DEFAULT_FIAT)
? themeColor('highlight')
: themeColor('text'),
fontFamily: 'PPNeueMontreal-Book'
}}
>
{`${item.flag ? item.flag : ''} ${
item.key
} ${
item.value ? `(${item.value})` : ''
}`}
{`${item.flag ? item.flag : ''} ${item.key
} ${item.value ? `(${item.value})` : ''
}`}
</ListItem.Title>
</ListItem.Content>
{(selectedCurrency === item.value ||
(!selectedCurrency &&
{(SettingsStore.settings.fiats.includes(
item.value
) ||
(!SettingsStore.settings.fiats &&
item.value === DEFAULT_FIAT)) &&
!currencyConverter && (
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The logic to determine if a currency is selected is duplicated for setting the color and showing the checkmark icon. This can be extracted into a single variable for clarity and to avoid repetition.

const isSelected = !currencyConverter && (
    (SettingsStore.settings.fiats && SettingsStore.settings.fiats.includes(item.value)) ||
    (!SettingsStore.settings.fiats && item.value === DEFAULT_FIAT)
);

You can then use isSelected for both the color style and the conditional rendering of the checkmark icon. This would make the code cleaner and easier to maintain.

Copy link
Contributor

Choose a reason for hiding this comment

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

@aryanraj45, you don’t need to change these files, so please remove this change.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review, @ajaysehwal!

I've removed the accidental change to gradle-wrapper.properties.
I also did a quick pass to clean up the code and improve type safety (removed unnecessary non-null assertions).

@kaloudis kaloudis requested a review from ajaysehwal January 25, 2026 22:42
@ajaysehwal
Copy link
Contributor

@aryanraj45, please run yarn verify locally before pushing your changes

@aryanraj45
Copy link
Author

@ajaysehwal Done! I've fixed all 65+ linting and formatting errors identified by yarn verify.

Cleaned up unused variables in
Wallet.tsx
.
Updated
AmountUtils.test.ts
to align with the new logic (it now correctly expects '0' instead of 'Disabled' when rates are unavailable).
Fixed formatting across all modified files.
yarn verify is now passing locally with 0 errors

Copy link
Contributor

@ajaysehwal ajaysehwal left a comment

Choose a reason for hiding this comment

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

@aryanraj45, your commit structure doesn’t look great right now. You’ve used the same title for two commits, and the last two commits seem unnecessary. Please revert the latest three commits and force-push again with only two commits. lmk if anything is unclear.

@aryanraj45
Copy link
Author

@ajaysehwal I've squashed the cleanup and refactor updates into a single commit as requested. The PR now contains exactly two commits:

The original feature request.
The cycle logic refactor + linting/type fixes.

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this changed?

const { changeUnits, units } = UnitsStore!;
const { settings } = SettingsStore!;

if (!UnitsStore || !SettingsStore) return null;
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this change required?

});

it('returns error when rate for currency is not available', () => {
it('returns 0 when rate for currency is not available', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

why does this behavior need to be changed?

Copy link
Author

Choose a reason for hiding this comment

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

This change prevents a visual flicker when switching currencies. When switching from one fiat to another, there's a brief moment where the new rate isn't loaded yet. Displaying 'Disabled' or 'N/A' causes the UI to flash, which is jarring. Returning '0' with the correct symbol ensures a smooth transition until the actual rate loads

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this approach can cause further issues. You should find another approach.

This wasn't an issue before with single fiat functionality.

};

type Units = 'sats' | 'BTC' | 'fiat';
type Units = 'sats' | 'BTC' | 'fiat' | string;
Copy link
Contributor

Choose a reason for hiding this comment

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

not a fan of this approach. Do we maybe need a type for our fiat strings?

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need to make changes to this view? Shouldn't everything be covered by the Conversion and UnitToggle components?

@aryanraj45
Copy link
Author

@kaloudis Thanks for the detailed review! I've addressed all the feedback:

Reverted gradle-wrapper.properties (accidental change)
Reverted
UnitToggle.tsx
(removed unnecessary defensive code)
Fixed
KeypadPane.tsx

  • removed tap-to-cycle from main amount, now only the orange button triggers currency cycling

Copy link
Contributor

@ajaysehwal ajaysehwal left a comment

Choose a reason for hiding this comment

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

@aryanraj45, please review all the changed files. There still seem to be a lot of unnecessary changes. I don’t think this feature requires this many modifications, so please remove the unnecessary ones and keep only the required changes

});

it('returns error when rate for currency is not available', () => {
it('returns 0 when rate for currency is not available', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this approach can cause further issues. You should find another approach.

This wasn't an issue before with single fiat functionality.

@@ -168,6 +168,8 @@ export interface Settings {
authenticationAttempts?: number;
fiatEnabled?: boolean;
fiat?: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

no need to have both fiat and fiats - best to consolidate them. Probably best to keep fiat and make it backwards compatible

Copy link
Author

Choose a reason for hiding this comment

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

@kaloudis done Consolidated fiat and fiats - fiat is now automatically derived from fiats[preferredFiatIndex]

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.

Allow selecting multiple fiat currencies

3 participants