-
As title |
Beta Was this translation helpful? Give feedback.
Answered by
0xaptosj
Mar 6, 2024
Replies: 1 comment
-
You need to query indexer to get this kind of data, Aptos labs hosted a public indexer, ts-sdk has a bunch of built-in functions to query indexer on NFT data. To get all NFTs by owner from a collection, you can run const result = await aptos.getAccountOwnedTokensFromCollectionAddress({
accountAddress: ownerAddr,
collectionAddress: COLLECTION_ID,
}); If there's no built-in function in ts-sdk to do what you need, you can also write graphql by hand and query it with ts-sdk, you can find all available queries on hasura. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
0xaptosj
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You need to query indexer to get this kind of data, Aptos labs hosted a public indexer, ts-sdk has a bunch of built-in functions to query indexer on NFT data.
To get all NFTs by owner from a collection, you can run
If there's no built-in function in ts-sdk to do what you need, you can also write graphql by hand and query it with ts-sdk, you can find all available queries on hasura.