Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3216f7a
feat: add deleteAccount
hmalik88 Jun 1, 2026
0af192b
test: update tests
hmalik88 Jun 1, 2026
851abd3
chore: regenerate action types
hmalik88 Jun 1, 2026
06b34a7
chore: add changelog entry
hmalik88 Jun 1, 2026
3b82ce5
chore: add pr number
hmalik88 Jun 1, 2026
d951e21
Merge remote-tracking branch 'origin/main' into hm/mul-1800
hmalik88 Jun 1, 2026
7175953
refactor: use provider list as source of truth
hmalik88 Jun 1, 2026
18f418d
fix: regenerate action types
hmalik88 Jun 1, 2026
02a10e9
Merge remote-tracking branch 'origin/main' into hm/mul-1800
hmalik88 Jun 1, 2026
7ca5242
fix: changelog
hmalik88 Jun 1, 2026
7162485
Merge remote-tracking branch 'origin/main' into hm/mul-1800
hmalik88 Jun 1, 2026
3b9422d
fix: cover disabled provider edge case
hmalik88 Jun 1, 2026
008d936
chore: update changelog
hmalik88 Jun 2, 2026
065838b
refactor: dry some repeated patterns
hmalik88 Jun 2, 2026
2c4bd02
Merge remote-tracking branch 'origin/main' into hm/mul-1800
hmalik88 Jun 2, 2026
38257bf
fix: lint
hmalik88 Jun 2, 2026
d01550f
chore: regenerate action method types
hmalik88 Jun 2, 2026
9155ef7
Merge remote-tracking branch 'origin/main' into hm/mul-1800
hmalik88 Jun 4, 2026
2b4271c
refactor: remove optional chaining
hmalik88 Jun 4, 2026
3f52fad
refactor: rename method to unwrap
hmalik88 Jun 4, 2026
4634931
refactor: reuse type
hmalik88 Jun 4, 2026
3140e76
fix: update error type
hmalik88 Jun 4, 2026
16424b4
refactor: remove some extra props
hmalik88 Jun 4, 2026
7d55e59
Merge remote-tracking branch 'origin/main' into hm/mul-1800
hmalik88 Jun 4, 2026
5fc8a32
test: update tests
hmalik88 Jun 4, 2026
fe10e4c
refactor: address bugbot comment
hmalik88 Jun 4, 2026
c34218a
fix: regenerate method action types
hmalik88 Jun 4, 2026
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
15 changes: 15 additions & 0 deletions packages/multichain-account-service/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Added `deleteAccount(id)` to the `Bip44AccountProvider` interface and to all built-in providers (`EvmAccountProvider`, `SolAccountProvider`, `BtcAccountProvider`, `TrxAccountProvider`, and the shared `SnapAccountProvider`/`AccountProviderWrapper`) ([#8960](https://github.com/MetaMask/core/pull/8960))
- `EvmAccountProvider.deleteAccount(id)` resolves the account's entropy source and forwards to the v2 HD keyring's `deleteAccount(accountId)`. When this drains the last account on a non-primary HD keyring, the keyring controller automatically prunes the empty keyring.
- `SnapAccountProvider.deleteAccount(id)` resolves the account's address and forwards to the legacy `SnapKeyring.removeAccount(address)` so that the snap and the host keyring stay in sync.
- `AccountProviderWrapper.deleteAccount(id)` forwards unconditionally so that wallet-removal flows can clean up snap-backed accounts even when the wrapper has been disabled.
- Added a public `unwrap` method on `AccountProviderWrapper`. This is an escape hatch for cleanup flows (e.g. wallet removal) that need to enumerate the underlying provider's accounts regardless of enabled state, since `getAccounts()` still returns `[]` when the wrapper is disabled.

### Changed

- **BREAKING:** `MultichainAccountService.removeMultichainAccountWallet` (and the corresponding `MultichainAccountService:removeMultichainAccountWallet` messenger action) now takes a single `entropySource` argument; the previous `accountAddress` parameter has been removed ([#8960](https://github.com/MetaMask/core/pull/8960))
- The method now iterates every account belonging to the wallet and dispatches `provider.deleteAccount(account.id)` to the matching provider, instead of only removing a single EVM address.
- For wrapped providers, enumeration uses the underlying provider so snap-backed accounts are still deleted when basic functionality is off (the wrapper's `getAccounts()` returns `[]` when disabled). Without this, snap-backed accounts would be orphaned in their underlying keyrings.
- Per-account deletions are best-effort: a single account's failure does not abort cleanup of the remaining accounts. If one or more deletions fail, a single aggregated error is reported via the messenger's `captureException` with the per-account failure details (`provider`, `accountId`, error message, stack) in its `context`. The wallet is always removed from the service's internal map at the end.

## [10.0.2]

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,19 @@ export type MultichainAccountServiceCreateMultichainAccountWalletAction = {
};

/**
* Removes a multichain account wallet.
* Removes a multichain account wallet, deleting all of its accounts across
* every registered provider (EVM and snap-based).
*
* NOTE: This method should only be called in client code as a revert mechanism.
* At the point that this code is called, discovery shouldn't have been triggered.
* This is meant to be used in the scenario where a seed phrase backup is not successful.
* The deletion iterates providers (the source of truth for their own
* account lists) and filters each provider's accounts to those matching
* the wallet's entropy source. Cleanup is best-effort end-to-end: neither
* a single account deletion failure nor a failure to enumerate a given
* provider's accounts aborts cleanup of the remaining providers. If one or
* more operations fail, a single aggregated error is reported via
* `reportError` with all per-failure details in its context. The wallet is
* always removed from the service's internal map at the end.
*
* @param entropySource - The entropy source of the multichain account wallet.
* @param accountAddress - The address of the account to remove.
* @returns The removed multichain account wallet.
*/
export type MultichainAccountServiceRemoveMultichainAccountWalletAction = {
type: `MultichainAccountService:removeMultichainAccountWallet`;
Expand Down
Loading
Loading