Skip to main content

MarketplaceV3.englishAuctions property

Auctions

Example

// Data of the auction you want to create
const auction = {
// address of the contract of the asset you want to auction
assetContractAddress: "0x...",
// token ID of the asset you want to auction
tokenId: "0",
// how many of the asset you want to auction
quantity: 1,
// address of the currency contract that will be used to pay for the auctioned tokens
currencyContractAddress: NATIVE_TOKEN_ADDRESS,
// the minimum bid that will be accepted for the token
minimumBidAmount: "1.5",
// how much people would have to bid to instantly buy the asset
buyoutBidAmount: "10",
// If a bid is made less than these many seconds before expiration, the expiration time is increased by this.
timeBufferInSeconds: "1000",
// A bid must be at least this much bps greater than the current winning bid
bidBufferBps: "100", // 100 bps stands for 1%
// when should the auction open up for bidding
startTimestamp: new Date(Date.now()),
// end time of auction
endTimestamp: new Date(Date.now() + 5 * 24 * 60 * 60 * 1000),
};

const tx = await contract.englishAuctions.createAuction(auction);
const receipt = tx.receipt; // the transaction receipt
const id = tx.id; // the id of the newly created auction

// And on the buyers side:
// The auction ID of the asset you want to bid on
const auctionId = 0;
// The total amount you are willing to bid for auctioned tokens
const bidAmount = 1;

await contract.englishAuctions.makeBid(auctionId, bidAmount);

Signature:

get englishAuctions(): MarketplaceV3EnglishAuctions<EnglishAuctionsLogic>;

Remarks

Create and manage auctions in your marketplace.