import { ethers } from 'ethers'; import type { NamedLogs, ContractEventNames, ContractWithEvents } from '../types/events'; /** * Parse and strongly type event logs from a transaction receipt using a contract instance and an optional filter. * * @param args.contractInstance The contract instance to parse logs from. * @param args.txReceipt The transaction receipt to parse logs from. * @param [args.filter=] An optional filter to filter logs by. Filters are names of events in the contract (e.g., * `CreateCertificate` can be used to filter the events by passing this function `['CreateCertificate']` as the * `args.filter` argument). * @returns An array of strongly typed logs with type support based on `args.contractInstance`. Note that all events in * the logs array which use `args.values` in their event signature will have `args.values` remapped to `args.vals` due * to a {@link https://github.com/ethers-io/ethers.js/discussions/3542#discussioncomment-4214097| limitation} of * JavaScript. * @example *