-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TS SDK] Add TokenV2 Indexer queries #8210
Conversation
* Queries all tokens of a specific collection that an account owns | ||
* | ||
* @param ownerAddress owner address | ||
* @param collectionAddress the collection address |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should clarify what collection address means. May be with a link to the token v2 doc page as well (or a TODO if that's not complete yet) cc @gregnazario
* can pass an optional `tokenStandard` parameter to query a specific standard | ||
* | ||
* @param creatorAddress the collection creator address | ||
* @param collectionName the collection name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May be provide an example?
creatorAddress: MaybeHexString, | ||
collectionName: string, | ||
extraArgs?: { | ||
tokenStandard?: TokenStandard; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, does this mean that there could be 2 different standard from the same collection? For example, AptosMonkey v1, and AptosMonkey v2 collection?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is not the same collection, these are 2 different collection that were created with the same account and have the same name.
for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Queries make sense. The APIs look a bit long but I'm sure that we can iterate if we get feedback on ergonomics.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know much about TokenV2, but these query wrapper functions make sense to me
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
✅ Forge suite
|
* add get account token query * add get account collection tokens * update changelog * add function comment * add function comment * fix lint * address feedback * update changelog * fix lint * typo * token ownership fields fragment
Description
This PR adds Indexer queries
getAccountTokens
- get all tokens that an account ownsgetAccountCollectionTokensByCollectionAddress
- get all tokens of a specific collection that an account ownsgetCollectionData
- get the collection data (if, for some reason, a creator account has 2 collections with the same name in v1 and v2, can use an optional tokenStandard parameter to query a specific standard)getCollectionAddress
- get the collection address (if, for some reason, a creator account has 2 collections with the same name in v1 and v2, can use an optional tokenStandard parameter to query a specific standard)with this,
In a next PR we will add support for (not yet supported on the indexer side)
Test Plan
tests are passing