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 = await sdk.getContract("{{contract_address}}", "marketplace");
Constructors
Constructor | Modifiers | Description |
---|---|---|
(constructor)(network, address, storage, options, abi, chainId, contractWrapper) | Constructs a new instance of the Marketplace class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
abi | Abi | ||
auction | MarketplaceAuction | Auctions | |
chainId | readonly | number | |
contractRoles | static | readonly ["admin", "lister", "asset"] | |
direct | MarketplaceDirect | Direct listings | |
encoder | ContractEncoder<MarketplaceContract> | ||
estimator | GasCostEstimator<MarketplaceContract> | ||
events | ContractEvents<MarketplaceContract> | ||
metadata | ContractMetadata<MarketplaceContract, typeof MarketplaceContractSchema> | ||
platformFees | ContractPlatformFee<MarketplaceContract> | ||
roles | ContractRoles<MarketplaceContract, typeof Marketplace.contractRoles[number]> |
Methods
Method | Modifiers | Description |
---|---|---|
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 | |
getOffers(listingId) | Get all the offers for a 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 | |
makeOffer(listingId, pricePerToken, quantity) | Make an offer for a Direct or Auction Listing | |
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