esc
func(s string) string- OID
- 00a977…1476:3
esc details
escCell
func(s string) string- OID
- 00a977…1476:5
escCell details
escBlock
func(s string) stringescBlock shows multi-line user text as a blockquote that keeps its line breaks but nothing else: every line is escaped like a table cell (so no link, image, HTML, \`|\` table or line-leading marker survives), a leading "=" is escaped (no setext heading), and lines end with a hard break.
- OID
- 00a977…1476:6
escBlock details
gnowebSafe
func(s string) stringgnowebSafe applies the gnoweb-specific steps described above.
- OID
- 00a977…1476:7
gnowebSafe details
linkOrText
func(link string) stringlinkOrText shows a work link. The escrow already guarantees it starts with https:// and has no spaces or control characters.
- OID
- 00a977…1476:8
linkOrText details
Denom
untyped stringValue
"ugnot"
MinReward
int64Value
1000000
MaxPageSize
untyped bigintValue
(50 <untyped> bigint)
ErrNotUserCall
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: only direct user calls (gnokey maketx call) are accepted"
ErrNoCoins
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: send the reward in ugnot with the call"
ErrSeveralCoins
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: send exactly one coin (ugnot)"
ErrWrongDenom
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: the reward must be in ugnot"
ErrRewardTooLow
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: the reward is below the minimum of 1 GNOT (1000000ugnot)"
ErrCoinsNotTaken
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: this function does not take coins; send none"
ErrUnknownQuest
untyped stringPanic messages for the realm's own checks. Escrow rule violations panic with the escrow error's text (prefix "escrow: ").
Value
"questmaster: unknown quest id"
quests
v0.Tree// questKey(id) -> \*escrow.Quest
- OID
- 00a977…1476:10
quests details
byPoster
v0.Tree// poster address -> \*avl.Tree of questKey(id) -> true
- OID
- 00a977…1476:12
byPoster details
byBuilder
v0.Tree// builder address -> \*avl.Tree of questKey(id) -> true
- OID
- 00a977…1476:14
byBuilder details
openIDs
v0.Tree// questKey(id) -> true, quests in state Open
- OID
- 00a977…1476:16
openIDs details
paidIDs
v0.Tree// questKey(id) -> true, quests in state Paid
- OID
- 00a977…1476:18
paidIDs details
lastID
uint64Value
2
totalPosted
int64// ugnot ever locked by PostQuest
Value
55000000
totalLocked
int64// ugnot held for quests that are Open, Claimed or Submitted
Value
50000000
totalPaid
int64// ugnot paid to builders
Value
5000000
totalRefunded
int64// ugnot refunded to posters
Value
0
PostQuest
func(title string, details string, workBlocks int64) uint64PostQuest creates a quest. Send the reward with the call as exactly one coin of ugnot, at least MinReward. workBlocks is the builder's work window in blocks (escrow.MinWorkBlocks to escrow.MaxWorkBlocks). Returns the new id.
- OID
- 00a977…1476:24
PostQuest details
ClaimQuest
func(id uint64)ClaimQuest takes an Open quest. The poster cannot claim their own quest.
- OID
- 00a977…1476:26
ClaimQuest details
UnclaimQuest
func(id uint64)UnclaimQuest lets the builder give a Claimed quest back. It opens again, or, if the poster closed it, ends with a refund to the poster.
- OID
- 00a977…1476:27
UnclaimQuest details
ReleaseQuest
func(id uint64)ReleaseQuest ends the builder's turn on a Claimed quest whose work deadline has passed. Anyone may call it. The quest opens again, or, if the poster closed it, ends with a refund to the poster.
- OID
- 00a977…1476:28
ReleaseQuest details
SubmitWork
func(id uint64, link string)SubmitWork sends the link to the work (must start with https://). Only the builder, up to and including the work deadline block.
- OID
- 00a977…1476:29
SubmitWork details
ApproveWork
func(id uint64)ApproveWork accepts the submitted work and pays the reward to the builder. Only the poster.
- OID
- 00a977…1476:30
ApproveWork details
RejectWork
func(id uint64, reason string)RejectWork refuses the submitted work with a reason. Its public reject count goes up. The quest opens again, or, if the poster closed it, ends with a refund to the poster. Only the poster, up to and including the review deadline block.
- OID
- 00a977…1476:31
RejectWork details
CancelQuest
func(id uint64)CancelQuest is the poster's way out. Only the poster. - Open quest: it ends at once and the reward is refunded. - Claimed or Submitted quest: it is marked as closing and no coins move. The builder keeps their turn (submit, approval, timeout payout); when the turn ends without approval (unclaim, release after the work deadline, or reject), the quest ends and the reward goes back to the poster instead of the quest opening again.
- OID
- 00a977…1476:32
CancelQuest details
endTurn
func(id uint64, p escrow.Payout, actor .uverse.address, how string, rlm .uverse.realm)endTurn finishes Unclaim, Release and Reject: the quest opens again, or a closing quest ends with the refund p.
- OID
- 00a977…1476:33
endTurn details
settleRefund
func(id uint64, p escrow.Payout, actor .uverse.address, how string, rlm .uverse.realm)settleRefund updates totals, emits QuestCancelled and sends the refund last. The quest is already Cancelled (final) when it is called.
- OID
- 00a977…1476:34
settleRefund details
ClaimPayout
func(id uint64)ClaimPayout pays the builder when the poster has not answered within the review window. Only the builder, from the block after the review deadline.
- OID
- 00a977…1476:35
ClaimPayout details
QuestView
typeQuestView is a read-only copy of one quest at the current block.
Value
questmaster.QuestView
GetQuest
func(id uint64) questmaster.QuestViewGetQuest returns a copy of quest id. It panics on an unknown id.
- OID
- 00a977…1476:36
GetQuest details
Totals
typeTotals are the board-wide running sums, in ugnot.
Value
questmaster.Totals
GetTotals
func() questmaster.TotalsGetTotals returns the running totals. Posted == Locked + Paid + Refunded.
- OID
- 00a977…1476:37
GetTotals details
OpenQuestIDs
func(offset int, limit int) []uint64OpenQuestIDs lists ids of Open quests, newest first. offset skips that many; at most MaxPageSize ids are returned whatever limit is.
- OID
- 00a977…1476:38
OpenQuestIDs details
PaidQuestIDs
func(offset int, limit int) []uint64PaidQuestIDs lists ids of Paid quests, newest first (by quest id).
- OID
- 00a977…1476:39
PaidQuestIDs details
AllQuestIDs
func(offset int, limit int) []uint64AllQuestIDs lists ids of all quests, newest first.
- OID
- 00a977…1476:40
AllQuestIDs details
QuestIDsByPoster
func(addr .uverse.address, offset int, limit int) []uint64QuestIDsByPoster lists ids of quests posted by addr, newest first.
- OID
- 00a977…1476:41
QuestIDsByPoster details
QuestIDsByBuilder
func(addr .uverse.address, offset int, limit int) []uint64QuestIDsByBuilder lists ids of quests addr has ever claimed, newest first. It is a history: a quest stays listed after the builder unclaims it, is released or is rejected, even if someone else builds it later. Use GetQuest(id).Builder for the current builder.
- OID
- 00a977…1476:42
QuestIDsByBuilder details
CountByPoster
func(addr .uverse.address) intCountByPoster returns how many quests addr has posted.
- OID
- 00a977…1476:43
CountByPoster details
CountByBuilder
func(addr .uverse.address) intCountByBuilder returns how many quests addr has ever claimed.
- OID
- 00a977…1476:44
CountByBuilder details
requireUserCall
func() .uverse.address- OID
- 00a977…1476:45
requireUserCall details
requireReward
func() int64requireReward checks the coins sent with PostQuest (rules 1 and 2) and returns the amount. Valid only together with requireUserCall.
- OID
- 00a977…1476:46
requireReward details
requireNoCoins
func()requireNoCoins refuses coins sent to a function that does not take any (rule 3), so nothing gets stuck in the realm.
- OID
- 00a977…1476:47
requireNoCoins details
mustGet
func(id uint64) *escrow.Quest- OID
- 00a977…1476:48
mustGet details
check
func(err .uverse.error)- OID
- 00a977…1476:49
check details
settlePaid
func(id uint64, p escrow.Payout)settlePaid updates storage and totals for a PayBuilder payout.
- OID
- 00a977…1476:50
settlePaid details
send
func(p escrow.Payout, rlm .uverse.realm)send moves exactly p.Amount ugnot from this realm to p.To. It is called last, after every state change (rule 4), and never sends the realm's balance (rule 5).
- OID
- 00a977…1476:51
send details
questKey
func(id uint64) stringquestKey zero-pads id so the avl order is numeric order.
- OID
- 00a977…1476:52
questKey details
idStr
func(id uint64) string- OID
- 00a977…1476:53
idStr details
amountStr
func(ugnot int64) string- OID
- 00a977…1476:54
amountStr details
addToIndex
func(idx *v0.Tree, addr .uverse.address, key string)- OID
- 00a977…1476:55
addToIndex details
indexSize
func(idx *v0.Tree, addr .uverse.address) int- OID
- 00a977…1476:56
indexSize details
indexPage
func(idx *v0.Tree, addr .uverse.address, offset int, limit int) []uint64- OID
- 00a977…1476:57
indexPage details
page
func(t *v0.Tree, offset int, limit int) []uint64page returns up to min(limit, MaxPageSize) ids from t, newest first.
- OID
- 00a977…1476:58
page details
PageSize
untyped bigintPageSize is the number of quests per list page.
Value
(20 <untyped> bigint)
maxPage
untyped bigintmaxPage bounds ?page= so offsets stay small.
Value
(1000000 <untyped> bigint)
SourceRepo
untyped stringSourceRepo is where the source code is published, shown in the footer of every page.
Value
"https://github.com/elangrr/questmaster"
Render
func(path string) stringRender returns the gnoweb page for path, with the footer.
- OID
- 00a977…1476:59
Render details
footer
func() stringfooter ends every page: attribution and where the source is.
- OID
- 00a977…1476:61
footer details
renderPage
func(path string) string- OID
- 00a977…1476:62
renderPage details
renderHome
func(page int) string- OID
- 00a977…1476:63
renderHome details
renderQuest
func(id uint64) string- OID
- 00a977…1476:64
renderQuest details
step
typestep is one possible move on a quest page.
Value
questmaster.step
closeStep
func() questmaster.step- OID
- 00a977…1476:65
closeStep details
reviewWarning
func() stringreviewWarning is shown to posters on the home and help pages.
- OID
- 00a977…1476:66
reviewWarning details
questState
func(q *escrow.Quest) stringquestState is the state as shown in tables and on the quest page.
- OID
- 00a977…1476:67
questState details
nextSteps
func(q *escrow.Quest, h int64) stringnextSteps lists the moves valid in q's state, who may make each, and a transaction link and gnokey command for each.
- OID
- 00a977…1476:68
nextSteps details
extraArg
func(fn string) string- OID
- 00a977…1476:69
extraArg details
renderUser
func(addr .uverse.address, asPoster bool, page int) string- OID
- 00a977…1476:70
renderUser details
renderPaid
func(page int) string- OID
- 00a977…1476:71
renderPaid details
renderHelp
func() string- OID
- 00a977…1476:72
renderHelp details
renderNotFound
func(reason string) string- OID
- 00a977…1476:73
renderNotFound details
questLink
func(q *escrow.Quest) string- OID
- 00a977…1476:74
questLink details
userLink
func(a .uverse.address, asPoster bool) stringuserLink links an address (always a valid bech32 address from storage or a validated path) to its poster or builder page.
- OID
- 00a977…1476:75
userLink details
shortAddr
func(a .uverse.address) string- OID
- 00a977…1476:76
shortAddr details
stateText
func(s escrow.State) string- OID
- 00a977…1476:77
stateText details
realmPkgPath
stringrealmPkgPath is this realm's package path, captured once when the realm is added. (unsafe.CurrentRealm() inside Render depends on the caller's frame, so it is not used there.)
Value
"gno.land/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/questmaster"
init.84
func()- OID
- 00a977…1476:79
init.84 details
realmPath
func() stringrealmPath is this realm's web path, e.g. "/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/questmaster".
- OID
- 00a977…1476:80
realmPath details
txLink
func(fn string) *v0.TxBuildertxLink builds a gnoweb transaction link for fn on this realm.
- OID
- 00a977…1476:81
txLink details
pageURL
func(p string) stringpageURL links to one of this realm's pages.
- OID
- 00a977…1476:82
pageURL details
postLink
func() string- OID
- 00a977…1476:83
postLink details
postLinkFor
func(ugnot int64) string- OID
- 00a977…1476:84
postLinkFor details
postLinks
func() stringpostLinks offers PostQuest forms with a few prefilled rewards.
- OID
- 00a977…1476:85
postLinks details
gnokeyCall
func(fn string, id string, arg string, send string) stringgnokeyCall builds a copy-paste gnokey command. Only realm-chosen text goes into it (function names, numbers, fixed example values).
- OID
- 00a977…1476:86
gnokeyCall details
chainID
untyped stringQuestMaster runs on the Onyx test network only; every example command targets it.
Value
"onyx-1"
chainRPC
untyped stringQuestMaster runs on the Onyx test network only; every example command targets it.
Value
"https://rpc.onyx.testnets.gno.land:443"
pageOf
func(t *v0.Tree, pageNum int, base string) ([]uint64, string)pageOf returns the ids for page (newest first) and prev/next links.
- OID
- 00a977…1476:87
pageOf details
splitQuery
func(path string) (string, url.Values)- OID
- 00a977…1476:88
splitQuery details
pageArg
func(q url.Values) int- OID
- 00a977…1476:89
pageArg details
parseID
func(s string) (uint64, bool)- OID
- 00a977…1476:90
parseID details
parseAddress
func(s string) (.uverse.address, bool)- OID
- 00a977…1476:91
parseAddress details
gnotStr
func(ugnot int64) stringgnot formats ugnot as GNOT with up to 6 decimals, without floats.
- OID
- 00a977…1476:92
gnotStr details
blocksStr
func(n int64) stringblocksStr formats a block count or height with thousands separators.
- OID
- 00a977…1476:93
blocksStr details
approx
func(blocks int64) stringapprox turns a number of blocks into "about N days/hours/minutes", at ApproxBlockMillis per block.
- OID
- 00a977…1476:94
approx details
left
func(deadline int64, h int64) stringleft describes the time to a deadline block from height h.
- OID
- 00a977…1476:95
left details
ApproxBlockMillis
untyped bigintApproxBlockMillis is the block time used for the approximate times on the pages (measured about 3.4 to 3.5 s on Onyx and mainnet in Nov 2026).
Value
(3500 <untyped> bigint)
timeNote
func() string- OID
- 00a977…1476:96
timeNote details
capital
func(s string) string- OID
- 00a977…1476:97
capital details
plural
func(n int, word string) stringplural returns "1 quest" or "N quests".
- OID
- 00a977…1476:98