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

### Added

- Expose `KeyringController:isUnlocked` method through `KeyringController` messenger ([#8573](https://github.com/MetaMask/core/pull/8573))
- Returns `true` when the vault is unlocked, `false` otherwise. Mirrors `state.isUnlocked` and the `isUnlocked()` instance method, allowing consumers to check lock status via the messenger without holding a controller reference.
- Add `withController` action to run atomic operations on multiple keyrings (within a single transaction) ([#8416](https://github.com/MetaMask/core/pull/8416))
- This action uses a `RestrictedController` object that exposes `addNewKeyring` and `removeKeyring` methods to add and remove keyring during the transaction (atomic) call.
- Expose `KeyringController:signTransaction` method through `KeyringController` messenger ([#8408](https://github.com/MetaMask/core/pull/8408))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ export type KeyringControllerAddNewKeyringAction = {
handler: KeyringController['addNewKeyring'];
};

/**
* Returns the status of the vault.
*
* @returns Boolean returning true if the vault is unlocked.
*/
export type KeyringControllerIsUnlockedAction = {
type: `KeyringController:isUnlocked`;
handler: KeyringController['isUnlocked'];
};

/**
* Returns the public addresses of all accounts from every keyring.
*
Expand Down Expand Up @@ -401,6 +411,7 @@ export type KeyringControllerMethodActions =
| KeyringControllerCreateNewVaultAndRestoreAction
| KeyringControllerCreateNewVaultAndKeychainAction
| KeyringControllerAddNewKeyringAction
| KeyringControllerIsUnlockedAction
| KeyringControllerGetAccountsAction
| KeyringControllerGetEncryptionPublicKeyAction
| KeyringControllerDecryptMessageAction
Expand Down
1 change: 1 addition & 0 deletions packages/keyring-controller/src/KeyringController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const MESSENGER_EXPOSED_METHODS = [
'createNewVaultAndKeychain',
'createNewVaultAndRestore',
'removeAccount',
'isUnlocked',
] as const;

/**
Expand Down
1 change: 1 addition & 0 deletions packages/keyring-controller/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export type {
KeyringControllerCreateNewVaultAndRestoreAction,
KeyringControllerCreateNewVaultAndKeychainAction,
KeyringControllerAddNewKeyringAction,
KeyringControllerIsUnlockedAction,
KeyringControllerGetAccountsAction,
KeyringControllerGetEncryptionPublicKeyAction,
KeyringControllerDecryptMessageAction,
Expand Down
Loading