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. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1fedf87. Configure here.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
|




Description
Aligns the mobile app's
@metamask/accountsand@metamask/coredependency graphs with the just-released@metamask/core@952.0.0packages and the latest published versions of every direct accounts-repo dep. #8584 removedInternalAccount.metadata.snap.{enabled, name},account-tree-controller@7.2.0expanded the account-type union withstellar:account, and the new core packages compile against@metamask/messenger@^1.2.0. The pre-existing pins caused multiple-version installs ofkeyring-api,keyring-internal-api, andmessenger. This PR brings everything onto a single, consistent set.Dependency changes
Direct accounts-repo bumps
@metamask/account-api^1.0.0^1.0.4@metamask/eth-hd-keyring^13.0.0^14.1.1@metamask/eth-ledger-bridge-keyring^11.4.0^12.0.2@metamask/eth-money-keyring^2.0.0^2.0.4@metamask/eth-qr-keyring^1.1.0^2.0.2@metamask/eth-snap-keyring^20.0.0^22.0.1@metamask/hw-wallet-sdk^0.7.0^0.8.0@metamask/keyring-api^21.6.0^23.1.0@metamask/keyring-internal-api^10.0.0^11.0.1@metamask/keyring-sdk^1.1.0^2.0.2@metamask/keyring-snap-client^8.2.1^9.0.2Major bumps (
eth-hd-keyring,eth-ledger-bridge-keyring,eth-qr-keyring,eth-snap-keyring,keyring-api,keyring-internal-api,keyring-sdk,keyring-snap-client) have no source-code impact in this repo; verified viagit grepfor the moved/renamed*V2symbols (none used) andtsc.Core package bumps (from
@metamask/core@952.0.0)@metamask/accounts-controller^37.2.0^38.0.0@metamask/account-tree-controller^7.1.0^7.2.0@metamask/earn-controller^12.0.0^12.1.0@metamask/keyring-controller^25.2.0^25.4.0@metamask/money-account-controller^0.1.0^0.2.0@metamask/multichain-network-controller^3.0.5^3.1.0@metamask/multichain-transactions-controller^7.0.4^7.1.0@metamask/network-enablement-controller^4.2.0^5.1.0Added resolutions
"@metamask/messenger": "^1.1.0"— the new core packages compile against@metamask/messenger@^1.2.0, but mobile's source uses@metamask/messenger@^1.1.0. Without forcing a single version, TypeScript resolves controller messenger types from the nested 1.2.0 install while the local code uses helpers from 1.1.x — the twoMessengertypes are nominally distinct and theMessengerActions<...>/MessengerEvents<...>extractors returnnever, breaking ~70 messenger config files. The1.2.0changelog has no**BREAKING:**entries (additions:getAction,subscribeOnce,waitUntil); confirmed viagit grepthat none of the bumped packages use the 1.2.x-only methods at runtime."@metamask/keyring-internal-api": "^11.0.1"—assets-controllers@105.x,bridge-controller@71.x,multichain-account-service@8.0.1, etc. carry nestedkeyring-internal-api@10.1.1copies whoseInternalAccounttype union doesn't includestellar:account. Forcing 11.0.1 across the tree unifies the type and removes falsenot assignableerrors at the type boundaries.keyring-apiresolutions trimmedThe pre-existing
@metamask/keyring-api@npm:^X.Y.Z → 23.0.1mappings have been retargeted to23.1.0and pruned to the four still-active ones:^21.3.0,^21.4.0,^21.6.0,^22.0.0→23.1.0(each is triggered by at least one transitive consumer remaining in the tree;eth-hd-keyring@13.0.0,eth-snap-keyring@19.0.0/keyring-snap-sdk@7.2.0,multichain-account-service@8.0.1,keyring-internal-snap-client@9.0.x/keyring-snap-client@8.2.x).^21.5.0(no remaining consumer post-bump) and^23.0.1(redundant — caret-overlaps with^23.1.0and yarn dedupe handles it without forcing). Verified by removing each and confirming the lockfile still resolves to a singlekeyring-api@23.1.0.Integration changes
accounts-controller@38.0.0removedmetadata.snap.{enabled, name}(#8584)app/core/Engine/messengers/accounts-controller-messenger/index.ts— droppedSnapControllerStateChangeEventfrom the delegated events and the unused import; the newaccounts-controllerno longer accepts it.name/enabledfields):app/components/UI/Earn/hooks/useTronClaimUnstakedTrx.test.tsapp/components/hooks/useKeyringId.test.tsapp/core/Multichain/test/utils.test.tsapp/core/SnapKeyring/SnapKeyring.test.tsapp/util/address/index.test.tsapp/util/test/accountsControllerTestUtils.ts(3 sites)keyring-controller@25.3.0+widenedwithKeyringcallback signatureThe operation parameter is now
({ keyring, metadata }: KeyringEntry)withkeyring: EthKeyring, instead of being parametrized by theSelectedKeyringgeneric. The mobile-side wrapperswithLedgerKeyringandwithQrKeyringpreviously narrowed the keyring type via that generic.app/core/Ledger/Ledger.ts,app/core/QrKeyring/QrKeyring.ts— keep the external wrapper signatures ({ keyring: LedgerKeyring … }/{ keyring: QrKeyring … }) but narrow inside the inner callback via aninstanceof LedgerKeyring/instanceof QrKeyringruntime guard. This uses TypeScript's flow-based narrowing with noascast and an explicit error path that documents the invariant (the selector filters by keyring type, so the cast is sound).Changelog
CHANGELOG entry: null
Related issues
Fixes: N/A
Manual testing steps
N/A
Screenshots/Recordings
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
Upgrades multiple
@metamask/*controller/keyring dependencies and adjusts messenger/keyring integration points; while mostly type/test-driven, it touches hardware-wallet keyring access paths and messenger delegation typing.Overview
Aligns the app’s accounts/core dependency graph with newer
@metamask/*controller and keyring packages (plus updatedyarn.lock/resolutions) to eliminate version skew.Updates integration code to match the new APIs: removes the Snap controller state-change event from the AccountsController messenger delegation, and adds a type-erasing cast in
rewards-controller-messengerto avoid TypeScript union-complexity errors.Hardens
withLedgerKeyringandwithQrKeyringwrappers withinstanceofruntime guards (throwing when a wrong keyring is returned) and adjusts related hardware-wallet tests to use real keyring instances/spies and updated account/snap metadata shapes (removingmetadata.snap.name/enabledacross fixtures).Reviewed by Cursor Bugbot for commit 1bb588a. Bugbot is set up for automated code reviews on this repo. Configure here.