newSaleEvent

Creates an event object for the NewSale event.

Example

import { getContractEvents } from "thirdweb";
import { newSaleEvent } from "thirdweb/extensions/marketplace";
const events = await getContractEvents({
contract,
events: [
newSaleEvent({
listingCreator: ...,
listingId: ...,
assetContract: ...,
})
],
});
function newSaleEvent(
filters: Partial<{
assetContract: string;
listingCreator: string;
listingId: bigint;
}>,
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "listingCreator";
readonly type: "address";
},
{
readonly indexed: true;
readonly name: "listingId";
readonly type: "uint256";
},
{
readonly indexed: true;
readonly name: "assetContract";
readonly type: "address";
},
{ readonly name: "tokenId"; readonly type: "uint256" },
{ readonly name: "buyer"; readonly type: "address" },
{ readonly name: "quantityBought"; readonly type: "uint256" },
{ readonly name: "totalPricePaid"; readonly type: "uint256" },
];
readonly name: "NewSale";
readonly type: "event";
}>;

Parameters

Optional filters to apply to the event.

Type

let filters: Partial<{
assetContract: string;
listingCreator: string;
listingId: bigint;
}>;

Returns

let returnType: PreparedEvent<{
readonly inputs: readonly [
{
readonly indexed: true;
readonly name: "listingCreator";
readonly type: "address";
},
{
readonly indexed: true;
readonly name: "listingId";
readonly type: "uint256";
},
{
readonly indexed: true;
readonly name: "assetContract";
readonly type: "address";
},
{ readonly name: "tokenId"; readonly type: "uint256" },
{ readonly name: "buyer"; readonly type: "address" },
{ readonly name: "quantityBought"; readonly type: "uint256" },
{ readonly name: "totalPricePaid"; readonly type: "uint256" },
];
readonly name: "NewSale";
readonly type: "event";
}>;

The prepared event object.