import { DecodedLogEntryEvent } from "@joincivil/typescript-types"; import { EthApi } from "@joincivil/ethapi"; import { TimestampedEvent } from "../types"; export function createTimestampedEvent(ethApi: EthApi, event: T): TimestampedEvent { // tslint:disable-next-line return Object.assign({}, event, { timestamp: async () => (await ethApi.getBlock(event.blockNumber!)).timestamp as number, }); }