Auction
typeAuction is a single ascending-bid auction.
Value
englishauction.Auction
auctions
v0.Tree// key(id) -> \*Auction
- OID
- 0bc6e4…a5b5:4
auctions details
pending
v0.Tree// "\<id>:\<addr>" -> uint64 refundable amount
- OID
- 0bc6e4…a5b5:6
pending details
nextID
int64Value
1
key
func(id int64) stringkey formats an id into a zero-padded, lexicographically-sortable string.
- OID
- 0bc6e4…a5b5:8
key details
pendKey
func(id int64, bidder .uverse.address) stringpendKey formats the refund key for a given auction id and bidder.
- OID
- 0bc6e4…a5b5:10
pendKey details
Start
func(item string, durationBlocks int64) int64Start opens a new auction for \`item\` running for \`durationBlocks\` blocks from the current height. The caller becomes the seller. Returns the auction id.
- OID
- 0bc6e4…a5b5:11
Start details
Bid
func(id int64, amount uint64)Bid places a bid of \`amount\` on auction \`id\`. It must strictly exceed the current highest bid. The displaced highest bid becomes refundable to its bidder via Withdraw.
- OID
- 0bc6e4…a5b5:12
Bid details
Withdraw
func(id int64) uint64Withdraw refunds the caller's accumulated displaced bids for auction \`id\`. Returns the amount refunded (0 if nothing pending).
- OID
- 0bc6e4…a5b5:13
Withdraw details
End
func(id int64)End closes auction \`id\` once its end height is reached, awarding the item to the highest bidder (if any). Anyone may call it.
- OID
- 0bc6e4…a5b5:14
End details
mustGet
func(id int64) *englishauction.AuctionmustGet returns the auction for \`id\`, panicking if it does not exist.
- OID
- 0bc6e4…a5b5:15
mustGet details
pendingOf
func(id int64, bidder .uverse.address) uint64pendingOf returns the refundable amount owed to \`bidder\` for auction \`id\`.
- OID
- 0bc6e4…a5b5:16
pendingOf details
blocksLeft
func(a *englishauction.Auction, height int64) int64blocksLeft returns how many blocks remain before \`a\` can be ended (0 if the end height has been reached).
- OID
- 0bc6e4…a5b5:17
blocksLeft details
hasWinner
func(a *englishauction.Auction) boolhasWinner reports whether the auction received at least one bid.
- OID
- 0bc6e4…a5b5:18
hasWinner details
Render
func(path string) stringRender lists every auction with item, top bid + bidder, time left, and winner.
- OID
- 0bc6e4…a5b5:19