typescript-sdk

Home > @3rdweb/sdk > MarketplaceModule

MarketplaceModule class

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

Signature:

export declare class MarketplaceModule extends ModuleWithRoles<Marketplace> implements IMarketplace 

Extends: ModuleWithRoles<Marketplace>

Implements: IMarketplace

Example

import { ThirdwebSDK } from "@3rdweb/sdk";

// You can switch out this provider with any wallet or provider setup you like.
const provider = ethers.Wallet.createRandom();
const sdk = new ThirdwebSDK(provider);
const module = sdk.getMarketplaceModule("");

Properties

Property Modifiers Type Description
moduleType static ModuleType  
roles static readonly [“admin”, “lister”, “asset”]  

Methods

Method Modifiers Description
acceptDirectListingOffer(listingId, addressOfOfferor)    
allowListingFromAnyAsset()    
allowListingFromSpecificAssetOnly(contractAddress)    
buyoutAuctionListing(listingId)   Buyout Auction
buyoutDirectListing(_buyout)   Buy Listing
buyoutListing(listingId, quantityDesired)    
cancelAuctionListing(listingId)   Cancel Auction Listing
cancelDirectListing(listingId)   Cancel Direct Listing
closeAuctionListing(listingId, closeFor)    
createAuctionListing(listing)   Create Auction
createDirectListing(listing)   Create Direct Listing
getActiveOffer(listingId, address)    
getAllListings(filter)    
getAuctionListing(listingId)    
getAuctionWinner(listingId)   Get Auction Winner
getBidBufferBps()    
getDirectListing(listingId)    
getListing(listingId)    
getTimeBufferInSeconds()    
getWinningBid(listingId)   Get Highest Bid
isRestrictedListerRoleOnly()    
isWinningBid(winningPrice, newBidPrice, bidBuffer)    
makeAuctionListingBid(bid)   Bid On Auction
makeDirectListingOffer(offer)    
setBidBufferBps(buffer)    
setRestrictedListerRoleOnly(isRestricted)    
setTimeBufferInSeconds(buffer)    
updateAuctionListing(listing)    
updateDirectListing(listing)