getContractEvents

Retrieves events from a contract based on the provided options.

Example

import { getContractEvents } from "thirdweb";
const events = await getContractEvents({
contract: myContract,
fromBlock: 123456n,
toBlock: 123456n,
events: [preparedEvent, preparedEvent2],
});
function getContractEvents(
options: GetContractEventsOptions<abi, abiEvents, TStrict>,
): Promise<GetContractEventsResult<abiEvents, TStrict>>;

Parameters

The options for retrieving events.

Type

let options: GetContractEventsOptions<abi, abiEvents, TStrict>;

Returns

let returnType: ParseEventLogsResult<abiEvents, TStrict>;

A promise that resolves to an array of parsed event logs. Note: toBlock and fromBlock are both inclusive.