feat: integrate USDC + USDm + USAT + 4-card BalanceCard (Phases 1 + 2)#148
Merged
Conversation
…ENCIES / resolvers
Expose DOLLAR_TOKEN_IDS, isDollarToken, and getDollarTokenIds for the home-screen Dolares card. USAT is filtered out on Sepolia where networkConfig.usatTokenId is empty.
New hooks aggregate all DOLLAR_TOKEN_IDS entries that have balance > 0, compute their local-currency value, and sort by value descending. useDollarBalance sums all entries for use as the Dolares card total.
…d/Investments) Replace the single 'available' card with two dedicated cards: - Pesos (white, non-expandable, COPm only, front by default) - Dolares (green gradient, expandable, per-token breakdown for USD stables with balance > 0) Update TabWallet.test.tsx testIDs to reference the new card ID.
…let Dolares row Three small follow-ups after Phase 2 visual QA: 1. BalanceCard Dolares gradient: switch from vivid emerald (#22C55E -> #137211) to muted Tether green (#26A17B -> #1A6F55 -> #0F4733). Matches DollarsIcon hue and reads less neon against the rest of the wallet palette. 2. useDollarTokensWithBalance: filter out dust by USD value (>= STABLE_TRANSACTION_MIN_AMOUNT = 0.01 USD) instead of just balance.gt(0). Was showing USDm rows with 25047 wei = 0.000000000000025 USDm rounded to COP$0.00. Threshold matches what tokensWithUsdValueSelector already uses, so row counts agree across screens. 3. TabWallet: collapse all individual dollar tokens (USDT/USDC/USDm/USAT) into a single 'Dolares' row showing the aggregate USD + COP value, mirroring how 'Pesos' is shown. Uses DollarsIcon + same row layout as the Gold item. Hidden when sum is 0. Also exposes useDollarUsdBalance hook for the USD aggregate, mirroring useDollarBalance for COP.
4 tasks
TuCopFi
added a commit
that referenced
this pull request
Jun 4, 2026
feat: dollar tokens Phase 3 foundation (stacked on PR #148)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phases 1 and 2 of the dollar-tokens-and-balance-cards plan ship together.
Phase 1 (data layer): integrate USDC, USDm (cUSD alias) and USAT into the wallet on Celo mainnet.
Phase 2 (UI): refactor the home/wallet
BalanceCardfrom 3 cards to 4 (Pesos / Dolares / Oro / Inversiones), and collapse individual dollar tokens into a single "Dolares" row in TabWallet.The new "Dolares" total aggregates USDT + USDC + USDm + USAT. Pesos disponibles is the white front card by default (non-expandable). The new Dolares card uses a muted Tether-green gradient
['#26A17B', '#1A6F55', '#0F4733']that matchesDollarsIconand the rest of the wallet palette. Expanding Dolares shows a per-token breakdown filtered by USD-value dust threshold (>= STABLE_TRANSACTION_MIN_AMOUNT, same threshold astokensWithUsdValueSelector).Verified visually (Android Pixel 8 emulator)
Tested with wallet
0xEa510ecA6966208499cDEc4552211F3C3Ca0df4e:Changes
Phase 1 (data layer)
src/web3/networkConfig.ts: three new token-ID constants + interface fields + both config objects +currencyToTokenIdmappings (USDC + USAT)src/tokens/constants.ts: USDC + USDm + USAT added toALLOWED_TOKEN_IDS. USAT guarded byif (networkConfig.usatTokenId)for Sepoliasrc/utils/currencies.ts: USDC + USAT added toCurrency,CiCoCurrency,CURRENCIES, resolverssrc/components/TokenDisplay.tsx:getTokenSymbolcovers the three new tokenssrc/tokens/hooks.ts:useUSDC/useUSDm/useUSATconvenience hookssrc/tokens/saga.ts: USAT priceUsd override (NaN -> 1) since the Valora upstream backend has USAT metadata but no price oracle. TODO to remove when upstream publishes a real feedsrc/tokens/selectors.ts: extendtokensByCurrencySelectorfor the new enum valuesusdCoin,mentoDollar,tetherUsd,tetherAmericaUsd)Phase 2 (UI)
docs/adr/0014-home-balance-cards-layout.md: ADR for the 4-card layout decisionsrc/tokens/dollarGroup.ts:DOLLAR_TOKEN_IDSset +isDollarToken()+getDollarTokenIds()src/tokens/hooks.ts:useDollarTokensWithBalance(returns array withusdValue+localValue, dust-filtered),useDollarBalance(sum in local currency),useDollarUsdBalance(sum in USD)src/components/BalanceCard.tsx: refactor from 3 cards to 4 (CardId enum, default activeCard = 'pesos', baseOrder, per-token Dolares breakdown, non-expandable Pesos)src/tokens/TabWallet.tsx: collapse individual dollar tokens into a single "Dolares" row showing aggregate USD + COP valueVerification
yarn build:ts- passyarn lint- passyarn test- 368 suites, 3997 pass, 44 skipped, 0 fail (Phase 1) + snapshot updates (Phase 2)Pre-existing bugs surfaced during QA (not introduced by this PR, but worth fixing separately)
UpgradeScreendoes not callSplashScreen.hide(). WhenshouldForceUpgradeis true at cold start,NavigatorWrapperrenders<UpgradeScreen>early andMainStackScreen(which holds the onlySplashScreen.hide()call) never mounts. Result: app stuck on splash forever instead of showing the upgrade prompt. Hit during my QA because Development branch is at1.118.4while StatsigminRequiredVersion = 1.118.5(PRs chore: bump version to 1.118.5 #146/fix(ios): wire Info.plist version keys to build-setting template vars #147 are only onmain). Fix is to addSplashScreen.hide()insideUpgradeScreen.componentDidMount(or a useEffect at the top ofNavigatorWrapper).facebook::react::jsinspector_modern::HostTarget::registerInstanceassertion failure during[RCTBridge setUp]. iOS simulator-only, debug-only. Production builds are unaffected. Visual QA on iOS sim needs either iPhone 15 Pro Max iOS 17.5 (works) or a release build.Known gaps / follow-ups (Phase 3)
spendTokenIdspre-existing inconsistency[CUSD_TOKEN_ID_MAINNET, CELO_TOKEN_ID_MAINNET](no USDT) is NOT modified by this PRTest plan
0xEa510ecA6966208499cDEc4552211F3C3Ca0df4e