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

Add tokens to MetaMask using wallet watchAsset bug #157

Open
zhaonancy opened this issue Apr 22, 2022 · 1 comment
Open

Add tokens to MetaMask using wallet watchAsset bug #157

zhaonancy opened this issue Apr 22, 2022 · 1 comment
Assignees
Labels
Applications bug Something isn't working Priority: P1

Comments

@zhaonancy
Copy link
Contributor

MetaMask didn't add cUSD, cEUR, cREAL automatically when switching to a new network. Found when investigating #146

When calling addTokensToMetamask which uses wallet_watchAsset (https://github.com/celo-org/use-contractkit/blob/master/packages/use-contractkit/src/utils/metamask.ts#L137), a popup prompts the user separately for each token every time, even if the token has already been added.

The wallet_watchAsset request return type is documented as a boolean for if the token is added, but actually returns an object immediately with status as pending, found when @nicolasbrugneaux and I tried storing the boolean in local storage to know whether to call addTokensToMetamask in order to avoid the recurring popup.

Previous MetaMask Integration PR: #80

Docs for wallet_watchAsset:

MetaMask Issues related to wallet_watchAsset (not working in Firefox, immediate return in Chrome):

@aaronmgdr aaronmgdr added bug Something isn't working Priority: P1 labels May 11, 2022
@dckesler dckesler added the v4 Scheduled to be included in v4 release label May 11, 2022
@nicolasbrugneaux
Copy link
Contributor

With @zhaonancy we double checked the state of that issue. Metamask has the fixed merged in, and released a build with it. We tried it and it seems to fix our issues.

However tha specifc fix isn't part of released extension on the chrome/firefox store yet.
PR in question: MetaMask/metamask-extension#14545

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Applications bug Something isn't working Priority: P1
Projects
None yet
Development

No branches or pull requests

4 participants