transferEvent

Creates an event object for the Transfer event.

Example

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

Parameters

Optional filters to apply to the event.

Type

let filters: Partial<{ from: string; to: string; tokenId: bigint }>;

Returns

let returnType: PreparedEvent<{
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "from";
readonly type: "address";
},
{
readonly indexed: true;
readonly name: "to";
readonly type: "address";
},
{
readonly indexed: true;
readonly name: "tokenId";
readonly type: "uint256";
},
];
readonly name: "Transfer";
readonly type: "event";
}>;

The prepared event object.