-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: unified swaps #16433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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
|
|
|
There was a problem hiding this comment.
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
metamask-mobile/app/components/UI/Bridge/Views/BridgeView/index.tsx
Lines 338 to 339 in 4ab5eac
| const isSwap = sourceToken?.chainId === destToken?.chainId; |
Was this report helpful? Give feedback by reacting with 👍 or 👎
|
tommasini
left a comment
There was a problem hiding this comment.
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



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