Skip to main content

Collection

The Collection Service is a service that allows you to interact with deployed collection contracts. It is mainly used to mint NFTs and get useful information. For technical reference please check here.

mint

After creating the collection, mint phase starts. This phase is important because, end-users get their NFTs calling mint functions. Our service's mint function bundles all the available ones on the contract and, with the given configuration, calls the right minting function on the contract and mints an NFT for the caller.

For further reference check here

mint(mintOptions: MintOptions)

type MintOptions = {
value: string;
type: 'free' | 'paid';
model: 'static' | 'dynamic' | 'limited';
isWhitelisted: boolean;
entityId?: string;
owner?: string;
owners?: string[];
variation?: string;
variations?: string[];
uri?: string;
uris?: string[];
merkleProof?: string[];
merkleProofs?: string[][];
signer?: string;
signature?: string;
signatures?: string[];
salt?: string;
salts?: string[];
directUpdateEnabled?: boolean;
directUpdateEnableds?: boolean[];
};

airdropMint

airdropMint(mintOptions: MintOptions)

type MintOptions = {
value: string;
owner: string;
variation: string;
uri: string;
merkleProof: string[];
signature: string;
salt: string;
};

airdropBatchMint

airdropBatchMint(mintOptions: MintOptions)

type MintOptions = {
value: string;
owners: string[];
variations: string[];
uris: string[];
merkleProofs: string[][];
signatures: string[];
salts: string[];
};

mintBatch

mintBatch(mintOptions: MintOptions)

type MintOptions = {
value: string;
variations: string[];
merkleProofs: string[][];
signatures: string[];
uris: string[];
salts: string[];
};

airdropSubscriptionMint

airdropSubscriptionMint(mintOptions: MintOptions)

type MintOptions = {
value: string;
entityId: string;
owner: string;
variation: string;
uri: string;
merkleProof: string[];
signature: string;
salt: string;
directUpdateEnabled: boolean;
};

airdropBatchSubscriptionMint

airdropBatchSubscriptionMint(mintOptions: MintOptions)

type MintOptions = {
value: string;
entityId: string;
owners: string[];
variations: string[];
uris: string[];
merkleProofs?: string[][];
signatures: string[];
salts: string[];
directUpdateEnableds: boolean[];
};

subscriptionMint

subscriptionMint(mintOptions: MintOptions)

type MintOptions = {
value: string;
entityId: string;
variation: string;
uri: string;
merkleProof: string[];
signature: string;
salt: string;
directUpdateEnabled: boolean;
};

transferOwnership

Transfers the ownership of the collection to a new owner. Ownership gives special abilities to the owner. Trasnfering ownership can only be done by the owner.

For technical info, check here.

transferOwnership( newOwner: string)

getOwnerBalance

Returns the balance of the owner of the collection. If the collection is a paid one, sent amounts will be saved on the contract and via this service it calls the contract's function and returns the balance.

For technical info, check here.

 getOwnerBalance(): Promise<BigNumber>

getProtocolBalance

Since mQuark is the provider of the protocol, it gets a small fee from the minting process. This function returns the balance of the protocol.

For technical info, check here.

getProtocolBalance(): Promise<BigNumber>

getCollectionInfo

Collection info includes usufel information to show on the UI or to use in some of the functions like in the mint process to get collection mint price, or how many NFTs are minted from the collection, etc.

For technical info, check here.

getCollectionInfo(): Promise<CollectionInfo>

tokenEntityURI

If a token subscribed to an entity, it will have an additional URI. To read each entity URI on the NFT, this function should be called.

For technical info, check here.

tokenEntityURI( _tokenId: BigNumber,  _entityId: BigNumber): Promise<string>

tokenURI

Implementation of the ERC721 standard function with the same name in the contract.Returns the URI(points to metadata) of the token with the given id.

tokenURI(id: string): Promise<string>