Skip to content

feat(swaps): add verified badges to asset picker#27878

Merged
bfullam merged 4 commits into
mainfrom
swaps-verified-badge
Mar 27, 2026
Merged

feat(swaps): add verified badges to asset picker#27878
bfullam merged 4 commits into
mainfrom
swaps-verified-badge

Conversation

@bfullam

@bfullam bfullam commented Mar 24, 2026

Copy link
Copy Markdown
Contributor

Description

This adds a verified trust signal to the swap/bridge asset picker when the backend returns isVerified on popular and search token results. The change threads the new field through the bridge token models, preserves it during token-to-balance merging, renders the verified badge inline in picker rows, and adds focused coverage for popular tokens, search results, and row rendering.

Changelog

CHANGELOG entry: Added verified badges to swap asset picker tokens

Related issues

Fixes:
Refs: SWAPS-4219

Manual testing steps

Feature: Swap asset picker verified trust signals

  Background:
    Given I am logged into MetaMask Mobile
    And I can open the swap or bridge asset picker

  Scenario: user sees a verified badge for a popular token
    Given the popular token response includes a token with isVerified set to true

    When user opens the source or destination asset picker
    Then the verified token should display a verified badge in its list row
    And tokens without isVerified should not display the badge

  Scenario: user sees a verified badge for a searched token
    Given the search token response includes a token with isVerified set to true

    When user searches for that token in the asset picker
    Then the search result should display a verified badge in its list row
    And the token should remain selectable as usual

Screenshots/Recordings

Before

N/A

After

N/A

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

Low Risk
Low risk UI/model threading of a new optional isVerified flag; main risk is minor layout/test regressions in the token picker row rendering.

Overview
Adds support for an optional isVerified trust signal on Bridge API token results and threads it into the in-app BridgeToken model.

Updates the token picker row (TokenSelectorItem) to render a small verified icon next to the token symbol when token.isVerified is true, and extends unit tests/fixtures to assert the flag is preserved through popular/search fetching and balance-merging, and is passed through BridgeTokenSelector into row rendering.

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

@bfullam bfullam requested a review from a team as a code owner March 24, 2026 15:38
@github-actions

Copy link
Copy Markdown
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.

@metamaskbot metamaskbot added the team-swaps-and-bridge Swaps and Bridge team label Mar 24, 2026
@github-actions github-actions Bot added size-M risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 24, 2026
@bfullam bfullam changed the title Add verified badges to swap asset picker tokens feat(swaps): add verified badges to asset picker Mar 24, 2026
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 24, 2026
GeorgeGkas
GeorgeGkas previously approved these changes Mar 24, 2026
@bfullam bfullam enabled auto-merge March 24, 2026 16:13
Comment thread app/components/UI/Bridge/components/TokenSelectorItem.test.tsx Outdated
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 24, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread app/components/UI/Bridge/components/TokenSelectorItem.tsx
@github-actions github-actions Bot added risk-medium Moderate testing recommended · Possible bug introduction risk and removed risk-medium Moderate testing recommended · Possible bug introduction risk labels Mar 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade, SmokeConfirmations
  • Selected Performance tags: None (no tests recommended)
  • Risk Level: medium
  • AI Confidence: 88%
click to see 🤖 AI reasoning details

E2E Test Selection:
The changes introduce an isVerified field to the Bridge token types and UI components:

  1. app/components/UI/Bridge/types.ts - Added optional isVerified?: boolean to BridgeToken interface
  2. app/components/UI/Bridge/hooks/usePopularTokens.ts - Added isVerified to PopularToken interface
  3. app/components/UI/Bridge/components/TokenSelectorItem.tsx - Added conditional rendering of a verified icon (VerifiedFilled) next to token symbols in the Bridge token selector when token.isVerified is true
  4. tests/helpers/swap/constants.ts (CRITICAL) - Added isVerified: true to ETH in GET_POPULAR_TOKENS_MAINNET_RESPONSE, which is used by both bridge-mocks.ts and swap-mocks.ts in E2E tests

The E2E test helper change (tests/helpers/swap/constants.ts) is the most impactful - it updates the mock API response used by bridge and swap E2E smoke tests. The GET_POPULAR_TOKENS_MAINNET_RESPONSE is consumed by bridge-mocks.ts (used in bridge-action-smoke.spec.ts, swap-trending-tokens.spec.ts) and swap-mocks.ts (used in swap-action-smoke.spec.ts, swap-deeplink-smoke.spec.ts, gasless-swap.spec.ts).

SmokeTrade is selected because the changes directly affect bridge and swap token selector UI and E2E mock data.
SmokeConfirmations is required per SmokeTrade tag description: "When selecting SmokeTrade for swap or bridge flows, also select SmokeConfirmations."

No other tags are needed - the changes are isolated to the Bridge/Swap token selector component and its test infrastructure. The changes are additive (new optional field + new UI element) and don't affect core wallet, accounts, network, or other flows.

Performance Test Selection:
The changes add a small conditional icon render to the Bridge token selector item. This is a minor UI addition (a single Icon component rendered conditionally) that is unlikely to have measurable performance impact on list rendering. No performance tests are warranted for this change.

View GitHub Actions results

@bfullam bfullam disabled auto-merge March 24, 2026 18:25
@github-actions

Copy link
Copy Markdown
Contributor

E2E Fixture Validation — Schema is up to date
17 value mismatches detected (expected — fixture represents an existing user).
View details

@sonarqubecloud

Copy link
Copy Markdown

@bfullam bfullam added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 73e9352 Mar 27, 2026
167 of 171 checks passed
@bfullam bfullam deleted the swaps-verified-badge branch March 27, 2026 14:21
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 27, 2026
@metamaskbot metamaskbot added the release-7.73.0 Issue or pull request that will be included in release 7.73.0 label Mar 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.73.0 Issue or pull request that will be included in release 7.73.0 risk-medium Moderate testing recommended · Possible bug introduction risk size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants