import connectWallet, { wallets } from '../components/wallet/connectWallet';
connectWallet(wallets.WALLETCONNECT).then((provider) => {
console.log(provider);
});
Options (more to be added):
- wallets.WALLETCONNECT
- wallets.METAMASK
- Include the following code to deploy ERC20/721/1155 contract.
- For this, must include the contract creation options as shown below for different ERCs and kind in the deploy function.
- enum for kind are :
**ERC20, ERC721, ERC1155**
{
"name": "TestToken",
"symbol": "TST",
"burnable": true,
"pausable": true,
"premint": "", # any interger value as string
"mintable": true,
"permit": false,
"access": "ownable",
"info": {
"securityContact": "rg@email.com",
"license": "MIT"
}
}
{
"name": "TestNFT",
"symbol": "TNFT",
"baseUri": "https://dvsfdg.com/samplenft.png",
"enumerable": false,
"uriStorage": true,
"burnable": false,
"pausable": false,
"mintable": true,
"incremental": false,
"accesss": "ownable",
"info": {
"securityContact": "rg@email.com",
"license": "MIT"
}
}
{
"name": "TestNFTCollection",
"uri": "dhsgfdshgvjaghvdf",
"burnable": false,
"pausable": false,
"mintable": false,
"supply": true,
"accesss": "ownable",
"info": {
"securityContact": "rg@email.com",
"license": "MIT"
}
}
import { deployContract } from '../utils/contract_deployer';
import { ERCs } from '../utils/types';
import { ERC20Data } from './api/erc20';
const erc20Opts: ERC20Data = {
name: 'TestToken',
symbol: 'TTK',
burnable: false,
pausable: false,
premint: '0',
mintable: true,
permit: false,
accesss: 'ownable',
info: {
securityContact: 'abcg@email.com',
license: 'MIT',
},
};
const contractDetails = await deployContract(erc20Opts, ERCs.ERC20, provider);
console.log(contractDetails);
// prints (contractDetails):
/* {
contractAddress: '0x834a27aba12F5490c0F54e8228C7fC939f16863e',
confirmationLink: 'https://mumbai.polygonscan.com/tx/0x0cdd1eec4ad7471d5cf87455ea30b22c56425e1625f6ca1278a4404f668e4711'
}*/
ERROR:
Type 'IterableIterator<Parent>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
SOLUTION:
https://github.com/Microsoft/TypeScript/issues/15446#issuecomment-391010337