feat(platform): list a wallet's royalty claims from the indexer's event index; 0.27.0 - #31
Merged
Merged
Conversation
…nt index; 0.27.0
`listRoyaltyClaims(address, config, { before, limit })` reads
`royalty_pool::pool::RoyaltyClaimedEvent` for a sender through the
GraphQL indexer, newest first, grouped by transaction. Filtering by
sender and the generic event type catches every claim path — a direct
`pool::claim_rewards` and a routed-stake sweep alike — where a function
filter on the entry point would miss the latter; the sender is the
wallet even when gas is sponsored.
Pages are complete transactions: when older events remain, the oldest
transaction on a page is withheld and the next cursor points just before
the oldest kept one, so it comes back whole on the next page. Each page
carries how far back the index still reaches, since the public indexers
retain events for a bounded window while keeping transactions to genesis.
`ProtocolIds` gains `royaltyPool`, the pool package the event type is
built from. Malformed events of the configured type fail loudly with
`MalformedRoyaltyClaimedEventError`.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117boNS2uJCQr7L2n94xx53
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.
What
listRoyaltyClaims(address, config, { before, limit })in@misofm/platform/read: the wallet'sroyalty_pool::pool::RoyaltyClaimedEvents from the GraphQL indexer, newest first, grouped into one claim per transaction with the pools swept and the amount from each.pool::claim_rewardsas an entry point, and that the sender stays the wallet under Enoki sponsorship.nextCursorpoints just before the oldest kept one, so it returns whole next page. A single transaction that fills a page is kept and continued past.availableFromMslets a caller distinguish "no older claims" from "no older index".ProtocolIds.royaltyPoolis new;MalformedRoyaltyClaimedEventErroris the failure for an event of the configured type with unexpected fields. Version 0.26.2 → 0.27.0.Consumers: misofm/api read service (
/wallets/{address}/royalty-claims), then the app's/royalties/history.Verification
bun run typecheck,bun run test(6 new tests: filter variables, grouping and ordering, the withheld-transaction cursor rule, the single-huge-transaction rule, malformed events, indexer errors),bun run build,bun run test:consumerpass.codegen:checkneeds the sibling Move checkouts; no generated code changed.🤖 Generated with Claude Code
https://claude.ai/code/session_0117boNS2uJCQr7L2n94xx53