import type { Abi, AbiEvent } from "abitype"; import type { Prettify } from "../../utils/type-utils.js"; import type { PreparedEvent } from "../prepare-event.js"; import { type GetContractEventsOptionsDirect } from "./get-events.js"; import type { ParseEventLogsResult } from "./parse-logs.js"; export type WatchContractEventsOptions[], TStrict extends boolean> = Prettify & { onEvents: (events: ParseEventLogsResult) => void; latestBlockNumber?: bigint; }>; /** * Listens for contract events from the blockchain. * @param options - The options for retrieving contract events. * @returns The unwatch function. * @example * ### Listen to all events for a contract * ```ts * import { watchContractEvents } from "thirdweb"; * const unwatch = watchContractEvents({ * contract: myContract, * onEvents: (events) => { * // do something with the events * }, * }); * ``` * * ### Listen to specific events for a contract * ```ts * import { prepareEvent, watchContractEvents } from "thirdweb"; * const myEvent = prepareEvent({ * event: "event MyEvent(uint256 myArg)", * }); * const events = await watchContractEvents({ * contract: myContract, * events: [myEvent], * onEvents: (events) => { * // do something with the events * }, * }); * ``` * @contract */ export declare function watchContractEvents[], const TStrict extends boolean = true>(options: WatchContractEventsOptions): () => void; //# sourceMappingURL=watch-events.d.ts.map