Commit a123783
fix: sei and mon native token swap selection (#38349)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
This PR applies a Yarn patch to @metamask/bridge-controller@61.0.0 to
correctly register the MONAD (143) and SEI (1329) chain IDs in the
ChainId enum.
This resolves a UI bug where swap fields incorrectly default to BTC or
ETH instead of MON/SEI when all “Popular Networks” are enabled.
The bridge-controller’s internal enumerations for numerical chain Ids
did not include MONAD nor SEI (chain ID 143).
When the app attempted to determine the appropriate chain, this caused
fallback behavior, leading to incorrect mappings (defaulting to
BTC/ETH).
Fix
- Introduce a Yarn patch that adds:
- ChainId.SEI = 1329
- ChainId.MONAD = 143
- Update package.json and yarn.lock to use the patched controller.
- No functional logic changes; only enum correction to ensure proper
chain resolution.
[](https://codespaces.new/MetaMask/metamask-extension/pull/38349?quickstart=1)
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry: Fixed a bug where swapping from the Mon token page
suggested ETH instead of MON when all Popular Networks were enabled.
Added missing MONAD (143) and SEI (1329) chain IDs to the
bridge-controller to ensure correct chain resolution.
## **Related issues**
Fixes:
## **Manual testing steps**
1. Go to this page...
2.
3.
## **Screenshots/Recordings**
<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->
### **Before**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/ea8b3df0-c9b1-462e-b6b5-4a96f22493a3
### **After**
<!-- [screenshots/recordings] -->
https://github.com/user-attachments/assets/15566568-1a08-46bb-87f7-be739a9c5079
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **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.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Registers SEI and MONAD chain IDs in
`@metamask/bridge-controller@61.0.0` via a Yarn patch and updates
dependencies to use the patched package.
>
> - **Bridge Controller patch**:
> - Adds `ChainId.SEI = 1329` and `ChainId.MONAD = 143` in
`dist/types.cjs` via
`/.yarn/patches/@metamask-bridge-controller-npm-61.0.0-8c413c463f.patch`.
> - **Dependencies**:
> - Points `package.json` and `yarn.lock` to the patched
`@metamask/bridge-controller@61.0.0`.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
f04cda3. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Bernardo Garces Chapero <bernardo.chapero@consensys.net>
Co-authored-by: Mark Stacey <mark.stacey@consensys.net>1 parent 7964998 commit a123783
File tree
3 files changed
+48
-3
lines changed- .yarn/patches
3 files changed
+48
-3
lines changedLines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5887 | 5887 | | |
5888 | 5888 | | |
5889 | 5889 | | |
5890 | | - | |
| 5890 | + | |
5891 | 5891 | | |
5892 | 5892 | | |
5893 | 5893 | | |
| |||
5919 | 5919 | | |
5920 | 5920 | | |
5921 | 5921 | | |
| 5922 | + | |
| 5923 | + | |
| 5924 | + | |
| 5925 | + | |
| 5926 | + | |
| 5927 | + | |
| 5928 | + | |
| 5929 | + | |
| 5930 | + | |
| 5931 | + | |
| 5932 | + | |
| 5933 | + | |
| 5934 | + | |
| 5935 | + | |
| 5936 | + | |
| 5937 | + | |
| 5938 | + | |
| 5939 | + | |
| 5940 | + | |
| 5941 | + | |
| 5942 | + | |
| 5943 | + | |
| 5944 | + | |
| 5945 | + | |
| 5946 | + | |
| 5947 | + | |
| 5948 | + | |
| 5949 | + | |
| 5950 | + | |
| 5951 | + | |
| 5952 | + | |
| 5953 | + | |
5922 | 5954 | | |
5923 | 5955 | | |
5924 | 5956 | | |
| |||
32791 | 32823 | | |
32792 | 32824 | | |
32793 | 32825 | | |
32794 | | - | |
| 32826 | + | |
32795 | 32827 | | |
32796 | 32828 | | |
32797 | 32829 | | |
| |||
0 commit comments