Search and Retrieve AINFT

This tutorial describe how to retrieve AINFTs by id, name, symbol and userAddress.

Retrieve AINFTs

You can retrieve AINFTs using geAinftsByAccount or getAinftsByAinftObject .

ainftJs.nft.getAinftsByAccount(userAddress)
	.then((res) => {
		console.log(JSON.stringify(res, null, 2));
	})
	.catch((error) => {
		console.log(error);
	})
ainftJs.nft.getAinftsByAinftObject(ainftObjectId)
	.then((res) => {
		console.log(JSON.stringify(res, null, 2));
	})
	.catch((error) => {
		console.log(error);
	})

Search Ainft object and AINFTs

Also, you can search ainft objects or AINFTs. Search options are below.

  • ainftObjectId - The ID of Ainft object

  • name - The name of Ainft object

  • symbol - The symbol of Ainft object

  • tokenId - Token ID of AINFT

  • userAddress - Address of AINFT owner

Response

Limit

Search function retrieves 20 items by default. If you want to set number of result items, you can use limit option. Maximum limit value is 100.

then, you can retrieve more with using cursor.

The cursor value is included in result of search. If you search nfts, usage is the same.

Last updated

Was this helpful?