UNPKG

@rep3/rep3-sdk

Version:

`rep3-sdk` is the ts package for projects to integrate rep3-protocol and services in their projects. This documentation will provide various ways and code snippets for the same. To know more about the protocol head over to our [docs](https://docs.rep3.gg/

24 lines (22 loc) 544 B
export enum EventsEnum { DaoContractDeployed = 'ProxyDeployed', MembershipClaimed = 'Claimed', IssueBadge = 'Issue', FunctionRouted = 'FunctionRouted', } export const eventListener = async ( contractInstance: any, eventType: EventsEnum, callbackFunction: Function, txHash: string ) => { contractInstance?.on(eventType, async (...args: any[]) => { if (args[args.length - 1].transactionHash === txHash) { try { await callbackFunction(args); } catch (error) { throw error; } } }); };