UNPKG

noob-ethereum

Version:
16 lines (15 loc) 545 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.findTransactionInteraction = void 0; function findTransactionInteraction(block, from, to) { return block.transactions.reduce((acc, tx) => { if (isTransactionInteractionMatch(tx, from, to)) { acc.push(tx.hash); } return acc; }, []); } exports.findTransactionInteraction = findTransactionInteraction; function isTransactionInteractionMatch(tx, from, to) { return tx.from === from && tx.to === to ? true : false; }