import type { Abi, AbiEvent, ExtractAbiEvent, ExtractAbiEventNames } from "abitype"; import type { ThirdwebContract } from "../../contract/contract.js"; import { type GetLogsBlockParams } from "../../rpc/actions/eth_getLogs.js"; import type { Prettify } from "../../utils/type-utils.js"; import { type PreparedEvent } from "../prepare-event.js"; import { type ParseEventLogsResult } from "./parse-logs.js"; export type GetContractEventsOptionsDirect[], TStrict extends boolean> = { contract: ThirdwebContract; events?: abiEvents; strict?: TStrict; useIndexer?: boolean; }; export type GetContractEventsOptions[], TStrict extends boolean> = Prettify & GetLogsBlockParams>; export type GetContractEventsResult[], TStrict extends boolean> = ParseEventLogsResult; /** * Retrieves events from a contract based on the provided options. * @param options - The options for retrieving events. * @returns A promise that resolves to an array of parsed event logs. * Note: toBlock and fromBlock are both inclusive. * @example * ```ts * import { getContractEvents } from "thirdweb"; * const events = await getContractEvents({ * contract: myContract, * fromBlock: 123456n, * toBlock: 123456n, * events: [preparedEvent, preparedEvent2], * }); * ``` * @example * Optionally specify a blockRange as the number of blocks to retrieve. toBlock will default to the current block number. * ```ts * import { getContractEvents } from "thirdweb"; * const events = await getContractEvents({ * contract: myContract, * blockRange: 123456n, * events: [preparedEvent, preparedEvent2], * }); * ``` * @example * Use fromBlock with blockRange for pagination. * ```ts * import { getContractEvents } from "thirdweb"; * const events = await getContractEvents({ * contract: myContract, * fromBlock: lastBlockFetched, * blockRange: 123456n, * events: [preparedEvent, preparedEvent2], * }); * ``` * @example * Retrieve events for a specific block hash. * ```ts * import { getContractEvents } from "thirdweb"; * const events = await getContractEvents({ * contract: myContract, * blockHash: "0x...", * events: [preparedEvent, preparedEvent2], * }); * ``` * @contract */ export declare function getContractEvents[] = PreparedEvent>>[], const TStrict extends boolean = true>(options: GetContractEventsOptions): Promise>; //# sourceMappingURL=get-events.d.ts.map