noob-ethereum
Version:
A simple Ethereum library
16 lines (15 loc) • 545 B
JavaScript
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;
}
;