How to use the @iota/transaction.OBSOLETE_TAG_OFFSET function in @iota/transaction

To help you get started, we’ve selected a few @iota/transaction examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github iotaledger / trinity-wallet / src / shared / libs / iota / sweeps.js View on Github external
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)));
            }