Skip to content

refactor(multichain-account-service)!: move MultichainAccount{Wallet,Group} implementations#6216

Merged
ccharly merged 10 commits into
mainfrom
feat/move-multichain-account-impl
Jul 31, 2025
Merged

refactor(multichain-account-service)!: move MultichainAccount{Wallet,Group} implementations#6216
ccharly merged 10 commits into
mainfrom
feat/move-multichain-account-impl

Conversation

@ccharly

@ccharly ccharly commented Jul 30, 2025

Copy link
Copy Markdown
Contributor

Explanation

Moving the implementations out of @metamask/account-api to have them closer to the service (which makes more sense too).

Beware, MultichainAccount has been renamed to MultichainAccountGroup to emphasis more on the the "group" aspect of multichain accounts.

References

Changelog

N/A

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@ccharly ccharly self-assigned this Jul 30, 2025
@ccharly
ccharly force-pushed the feat/move-multichain-account-impl branch from f21eb46 to 05b4aa6 Compare July 30, 2025 21:31
@socket-security

socket-security Bot commented Jul 31, 2025

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​metamask/​account-api@​0.5.0 ⏵ 0.6.09610071 -296 +2100

View full report

@ccharly
ccharly marked this pull request as ready for review July 31, 2025 11:13
@ccharly
ccharly requested review from a team as code owners July 31, 2025 11:13

@fabiobozzo fabiobozzo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@ccharly
ccharly enabled auto-merge (squash) July 31, 2025 12:29
entropySource: EntropySourceId,
): MultichainAccountWalletId {
return `${AccountWalletType.Entropy}:${entropySource}`;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Inconsistent Function Import Causes Divergent Behavior

The toMultichainAccountWalletId function is redefined locally in MultichainAccountWallet.ts but is also imported from @metamask/account-api in other files (e.g., MultichainAccountService.ts, AccountTreeController.test.ts, MultichainAccountWallet.test.ts). This import inconsistency can lead to different implementations being used across the codebase, potentially causing divergent behavior and runtime issues. As part of the refactoring, all consumers should import toMultichainAccountWalletId from the local MultichainAccountWallet module.

Locations (2)
Fix in Cursor Fix in Web

@ccharly
ccharly merged commit 1a9757a into main Jul 31, 2025
219 checks passed
@ccharly
ccharly deleted the feat/move-multichain-account-impl branch July 31, 2025 12:37
ccharly added a commit that referenced this pull request Jul 31, 2025
…ultichainAccountWalletId` (#6219)

## Explanation

Just an oversight of this PR ([found by
Cursor](#6216 (comment))):
- #6216

## References

N/A

## Changelog

N/A

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants