How to get notified when the SmartContract gets deployed
The Scheduler deploys your SmartContracts automatically.
// 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');
If you want to get notified when your SmartContract is deployed, 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 SmartContracts deploys 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 deploy. However, if you only want to check when a single SmartContract has been deployed, the best option is to use object oriented solution:
// Get an instance of an SmartContract classconstsc=awaitsdk.getSmartContract('6477098f222cdf6d9fd3c1dd');// Automatically unsubcribes after deployedsc.onDeploy().subscribe({smartContractId} => {console.log('Deployed SmartContract:', smartContractId);});
Pending transactions
All of the examples above are from deployments by which their transactions have been completed. if you want early access to the pending transaction on the blockchain, you can use an extra param: