Updating metadata

Notify OpenSea about metadata changes

When token metadata changes, emit the event for your token standard so OpenSea can refresh the affected item.

ERC-721 metadata updates

Use the ERC-4906 events for an individual token or a range of tokens:

event MetadataUpdate(uint256 _tokenId);
event BatchMetadataUpdate(uint256 _fromTokenId, uint256 _toTokenId);

To refresh a whole collection, set _toTokenId to type(uint256).max.

ERC-1155 metadata updates

Use the URI event defined by ERC-1155:

event URI(string _value, uint256 indexed _id);

You can also request a refresh with the Refresh NFT metadata endpoint.