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

CIP-0030 normalize wallet names #404

Open
GGAlanSmithee opened this issue Dec 4, 2022 · 2 comments
Open

CIP-0030 normalize wallet names #404

GGAlanSmithee opened this issue Dec 4, 2022 · 2 comments

Comments

@GGAlanSmithee
Copy link

Creating an issue with the intent to create a CIP unless there is some obvious reason not to.

See the image below; the window.cardano[name] and window.cardano.[name].name can differ in case (and perhaps in other ways as well). This makes it unnecessarily hard to dynamically iterate available wallets, with the intent to window.cardano[key].enable() it.

I suggest to normalize the names to always be lowercase, and fully match the key they are registered under. If needed, we could instead add an additional property, key which must match the corresponding key in window.cardano.

The point against this is that this can be derrived by the key itself, but this just adds more complexity where it does not need to be.

CC @alessandrokonrad

image

@GGAlanSmithee
Copy link
Author

to elaborate on my own counter-point why this might not be needed, it can easily be achieved in user-land, like here
https://github.com/GGAlanSmithee/use-cardano/blob/main/src/hooks/use-wallet-providers.tsx#L29:

const providers = Object.keys(window.cardano)
  .map((key) => ({
    key,
    ...window.cardano[key],
  }))
 .filter(filterAvailableProviders)

@rphair
Copy link
Collaborator

rphair commented Jan 20, 2023

@GGAlanSmithee referencing #446 since it looks like there is some improvement being made in this area.

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

2 participants