Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/dist/types.cjs b/dist/types.cjs
index a83a797b8f01747a6d51eb1219669c729955f039..ea9eb54bf3a0ae7ed3c75a8bb9904dd925a50a16 100644
--- a/dist/types.cjs
+++ b/dist/types.cjs
@@ -47,6 +47,8 @@ var ChainId;
ChainId[ChainId["SOLANA"] = 1151111081099710] = "SOLANA";
ChainId[ChainId["BTC"] = 20000000000001] = "BTC";
ChainId[ChainId["TRON"] = 728126428] = "TRON";
+ ChainId[ChainId["SEI"] = 1329] = "SEI";
+ ChainId[ChainId["MONAD"] = 143] = "MONAD";
})(ChainId || (exports.ChainId = ChainId = {}));
var RequestStatus;
(function (RequestStatus) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Patch missing ESM version of ChainId enum

The patch only modifies dist/types.cjs (CommonJS) but likely needs to also patch dist/types.mjs (ES Modules). Other patches in this repository (e.g., @metamask-assets-controllers) patch both .cjs and .mjs files because MetaMask controller packages export both formats. If the build system resolves the ESM version, the SEI and MONAD chain IDs won't be present in the ChainId enum, and the fix for the swap field defaulting issue may not work consistently.

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Patch may be incomplete, missing ESM file modification

The patch only modifies dist/types.cjs (CommonJS), but existing patches in this repository for other MetaMask controller packages (like @metamask-assets-controllers) follow a pattern of patching both .cjs and .mjs files. If @metamask/bridge-controller has dual exports (which is standard for MetaMask packages), the ESM version (types.mjs) won't include the SEI and MONAD chain IDs. This could cause the same bug to reappear in contexts that use ESM module resolution.

Fix in Cursor Fix in Web

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Patch missing ESM file causing inconsistent ChainId enum

The patch only modifies dist/types.cjs (CommonJS) but likely needs to also patch dist/types.mjs (ES Module). Looking at similar patches in this codebase like @metamask-assets-controllers-npm-89.0.1-02fa7acd54.patch, MetaMask controller packages typically export both CJS and ESM formats, and both need patching for consistency. If only the CJS file is patched, code that imports via ESM bundling won't see the new SEI and MONAD chain IDs, potentially causing the fix to not work in certain module resolution contexts.

Fix in Cursor Fix in Web

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@
"@metamask/assets-controllers": "patch:@metamask/assets-controllers@patch%3A@metamask/assets-controllers@npm%253A89.0.1%23~/.yarn/patches/@metamask-assets-controllers-npm-89.0.1-02fa7acd54.patch%3A%3Aversion=89.0.1&hash=6be0d3#~/.yarn/patches/@metamask-assets-controllers-patch-7c7d711c8c.patch",
"@metamask/base-controller": "^9.0.0",
"@metamask/bitcoin-wallet-snap": "^1.7.0",
"@metamask/bridge-controller": "^61.0.0",
"@metamask/bridge-controller": "patch:@metamask/bridge-controller@npm%3A61.0.0#~/.yarn/patches/@metamask-bridge-controller-npm-61.0.0-8c413c463f.patch",
"@metamask/bridge-status-controller": "^61.0.0",
"@metamask/browser-passworder": "^4.3.0",
"@metamask/chain-agnostic-permission": "^1.2.2",
Expand Down
36 changes: 34 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5887,7 +5887,7 @@ __metadata:
languageName: node
linkType: hard

"@metamask/bridge-controller@npm:^61.0.0":
"@metamask/bridge-controller@npm:61.0.0":
version: 61.0.0
resolution: "@metamask/bridge-controller@npm:61.0.0"
dependencies:
Expand Down Expand Up @@ -5919,6 +5919,38 @@ __metadata:
languageName: node
linkType: hard

"@metamask/bridge-controller@patch:@metamask/bridge-controller@npm%3A61.0.0#~/.yarn/patches/@metamask-bridge-controller-npm-61.0.0-8c413c463f.patch":
version: 61.0.0
resolution: "@metamask/bridge-controller@patch:@metamask/bridge-controller@npm%3A61.0.0#~/.yarn/patches/@metamask-bridge-controller-npm-61.0.0-8c413c463f.patch::version=61.0.0&hash=f88d28"
dependencies:
"@ethersproject/address": "npm:^5.7.0"
"@ethersproject/bignumber": "npm:^5.7.0"
"@ethersproject/constants": "npm:^5.7.0"
"@ethersproject/contracts": "npm:^5.7.0"
"@ethersproject/providers": "npm:^5.7.0"
"@metamask/base-controller": "npm:^9.0.0"
"@metamask/controller-utils": "npm:^11.15.0"
"@metamask/gas-fee-controller": "npm:^25.0.0"
"@metamask/keyring-api": "npm:^21.0.0"
"@metamask/messenger": "npm:^0.3.0"
"@metamask/metamask-eth-abis": "npm:^3.1.1"
"@metamask/multichain-network-controller": "npm:^2.0.0"
"@metamask/polling-controller": "npm:^15.0.0"
"@metamask/utils": "npm:^11.8.1"
bignumber.js: "npm:^9.1.2"
reselect: "npm:^5.1.1"
uuid: "npm:^8.3.2"
peerDependencies:
"@metamask/accounts-controller": ^34.0.0
"@metamask/assets-controllers": ^89.0.0
"@metamask/network-controller": ^25.0.0
"@metamask/remote-feature-flag-controller": ^2.0.0
"@metamask/snaps-controllers": ^14.0.0
"@metamask/transaction-controller": ^61.0.0
checksum: 10/8ad4ed2d6cbfa09aa42394b6c61a97fec9401fd3d26f6f90c8f4d0afd9f736f2eef45c5f71be6baf009f008a51452badb32aee38c029bb0a905792f6da84afe5
languageName: node
linkType: hard

"@metamask/bridge-status-controller@npm:^61.0.0":
version: 61.0.0
resolution: "@metamask/bridge-status-controller@npm:61.0.0"
Expand Down Expand Up @@ -32791,7 +32823,7 @@ __metadata:
"@metamask/auto-changelog": "npm:^5.1.0"
"@metamask/base-controller": "npm:^9.0.0"
"@metamask/bitcoin-wallet-snap": "npm:^1.7.0"
"@metamask/bridge-controller": "npm:^61.0.0"
"@metamask/bridge-controller": "patch:@metamask/bridge-controller@npm%3A61.0.0#~/.yarn/patches/@metamask-bridge-controller-npm-61.0.0-8c413c463f.patch"
"@metamask/bridge-status-controller": "npm:^61.0.0"
"@metamask/browser-passworder": "npm:^4.3.0"
"@metamask/build-utils": "npm:^3.0.0"
Expand Down
Loading