// You need to create an SmartContractconstsc=awaitsdk.generateSmartContract({ name:'Test SDK', blockchain:4, standard:'ERC-1155', symbol:'SDK', maxNFTs:100, description:'description', configuration: { mintPrice:10 }});//Or retrieve one that has not been deployed yetconstsc=awaitsdk.getSmartContract('6477098f222cdf6d9fd3c1dd');//...constnfts=sc.data.nfts;
If you want to get notified when your NFTs are minted, you can subscribe to the events Minteandome provides.
This subscription is very flexible and accepts some filters. In the example above, it will listen for all the minted NFTs that may happen. If you want to be more restrictive, you can use:
In this other example, it will listen only for that specific SmartContract minted NFTs, or for an specific NFT of an SmartContract. However, there is a better object oriented solution for this scenario:
// Get an instance of an SmartContract classconstsc=awaitsdk.getSmartContract('6477098f222cdf6d9fd3c1dd');constnft=sc.data.nfts[0]; // First NFT// Automatically unsubcribes after deployednft.onMint().subscribe({smartContractId, idNFT} => {console.log('Deployed SmartContract:', smartContractId);});