Skip to content

Implemented NFT badge indexer and wallet badge REST API - #1200

Merged
Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
DioChuks:feat/nft-wallet-badge-indexer
Oct 22, 2026
Merged

Chucks1093 merged 3 commits into
accesslayerorg:mainfrom
DioChuks:feat/nft-wallet-badge-indexer

Conversation

@DioChuks

Copy link
Copy Markdown
Contributor

Summary

I traced the existing badge event indexing, persistence, routes, and cache behavior against each acceptance criterion before deciding whether any changes are needed.

Existing implementation

The repository already had badge qualification and on-chain minting, but it did not index BadgeMinted events into a wallet read model or provide badge REST endpoints and caching.

Implemented

  • Added the wallet_badges Prisma model and migration, with uniqueness for both wallet/type and chain event position.
  • Added BadgeMinted event processing to the shared indexer pipeline. The handler records the chain timestamp and invalidates that wallet’s badge caches. Invalid events or failed writes stop processing before the shared cursor advances.
  • Added GET /api/v1/wallets/:wallet/badges, returning earned badges and the remaining locked types, and GET /api/v1/wallets/:wallet/badges/summary, returning a count for each type.
  • Added a five-minute cache for both responses.
  • Updated the badge documentation.

Key files: indexer service, indexer pipeline, badge read service, wallet routes, Prisma schema, migration.

Acceptance criteria

All five criteria are covered: event indexing and cursor safety, mint timestamps, per-type summary counts, wallet-specific cache invalidation, and all five badge types represented across earned and locked results.

Validation

  • Focused Jest run: 5 suites, 36 tests passed.
  • pnpm build: passed.
  • ESLint on changed TypeScript files: passed.
  • pnpm exec prisma validate --schema prisma/schema: passed.
  • The migration file was added but not applied to a database.

Closes #1134

Testing

  • pnpm lint
  • pnpm build
  • pnpm exec prisma generate when schema or generated types changed

Checklist

  • Linked issue or backlog item
  • No secrets or live credentials added
  • Docs updated if setup or env changed
  • Change is scoped to one problem

@drips-wave

drips-wave Bot commented Oct 21, 2026

Copy link
Copy Markdown

@DioChuks 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 c3772b0 into accesslayerorg:main Oct 22, 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.

Build NFT badge indexer and wallet badge REST API

2 participants