Skip to content

fix: swaps network filtering#25092

Merged
bfullam merged 7 commits intomainfrom
swaps-dest-network-filtering
Jan 23, 2026
Merged

fix: swaps network filtering#25092
bfullam merged 7 commits intomainfrom
swaps-dest-network-filtering

Conversation

@bfullam
Copy link
Copy Markdown
Contributor

@bfullam bfullam commented Jan 23, 2026

Description

Changes network filtering logic to only filter the source networks.

Also includes several minor fast follow changes.

Changelog

CHANGELOG entry: Changed swaps network filtering logic to only filter source networks

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

  • Introduces selectSourceChainRanking (filters by user-configured networks) and selectDestChainRanking (returns all chains) replacing selectEnabledChainRanking; updates usage in BridgeTokenSelector and NetworkPills.
  • Refactors token selection to use TokenSelectorType enum across component and hooks; adjusts logic for dest initialization and noFee handling; passes type to NetworkPills.
  • Tightens balance typing: BalancesByAssetId now keyed by CaipAssetType; normalizes EVM asset IDs to lowercase; updates useTokensWithBalances accordingly.
  • Unifies Bridge API base URL via BRIDGE_API_BASE_URL for popular/search token endpoints.
  • Adds/updates unit tests for new selectors, components, and hooks.

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

@bfullam bfullam requested a review from a team as a code owner January 23, 2026 09:26
@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 Jan 23, 2026
@bfullam bfullam changed the title Swaps dest network filtering fix: swaps asset picker fast follows Jan 23, 2026
@bfullam bfullam changed the title fix: swaps asset picker fast follows fix: swaps network filtering Jan 23, 2026
Copy link
Copy Markdown

@cursor cursor bot left a comment

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 2 potential issues.

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeTrade
  • Risk Level: medium
  • AI Confidence: 85%
click to see 🤖 AI reasoning details

The changes are focused on the Bridge functionality within the MetaMask Mobile app:

  1. Core Redux Changes: The bridge slice now has separate selectors for source and destination chain rankings (selectSourceChainRanking and selectDestChainRanking). Source mode filters by user-configured networks while destination mode shows all bridge-supported networks.

  2. UI Component Changes: BridgeTokenSelector and NetworkPills components now use different chain rankings based on whether the user is selecting a source or destination token.

  3. Type Safety Improvements: Added TokenSelectorType enum and improved type annotations with CaipAssetType.

  4. API URL Simplification: Hooks now use a centralized BRIDGE_API_BASE_URL constant.

The E2E test bridge-action-smoke.spec.ts is tagged with SmokeTrade and directly tests the bridge functionality including:

  • Selecting destination network
  • Selecting tokens
  • Confirming bridge transactions
  • Verifying bridge activity completion

This test will validate that the changes to network/token selection in the bridge flow work correctly. The changes don't affect other areas like accounts, confirmations, identity, or network management outside of the bridge context.

View GitHub Actions results

@sonarqubecloud
Copy link
Copy Markdown

@bfullam bfullam enabled auto-merge January 23, 2026 11:19
@bfullam bfullam added this pull request to the merge queue Jan 23, 2026
Merged via the queue into main with commit f3151a6 Jan 23, 2026
83 checks passed
@bfullam bfullam deleted the swaps-dest-network-filtering branch January 23, 2026 11:42
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2026
@metamaskbot metamaskbot added the release-7.64.0 Issue or pull request that will be included in release 7.64.0 label Jan 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.64.0 Issue or pull request that will be included in release 7.64.0 size-M team-swaps-and-bridge Swaps and Bridge team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants