Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes: MetaMask/MetaMask-planning#1022 # Changelog ## @metamask/assets-controllers - **BREAKING:** `NFTController` now expects `getNetworkClientById` in constructor options - **BREAKING:** `NftController. addNft()` function signature has changed: - Previously ``` address: string, tokenId: string, nftMetadata?: NftMetadata, accountParams?: { userAddress: string; chainId: Hex; }, source = Source.Custom, ``` now: ``` tokenAddress: string, tokenId: string, { nftMetadata?: NftMetadata; chainId?: Hex; // extracts from AccountParams userAddress?: string // extracted from AccountParams source?: Source; networkClientId?: NetworkClientId; // new }, ``` - CHANGED: `NftController.addNftVerifyOwnership`: now accepts optional `networkClientId` which is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state. - CHANGED: `NftController.isNftOwner`: now accepts optional `networkClientId` which is used to instantiate the provider for the correct chain and call the NFT contract to verify ownership. - CHANGED: `NftController. addNft()` will use the chainId value derived from `networkClientId` if provided - CHANGED: `NftController. watchNft()` options now accepts optional `networkClientId` which is used to fetch NFT metadata and determine by which chainId the added NFT should be stored in state.
- Loading branch information