@metamask-previews/assets-controllers 65.0.0-preview-88a682b → 65.0.0-preview-e5f15167
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/AccountTrackerController.d.cts +2 -2
- package/dist/AccountTrackerController.d.mts +2 -2
- package/dist/CurrencyRateController.d.cts +2 -2
- package/dist/CurrencyRateController.d.mts +2 -2
- package/dist/DeFiPositionsController/DeFiPositionsController.d.cts +2 -2
- package/dist/DeFiPositionsController/DeFiPositionsController.d.mts +2 -2
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.cts +2 -2
- package/dist/MultichainAssetsRatesController/MultichainAssetsRatesController.d.mts +2 -2
- package/dist/NftController.cjs +207 -93
- package/dist/NftController.cjs.map +1 -1
- package/dist/NftController.d.cts +34 -41
- package/dist/NftController.d.cts.map +1 -1
- package/dist/NftController.d.mts +34 -41
- package/dist/NftController.d.mts.map +1 -1
- package/dist/NftController.mjs +208 -94
- package/dist/NftController.mjs.map +1 -1
- package/dist/NftDetectionController.cjs +2 -2
- package/dist/NftDetectionController.cjs.map +1 -1
- package/dist/NftDetectionController.d.cts +2 -1
- package/dist/NftDetectionController.d.cts.map +1 -1
- package/dist/NftDetectionController.d.mts +2 -1
- package/dist/NftDetectionController.d.mts.map +1 -1
- package/dist/NftDetectionController.mjs +2 -2
- package/dist/NftDetectionController.mjs.map +1 -1
- package/dist/TokenBalancesController.d.cts +2 -2
- package/dist/TokenBalancesController.d.mts +2 -2
- package/dist/TokenDetectionController.d.cts +2 -2
- package/dist/TokenDetectionController.d.mts +2 -2
- package/dist/TokenListController.d.cts +2 -2
- package/dist/TokenListController.d.mts +2 -2
- package/dist/TokenRatesController.d.cts +2 -2
- package/dist/TokenRatesController.d.mts +2 -2
- package/package.json +3 -1
package/dist/NftController.d.cts
CHANGED
@@ -2,13 +2,15 @@ import type { AccountsControllerSelectedEvmAccountChangeEvent, AccountsControlle
|
|
2
2
|
import type { AddApprovalRequest } from "@metamask/approval-controller";
|
3
3
|
import type { RestrictedMessenger, ControllerStateChangeEvent } from "@metamask/base-controller";
|
4
4
|
import { BaseController, type ControllerGetStateAction } from "@metamask/base-controller";
|
5
|
-
import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction
|
5
|
+
import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
6
|
+
import type { BulkPhishingDetectionScanResponse } from "@metamask/phishing-controller";
|
6
7
|
import type { PreferencesControllerStateChangeEvent } from "@metamask/preferences-controller";
|
7
8
|
import type { Hex } from "@metamask/utils";
|
8
9
|
import type { AssetsContractControllerGetERC1155BalanceOfAction, AssetsContractControllerGetERC1155TokenURIAction, AssetsContractControllerGetERC721AssetNameAction, AssetsContractControllerGetERC721AssetSymbolAction, AssetsContractControllerGetERC721OwnerOfAction, AssetsContractControllerGetERC721TokenURIAction } from "./AssetsContractController.cjs";
|
9
10
|
import { Source } from "./constants.cjs";
|
10
11
|
import type { Collection, Attributes, LastSale, TopBid } from "./NftDetectionController.cjs";
|
11
|
-
type
|
12
|
+
import type { NetworkControllerFindNetworkClientIdByChainIdAction } from "../../network-controller/src/NetworkController.cjs";
|
13
|
+
export type NFTStandardType = 'ERC721' | 'ERC1155';
|
12
14
|
type SuggestedNftMeta = {
|
13
15
|
asset: {
|
14
16
|
address: string;
|
@@ -147,11 +149,18 @@ type NftAsset = {
|
|
147
149
|
declare const controllerName = "NftController";
|
148
150
|
export type NftControllerGetStateAction = ControllerGetStateAction<typeof controllerName, NftControllerState>;
|
149
151
|
export type NftControllerActions = NftControllerGetStateAction;
|
152
|
+
/**
|
153
|
+
* Action type for bulk scanning URLs with PhishingController
|
154
|
+
*/
|
155
|
+
export type PhishingControllerBulkScanUrlsAction = {
|
156
|
+
type: 'PhishingController:bulkScanUrls';
|
157
|
+
handler: (urls: string[]) => Promise<BulkPhishingDetectionScanResponse>;
|
158
|
+
};
|
150
159
|
/**
|
151
160
|
* The external actions available to the {@link NftController}.
|
152
161
|
*/
|
153
|
-
export type AllowedActions = AddApprovalRequest | AccountsControllerGetAccountAction | AccountsControllerGetSelectedAccountAction | NetworkControllerGetNetworkClientByIdAction | AssetsContractControllerGetERC721AssetNameAction | AssetsContractControllerGetERC721AssetSymbolAction | AssetsContractControllerGetERC721TokenURIAction | AssetsContractControllerGetERC721OwnerOfAction | AssetsContractControllerGetERC1155BalanceOfAction | AssetsContractControllerGetERC1155TokenURIAction;
|
154
|
-
export type AllowedEvents = PreferencesControllerStateChangeEvent |
|
162
|
+
export type AllowedActions = AddApprovalRequest | AccountsControllerGetAccountAction | AccountsControllerGetSelectedAccountAction | NetworkControllerGetNetworkClientByIdAction | AssetsContractControllerGetERC721AssetNameAction | AssetsContractControllerGetERC721AssetSymbolAction | AssetsContractControllerGetERC721TokenURIAction | AssetsContractControllerGetERC721OwnerOfAction | AssetsContractControllerGetERC1155BalanceOfAction | AssetsContractControllerGetERC1155TokenURIAction | NetworkControllerFindNetworkClientIdByChainIdAction | PhishingControllerBulkScanUrlsAction;
|
163
|
+
export type AllowedEvents = PreferencesControllerStateChangeEvent | AccountsControllerSelectedEvmAccountChangeEvent;
|
155
164
|
export type NftControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, NftControllerState>;
|
156
165
|
export type NftControllerEvents = NftControllerStateChangeEvent;
|
157
166
|
/**
|
@@ -172,7 +181,6 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
172
181
|
* Creates an NftController instance.
|
173
182
|
*
|
174
183
|
* @param options - The controller options.
|
175
|
-
* @param options.chainId - The chain ID of the current network.
|
176
184
|
* @param options.ipfsGateway - The configured IPFS gateway.
|
177
185
|
* @param options.openSeaEnabled - Controls whether the OpenSea API is used.
|
178
186
|
* @param options.useIpfsSubdomains - Controls whether IPFS subdomains are used.
|
@@ -182,8 +190,7 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
182
190
|
* @param options.messenger - The messenger.
|
183
191
|
* @param options.state - Initial state to set on this controller.
|
184
192
|
*/
|
185
|
-
constructor({
|
186
|
-
chainId: Hex;
|
193
|
+
constructor({ ipfsGateway, openSeaEnabled, useIpfsSubdomains, isIpfsGatewayEnabled, onNftAdded, messenger, state, }: {
|
187
194
|
ipfsGateway?: string;
|
188
195
|
openSeaEnabled?: boolean;
|
189
196
|
useIpfsSubdomains?: boolean;
|
@@ -208,13 +215,12 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
208
215
|
* @param asset.tokenId - The ID of the asset.
|
209
216
|
* @param type - The asset type.
|
210
217
|
* @param origin - Domain origin to register the asset from.
|
218
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
211
219
|
* @param options - Options bag.
|
212
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
213
220
|
* @param options.userAddress - The address of the account where the NFT is being added.
|
214
221
|
* @returns Object containing a Promise resolving to the suggestedAsset address if accepted.
|
215
222
|
*/
|
216
|
-
watchNft(asset: NftAsset, type: NFTStandardType, origin: string,
|
217
|
-
networkClientId?: NetworkClientId;
|
223
|
+
watchNft(asset: NftAsset, type: NFTStandardType, origin: string, networkClientId: NetworkClientId, { userAddress, }?: {
|
218
224
|
userAddress?: string;
|
219
225
|
}): Promise<void>;
|
220
226
|
/**
|
@@ -229,27 +235,23 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
229
235
|
* @param ownerAddress - User public address.
|
230
236
|
* @param nftAddress - NFT contract address.
|
231
237
|
* @param tokenId - NFT token ID.
|
232
|
-
* @param
|
233
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
238
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
234
239
|
* @returns Promise resolving the NFT ownership.
|
235
240
|
*/
|
236
|
-
isNftOwner(ownerAddress: string, nftAddress: string, tokenId: string,
|
237
|
-
networkClientId?: NetworkClientId;
|
238
|
-
}): Promise<boolean>;
|
241
|
+
isNftOwner(ownerAddress: string, nftAddress: string, tokenId: string, networkClientId: NetworkClientId): Promise<boolean>;
|
239
242
|
/**
|
240
243
|
* Verifies currently selected address owns entered NFT address/tokenId combo and
|
241
244
|
* adds the NFT and respective NFT contract to the stored NFT and NFT contracts lists.
|
242
245
|
*
|
243
246
|
* @param address - Hex address of the NFT contract.
|
244
247
|
* @param tokenId - The NFT identifier.
|
248
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
245
249
|
* @param options - an object of arguments
|
246
250
|
* @param options.userAddress - The address of the current user.
|
247
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
248
251
|
* @param options.source - Whether the NFT was detected, added manually or suggested by a dapp.
|
249
252
|
*/
|
250
|
-
addNftVerifyOwnership(address: string, tokenId: string, { userAddress,
|
253
|
+
addNftVerifyOwnership(address: string, tokenId: string, networkClientId: NetworkClientId, { userAddress, source, }?: {
|
251
254
|
userAddress?: string;
|
252
|
-
networkClientId?: NetworkClientId;
|
253
255
|
source?: Source;
|
254
256
|
}): Promise<void>;
|
255
257
|
/**
|
@@ -257,20 +259,17 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
257
259
|
*
|
258
260
|
* @param tokenAddress - Hex address of the NFT contract.
|
259
261
|
* @param tokenId - The NFT identifier.
|
262
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
260
263
|
* @param options - an object of arguments
|
261
264
|
* @param options.nftMetadata - NFT optional metadata.
|
262
265
|
* @param options.userAddress - The address of the current user.
|
263
266
|
* @param options.source - Whether the NFT was detected, added manually or suggested by a dapp.
|
264
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
265
|
-
* @param options.chainId - The chain ID to add the NFT to.
|
266
267
|
* @returns Promise resolving to the current NFT list.
|
267
268
|
*/
|
268
|
-
addNft(tokenAddress: string, tokenId: string, { nftMetadata, userAddress, source,
|
269
|
+
addNft(tokenAddress: string, tokenId: string, networkClientId: NetworkClientId, { nftMetadata, userAddress, source, }?: {
|
269
270
|
nftMetadata?: NftMetadata;
|
270
271
|
userAddress?: string;
|
271
272
|
source?: Source;
|
272
|
-
networkClientId?: NetworkClientId;
|
273
|
-
chainId?: Hex;
|
274
273
|
}): Promise<void>;
|
275
274
|
/**
|
276
275
|
* Refetches NFT metadata and updates the state
|
@@ -278,24 +277,21 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
278
277
|
* @param options - Options for refetching NFT metadata
|
279
278
|
* @param options.nfts - nfts to update metadata for.
|
280
279
|
* @param options.userAddress - The current user address
|
281
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
282
280
|
*/
|
283
|
-
updateNftMetadata({ nfts, userAddress,
|
281
|
+
updateNftMetadata({ nfts, userAddress, }: {
|
284
282
|
nfts: Nft[];
|
285
283
|
userAddress?: string;
|
286
|
-
networkClientId?: NetworkClientId;
|
287
284
|
}): Promise<void>;
|
288
285
|
/**
|
289
286
|
* Removes an NFT from the stored token list.
|
290
287
|
*
|
291
288
|
* @param address - Hex address of the NFT contract.
|
292
289
|
* @param tokenId - Token identifier of the NFT.
|
290
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
293
291
|
* @param options - an object of arguments
|
294
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
295
292
|
* @param options.userAddress - The address of the account where the NFT is being removed.
|
296
293
|
*/
|
297
|
-
removeNft(address: string, tokenId: string,
|
298
|
-
networkClientId?: NetworkClientId;
|
294
|
+
removeNft(address: string, tokenId: string, networkClientId: NetworkClientId, { userAddress }?: {
|
299
295
|
userAddress?: string;
|
300
296
|
}): void;
|
301
297
|
/**
|
@@ -303,12 +299,11 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
303
299
|
*
|
304
300
|
* @param address - Hex address of the NFT contract.
|
305
301
|
* @param tokenId - Token identifier of the NFT.
|
302
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
306
303
|
* @param options - an object of arguments
|
307
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
308
304
|
* @param options.userAddress - The address of the account where the NFT is being removed.
|
309
305
|
*/
|
310
|
-
removeAndIgnoreNft(address: string, tokenId: string,
|
311
|
-
networkClientId?: NetworkClientId;
|
306
|
+
removeAndIgnoreNft(address: string, tokenId: string, networkClientId: NetworkClientId, { userAddress }?: {
|
312
307
|
userAddress?: string;
|
313
308
|
}): void;
|
314
309
|
/**
|
@@ -321,13 +316,12 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
321
316
|
*
|
322
317
|
* @param nft - The NFT object to check and update.
|
323
318
|
* @param batch - A boolean indicating whether this method is being called as part of a batch or single update.
|
319
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
324
320
|
* @param accountParams - The userAddress and chainId to check ownership against
|
325
321
|
* @param accountParams.userAddress - the address passed through the confirmed transaction flow to ensure assets are stored to the correct account
|
326
|
-
* @param accountParams.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
327
322
|
* @returns the NFT with the updated isCurrentlyOwned value
|
328
323
|
*/
|
329
|
-
checkAndUpdateSingleNftOwnershipStatus(nft: Nft, batch: boolean, { userAddress
|
330
|
-
networkClientId?: NetworkClientId;
|
324
|
+
checkAndUpdateSingleNftOwnershipStatus(nft: Nft, batch: boolean, networkClientId: NetworkClientId, { userAddress }?: {
|
331
325
|
userAddress?: string;
|
332
326
|
}): Promise<{
|
333
327
|
isCurrentlyOwned: boolean | undefined;
|
@@ -359,12 +353,12 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
359
353
|
/**
|
360
354
|
* Checks whether NFTs associated with current selectedAddress/chainId combination are still owned by the user
|
361
355
|
* And updates the isCurrentlyOwned value on each accordingly.
|
356
|
+
*
|
357
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
362
358
|
* @param options - an object of arguments
|
363
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
364
359
|
* @param options.userAddress - The address of the account where the NFT ownership status is checked/updated.
|
365
360
|
*/
|
366
|
-
checkAndUpdateAllNftsOwnershipStatus(
|
367
|
-
networkClientId?: NetworkClientId;
|
361
|
+
checkAndUpdateAllNftsOwnershipStatus(networkClientId: NetworkClientId, { userAddress, }?: {
|
368
362
|
userAddress?: string;
|
369
363
|
}): Promise<void>;
|
370
364
|
/**
|
@@ -373,12 +367,11 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
373
367
|
* @param address - Hex address of the NFT contract.
|
374
368
|
* @param tokenId - Hex address of the NFT contract.
|
375
369
|
* @param favorite - NFT new favorite status.
|
370
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
376
371
|
* @param options - an object of arguments
|
377
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
378
372
|
* @param options.userAddress - The address of the account where the NFT is being removed.
|
379
373
|
*/
|
380
|
-
updateNftFavoriteStatus(address: string, tokenId: string, favorite: boolean,
|
381
|
-
networkClientId?: NetworkClientId;
|
374
|
+
updateNftFavoriteStatus(address: string, tokenId: string, favorite: boolean, networkClientId: NetworkClientId, { userAddress, }?: {
|
382
375
|
userAddress?: string;
|
383
376
|
}): void;
|
384
377
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NftController.d.cts","sourceRoot":"","sources":["../src/NftController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+CAA+C,EAC/C,kCAAkC,EAClC,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,sCAAsC;AACxE,OAAO,KAAK,EACV,mBAAmB,EACnB,0BAA0B,EAC3B,kCAAkC;AACnC,OAAO,EACL,cAAc,EACd,KAAK,wBAAwB,EAC9B,kCAAkC;
|
1
|
+
{"version":3,"file":"NftController.d.cts","sourceRoot":"","sources":["../src/NftController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+CAA+C,EAC/C,kCAAkC,EAClC,0CAA0C,EAC3C,sC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AC;QACT,WAAW,EAAE,UAAU,EAAE,CAAC;KAC3B,CAAC;IAgBI,gBAAgB,CAAC,gBAAgB,EAAE,gBAAgB;IAiEzD;;OAEG;IACH,UAAU;CAwHX;AAED,eAAe,aAAa,CAAC"}
|
package/dist/NftController.d.mts
CHANGED
@@ -2,13 +2,15 @@ import type { AccountsControllerSelectedEvmAccountChangeEvent, AccountsControlle
|
|
2
2
|
import type { AddApprovalRequest } from "@metamask/approval-controller";
|
3
3
|
import type { RestrictedMessenger, ControllerStateChangeEvent } from "@metamask/base-controller";
|
4
4
|
import { BaseController, type ControllerGetStateAction } from "@metamask/base-controller";
|
5
|
-
import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction
|
5
|
+
import type { NetworkClientId, NetworkControllerGetNetworkClientByIdAction } from "@metamask/network-controller";
|
6
|
+
import type { BulkPhishingDetectionScanResponse } from "@metamask/phishing-controller";
|
6
7
|
import type { PreferencesControllerStateChangeEvent } from "@metamask/preferences-controller";
|
7
8
|
import type { Hex } from "@metamask/utils";
|
8
9
|
import type { AssetsContractControllerGetERC1155BalanceOfAction, AssetsContractControllerGetERC1155TokenURIAction, AssetsContractControllerGetERC721AssetNameAction, AssetsContractControllerGetERC721AssetSymbolAction, AssetsContractControllerGetERC721OwnerOfAction, AssetsContractControllerGetERC721TokenURIAction } from "./AssetsContractController.mjs";
|
9
10
|
import { Source } from "./constants.mjs";
|
10
11
|
import type { Collection, Attributes, LastSale, TopBid } from "./NftDetectionController.mjs";
|
11
|
-
type
|
12
|
+
import type { NetworkControllerFindNetworkClientIdByChainIdAction } from "../../network-controller/src/NetworkController.mjs";
|
13
|
+
export type NFTStandardType = 'ERC721' | 'ERC1155';
|
12
14
|
type SuggestedNftMeta = {
|
13
15
|
asset: {
|
14
16
|
address: string;
|
@@ -147,11 +149,18 @@ type NftAsset = {
|
|
147
149
|
declare const controllerName = "NftController";
|
148
150
|
export type NftControllerGetStateAction = ControllerGetStateAction<typeof controllerName, NftControllerState>;
|
149
151
|
export type NftControllerActions = NftControllerGetStateAction;
|
152
|
+
/**
|
153
|
+
* Action type for bulk scanning URLs with PhishingController
|
154
|
+
*/
|
155
|
+
export type PhishingControllerBulkScanUrlsAction = {
|
156
|
+
type: 'PhishingController:bulkScanUrls';
|
157
|
+
handler: (urls: string[]) => Promise<BulkPhishingDetectionScanResponse>;
|
158
|
+
};
|
150
159
|
/**
|
151
160
|
* The external actions available to the {@link NftController}.
|
152
161
|
*/
|
153
|
-
export type AllowedActions = AddApprovalRequest | AccountsControllerGetAccountAction | AccountsControllerGetSelectedAccountAction | NetworkControllerGetNetworkClientByIdAction | AssetsContractControllerGetERC721AssetNameAction | AssetsContractControllerGetERC721AssetSymbolAction | AssetsContractControllerGetERC721TokenURIAction | AssetsContractControllerGetERC721OwnerOfAction | AssetsContractControllerGetERC1155BalanceOfAction | AssetsContractControllerGetERC1155TokenURIAction;
|
154
|
-
export type AllowedEvents = PreferencesControllerStateChangeEvent |
|
162
|
+
export type AllowedActions = AddApprovalRequest | AccountsControllerGetAccountAction | AccountsControllerGetSelectedAccountAction | NetworkControllerGetNetworkClientByIdAction | AssetsContractControllerGetERC721AssetNameAction | AssetsContractControllerGetERC721AssetSymbolAction | AssetsContractControllerGetERC721TokenURIAction | AssetsContractControllerGetERC721OwnerOfAction | AssetsContractControllerGetERC1155BalanceOfAction | AssetsContractControllerGetERC1155TokenURIAction | NetworkControllerFindNetworkClientIdByChainIdAction | PhishingControllerBulkScanUrlsAction;
|
163
|
+
export type AllowedEvents = PreferencesControllerStateChangeEvent | AccountsControllerSelectedEvmAccountChangeEvent;
|
155
164
|
export type NftControllerStateChangeEvent = ControllerStateChangeEvent<typeof controllerName, NftControllerState>;
|
156
165
|
export type NftControllerEvents = NftControllerStateChangeEvent;
|
157
166
|
/**
|
@@ -172,7 +181,6 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
172
181
|
* Creates an NftController instance.
|
173
182
|
*
|
174
183
|
* @param options - The controller options.
|
175
|
-
* @param options.chainId - The chain ID of the current network.
|
176
184
|
* @param options.ipfsGateway - The configured IPFS gateway.
|
177
185
|
* @param options.openSeaEnabled - Controls whether the OpenSea API is used.
|
178
186
|
* @param options.useIpfsSubdomains - Controls whether IPFS subdomains are used.
|
@@ -182,8 +190,7 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
182
190
|
* @param options.messenger - The messenger.
|
183
191
|
* @param options.state - Initial state to set on this controller.
|
184
192
|
*/
|
185
|
-
constructor({
|
186
|
-
chainId: Hex;
|
193
|
+
constructor({ ipfsGateway, openSeaEnabled, useIpfsSubdomains, isIpfsGatewayEnabled, onNftAdded, messenger, state, }: {
|
187
194
|
ipfsGateway?: string;
|
188
195
|
openSeaEnabled?: boolean;
|
189
196
|
useIpfsSubdomains?: boolean;
|
@@ -208,13 +215,12 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
208
215
|
* @param asset.tokenId - The ID of the asset.
|
209
216
|
* @param type - The asset type.
|
210
217
|
* @param origin - Domain origin to register the asset from.
|
218
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
211
219
|
* @param options - Options bag.
|
212
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
213
220
|
* @param options.userAddress - The address of the account where the NFT is being added.
|
214
221
|
* @returns Object containing a Promise resolving to the suggestedAsset address if accepted.
|
215
222
|
*/
|
216
|
-
watchNft(asset: NftAsset, type: NFTStandardType, origin: string,
|
217
|
-
networkClientId?: NetworkClientId;
|
223
|
+
watchNft(asset: NftAsset, type: NFTStandardType, origin: string, networkClientId: NetworkClientId, { userAddress, }?: {
|
218
224
|
userAddress?: string;
|
219
225
|
}): Promise<void>;
|
220
226
|
/**
|
@@ -229,27 +235,23 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
229
235
|
* @param ownerAddress - User public address.
|
230
236
|
* @param nftAddress - NFT contract address.
|
231
237
|
* @param tokenId - NFT token ID.
|
232
|
-
* @param
|
233
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
238
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
234
239
|
* @returns Promise resolving the NFT ownership.
|
235
240
|
*/
|
236
|
-
isNftOwner(ownerAddress: string, nftAddress: string, tokenId: string,
|
237
|
-
networkClientId?: NetworkClientId;
|
238
|
-
}): Promise<boolean>;
|
241
|
+
isNftOwner(ownerAddress: string, nftAddress: string, tokenId: string, networkClientId: NetworkClientId): Promise<boolean>;
|
239
242
|
/**
|
240
243
|
* Verifies currently selected address owns entered NFT address/tokenId combo and
|
241
244
|
* adds the NFT and respective NFT contract to the stored NFT and NFT contracts lists.
|
242
245
|
*
|
243
246
|
* @param address - Hex address of the NFT contract.
|
244
247
|
* @param tokenId - The NFT identifier.
|
248
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
245
249
|
* @param options - an object of arguments
|
246
250
|
* @param options.userAddress - The address of the current user.
|
247
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
248
251
|
* @param options.source - Whether the NFT was detected, added manually or suggested by a dapp.
|
249
252
|
*/
|
250
|
-
addNftVerifyOwnership(address: string, tokenId: string, { userAddress,
|
253
|
+
addNftVerifyOwnership(address: string, tokenId: string, networkClientId: NetworkClientId, { userAddress, source, }?: {
|
251
254
|
userAddress?: string;
|
252
|
-
networkClientId?: NetworkClientId;
|
253
255
|
source?: Source;
|
254
256
|
}): Promise<void>;
|
255
257
|
/**
|
@@ -257,20 +259,17 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
257
259
|
*
|
258
260
|
* @param tokenAddress - Hex address of the NFT contract.
|
259
261
|
* @param tokenId - The NFT identifier.
|
262
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
260
263
|
* @param options - an object of arguments
|
261
264
|
* @param options.nftMetadata - NFT optional metadata.
|
262
265
|
* @param options.userAddress - The address of the current user.
|
263
266
|
* @param options.source - Whether the NFT was detected, added manually or suggested by a dapp.
|
264
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
265
|
-
* @param options.chainId - The chain ID to add the NFT to.
|
266
267
|
* @returns Promise resolving to the current NFT list.
|
267
268
|
*/
|
268
|
-
addNft(tokenAddress: string, tokenId: string, { nftMetadata, userAddress, source,
|
269
|
+
addNft(tokenAddress: string, tokenId: string, networkClientId: NetworkClientId, { nftMetadata, userAddress, source, }?: {
|
269
270
|
nftMetadata?: NftMetadata;
|
270
271
|
userAddress?: string;
|
271
272
|
source?: Source;
|
272
|
-
networkClientId?: NetworkClientId;
|
273
|
-
chainId?: Hex;
|
274
273
|
}): Promise<void>;
|
275
274
|
/**
|
276
275
|
* Refetches NFT metadata and updates the state
|
@@ -278,24 +277,21 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
278
277
|
* @param options - Options for refetching NFT metadata
|
279
278
|
* @param options.nfts - nfts to update metadata for.
|
280
279
|
* @param options.userAddress - The current user address
|
281
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
282
280
|
*/
|
283
|
-
updateNftMetadata({ nfts, userAddress,
|
281
|
+
updateNftMetadata({ nfts, userAddress, }: {
|
284
282
|
nfts: Nft[];
|
285
283
|
userAddress?: string;
|
286
|
-
networkClientId?: NetworkClientId;
|
287
284
|
}): Promise<void>;
|
288
285
|
/**
|
289
286
|
* Removes an NFT from the stored token list.
|
290
287
|
*
|
291
288
|
* @param address - Hex address of the NFT contract.
|
292
289
|
* @param tokenId - Token identifier of the NFT.
|
290
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
293
291
|
* @param options - an object of arguments
|
294
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
295
292
|
* @param options.userAddress - The address of the account where the NFT is being removed.
|
296
293
|
*/
|
297
|
-
removeNft(address: string, tokenId: string,
|
298
|
-
networkClientId?: NetworkClientId;
|
294
|
+
removeNft(address: string, tokenId: string, networkClientId: NetworkClientId, { userAddress }?: {
|
299
295
|
userAddress?: string;
|
300
296
|
}): void;
|
301
297
|
/**
|
@@ -303,12 +299,11 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
303
299
|
*
|
304
300
|
* @param address - Hex address of the NFT contract.
|
305
301
|
* @param tokenId - Token identifier of the NFT.
|
302
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
306
303
|
* @param options - an object of arguments
|
307
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
308
304
|
* @param options.userAddress - The address of the account where the NFT is being removed.
|
309
305
|
*/
|
310
|
-
removeAndIgnoreNft(address: string, tokenId: string,
|
311
|
-
networkClientId?: NetworkClientId;
|
306
|
+
removeAndIgnoreNft(address: string, tokenId: string, networkClientId: NetworkClientId, { userAddress }?: {
|
312
307
|
userAddress?: string;
|
313
308
|
}): void;
|
314
309
|
/**
|
@@ -321,13 +316,12 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
321
316
|
*
|
322
317
|
* @param nft - The NFT object to check and update.
|
323
318
|
* @param batch - A boolean indicating whether this method is being called as part of a batch or single update.
|
319
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
324
320
|
* @param accountParams - The userAddress and chainId to check ownership against
|
325
321
|
* @param accountParams.userAddress - the address passed through the confirmed transaction flow to ensure assets are stored to the correct account
|
326
|
-
* @param accountParams.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
327
322
|
* @returns the NFT with the updated isCurrentlyOwned value
|
328
323
|
*/
|
329
|
-
checkAndUpdateSingleNftOwnershipStatus(nft: Nft, batch: boolean, { userAddress
|
330
|
-
networkClientId?: NetworkClientId;
|
324
|
+
checkAndUpdateSingleNftOwnershipStatus(nft: Nft, batch: boolean, networkClientId: NetworkClientId, { userAddress }?: {
|
331
325
|
userAddress?: string;
|
332
326
|
}): Promise<{
|
333
327
|
isCurrentlyOwned: boolean | undefined;
|
@@ -359,12 +353,12 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
359
353
|
/**
|
360
354
|
* Checks whether NFTs associated with current selectedAddress/chainId combination are still owned by the user
|
361
355
|
* And updates the isCurrentlyOwned value on each accordingly.
|
356
|
+
*
|
357
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
362
358
|
* @param options - an object of arguments
|
363
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
364
359
|
* @param options.userAddress - The address of the account where the NFT ownership status is checked/updated.
|
365
360
|
*/
|
366
|
-
checkAndUpdateAllNftsOwnershipStatus(
|
367
|
-
networkClientId?: NetworkClientId;
|
361
|
+
checkAndUpdateAllNftsOwnershipStatus(networkClientId: NetworkClientId, { userAddress, }?: {
|
368
362
|
userAddress?: string;
|
369
363
|
}): Promise<void>;
|
370
364
|
/**
|
@@ -373,12 +367,11 @@ export declare class NftController extends BaseController<typeof controllerName,
|
|
373
367
|
* @param address - Hex address of the NFT contract.
|
374
368
|
* @param tokenId - Hex address of the NFT contract.
|
375
369
|
* @param favorite - NFT new favorite status.
|
370
|
+
* @param networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
376
371
|
* @param options - an object of arguments
|
377
|
-
* @param options.networkClientId - The networkClientId that can be used to identify the network client to use for this request.
|
378
372
|
* @param options.userAddress - The address of the account where the NFT is being removed.
|
379
373
|
*/
|
380
|
-
updateNftFavoriteStatus(address: string, tokenId: string, favorite: boolean,
|
381
|
-
networkClientId?: NetworkClientId;
|
374
|
+
updateNftFavoriteStatus(address: string, tokenId: string, favorite: boolean, networkClientId: NetworkClientId, { userAddress, }?: {
|
382
375
|
userAddress?: string;
|
383
376
|
}): void;
|
384
377
|
/**
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"NftController.d.mts","sourceRoot":"","sources":["../src/NftController.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+CAA+C,EAC/C,kCAAkC,EAClC,0CAA0C,EAC3C,sCAAsC;AACvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,sCAAsC;AACxE,OAAO,KAAK,EAC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