"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var event_1 = require("./event");
var EventFactory = /** @class */ (function () {
    // constructor
    function EventFactory(contract) {
        this.contract = contract;
        this.abiModel = this.contract.abiModel;
        this.abiCoder = this.contract.abiCoder;
        this.eventKeys = this.mapEventKeys();
    }
    EventFactory.prototype.addEventsToContract = function () {
        var _this = this;
        this.eventKeys.forEach(function (key) {
            var newObject = {};
            newObject[key] = function (params) {
                return new event_1.EventMethod(key, params, _this.abiModel.getEvent(key), _this.contract);
            };
            Object.assign(_this.contract.events, newObject);
        });
        return this.contract;
    };
    /**
     * @function mapMethodKeys
     * @return {string[]} {description}
     */
    EventFactory.prototype.mapEventKeys = function () {
        return Object.keys(this.abiModel.abi.events);
    };
    return EventFactory;
}());
exports.EventFactory = EventFactory;
//# sourceMappingURL=eventFactory.js.map