Skip to content

feat(multichain-account-service): add deleteAccount to providers#8960

Open
hmalik88 wants to merge 27 commits into
mainfrom
hm/mul-1800
Open

feat(multichain-account-service): add deleteAccount to providers#8960
hmalik88 wants to merge 27 commits into
mainfrom
hm/mul-1800

Conversation

@hmalik88
Copy link
Copy Markdown
Contributor

@hmalik88 hmalik88 commented Jun 1, 2026

Explanation

The removeMultichainAccountWallet method was updated to properly delete all associated accounts with a wallet. The deleteAccount method was added to the providers to facilitate this.

References

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
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

High Risk
Breaking messenger API plus multi-provider account deletion and keyring/snap removal paths are security- and data-sensitive; partial failures are swallowed while the wallet is still removed from service state.

Overview
Adds deleteAccount(id) to the Bip44AccountProvider contract and wires it through EVM (v2 HD keyring.deleteAccount), snap providers (SnapKeyring.removeAccount), and AccountProviderWrapper (always forwards, including when disabled). AccountProviderWrapper also gains unwrap() so wallet removal can list underlying snap accounts when basic functionality is off.

BREAKING: removeMultichainAccountWallet / MultichainAccountService:removeMultichainAccountWallet now take only entropySource (the accountAddress argument is removed). Removal walks every provider, deletes all accounts for that wallet via deleteAccount, uses unwrap() for enumeration when wrappers are disabled, reports one aggregated captureException on partial failure, and still drops the wallet from the service map. Changelog and tests cover multi-provider cleanup, disabled-wrapper behavior, and error aggregation.

Reviewed by Cursor Bugbot for commit c34218a. Bugbot is set up for automated code reviews on this repo. Configure here.

@hmalik88 hmalik88 marked this pull request as ready for review June 1, 2026 19:29
@hmalik88 hmalik88 requested review from a team as code owners June 1, 2026 19:29
@hmalik88 hmalik88 temporarily deployed to default-branch June 1, 2026 19:29 — with GitHub Actions Inactive
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.ts Outdated
Comment thread packages/multichain-account-service/src/MultichainAccountService.test.ts Outdated
@hmalik88 hmalik88 requested a review from ccharly June 4, 2026 14:39
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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 5fc8a32. Configure here.

Comment thread packages/multichain-account-service/src/MultichainAccountService.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants