Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
throw new Error(
'One of the members for a Multisignature Transaction was not found. Check your initial account setup. Make sure all members exist',
);
}
membersAccounts.push(thisMember);
}
// Create basic multisignature object
const multisignatureObject = registerMultisignatureLisk({
lifetime: 1,
minimum: membersAccounts.length,
keysgroup: membersAccounts.map(aMember => aMember.publicKey),
});
multisignatureObject.timestamp = this.timestamp;
// Create a multisignature instance
const multisignatureTXInstance = new MultisignatureTransaction(
multisignatureObject,
);
multisignatureTXInstance.sign(targetAccount.passphrase);
// Add the signatures for each member
// eslint-disable-next-line no-restricted-syntax
for (const aMemberAccount of membersAccounts) {
const aSigObject = createSignatureObject(
multisignatureTXInstance.toJSON(),
aMemberAccount.passphrase,
);
multisignatureTXInstance.addMultisignature(null, aSigObject);
}
// Push it to the pending
this.state.pendingTransactions.push(multisignatureTXInstance);
this.lastTransactionId = multisignatureTXInstance._id;