-
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] Improve IndexerClient
to support tokenv2 sorting and new queries
#9395
Conversation
IndexerClient
to support tokenv2 sorting and new queries
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.
noice
@@ -146,31 +168,52 @@ export class IndexerClient { | |||
} | |||
|
|||
/** | |||
* Queries a token activities by token id hash | |||
* Queries a token activities by token address (token data id) |
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.
Maybe to be a little clearer: * Queries a token activities by token address or token data id
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.
yea... so token data id is token address, indexer uses token_data_id key but token address might be more understandable for users..? open for suggestions
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's either the token_data_id hash or the token address, the former for v1 and latter for v2, right? that was my understanding
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.
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.
yeah, but it's just a naming convention to make v1 and v2 queries coalesce, the value for v2 is just the token address, whereas with token v1 the value is the hash of the token name + creator + collection name (or maybe something else, I could be wrong, maybe it's a table handle or something), but I've only seen the indexer using it
Sorry if you already knew this, don't mean to explain it to you if you did, but just saying because some people might not understand that the field for the query works for both v1 and v2
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.
I see what you mean! yes I was just thinking about sdk vs indexer naming - I think what you are saying makes sense, will update the code! thanks!
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.
Yeah some of the names are very confusing for the indexer. At first glance you'd think all the _v2
queries are specifically for token v2, but they're not, they're just more robust versions of the "v1" queries haha (although maybe the v1 queries don't handle v2, I don't know anymore 🤣)
That's the main reason I suggest it, because then it's a little clearer to people what the purpose of the "_v2" queries are
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.
yes, I think the idea was that all _v2
queries can handle v1 and v2 data, and all v1 queries can only handle v1 data
} | ||
|
||
/** | ||
* Queries account's current owned tokens by the token address (token data id). |
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.
same here, (and maybe anywhere else..?) token address or token data id
bc40449
to
9e0b2e6
Compare
9e0b2e6
to
ed53f07
Compare
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.
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.
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
|
Description
Per @kent-white's request in aptos-labs/explorer#578
export * from "./indexer/generated/types";
Test Plan
ts sdk indexer tests are passing