"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decodeEvents = exports.filterEvents = void 0;
const filterEvents = (blockEvents, name) => {
    var _a;
    return ((_a = blockEvents.events) === null || _a === void 0 ? void 0 : _a.filter(event => event.event === name)) || [];
};
exports.filterEvents = filterEvents;
const decodeEvents = (token, events) => {
    const decodedEvents = [];
    for (const event of events) {
        const getEventInterface = token.interface.getEvent(event.event || '');
        decodedEvents.push(token.interface.decodeEventLog(getEventInterface, event.data, event.topics));
    }
    return decodedEvents;
};
exports.decodeEvents = decodeEvents;
