Render
func(path string) stringRender routes three views: the realm's own index, one page's threads, and one thread. A page key contains slashes, so "page/\<key>" is split on the prefix rather than by path element: realmpath gives the parts, and rejoining them would only be a way to get it wrong.
- OID
- 074862…17e9:3
Render details
renderIndex
func() string- OID
- 074862…17e9:5
renderIndex details
renderPage
func(page string) string- OID
- 074862…17e9:6
renderPage details
renderThread
func(raw string) string- OID
- 074862…17e9:7
renderThread details
listing
func(items []v0.Listing, withPage bool) stringlisting renders a set of threads. withPage adds the page column, which the index needs and a page view would only repeat.
- OID
- 074862…17e9:8
listing details
realmPath
untyped stringrealmPath is this realm's own path, the one its gnomod.toml module line declares. It is written out rather than read from unsafe.CurrentRealm(), which reports the CALLER in every plain read this realm exports and would therefore build every link against whichever realm embedded the block.
Value
"gno.land/r/moul/x/social/threads/v0"
EarnPerReplier
int64Value
1
PinCost
int64Value
10
PinBlocks
int64Value
1000
BlockThreads
untyped bigintValue
(5 <untyped> bigint)
board
*v0.Board- OID
- 074862…17e9:10
board details
points
*v0.Coin- OID
- 074862…17e9:41
points details
tokenKey
stringValue
"gno.land/r/moul/x/social/threads/v0.THREAD"
tokenPolicy
v0.PolicytokenPolicy is the three declarations THREAD is issued under. It is a var and not three literals inside init so that the tests, which rebuild the ledger between cases, issue the same token the chain holds.
- OID
- 074862…17e9:19
tokenPolicy details
init.14
func()- OID
- 074862…17e9:20
init.14 details
Post
func(page string, body string) int64Post opens a thread under page. page is a package path, the full one: "gno.land/r/moul/home". It does not have to be a realm that embeds the block, and nothing checks that it exists. A page is just a name, which is what lets a realm key discussion on something finer than itself.
- OID
- 074862…17e9:22
Post details
Reply
func(threadID int64, body string)Reply appends to a thread. The first time each distinct address replies to a given thread, its author earns EarnPerReplier. Replying again earns nothing, and replying to your own thread never earns anything.
- OID
- 074862…17e9:23
Reply details
Boost
func(threadID int64)Boost burns PinCost THREAD from the caller and pins the thread to the top of its page for PinBlocks blocks. Anyone may boost anyone's thread. The pin is on the thread and not on the buyer, so the thing being sold is placement and not authorship.
- OID
- 074862…17e9:24
Boost details
Transfer
func(to .uverse.address, amount int64)Transfer moves the caller's own THREAD. It is what makes the sink a market: somebody who wants a pin and has written nothing has to buy from an author.
- OID
- 074862…17e9:25
Transfer details
Approve
func(spender .uverse.address, amount int64)Approve lets spender draw amount of the caller's THREAD.
- OID
- 074862…17e9:26
Approve details
TransferFrom
func(from .uverse.address, to .uverse.address, amount int64)TransferFrom spends an allowance the caller was granted.
- OID
- 074862…17e9:27
TransferFrom details
RenderBlock
func() stringRenderBlock returns the block for the realm CALLING it, which is the form a host realm embeds. It has no cur realm parameter on purpose. A plain read is borrowed: gno opens no realm frame for it, so unsafe.CurrentRealm() reports the caller's path and the block keys itself with no argument. Adding a cur realm here would silently reverse that and key every embed to this realm instead.
- OID
- 074862…17e9:28
RenderBlock details
RenderBlockFor
func(page string) stringRenderBlockFor is [RenderBlock](#RenderBlock) for a named page. Use it from a crossing function, where there is no caller to read off the stack, or when one realm renders several pages.
- OID
- 074862…17e9:29
RenderBlockFor details
blockFor
func(page string) stringblockFor is the shared body, so no exported read of this realm calls another and picks up the wrong path.
- OID
- 074862…17e9:30
blockFor details
Count
func(page string) intCount is how many threads a page holds.
- OID
- 074862…17e9:31
Count details
Total
func() intTotal is how many threads exist, across every page.
- OID
- 074862…17e9:32
Total details
Pages
func() intPages is how many pages have ever been posted on.
- OID
- 074862…17e9:33
Pages details
Repliers
func(threadID int64) intRepliers is how many distinct addresses have replied to a thread, which is also how much its author has earned from it.
- OID
- 074862…17e9:34
Repliers details
PinnedUntil
func(threadID int64) int64PinnedUntil is the height a thread stops being pinned at, or 0.
- OID
- 074862…17e9:35
PinnedUntil details
BalanceOf
func(owner .uverse.address) int64BalanceOf is an address's THREAD balance.
- OID
- 074862…17e9:36
BalanceOf details
Allowance
func(owner .uverse.address, spender .uverse.address) int64Allowance is what owner let spender draw.
- OID
- 074862…17e9:37
Allowance details
TotalSupply
func() int64TotalSupply is the THREAD in existence: everything earned, less everything burned by Boost.
- OID
- 074862…17e9:38
TotalSupply details
TokenKey
func() stringTokenKey is the r/nt/grc20reg key for THREAD.
- OID
- 074862…17e9:39
TokenKey details
caller
func() .uverse.address- OID
- 074862…17e9:40