useContractEventListener()
function useContractEventListener<TContract, TEventName>(
contract,
address,
eventName,
listener,
options?): void;
Defined in: packages/react/src/hooks/use-contract-event-listener.ts:22
Hook for listening to contract events.
Type Parameters
| Type Parameter |
|---|
TContract extends Contract |
TEventName extends string |
Parameters
| Parameter | Type | Description |
|---|---|---|
contract | TContract | The contract instance to listen to events from |
address | Address | undefined | The contract address |
eventName | TEventName | The name of the event to listen for |
listener | (event) => void | Callback function invoked when the event is emitted |
options? | Partial<ChainOptions<string | number | undefined>> | Additional options |
Returns
void