How to use the @iota/transaction.TRANSACTION_LENGTH 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
.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)));
            }

            const convertToTransactionObjects = (tryteString) => iota.utils.transactionObject(tryteString);
            cached.transactionObjects = map(cached.trytes, convertToTransactionObjects);

            // Check if prepared bundle is valid, especially if its signed correctly.
            if (isBundle(cached.transactionObjects)) {
                return getTransactionsToApproveAsync(settings)();
            }

            throw new Error(Errors.INVALID_BUNDLE);
        })
        .then(({ trunkTransaction, branchTransaction }) => {
github iotaledger / trinity-wallet / src / shared / libs / iota / sweeps.js View on Github external
.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)));
            }

            const convertToTransactionObjects = (tryteString) => iota.utils.transactionObject(tryteString);
            cached.transactionObjects = map(cached.trytes, convertToTransactionObjects);

            // Check if prepared bundle is valid, especially if its signed correctly.
            if (isBundle(cached.transactionObjects)) {
                return getTransactionsToApproveAsync(settings)();
            }

            throw new Error(Errors.INVALID_BUNDLE);
        })
        .then(({ trunkTransaction, branchTransaction }) => {