Repository navigation
feat: co-creator roster, reserve balance, content-access and tip history endpoints - #1186
Merged
Chucks1093 merged 1 commit intoOct 21, 2026
Conversation
…ory endpoints (accesslayerorg#1132 accesslayerorg#1137 accesslayerorg#1139 accesslayerorg#1140) - KeyCoCreator/KeyTip/KeyTipTotal/KeyReserve/KeyReserveEvent read models with an applied hand-written migration - Indexer handlers for CoCreatorSet/Removed, ReserveAccrued/Deployed and TipSent: order-safe, idempotent (unique txHash+eventIndex), DLQ on malformed events, cache invalidation after every event - Dispatcher wiring in processIndexerEvents before cursor advancement - REST: GET /keys/:key_id/co-creators[/:wallet], /reserve, /content-access/:wallet, /tips, /tips/total, /tips/:tipId/content - 30/60s Redis caches with event-driven invalidation; content-access is contract-first (check_access) with off-chain fallback, invalidated on KEY_BOUGHT/KEY_SOLD
|
@devsimze Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Implements four REST/indexer issues in one set of read models and endpoints:
GET /keys/:key_id/co-creatorsand/co-creators/:wallet— active co-creator roster with roles, share_bps and added_at. Indexed fromCoCreatorSetEvent/CoCreatorRemovedEvent(co_set,cc_rm).GET /keys/:key_id/reserve— reserve balance, market cap (price snapshot × circulating supply), reserve ratio bps andlow_reserveflag. Indexed fromReserveAccrued/ReserveDeployed.GET /keys/:key_id/content-access/:wallet— content-gate check{ is_allowed, gate_type, requirement }. Contract-first viacheck_accesssimulation (injectable fetcher, same pattern as whitelist); off-chain fallback viaget_min_hold_for_access/is_subscribed/get_key_balance+ indexed KeyOwnership balance. 30s cache, invalidated on KEY_BOUGHT/KEY_SOLD.GET /keys/:key_id/tips,/tips/total,/tips/:tipId/content— cursor-paginated tip history, cumulative totals, IPFS message content (Pinata gateway, cached 1h). Indexed fromTipSent.Guarantees
(txHash, eventIndex); a replay hits the constraint, its balance/total delta rolls back, and the cache is still invalidated. Order-safe watermark-style upserts on the aggregate tables.CO_CREATOR,RESERVE,TIP_SENTjob types); failures propagate so the dispatcher does not advance the ledger cursor and the batch is redelivered.Schema
Hand-written migration
20261020180000_add_key_cocreator_tip_reserve_tablesaddskey_cocreators,key_tips,key_tip_totals,key_reserves,key_reserve_events(migration replay is broken repo-wide; SQL applied directly).Verification
tsc --noEmitclean (only pre-existingprice-stream/wserrors remain)indexer-pipeline-dispatch.integration.test.ts+event-dedup-guard.unit.test.ts+whitelist.routes.test.ts: 38/38 passingCloses #1132
Closes #1137
Closes #1139
Closes #1140