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

scanWindow

untyped bigint

scanWindow is how many stored position records one page walks. There is no address-to-positions index anywhere in GnoSwap: gnft is a plain grc721 with no enumerable extension, so the only way to find an address's positions is to walk the records and ask each one who owns it. GnoSwap's own position realm renders a keyed lookup and says out loud that it "does not enumerate positions", which is the same ceiling talking. Queries get 3,000,000,000 gas (maxGasQuery, gno.land/pkg/sdk/vm/keeper.go), so the walk is paged rather than unbounded, and the page footer links the next one.

Value

(250 <untyped> bigint)

stakerPath

untyped string

stakerPath is the realm that custodies a staked position's NFT. Staking transfers the token to it, so for anything staked the grc721 owner is this address and not a person: see resolveOwner.

Value

"gno.land/r/gnoswap/staker"

Render

func(path string) string

Render serves three routes: the index, an address page, and the next page of an address whose records did not fit in one scan window. "" the index "g1..." that address, scanning from record 0 "g1.../from/500" the same, scanning from record 500

Open
OID
065df7…0da7:3
Render details

Inspect func

shortSelf

untyped string

shortSelf is this realm's own render prefix, used in the links it prints.

Value

"/r/moul/x/gsdash/v0"

renderAddress

func(addr .uverse.address, offset int) string
Open
OID
065df7…0da7:6
renderAddress details

Inspect func

renderPositions

func(addr .uverse.address, offset int) string

renderPositions walks one window of the position records and prints the rows belonging to addr. The walk is deliberately cheap per record and expensive per hit: identifying the owner is one or two tree lookups, while the price math behind IsInRange, the token balances and the unclaimed fees costs far more. Only a row that is actually printed pays for it.

Open
OID
065df7…0da7:7
renderPositions details

Inspect func

row

func(id uint64, staked bool) []string

row is the expensive half: everything here reads pool price state or recomputes a fee, so it runs for a matched position and never for a scanned one.

Open
OID
065df7…0da7:8
row details

Inspect func

resolveOwner

func(id uint64) (owner .uverse.address, staked bool, ok bool)
Open
OID
065df7…0da7:9
resolveOwner details

Inspect func

parsePath

func(path string) (addr string, offset int, ok bool)

parsePath splits an address route from its optional scan offset.

Open
OID
065df7…0da7:10
parsePath details

Inspect func

shortPool

func(poolKey string) string

shortPool turns a pool key ("\<token0 path>.\<symbol>:\<token1 path>.\<symbol>:\<fee>") into something that fits a table cell.

Open
OID
065df7…0da7:11
shortPool details

Inspect func

symbolOf

func(tokenKey string) string

symbolOf takes the symbol off a GnoSwap token key, which is the grc20 registry form "\<pkgpath>.\<Symbol>".

Open
OID
065df7…0da7:12
symbolOf details

Inspect func
scanWindow : untyped bigint =(250 <untyped> bigint)
stakerPath : untyped string ="gno.land/r/gnoswap/staker"
Render : func(path string) string Inspect
shortSelf : untyped string ="/r/moul/x/gsdash/v0"
renderIndex : func() string Inspect
renderAddress : func(addr .uverse.address, offset int) string Inspect
renderPositions : func(addr .uverse.address, offset int) string Inspect
row : func(id uint64, staked bool) []string Inspect
resolveOwner : func(id uint64) (owner .uverse.address, staked bool, ok bool) Inspect
parsePath : func(path string) (addr string, offset int, ok bool) Inspect
shortPool : func(poolKey string) string Inspect
symbolOf : func(tokenKey string) string Inspect
yesNo : func(b bool) string Inspect