Skip to content

Conversation

@amitabh94
Copy link
Contributor

Explanation

The mobile codebase currently relies on a patch (@metamask+assets-controllers+73.0.2.patch) to modify @metamask/assets-controllers and @metamask/preferences-controller. This patch introduces a new preference for displaying NFT media, removes OpenSea-specific API key handling, and adds a preference for safe chains list validation. The goal of this PR is to incorporate these changes directly into the core packages to eliminate the need for this mobile patch, simplifying maintenance and ensuring consistency across platforms.

This PR implements the following changes:

  • Renames openSeaEnabled to displayNftMedia: This change is applied across NftController (in @metamask/assets-controllers) and PreferencesController (in @metamask/preferences-controller), including state, methods, and tests. Backward compatibility for openSeaEnabled is maintained during the transition to prevent immediate breaking changes for consumers.
  • Removes OpenSea API key handling: The setApiKey method and openSeaApiKey state are removed from NftController.
  • Adds useSafeChainsListValidation: A new state property and its corresponding setter are introduced in PreferencesController.

The rename from openSeaEnabled to displayNftMedia is a semantic shift to broaden the scope beyond OpenSea and prepare for future NFT API integrations, decoupling the display logic from a specific provider. The removal of OpenSea API key functionality aligns with this broader strategy. Changes span assets-controllers and preferences-controller because NftController consumes preferences managed by PreferencesController.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Open in Cursor Open in Web

Co-authored-by: amitabh.aggarwal <amitabh.aggarwal@consensys.net>
@cursor
Copy link

cursor bot commented Aug 13, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

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

Successfully merging this pull request may close these issues.

4 participants