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

Incorrect typing expectation for .getEntries() method #127

Open
meeh0w opened this issue Jul 26, 2023 · 0 comments
Open

Incorrect typing expectation for .getEntries() method #127

meeh0w opened this issue Jul 26, 2023 · 0 comments

Comments

@meeh0w
Copy link

meeh0w commented Jul 26, 2023

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][]>;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant