Querying NFTs
Querying Available NFT Models
In order to display the NFT content available for your app, use the nftModels
API. This query returns all the NFTModel
that you have marked as Available in the Admin Portal
In Admin Portal, NFTModel is referred to as Collectible.
Recall that an NFTModel is basically a blueprint for an NFT -- it contains all the content and metadata that would get minted into an NFT. You can limit the supply of NFTs for an NFTModel by setting its quantity
appropriately (using the Admin Portal as follows).
Note: You can do some rich filtering on which NFTModels to display in your application using the (optional) NFTModelFilterInput parameter.
Querying User NFTs
Use the nfts
query to get NFT's
belonging to the currently logged-in user. Like the nftModels
query, you can optionally filter this query as needed (by particular NFTModel
's, for example).
nfts - Gets all NFT's belonging to the current AppUser context.
The queries above don't query the blockchain directly. Instead, they query Niftory's database representation of the blockchain, which helps make them very fast, and allows non-blockchain data (such as not-yet-minted NFTModels) to be retrieved from the same API.
NFTSet, NFTModel and NFT types all have blockchainId
, which is set once an NFT is minted, and can be used to look up these entities on the blockchain itself.
Last updated