Null Metadata when useNFTBalances or getTokenIdMetadata

Chain: Mumbai
Contract: 0x7e24D827246847044F3965d78ae7400631ed987f
TokenID: 0
scan here:https://mumbai.polygonscan.com/address/0x7e24D827246847044F3965d78ae7400631ed987f

When I call useNFTBalances or getTokenIdMetadata always get null metadata

amount: "1"
block_number: "26255572"
block_number_minted: "26255572"
contract_type: "ERC1155"
metadata: null
name: null
owner_of: "0x3f34c005ae31777d8330fe9715c66a0fc92f2171"
symbol: null
synced_at: null
token_address: "0x7e24d827246847044f3965d78ae7400631ed987f"
token_hash: "8034806454a54831d0e5a1215a6ba317"
token_id: "0"
token_uri: null

The token_uri in contact should be

ipfs://QmVrpUJUYh66Z95cfm1xJHjFqfsZ9475T8szWE7vtz3P8m/?id=0

or view content directly here
https://ipfs.moralis.io:2053/ipfs/QmVrpUJUYh66Z95cfm1xJHjFqfsZ9475T8szWE7vtz3P8m

Also I have tried ReSyncMetadata to update both in script and admin interface, always got:

{
  "status": "The metadata could not be updated! Try again later"
}

What is the problem and how should I fix it? Thank you

Did you try resync metadata with uri flag?

Yes, I tried it many times. But now work.


Do you know how to check what is the uri on chain for that token id? Like making a query to the blockchain.

Yes. You remind me. What I implemented is a function tokenURI

    function tokenURI(uint256 tokenId)
        public
        view
        virtual
        returns (string memory)

I just found it should be “uri” in original ERC1155

function uri(uint256) public view virtual override returns (string memory)

tokenURI works find on Opensea. So I didnt realized it.
https://testnets.opensea.io/assets/mumbai/0x7e24d827246847044f3965d78ae7400631ed987f/0

Is that the problem? I will try implement uri() function at once. Thank you for your time

It works finally. The problem is exactly it,

1 Like