You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
KeyringController should infer Keyring types based on builders #4366
Since types of keyrings managed by KeyringController depend on builders injected by clients, their types should be inferred by KeyringController based on those.
Builders should return an object that extends Keyring<Json>.
Currently when the client uses a keyring, the type of that keyring is unknown (and must be typecast).
The keyring controller should be able to infer the correct type. We may be able to use the same technique that we use for Messenger.publish and Messenger.call, where the type of the parameters/handler is inferred based on the name of the action or event.
The main challenge for this ticket is working out the implementation (need to play around with TypeScript) and also going through and removing all of the existing typecasts for keyrings (at least when it comes to retrieving a particular keyring from the client perspective).
Activity
mcmire commentedon Jun 4, 2025
Currently when the client uses a keyring, the type of that keyring is
unknown(and must be typecast).The keyring controller should be able to infer the correct type. We may be able to use the same technique that we use for
Messenger.publishandMessenger.call, where the type of the parameters/handler is inferred based on the name of the action or event.The main challenge for this ticket is working out the implementation (need to play around with TypeScript) and also going through and removing all of the existing typecasts for keyrings (at least when it comes to retrieving a particular keyring from the client perspective).