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.73 kB
TypeScript
import { GovernanceContract } from '@contracts';
import { IEventListener } from '../../interfaces/listeners/IEventListener';
import { IVoteCastEvent } from '../../interfaces/events/governance/IVoteCastEvent';
/**
* @title Vote Cast Event Listener
* @notice Listens for VoteCast events from the Governance contract
* @dev This listener monitors the governance contract for vote casting events
*/
export declare class VoteCastListener implements IEventListener<IVoteCastEvent> {
private readonly governanceContract;
private isListening;
private eventFilter;
private callbacks;
constructor(governanceContract: GovernanceContract);
/**
* @notice Start listening for VoteCast events
* @param callback Function to call when event is received
*/
start(callback: (event: IVoteCastEvent) => void | Promise<void>): Promise<void>;
/**
* @notice Add a callback to the listener
* @param callback Function to call when event is received
*/
addCallback(callback: (event: IVoteCastEvent) => void | Promise<void>): void;
/**
* @notice Remove a callback from the listener
* @param callback Function to remove
*/
removeCallback(callback: (event: IVoteCastEvent) => void | Promise<void>): void;
/**
* @notice Stop listening for events
*/
stop(): void;
/**
* @notice Get historical VoteCast events
* @param fromBlock Starting block number
* @param toBlock Ending block number (optional, defaults to latest)
*/
getHistoricalEvents(fromBlock: number, toBlock?: number | 'latest'): Promise<IVoteCastEvent[]>;
/**
* @notice Check if the listener is currently active
*/
get listening(): boolean;
}