newListingEvent

Creates an event object for the NewListing event.

Example

import { getContractEvents } from "thirdweb";
import { newListingEvent } from "thirdweb/extensions/marketplace";
const events = await getContractEvents({
contract,
events: [
newListingEvent({
listingCreator: ...,
listingId: ...,
assetContract: ...,
})
],
});
function newListingEvent(
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 components: readonly [
{ readonly name: "listingId"; readonly type: "uint256" },
{ readonly name: "tokenId"; readonly type: "uint256" },
{ readonly name: "quantity"; readonly type: "uint256" },
{ readonly name: "pricePerToken"; readonly type: "uint256" },
{ readonly name: "startTimestamp"; readonly type: "uint128" },
{ readonly name: "endTimestamp"; readonly type: "uint128" },
{ readonly name: "listingCreator"; readonly type: "address" },
{ readonly name: "assetContract"; readonly type: "address" },
{ readonly name: "currency"; readonly type: "address" },
{ readonly name: "tokenType"; readonly type: "uint8" },
{ readonly name: "status"; readonly type: "uint8" },
{ readonly name: "reserved"; readonly type: "bool" },
];
readonly name: "listing";
readonly type: "tuple";
},
];
readonly name: "NewListing";
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 components: readonly [
{ readonly name: "listingId"; readonly type: "uint256" },
{ readonly name: "tokenId"; readonly type: "uint256" },
{ readonly name: "quantity"; readonly type: "uint256" },
{ readonly name: "pricePerToken"; readonly type: "uint256" },
{ readonly name: "startTimestamp"; readonly type: "uint128" },
{ readonly name: "endTimestamp"; readonly type: "uint128" },
{ readonly name: "listingCreator"; readonly type: "address" },
{ readonly name: "assetContract"; readonly type: "address" },
{ readonly name: "currency"; readonly type: "address" },
{ readonly name: "tokenType"; readonly type: "uint8" },
{ readonly name: "status"; readonly type: "uint8" },
{ readonly name: "reserved"; readonly type: "bool" },
];
readonly name: "listing";
readonly type: "tuple";
},
];
readonly name: "NewListing";
readonly type: "event";
}>;

The prepared event object.