alchemyplatform/alchemy-web3

[Bug] getNFTs cannot return the ENS name which was expired but re-registered

Closed this issue · 3 comments

Network: Ethereum
API request: getNFTs

Description:
When there is an ENS name (e.g. snowkey.eth ) which was expired but re-registered, the getNFTs api returns as unknown.name

image

{
  "ownedNfts": [
    {
      "contract": {
        "address": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85"
      },
      "id": {
        "tokenId": "0x1fd4be701083c6c7847de1aa3d7653eecd639442579b7ca2db49bfe050e0cee9",
        "tokenMetadata": {
          "tokenType": "ERC721"
        }
      },
      "balance": "1",
      "title": "",
      "description": "",
      "tokenUri": {
        "raw": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0x1fd4be701083c6c7847de1aa3d7653eecd639442579b7ca2db49bfe050e0cee9",
        "gateway": "https://metadata.ens.domains/mainnet/0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85/0x1fd4be701083c6c7847de1aa3d7653eecd639442579b7ca2db49bfe050e0cee9"
      },
      "media": [
        {
          "raw": "",
          "gateway": ""
        }
      ],
      "metadata": {
        "message": {
          "name": "unknown.name",
          "description": "Unknown ENS name",
          "attributes": [
            {
              "display_type": "date",
              "value": 1580346653000000,
              "trait_type": "Created Date"
            },
            {
              "display_type": "number",
              "value": 7,
              "trait_type": "Length"
            },
            {
              "display_type": "string",
              "value": "letter",
              "trait_type": "Character Set"
            }
          ],
          "name_length": 7,
          "version": 0,
          "is_normalized": true
        }
      },
      "timeLastUpdated": "2022-05-13T22:44:09.700Z"
    },
   ......
  ],
  "totalCount": 2,
  "blockHash": "0xe429b2fe7874b2cefefa1a76c8350bf8709657a3438d8d24df997a4ca807bed2"
}

@kellyshang Thanks for filing the bug! I was able to repro this. Will update this issue once I get more information.

@kellyshang I found that the underlying metadata URL for the snowkey NFT was correct, but the cached metadata was outdated. I refreshed the metadata and it seems to be working fine for me now.

We're working on improving our metadata refresh rate, but If you find a particular NFT's metadata is stale, you can refresh the NFT metadata manually. It's currently a feature on our new beta SDK as refreshNftMetadata().

I'm going to mark this issue as closed since it's WAI, but feel free to ask any other questions you may have!

@thebrianchen Thanks for your help, it working fine for me now.