import type { AbiParameterToPrimitiveType } from "abitype"; import { prepareEvent } from "../../../../../event/prepare-event.js"; /** * Represents the filters for the "ApprovalForAll" event. */ export type ApprovalForAllEventFilters = Partial<{ owner: AbiParameterToPrimitiveType<{ type: "address"; name: "owner"; indexed: true; }>; operator: AbiParameterToPrimitiveType<{ type: "address"; name: "operator"; indexed: true; }>; }>; /** * Creates an event object for the ApprovalForAll event. * @param filters - Optional filters to apply to the event. * @returns The prepared event object. * @extension ERC721 * @example * ```ts * import { getContractEvents } from "thirdweb"; * import { approvalForAllEvent } from "thirdweb/extensions/erc721"; * * const events = await getContractEvents({ * contract, * events: [ * approvalForAllEvent({ * owner: ..., * operator: ..., * }) * ], * }); * ``` */ export function approvalForAllEvent(filters: ApprovalForAllEventFilters = {}) { return prepareEvent({ filters, signature: "event ApprovalForAll(address indexed owner, address indexed operator, bool approved)", }); }