Entity
Entity service is used to interact with your Entity Contract on the mQuark Protocol that is given to you after registering. It manages the creation of NFT collections with additional useful functions.For technical reference please check here.
createCollection
Creates a brand new NFT Collection which is ready to be minted. Returns the deployed contract address. Every collection is a set of new NFTs. Please see our glossary for more information.
For technical info, check here.
async createCollection(
_collectionParams: CollectionParams,
_isDynamicUri: string,
_ERCimplementation: string,
_merkelRoot?: string
): Promise<string>
type CollectionParams = {
templateId: string; // The ID of the template associated with the collection
collectionURIs: string[]; // The URIs associated with the collection
totalSupply:string; // The total supply of tokens in the collection
mintPrice:string; // The price of minting a token in the collection
mintPerAccountLimit: string; // The maximum number of tokens that can be minted per wallet
name:string; // The name of the collection
symbol:string; // The symbol of the collection
verifier?: string; //The address of the verifier. It should be Externally Owned Account, it will be used to check signatures
isWhitelisted: boolean; // A flag indicating if the collection is whitelisted
}
importExternalCollection
If you have created a collection already before, this function allows you to import it to your Entitiy, and allows NFT owners to use subscription and upgrade features.
For technical info, check here.
async importExternalCollection(
_templateId:string,
_collectionAddress:string
)
transferOwnershipOfCollection
Since collections are belong to entities, this function allows you to transfer ownership of a collection to another entity.
For technical info, check here.
async transferOwnershipOfCollection( _newOwner:string, _collectionId:string)
collectFunds
Transfer funds from given collection IDs to this contract. It eases the process of collecting funds from collections.
For technical info, check here.
async collectFunds(_ids:string[])
withdraw
Witdraws the transferred funds.
For technical info, check here.
async withdraw()
getEntityInfo
Returns the information about the entity.
For technical info, check here.
async getEntityInfo(): Promise<EntityInfo>
type EntityInfo = {
contractAddress: string;
creator: string;
id: BigNumber;
name: string;
description: string;
thumbnail: string;
entitySlotDefaultURI: string;
}
getBalance
Returns the balance of the entity.
For technical info, check here.
async getBalance(): Promise<BigNumber>
getLastCollectionId
Collections have IDs, this function returns the last ID of the collections.
For technical info, check here.
async getLastCollectionId(): Promise<BigNumber>
getCollectionAddress
Returns the address of the collection with the given ID.
For technical info, check here.
async getCollectionAddress(collectionId: string):Promise<string>