Skip to content

feat: co-creator roster, reserve balance, content-access and tip history endpoints - #1186

Merged
Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
devsimze:feat/issues-1132-1137-1139-1140
Oct 21, 2026
Merged

Chucks1093 merged 1 commit into
accesslayerorg:mainfrom
devsimze:feat/issues-1132-1137-1139-1140

Conversation

@devsimze

Copy link
Copy Markdown

Summary

Implements four REST/indexer issues in one set of read models and endpoints:

Guarantees

  • Idempotent indexers: every event is first recorded in an append-only log with unique (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.
  • Atomic: log row + balance/total mutation share one Prisma transaction, so aggregates can never drift from their event log.
  • DLQ on malformed events (CO_CREATOR, RESERVE, TIP_SENT job types); failures propagate so the dispatcher does not advance the ledger cursor and the batch is redelivered.
  • Caches: 60s for rosters/totals/reserve, 30s for content-access; all invalidated per key by the indexer after every event (event-driven, not TTL-only).

Schema

Hand-written migration 20261020180000_add_key_cocreator_tip_reserve_tables adds key_cocreators, key_tips, key_tip_totals, key_reserves, key_reserve_events (migration replay is broken repo-wide; SQL applied directly).

Verification

  • tsc --noEmit clean (only pre-existing price-stream/ws errors remain)
  • ESLint clean on all changed files
  • indexer-pipeline-dispatch.integration.test.ts + event-dedup-guard.unit.test.ts + whitelist.routes.test.ts: 38/38 passing

Closes #1132
Closes #1137
Closes #1139
Closes #1140

…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
@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@Chucks1093
Chucks1093 merged commit bb17bc9 into accesslayerorg:main Oct 21, 2026
4 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

3 participants