Get all Bids of a Collection
Getting all bids of on NFTs belonging to a specific collection
To query active bids of a collection, we will have to query data differently for Tensor cNFT and normal NFTs.
For Tensor cNFT, we have to check two fields target and targetId.
If target object has key assetId, then targetId points to an actual cNFT address.
If target object has key whitelist, then targetId points to the collection detail. (coming soon)
In this example we are checking for {target: {_has_key: "assetId"}. We will have to compare targetId against a pre defined collection mint list, which we can save before hand or fetch through DAS. For this example, we will be fetching through a DAS call.
The key is to use GraphQL _in filter which checks if targetId is present in the mint list.
Active Bids on a cNFT Collection (Compressed NFT collection)
We can also also query the same for Non-compressed NFTs of a collection. However, this data is available in the bidState account of Tensor_Bid account. We can fetch all the NFTs belonging to a particular collection using DAS, and then use the where filter on the nftMint to get the desired result. An example is illustrated below.
We can use the _in check to to compare if a key exists in a range(array) of values
Active Bids on a NFT Collection (Non-Compressed NFT collection)
Last updated