contractAction - Instance of ContractFunction. ContractFunctions are all contract methods constructed with eoslime
constfaucetContract=eoslime.Contract.fromFile(FAUCET_ABI_PATH,faucetAccount.name, faucetAccount);// produce is a ContractFunction constructed from the contract ABIawaitfaucetContract.actions.produce
actionData - An array of the parameters you will want the produce function to be called with
You are loading actually the proposer account with
MultiSigAccount.load
When you are proposing a transaction, behind the scene the proposer approves it.
constfaucetContract=eoslime.Contract.fromFile(FAUCET_ABI_PATH,faucetAccount.name, faucetAccount);// produce is a ContractFunction constructed from the contract ABIawaitfaucetContract.actions.produce
constproposer=awaiteoslime.Account.createRandom();constonBehalfAccounts=awaiteoslime.Account.createRandoms(2);awaitproposer.addOnBehalfAccount(onBehalfAccounts[0].name);awaitproposer.addOnBehalfAccount(onBehalfAccounts[1].name);awaitproposer.increaseThreshold(2);constmultiSigAccount=eoslime.MultiSigAccount.load(proposer.name,proposer.privateKey);multiSigAccount.loadAccounts(onBehalfAccounts);constproposalId=awaitmultiSigAccount.propose(faucetContract.actions.produce, [account.name,"100.0000 TKNS",account.name,"memo"]);awaitmultiSigAccount.approve(multiSigAccount.accounts[0].publicKey, proposalId);/*By doing propose, the proposer approves the transactionIn order the transaction to be executed it requires 2 signaturesbecause of the treshold. That is why we need only one approve*/consttxReceipt=awaitmultiSigAccount.processProposal(proposalId);