Skip to content

KeyringController should infer Keyring types based on builders #4366

Open

Description

@mikesposito

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>.

Activity

  1. mcmire commented on Jun 4, 2025

    @mcmire
    Collaborator

    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).

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions