approvalEvent

Creates an event object for the Approval event.

Example

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

Parameters

Optional filters to apply to the event.

Type

let filters: Partial<{
approved: string;
owner: string;
tokenId: bigint;
}>;

Returns

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

The prepared event object.