Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

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 moved this to Todo in react-celo 4.1 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

@aaronmgdr aaronmgdr moved this from Todo to In Progress in react-celo 4.1 May 13, 2022
@aaronmgdr aaronmgdr removed the v4 Scheduled to be included in v4 release label May 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Applications bug Something isn't working Priority: P1
Projects
None yet
Development

No branches or pull requests

4 participants