Buyout an english auction
Rest
...args: [auctionId: BigNumberish]the transaction result
Buy a specific auction from the marketplace.
// The auction ID you want to buy
const auctionId = 0;
await contract.englishAuctions.buyoutAuction(auctionId);
EnglishAuctions
Rest
...args: [auctionId: BigNumberish]Cancel an english auction
Rest
...args: [auctionId: BigNumberish]the transaction result
Cancel an auction on the marketplace
// The ID of the auction you want to cancel
const auctionId = "0";
await contract.englishAuctions.cancelAuction(auctionId);
EnglishAuctions
Rest
...args: [auctionId: BigNumberish]Close the english auction for the bidder
Rest
...args: [auctionId: BigNumberish, closeFor?: string]the transaction result
Closes the Auction and executes the sale for the buyer.
// The ID of the auction you want to close
const auction = "0";
await contract.englishAuctions.closeAuctionForBidder(auctionId);
EnglishAuctions
Rest
...args: [auctionId: BigNumberish, closeFor?: string]Close the english auction for the seller
Rest
...args: [auctionId: BigNumberish]the transaction result
Closes the Auction and executes the sale for the seller.
// The ID of the auction you want to close
const auctionId = "0";
await contract.englishAuctions.closeAuctionForSeller(auctionId);
EnglishAuctions
Rest
...args: [auctionId: BigNumberish]Private
contractCreate an english auction
Rest
...args: [auction: { the transaction hash and the auction id
Create a new auction where people can bid on an asset.
// 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: "900", // 15 minutes by default
// A bid must be at least this much bps greater than the current winning bid
bidBufferBps: "500", // 5% by default
// 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
EnglishAuctions
Rest
...args: [auction: { Create a batch of new auctions
Rest
...args: [listings: { Create a batch of new auctions on the marketplace
const auctions = [...];
const tx = await contract.englishAuctions.createAuctionsBatch(auctions);
Rest
...args: [listings: { Close the english auction for both the seller and the bidder
Rest
...args: [auctionId: BigNumberish]the transaction result
Closes the Auction and executes the sale for both parties.
// The ID of the auction you want to close
const auction = "0";
await contract.englishAuctions.executeSale(auctionId);
EnglishAuctions
Rest
...args: [auctionId: BigNumberish]Bid on an english auction
Rest
...args: [auctionId: BigNumberish, bidAmount: string | number]the transaction result
Make a bid on an auction
// 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);
EnglishAuctions
Rest
...args: [auctionId: BigNumberish, bidAmount: string | number]Private
storagePrivate
applyOptional
filter: MarketplaceFilterWithoutOfferorGet all english auctions
Optional
filter: MarketplaceFilterWithoutOfferoroptional filter parameters
the Auction object array
const auctions = await contract.englishAuctions.getAll();
EnglishAuctions
Get all valid english auctions
Optional
filter: MarketplaceFilterWithoutOfferoroptional filter parameters
the Auction object array
const auctions = await contract.englishAuctions.getAllValid();
EnglishAuctions
Get a single english auction
the auction Id
the Auction object
const auctionId = 0;
const auction = await contract.englishAuctions.getAuction(auctionId);
EnglishAuctions
Get the buffer for an english auction
id of the auction
the buffer in basis points
// The ID of the auction you want to get the buffer for
const auctionId = "0";
const buffer = await contract.englishAuctions.getBidBufferBps(auctionId);
EnglishAuctions
Get the minimum next bid for an english auction
id of the auction
the minimum bid a user can place to outbid the previous highest bid
// The ID of the auction you want to get the minimum next bid for
const auctionId = "0";
const minimumNextBid = await contract.englishAuctions.getMinimumNextBid(auctionId);
EnglishAuctions
Get the winner for a specific english auction
the auction Id
the address of the auction winner
Get the winner of the auction after an auction ends.
// The auction ID of a closed english auction
const auctionId = 0;
const auctionWinner = await contract.englishAuctions.getWinner(auctionId);
EnglishAuctions
Get winning bid of an english auction
the auction Id
Get the current highest bid of an active auction.
// The ID of the auction
const auctionId = 0;
const winningBid = await contract.englishAuctions.getWinningBid(auctionId);
EnglishAuctions
Check if a bid is or will be a winning bid
Auction Id
Amount to bid
true if the bid is or will be a winning bid
const auctionId = 0;
const bidAmount = 100;
const isWinningBid = await contract.englishAuctions.isWinningBid(auctionId, bidAmount);
EnglishAuctions
Private
validateThrows error if auction could not be found
Auction to check for
Generated using TypeDoc
Handles auctions