Skip to content

Commit

Permalink
feat: remove nft detection polling (#4281)
Browse files Browse the repository at this point in the history
## Explanation

This PR removes polling logic from NftDetectionController.
Calling detectNfts function will be tied to UI components instead of
preference change events.
NftDetectionController will now extend `BaseController` instead of
`StaticIntervalPollingController`.

The detectNfts logic has also changed to call the NFT-API and save the
nfts in state as soon as they are available instead of waiting to fetch
all the user NFTs before saving to state.


## References


* Related to
[67890](MetaMask/metamask-extension#24547)


## Changelog

<!--
If you're making any consumer-facing changes, list those changes here as
if you were updating a changelog, using the template below as a guide.

(CATEGORY is one of BREAKING, ADDED, CHANGED, DEPRECATED, REMOVED, or
FIXED. For security-related issues, follow the Security Advisory
process.)

Please take care to name the exact pieces of the API you've added or
changed (e.g. types, interfaces, functions, or methods).

If there are any breaking changes, make sure to offer a solution for
consumers to follow once they upgrade to the changes.

Finally, if you're only making changes to development scripts or tests,
you may replace the template below with "None".
-->

### `@metamask/assets-controllers`

- **BREAKING**: Changed NftDetectionController to extend
`BaseController`.
- **REMOVED**: Removed `interval` from contructor in
`NftDetectionController`.


## 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 highlighted breaking changes using the "BREAKING" category
above as appropriate
  • Loading branch information
sahar-fehri authored Jun 12, 2024
1 parent 0f2a743 commit 2763df6
Show file tree
Hide file tree
Showing 2 changed files with 240 additions and 457 deletions.
Loading

0 comments on commit 2763df6

Please sign in to comment.