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

v0 state

Back to all declarations

denom

untyped string

Value

"ugnot"

status

type

Value

v0.status

statusActive

v0.status

Value

<zero>

statusSold

v0.status

Value

<zero>

statusCancelled

v0.status

Value

<zero>

auction

type

auction is one listing: price falls linearly from StartPrice to FloorPrice over Duration blocks starting at StartHeight, then holds flat at FloorPrice until bought or cancelled.

Value

v0.auction

auctions

v0.Tree

// id string -> \*auction

Open
OID
0ed89f…44dd:4
auctions details

Inspect ref

nextID

uint64

Value

0

totalListed

uint64

Value

0

totalSold

uint64

Value

0

totalVolume

int64

Value

0

List

func(item string, startPrice int64, floorPrice int64, durationBlocks int64) string

List creates a new Dutch auction for item, starting at startPrice ugnot and falling linearly to floorPrice over durationBlocks. Returns the new auction's ID. Crossing function.

Open
OID
0ed89f…44dd:38
List details

Inspect func

Buy

func(id string) int64

Buy purchases auction id at its current price. The caller must send at least that many ugnot with the transaction; any excess is refunded immediately. Only a direct EOA transaction (MsgCall) may buy, so the payment envelope can't be spoofed via an ephemeral MsgRun realm. Returns the price actually paid. Crossing function.

Open
OID
0ed89f…44dd:39
Buy details

Inspect func

Cancel

func(id string)

Cancel withdraws an active auction. Only the seller may cancel, and only before it's bought. Crossing function.

Open
OID
0ed89f…44dd:40
Cancel details

Inspect func

CurrentPrice

func(id string) int64

CurrentPrice returns id's price at the current chain height.

Open
OID
0ed89f…44dd:41
CurrentPrice details

Inspect func

AuctionInfo

func(id string) (item string, seller .uverse.address, status string, currentPrice int64, floorPrice int64, startPrice int64)
Open
OID
0ed89f…44dd:42
AuctionInfo details

Inspect func

priceAt

func(a *v0.auction, height int64) int64

priceAt computes the linear-decay price of a at the given height. Once settled (sold or cancelled), the price is frozen: SoldPrice for a sale, zero for a cancellation.

Open
OID
0ed89f…44dd:43
priceAt details

Inspect func

getAuction

func(id string) *v0.auction
Open
OID
0ed89f…44dd:44
getAuction details

Inspect func

Render

func(path string) string

Render produces the gnoweb Markdown view: a table of every auction, newest first, with live prices. Not a crossing function.

Open
OID
0ed89f…44dd:45
Render details

Inspect func
denom : untyped string ="ugnot"
status : type =v0.status
statusActive : v0.status =<zero>
statusSold : v0.status =<zero>
statusCancelled : v0.status =<zero>
auction : type =v0.auction
auctions : v0.Tree Inspect
nextID : uint64 =0
totalListed : uint64 =0
totalSold : uint64 =0
totalVolume : int64 =0
errEmptyItem : *errors.errorString Inspect
errBadPrice : *errors.errorString Inspect
errBadDuration : *errors.errorString Inspect
errNotFound : *errors.errorString Inspect
errNotActive : *errors.errorString Inspect
errNotSeller : *errors.errorString Inspect
errNotUserCall : *errors.errorString Inspect
errUnderpaid : *errors.errorString Inspect
errSpoofedRealm : *errors.errorString Inspect
caller : func() .uverse.address Inspect
List : func(item string, startPrice int64, floorPrice int64, durationBlocks int64) string Inspect
Buy : func(id string) int64 Inspect
Cancel : func(id string) Inspect
CurrentPrice : func(id string) int64 Inspect
AuctionInfo : func(id string) (item string, seller .uverse.address, status string, currentPrice int64, floorPrice int64, startPrice int64) Inspect
priceAt : func(a *v0.auction, height int64) int64 Inspect
getAuction : func(id string) *v0.auction Inspect
Render : func(path string) string Inspect