UNPKG

mev-inspect

Version:

A JS port of 'mev-inspect-py' optimised for ease of use.

29 lines 926 B
import { isValidPool } from '../classifier/index.js'; function getMarketAddress(log) { return log.address.toLowerCase(); } function getRepayments(chainId, markets, logs) { return logs .map((log) => { if (log.classifier.type !== 'repayment') { return null; } const marketAddress = getMarketAddress(log); const market = markets.find((pool) => pool.address === marketAddress); if (!market) { return null; } const protocol = log.classifier.protocol; if (!protocol) { return null; } const lendingProtocol = protocol; if (!isValidPool(chainId, lendingProtocol, market.pool.address)) { return null; } return log.classifier.parse(market, log); }) .filter((repayment) => !!repayment); } export default getRepayments; //# sourceMappingURL=repayments.js.map