All objects are created in a similar fashion, and we will use StakingContract as an example
Here you can create a Staking Contract with a given ERC20 Contract Address, login with metamask & connect with solidity methods available
import { Web3Connection, StakingContract } from'@taikai/dappkit';constweb3Connection=newWeb3Connection({ web3Host:'WEB3_LINK'});awaitweb3Connection.start();constdeployer=newStakingContract(web3Connection);awaitdeployer.loadAbi();awaitweb3Connection.connect();consttx=awaitdeployer.deployJsonAbi('0xCONTRACT_ADDRESS');// Creating new Instance of StakingContract to be able to access the tokensconststakingContract=newStakingContract(web3Connection,tx.contractAddress);awaitstakingContract.start();console.log(awaitstakingContract.availableTokens());
What if the contract was deployed already?
If the Contract is already deployed the use case is very similar