Skip to content

Conversation

Brunonascdev
Copy link
Contributor

@Brunonascdev Brunonascdev commented Oct 18, 2025

Description

This PR introduces several updates to the Card feature to support displaying authenticated user data after logging in with Baanx. It improves both backend integration and UI components to align the mobile experience with card.metamask.io.

Key changes include:

  • Added support for Solana assets within the Card view.
  • Integrated GET wallets and priority endpoints to fetch user-specific data.
  • Updated data presentation logic to match the behavior of card.metamask.io.
  • Introduced a new CardImage component featuring the Metal Card design.
  • Added a Progress Bar component to display Allowance vs. Balance indicators.
  • Implemented a Card Warning component to show allowance-related warnings.

Changelog

CHANGELOG entry: Added support for displaying Solana assets in the Card feature.
CHANGELOG entry: Integrated GET wallets and priority endpoints to retrieve user wallet data.
CHANGELOG entry: Updated Card data presentation to align with card.metamask.io logic.
CHANGELOG entry: Added a new CardImage component featuring the Metal Card design.
CHANGELOG entry: Added a new Progress Bar component showing Allowance versus Balance.
CHANGELOG entry: Added a new Card Warning component to display allowance warnings.

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Implements authenticated card data flow (priority token via API), adds Solana support, updates balance/allowance handling, and introduces CardImage, WarningBox, and SpendingLimitProgressBar with CardHome/UI/navigation integrations.

  • SDK/Backend:
    • Add getCardDetails and getCardExternalWalletDetails to CardSDK; switch to chain-aware getSupportedTokensByChainId.
    • Map API wallet details to priority token; cache and state for authenticated/non‑authenticated modes.
  • State/Hooks:
    • Extend card slice with authenticated priority token and timestamps; refine cache validity (30s auth/5m anon).
    • useGetPriorityCardToken: use API when authenticated; on-chain allowances otherwise; warning emission (NeedDelegation).
    • useAssetBalance: handle availableBalance, raw values, Solana chain, and display logic; derive fiat accordingly.
  • UI:
    • New CardImage (virtual/physical/metal) with address truncation; new CardWarningBox; new SpendingLimitProgressBar.
    • CardHome: loading states, warnings, add/change asset buttons, spending limit, logout, card type/address props.
    • Navbar: simplify card button display prop handling.
  • Navigation:
    • Initial Card route now depends on auth/cardholder status.
  • Utilities:
    • buildTokenIconUrl supports Solana; add truncateAddress.
  • Tests:
    • Comprehensive updates/additions for hooks, SDK, components, and styles.

Written by Cursor Bugbot for commit 36ea7fe. This will update automatically on new commits. Configure here.

Brunonascdev and others added 30 commits October 2, 2025 23:06
…taMask/metamask-mobile into chore/card-api-integration-foundation
@Brunonascdev Brunonascdev self-assigned this Oct 18, 2025
@Brunonascdev Brunonascdev added the team-card Card Team label Oct 18, 2025
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@Brunonascdev Brunonascdev marked this pull request as ready for review October 18, 2025 00:43
@Brunonascdev Brunonascdev requested a review from a team as a code owner October 18, 2025 00:43
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

Copy link

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant