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],
});

Parameters

Returns

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