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.

gnocial 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
0e8c30…e513:3
SetPaused details

Inspect func

SetTreasury

func(next .uverse.address)

SetTreasury moves future protocol fees and surplus sweeps to next.

Open
OID
0e8c30…e513:5
SetTreasury details

Inspect func

TransferAdmin

func(next .uverse.address)

TransferAdmin rotates the pause/sweep key.

Open
OID
0e8c30…e513: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
0e8c30…e513:7
SetSuccessor details

Inspect func

validSuccessor

func(path string) bool
Open
OID
0e8c30…e513: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
0e8c30…e513: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
0e8c30…e513: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
0e8c30…e513:12
Reply details

Inspect func

writePost

func(author *gnocial.Profile, parent int, body string, gated bool) int
Open
OID
0e8c30…e513: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
0e8c30…e513:15
Delete details

Inspect func

Like

func(id int)

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

Open
OID
0e8c30…e513:16
Like details

Inspect func

Unlike

func(id int)

Unlike removes the caller's like.

Open
OID
0e8c30…e513: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
0e8c30…e513: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
0e8c30…e513:19
GatedBody details

Inspect func

livePost

func(id int) *gnocial.Article
Open
OID
0e8c30…e513:20
livePost details

Inspect func

Liked

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

Liked reports whether who liked the post.

Open
OID
0e8c30…e513: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
0e8c30…e513:22
Register details

Inspect func

SetCreatorFee

func(points int64)

SetCreatorFee stores this member's share of each ticket trade, in basis points. Only that member can change it. The trade total stays FeeCapBps.

Open
OID
0e8c30…e513:24
SetCreatorFee details

Inspect func

UpdateProfile

func(name string, bio string)

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

Open
OID
0e8c30…e513:25
UpdateProfile details

Inspect func

Follow

func(handle string)

Follow records that the caller follows handle.

Open
OID
0e8c30…e513:26
Follow details

Inspect func

Unfollow

func(handle string)

Unfollow removes a follow.

Open
OID
0e8c30…e513:27
Unfollow details

Inspect func

Following

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

Following reports whether from follows the handle.

Open
OID
0e8c30…e513:28
Following details

Inspect func

Holding

type

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

Value

gnocial.Holding

Feed

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

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

Open
OID
0e8c30…e513:31
Feed details

Inspect func

PostsBy

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

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

Open
OID
0e8c30…e513:32
PostsBy details

Inspect func

Replies

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

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

Open
OID
0e8c30…e513:33
Replies details

Inspect func

Handles

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

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

Open
OID
0e8c30…e513:34
Handles details

Inspect func

FollowingList

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

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

Open
OID
0e8c30…e513:35
FollowingList details

Inspect func

FollowerList

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

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

Open
OID
0e8c30…e513:36
FollowerList details

Inspect func

edgeList

func(who .uverse.address, after .uverse.address, limit int, sep string) []gnocial.Profile
Open
OID
0e8c30…e513:37
edgeList details

Inspect func

Holdings

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

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

Open
OID
0e8c30…e513:38
Holdings details

Inspect func

Hot

func(limit int) []gnocial.Article

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

Open
OID
0e8c30…e513:39
Hot details

Inspect func

MemberCount

func() int

MemberCount is the number of registered handles.

Open
OID
0e8c30…e513:40
MemberCount details

Inspect func

FeedCount

func() int

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

Open
OID
0e8c30…e513:41
FeedCount details

Inspect func

LatestID

func() int

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

Open
OID
0e8c30…e513:42
LatestID details

Inspect func

hotWindow

untyped bigint

Value

(30 <untyped> bigint)

scoredPost

type

Value

gnocial.scoredPost

insertRank

func(top []gnocial.scoredPost, row gnocial.scoredPost, limit int) []gnocial.scoredPost
Open
OID
0e8c30…e513:43
insertRank details

Inspect func

recentPosts

func(before int, limit int) []*gnocial.Article
Open
OID
0e8c30…e513:44
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
0e8c30…e513:45
Render details

Inspect func

FeeCapBps

int64

Value

1000

CreatorFeeMinBps

int64

Value

100

CreatorFeeMaxBps

int64

Value

700

CreatorFeeDefaultBps

int64

Value

500

CreatorReferralBps

int64

Value

50

TraderReferralBps

int64

Value

50

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

"2"

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

gnocial.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

gnocial.Article

book

type

Value

gnocial.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

gnocial.store

Version

func() string

Version is this package revision. It has no setter.

Open
OID
0e8c30…e513:53
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
0e8c30…e513:54
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
0e8c30…e513:55
Paused details

Inspect func

TotalReserve

func() int64

TotalReserve is the ugnot locked to back outstanding tickets.

Open
OID
0e8c30…e513:56
TotalReserve details

Inspect func

payout

func(to .uverse.address, amt int64, why string)
Open
OID
0e8c30…e513:60
payout details

Inspect func

validHandle

func(s string) bool
Open
OID
0e8c30…e513:63
validHandle details

Inspect func

cleanLine

func(s string, maxRunes int, maxBytes int, label string, allowEmpty bool) string
Open
OID
0e8c30…e513:65
cleanLine details

Inspect func

cleanBody

func(s string) string
Open
OID
0e8c30…e513:66
cleanBody details

Inspect func

profileByAddr

func(a .uverse.address) *gnocial.Profile
Open
OID
0e8c30…e513:68
profileByAddr details

Inspect func

lookup

func(handle string) *gnocial.Profile
Open
OID
0e8c30…e513:69
lookup details

Inspect func

mustMember

func(a .uverse.address) *gnocial.Profile
Open
OID
0e8c30…e513:70
mustMember details

Inspect func

bookOf

func(creator .uverse.address) *gnocial.book
Open
OID
0e8c30…e513:71
bookOf details

Inspect func

postByID

func(id int) *gnocial.Article
Open
OID
0e8c30…e513:72
postByID details

Inspect func

shareKey

func(holder .uverse.address, creator .uverse.address) string
Open
OID
0e8c30…e513:73
shareKey details

Inspect func

getShares

func(holder .uverse.address, creator .uverse.address) int
Open
OID
0e8c30…e513:74
getShares details

Inspect func

setShares

func(holder .uverse.address, creator .uverse.address, n int)
Open
OID
0e8c30…e513:75
setShares details

Inspect func

authorKey

func(a .uverse.address, id int) string
Open
OID
0e8c30…e513:76
authorKey details

Inspect func

followKey

func(from .uverse.address, to .uverse.address) string
Open
OID
0e8c30…e513:77
followKey details

Inspect func

fanKey

func(creator .uverse.address, fan .uverse.address) string
Open
OID
0e8c30…e513:78
fanKey details

Inspect func

likeKey

func(id int, who .uverse.address) string
Open
OID
0e8c30…e513:79
likeKey details

Inspect func

ProfileByHandle

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

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

Open
OID
0e8c30…e513:80
ProfileByHandle details

Inspect func

ProfileOf

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

ProfileOf returns a copy of the profile bound to addr.

Open
OID
0e8c30…e513:81
ProfileOf details

Inspect func

GetPost

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

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

Open
OID
0e8c30…e513:82
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
0e8c30…e513:83
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
0e8c30…e513:84
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. The total fee is always FeeCapBps of the curve. An anonymous quote pays no trader-referrer slice, so that slice stays in the protocol fee. The amount due does not change when the buyer is known.

Open
OID
0e8c30…e513:85
QuoteBuy details

Inspect func

QuoteBuyFor

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

QuoteBuyFor is QuoteBuy with the buyer's address. Empty or a member with no referrer adds no trader-referrer slice. A bad address panics.

Open
OID
0e8c30…e513:87
QuoteBuyFor 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. The reserve drops by the full curve. Proceeds are the curve minus FeeCapBps, whoever the seller is.

Open
OID
0e8c30…e513:88
QuoteSell details

Inspect func

QuoteSellFor

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

QuoteSellFor is QuoteSell with the seller's address.

Open
OID
0e8c30…e513:89
QuoteSellFor details

Inspect func

Buy

func(handle string, amount int)

Buy mints amount tickets of handle. Attach exactly QuoteBuy's due in ugnot. The caller's own referrer receives the trader slice. The due matches QuoteBuy.

Open
OID
0e8c30…e513:90
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
0e8c30…e513:91
Sell details

Inspect func

forwardFees

func(creator *gnocial.Profile, creatorFee int64, protocolFee int64, creatorRef .uverse.address, creatorRefAmt int64, traderRef .uverse.address, traderRefAmt int64)
Open
OID
0e8c30…e513:92
forwardFees details

Inspect func

addShares

func(holder .uverse.address, creator .uverse.address, n int)
Open
OID
0e8c30…e513:93
addShares details

Inspect func

subShares

func(holder .uverse.address, creator .uverse.address, n int)
Open
OID
0e8c30…e513:94
subShares details

Inspect func

quoteTotals

func(handle string, trader string, amount int, sell bool) (curve int64, creatorFee int64, protocolFee int64, referralFee int64)
Open
OID
0e8c30…e513:95
quoteTotals details

Inspect func

tradeQuote

func(handle string, trader string, amount int, sell bool) (curve int64, creatorFee int64, protocolFee int64, creatorRefAmt int64, traderRefAmt int64, creator *gnocial.Profile, creatorRef .uverse.address, traderRef .uverse.address)

tradeQuote splits FeeCapBps of the curve. trader is the buyer or seller. Empty means an anonymous quote: no trader-referrer slice. protocolFee is the cap minus the floored slices, so it cannot go negative while the configured slices fit inside the cap.

Open
OID
0e8c30…e513:96
tradeQuote details

Inspect func

traderReferrer

func(raw string) .uverse.address
Open
OID
0e8c30…e513:97
traderReferrer details

Inspect func

bps

func(amount int64, points int64) int64
Open
OID
0e8c30…e513:98
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
0e8c30…e513:99
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 *gnocial.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) *gnocial.Article Inspect
Liked : func(who .uverse.address, id int) bool Inspect
Register : func(handle string, name string, bio string, referrer string) Inspect
SetCreatorFee : func(points int64) 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 =gnocial.Holding
mustLimit : func(n int) int Inspect
Feed : func(before int, limit int) []gnocial.Article Inspect
PostsBy : func(addr .uverse.address, before int, limit int) []gnocial.Article Inspect
Replies : func(parent int, after int, limit int) []gnocial.Article Inspect
Handles : func(after string, limit int) []gnocial.Profile Inspect
FollowingList : func(who .uverse.address, after .uverse.address, limit int) []gnocial.Profile Inspect
FollowerList : func(who .uverse.address, after .uverse.address, limit int) []gnocial.Profile Inspect
edgeList : func(who .uverse.address, after .uverse.address, limit int, sep string) []gnocial.Profile Inspect
Holdings : func(holder .uverse.address, after .uverse.address, limit int) []gnocial.Holding Inspect
Hot : func(limit int) []gnocial.Article Inspect
MemberCount : func() int Inspect
FeedCount : func() int Inspect
LatestID : func() int Inspect
hotWindow : untyped bigint =(30 <untyped> bigint)
scoredPost : type =gnocial.scoredPost
insertRank : func(top []gnocial.scoredPost, row gnocial.scoredPost, limit int) []gnocial.scoredPost Inspect
recentPosts : func(before int, limit int) []*gnocial.Article Inspect
Render : func(path string) string Inspect
FeeCapBps : int64 =1000
CreatorFeeMinBps : int64 =100
CreatorFeeMaxBps : int64 =700
CreatorFeeDefaultBps : int64 =500
CreatorReferralBps : int64 =50
TraderReferralBps : int64 =50
TicketUnit : int64 =10000
MaxSupply : untyped bigint =(2000 <untyped> bigint)
MaxTrade : untyped bigint =(20 <untyped> bigint)
MaxBodyRunes : untyped bigint =(280 <untyped> bigint)
ProtocolVersion : untyped string ="2"
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 =gnocial.Profile
Article : type =gnocial.Article
book : type =gnocial.book
store : type =gnocial.store
state : *gnocial.store Inspect
init.65 : func() Inspect
newStore : func() *gnocial.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) *gnocial.Profile Inspect
lookup : func(handle string) *gnocial.Profile Inspect
mustMember : func(a .uverse.address) *gnocial.Profile Inspect
bookOf : func(creator .uverse.address) *gnocial.book Inspect
postByID : func(id int) *gnocial.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) (gnocial.Profile, bool) Inspect
ProfileOf : func(addr .uverse.address) (gnocial.Profile, bool) Inspect
GetPost : func(id int) (gnocial.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
QuoteBuyFor : func(handle string, buyer 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
QuoteSellFor : func(handle string, seller 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 *gnocial.Profile, creatorFee int64, protocolFee int64, creatorRef .uverse.address, creatorRefAmt int64, traderRef .uverse.address, traderRefAmt int64) Inspect
addShares : func(holder .uverse.address, creator .uverse.address, n int) Inspect
subShares : func(holder .uverse.address, creator .uverse.address, n int) Inspect
quoteTotals : func(handle string, trader string, amount int, sell bool) (curve int64, creatorFee int64, protocolFee int64, referralFee int64) Inspect
tradeQuote : func(handle string, trader string, amount int, sell bool) (curve int64, creatorFee int64, protocolFee int64, creatorRefAmt int64, traderRefAmt int64, creator *gnocial.Profile, creatorRef .uverse.address, traderRef .uverse.address) Inspect
traderReferrer : func(raw string) .uverse.address Inspect
bps : func(amount int64, points int64) int64 Inspect
curveCost : func(supply int, amount int) int64 Inspect
sumSq : func(n int64) int64 Inspect