feat(card): disable swaps if selected address is different from priority token owner address #21454
+422
−2
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.



Description
Implements account address validation for the Card feature's "Add Funds" functionality.
The feature now disables swaps when the priority token owner address doesn't match the user's selected EVM or Solana account address.
Changelog
CHANGELOG entry: Disabled "Add Funds" button when priority token address doesn't match selected account on Card feature
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Simulator.Screen.Recording.-.iPhone.16.-.2025-10-20.at.22.24.52.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Disables the Card Home Add Funds action based on a new address-matching hook, adds disabled styling/tests, and improves SDK error logging for external wallet fetches.
useIsSwapEnabledForPriorityTokento gateAdd Fundsby address match; setsdisabledand appliesstyles.halfWidthButtonDisabledwhen not allowed.ButtonsSectiondeps to includeisSwapEnabledForPriorityToken.useIsSwapEnabledForPriorityTokenhalfWidthButtonDisabledinCardHome.styles.ts.useIsSwapEnabledForPriorityToken.test.tscovering auth and EVM/Solana comparisons.CardHome.test.tsxto verifyAdd Fundsenabled/disabled behavior and styling; updates snapshots.CardSDK.ts): Enhances error logging by attempting to parse and log JSON bodies when fetching external and priority wallet details fails.Written by Cursor Bugbot for commit 5af32de. This will update automatically on new commits. Configure here.