Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

v1 state

Back to all declarations

ErrUserCallOnly

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: post must be a direct user call"

ErrReward

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: send exactly one coin of ugnot"

ErrRewardRange

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: reward is outside the allowed range"

ErrTitle

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: title must be 3 to 120 characters"

ErrDetails

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: details are too long"

ErrDone

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: done text is too long"

ErrCategory

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: unknown category"

ErrDeadline

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: deadline must be 1 hour to 90 days from now"

ErrNotFound

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task not found"

ErrNotOpen

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task is not open"

ErrOwnTask

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: you cannot take your own task"

ErrPastDeadline

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: deadline has passed"

ErrNotDoer

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: only the doer can do this"

ErrNotPoster

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: only the poster can do this"

ErrNotTaken

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task is not taken"

ErrNotInReview

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: task is not in review"

ErrURL

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: work link must start with https:// and have no spaces"

ErrChangesUsed

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: changes were already asked once"

ErrNote

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: note must be 1 to 1000 characters"

ErrTooEarly

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: the review window has not ended"

ErrDoerHasTime

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: the doer still has time before the deadline"

ErrCannotCancel

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: this task can no longer be cancelled"

ErrMinDone

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: required experience must be 0 to 100 paid tasks"

ErrInvite

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: invite must be a valid address"

ErrInviteSelf

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: you cannot offer a task to yourself"

ErrInviteOnly

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: this task was offered to someone else"

ErrNeedRecord

untyped string

Error messages. Each failure has its own message so callers, tests and the web app can tell them apart.

Value

"gild: this task needs more paid Gild work on your record"

Denom

untyped string

Rules. They are constants so anyone can read them in the source.

Value

"ugnot"

MinReward

int64

// 1 GNOT

Value

1000000

MaxReward

int64

// 1 billion GNOT, a sanity cap

Value

1000000000000000

ReviewWindow

time.Duration

// poster's time to answer sent work

Value

<zero>

ChangesExtension

time.Duration

// minimum time a doer gets after changes are asked

Value

<zero>

MinDeadline

time.Duration

Rules. They are constants so anyone can read them in the source.

Value

<zero>

MaxDeadline

time.Duration

Rules. They are constants so anyone can read them in the source.

Value

<zero>

MinTitle

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(3 <untyped> bigint)

MaxTitle

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(120 <untyped> bigint)

MaxDetails

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(4000 <untyped> bigint)

MaxDone

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(1000 <untyped> bigint)

MaxURL

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(300 <untyped> bigint)

MaxNote

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(1000 <untyped> bigint)

MaxPage

untyped bigint

Rules. They are constants so anyone can read them in the source.

Value

(50 <untyped> bigint)

MaxMinDone

untyped bigint

// the highest experience a task can require

Value

(100 <untyped> bigint)

Status

type

Status is where a task is in its life.

Value

v1.Status

StatusOpen

v1.Status

// reward locked, waiting for a doer

Value

<zero>

StatusTaken

v1.Status

// a doer is working on it

Value

<zero>

StatusInReview

v1.Status

// work sent, waiting for the poster

Value

<zero>

StatusPaid

v1.Status

// reward paid to the doer

Value

<zero>

StatusRefunded

v1.Status

// reward returned to the poster

Value

<zero>

Task

type

Task is one posted piece of work.

Value

v1.Task

tasks

v0.Tree

// id key -> \*Task, every task

Open
OID
0e2ecc…abb2:6
tasks details

Inspect ref

openTasks

v0.Tree

// id key -> \*Task, only open tasks

Open
OID
0e2ecc…abb2:8
openTasks details

Inspect ref

byPoster

v0.Tree

// address -> \*avl.Tree of id key -> \*Task

Open
OID
0e2ecc…abb2:10
byPoster details

Inspect ref

byDoer

v0.Tree

// address -> \*avl.Tree of id key -> \*Task

Open
OID
0e2ecc…abb2:12
byDoer details

Inspect ref

byInvite

v0.Tree

// address -> \*avl.Tree of id key -> \*Task, direct offers

Open
OID
0e2ecc…abb2:14
byInvite details

Inspect ref

nextID

v0.ID

Value

<zero>

lockedTotal

int64

// rewards currently held by this realm

Value

0

paidTotal

int64

// rewards paid to doers

Value

0

webPath

string

// this realm's gnoweb path, e.g. "/r/thesithunyein/gild/v1"

Value

"/r/g1jw2yrfqnd4fp90qadw88pnjgpden4vgagjvpe6/gild/v1"

Post

func(title string, details string, done string, category string, deadline int64, minDone int, invite string) int64

Post creates a task and locks the coins sent with the call as its reward. It must be called directly by a user (maketx call) with exactly one coin of Denom attached. deadline is a Unix time in seconds. minDone is how many paid Gild tasks a doer must already have (0 = anyone). invite is an address the task is offered to, or "" for an open task.

Open
OID
0e2ecc…abb2:25
Post details

Inspect func

Take

func(id int64)

Take assigns an open task to the caller. The poster cannot take their own task, and nobody can take a task after its deadline. A direct offer can only be taken by the invited address, and a gated task only by someone whose record meets its MinDone.

Open
OID
0e2ecc…abb2:26
Take details

Inspect func

Release

func(id int64)

Release gives a taken task back so someone else can take it. Only the doer can call it, and only before work is sent. Any change request is cleared, so the next doer starts fresh.

Open
OID
0e2ecc…abb2:27
Release details

Inspect func

Submit

func(id int64, workURL string)

Submit sends a link to the finished work. Only the doer can call it, and only while the task is taken.

Open
OID
0e2ecc…abb2:28
Submit details

Inspect func

Approve

func(id int64)

Approve pays the doer. Only the poster can call it, and only after work was sent.

Open
OID
0e2ecc…abb2:29
Approve details

Inspect func

RequestChanges

func(id int64, note string)

RequestChanges sends the task back to the doer once. The doer gets at least ChangesExtension from now before the poster can take the reward back.

Open
OID
0e2ecc…abb2:30
RequestChanges details

Inspect func

ClaimAfterSilence

func(id int64)

ClaimAfterSilence pays the doer when the poster has not answered within ReviewWindow of the work being sent.

Open
OID
0e2ecc…abb2:31
ClaimAfterSilence details

Inspect func

Cancel

func(id int64)

Cancel returns the reward to the poster. It works while the task is open, or when a doer took it but sent no work before the deadline. It never works once work has been sent, so a poster cannot cancel to avoid paying.

Open
OID
0e2ecc…abb2:32
Cancel details

Inspect func

Completed

func(addr .uverse.address) int

Completed returns how many tasks addr finished and was paid for on Gild, across both boards (v0 and v1). Other realms can call it to gate features by proven work.

Open
OID
0e2ecc…abb2:33
Completed details

Inspect func

Earned

func(addr .uverse.address) int64

Earned returns the total paid to addr on Gild across both boards, in Denom.

Open
OID
0e2ecc…abb2:34
Earned details

Inspect func

HasCompleted

func(addr .uverse.address, n int) bool

HasCompleted reports whether addr finished at least n tasks on Gild.

Open
OID
0e2ecc…abb2:35
HasCompleted details

Inspect func

pay

func(t *v1.Task, rlm .uverse.realm, by string)

pay marks the task paid, records it, then sends the reward. State changes come before the transfer.

Open
OID
0e2ecc…abb2:36
pay details

Inspect func

send

func(to .uverse.address, amount int64, rlm .uverse.realm)

send pays amount from this realm to addr. rlm must be the live realm handle.

Open
OID
0e2ecc…abb2:37
send details

Inspect func

rewardFrom

func(sent chain.Coins) int64
Open
OID
0e2ecc…abb2:38
rewardFrom details

Inspect func

idStr

func(id v0.ID) string

idStr is the public form of a task id, e.g. "12".

Open
OID
0e2ecc…abb2:39
idStr details

Inspect func

index

func(tree *v0.Tree, addr .uverse.address, key string, t *v1.Task)
Open
OID
0e2ecc…abb2:41
index details

Inspect func

unindex

func(tree *v0.Tree, addr .uverse.address, key string)
Open
OID
0e2ecc…abb2:42
unindex details

Inspect func

isCategory

func(c string) bool
Open
OID
0e2ecc…abb2:43
isCategory details

Inspect func

TaskJSON

func(id int64) string

TaskJSON returns one task as JSON, or "null" if it does not exist.

Open
OID
0e2ecc…abb2:44
TaskJSON details

Inspect func

TasksJSON

func(filter string, offset int, limit int) string

TasksJSON lists tasks newest first. filter is "open" or "all".

Open
OID
0e2ecc…abb2:46
TasksJSON details

Inspect func

PosterTasksJSON

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

PosterTasksJSON lists tasks posted by addr, newest first.

Open
OID
0e2ecc…abb2:47
PosterTasksJSON details

Inspect func

DoerTasksJSON

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

DoerTasksJSON lists tasks taken by addr, newest first.

Open
OID
0e2ecc…abb2:48
DoerTasksJSON details

Inspect func

InvitesJSON

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

InvitesJSON lists tasks offered directly to addr, newest first. It keeps every offer, so check each task's status.

Open
OID
0e2ecc…abb2:49
InvitesJSON details

Inspect func

StatsJSON

func() string

StatsJSON returns totals for this board (v1). Add gild/v0 StatsJSON for all-time numbers.

Open
OID
0e2ecc…abb2:50
StatsJSON details

Inspect func

ProfileJSON

func(addr .uverse.address) string

ProfileJSON returns the work record of addr. completed and earned count both boards; posted, spent and recent cover this board only.

Open
OID
0e2ecc…abb2:51
ProfileJSON details

Inspect func

sub

func(tree *v0.Tree, addr .uverse.address) *v0.Tree
Open
OID
0e2ecc…abb2:52
sub details

Inspect func

clampPage

func(offset int, limit int) (int, int)
Open
OID
0e2ecc…abb2:53
clampPage details

Inspect func

pageJSON

func(tree *v0.Tree, offset int, limit int) string
Open
OID
0e2ecc…abb2:54
pageJSON details

Inspect func

taskJSON

func(t *v1.Task) string
Open
OID
0e2ecc…abb2:55
taskJSON details

Inspect func

jsonStr

func(s string) string

jsonStr returns s as a JSON string literal. It also escapes \<, > and & so the output is safe to place inside HTML.

Open
OID
0e2ecc…abb2:57
jsonStr details

Inspect func

mdText

func(s string) string

mdText escapes characters that would turn user text into markdown links, images, headings or HTML.

Open
OID
0e2ecc…abb2:58
mdText details

Inspect func

gnot

func(u int64) string

gnot formats an amount in ugnot as GNOT, e.g. 1500000 -> "1.5 GNOT".

Open
OID
0e2ecc…abb2:59
gnot details

Inspect func

AppURL

untyped string

AppURL is the web app. Every gnoweb page links to it, but nothing here depends on it: the realm works the same from gnokey or gnoweb.

Value

"https://gild.sithunyein.com/app"

Render

func(path string) string

Render serves the gnoweb pages: "" the board: totals, open tasks, rules "task/<id>" one task "u/<address>" someone's work record

Open
OID
0e2ecc…abb2:60
Render details

Inspect func

renderTask

func(t *v1.Task) string
Open
OID
0e2ecc…abb2:64
renderTask details

Inspect func

nextStep

func(t *v1.Task) string

nextStep tells a gnoweb reader which function moves the task forward.

Open
OID
0e2ecc…abb2:65
nextStep details

Inspect func

renderProfile

func(addr .uverse.address) string
Open
OID
0e2ecc…abb2:66
renderProfile details

Inspect func

whoCanTake

func(t *v1.Task) string
Open
OID
0e2ecc…abb2:67
whoCanTake details

Inspect func

statusText

func(s v1.Status) string
Open
OID
0e2ecc…abb2:68
statusText details

Inspect func

who

func(a .uverse.address) string

who links an address to its work record, shortened to fit a table.

Open
OID
0e2ecc…abb2:69
who details

Inspect func

cell

func(s string) string

cell is mdText for a table cell: one line, no pipes.

Open
OID
0e2ecc…abb2:70
cell details

Inspect func

siblingPath

func(rel string) string

siblingPath returns another realm in this namespace, e.g. "builders/v2".

Open
OID
0e2ecc…abb2:71
siblingPath details

Inspect func

trimSpace

func(s string) string
Open
OID
0e2ecc…abb2:72
trimSpace details

Inspect func

checkText

func(s string, min int, max int, msg string)

checkText panics with msg unless s has between min and max characters and contains no control characters other than newline and tab.

Open
OID
0e2ecc…abb2:74
checkText details

Inspect func

isWorkURL

func(s string) bool

isWorkURL accepts https links with no spaces or control characters.

Open
OID
0e2ecc…abb2:75
isWorkURL details

Inspect func
ErrUserCallOnly : untyped string ="gild: post must be a direct user call"
ErrReward : untyped string ="gild: send exactly one coin of ugnot"
ErrRewardRange : untyped string ="gild: reward is outside the allowed range"
ErrTitle : untyped string ="gild: title must be 3 to 120 characters"
ErrDetails : untyped string ="gild: details are too long"
ErrDone : untyped string ="gild: done text is too long"
ErrCategory : untyped string ="gild: unknown category"
ErrDeadline : untyped string ="gild: deadline must be 1 hour to 90 days from now"
ErrNotFound : untyped string ="gild: task not found"
ErrNotOpen : untyped string ="gild: task is not open"
ErrOwnTask : untyped string ="gild: you cannot take your own task"
ErrPastDeadline : untyped string ="gild: deadline has passed"
ErrNotDoer : untyped string ="gild: only the doer can do this"
ErrNotPoster : untyped string ="gild: only the poster can do this"
ErrNotTaken : untyped string ="gild: task is not taken"
ErrNotInReview : untyped string ="gild: task is not in review"
ErrURL : untyped string ="gild: work link must start with https:// and have no spaces"
ErrChangesUsed : untyped string ="gild: changes were already asked once"
ErrNote : untyped string ="gild: note must be 1 to 1000 characters"
ErrTooEarly : untyped string ="gild: the review window has not ended"
ErrDoerHasTime : untyped string ="gild: the doer still has time before the deadline"
ErrCannotCancel : untyped string ="gild: this task can no longer be cancelled"
ErrMinDone : untyped string ="gild: required experience must be 0 to 100 paid tasks"
ErrInvite : untyped string ="gild: invite must be a valid address"
ErrInviteSelf : untyped string ="gild: you cannot offer a task to yourself"
ErrInviteOnly : untyped string ="gild: this task was offered to someone else"
ErrNeedRecord : untyped string ="gild: this task needs more paid Gild work on your record"
Denom : untyped string ="ugnot"
MinReward : int64 =1000000
MaxReward : int64 =1000000000000000
ReviewWindow : time.Duration =<zero>
ChangesExtension : time.Duration =<zero>
MinDeadline : time.Duration =<zero>
MaxDeadline : time.Duration =<zero>
MinTitle : untyped bigint =(3 <untyped> bigint)
MaxTitle : untyped bigint =(120 <untyped> bigint)
MaxDetails : untyped bigint =(4000 <untyped> bigint)
MaxDone : untyped bigint =(1000 <untyped> bigint)
MaxURL : untyped bigint =(300 <untyped> bigint)
MaxNote : untyped bigint =(1000 <untyped> bigint)
MaxPage : untyped bigint =(50 <untyped> bigint)
MaxMinDone : untyped bigint =(100 <untyped> bigint)
Status : type =v1.Status
StatusOpen : v1.Status =<zero>
StatusTaken : v1.Status =<zero>
StatusInReview : v1.Status =<zero>
StatusPaid : v1.Status =<zero>
StatusRefunded : v1.Status =<zero>
categories : []string (len=6) Inspect
Task : type =v1.Task
tasks : v0.Tree Inspect
openTasks : v0.Tree Inspect
byPoster : v0.Tree Inspect
byDoer : v0.Tree Inspect
byInvite : v0.Tree Inspect
nextID : v0.ID =<zero>
book : *v0.Book Inspect
lockedTotal : int64 =0
paidTotal : int64 =0
webPath : string ="/r/g1jw2yrfqnd4fp90qadw88pnjgpden4vgagjvpe6/gild/v1"
init.60 : func() Inspect
Post : func(title string, details string, done string, category string, deadline int64, minDone int, invite string) int64 Inspect
Take : func(id int64) Inspect
Release : func(id int64) Inspect
Submit : func(id int64, workURL string) Inspect
Approve : func(id int64) Inspect
RequestChanges : func(id int64, note string) Inspect
ClaimAfterSilence : func(id int64) Inspect
Cancel : func(id int64) Inspect
Completed : func(addr .uverse.address) int Inspect
Earned : func(addr .uverse.address) int64 Inspect
HasCompleted : func(addr .uverse.address, n int) bool Inspect
pay : func(t *v1.Task, rlm .uverse.realm, by string) Inspect
send : func(to .uverse.address, amount int64, rlm .uverse.realm) Inspect
rewardFrom : func(sent chain.Coins) int64 Inspect
idStr : func(id v0.ID) string Inspect
mustGet : func(id int64) *v1.Task Inspect
index : func(tree *v0.Tree, addr .uverse.address, key string, t *v1.Task) Inspect
unindex : func(tree *v0.Tree, addr .uverse.address, key string) Inspect
isCategory : func(c string) bool Inspect
TaskJSON : func(id int64) string Inspect
TasksJSON : func(filter string, offset int, limit int) string Inspect
PosterTasksJSON : func(addr .uverse.address, offset int, limit int) string Inspect
DoerTasksJSON : func(addr .uverse.address, offset int, limit int) string Inspect
InvitesJSON : func(addr .uverse.address, offset int, limit int) string Inspect
StatsJSON : func() string Inspect
ProfileJSON : func(addr .uverse.address) string Inspect
sub : func(tree *v0.Tree, addr .uverse.address) *v0.Tree Inspect
clampPage : func(offset int, limit int) (int, int) Inspect
pageJSON : func(tree *v0.Tree, offset int, limit int) string Inspect
taskJSON : func(t *v1.Task) string Inspect
unix : func(t time.Time) string Inspect
jsonStr : func(s string) string Inspect
mdText : func(s string) string Inspect
gnot : func(u int64) string Inspect
AppURL : untyped string ="https://gild.sithunyein.com/app"
Render : func(path string) string Inspect
notFound : func() string Inspect
renderHome : func() string Inspect
renderTask : func(t *v1.Task) string Inspect
nextStep : func(t *v1.Task) string Inspect
renderProfile : func(addr .uverse.address) string Inspect
whoCanTake : func(t *v1.Task) string Inspect
statusText : func(s v1.Status) string Inspect
who : func(a .uverse.address) string Inspect
cell : func(s string) string Inspect
siblingPath : func(rel string) string Inspect
trimSpace : func(s string) string Inspect
checkText : func(s string, min int, max int, msg string) Inspect
isWorkURL : func(s string) bool Inspect