typescript-sdk

Home > @3rdweb/sdk > MarketplaceModule > createAuctionListing

MarketplaceModule.createAuctionListing() method

Create Auction

Signature:

createAuctionListing(listing: NewAuctionListing): Promise<BigNumber>;

Parameters

Parameter Type Description
listing NewAuctionListing  

Returns:

Promise<BigNumber>

Remarks

Create a new auction where people can bid on an asset.

Example

// Data of the auction you want to create
const auction = {
  // address of the contract the asset you want to list is on
  assetContractAddress: "0x...",
  // token ID of the asset you want to list
  tokenId: "0",
  // in how many seconds with the listing open up
  startTimeInSeconds: 0,
  // how long the listing will be open for
  listingDurationInSeconds: 86400,
  // how many of the asset you want to list
  quantity: 1,
  // address of the currency contract that will be used to pay for the listing
  currencyContractAddress: "0x0000000000000000000000000000000000000000",
  // how much people would have to bid to instantly buy the asset
  buyoutPricePerToken: "10",
  // the minimum bid that will be accepted for the token
  reservePricePerToken: "1",
}

await module.createAuctionListing(auction);