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

detect account change in wallets that does not expose events (all non-nami wallets) #50

Open
GGAlanSmithee opened this issue Dec 13, 2022 · 2 comments
Assignees

Comments

@GGAlanSmithee
Copy link
Member

Right now it's hardcoded to nami, but we should probably use some feature detection instead

@GGAlanSmithee
Copy link
Member Author

This is not hardcoded any more, but discovered using feature detection with walletApi.experimental.on(...). However, it's a shame that most wallet providers does not implement this. I am planning to add a CIP for this.

@GGAlanSmithee GGAlanSmithee changed the title better detection for account and network change event support detect account change in wallets that does not expose events (all non-nami wallets) Dec 30, 2022
@GGAlanSmithee
Copy link
Member Author

We could implement this now, with some long polling kind of thing, ie.

If the wallet does not support events for changing account or network, we could emulate this with a setTimeout that periodically checks if the account or network has been changed. I am not super excited by this for two reasons; 1. the UX won't be great, and 2. it's just a waste from a resource / performance point of view. I really like how use-cardano works now with regards to not doing anything when you're not interacting with your wallet or the blockchain.

I might give this a try, just to see how it plays out, as an intermediare solution until (and if) I can get a CIP to pass.

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