I have created an ERC1155 smart contract on Seplia testnet.
The contract works perfectly on OpenSea. It displays NFT data, collection data. However, when I import nft into MetaMask, the NFT information is displayed, but the images of the collection are not displayed in both of chrome extension and moblie MetaMask.
According to OpenSea, The contractURI of the contract specifies the metadata of the collection.
function contractURI() public view returns (string memory) {
return "collectionURI";
}
→Collection data not showing
And I have defined the variables of “name” and “image”.
string public name;
string public image;
→Collection name showing but image not showing
Does MetaMask not support the display of NFT collections on the testnet? If there is a way to display them, how should I do it?
From your description, it seems like you’re having trouble displaying NFT images on MetaMask, even though they appear correctly on OpenSea. This issue might be due to how MetaMask handles NFTs compared to other platforms like OpenSea.
MetaMask uses a feature called wallet_watchAsset to display NFTs. According to the MetaMask documentation, this feature is still experimental and currently only available on the desktop extension, not on mobile 10.
However, the fact that your NFTs are appearing in MetaMask at all suggests that the basic functionality is working. It’s possible that the issue lies with how MetaMask interprets the metadata associated with your NFTs.
Here are a few things you could check:
Metadata Format: Ensure that your NFT metadata is formatted correctly. The metadata should be a JSON object that includes fields for name, description, and image. The image field should contain a valid URL that points to an image file. If the URL is incorrect or the image file doesn’t exist, the image won’t display.
{
"name": "Your NFT Name",
"description": "Description of your NFT",
"image": "https://example.com/path/to/your/image.png"
}
Image File Type: Some browsers or extensions may have issues displaying certain types of image files. Try changing the image file type to see if that resolves the issue. Common formats include PNG, JPEG, and GIF.
Network Issues: If your image URLs are hosted on a server, there could be network issues preventing MetaMask from accessing the image files. Check the server hosting your images to ensure it’s running properly and accessible over the internet.
Browser Issues: Different browsers or versions of MetaMask may handle NFTs differently. If you’re using a different browser or version of MetaMask compared to OpenSea, try switching to see if that makes a difference.
If none of the above suggestions work, it’s possible that there’s a bug or limitation in MetaMask’s handling of NFTs. In this case, you might want to reach out to MetaMask’s support team for assistance here: https://support.metamask.io/
I appreciate your answer!
I tried the chrome browser and mobile (iOS).
The NFT meta information and images are fully displayed. On the other hand, the name and icon of the collection of NFTs displayed in the Collection tab in MetaMask are not displayed.