Skip to content

@gala-chain/testAPI


API > fetchNFTInstances

Function: fetchNFTInstances()

fetchNFTInstances(client, nftClassKey, owner): Promise\<string[]>

Fetches all NFT instance IDs owned by a specific user.

Parameters

client: ChainClient

Chain client for blockchain queries

nftClassKey: TokenClassKey

Token class identifier

owner: string

User identity key to query balances for

Returns

Promise resolving to array of token instance IDs sorted numerically

Example

const instances = await fetchNFTInstances(client, nftClassKey, user.identityKey);
console.log(instances); // ["1", "3", "7"]

Source

chain-test/src/e2e/tokenOps.ts:135