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
Constructor | Modifiers | Description |
---|---|---|
(constructor)(network, address, storage, options, contractWrapper) | Constructs a new instance of the Marketplace class |
Properties
Property | Modifiers | Type | Description |
---|---|---|---|
auction | MarketplaceAuction | Auctions | |
contractAbi | static | any | |
contractRoles | static | readonly ["admin", "lister", "asset"] | |
contractType | static | "marketplace" | |
direct | MarketplaceDirect | Direct listings | |
encoder | ContractEncoder<MarketplaceContract> | ||
estimator | GasCostEstimator<MarketplaceContract> | ||
events | ContractEvents<MarketplaceContract> | ||
metadata | ContractMetadata<MarketplaceContract, typeof Marketplace.schema> | ||
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 | |
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