-
-
Notifications
You must be signed in to change notification settings - Fork 205
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
Redesign Keyring Controller API #431
Comments
I'm not sure where I land yet on all of these questions. I have a draft answer for the first one though:
|
I've begun work to prepare for the new proposed Keyring APIs. It would have been challenging to move directly from what we have now to the new API because we've fallen behind in maintaining these repos and their dependencies. At the moment they're using JavaScript, they're full of inconsistencies and extra non-standard functions, they have outdated dependencies, they don't follow our standard lint rules, etc. So I'll be making an effort to clean them up and migrate them to TypeScript first. This will make more clear what their existing APIs are, so the proposed changes will be easier to understand, review, and implement. I've added a rough checklist of the work involved to the issue description. |
This may already be covered by the above, but linking this issue in case it gives us ideas: #35 |
The scope of this issue was too broad. I split out the identity state management to a separate issue, as well as the consolidation of keyring code between extension and mobile. |
Closing this in favour of the Keyring Controller API proposal from the accounts team: https://www.notion.so/metamask-consensys/KeyringController-API-b28018e6611940d5a57d5c5a0226902c |
The keyring controller API is confusing and difficult to extend.
Today we have two "keyring controllers". The first is the original one,
eth-keyring-controller
, which is used by both projects. The second is@metamask/keyring-controller
, which is used by mobile as a wrapper aroundeth-keyring-controller
.@metamask/keyring-controller
mainly serves to coordinate changes betweeneth-keyring-controller
and other controllers. It also handles some keyring-interaction related tasks that aren't handled byeth-keyring-controller
, such as input parsing for imported accounts.metamask-controller.js
. This collection of functions serves the same purpose that@metamask/keyring-controller
does for mobile.My questions are:
eth-keyring-controller
) responsible for exactly? Why are some keyring methods called through the KeyringController, while others are called directly on keyrings?The outcome of this task should be a proposal in Notion.
Related issues:
Edit: Work towards this has begun, but there is a bunch of preparation required first. Here's a rough checklist of the work involved:
Keyring
interface that matches existing APIs as closely as possibletypes
repo and all necessary basic typesKeyring
types utils#74)@metamask
scope eth-trezor-keyring#158)The text was updated successfully, but these errors were encountered: