contractAction - Instance of ContractFunction. ContractFunctions are all contract methods constructed with eoslime
const faucetContract = eoslime.Contract.fromFile(FAUCET_ABI_PATH, faucetAccount.name, faucetAccount);
// produce is a ContractFunction constructed from the contract ABI
await faucetContract.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.
const faucetContract = eoslime.Contract.fromFile(FAUCET_ABI_PATH, faucetAccount.name, faucetAccount);
// produce is a ContractFunction constructed from the contract ABI
await faucetContract.actions.produce
const proposer = await eoslime.Account.createRandom();
const onBehalfAccounts = await eoslime.Account.createRandoms(2);
await proposer.addOnBehalfAccount(onBehalfAccounts[0].name);
await proposer.addOnBehalfAccount(onBehalfAccounts[1].name);
await proposer.increaseThreshold(2);
const multiSigAccount = eoslime.MultiSigAccount.load(proposer.name, proposer.privateKey);
multiSigAccount.loadAccounts(onBehalfAccounts);
const proposalId = await multiSigAccount.propose(faucetContract.actions.produce, [account.name, "100.0000 TKNS", account.name, "memo"]);
await multiSigAccount.approve(multiSigAccount.accounts[0].publicKey, proposalId);
/*
By doing propose, the proposer approves the transaction
In order the transaction to be executed it requires 2 signatures
because of the treshold. That is why we need only one approve
*/
const txReceipt = await multiSigAccount.processProposal(proposalId);