feat: unified swaps#16433
Conversation
|
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. |
2417c41 to
0eaa817
Compare
|
|
b01cd90 to
dfd143b
Compare
|
|
|
Adding |
|
…erge, set to proper versions
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
|
|
There was a problem hiding this comment.
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
metamask-mobile/app/components/UI/Bridge/Views/BridgeView/index.tsx
Lines 338 to 339 in 4ab5eac
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
tommasini
left a comment
There was a problem hiding this comment.
Left a comment, but if I'm missing something and we do not need to address it, feel free to resolve it



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
export MM_UNIFIED_SWAPS_ENABLED="true"to.js.envsource .js.envSwaps
Bridge
Feature flags
export MM_UNIFIED_SWAPS_ENABLED="false"to.js.envsource .js.envScreenshots/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