Skip to content

Incorrect typing expectation for .getEntries() method #127

@meeh0w

Description

@meeh0w

Hi 👋

As I'm implementing a custom storage implementation for our needs, I noticed that the typing expectations for getEntries() method feels off:

public getEntries<T = any>(): Promise<[string, T][]>;

This method is supposed to return all objects stored by WalletConnect libs, which of course means that they will differ in shape.
This means that we cannot pass a generic like so:

storage.getEntries<SomeType>();

and expect all of the entries returned to satisfy SomeType - some of them will contain session's data, while others will contain pairings, expirer metadata, etc.

I think this should be changed to:

public getEntries(): Promise<[string, unknown][]>;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions