Subscription
Subscription service for the protocol. Manages the subscription of NFTs to entities, updating the entity URIs and unlocking free NFTs.
subscribeToEntity
Subscription is a unique feature. It allows NFTs to subscribe to an entity and assigns additional URI.
For technical info, check here.
subscribeToEntity(
tokenId: string,
tokenContract: string,
subscriptionId: string,
subscriptionPrice: string
)
updateURISlot
Updates the URI of an entity on an NFT. It requires a valid signature signed by the verifier address which is given during the entity registration as a parameter or it may have been changed later. To generate the signature, see our utility functions here
For technical info, check here.
updateURISlot(_signature: string, _updateInfo: string)
unlockToken
Unlocks free mint NFTs. Free mint NFTs are locked to subscribe and as a result, locked to upgradability. By paying its template price, it can be unlocked.
For technical info, check here.
unlockToken(_signature: string, _tokenId: string, unlockPrice: string)
transferTokenEntityURI
Since an NFT has multiple URIs rather than having only one, it is possible to sell one of the URIs to another NFT. Resets the sold URI to the default URI and updates the URI of the buyer NFT with the URI of the seller NFT.
For technical info, check here.
transferTokenEntityURI(
seller: SellOrder,
buyer: BuyOrder,
sellerSignature: string,
buyerSignature: string
)
setDefaultURI
When an NFT is subscribed to an entity, it is assigned a default URI initially. It shows that the NFT is subscribed to the entity.
For technical info, check here.
setDefaultURI(
_entityId: string,
_defaultURI: string
)
withdraw
Withdraws saved funds from subscriptions for entities.
For technical info, check here.
withdraw(_entityId: string,_amount: string)
withdrawProtocol
Witdraws saved fees from subcriptions and unlocks for the protocol.
For technical info, check here.
withdrawProtocol(amount: string)
getIsAddressRegisteredAsEntity
Returns whether an address is registered as an entity or not.
For technical info, check here.
getIsAddressRegisteredAsEntity(address: string): Promise<boolean>
getEntityBalance
Returns the balance of an entity.
For technical info, check here.
getEntityBalance(entityId: string): Promise<BigNumber>
getEntityConfig
Returns the configuration of an entity.
For technical info, check here.
getEntityConfig(entityId: string): Promise<EntityConfig>
type EntityConfig = {
entityId: BigNumber;
subscriptionPrice: BigNumber;
defaultURI: string;
uriSet: boolean;
signer: string;
}
getIsUnlocked
Returns whether an NFT is unlocked or not.
For technical info, check here.
getIsUnlocked(tokenId:string, tokenContract:string): Promise<boolean>
getIsSubscribed
Returns whether an NFT is subscribed to an entity or not. Subscribing the same NFT to the same entity twice is not possible.
For technical info, check here.
getIsSubscribed(
_tokenId: string,
_tokenContract: string,
_subscriptionId: string
): Promise<boolean>
getCollection
Returns the collection of an entity.
For technical info, check here.
getCollection(
_contractAddress: string
): Promise<Collection>
calculateBatchSubscriptionPrice
Calculates the total price of a batch subscription.
For technical info, check here.
calculateBatchSubscriptionPrice(_subscriptionIds: string[]): Promise<BigNumber>