Skip to content

feat: unified swaps#16433

Merged
bfullam merged 82 commits into
mainfrom
mms-2341-unified-swaps
Jul 10, 2025
Merged

feat: unified swaps#16433
bfullam merged 82 commits into
mainfrom
mms-2341-unified-swaps

Conversation

@infiniteflower

@infiniteflower infiniteflower commented Jun 17, 2025

Copy link
Copy Markdown
Contributor

Description

This PR handles Unified Swaps routing, network, and token selection. It's hidden behind an env var and a feature flag, so there is no risk of accidentally exposing this feature before it's ready.

Related issues

Resolves: https://consensyssoftware.atlassian.net/browse/MMS-2341

Manual testing steps

Setup

  1. Add export MM_UNIFIED_SWAPS_ENABLED="true" to .js.env
  2. Terminal: source .js.env
  3. Start the app up

Swaps

  1. Go to Swaps (notice there's no Bridge button anymore)
  2. Request a quote for a source and dest token with the same chain

Bridge

  1. Go to Swaps (notice there's no Bridge button anymore)
  2. Request a quote for a source and dest token with a different chain

Feature flags

  1. Add export MM_UNIFIED_SWAPS_ENABLED="false" to .js.env
  2. Terminal: source .js.env
  3. Start the app up
  4. You should see 2 buttons for Swap and Bridge
  5. Swap btn should take you to Legacy Swaps
  6. Bridge btn should take you to Bridge

Screenshots/Recordings

Before

After

Bridge

Screen.Recording.2025-06-19.at.5.54.00.PM.mov

Swap

Screen.Recording.2025-06-19.at.5.46.23.PM.mov

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.

@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 Jun 17, 2025
@infiniteflower infiniteflower added QA Passed QA testing has been completed and passed Run Smoke E2E labels Jun 18, 2025
@infiniteflower infiniteflower force-pushed the mms-2341-unified-swaps branch from 2417c41 to 0eaa817 Compare June 19, 2025 16:19
@github-actions

github-actions Bot commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 2c51102
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1eeca6ff-6b13-4dea-bc57-7837a1c861db

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@github-actions

github-actions Bot commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: b01cd90
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/fe628443-c6f5-40f8-8c2f-0b1d129c80c3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions

github-actions Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: dfd143b
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2f897550-3f66-4efc-8556-e78125657899

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@github-actions

github-actions Bot commented Jun 20, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 6103316
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/356ca19c-9476-4b2c-a9b3-5b6428240236

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@bfullam

bfullam commented Jul 7, 2025

Copy link
Copy Markdown
Contributor

Adding no e2e smoke needed tag because run_wallet_platform_swimlane_android_smoke is also failing on main

@github-actions

github-actions Bot commented Jul 8, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: ff361b1
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7b173a56-329c-43a3-ab42-ce795a276b1f

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

cursor[bot]

This comment was marked as outdated.

bfullam
bfullam previously approved these changes Jul 8, 2025
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@socket-security

socket-security Bot commented Jul 9, 2025

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: b512cd5
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7cd8cd0c-796a-45b1-9d15-ca925b77ae67

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@github-actions

github-actions Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 743d3d4
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/7ac3927b-494a-4c79-8d05-f2371664f16a

Note

  • You can rerun any failed steps by opening the Bitrise build, tapping Rebuild on the upper right then Rebuild unsuccessful Workflows
  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

cursor[bot]

This comment was marked as outdated.

@github-actions

github-actions Bot commented Jul 10, 2025

Copy link
Copy Markdown
Contributor

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 4ab5eac
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/df1d5ad4-33fd-4c4d-afb1-5fbef5443453

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

@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.

Bug: Swap Logic Fails Initial State Check

The isSwap determination logic was changed from bridgeViewMode to sourceToken?.chainId === destToken?.chainId. This new logic incorrectly classifies the initial state (when both tokens are undefined) as a swap, causing the button to display "Confirm swap". Furthermore, it broadly assumes all same-chain operations are swaps, which may not be accurate for all bridge scenarios, leading to incorrect button labels and potential user confusion.

app/components/UI/Bridge/Views/BridgeView/index.tsx#L338-L339

const isSwap = sourceToken?.chainId === destToken?.chainId;

Fix in CursorFix in Web


Was this report helpful? Give feedback by reacting with 👍 or 👎

@sonarqubecloud

Copy link
Copy Markdown

Comment thread app/components/Views/WalletActions/WalletActions.tsx

@tommasini tommasini 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.

Left a comment, but if I'm missing something and we do not need to address it, feel free to resolve it

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

Labels

QA Passed QA testing has been completed and passed release-7.52.0 Issue or pull request that will be included in release 7.52.0 team-swaps-and-bridge Swaps and Bridge team

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.