Docs

useContractEvents

Watches contract events and returns the logs.

Example

import { useContractEvents } from "thirdweb/react";
import { tokensClaimedEvent } from "thirdweb/extensions/erc721";
const account = useActiveAccount();
const contractEvents = useContractEvents({
contract
events: [tokensClaimedEvent({ claimer: account?.address })],
});

Parameters

Returns

The contract events of the watched contract events.