Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const outcome = createBundleMiner({
signedNormalizedBundle: minNormalizedBundle(normalizedBundles, numberOfFragments),
essence: bundleEssence(unsignedBundle),
numberOfFragments,
offset,
count,
}).start();
if (outcome.tritSecurityLevel > optimalOutcome.tritSecurityLevel) {
optimalOutcome = outcome;
}
offset += count;
}
unsignedBundle.set(valueToTrits(optimalOutcome.index), Transaction.OBSOLETE_TAG_OFFSET);
const bundle = finalizeBundle(unsignedBundle);
const cached = {
transactionObjects: [],
trytes: [],
};
return seedStore
.getSeed(true)
.then((seed) => signatureFragments(seed, input.index, numberOfFragments, optimalOutcome.bundle))
.then((_signatureFragments) => {
bundle.set(addSignatureOrMessage(bundle, _signatureFragments, 1));
for (let offset = 0; offset < bundle.length; offset += Transaction.TRANSACTION_LENGTH) {
cached.trytes.push(tritsToTrytes(bundle.subarray(offset, offset + Transaction.TRANSACTION_LENGTH)));
}