UNPKG

evx-sdk

Version:

The Evx SDK is a developer toolkit designed to simplify interaction with the Evx decentralized liquidity protocol. It provides an abstraction layer over the smart contracts, allowing developers to easily build applications, integrate liquidity pools, fetc

45 lines (44 loc) 1.82 kB
import { GovernanceContract } from '@contracts'; import { IEventListener } from '../../interfaces/listeners/IEventListener'; import { IProposalCreatedEvent } from '../../interfaces/events/governance/IProposalCreatedEvent'; /** * @title Proposal Created Event Listener * @notice Listens for ProposalCreated events from the Governance contract * @dev This listener monitors the governance contract for proposal creation events */ export declare class ProposalCreatedListener implements IEventListener<IProposalCreatedEvent> { private readonly governanceContract; private isListening; private eventFilter; private callbacks; constructor(governanceContract: GovernanceContract); /** * @notice Start listening for ProposalCreated events * @param callback Function to call when event is received */ start(callback: (event: IProposalCreatedEvent) => void | Promise<void>): Promise<void>; /** * @notice Add a callback to the listener * @param callback Function to call when event is received */ addCallback(callback: (event: IProposalCreatedEvent) => void | Promise<void>): void; /** * @notice Remove a callback from the listener * @param callback Function to remove */ removeCallback(callback: (event: IProposalCreatedEvent) => void | Promise<void>): void; /** * @notice Stop listening for events */ stop(): void; /** * @notice Get historical ProposalCreated events * @param fromBlock Starting block number * @param toBlock Ending block number (optional, defaults to latest) */ getHistoricalEvents(fromBlock: number, toBlock?: number | 'latest'): Promise<IProposalCreatedEvent[]>; /** * @notice Check if the listener is currently active */ get listening(): boolean; }