Get Active Listings of a Wallet
Get all active listings of a wallet on Tensor marketplace using GraphQL
Tensor has two programs which contains active listings.
Tensor Swap stores active listings in SingleListing account
Tensor cNFT stores listing data in ListState account.
Cross program query is possible here. You can query both programs in a single graphQL call.
With Shyft's SuperIndexer, you can query accounts data through GraphQL. We will be applying a where filter on owner field of the accounts data. This will give us all active listings for that owner (wallet).
Tensor Cross Program Query
We will query both Tensor programs, cNFT and Tensor Swap in a single call, and see the power of cross program queries, thanks to GraphQL APIs.
You can directly copy paste this code on replit and see it in action.
Active Listings for Tensor Swap (normal NFTs)
Active Listings for Tensor cNFT
You can also query compressed NFT listings on Tensor, using the following code.
Last updated