Developer-DAO / pixel-avatars

A Polygon-based minting projects for Developer DAO members who own an Devs for Revolution NFT

Home Page:https://pixel-devs.developerdao.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: Indicate when token id is already minted

rasmuscnielsen opened this issue · comments

Ie by adding "Already minted - {TOKEN ID}" to the dropdown of personal tokens.

@briangershon As for this one my thoughts are

  • Tweak the response of useAvatarContract@getAvailableTokens to somehow include mint status. Say an array of objects rather than current array of plain integers
  • As a result the getAvailableTokens would - after fetching the inventory from server - also need to fetch the claim status of the individual tokens before return the response. I imagine the code would be quite similar to what the web server does for the genesis tokens only it might be another method to call on the avatar contract
    // For each token the address owns we need to fetch the actual NFT
    const tokenPromises = [...Array(balance).keys()].map((idx) =>
    contract.tokenOfOwnerByIndex(address, idx)
    )
    return (await Promise.all(tokenPromises)).map((t) => t.toNumber())