Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

englishauction state

Back to all declarations

Auction

type

Auction is a single ascending-bid auction.

Value

englishauction.Auction

auctions

v0.Tree

// key(id) -> \*Auction

Open
OID
0bc6e4…a5b5:4
auctions details

Inspect ref

pending

v0.Tree

// "\<id>:\<addr>" -> uint64 refundable amount

Open
OID
0bc6e4…a5b5:6
pending details

Inspect ref

nextID

int64

Value

1

key

func(id int64) string

key formats an id into a zero-padded, lexicographically-sortable string.

Open
OID
0bc6e4…a5b5:8
key details

Inspect func

pendKey

func(id int64, bidder .uverse.address) string

pendKey formats the refund key for a given auction id and bidder.

Open
OID
0bc6e4…a5b5:10
pendKey details

Inspect func

Start

func(item string, durationBlocks int64) int64

Start opens a new auction for \`item\` running for \`durationBlocks\` blocks from the current height. The caller becomes the seller. Returns the auction id.

Open
OID
0bc6e4…a5b5:11
Start details

Inspect func

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.

Open
OID
0bc6e4…a5b5:12
Bid details

Inspect func

Withdraw

func(id int64) uint64

Withdraw refunds the caller's accumulated displaced bids for auction \`id\`. Returns the amount refunded (0 if nothing pending).

Open
OID
0bc6e4…a5b5:13
Withdraw details

Inspect func

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.

Open
OID
0bc6e4…a5b5:14
End details

Inspect func

mustGet

func(id int64) *englishauction.Auction

mustGet returns the auction for \`id\`, panicking if it does not exist.

Open
OID
0bc6e4…a5b5:15
mustGet details

Inspect func

pendingOf

func(id int64, bidder .uverse.address) uint64

pendingOf returns the refundable amount owed to \`bidder\` for auction \`id\`.

Open
OID
0bc6e4…a5b5:16
pendingOf details

Inspect func

blocksLeft

func(a *englishauction.Auction, height int64) int64

blocksLeft returns how many blocks remain before \`a\` can be ended (0 if the end height has been reached).

Open
OID
0bc6e4…a5b5:17
blocksLeft details

Inspect func

hasWinner

func(a *englishauction.Auction) bool

hasWinner reports whether the auction received at least one bid.

Open
OID
0bc6e4…a5b5:18
hasWinner details

Inspect func

Render

func(path string) string

Render lists every auction with item, top bid + bidder, time left, and winner.

Open
OID
0bc6e4…a5b5:19
Render details

Inspect func
Auction : type =englishauction.Auction
auctions : v0.Tree Inspect
pending : v0.Tree Inspect
nextID : int64 =1
key : func(id int64) string Inspect
pendKey : func(id int64, bidder .uverse.address) string Inspect
Start : func(item string, durationBlocks int64) int64 Inspect
Bid : func(id int64, amount uint64) Inspect
Withdraw : func(id int64) uint64 Inspect
End : func(id int64) Inspect
mustGet : func(id int64) *englishauction.Auction Inspect
pendingOf : func(id int64, bidder .uverse.address) uint64 Inspect
blocksLeft : func(a *englishauction.Auction, height int64) int64 Inspect
hasWinner : func(a *englishauction.Auction) bool Inspect
Render : func(path string) string Inspect