Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
return this;
};
if (errors.length !== 0) {
throw new Error('Provided transaction is invalid.');
}
const { passphrase } = await getInputsFromSources({
passphrase: {
source: passphraseSource,
repeatPrompt: true,
},
});
if (!passphrase) {
throw new ValidationError('No passphrase was provided.');
}
const result = transactions.createSignatureObject(
transactionObject,
passphrase,
);
this.print(result);
}
}
withAccount: signerAccountAddress => {
const accountStore = Object.values(this.state.accounts);
const signerAccount = accountStore.find(
anAccount => anAccount.address === signerAccountAddress,
);
if (!signerAccount) {
throw new Error(
'Signer account not found make sure the account exists on your intial account state.',
);
}
const transactionSignature = createSignatureObject(
transactionToBeSigned.toJSON(),
signerAccount.passphrase,
);
transactionToBeSigned.signatures.push(transactionSignature.signature);
return this;
},
};