I have an ERC 1155 Contract created with a URI function set like this:
function uri(uint256 _tokenId) public pure override returns (string memory) {
return string(
abi.encodePacked(
"https://jordashtalon.github.io/LimitlessFlightNFTs/Generated/",
Strings.toString(_tokenId),
".json"
)
);
}
That seems to work fine, when I mint a token of id 1 it mints the token great, and the metadata json url exists. However I call this function in my javascript on the frontend:
let NFTs = await Moralis.Web3API.token.getAllTokenIds({address: this.$config.contract_address, chain: this.$config.chain});
console.log(NFTs.result, 'NFT Data');
The NFT response looks like this:
[{
amount: "1"
block_number_minted: "10750594"
contract_type: "ERC1155"
last_metadata_sync: null
last_token_uri_sync: "2022-05-27T18:41:06.790Z"
metadata: null
name: "Jump Suit"
symbol: "SUIT"
synced_at: null
token_address: "0x090dc9e47e674770daf3e7ed37c78f221fd059bc"
token_hash: "b1f97aa4f541ee01c77caa80a06985ce"
token_id: "1"
token_uri: "https://jordashtalon.github.io/LimitlessFlightNFTs/Generated/1.json"
}]
The token_uri appears to be setup correctly and goes to a live url, however the metadata itself is null without any of the metadata set and I canβt figure out why.