Updating NFTs
If a token subscribed to an entity, it is possible to update the URI slot (subscription asset) of the token. This feature is useful for the entities that want to update their subscribers NFTs' metadata.
There are 3 functions that can be used to update the URI slot of a token in mQuarkSubscriber contract;
/**
* @param signature Signed data by the entity's wallet
* @param updateInfo Encoded data containing the following:
* - entity: Address of the entity that is responsible for the slot
* - entityId: ID of the entity
* - tokenContract: Contract address of the given token (external contract or mQuark)
* - tokenId: Token ID
* - updatedUri: The newly generated URI for the token
*/
function updateURISlot(
bytes calldata signature,
bytes calldata updateInfo
) external
/**
* @param _signature Signed data by the entity's wallet
* @param _updateInfo Encoded data containing the following:
* - entity: Address of the entity that is responsible for the slot
* - entityId: ID of the entity
* - tokenContract: Contract address of the given token (external contract or mQuark)
* - tokenId: Token ID
* - updatedUri: The newly generated URI for the token
* @param _isSlotURIUpdate Boolean indicating if the update is for a slot URI or a token URI
*/
function directUpdateURISlot(
bytes calldata _signature,
bytes calldata _updateInfo,
bool _isSlotURIUpdate
) external
/**
* @param _signatures Signed data by the entity's wallet
* @param _updatedUris The updated URIs of the entity slot
* @param _tokenIds The IDs of the tokens.
* @param _entityId The ID of the entity.
* @param _contractAddress Address of the given token contract (external contract or mQuark)
* @param _isSlotURIUpdate Boolean indicating if the update is for a slot URI or a token URI
*/
function directUpdateURISlots(
bytes[] calldata _signatures,
string[] calldata _updatedUris,
uint256[] calldata _tokenIds,
uint256 _entityId,
address _contractAddress,
bool _isSlotURIUpdate
) external
Entities should sign the data with the private key of the entity, if it is not changed later on the subscriber contract.
- Further details can be found here.