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
5 changes: 5 additions & 0 deletions packages/keyring-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Add actions for `createNewVaultAndKeychain` and `createNewVaultAndRestore` ([#6928](https://github.com/MetaMask/core/pull/6928))
- These actions are meant to to be consumed by the `MultichainAccountService` in its `createMultichainAccountWallet` method.

### Changed

- Bump `@metamask/base-controller` from `^8.4.1` to `^8.4.2` ([#6917](https://github.com/MetaMask/core/pull/6917))
Expand Down
24 changes: 23 additions & 1 deletion packages/keyring-controller/src/KeyringController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,16 @@ export type KeyringControllerWithKeyringAction = {
handler: KeyringController['withKeyring'];
};

export type KeyringControllerCreateNewVaultAndKeychainAction = {
type: `${typeof name}:createNewVaultAndKeychain`;
handler: KeyringController['createNewVaultAndKeychain'];
};

export type KeyringControllerCreateNewVaultAndRestoreAction = {
type: `${typeof name}:createNewVaultAndRestore`;
handler: KeyringController['createNewVaultAndRestore'];
};

export type KeyringControllerAddNewKeyringAction = {
type: `${typeof name}:addNewKeyring`;
handler: KeyringController['addNewKeyring'];
Expand Down Expand Up @@ -226,7 +236,9 @@ export type KeyringControllerActions =
| KeyringControllerSignUserOperationAction
| KeyringControllerAddNewAccountAction
| KeyringControllerWithKeyringAction
| KeyringControllerAddNewKeyringAction;
| KeyringControllerAddNewKeyringAction
| KeyringControllerCreateNewVaultAndKeychainAction
| KeyringControllerCreateNewVaultAndRestoreAction;

export type KeyringControllerEvents =
| KeyringControllerStateChangeEvent
Expand Down Expand Up @@ -1780,6 +1792,16 @@ export class KeyringController extends BaseController<
`${name}:addNewKeyring`,
this.addNewKeyring.bind(this),
);

this.messagingSystem.registerActionHandler(
`${name}:createNewVaultAndKeychain`,
this.createNewVaultAndKeychain.bind(this),
);

this.messagingSystem.registerActionHandler(
`${name}:createNewVaultAndRestore`,
this.createNewVaultAndRestore.bind(this),
);
}

/**
Expand Down
Loading