Skip to content

Commit c9b2cc7

Browse files
authored
Parameterize NftController.addNft by networkClientId (#1698)
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.
1 parent 43296a8 commit c9b2cc7

File tree

4 files changed

+639
-244
lines changed

4 files changed

+639
-244
lines changed

0 commit comments

Comments
 (0)