MetaMask / MetaMask/core

watchAsset for NFT does not exist

Open
#1,193 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

team-assets
Dominant language
TypeScript
Stars
413
Forks
308
Avg merge
1d 4h
Merged PRs (30d)
253

Description

As NFTs are now globally available both in the mobile as well as the desktop extension, the watchAsset logic has now fallen out of date. The watchAsset function only binds to the tokensController for watchAsset and no such function exists in the NFTController.

https://github.com/MetaMask/core/blob/269f4af3450ea76b00f7b988237a21498a3ce53a/packages/assets-controllers/src/TokensController.ts#L643-L654

This does not check, nor have any validation logic, for ERC1155 or ERC721 assets.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with TokensController.ts at lines 643-654 and trace the existing watchAsset entry point, then inspect NFTController to confirm the missing path. Done means watchAsset handles NFT assets and includes validation logic for ERC1155 and ERC721 tokens.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.