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