Skip to content

Commit

Permalink
Add optional networkClientId and userAddress args to remaining `N…
Browse files Browse the repository at this point in the history
…ftController` public methods (#2006)

## `@metamask/assets-controllers`
### Changed:
- `watchNft`, `removeNft`, `removeAndIgnoreNft`, `removeNftContract`,
`updateNftFavoriteStatus`, and `checkAndUpdateAllNftsOwnershipStatus`
methods on `NftController` all now accept an optional options object
argument containing `networkClientId` and `userAddress` to identify
where in state to mutate.
- **BREAKING**: `addNft` no longer accepts a `chainId` property in its
options argument since this value can be retrieved by the
`networkClientId` property and is therefore redundant.
- **BREAKING**: The third and fourth arguments on NftController's
`addNftVerifyOwnership` method, have been replaced with an options
object containing optional properties `networkClientId`, `userAddress`
and `source`. This method signature is more aligned with the options
pattern for passing `networkClientId` and `userAddress` on this
controller and elsewhere.
- **BREAKING**: `checkAndUpdateSingleNftOwnershipStatus` on
NftController no longer accepts a `chainId` in its options argument.
This is replaced with an optional `networkClientId` property which can
be used to fetch chainId.
***BREAKING**: The fourth argument of the `isNftOwner` method on
`NftController` is now an options object with an optional
`networkClientId` property. This method signature is more aligned with
the options pattern for passing `networkClientId` on this controller and
elsewhere.
- **BREAKING**: `validateWatchNft` method on `NftController` is now
private.
- **BREAKING**: `detectNfts` on `NftDetectionController` now accepts a
single object argument with optional properties `networkClientId` and
`userAddress`, rather than taking these as two sequential arguments.
  • Loading branch information
adonesky1 authored Nov 14, 2023
1 parent 1f54e87 commit 2938d37
Show file tree
Hide file tree
Showing 5 changed files with 835 additions and 254 deletions.
6 changes: 3 additions & 3 deletions packages/assets-controllers/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ module.exports = merge(baseConfig, {
// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 87.77,
branches: 88.2,
functions: 96.15,
lines: 95.28,
statements: 95.4,
lines: 96.25,
statements: 96.5,
},
},

Expand Down
Loading

0 comments on commit 2938d37

Please sign in to comment.