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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

arena state

Back to all declarations

SetPaused

func(on string)

SetPaused freezes posts, replies, tips, and ticket buys when on is true/1/yes. Pass false/0/no to reopen. Ticket sells are never paused.

Open
OID
0ac1c9…848d:3
SetPaused details

Inspect func

SetTreasury

func(next .uverse.address)

SetTreasury moves future protocol fees and surplus sweeps to next.

Open
OID
0ac1c9…848d:5
SetTreasury details

Inspect func

TransferAdmin

func(next .uverse.address)

TransferAdmin rotates the pause/sweep key.

Open
OID
0ac1c9…848d:6
TransferAdmin details

Inspect func

SetSuccessor

func(next string)

SetSuccessor records the package path of a later realm. An empty path clears it. This does not move coins or shares.

Open
OID
0ac1c9…848d:7
SetSuccessor details

Inspect func

validSuccessor

func(path string) bool
Open
OID
0ac1c9…848d:8
validSuccessor details

Inspect func

Sweep

func(confirm string)

Sweep sends this realm's ugnot above TotalReserve to the treasury. confirm must be the word "sweep". Ticket collateral is not included.

Open
OID
0ac1c9…848d:9
Sweep details

Inspect func

Post

func(body string, gated string) int

Post publishes a top-level post and returns its id. gated is yes/1/true/khoa to withhold the body from Render. The body is still public chain state. Pass an empty gated value for a public post.

Open
OID
0ac1c9…848d:10
Post details

Inspect func

Reply

func(parent int, body string) int

Reply publishes a reply to parent and returns the new id. Replies are public.

Open
OID
0ac1c9…848d:12
Reply details

Inspect func

writePost

func(author *arena.Profile, parent int, body string, gated bool) int
Open
OID
0ac1c9…848d:13
writePost details

Inspect func

Delete

func(id int)

Delete soft-deletes the caller's post and clears its body from current state. The original transaction still holds the text in chain history.

Open
OID
0ac1c9…848d:15
Delete details

Inspect func

Like

func(id int)

Like adds the caller's like. One like per account.

Open
OID
0ac1c9…848d:16
Like details

Inspect func

Unlike

func(id int)

Unlike removes the caller's like.

Open
OID
0ac1c9…848d:17
Unlike details

Inspect func

Tip

func(id int)

Tip forwards the attached ugnot to the post's author. The realm does not keep it.

Open
OID
0ac1c9…848d:18
Tip details

Inspect func

GatedBody

func(id int) string

GatedBody returns a gated post's text for the author or a current ticket holder. Chain storage is public; this only gates the convenience call and Render.

Open
OID
0ac1c9…848d:19
GatedBody details

Inspect func

livePost

func(id int) *arena.Article
Open
OID
0ac1c9…848d:20
livePost details

Inspect func

Liked

func(who .uverse.address, id int) bool

Liked reports whether who liked the post.

Open
OID
0ac1c9…848d:21
Liked details

Inspect func

Register

func(handle string, name string, bio string, referrer string)

Register opens a profile for the calling account. handle is 3–16 chars of a-z, 0-9 and underscore. referrer may be empty or the bech32 address of an existing member. A member can register once.

Open
OID
0ac1c9…848d:22
Register details

Inspect func

UpdateProfile

func(name string, bio string)

UpdateProfile replaces the display name and bio. The handle stays.

Open
OID
0ac1c9…848d:24
UpdateProfile details

Inspect func

Follow

func(handle string)

Follow records that the caller follows handle.

Open
OID
0ac1c9…848d:25
Follow details

Inspect func

Unfollow

func(handle string)

Unfollow removes a follow.

Open
OID
0ac1c9…848d:26
Unfollow details

Inspect func

Following

func(from .uverse.address, handle string) bool

Following reports whether from follows the handle.

Open
OID
0ac1c9…848d:27
Following details

Inspect func

Holding

type

Holding is one creator's tickets in a wallet. It is a copy.

Value

arena.Holding

Feed

func(before int, limit int) []arena.Article

Feed lists newest top-level posts with id \< before. before 0 starts at the newest.

Open
OID
0ac1c9…848d:30
Feed details

Inspect func

PostsBy

func(addr .uverse.address, before int, limit int) []arena.Article

PostsBy lists one member's newest top-level posts with id \< before.

Open
OID
0ac1c9…848d:31
PostsBy details

Inspect func

Replies

func(parent int, after int, limit int) []arena.Article

Replies lists direct replies of parent with id > after, oldest first.

Open
OID
0ac1c9…848d:32
Replies details

Inspect func

Handles

func(after string, limit int) []arena.Profile

Handles lists profiles in handle order, strictly after the given handle.

Open
OID
0ac1c9…848d:33
Handles details

Inspect func

FollowingList

func(who .uverse.address, after .uverse.address, limit int) []arena.Profile

FollowingList lists profiles \`who\` follows, in address order, after \`after\`.

Open
OID
0ac1c9…848d:34
FollowingList details

Inspect func

FollowerList

func(who .uverse.address, after .uverse.address, limit int) []arena.Profile

FollowerList lists profiles that follow \`who\`, in address order, after \`after\`.

Open
OID
0ac1c9…848d:35
FollowerList details

Inspect func

edgeList

func(who .uverse.address, after .uverse.address, limit int, sep string) []arena.Profile
Open
OID
0ac1c9…848d:36
edgeList details

Inspect func

Holdings

func(holder .uverse.address, after .uverse.address, limit int) []arena.Holding

Holdings lists ticket balances of holder, after the given creator address.

Open
OID
0ac1c9…848d:37
Holdings details

Inspect func

Hot

func(limit int) []arena.Article

Hot ranks the newest window the same way Render does. It is not a global index.

Open
OID
0ac1c9…848d:38
Hot details

Inspect func

MemberCount

func() int

MemberCount is the number of registered handles.

Open
OID
0ac1c9…848d:39
MemberCount details

Inspect func

FeedCount

func() int

FeedCount is the number of live top-level posts still in the feed index.

Open
OID
0ac1c9…848d:40
FeedCount details

Inspect func

LatestID

func() int

LatestID is the newest post id, or 0 when nothing has been posted.

Open
OID
0ac1c9…848d:41
LatestID details

Inspect func

hotWindow

untyped bigint

Value

(30 <untyped> bigint)

scoredPost

type

Value

arena.scoredPost

insertRank

func(top []arena.scoredPost, row arena.scoredPost, limit int) []arena.scoredPost
Open
OID
0ac1c9…848d:42
insertRank details

Inspect func

recentPosts

func(before int, limit int) []*arena.Article
Open
OID
0ac1c9…848d:43
recentPosts details

Inspect func

Render

func(path string) string

Render is the short gnoweb page for this fund realm. The long client and Sheet live in the view realm. A realm has to declare Render, and the storage deposit of this package cannot hold both the curve and the full client.

Open
OID
0ac1c9…848d:44
Render details

Inspect func

CreatorFeeBps

int64

Value

500

ProtocolFeeBps

int64

Value

500

ReferralFeeBps

int64

Value

100

TicketUnit

int64

Value

10000

MaxSupply

untyped bigint

Value

(2000 <untyped> bigint)

MaxTrade

untyped bigint

Value

(20 <untyped> bigint)

MaxBodyRunes

untyped bigint

Value

(280 <untyped> bigint)

ProtocolVersion

untyped string

Value

"1"

maxHandle

untyped bigint

Value

(16 <untyped> bigint)

minHandle

untyped bigint

Value

(3 <untyped> bigint)

maxNameRunes

untyped bigint

Value

(32 <untyped> bigint)

maxNameBytes

untyped bigint

Value

(128 <untyped> bigint)

maxBioRunes

untyped bigint

Value

(160 <untyped> bigint)

maxBioBytes

untyped bigint

Value

(640 <untyped> bigint)

maxBodyBytes

untyped bigint

Value

(1120 <untyped> bigint)

Profile

type

Profile is a copy of a member's public record.

Value

arena.Profile

Article

type

Article is a copy of one post. Gated bodies are still stored on chain; Render withholds them, and GatedBody checks the caller.

Value

arena.Article

book

type

Value

arena.book

store

type

Trees stay unexported. avl.Iterate takes a callback; handing out the tree would let another realm run that callback under this realm.

Value

arena.store

Version

func() string

Version is this package revision. It has no setter.

Open
OID
0ac1c9…848d:52
Version details

Inspect func

Successor

func() string

Successor is the package path of a later realm, or empty. The later realm does not receive this realm's ticket reserve.

Open
OID
0ac1c9…848d:53
Successor details

Inspect func

Paused

func() bool

Paused reports whether new posts, replies, tips, and ticket buys are frozen. Sells stay open so ticket collateral can still exit.

Open
OID
0ac1c9…848d:54
Paused details

Inspect func

TotalReserve

func() int64

TotalReserve is the ugnot locked to back outstanding tickets.

Open
OID
0ac1c9…848d:55
TotalReserve details

Inspect func

payout

func(to .uverse.address, amt int64, why string)
Open
OID
0ac1c9…848d:59
payout details

Inspect func

validHandle

func(s string) bool
Open
OID
0ac1c9…848d:62
validHandle details

Inspect func

cleanLine

func(s string, maxRunes int, maxBytes int, label string, allowEmpty bool) string
Open
OID
0ac1c9…848d:64
cleanLine details

Inspect func

cleanBody

func(s string) string
Open
OID
0ac1c9…848d:65
cleanBody details

Inspect func

profileByAddr

func(a .uverse.address) *arena.Profile
Open
OID
0ac1c9…848d:67
profileByAddr details

Inspect func

lookup

func(handle string) *arena.Profile
Open
OID
0ac1c9…848d:68
lookup details

Inspect func

mustMember

func(a .uverse.address) *arena.Profile
Open
OID
0ac1c9…848d:69
mustMember details

Inspect func

bookOf

func(creator .uverse.address) *arena.book
Open
OID
0ac1c9…848d:70
bookOf details

Inspect func

postByID

func(id int) *arena.Article
Open
OID
0ac1c9…848d:71
postByID details

Inspect func

shareKey

func(holder .uverse.address, creator .uverse.address) string
Open
OID
0ac1c9…848d:72
shareKey details

Inspect func

getShares

func(holder .uverse.address, creator .uverse.address) int
Open
OID
0ac1c9…848d:73
getShares details

Inspect func

setShares

func(holder .uverse.address, creator .uverse.address, n int)
Open
OID
0ac1c9…848d:74
setShares details

Inspect func

authorKey

func(a .uverse.address, id int) string
Open
OID
0ac1c9…848d:75
authorKey details

Inspect func

followKey

func(from .uverse.address, to .uverse.address) string
Open
OID
0ac1c9…848d:76
followKey details

Inspect func

fanKey

func(creator .uverse.address, fan .uverse.address) string
Open
OID
0ac1c9…848d:77
fanKey details

Inspect func

likeKey

func(id int, who .uverse.address) string
Open
OID
0ac1c9…848d:78
likeKey details

Inspect func

ProfileByHandle

func(handle string) (arena.Profile, bool)

ProfileByHandle returns a copy of the profile, or false when the handle is unknown.

Open
OID
0ac1c9…848d:79
ProfileByHandle details

Inspect func

ProfileOf

func(addr .uverse.address) (arena.Profile, bool)

ProfileOf returns a copy of the profile bound to addr.

Open
OID
0ac1c9…848d:80
ProfileOf details

Inspect func

GetPost

func(id int) (arena.Article, bool)

GetPost returns a copy of the post. The copy does not alias storage.

Open
OID
0ac1c9…848d:81
GetPost details

Inspect func

SharesOf

func(holder .uverse.address, handle string) int

SharesOf returns how many tickets holder has of the creator's handle.

Open
OID
0ac1c9…848d:82
SharesOf details

Inspect func

SupplyOf

func(handle string) (supply int, reserve int64, holders int)

SupplyOf returns tickets outstanding, ugnot locked in that curve, and holders.

Open
OID
0ac1c9…848d:83
SupplyOf details

Inspect func

QuoteBuy

func(handle string, amount int) (due int64, curve int64, creatorFee int64, protocolFee int64, referralFee int64)

QuoteBuy is the exact ugnot a buyer must attach to mint amount tickets. due = curve + creator fee + protocol fee + referral fee. curve is what stays in the reserve. Fees are paid on top and forwarded.

Open
OID
0ac1c9…848d:84
QuoteBuy details

Inspect func

QuoteSell

func(handle string, amount int) (proceeds int64, curve int64, creatorFee int64, protocolFee int64, referralFee int64)

QuoteSell is what a seller receives, and the fees taken out of the curve refund. The reserve drops by the full curve amount, so later sells stay solvent.

Open
OID
0ac1c9…848d:86
QuoteSell details

Inspect func

Buy

func(handle string, amount int)

Buy mints amount tickets of handle. Attach exactly QuoteBuy's due in ugnot.

Open
OID
0ac1c9…848d:87
Buy details

Inspect func

Sell

func(handle string, amount int)

Sell burns amount tickets and pays the caller from the reserve, minus fees. Sells stay available while the realm is paused.

Open
OID
0ac1c9…848d:88
Sell details

Inspect func

forwardFees

func(creator *arena.Profile, creatorFee int64, protocolFee int64, referralFee int64)
Open
OID
0ac1c9…848d:89
forwardFees details

Inspect func

addShares

func(holder .uverse.address, creator .uverse.address, n int)
Open
OID
0ac1c9…848d:90
addShares details

Inspect func

subShares

func(holder .uverse.address, creator .uverse.address, n int)
Open
OID
0ac1c9…848d:91
subShares details

Inspect func

splitFees

func(curve int64, referred bool) (creator int64, protocol int64, referral int64)
Open
OID
0ac1c9…848d:92
splitFees details

Inspect func

bps

func(amount int64, points int64) int64
Open
OID
0ac1c9…848d:93
bps details

Inspect func

curveCost

func(supply int, amount int) int64

curveCost is the ugnot reserve needed to move \`amount\` tickets starting at supply. Ticket i (1-based) is priced i² \* TicketUnit. The sum of squares is exact.

Open
OID
0ac1c9…848d:94
curveCost details

Inspect func
SetPaused : func(on string) Inspect
SetTreasury : func(next .uverse.address) Inspect
TransferAdmin : func(next .uverse.address) Inspect
SetSuccessor : func(next string) Inspect
validSuccessor : func(path string) bool Inspect
Sweep : func(confirm string) Inspect
Post : func(body string, gated string) int Inspect
Reply : func(parent int, body string) int Inspect
writePost : func(author *arena.Profile, parent int, body string, gated bool) int Inspect
yesNo : func(v bool) string Inspect
Delete : func(id int) Inspect
Like : func(id int) Inspect
Unlike : func(id int) Inspect
Tip : func(id int) Inspect
GatedBody : func(id int) string Inspect
livePost : func(id int) *arena.Article Inspect
Liked : func(who .uverse.address, id int) bool Inspect
Register : func(handle string, name string, bio string, referrer string) Inspect
UpdateProfile : func(name string, bio string) Inspect
Follow : func(handle string) Inspect
Unfollow : func(handle string) Inspect
Following : func(from .uverse.address, handle string) bool Inspect
Holding : type =arena.Holding
mustLimit : func(n int) int Inspect
Feed : func(before int, limit int) []arena.Article Inspect
PostsBy : func(addr .uverse.address, before int, limit int) []arena.Article Inspect
Replies : func(parent int, after int, limit int) []arena.Article Inspect
Handles : func(after string, limit int) []arena.Profile Inspect
FollowingList : func(who .uverse.address, after .uverse.address, limit int) []arena.Profile Inspect
FollowerList : func(who .uverse.address, after .uverse.address, limit int) []arena.Profile Inspect
edgeList : func(who .uverse.address, after .uverse.address, limit int, sep string) []arena.Profile Inspect
Holdings : func(holder .uverse.address, after .uverse.address, limit int) []arena.Holding Inspect
Hot : func(limit int) []arena.Article Inspect
MemberCount : func() int Inspect
FeedCount : func() int Inspect
LatestID : func() int Inspect
hotWindow : untyped bigint =(30 <untyped> bigint)
scoredPost : type =arena.scoredPost
insertRank : func(top []arena.scoredPost, row arena.scoredPost, limit int) []arena.scoredPost Inspect
recentPosts : func(before int, limit int) []*arena.Article Inspect
Render : func(path string) string Inspect
CreatorFeeBps : int64 =500
ProtocolFeeBps : int64 =500
ReferralFeeBps : int64 =100
TicketUnit : int64 =10000
MaxSupply : untyped bigint =(2000 <untyped> bigint)
MaxTrade : untyped bigint =(20 <untyped> bigint)
MaxBodyRunes : untyped bigint =(280 <untyped> bigint)
ProtocolVersion : untyped string ="1"
maxHandle : untyped bigint =(16 <untyped> bigint)
minHandle : untyped bigint =(3 <untyped> bigint)
maxNameRunes : untyped bigint =(32 <untyped> bigint)
maxNameBytes : untyped bigint =(128 <untyped> bigint)
maxBioRunes : untyped bigint =(160 <untyped> bigint)
maxBioBytes : untyped bigint =(640 <untyped> bigint)
maxBodyBytes : untyped bigint =(1120 <untyped> bigint)
Profile : type =arena.Profile
Article : type =arena.Article
book : type =arena.book
store : type =arena.store
state : *arena.store Inspect
init.61 : func() Inspect
newStore : func() *arena.store Inspect
Admin : func() .uverse.address Inspect
Treasury : func() .uverse.address Inspect
Version : func() string Inspect
Successor : func() string Inspect
Paused : func() bool Inspect
TotalReserve : func() int64 Inspect
caller : func() .uverse.address Inspect
mustNoPay : func() Inspect
takeUgnot : func() int64 Inspect
payout : func(to .uverse.address, amt int64, why string) Inspect
mustAdmin : func() Inspect
pad : func(n int) string Inspect
validHandle : func(s string) bool Inspect
reserved : func(h string) bool Inspect
cleanLine : func(s string, maxRunes int, maxBytes int, label string, allowEmpty bool) string Inspect
cleanBody : func(s string) string Inspect
isYes : func(s string) bool Inspect
profileByAddr : func(a .uverse.address) *arena.Profile Inspect
lookup : func(handle string) *arena.Profile Inspect
mustMember : func(a .uverse.address) *arena.Profile Inspect
bookOf : func(creator .uverse.address) *arena.book Inspect
postByID : func(id int) *arena.Article Inspect
shareKey : func(holder .uverse.address, creator .uverse.address) string Inspect
getShares : func(holder .uverse.address, creator .uverse.address) int Inspect
setShares : func(holder .uverse.address, creator .uverse.address, n int) Inspect
authorKey : func(a .uverse.address, id int) string Inspect
followKey : func(from .uverse.address, to .uverse.address) string Inspect
fanKey : func(creator .uverse.address, fan .uverse.address) string Inspect
likeKey : func(id int, who .uverse.address) string Inspect
ProfileByHandle : func(handle string) (arena.Profile, bool) Inspect
ProfileOf : func(addr .uverse.address) (arena.Profile, bool) Inspect
GetPost : func(id int) (arena.Article, bool) Inspect
SharesOf : func(holder .uverse.address, handle string) int Inspect
SupplyOf : func(handle string) (supply int, reserve int64, holders int) Inspect
QuoteBuy : func(handle string, amount int) (due int64, curve int64, creatorFee int64, protocolFee int64, referralFee int64) Inspect
QuoteSell : func(handle string, amount int) (proceeds int64, curve int64, creatorFee int64, protocolFee int64, referralFee int64) Inspect
Buy : func(handle string, amount int) Inspect
Sell : func(handle string, amount int) Inspect
forwardFees : func(creator *arena.Profile, creatorFee int64, protocolFee int64, referralFee int64) Inspect
addShares : func(holder .uverse.address, creator .uverse.address, n int) Inspect
subShares : func(holder .uverse.address, creator .uverse.address, n int) Inspect
splitFees : func(curve int64, referred bool) (creator int64, protocol int64, referral int64) Inspect
bps : func(amount int64, points int64) int64 Inspect
curveCost : func(supply int, amount int) int64 Inspect
sumSq : func(n int64) int64 Inspect