Skip to content
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

Open
mikesposito opened this issue Jan 15, 2025 · 1 comment
Open

Remove KeyringController methods that are not keyring-agnostic #5153

mikesposito opened this issue Jan 15, 2025 · 1 comment

Comments

@mikesposito
Copy link
Member

mikesposito commented Jan 15, 2025

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 main HDKeyring
  • addNewAccountForKeyring as it is not compatible with all keyrings, and does not guarantee that the keyring passed is even managed by KeyringController
  • importAccountWithStrategy as it is only applicable to SimpleKeyring
    • Private keys (or JSON containing keys, depending on the strategy) could also be passed directly to SimpleKeyring builder options, with some adjustments to how the SimpleKeyring class handles initialization params
  • exportSeedPhrase as it is only applicable to HDKeyring
  • exportAccount as it is only compatible with HDKeyring and SimpleKeyring
  • getQRKeyring as it is a QR-specific method
  • getOrAddQRKeyring
  • restoreQRKeyring
  • resetQRKeyringState
  • getQRKeyringState
  • submitQR*
  • cancelQR*
  • connectQRHardware
  • unlockQRHardwareWalletAccount
  • forgetQRDevice
@desi
Copy link
Contributor

desi commented Jan 20, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants