-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: collection buy event resolver #37
Conversation
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.
Looks oki I would merge it into one query :)
src/server-extension/query/event.ts
Outdated
date(e.timestamp), | ||
COALESCE(MAX(e.meta::bigint), 0) as max, |
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.
date(e.timestamp), | |
COALESCE(MAX(e.meta::bigint), 0) as max, | |
date(e.timestamp), | |
COUNT(e.*) as count | |
COALESCE(MAX(e.meta::bigint), 0) as max, |
src/server-extension/query/event.ts
Outdated
|
||
export const totalBuyEvent = `SELECT | ||
COUNT(e.*) as count | ||
FROM event e | ||
LEFT JOIN nft_entity ne on ne.id = e.nft_id | ||
WHERE e.interaction = 'BUY' AND ne.collection_id = $1;` |
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.
export const totalBuyEvent = `SELECT | |
COUNT(e.*) as count | |
FROM event e | |
LEFT JOIN nft_entity ne on ne.id = e.nft_id | |
WHERE e.interaction = 'BUY' AND ne.collection_id = $1;` |
@vikiival Thanks for your comments. I have change the code. |
Thanks a lot for your help! ❤️ |
Add a resolver to return
max
andcount
of collection's events.More details ref: kodadot/nft-gallery#2556
It's my first time contributing to the subsquid project. I encountered some problems connecting the local server, so I wrote the code directly and haven't tested it.
Please don't hesitate to point out my mistakes and give me some corrections. Thanks a lot! @vikiival