How to use the @iota/transaction.transactionHashValidator 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 / iota.js / packages / core / src / createBroadcastBundle.ts View on Github external
return function broadcastBundle(
        tailTransactionHash: Hash,
        callback?: Callback>
    ): Promise> {
        return Promise.resolve(validate(transactionHashValidator(tailTransactionHash)))
            .then(() => getBundle(tailTransactionHash))
            .then(asFinalTransactionTrytes)
            .then(broadcastTransactions)
            .asCallback(callback)
    }
}
github iotaledger / iota.js / packages / core / src / createReplayBundle.ts View on Github external
return function replayBundle(
        tail: Hash,
        depth: number,
        minWeightMagnitude: number,
        reference?: Hash,
        callback?: Callback
    ): Promise {
        return Promise.resolve(
            validate(
                transactionHashValidator(tail),
                depthValidator(depth),
                minWeightMagnitudeValidator(minWeightMagnitude)
            )
        )
            .then(() => getBundle(tail))
            .then(bundle => asFinalTransactionTrytes(bundle))
            .then(trytes => sendTrytes(trytes, depth, minWeightMagnitude, reference))
            .asCallback(typeof arguments[3] === 'function' ? arguments[3] : callback)
    }
}