Repository navigation
feat(api): add tip leaderboard, community polls, governance voting weight, and invoice schedule APIs - #1202
Open
wheval wants to merge 1 commit into
Open
feat(api): add tip leaderboard, community polls, governance voting weight, and invoice schedule APIs#1202wheval wants to merge 1 commit into
wheval wants to merge 1 commit into
Conversation
…ight, and invoice schedule APIs (accesslayerorg#1173 accesslayerorg#1174 accesslayerorg#1176 accesslayerorg#1177)
Member
|
1 similar comment
Member
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /keys/:key_id/tips/leaderboard?limit=Nreturning ranked top tippers (rank, truncatedwalletornullwhen anonymous,total_tipped,tip_count,anonymousflag) with a 5-minute Redis cache invalidated onTipSentevents and empty list[]when a key has no tips.GET /keys/:key_id/polls(paginated active and closed polls with tally andtime_remaining_seconds),GET /keys/:key_id/polls/:poll_id(per-option breakdown and callerwallet_vote), andGET /keys/:key_id/polls/:poll_id/weight/:wallet(snapshot-based vote weight), backed by a 30s Redis cache invalidated onPollVoteCastandPollClosedevents.GET /governance/voting-weight/:wallet/:key_idreturningown_weight,delegated_weight,total, and activedelegators({ wallet, amount }), cached for 60s and invalidated onVotingDelegated/DELEGATION_SETandDelegationRevoked/DELEGATION_REVOKEDevents.InstalmentPaidcontract events idempotently intoinstalment_paymentsand exposeGET /invoices/:invoice_id/scheduleandGET /invoices/:invoice_id/schedule/nextwith request-timeoverduecomputation and a 60s Redis cache invalidated onInstalmentPaidevents.Closes #1173
Closes #1174
Closes #1176
Closes #1177
Testing
pnpm lintpnpm buildpnpm exec prisma generatewhen schema or generated types changedChecklist