Class: EnglishAuction

EnglishAuction()

An Auction Library Timed auction starting at a low price and increasing until no more bids are made. Also supports reserve price and automatic bidding.

Constructor

new EnglishAuction()

Source:

Methods

Bid(auctionId, userId, price)

Create a bid in an auction
Parameters:
Name Type Description
auctionId string auction id
userId string user id
price number price bud
Source:

CalcMinimumBid(auctionId) → {Promise}

Get the minimum next bid for the specified auction
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
Minimum bid price Promise will resolve to type number.
Type
Promise

CalcTimeRemaining(auctionId, now) → {Promise}

Get the time remaining for the specified auction
Parameters:
Name Type Description
auctionId string auction id
now number current unix timestamp
Source:
Returns:
Time remaining in seconds Promise will resolve to type number.
Type
Promise

Create(start, end, startingPrice, reservePrice, priceIncrement) → {Promise}

Create a new auction
Parameters:
Name Type Description
start number start time of auction
end number end time of auction
startingPrice number starting price of auction
reservePrice number reserve price for the auction (0 = none)
priceIncrement number price increments for bids in the auction
Source:
Returns:
auctionId Promise will resolve to type string.
Type
Promise

GetAuctionsEnding(endfrom, endto, page, perpage, sort, asc) → {Promise}

Get a list of auctions based on their end time
Parameters:
Name Type Description
endfrom number end from
endto number end to
page number
perpage number number of auctions per page
sort string field to sort by
asc boolean ascending (true) or descending (false)
Source:
Returns:
List of auctions ending in the specified period Promise will resolve to type array.
Type
Promise

GetAuctionsStarting(startfrom, startto, page, perpage, sort, asc) → {Promise}

Get a list of auctions based on their start time
Parameters:
Name Type Description
startfrom number start from
startto number start to
page number
perpage number number of auctions per page
sort string field to sort by
asc boolean ascending (true) or descending (false)
Source:
Returns:
List of auctions starting in the specified period Promise will resolve to type array.
Type
Promise

GetEnd(auctionId) → {Promise}

Check if auction has ended
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
true if auction has ended, false otherwise Promise will resolve to type boolean.
Type
Promise

GetHighestBidder(auctionId) → {Promise}

Get the highest bidder in an auction
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
Promise will resolve to type mixed.
Type
Promise

GetHighestBids(auctionId, numBids) → {Promise}

Get the highest bids in an auction
Parameters:
Name Type Description
auctionId string auction id
numBids number max number of highest bids to return
Source:
Returns:
Highest bids for the specified auction Promise will resolve to type array.
Type
Promise

GetNumberOfBids(auctionId) → {Promise}

Get the number of bids in an auction
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
Number of bids placed in the specified auction Promise will resolve to type number.
Type
Promise

GetOpenAuctions(page, perpage, sort, asc) → {Promise}

Get a list of currently running auctions
Parameters:
Name Type Description
page number
perpage number number of auctions per page
sort string field to sort by
asc boolean ascending (true) or descending (false)
Source:
Returns:
List of open auctions Promise will resolve to type array.
Type
Promise

GetPriceIncrement(auctionId) → {Promise}

Get the price increment for the specified auction
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
Price increment Promise will resolve to type number.
Type
Promise

GetReservePrice(auctionId) → {Promise}

Get the reserve price for the specified auction
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
Reserve price Promise will resolve to type number.
Type
Promise

GetStart(auctionId) → {Promise}

Get the start of an auction Will return a timestamp in milliseconds
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
start of auction Promise will resolve to type number.
Type
Promise

GetStartingPrice(auctionId) → {Promise}

Get the starting price for the specified auction
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
Starting price Promise will resolve to type number.
Type
Promise

HasEnded(auctionId) → {Promise}

Check if an auction has ended yet
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
true if auction has ended, false otherwise Promise will resolve to type boolean.
Type
Promise

HasStarted(auctionId) → {Promise}

Check if an auction has started yet
Parameters:
Name Type Description
auctionId string auction id
Source:
Returns:
true if auction has started, false otherwise Promise will resolve to type boolean.
Type
Promise