-
-
Notifications
You must be signed in to change notification settings - Fork 214
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
Remove KeyringController
methods that are not keyring-agnostic
#5153
Comments
Before finalizing the methods we want to nuke, meet with @danroc to make sure we have a more complete list. We may need another issue for making Keyring API changes. |
@mikesposito Will there be some kind of "drop-in" replacement for We @MetaMask/identity solely rely on this method for account syncing, and while the derivation path approach will tremendously help us when it's implemented in the future, we still need to maintain backwards compatibility until all users have their derivation paths uploaded to user storage. PS: just flagging this as non-trivial and a hard dependency because it would be a breaking change for account syncing |
@mathieuartu the method will be removed from KeyringController as it can be used only for the HDKeyring. Though, accounts on HD and other keyrings can still be added this way: const numberOfAccountsToAdd = 1;
const newAccounts = await keyringController.withKeyring(
{ type: 'HD Key Tree' },
async (keyring) => keyring.addAccounts(numberOfAccountsToAdd),
); |
@mathieuartu I believe you could also leverage the I haven't tested it, but something like this could work: this.#messenger.subscribe('AccountsController:accountAdded', (account) => {
if (account.metadata.keyring.type === KeyringTypes.HD) {
// Track new HD account.
...
}
}); Unless there was a specific reason to rely on the new EDIT:
|
KeyringController
currently provides some methods specific to certain types of keyrings (that is, certain Keyring classes). Though, KeyringController should be managing all keyrings in the same way, and its API should provide access to keyrings in a generic manner, agnostic to the specific keyring type the consumer wants to interact with.This should include removing all methods related to the QR keyring, as well as all other methods which are not applicable to the generic Keyring type, like:
addNewAccount
as it is a specific method for the mainHDKeyring
addNewAccountForKeyring
as it is not compatible with all keyrings, and does not guarantee that the keyring passed is even managed byKeyringController
importAccountWithStrategy
as it is only applicable toSimpleKeyring
SimpleKeyring
builder options, with some adjustments to how theSimpleKeyring
class handles initialization paramsexportSeedPhrase
as it is only applicable toHDKeyring
exportAccount
as it is only compatible withHDKeyring
andSimpleKeyring
getQRKeyring
as it is a QR-specific methodgetOrAddQRKeyring
restoreQRKeyring
resetQRKeyringState
getQRKeyringState
submitQR*
cancelQR*
connectQRHardware
unlockQRHardwareWalletAccount
forgetQRDevice
The text was updated successfully, but these errors were encountered: