Skip to main content

Marketplace class

Create your own whitelabel marketplace that enables users to buy and sell any digital assets.

Example

import { ThirdwebSDK } from "@thirdweb-dev/sdk";

const sdk = new ThirdwebSDK("{{chainName}}");
const contract = sdk.getMarketplace("{{contract_address}}");

Constructors

ConstructorModifiersDescription
(constructor)(network, address, storage, options, contractWrapper)Constructs a new instance of the Marketplace class

Properties

PropertyModifiersTypeDescription
auctionMarketplaceAuctionAuctions
contractAbistaticany
contractRolesstaticreadonly ["admin", "lister", "asset"]
contractTypestatic"marketplace"
directMarketplaceDirectDirect listings
encoderContractEncoder<MarketplaceContract>
estimatorGasCostEstimator<MarketplaceContract>
eventsContractEvents<MarketplaceContract>
metadataContractMetadata<MarketplaceContract, typeof Marketplace.schema>
platformFeesContractPlatformFee<MarketplaceContract>
rolesContractRoles<MarketplaceContract, typeof Marketplace.contractRoles[number]>

Methods

MethodModifiersDescription
allowListingFromAnyAsset()Allow listings from any NFT contract
allowListingFromSpecificAssetOnly(contractAddress)Restrict listing NFTs only from the specified NFT contract address. It is possible to allow listing from multiple contract addresses.
buyoutListing(listingId, quantityDesired, receiver)Purchase NFTs
getActiveListings(filter)Get all active listings
getAddress()
getAllListings(filter)Get all the listings
getBidBufferBps()Get the buffer in basis points between offers
getListing(listingId)Convenience function to get either a direct or auction listing
getTimeBufferInSeconds()get the buffer time in seconds between offers
getTotalCount()Get the total number of Listings
isRestrictedToListerRoleOnly()Get whether listing is restricted only to addresses with the Lister role
onNetworkUpdated(network)
setBidBufferBps(bufferBps)Set the Auction bid buffer
setTimeBufferInSeconds(bufferInSeconds)Set the Auction Time buffer:

Signature:

export declare class Marketplace implements UpdateableNetwork

Implements: UpdateableNetwork