Customizations

How you can customize the ArtCart

The easiest way to customize how players receive NFTs is by customizing the serverless functions.

  if(eligibleTemplates.length>0){
    //ADD ANY CUSTOM LOGIC HERE
    /*
    //------------------------
    */

    //getting random NFT index
    const index = Math.floor(Math.random()*eligibleTemplates.length);

    //getting cid (meta ipfs hash that defines NFT template
    const cid = eligibleTemplates[index].meta_ipfshash;

    //issuing NFT
    const responseNFT = await axios.post(`https://platform.artcart.cloud/api/transactional/nft`, {
      cid: cid,
      email: data.email
    }, { headers: { "Authorization": `Bearer ${token}` } });
    return { statusCode: 200 }

Once you get the list of eligible templates in the eligibleTemplates variable you can pick one of the templates based on any criteria such as rarity, player level etc.

In case of questions please visit our discord channel: https://discord.gg/YbnFjjPw

Last updated