import { ERC1155Standard, Web3Connection } from'@taikai/dappkit';/* Create your web3Connection */constweb3Connection=newWeb3Connection({ web3Host:'WEB3_LINK',/* privateKey: '' */});awaitweb3Connection.start();awaitweb3Connection.connect(); // if a privateKey was provided, can be ignored/* Create an ERC1155Standard Deployer */constdeployer=newERC1155Standard(web3Connection);/* Deploy the ERC1155 Contract */awaitdeployer.loadAbi();consttx=awaitdeployer.deployJsonAbi('http://localhost:1337/');/* Instantiate and use your new ERC1155 Token Contract*/consterc1155Contract=newERC1155Standard(web3connection,tx.contractAddress);awaiterc1155Contract.start();erc1155Contract.mint('0xTO_ADDRESS',0,1000,'0x12345678');
If you prefer your contract to be ownable, you can appeal to the erc-1155 ownable version:
import { ERC1155Ownable, Web3Connection } from'@taikai/dappkit';/* Create your web3Connection */constweb3Connection=newWeb3Connection({ web3Host:'WEB3_LINK',/* privateKey: '' */});awaitweb3Connection.start();awaitweb3Connection.connect(); // if a privateKey was provided, can be ignored/* Create an ERC1155Ownable Deployer */constdeployer=newERC1155Ownable(web3Connection);/* Deploy the ERC1155 Contract */awaitdeployer.loadAbi();consttx=awaitdeployer.deployJsonAbi('http://localhost:1337/');/* Instantiate and use your new ERC1155 Token Contract*/consterc1155Contract=newERC1155Ownable(web3connection,tx.contractAddress);awaiterc1155Contract.start();erc1155Contract.mint('0xTO_ADDRESS',0,1000,'0x12345678');