Buyout Auction
Rest
...args: [listingId: BigNumberish]Buy a specific direct listing from the marketplace.
// The listing ID of the asset you want to buy
const listingId = 0;
await contract.auction.buyoutListing(listingId);
Rest
...args: [listingId: BigNumberish]Cancel Auction Listing
Rest
...args: [listingId: BigNumberish]Cancel an auction listing on the marketplace
// The listing ID of the auction listing you want to cancel
const listingId = "0";
await contract.auction.cancelListing(listingId);
Rest
...args: [listingId: BigNumberish]Close the Auction for the buyer or the seller
Rest
...args: [listingId: BigNumberish, closeFor?: string]Closes the Auction and executes the sale for the buyer or the seller.
// The listing ID of the auction listing you want to close
const listingId = "0";
await contract.auction.closeListing(listingId);
Rest
...args: [listingId: BigNumberish, closeFor?: string]Private
contractCreate Auction
Rest
...args: [listing: NewAuctionListing]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 the asset you want to list is on
assetContractAddress: "0x...",
// token ID of the asset you want to list
tokenId: "0",
// when should the listing open up for offers
startTimestamp: new Date(),
// 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: NATIVE_TOKEN_ADDRESS,
// 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.5",
}
const tx = await contract.auction.createListing(auction);
const receipt = tx.receipt; // the transaction receipt
const id = tx.id; // the id of the newly created listing
Rest
...args: [listing: NewAuctionListing]Create a batch of new auctions
Rest
...args: [listings: NewAuctionListing[]]Create a batch of new auctions on the marketplace
const auctions = [...];
const tx = await contract.auction.createListingsBatch(auctions);
Rest
...args: [listings: NewAuctionListing[]]Execute the Auction Sale
Rest
...args: [listingId: BigNumberish]Closes the Auction and executes the sale for both parties.
// The listing ID of the auction listing you want to close
const listingId = "0";
await contract.auction.executeSale(listingId);
Rest
...args: [listingId: BigNumberish]Bid On Auction
Rest
...args: [listingId: BigNumberish, pricePerToken: string | number]Make a bid on an auction listing
// The listing ID of the asset you want to bid on
const listingId = 0;
// The price you are willing to bid for a single token of the listing
const pricePerToken = 1;
await contract.auction.makeBid(listingId, pricePerToken);
Rest
...args: [listingId: BigNumberish, pricePerToken: string | number]Private
storageUpdate an Auction listing with new metadata
Rest
...args: [listing: AuctionListing]Rest
...args: [listing: AuctionListing]Get an Auction listing by id
the listing Id
the Auction listing object
returns the minimum bid a user can place to outbid the previous highest bid
the listing id of the auction
Get Auction Winner
Get the winner of the auction after an auction ends.
// The listing ID of the auction that closed
const listingId = 0;
contract.auction.
.getWinner(listingId)
.then((auctionWinner) => console.log(auctionWinner))
.catch((err) => console.error(err));
Get Highest Bid
Get the current highest bid of an active auction.
// The listing ID of the auction that closed
const listingId = 0;
contract.auction.
.getWinningBid(listingId)
.then((offer) => console.log(offer))
.catch((err) => console.error(err));
Private
validateThrows error if listing could not be found
Listing to check for
Generated using TypeDoc
Handles auction listings