-
-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: add SnapKeyring.createAccount
+ internal options
#252
Conversation
179b52b
to
a0e42f8
Compare
@metamaskbot publish-preview |
a0e42f8
to
a4296e9
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions (from the Expand for full list of packages and versions.
|
a4296e9
to
1ddff34
Compare
@metamaskbot publish-preview |
Preview builds have been published. See these instructions (from the Expand for full list of packages and versions.
|
SnapKeyring.createAccount
+ internal options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review session with @danroc
@metamaskbot publish-preview |
Preview builds have been published. See these instructions (from the Expand for full list of packages and versions.
|
Co-authored-by: Daniel Rocha <68558152+danroc@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Introducing a new way of handling internal options (
display*
flags) that were used to configure the account creation flow.Initially those flags were being sent by the Snap (only interpreted for preinstalled Snaps) itself to allow to skip some specific steps of the flow (e.g display the account name input OR display the confirmation about the account creation action).
The main problem with the previous approach is that the caller (MetaMask here) of
keyring_createAccount
cannot skip those steps programmatically. It's up to the Snap to the Snap to emit the right flags with the correct values during the flow.With the new approach, we "hide" those flags behind a context that is owned by the Snap keyring. In addition to that, we've added a new
SnapKeyring.createAccount
method that allows the caller (MetaMask here, again) to enable those flags if needed.This way, we can configure the flow to behave differently:
Caution
The current flow will still select the newly created account at the end of the flow, but with this new approach we could easily extend our "internal options" and skip that step too, like