pkgPath
untyped stringThe paths Bolo's addresses derive from. pkgPath is this realm's own; a test checks it against the realm.
Value
"gno.land/r/g12yg9nh4ncma44emgm8msxe8aavzywt0p95tanv/bolo/v0"
registryPath
untyped stringThe paths Bolo's addresses derive from. pkgPath is this realm's own; a test checks it against the realm.
Value
"gno.land/r/g12yg9nh4ncma44emgm8msxe8aavzywt0p95tanv/bolo"
slashedPath
untyped string// where slashed bonds go; nothing ever spends it (INV-8)
Value
"slashed"
escrowPath
func(id v0.ID) stringescrowPath and bondPath are a campaign's sub-paths (API §1): one escrow and one bond address per campaign, so a bug in one campaign can't spend another's.
- OID
- 07094b…6d43:3
escrowPath details
bondPath
func(id v0.ID) string- OID
- 07094b…6d43:5
bondPath details
escrowSub
func(c *v0.campaign) .uverse.realm- OID
- 07094b…6d43:6
escrowSub details
bondSub
func(c *v0.campaign) .uverse.realm- OID
- 07094b…6d43:7
bondSub details
escrowAddr
func(id v0.ID) .uverse.address- OID
- 07094b…6d43:8
escrowAddr details
bondAddr
func(id v0.ID) .uverse.address- OID
- 07094b…6d43:9
bondAddr details
slashedAddr
func() .uverse.address- OID
- 07094b…6d43:10
slashedAddr details
realmAddr
func() .uverse.address- OID
- 07094b…6d43:11
realmAddr details
depositAddr
func() .uverse.address- OID
- 07094b…6d43:12
depositAddr details
registryAddr
func() .uverse.address- OID
- 07094b…6d43:13
registryAddr details
registryDepositAddr
func() .uverse.address- OID
- 07094b…6d43:14
registryDepositAddr details
adminAddr
.uverse.addressValue
<gnolang.StringValue>
assertCodeCaller
func()assertCodeCaller refuses any caller but a deployed realm (API C11). A maketx run script is ephemeral and code at once: it is refused here, as is a user.
- OID
- 07094b…6d43:15
assertCodeCaller details
assertSigner
func(who .uverse.address)assertSigner runs right after C11's branch: no session key, in either branch (C11), then the caller must be who (API §3.6).
- OID
- 07094b…6d43:17
assertSigner details
ProposeAdmin
func(next .uverse.address)ProposeAdmin proposes next as the admin, who takes over by accepting. None of Bolo's own addresses can ever accept, so none can be proposed. A second proposal replaces the first.
- OID
- 07094b…6d43:18
ProposeAdmin details
AcceptAdmin
func()AcceptAdmin makes the proposed admin the admin, and ends the proposal.
- OID
- 07094b…6d43:19
AcceptAdmin details
SetParams
func(deposit int64, dormancyDays int, exitDelayDays int, bondHoldDays int)SetParams sets the Params new campaigns get; every live campaign keeps its own (INV-5).
- OID
- 07094b…6d43:20
SetParams details
SetTipRecipient
func(addr .uverse.address)SetTipRecipient sets where tips and swept strays go: never one of Bolo's own addresses.
- OID
- 07094b…6d43:21
SetTipRecipient details
SetMinDonation
func(amount int64)SetMinDonation sets the smallest gift Donate accepts, in ugnot, for new gifts.
- OID
- 07094b…6d43:22
SetMinDonation details
SetPresets
func(a int64, b int64, c int64, d int64)SetPresets sets the four one-click amounts, in ugnot. Display only.
- OID
- 07094b…6d43:23
SetPresets details
SetEscrowCap
func(max int64)SetEscrowCap sets the most one campaign's tracked escrow balance may reach; 0 removes the cap. It gates gifts only, never money going out (INV-4).
- OID
- 07094b…6d43:24
SetEscrowCap details
AddCategory
func(code string)AddCategory adds a category. There is no remove and no rename: every campaign keeps a valid category.
- OID
- 07094b…6d43:25
AddCategory details
Sunset
func()Sunset stops CreateCampaign for good. It names no successor: where new campaigns start is the registry's Current() (API §3.7). A second call changes nothing.
- OID
- 07094b…6d43:26
Sunset details
Pause
func()Pause stops CreateCampaign, Donate and PostBond — money coming in, never money going out. Pausing while paused changes nothing.
- OID
- 07094b…6d43:27
Pause details
Unpause
func()Unpause lifts a pause. Unpausing while running changes nothing.
- OID
- 07094b…6d43:28
Unpause details
checkParams
func(deposit int64, dormancyDays int, exitDelayDays int, bondHoldDays int) v0.ParamscheckParams returns the Params for SetParams' arguments, or panics with ErrSetting when one is out of bounds (API §3.6). The upper bounds keep the conversion to seconds far from overflowing.
- OID
- 07094b…6d43:29
checkParams details
between
func(n int, min int, max int) bool- OID
- 07094b…6d43:30
between details
checkPresets
func(a int64, b int64, c int64, d int64) [4]int64checkPresets returns the four amounts, or panics with ErrSetting unless they are positive and strictly ascending (API §3.6).
- OID
- 07094b…6d43:31
checkPresets details
checkOutsideBolo
func(a .uverse.address)checkOutsideBolo refuses, with ErrSetting, a malformed address (C12) and every address of Bolo's own (API §3.6): the realm's, where tips would stay (INV-3); the escrow and bond addresses derived so far, where an escrow would count tips as untracked money; slashed, where they would be burned; the storage-deposit address, the keeper's (Q8); and the registry, with its storage-deposit address. Tips must not go there, and none of them can ever accept the admin role.
- OID
- 07094b…6d43:32
checkOutsideBolo details
checkNewCategory
func(code string)checkNewCategory refuses a code that isn't 3 to 20 lowercase letters, one already listed, or one past the cap (API §3.6).
- OID
- 07094b…6d43:33
checkNewCategory details
Close
func(id string)Close closes campaign id to new donations. Its organizer can, at any time; anyone can, once it is past its deadline or inactive for long enough — the campaign's page says when. Closing stops gifts only: what the campaign holds still goes to the beneficiary, or back to its donors. Its branch follows state, never the caller (API §3.1, Q7). Past its deadline, Close records the close if nothing has yet, and never fails. A dormant campaign closes as dormant, whoever calls. Only an open campaign nobody else may close yet takes the organizer's branch, which checks how the call arrived (C11) before it reads who sent it.
- OID
- 07094b…6d43:34
Close details
closeNow
func(c *v0.campaign, reason string, by .uverse.address)closeNow closes the open campaign c now, for reason, and takes it out of the active indexes; Closed names by, who sent the call (API §3.1, §6).
- OID
- 07094b…6d43:36
closeNow details
closeNotYet
untyped stringcloseNotYet is CanClose's reason while only the organizer may close.
Value
"not_yet"
CanClose
func(id string, caller .uverse.address) (bool, string)CanClose says what Close(id), sent by caller from a wallet, would do now (API §4): true, with the reason it would record — "deadline" or "dormant" for anyone, "organizer" for the organizer alone — or false, with "closed" once closed or settled, and "not\_yet" while only the organizer may close.
- OID
- 07094b…6d43:37
CanClose details
maxDeadlineDays
untyped bigintmaxDeadlineDays bounds how far ahead a deadline may be, so no timer computed from it can overflow (API §3.1).
Value
(3650 <untyped> bigint)
CreateCampaign
func(title string, description string, category string, imageCID string, imageAlt string, beneficiary .uverse.address, goal int64, mode string, deadline int64) stringCreateCampaign opens a campaign, which you organize, and returns its ID. Send the creation deposit with it — Bolo's "Start a campaign" link attaches it — and it comes back when the campaign completes. title and description are public, and the description may hold links, never an image. category is one of Bolo's categories. imageCID and imageAlt are a photo on IPFS and what it shows, or both empty. beneficiary is the address the money goes to, which can never change. goal is in ugnot, 0 for none. mode is "escrow" or "direct". deadline is a Unix time, 0 for none. It opens a campaign for its caller, the organizer (API §3.1). The envelope is exactly the creation deposit, which goes to the campaign's bond address: the realm keeps nothing (INV-3).
- OID
- 07094b…6d43:38
CreateCampaign details
checkCampaignText
func(title string, description string, imageCID string, imageAlt string) *v0.campaignTextcheckCampaignText checks a campaign's text (API §2.3) and returns it normalized: the title, the story, and the photo with its description.
- OID
- 07094b…6d43:40
checkCampaignText details
checkCampaignTerms
func(category string, mode string, goal int64, deadline int64)checkCampaignTerms refuses a category not listed, a mode that isn't one, a negative goal, and a deadline neither 0 nor in the future, at most maxDeadlineDays ahead (API §3.1).
- OID
- 07094b…6d43:41
checkCampaignTerms details
checkBeneficiary
func(b .uverse.address, id v0.ID)checkBeneficiary refuses a malformed address (C12) and every address a campaign must never pay (API §1): the realm's, slashed, the storage-deposit address, the registry and its storage-deposit address, every escrow and bond address handed out — and those of id, the campaign about to be created, which paying itself would trap every gift.
- OID
- 07094b…6d43:42
checkBeneficiary details
recordDeadline
func(c *v0.campaign)recordDeadline records a passed deadline (API §3.1): an open campaign whose deadline has passed becomes closed, at its deadline, for reason deadline, and leaves the active indexes; Closed is emitted, naming the caller there and only there. Every crossing function that takes a campaign ID calls it before any other precondition; queries and Render compute the same with effective, writing nothing.
- OID
- 07094b…6d43:43
recordDeadline details
addActive
func(c *v0.campaign)addActive puts c in the two active indexes, which list the open, listed campaigns (API §2.5).
- OID
- 07094b…6d43:45
addActive details
dropActive
func(c *v0.campaign)dropActive takes c out of the two active indexes (API §2.5).
- OID
- 07094b…6d43:46
dropActive details
Donate
func(id string, tip int64, message string, anonymous bool) stringDonate gives to campaign id, and returns your receipt's ID. Send the gift and any tip together: tip is the part of what you send that goes to Bolo, in ugnot — 0 for none. message is optional, and public. anonymous, if true, keeps your address off Bolo's pages; the chain still shows it. In a direct campaign the gift goes straight to the beneficiary; in escrow, to the campaign's escrow, until the beneficiary withdraws it. Any user, by a direct transaction, the donor being the caller (API §3.2). The envelope is the gift plus the tip. The gift goes to the beneficiary, or to the campaign's escrow, and the tip to the tip recipient: the realm keeps nothing (INV-3), and coins found there are never credited (C4).
- OID
- 07094b…6d43:47
Donate details
checkGift
func(c *v0.campaign, total int64, tip int64) int64checkGift returns the gift in an envelope of total ugnot carrying tip, or panics (API §3.2), in this order: a negative tip, or nothing left for the gift; a campaign that isn't open; a paused Bolo; a gift under the minimum.
- OID
- 07094b…6d43:49
checkGift details
checkRoom
func(c *v0.campaign, amount int64)checkRoom refuses a gift of amount that c can't take (API §3.2): one that would push Raised past int64, or, in escrow mode with a cap set, the tracked balance — never the bank's — past MaxEscrowBalance.
- OID
- 07094b…6d43:50
checkRoom details
receiptID
func(campaign v0.ID, seq v0.ID) stringreceiptID is a receipt's ID: its campaign's, a slash, and its sequence number (API C9).
- OID
- 07094b…6d43:51
receiptID details
SweepStrays
func() int64SweepStrays sends the coins someone sent to Bolo's own address by mistake to the tip recipient, and returns how much: anyone can. It sends the ugnot at the realm's address to the tip recipient (API §3.4). The realm holds nothing between transactions (INV-3), so all of it is strays; anyone may call, and with nothing there it sends nothing and emits nothing (Q3).
- OID
- 07094b…6d43:52
SweepStrays details
envelopeUgnot
func() int64envelopeUgnot returns the ugnot attached to this call (API C3, C4): an envelope is one ugnot coin, or nothing; anything else is ErrWrongDenom. It is the one place Bolo reads OriginSend, and only user-only writes reach it: C11's keyed refusal, then AssertOriginCall, in their own body (make check). Never a write behind C11's realm branch, which a deployed realm passes with an envelope paid to itself.
- OID
- 07094b…6d43:53
envelopeUgnot details
Error
typeError is the type of every failure Bolo reports (API C10, §7). Each one is a constant, never a variable another realm could reassign (C6), and its text starts with its copy key, which a client turns into a message (UI spec §8).
Value
v0.Error
ErrNotFound
v0.ErrorValue
<gnolang.StringValue>
ErrNotUserCall
v0.ErrorValue
<gnolang.StringValue>
ErrSessionKey
v0.ErrorValue
<gnolang.StringValue>
ErrWrongDenom
v0.ErrorValue
<gnolang.StringValue>
ErrBadAmount
v0.ErrorValue
<gnolang.StringValue>
ErrDepositMismatch
v0.ErrorValue
<gnolang.StringValue>
ErrPaused
v0.ErrorValue
<gnolang.StringValue>
ErrNotOrganizer
v0.ErrorValue
<gnolang.StringValue>
ErrNotBeneficiary
v0.ErrorValue
<gnolang.StringValue>
ErrNotAdmin
v0.ErrorValue
<gnolang.StringValue>
ErrCampaignClosed
v0.ErrorValue
<gnolang.StringValue>
ErrCampaignSettled
v0.ErrorValue
<gnolang.StringValue>
ErrBondSlashed
v0.ErrorValue
<gnolang.StringValue>
ErrNoBond
v0.ErrorValue
<gnolang.StringValue>
ErrHoldEnded
v0.ErrorValue
<gnolang.StringValue>
ErrWrongMode
v0.ErrorValue
<gnolang.StringValue>
ErrNothingToRefund
v0.ErrorValue
<gnolang.StringValue>
ErrRefundWindowClosed
v0.ErrorValue
<gnolang.StringValue>
ErrExitOpen
v0.ErrorValue
<gnolang.StringValue>
ErrNotClosable
v0.ErrorValue
<gnolang.StringValue>
ErrNotFinalizable
v0.ErrorValue
<gnolang.StringValue>
ErrNothingToWithdraw
v0.ErrorValue
<gnolang.StringValue>
ErrTitle
v0.ErrorValue
<gnolang.StringValue>
ErrDescription
v0.ErrorValue
<gnolang.StringValue>
ErrMessage
v0.ErrorValue
<gnolang.StringValue>
ErrUpdate
v0.ErrorValue
<gnolang.StringValue>
ErrNotice
v0.ErrorValue
<gnolang.StringValue>
ErrImage
v0.ErrorValue
<gnolang.StringValue>
ErrMarkup
v0.ErrorValue
<gnolang.StringValue>
ErrBeneficiary
v0.ErrorValue
<gnolang.StringValue>
ErrCategory
v0.ErrorValue
<gnolang.StringValue>
ErrMode
v0.ErrorValue
<gnolang.StringValue>
ErrDeadline
v0.ErrorValue
<gnolang.StringValue>
ErrGoal
v0.ErrorValue
<gnolang.StringValue>
ErrSetting
v0.ErrorValue
<gnolang.StringValue>
ErrSunset
v0.ErrorValue
<gnolang.StringValue>
ErrCapReached
v0.ErrorValue
<gnolang.StringValue>
ErrBooksMismatch
v0.ErrorValue
<gnolang.StringValue>
evCampaignCreated
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"CampaignCreated"
evBondPosted
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"BondPosted"
evBondReleased
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"BondReleased"
evDonated
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Donated"
evWithdrawn
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Withdrawn"
evRefunded
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Refunded"
evUpdatePosted
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"UpdatePosted"
evClosed
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Closed"
evSettled
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Settled"
evDelisted
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Delisted"
evRelisted
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Relisted"
evNoticeSet
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"NoticeSet"
evStraysSwept
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"StraysSwept"
evParamsChanged
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"ParamsChanged"
evAdminProposed
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"AdminProposed"
evAdminChanged
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"AdminChanged"
evPaused
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Paused"
evUnpaused
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Unpaused"
evTipRecipientChanged
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"TipRecipientChanged"
evMinDonationChanged
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"MinDonationChanged"
evPresetsChanged
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"PresetsChanged"
evEscrowCapChanged
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"EscrowCapChanged"
evCategoryAdded
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"CategoryAdded"
evSunset
untyped stringThe events Bolo emits (API §6), for the web app's indexer. Their attributes are strings.
Value
"Sunset"
itoa
func(n int64) stringitoa formats an amount, a timestamp or a sequence number as an attribute.
- OID
- 07094b…6d43:55
itoa details
Finalize
func(id string)Finalize completes closed campaign id: anyone can, once the campaign's page offers it. It returns the organizer's deposit, and sends the beneficiary the coins someone sent to the escrow outside Bolo. What donors can still reclaim stays theirs. It settles a closed campaign, and forwards what no donor is owed (API §3.4): anyone may call, with no identity. At its first call it settles the campaign; every call forwards the coins sent to the escrow outside Bolo to the beneficiary, and everything at the bond address but a bond still on hold to the organizer — the deposit, and the bond once its hold has ended. It never moves the tracked balance: that stays the donors' (INV-16).
- OID
- 07094b…6d43:57
Finalize details
settlement
typesettlement is what one Finalize call moves, and announces.
Value
v0.settlement
bookFinalize
func(c *v0.campaign) v0.settlementbookFinalize checks a Finalize call on c and enters it in the books, before any coin moves (API §3.4): the first settles c, if checkFinalizable allows; every one works out what to forward, and releases a bond whose hold has ended.
- OID
- 07094b…6d43:59
bookFinalize details
checkFinalizable
func(c *v0.campaign)checkFinalizable refuses c's first settlement (API §3.4), with ErrNotFinalizable, unless it is closed and its FinalizableAt has come: at once in direct mode or with no tracked balance, else once its exit window opens. The view, CanFinalize and this share one rule, finalizableAt.
- OID
- 07094b…6d43:60
checkFinalizable details
pending
func(c *v0.campaign) v0.settlementpending works out what a Finalize call would move from c now, without writing: the escrow's coins above its books, to the beneficiary; the bond address's coins but a bond still on hold — not slashed, not released, its hold not ended — to the organizer, the bond itself included once its hold has ended. Books above the bank, at either address, are ErrBooksMismatch (INV-1, INV-7).
- OID
- 07094b…6d43:61
pending details
CanFinalize
func(id string) (bool, string)CanFinalize says what Finalize(id) would do now (API §4), a passed deadline counted as recorded: true with "settle" for the first settlement, or "forward" on a settled campaign with something to move; false with "open", "not\_yet" while a tracked balance waits for its exit window, or "settled" with nothing to move.
- OID
- 07094b…6d43:62
CanFinalize details
assertCurrent
func()assertCurrent is the first statement of every crossing function (API C2).
- OID
- 07094b…6d43:63
assertCurrent details
checkAddress
func(a .uverse.address, err v0.Error)checkAddress refuses an address argument that isn't a well-formed address (API C12): exactly 40 characters, a lowercase "g" first, then IsValid(). MsgCall passes an address argument through unchecked, and a malformed one stored once would make every later send to it fail. IsValid alone also accepts an address in capitals, which the bank pays as the same account but which never equals the lowercase spelling; it refuses mixed case, so a lowercase "g" means a lowercase address. The length comes first, so IsValid only ever parses address-sized input.
- OID
- 07094b…6d43:65
checkAddress details
secondsPerDay
untyped bigintValue
(86400 <untyped> bigint)
daysToSeconds
func(days int, err v0.Error) int64daysToSeconds converts a duration in whole days to seconds, refusing a negative one and one whose seconds would overflow (API §2.3).
- OID
- 07094b…6d43:66
daysToSeconds details
now
func() int64now is block time in Unix seconds (API C8).
- OID
- 07094b…6d43:67
now details
parseID
func(s string) (v0.ID, bool)parseID returns the campaign ID s names, if s is canonical (API C9): the decimal form of a positive ID — digits only, no sign, no leading zero, no space. "042" names nothing, never campaign 42: one ID has one spelling, and so one set of addresses (INV-18).
- OID
- 07094b…6d43:68
parseID details
idString
func(id v0.ID) stringidString is the canonical decimal form of id.
- OID
- 07094b…6d43:70
idString details
init.130
func()- OID
- 07094b…6d43:71
init.130 details
maxPageSize
untyped bigintValue
(50 <untyped> bigint)
idKeyLen
untyped bigintidKeyLen is the length of a campaign's key, seqid.ID.Binary().
Value
(8 <untyped> bigint)
pageSize
func(size int) intpageSize clamps a requested size to 1–50.
- OID
- 07094b…6d43:73
pageSize details
ListCampaigns
func(after string, size int, category string) ([]v0.CampaignView, string)ListCampaigns returns the open, listed campaigns, newest first, from below after ("" for the newest), and the cursor to pass next, "" at the end; category may be "". A campaign past a deadline nobody recorded is left out (Q6). One call reads at most four times size entries, so a page can be short while the cursor isn't "".
- OID
- 07094b…6d43:75
ListCampaigns details
ListByOrganizer
func(addr .uverse.address, after string, size int) ([]v0.CampaignView, string)ListByOrganizer returns the campaigns addr organizes, delisted included, newest first, from below after, and the cursor to pass next. An address is compared as given (C12).
- OID
- 07094b…6d43:76
ListByOrganizer details
ListByBeneficiary
func(addr .uverse.address, after string, size int) ([]v0.CampaignView, string)ListByBeneficiary returns the campaigns naming addr as beneficiary, delisted included — the beneficiary must keep seeing them (INV-4) — newest first, from below after, and the cursor to pass next.
- OID
- 07094b…6d43:77
ListByBeneficiary details
ListByDonor
func(addr .uverse.address, after string, size int) ([]v0.CampaignView, string)ListByDonor returns the campaigns addr gave to at least once without anonymity, newest first, from below after, and the cursor to pass next: a campaign where all of addr's gifts were anonymous is in no index under addr.
- OID
- 07094b…6d43:78
ListByDonor details
everyCampaign
func(*v0.campaign) bool- OID
- 07094b…6d43:79
everyCampaign details
campaignPage
func(index *v0.Tree, prefix string, after string, size int, budget int, keep func(...)) ([]v0.CampaignView, string)campaignPage reads index newest first: the keys under prefix — a category's or an address's range, which ends at the "/" after it, or the whole index for "" — below after's key. It reads at most budget entries, keeps size views of those keep accepts, and returns them with the ID of the last entry read when more remain, "" when the range is done. A non-canonical after is ErrNotFound (C9).
- OID
- 07094b…6d43:80
campaignPage details
pageOffset
func(page int, size int, n int) (int, bool)pageOffset returns where page starts, newest first, in a tree of n entries paged by size, and false past the end. A page counts from 1; below 1 reads as 1.
- OID
- 07094b…6d43:81
pageOffset details
ListReceipts
func(id string, page int, size int) []v0.ReceiptViewListReceipts returns a page of the campaign's gifts, newest first.
- OID
- 07094b…6d43:82
ListReceipts details
WithdrawalView
typeWithdrawalView is one payout to the beneficiary (API §2.4): its tracked amount and the coins sent outside Bolo it carried, apart.
Value
v0.WithdrawalView
ListWithdrawals
func(id string, page int, size int) []v0.WithdrawalViewListWithdrawals returns a page of the campaign's withdrawals, newest first.
- OID
- 07094b…6d43:83
ListWithdrawals details
RefundView
typeRefundView is one payout to a donor (API §2.4). Donor is empty when all of that donor's gifts to the campaign were anonymous; Kind is "open" or "exit".
Value
v0.RefundView
ListRefunds
func(id string, page int, size int) []v0.RefundViewListRefunds returns a page of the campaign's refunds, newest first.
- OID
- 07094b…6d43:84
ListRefunds details
UpdateView
typeUpdateView is one organizer update (API §2.4).
Value
v0.UpdateView
ListUpdates
func(id string, page int, size int) []v0.UpdateViewListUpdates returns a page of the campaign's updates, newest first.
- OID
- 07094b…6d43:85
ListUpdates details
Delist
func(id string, notice string, slash bool)Delist takes the campaign off the active lists, with a public notice, and with slash moves its bond to the slashed address, where nothing ever spends it (INV-8). Delisting again replaces the notice, and may slash a bond not yet slashed.
- OID
- 07094b…6d43:86
Delist details
bookSlash
func(c *v0.campaign) int64bookSlash checks a slash of c's bond and enters it in the books, before the coins move (API §3.5), and returns what moves: the bond, never the deposit. It refuses, in order, no bond posted, a bond already slashed, a hold that has ended — once closed, BondHold after closedAt, settled or not — and a bond address holding less than the bond (INV-7).
- OID
- 07094b…6d43:88
bookSlash details
Relist
func(id string)Relist puts a delisted campaign back on the lists, and into the active indexes if it is still open (API §3.5). Its notice stays, as does a slash. Relisting a listed campaign changes nothing.
- OID
- 07094b…6d43:89
Relist details
SetNotice
func(id string, notice string)SetNotice attaches a public warning to the campaign without delisting it, or clears it with "" (API §3.5). An unchanged notice changes nothing.
- OID
- 07094b…6d43:90
SetNotice details
checkNotice
func(c *v0.campaign, notice string) stringcheckNotice returns notice as SetNotice stores it (API §3.5): "" clears, except on a delisted campaign, which keeps a public reason; any other text is normalized, 1–280 characters. It panics with ErrNotice otherwise.
- OID
- 07094b…6d43:91
checkNotice details
HideMessage
func(id string, seq int64)HideMessage hides one gift's message (API §3.5): visibility only. The receipt, its amount and its donor stay, and so does the stored text. Hiding a hidden message, or a receipt without one, changes nothing.
- OID
- 07094b…6d43:92
HideMessage details
hiderOrganizer
untyped stringWho hid a campaign's photo: ImageHidden's by (API §6).
Value
"organizer"
hiderModerator
untyped stringWho hid a campaign's photo: ImageHidden's by (API §6).
Value
"moderator"
PostBond
func(id string)PostBond adds what you send to campaign id's bond: a stake its organizer may post, lost if Bolo's moderator delists the campaign for fraud. It is not a guarantee. The organizer only, while the campaign is open. It adds the envelope to the campaign's bond (API §3.1): its organizer only, by a direct transaction, while the campaign is open, its bond unslashed and Bolo not paused. The bond only grows, and the coins go on to the bond address: the realm keeps nothing (INV-3).
- OID
- 07094b…6d43:93
PostBond details
checkBond
func(c *v0.campaign, amount int64)checkBond refuses amount as more bond for c (API §3.1), in this order: nothing sent, a campaign that isn't open, a slashed bond, a paused Bolo, and a bond that would pass int64.
- OID
- 07094b…6d43:95
checkBond details
assertOpen
func(c *v0.campaign)assertOpen refuses a campaign that isn't open, by its stored status: ErrCampaignSettled once settled, ErrCampaignClosed otherwise. A passed deadline is recorded before (API §3.1).
- OID
- 07094b…6d43:96
assertOpen details
PostUpdate
func(id string, body string) stringPostUpdate posts an update on campaign id, shown under its story, and returns the update's number: its organizer only. body may hold links, never an image. It appends an update to the campaign (API §3.1): its organizer only, by a direct transaction, in every status and while paused. Updates are append-only, and each resets the dormancy clock.
- OID
- 07094b…6d43:97
PostUpdate details
HideImage
func(id string)HideImage hides campaign id's photo, for good: its organizer can, and so can Bolo's moderator. Its organizer may, by a direct transaction, and so may the moderator, with the master key — a DAO realm, once one holds the role, through C11's realm branch (API §3.1, §3.5). The CID stays: it is a fingerprint, and never replaced. Hiding a hidden photo, or a campaign with none, changes nothing.
- OID
- 07094b…6d43:98
HideImage details
windowOpen
untyped stringThe refund windows' names: Refund's kind, GetContribution's window (API §3.2).
Value
"open"
windowExit
untyped stringThe refund windows' names: Refund's kind, GetContribution's window (API §3.2).
Value
"exit"
Withdraw
func(id string) int64Withdraw sends everything campaign id's escrow holds to its beneficiary, and returns how much: the beneficiary only, until the exit window opens — the campaign's page says when. The beneficiary only — a user by a direct transaction, or a deployed realm, through C11's realm branch (API §3.3). The tracked part counts as Withdrawn, and only it ends the open refund window; coins sent to the escrow outside Bolo go along, recorded apart.
- OID
- 07094b…6d43:99
Withdraw details
bookWithdrawal
func(c *v0.campaign) *v0.withdrawalbookWithdrawal checks a withdrawal from c and enters it in the books, before any coin moves (API §3.3): the refusals of checkWithdrawable; nothing at the escrow; INV-1. Everything at the escrow goes, the tracked part as Withdrawn — ending the open refund window only when above 0 — and the rest recorded apart. It returns the stored record.
- OID
- 07094b…6d43:101
bookWithdrawal details
checkWithdrawable
func(c *v0.campaign)checkWithdrawable refuses a withdrawal from c (API §3.3), in this order: a direct campaign, a settled one, and a closed one whose exit window has opened — what is left belongs to the exit process then.
- OID
- 07094b…6d43:102
checkWithdrawable details
Refund
func(id string) int64Refund gives you back, from campaign id's escrow, what you can take back now, and returns how much: your whole gift until the beneficiary first withdraws, or, once the beneficiary's window after the campaign closes has passed, your share of what they left uncollected. The campaign's page offers it when a donor can. It pays the caller back from their own contribution to the campaign (API §3.2, INV-13): a donor, by a direct transaction, while a refund window is open to them. The open window — no tracked withdrawal ever — pays everything not yet refunded.
- OID
- 07094b…6d43:103
Refund details
bookRefund
func(c *v0.campaign, donor .uverse.address) *v0.refundbookRefund checks a refund of donor's contribution to c and enters it in the books, before any coin moves (API §3.2): the refusals of checkRefund, then INV-1, on the books as they stand. An exit claim freezes the pool and its base if it is the first, uses the donor's one claim, and may not exceed the tracked balance (INV-17). It returns the stored record.
- OID
- 07094b…6d43:104
bookRefund details
checkRefund
func(c *v0.campaign, donor .uverse.address) (*v0.contribution, string, int64)checkRefund returns donor's contribution to c, the window Refund would use and what it would pay, or panics (API §3.2), in this order: a direct campaign; nothing to refund; no window open, a used exit claim included; an exit claim that rounds down to 0.
- OID
- 07094b…6d43:105
checkRefund details
refundable
func(c *v0.campaign, k *v0.contribution) (string, int64)refundable returns the window Refund would use for k now, and what it would pay (API §3.2). The open window, while no tracked withdrawal ever happened, pays all not yet refunded. After one, the exit window opens once the campaign is closed and ExitDelay has passed, while a tracked balance is left: one claim per donor, pro-rata against the pool and base the first claim froze — or would freeze now. It reads the effective status, as GetContribution can't record a passed deadline.
- OID
- 07094b…6d43:106
refundable details
exitClaim
func(left int64, pool int64, base int64) int64exitClaim is left × pool / base, rounded down (API §3.2): computed in 128 bits, as both factors fit in 63 bits but their product doesn't. A claimant's left is part of the base, so the base is above 0 and the quotient at most the pool, and Div64's own panics, keyless, can't be reached; both conditions are asserted first.
- OID
- 07094b…6d43:107
exitClaim details
assertBooks
func(c *v0.campaign)assertBooks panics with ErrBooksMismatch when c's books hold more than its escrow does (INV-1). It runs before every payout from an escrow, on the books as they stand, so a bug in the books stops a payment instead of paying out coins they can't account for.
- OID
- 07094b…6d43:108
assertBooks details
contributionOf
func(c *v0.campaign, donor .uverse.address) *v0.contributioncontributionOf returns donor's record in c, or nil.
- OID
- 07094b…6d43:109
contributionOf details
ContributionView
typeContributionView is one donor's record in one campaign (API §2.4), with what Refund would pay them now: a copy.
Value
v0.ContributionView
GetContribution
func(id string, donor .uverse.address) v0.ContributionViewGetContribution returns donor's record in campaign id (API §4): zeros and no window for an address that never gave, and no window for an exit claim that rounds to 0, which Refund refuses. An address is compared as given (C12).
- OID
- 07094b…6d43:110
GetContribution details
ReceiptView
typeReceiptView is one gift, as the receipt page and the campaign page show it (API §2.4): a copy, holding nothing of the realm's state.
Value
v0.ReceiptView
GetReceipt
func(id string, seq int64) v0.ReceiptViewGetReceipt returns gift seq of campaign id (API §4): an unknown campaign or sequence number is ErrNotFound.
- OID
- 07094b…6d43:111
GetReceipt details
receiptOf
func(c *v0.campaign, seq int64) *v0.receiptreceiptOf returns gift seq of c, or panics with ErrNotFound.
- OID
- 07094b…6d43:113
receiptOf details
ListRecent
func(id string) []v0.ReceiptViewListRecent returns the campaign's last gifts, newest first, at most recentSize (API §4): read through the ring of sequence numbers in its hot state.
- OID
- 07094b…6d43:114
ListRecent details
receiptView
func(c *v0.campaign, r *v0.receipt) v0.ReceiptViewreceiptView builds r's view (API §2.4): the donor blanked when the gift was anonymous, the message when moderation hid it, and what this donor was refunded since, so a receipt can't vouch for money taken back (INV-12).
- OID
- 07094b…6d43:115
receiptView details
webPath
untyped string// this realm on gnoweb
Value
"/r/g12yg9nh4ncma44emgm8msxe8aavzywt0p95tanv/bolo/v0"
maxPathLen
untyped bigint// longer than any valid path
Value
(256 <untyped> bigint)
listPage
untyped bigint// entries a list page shows
Value
(20 <untyped> bigint)
updatesPage
untyped bigint// updates a page shows: each can cost 0.18 billion gas to render
Value
(5 <untyped> bigint)
addressSection
untyped bigint// entries each address-page section shows
Value
(10 <untyped> bigint)
barWide
untyped bigint// a progress bar's width across a page, scaled down to fit
Value
(1000 <untyped> bigint)
barCard
untyped bigint// and in a card, half a row
Value
(400 <untyped> bigint)
notFound
untyped stringValue
"# Not found\n\nThere is nothing here. [Bolo](/r/g12yg9nh4ncma44emgm8msxe8aavzywt0p95tanv/bolo/v0)\n"
Render
func(path string) stringRender returns the markdown page for path (API §5).
- OID
- 07094b…6d43:116
Render details
route2page
func(route string, q map[string]string) (string, bool)route2page renders route, or reports false when route names nothing or a value in q doesn't parse. Every prefix of a route renders a page, as gnoweb's header links each one: "c" the home page, "c/{id}/r" the gifts, "u" the form to find an address.
- OID
- 07094b…6d43:118
route2page details
parseQuery
func(raw string) (map[string]string, bool)parseQuery splits a query into its key=value pairs: an empty pair is skipped, a key given twice fails. Values are taken as they are: the routes parse them.
- OID
- 07094b…6d43:119
parseQuery details
pageOf
func(q map[string]string, render func(...)) (string, bool)pageOf calls render with the page q asks for, 1 when it asks none, or fails when its page isn't a canonical number of at least 1.
- OID
- 07094b…6d43:120
pageOf details
parsePage
func(s string) (int, bool)parsePage parses a page number: canonical decimal — no sign, no leading zero — from 1, at most nine digits.
- OID
- 07094b…6d43:121
parsePage details
parseAddress
func(s string) (.uverse.address, bool)- OID
- 07094b…6d43:122
parseAddress details
renderHome
func(q map[string]string) (string, bool)renderHome is the home page: the guarantees in one line, how it works, the links to start a campaign and to find an address, the newest active campaigns in a category or all, 20 at a time by cursor, and the categories.
- OID
- 07094b…6d43:123
renderHome details
writeStart
func(b *strings.Builder)writeStart writes the link to start a campaign — CreateCampaign's form, the creation deposit attached — while this version takes new campaigns, or why it doesn't; then the link to find an address.
- OID
- 07094b…6d43:124
writeStart details
writeCards
func(b *strings.Builder, views []v0.CampaignView)writeCards writes campaigns as cards, two to a row in gnoweb's columns (UI spec §4.13): the title as a link, the progress bar, raised of the goal and donors, then the mode, the category, the time left or how it ended, and a bond or a moderator's notice when there is one. The one user text, the title, goes through inline, whose InlineText escapes "\<": nothing in it can open, separate or close a block. A separator is written self-closing, the spelling every gnoweb reads as one.
- OID
- 07094b…6d43:125
writeCards details
timeWord
func(v v0.CampaignView) stringtimeWord says where a campaign stands in time, on a card: the time left, no deadline, or how it ended.
- OID
- 07094b…6d43:126
timeWord details
renderCampaign
func(c *v0.campaign) stringrenderCampaign is a campaign's page (API §5, UI spec §4.13), Bolo's own blocks before the organizer's words: the notice, the photo, the title and byline, the figures, the mode, the state banner, the donate links, where the money is, the verification block; then the story as a quote; then the recent gifts, the latest update, and last the actions of the organizer, the beneficiary and anyone.
- OID
- 07094b…6d43:127
renderCampaign details
writeFigures
func(b *strings.Builder, v v0.CampaignView)writeFigures writes the progress bar, then three figures, a short line each, which stay short on a phone: raised, of the goal; donors and gifts; the time left, or how it ended.
- OID
- 07094b…6d43:128
writeFigures details
writeMode
func(b *strings.Builder, v v0.CampaignView)writeMode writes the custody mode in words and what it means now (UI spec §4.3, ModeChip), with the refund link while a refund window is open to some donor — as far as the books can tell: after every donor's exit claim, rounding can leave a few ugnot that keep the window open in the books (API §2.4, §5).
- OID
- 07094b…6d43:129
writeMode details
writeBanner
func(b *strings.Builder, v v0.CampaignView, space int64, dormant bool)writeBanner writes the one state banner the UI spec's state matrix gives the campaign now (§6), as gnoweb's alert box, which no user text can open (API §5): how it was closed and what remains to happen, that it completed, that Bolo is paused, that the escrow cap leaves no room for a gift, or that anyone may close it as it is dormant. space is the room the cap leaves.
- OID
- 07094b…6d43:130
writeBanner details
closedText
func(v v0.CampaignView) stringclosedText says how a campaign was closed and, in escrow, what remains: the beneficiary's countdown to the exit window, or the window open to donors.
- OID
- 07094b…6d43:131
closedText details
room
func(v v0.CampaignView) int64room is how much more campaign v can take: what the escrow cap leaves, in escrow with a cap (checkRoom); otherwise as much as an amount can be.
- OID
- 07094b…6d43:132
room details
writeGive
func(b *strings.Builder, v v0.CampaignView, space int64)writeGive writes the one-click donate links (API §5): while the campaign is open, listed and Bolo isn't paused, one per preset Donate would take — at least the smallest gift, and no more than the room the escrow cap leaves, space — then the page for another amount, with the room said when it left a preset out.
- OID
- 07094b…6d43:133
writeGive details
giveLink
func(id string, ugnot int64) stringgiveLink is a one-click link that gives ugnot to campaign id, with no tip and no message: gnoweb's form attaches the coins once the donor confirms them.
- OID
- 07094b…6d43:134
giveLink details
renderGive
func(c *v0.campaign, q map[string]string) stringrenderGive is the page for another amount (API §5). gnoweb's function form attaches only the coins a link carries, so this page asks the amount in gnoweb's own form, which submits back as ?amount=, and answers an amount Donate would take with its one-click link. Any other amount gets the form again with what the campaign can take, echoing nothing; a campaign Bolo offers no gift link for says so.
- OID
- 07094b…6d43:135
renderGive details
parseGNOT
func(s string) (int64, bool)parseGNOT parses an amount in GNOT into ugnot (API §5): digits without a sign or a leading zero, at most 12 of them, then optionally a decimal point — "." or, as a form sends a comma, "%2C" — and one to six digits; but not a comma and exactly three, which may be a thousands separator. The spaces a form sends around a value, as "+", are dropped first.
- OID
- 07094b…6d43:136
parseGNOT details
writeMoney
func(b *strings.Builder, v v0.CampaignView)writeMoney writes where the money is, a table of amounts: given, then, in escrow, refunded, raised net of refunds, withdrawn and held; in direct mode, sent straight to the beneficiary.
- OID
- 07094b…6d43:137
writeMoney details
writeVerify
func(b *strings.Builder, v v0.CampaignView)writeVerify writes the verification block: where to check every figure on the chain itself (UI spec §2, level 3), each address in full.
- OID
- 07094b…6d43:138
writeVerify details
writeManage
func(b *strings.Builder, v v0.CampaignView, anyone bool)writeManage writes the actions of the organizer, the beneficiary and anyone, each with who may take it, when that call could succeed for someone (API §5): last, as the web app puts maintenance last (UI spec §4.3). anyone is whether CanClose lets anyone close it.
- OID
- 07094b…6d43:139
writeManage details
writeGift
func(b *strings.Builder, r v0.ReceiptView)writeGift writes one gift in two lines: its amount, and its message unless moderation hid it; then who gave it — a short address linking to its page, or anonymous — when, how much its donor was refunded since (INV-12), and its receipt.
- OID
- 07094b…6d43:140
writeGift details
renderReceipt
func(c *v0.campaign, seq int64) stringrenderReceipt is a gift's receipt: the shareable object (PRD §5). When its donor was refunded since, the refund banner comes first, so a refunded receipt never looks like a live gift (UI spec §4.5, INV-12).
- OID
- 07094b…6d43:141
renderReceipt details
renderDonations
func(c *v0.campaign, page int) stringrenderDonations is a page of a campaign's gifts, newest first, under one line of totals.
- OID
- 07094b…6d43:142
renderDonations details
renderLedger
func(c *v0.campaign, page int) stringrenderLedger is a page of a campaign's money out of its escrow: withdrawals, then refunds, each newest first. In direct mode, it says that nothing goes out: Withdraw and Refund refuse a direct campaign, so neither list ever holds one.
- OID
- 07094b…6d43:143
renderLedger details
renderUpdates
func(c *v0.campaign, page int) stringrenderUpdates is a page of a campaign's updates, newest first, each as a quote.
- OID
- 07094b…6d43:144
renderUpdates details
empty
func(page int, first string, later string) stringempty says a page of a campaign's list has nothing on it: first on the list's first page, where it means the list is empty, later past it (API §5).
- OID
- 07094b…6d43:145
empty details
writePager
func(b *strings.Builder, base string, page int, size int, n int)writePager writes links to the pages before and after page, of n entries, size a page.
- OID
- 07094b…6d43:146
writePager details
addressList
func(name string) (func(...), string)addressList returns the address page's list a path segment names, and its heading; nil for any other segment. They show listed campaigns only, as they promote (API §5).
- OID
- 07094b…6d43:147
addressList details
renderAddress
func(addr .uverse.address) stringrenderAddress is the public address page: the short address as its title and the full one under it, then the 10 newest campaigns of each list, as cards, with "More" while a list goes on.
- OID
- 07094b…6d43:148
renderAddress details
renderAddressList
func(addr .uverse.address, name string, heading string, list func(...), after string) stringrenderAddressList is one of the address page's lists, 20 at a time by cursor.
- OID
- 07094b…6d43:149
renderAddressList details
writeListed
func(b *strings.Builder, views []v0.CampaignView, paged bool)writeListed writes the cards of the listed campaigns among views: a delisted one is left out of a list that promotes. With none to show, it says so, and whether this is only one page of the list: a later one, or one a "More" follows (paged).
- OID
- 07094b…6d43:150
writeListed details
renderLookup
func(q map[string]string) stringrenderLookup is the page that finds an address: gnoweb's form, which submits back here as ?address=. A valid address gets its page; anything else, the form again with one fixed line, echoing nothing from the request (API §5).
- OID
- 07094b…6d43:151
renderLookup details
renderAbout
func() stringrenderAbout is the guarantees table, what Bolo costs, where tips go, how to check it, and what not to do (PRD §3, UI spec §4.11).
- OID
- 07094b…6d43:152
renderAbout details
renderParams
func() stringrenderParams shows the parameters new campaigns get, the live settings in words, and the admin.
- OID
- 07094b…6d43:153
renderParams details
progressBar
func(net int64, goal int64, width int) stringprogressBar draws how much of its goal a campaign raised (UI spec §5, ProgressBar): an SVG image of two numbers, which gnoweb accepts inline as a data URI, width wide. It fills min(net, goal) of goal; its text, the percentage, is uncapped. With no goal, there is no bar.
- OID
- 07094b…6d43:154
progressBar details
percent
func(net int64, goal int64) stringpercent writes net as a share of goal, rounded down and uncapped: "124%".
- OID
- 07094b…6d43:155
percent details
share
func(part int64, whole int64, scale int64) int64share is part×scale/whole rounded down, for whole > 0, and 0 for part ≤ 0: exact for any part up to math.MaxInt64/scale, past every amount of ugnot there is, and held there beyond, so the product never overflows.
- OID
- 07094b…6d43:156
share details
short
func(a .uverse.address) stringshort shortens an address where a reader recognizes it rather than checks it: its first eight and last six characters (UI spec §4.13).
- OID
- 07094b…6d43:157
short details
addrLink
func(a .uverse.address) stringaddrLink links an address's short form, in a code span, to its address page: Bolo's own link, where gnoweb makes no mention (API §5).
- OID
- 07094b…6d43:158
addrLink details
gnot
func(ugnot int64) stringgnot writes an amount of ugnot in GNOT: up to six decimals, trailing zeros dropped.
- OID
- 07094b…6d43:159
gnot details
amount
func(ugnot int64) stringamount writes an amount of ugnot as a number of GNOT, for a column headed GNOT.
- OID
- 07094b…6d43:160
amount details
when
func(unix int64) stringwhen writes a Unix time in UTC.
- OID
- 07094b…6d43:161
when details
stamp
func(unix int64) stringstamp writes a Unix time in UTC without saying so, for a column that does.
- OID
- 07094b…6d43:162
stamp details
day
func(unix int64) stringday writes a Unix time's day in UTC, where the minute is written nearby: a figure's caption, under the full time in the dates line.
- OID
- 07094b…6d43:163
day details
left
func(until int64) stringleft writes a real timer's countdown (UI spec §5, Countdown): whole days left, then "less than a day left".
- OID
- 07094b…6d43:164
left details
count
func(n int, one string, many string) stringcount writes n of something: one, or many.
- OID
- 07094b…6d43:165
count details
days
func(seconds int64) stringdays writes a duration in seconds as whole days.
- OID
- 07094b…6d43:166
days details
statusWord
func(status string) stringstatusWord names a status in the UI spec's words (§8.1).
- OID
- 07094b…6d43:167
statusWord details
modeWord
func(mode string) stringmodeWord names a custody mode in the UI spec's words (§8.1).
- OID
- 07094b…6d43:168
modeWord details
inline
func(s string) stringinline escapes text for an inline slot: sanitize.InlineText, which leaves no link and no image, then the mentions gnoweb would still make links of — "@name", and an address after a space — each to a page whose owner writes it (API §5). A backslash keeps "@" as it reads; a no-break space looks like the space it replaces.
- OID
- 07094b…6d43:169
inline details
lineStart
func(s string) stringlineStart escapes text for an inline slot that opens a line — the title's heading, the notice's line — where gnoweb also links an address with nothing before it: "g" reads as the "g" it replaces. Only there: gnoweb's table of contents shows a card's heading as written, and a card's title sits in a link's text, where gnoweb makes no mention (API §5).
- OID
- 07094b…6d43:170
lineStart details
launchDeposit
int64// ugnot
Value
1000000
launchDormancy
int64Phase 0's values (API §2.2): placeholders for the deposit, the minimum donation and the escrow cap, whose launch values API §2.2 proposes, and the three durations it proposes. All are settled before Phase 1 (README), and only the admin changes them afterwards.
Value
7776000
launchExitDelay
int64Phase 0's values (API §2.2): placeholders for the deposit, the minimum donation and the escrow cap, whose launch values API §2.2 proposes, and the three durations it proposes. All are settled before Phase 1 (README), and only the admin changes them afterwards.
Value
5184000
launchBondHold
int64Phase 0's values (API §2.2): placeholders for the deposit, the minimum donation and the escrow cap, whose launch values API §2.2 proposes, and the three durations it proposes. All are settled before Phase 1 (README), and only the admin changes them afterwards.
Value
2592000
launchMinDonation
int64// ugnot, a placeholder
Value
1000000
launchEscrowCap
int64// ugnot (1,000 GNOT), a placeholder
Value
1000000000
maxCategories
untyped bigintPhase 0's values (API §2.2): placeholders for the deposit, the minimum donation and the escrow cap, whose launch values API §2.2 proposes, and the three durations it proposes. All are settled before Phase 1 (README), and only the admin changes them afterwards.
Value
(50 <untyped> bigint)
admin
.uverse.address// a realm once a DAO accepts the role (ADR D11)
Value
<gnolang.StringValue>
pendingAdmin
.uverse.address// the proposed admin until it accepts; "" for none
Value
<zero>
params
v0.ParamsThe admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
- OID
- 07094b…6d43:174
params details
presets
[4]int64The admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
- OID
- 07094b…6d43:176
presets details
minDonation
int64The admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
Value
1000000
escrowCap
int64// 0: no cap
Value
1000000000
tipRecipient
.uverse.addressThe admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
Value
<gnolang.StringValue>
paused
boolThe admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
Value
false
sunset
boolThe admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
Value
false
categories
v0.Tree// code → true
- OID
- 07094b…6d43:183
categories details
categoryOrder
[]stringThe admin and the settings only it changes (API §2.2, §3.6). Package state, all unexported (C6).
- OID
- 07094b…6d43:185
categoryOrder details
SettingsView
typeSettingsView is the live settings (API §2.4): a copy, holding nothing of the realm's state.
Value
v0.SettingsView
GetParams
func() v0.ParamsGetParams returns the Params a campaign created now would get (API §4).
- OID
- 07094b…6d43:186
GetParams details
GetSettings
func() v0.SettingsViewGetSettings returns the live settings (API §4).
- OID
- 07094b…6d43:188
GetSettings details
GetAdmin
func() (.uverse.address, .uverse.address)GetAdmin returns the admin and the proposed admin, "" when there is none (API §4).
- OID
- 07094b…6d43:189
GetAdmin details
Params
typeParams are the settings snapshotted into each campaign when it is created (API §2.2): its deposit and its timers never change afterwards (INV-5). Durations are in seconds.
Value
v0.Params
modeDirect
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"direct"
modeEscrow
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"escrow"
statusOpen
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"open"
statusClosed
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"closed"
statusSettled
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"settled"
reasonOrganizer
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"organizer"
reasonDeadline
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"deadline"
reasonDormant
untyped stringCustody modes, statuses and close reasons (API §2.1).
Value
"dormant"
campaign
typecampaign holds what never changes once a campaign is created (INV-10), and points to what does. Gno re-saves a changed object and every object that owns it, up to the first with two owners, so each donation re-saves this object with its hot state and its trees: it holds only small fields, and the organizer's text lives in its own object, written once (API §2.5).
Value
v0.campaign
campaignText
typecampaignText is what the organizer wrote, which never changes (INV-10): written once, off the path every donation re-saves.
Value
v0.campaignText
recentSize
untyped bigintValue
(20 <untyped> bigint)
campaignState
typecampaignState is a campaign's hot object: small, rewritten on every donation.
Value
v0.campaignState
contribution
typecontribution is one donor's record in one campaign (API §3.2).
Value
v0.contribution
receipt
typereceipt is one donation.
Value
v0.receipt
withdrawal
typewithdrawal is one payout to the beneficiary.
Value
v0.withdrawal
refund
typerefund is one payout to a donor.
Value
v0.refund
update
typeupdate is one organizer update: append-only.
Value
v0.update
nextID
v0.ID// the last campaign ID given out
Value
<zero>
campaigns
v0.Tree// seqid.Binary() → \*campaign
- OID
- 07094b…6d43:192
campaigns details
derived
v0.Tree// address → true
- OID
- 07094b…6d43:194
derived details
active
v0.Tree// seqid.Binary() → true: the open, listed campaigns
- OID
- 07094b…6d43:196
active details
activeByCategory
v0.Tree// category + "/" + seqid.Binary() → true: the same
- OID
- 07094b…6d43:198
activeByCategory details
byOrganizer
v0.Tree// organizer + "/" + seqid.Binary() → true
- OID
- 07094b…6d43:200
byOrganizer details
byBeneficiary
v0.Tree// beneficiary + "/" + seqid.Binary() → true
- OID
- 07094b…6d43:202
byBeneficiary details
byDonor
v0.Tree// donor + "/" + seqid.Binary() → true: a gift that wasn't anonymous
- OID
- 07094b…6d43:204
byDonor details
statsState
typestatsState holds Bolo-wide counters (API §2.4), kept as things happen, never by walking the campaigns. Gift and refund totals aren't kept: an indexer sums them.
Value
v0.statsState
stats
v0.statsState- OID
- 07094b…6d43:206
stats details
StatsView
typeStatsView is what GetStats returns (API §2.4).
Value
v0.StatsView
GetStats
func() v0.StatsViewGetStats returns Bolo-wide figures (API §4). Open counts a campaign past a deadline nobody recorded until someone does (§3.1).
- OID
- 07094b…6d43:207
GetStats details
titleMin
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(4 <untyped> bigint)
titleMax
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(80 <untyped> bigint)
descriptionMax
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(5000 <untyped> bigint)
messageMax
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(140 <untyped> bigint)
updateMin
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(1 <untyped> bigint)
updateMax
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(2000 <untyped> bigint)
noticeMin
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(1 <untyped> bigint)
noticeMax
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(280 <untyped> bigint)
altMin
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(1 <untyped> bigint)
altMax
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(250 <untyped> bigint)
cidMaxBytes
untyped bigintText limits in characters — Unicode code points — after normalization (API §2.3). Every text also has a byte cap of four times its character limit, on the argument as sent.
Value
(100 <untyped> bigint)
normalize
func(s string, multiline bool) stringnormalize prepares user text for checking and storing (API C7, §2.3). Bidi and zero-width characters go first, through the very function sanitize.Block calls when it renders, so that no check can be dodged by what rendering removes. Line breaks are unified — CR-LF, CR, NEL and the Unicode line and paragraph separators all become "\\n" — and kept in multiline text; elsewhere they become a space. Tabs and the other whitespace controls (a vertical tab, a form feed, the information separators) become a space everywhere, so words never join. Then every character that only pads a text goes (invisible), and surrounding whitespace is trimmed. Stripping more than Block does only makes the checks stricter, and the stripped text is what gets stored.
- OID
- 07094b…6d43:209
normalize details
invisible
func(r int32) boolinvisible reports whether r shows nothing and only pads a text: a control or a format character (Unicode Cc, Cf: a word joiner, a soft hyphen), one Unicode lists as Other\_Default\_Ignorable\_Code\_Point (a Hangul filler, the combining grapheme joiner), or a blank symbol (the Braille blank, the musical null notehead). A Latin-1 character skips the tables, which are costly and which English or French text seldom leaves: of them, only the controls and the soft hyphen are invisible (TestLatin1 holds this to the tables). Every control is Latin-1.
- OID
- 07094b…6d43:211
invisible details
checkText
func(s string, min int, max int, multiline bool, err v0.Error) stringcheckText checks one text argument and returns it normalized, the form Bolo stores (API §2.3): valid UTF-8 and at most four bytes per allowed character as sent; then, normalized, at most max characters, of which at least min show on their own. It panics with err otherwise.
- OID
- 07094b…6d43:212
checkText details
visible
func(s string, min int) boolvisible reports whether at least min characters of s show on their own — letters, digits, punctuation, symbols and spacing marks — counting the spaces between two of them. A mark that takes no space (an accent, a variation selector) only changes the character before it, a private-use character or a code point Unicode hasn't assigned shows nothing a reader can count on, and a space shows only between characters that do. They all stay in the text, but don't count toward a minimum. Latin-1 skips the tables, as in invisible: there, every character shows on its own but the controls, the soft hyphen and the two spaces, ' ' and U+00A0. Counting stops once min characters have shown, so a long text pays the tables only until then, and a story, whose minimum is 0, never.
- OID
- 07094b…6d43:213
visible details
checkStory
func(s string, min int, max int, err v0.Error) stringcheckStory checks a story or an update, the organizer's own text, and returns it normalized (API §2.3): the limits of checkText, then no image and no raw HTML, judged on the normalized text that sanitize.Block will render.
- OID
- 07094b…6d43:214
checkStory details
checkMarkup
func(s string)checkMarkup refuses an image or raw HTML (API §2.3): \`!\[\`, or \`\<\` followed by a letter, \`/\`, \`!\` or \`?\` — every way CommonMark opens raw HTML. The campaign photo is the only image a campaign shows, and \`\<3\` still passes.
- OID
- 07094b…6d43:215
checkMarkup details
checkImage
func(cid string, alt string) (string, string)checkImage checks a campaign photo's CID and its description (API §2.3, ADR D16), and returns both, the description normalized: no photo, no description; a photo, a description of 1 to 250 characters.
- OID
- 07094b…6d43:216
checkImage details
validCID
func(s string) boolvalidCID reports whether s has the shape of an IPFS CID Bolo accepts: v0, "Qm" and 44 more base58btc characters; or v1 in lowercase base32, "b" then that alphabet; at most 100 bytes. Render writes the CID into \`(ipfs://…)\` as it is, so the character set is the escaping (API §2.3).
- OID
- 07094b…6d43:217
validCID details
base58btc
untyped stringValue
"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
base32Lower
untyped stringValue
"abcdefghijklmnopqrstuvwxyz234567"
allIn
func(s string, set string) bool- OID
- 07094b…6d43:218
allIn details
CampaignView
typeCampaignView is a campaign as clients see it (API §2.4): a copy, holding nothing of the realm's state, its derived fields computed at now without writing.
Value
v0.CampaignView
GetCampaign
func(id string) v0.CampaignViewGetCampaign returns campaign id's view (API §4). An unknown or non-canonical ID is ErrNotFound (C9).
- OID
- 07094b…6d43:219
GetCampaign details
campaignOf
func(id string) *v0.campaigncampaignOf returns the campaign id names, or panics with ErrNotFound (C9).
- OID
- 07094b…6d43:221
campaignOf details
lookup
func(id string) (*v0.campaign, bool)lookup returns the campaign id names, if id is canonical and the campaign exists.
- OID
- 07094b…6d43:222
lookup details
effective
func(c *v0.campaign) (status string, reason string, closedAt int64)effective returns c's status, close reason and close time at now, counting a passed deadline as recorded (API §2.4, §3.1), without writing.
- OID
- 07094b…6d43:223
effective details
trackedBalance
func(c *v0.campaign) int64trackedBalance is what the books say the escrow holds (API §2.4): 0 in direct mode.
- OID
- 07094b…6d43:224
trackedBalance details
campaignView
func(c *v0.campaign) v0.CampaignViewcampaignView builds c's view at now (API §2.4).
- OID
- 07094b…6d43:225
campaignView details
dormantAt
func(c *v0.campaign) int64dormantAt is when anyone may close c for dormancy: its last activity plus its snapshot's dormancy period (API §3.1).
- OID
- 07094b…6d43:226
dormantAt details
lastActivity
func(c *v0.campaign) int64lastActivity is the latest of c's creation, its last gift and its last update: dormancy counts from it (API §3.1).
- OID
- 07094b…6d43:227
lastActivity details
finalizableAt
func(c *v0.campaign, closedAt int64, balance int64) int64finalizableAt is when Finalize first succeeds for c closed at closedAt (API §2.4, §3.4): at once in direct mode or with nothing tracked, else once the exit opens.
- OID
- 07094b…6d43:228