// SPDX-License-Identifier: MIT pragma solidity ^0.8.23; // interfaces // libraries // contracts interface IERC5643Base { error ERC5643__InvalidTokenId(uint256 tokenId); error ERC5643__SubscriptionNotRenewable(uint256 tokenId); error ERC5643__NotApprovedOrOwner(); error ERC5643__DurationZero(); /// @notice Emitted when a subscription expiration changes /// @dev When a subscription is canceled, the expiration value should also be 0. event SubscriptionUpdate(uint256 indexed tokenId, uint64 expiration); } interface IERC5643 is IERC5643Base { /// @notice Renews the subscription to an NFT /// Throws if `tokenId` is not a valid NFT /// @param tokenId The NFT to renew the subscription for /// @param duration The number of seconds to extend a subscription for function renewSubscription(uint256 tokenId, uint64 duration) external payable; /// @notice Cancels the subscription of an NFT /// @dev Throws if `tokenId` is not a valid NFT /// @param tokenId The NFT to cancel the subscription for function cancelSubscription(uint256 tokenId) external payable; /// @notice Gets the expiration date of a subscription /// @dev Throws if `tokenId` is not a valid NFT /// @param tokenId The NFT to get the expiration date of /// @return The expiration date of the subscription function expiresAt(uint256 tokenId) external view returns (uint64); /// @notice Determines whether a subscription can be renewed /// @dev Throws if `tokenId` is not a valid NFT /// @param tokenId The NFT to get the expiration date of /// @return The renewability of a the subscription function isRenewable(uint256 tokenId) external view returns (bool); }