typescript-sdk

Home > @3rdweb/sdk > IMarketplace

IMarketplace interface

Signature:

export interface IMarketplace 

Methods

Method Description
acceptDirectListingOffer(listingId, addressOfOfferor) Accepts the offer of the specified wallet in addressofOfferor.
buyoutAuctionListing(listingId) Buyout the listing based on the buyout price.The offer must be higher as high as the buyout price in order for this buyout to succeed. If the buyout is too low, the method will throw an error.Buying out an auction listing will purchase all tokens regardless of the quantity. There is no way to buy a partial amount of the tokens.Assuming this transaction is successful, the buyer will instantly have access to the tokens and does not need to call closeAuctionListing.
buyoutDirectListing(buyout) Buyout the listing based on the buyout price.The offer must be higher as high as the buyout price in order for this buyout to succeed. If the buyout is too low, the method will throw an error.
buyoutListing(listingId, quantityDesired) Generic buyout method that will dynamically determine the listing type.Only direct listings support buying out a specific quantity, therefore the quantityDesired parameter is ignored if the listing ID passed in is an auction listing.
cancelAuctionListing(listingId) Cancels an auction listing. You can only cancel the listing if it has not started yet.
cancelDirectListing(listingId) Cancels a direct listing by updating the quantity to be sold to 0.
closeAuctionListing(listingId, closeFor) Closes an auction listing and distributes the payment/assets. You can only close the listing after it has already ended.This method must be called by both the buyer and the seller.When the buyer calls this method, the tokens they purchased will be distributed to the buyers wallet.When the seller calls this method, the winning bid will be distributed to the sellers wallet.
createAuctionListing(listing) Creates a new auction listing on a marketplace.
createDirectListing(listing) Creates a new direct listing on a marketplace.
getActiveOffer(listingId, address) If the address has made an offer to the specified listing, this method will fetch the offer and return it. If no offer has been made, this method will return undefined.
getAllListings() Fetch all the listings in the marketplace.
getAuctionListing(listingId) Fetch an auction listing by Id.
getBidBufferBps() Fetch the current bid buffer on the marketplace contract. The bid buffer is represented in basis points.This is a percentage (e.g. 5%). A new bid is considered to be a winning bid only if its bid amount is at least the bid buffer (e.g. 5%) greater than the previous winning bid. This prevents buyers from making very slightly higher bids to win the auctioned items.
getDirectListing(listingId) Fetch a direct listing by Id.
getListing(listingId) Helper method to fetch a listing without knowing the type.
getTimeBufferInSeconds() Fetch the current time buffer on the marketplace contract.This is measured in seconds (e.g. 15 minutes or 900 seconds). If a winning bid is made within the buffer of the auction closing (e.g. 15 minutes within the auction closing), the auction’s closing time is increased by the buffer toprevent buyers from making last minute winning bids, and to give time to other buyers to make a higher bid if they wish to.This value is formatter as basis points (e.g. 5% = 500).
getWinningBid(listingId) If there’s a winning big on the listing, this method will return it.
makeAuctionListingBid(bid) Make an offer on an auction. The offer must be at least current bid * bid buffer %) in order to be accepted.Bid buffer is configured on the Marketplace contract.Note: If you make a bid above the buyout price, you will automatically be awarded the the listing and the sale will be executed.// TODO: come back to currencyContractAddress
makeDirectListingOffer(offer) Make an offer on a direct listing.
setBidBufferBps(buffer) Sets the bid buffer on the marketplace contract. The bid buffer is represented in basis points.
setTimeBufferInSeconds(buffer) Sets the current time buffer on the marketplace contract.
updateAuctionListing(listing) Updates an auction listing.
updateDirectListing(listing) Updates a direct listing.