Commit 2c255a6
authored
feat: add
## Explanation
This is needed to handle keyring controller locked scenarios when
account creation is mid-flight in the multichain account service.
Alternative was to do `KeyringController:getState`, but I'd rather not
pull in the whole state to do a boolean check.
## References
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
- [x] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/processes/updating-changelogs.md)
- [x] I've introduced [breaking
changes](https://github.com/MetaMask/core/tree/main/docs/processes/breaking-changes.md)
in this PR and have prepared draft pull requests for clients and
consumer packages to resolve them
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Low risk: adds a new read-only messenger action that returns the
existing `state.isUnlocked` boolean, with no changes to unlock/lock
behavior or vault persistence.
>
> **Overview**
> Adds a new `KeyringController:isUnlocked` messenger action so
consumers can query vault lock status without fetching full controller
state or holding a controller reference.
>
> This updates the allowed action types/exports and exposes `isUnlocked`
via `MESSENGER_EXPOSED_METHODS`, with a changelog entry documenting the
new capability.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
83fffcb. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->isUnlocked action (MetaMask#8573)1 parent 5a3fa25 commit 2c255a6
4 files changed
Lines changed: 15 additions & 0 deletions
File tree
- packages/keyring-controller
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| |||
401 | 411 | | |
402 | 412 | | |
403 | 413 | | |
| 414 | + | |
404 | 415 | | |
405 | 416 | | |
406 | 417 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
79 | 80 | | |
80 | 81 | | |
81 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
0 commit comments