Skip to content

feat(platform): list a wallet's royalty claims from the indexer's event index; 0.27.0 - #31

Merged
tamashi095 merged 1 commit into
mainfrom
feat/royalty-claims-read
Sep 9, 2026
Merged

feat(platform): list a wallet's royalty claims from the indexer's event index; 0.27.0#31
tamashi095 merged 1 commit into
mainfrom
feat/royalty-claims-read

Conversation

@tamashi095

Copy link
Copy Markdown
Contributor

What

listRoyaltyClaims(address, config, { before, limit }) in @misofm/platform/read: the wallet's royalty_pool::pool::RoyaltyClaimedEvents from the GraphQL indexer, newest first, grouped into one claim per transaction with the pools swept and the amount from each.

  • Sender + generic event type, not a function filter: verified on testnet that a routed-stake sweep emits the same event without calling pool::claim_rewards as an entry point, and that the sender stays the wallet under Enoki sponsorship.
  • Complete transactions per page. A page boundary can split a transaction's events; when older events remain, the oldest transaction on the page is withheld and nextCursor points just before the oldest kept one, so it returns whole next page. A single transaction that fills a page is kept and continued past.
  • Retention is reported. The public indexers keep events for a bounded window (27 days at the time of writing on both networks) and transactions to genesis; availableFromMs lets a caller distinguish "no older claims" from "no older index".
  • ProtocolIds.royaltyPool is new; MalformedRoyaltyClaimedEventError is 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:consumer pass. codegen:check needs the sibling Move checkouts; no generated code changed.

🤖 Generated with Claude Code

https://claude.ai/code/session_0117boNS2uJCQr7L2n94xx53

…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
@tamashi095
tamashi095 merged commit 414e18c into main Sep 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant