5 ‐ Card Unlocks ‐ NFTs - Decentraland-Community-Modules/DCL-TCG-Framework-SDK7 GitHub Wiki
This section will go over linking card unlocks in the deck manager to both worn and owned wearables.
NFT/contract card unlocks must be created using the data interface below.
/** data interface for defining an nft contract linkage */
export interface ContractDataObject {
//indexing
id:CONTRACT_DATA_ID; //unique id for this contract/cardset
type:NFT_ACTIVATION_TYPE, //what level of activation ir required
urn:string; //targeted nft
//added cards
linkedCards:CardProvisionDataObject[];
}
Here is a breakdown of what each parameter does:
- id: This references the card group that will be unlocked when the wearable conditions are met.
- type: This defines if a wearable needs to be worn or owned for the card to be unlocked.
- urn: place a link to your targeted wearable contract here. For more information on linked wearables specifically, view the official documentation here.
- linkedCards: The card(s) and quantity of them are listed here.
Below is an example of an eye patch being worn and thereby unlocking 3 void cards in various quantities.
export const ContractData:ContractDataObject[] = [
. . .
//## wear eyepatch -> unlocks void cards
{
//indexing
id:CONTRACT_DATA_ID.UNLOCK_VOID_CARDS,
type:NFT_ACTIVATION_TYPE.WEAR,
urn:"urn:decentraland:off-chain:base-avatars:piratepatch",
//added cards
linkedCards:[
{ id:CARD_DATA_ID.SPELL_VOIDBOLT, count:3 },
{ id:CARD_DATA_ID.CHARACTER_VOID_GOLEM, count:5 },
{ id:CARD_DATA_ID.TERRAIN_VOID, count:1 },
],
},
. . .
];