approvalEvent

Creates an event object for the Approval event.

Example

import { getContractEvents } from "thirdweb";
import { approvalEvent } from "thirdweb/extensions/erc20";
const events = await getContractEvents({
contract,
events: [
approvalEvent({
owner: ...,
spender: ...,
})
],
});
function approvalEvent(
filters: Partial<{ owner: string; spender: string }>,
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "owner";
readonly type: "address";
},
{
readonly indexed: true;
readonly name: "spender";
readonly type: "address";
},
{ readonly name: "value"; readonly type: "uint256" },
];
readonly name: "Approval";
readonly type: "event";
}>;

Parameters

Optional filters to apply to the event.

Type

let filters: Partial<{ owner: string; spender: string }>;

Returns

let returnType: PreparedEvent<{
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "owner";
readonly type: "address";
},
{
readonly indexed: true;
readonly name: "spender";
readonly type: "address";
},
{ readonly name: "value"; readonly type: "uint256" },
];
readonly name: "Approval";
readonly type: "event";
}>;

The prepared event object.