Skip to content

Feat: Migrate Challenge Completion Tracking from Browser Cache to Wallet-Based System #205

@L0STE

Description

@L0STE

Problem

Challenge completion is currently tracked using browser-based caching rather than being linked to user wallets. This approach was implemented because we lacked proper indexing for individual mint data, forcing us to cache NFT information locally in the browser.

Issues with current implementation:

  • Challenge progress is tied to browser sessions, not user identity
  • Data is lost when users switch browsers or clear cache
  • No persistent record of user achievements across devices

Solution

Our new internal indexer and API has the following endpoints:

"endpoints": {
    "/": "API information",
    "/collection": "List all collections with mint counts",
    "/collection/:id": "Get collection details with pagination",
    "/mints": "Get timeseries mint data for all collections",
    "/mints/:id": "Get timeseries mint data for specific collection",
    "/totals": "Get cumulative total data for all collections",
    "/totals/:id": "Get cumulative total data for specific collection",
    "/user/:id": "Get user mint history",
    "/stats": "Database statistics"
}

This means that we could replace browser cache with wallet-based API calls like this:

  1. Call https://index.blueshift.gg/user/:id (where :id is the wallet address connected to the dashboard).
  2. Read through all NFTs minted by the user with associated collection data and cross-reference it with existing collection present in the challenge.ts file.

Similarly we could update the challenge completion statistics on top of each challenge to not call an RPC everytime but just get the data from https://index.blueshift.gg/stats.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions