esc
func(s string) string- OID
- 0a1979…b7a4:3
esc details
escCell
func(s string) string- OID
- 0a1979…b7a4:5
escCell details
gnowebSafe
func(s string) string- OID
- 0a1979…b7a4:6
gnowebSafe details
Denom
untyped stringDenom is the only coin a plan can be paid in.
Value
"ugnot"
MinAmount
int64Limits. See docs/design.md for the reasoning behind each value.
Value
100000
MaxAmount
int64Limits. See docs/design.md for the reasoning behind each value.
Value
1000000000000
MinPeriod
int64Limits. See docs/design.md for the reasoning behind each value.
Value
60
MaxPeriod
int64Limits. See docs/design.md for the reasoning behind each value.
Value
2592000
MaxTerm
int64Limits. See docs/design.md for the reasoning behind each value.
Value
31622400
FeeAllowance
int64Limits. See docs/design.md for the reasoning behind each value.
Value
100000
MaxTitleLen
untyped bigintLimits. See docs/design.md for the reasoning behind each value.
Value
(80 <untyped> bigint)
PageSize
untyped bigintLimits. See docs/design.md for the reasoning behind each value.
Value
(20 <untyped> bigint)
MaxSessionsPerWallet
untyped bigintLimits. See docs/design.md for the reasoning behind each value.
Value
(16 <untyped> bigint)
Plan
typePlan is published by a payee and never changes. New terms mean a new plan.
Value
mandate.Plan
Mandate
typeMandate is one payer's permission for one session key on one plan. It keeps only what cannot be derived: the amount paid is Pulls \* the plan's amount, and the last pull was one period before NextPullAt.
Value
mandate.Mandate
Payee
typePayee holds a payee's plans, totals and published collector key.
Value
mandate.Payee
realmPath
string// this realm's package path, captured at init
Value
"gno.land/r/g1llc3lq3zmjtjdk29dk52munrzxt5ne746cl7r8/mandate"
nextPlanID
uint64State. Storage is paid per byte (100 ugnot) and gas mostly per object read or written, so the layout keeps both small, and nothing one address does can grow what another payer's calls read (docs/design.md): - plans, payees and payers live in avl trees: an attacker can only add depth (log2 of the number of entries); - each payer's lookups live in that payer's own record (Payer, stored by value in the tree), capped at MaxActivePerPayer active mandates and MaxCreditsPerPayer kept credits; - each plan's supporter list holds small values in chunks (see fixedList), so adding one costs the same however long it is; - a payer's history is a linked list through the mandates, walked only by free reads.
Value
1
nextMandateID
uint64State. Storage is paid per byte (100 ugnot) and gas mostly per object read or written, so the layout keeps both small, and nothing one address does can grow what another payer's calls read (docs/design.md): - plans, payees and payers live in avl trees: an attacker can only add depth (log2 of the number of entries); - each payer's lookups live in that payer's own record (Payer, stored by value in the tree), capped at MaxActivePerPayer active mandates and MaxCreditsPerPayer kept credits; - each plan's supporter list holds small values in chunks (see fixedList), so adding one costs the same however long it is; - a payer's history is a linked list through the mandates, walked only by free reads.
Value
1
plans
*v0.Tree// pad(planID) -> \*Plan
- OID
- 0a1979…b7a4:11
plans details
payees
*v0.Tree// payee -> \*Payee
- OID
- 0a1979…b7a4:14
payees details
payers
*v0.Tree// payer -> Payer (a value, not a pointer)
- OID
- 0a1979…b7a4:17
payers details
totalPulls
int64State. Storage is paid per byte (100 ugnot) and gas mostly per object read or written, so the layout keeps both small, and nothing one address does can grow what another payer's calls read (docs/design.md): - plans, payees and payers live in avl trees: an attacker can only add depth (log2 of the number of entries); - each payer's lookups live in that payer's own record (Payer, stored by value in the tree), capped at MaxActivePerPayer active mandates and MaxCreditsPerPayer kept credits; - each plan's supporter list holds small values in chunks (see fixedList), so adding one costs the same however long it is; - a payer's history is a linked list through the mandates, walked only by free reads.
Value
1
totalPaid
int64State. Storage is paid per byte (100 ugnot) and gas mostly per object read or written, so the layout keeps both small, and nothing one address does can grow what another payer's calls read (docs/design.md): - plans, payees and payers live in avl trees: an attacker can only add depth (log2 of the number of entries); - each payer's lookups live in that payer's own record (Payer, stored by value in the tree), capped at MaxActivePerPayer active mandates and MaxCreditsPerPayer kept credits; - each plan's supporter list holds small values in chunks (see fixedList), so adding one costs the same however long it is; - a payer's history is a linked list through the mandates, walked only by free reads.
Value
500000
init.24
func()- OID
- 0a1979…b7a4:21
init.24 details
Offer
func(title string, amountUgnot int64, periodSeconds int64) uint64Offer publishes a plan: amountUgnot every periodSeconds, paid to the caller. Signed with the payee's own key; no session, no coins.
- OID
- 0a1979…b7a4:23
Offer details
SetCollectorKey
func(pubKey string)SetCollectorKey publishes the public key (bech32, gpub1...) of the key the payee's collector signs pulls with. Plan pages show it in the copy-ready commands, so payers create their session for the right key. Signed with the payee's own key. It does not change existing mandates.
- OID
- 0a1979…b7a4:24
SetCollectorKey details
Subscribe
func(planID uint64, sessionAddr .uverse.address, expiresAtUnix int64) uint64Subscribe records the terms for one session: the payer allows the holder of sessionAddr to pull the plan's amount once per period until expiresAtUnix, through this realm only. Signed with the payer's own key (never a session), no coins. Create the session on chain in the same transaction or just before (see the plan page for the exact command). The first payment is collected by the first Pull, which is due at once (billing in advance: each period is paid at its start).
- OID
- 0a1979…b7a4:25
Subscribe details
Pull
func()Pull collects one period's payment. It must be signed with the mandate's session key on behalf of the payer (gnokey ... -master \<payer> \<session key>), as a direct call, sending exactly the plan's amount. The realm forwards the coins to the plan's payee in the same transaction. At most one pull per period; the next one is due one period after this one, the same rule the chain applies to the session's spend period.
- OID
- 0a1979…b7a4:26
Pull details
checkPull
func(isSession bool, sess .uverse.address, paths []string, payer .uverse.address, sent chain.Coins, now int64) (*mandate.Mandate, *mandate.Plan)checkPull applies every rule of Pull to the transaction's session info, signer and coins, and returns the mandate and plan to pay, or panics. It is separate from Pull so the rules can be unit-tested: \`gno test\` cannot sign with a session key.
- OID
- 0a1979…b7a4:27
checkPull details
recordPull
func(m *mandate.Mandate, p *mandate.Plan, now int64)recordPull updates the mandate, plan, payee and totals for one payment and emits the event. It never creates an object: Pull runs under the payer's session budget, which also pays its storage deposit. A first pull flips the mandate's entry in the plan's list from unpaid to paid in place (same width) and sets fields that were zero (amino omits zero values), a few dozen bytes at most; later pulls add nothing.
- OID
- 0a1979…b7a4:28
recordPull details
Cancel
func(payer .uverse.address, sessionAddr .uverse.address)Cancel ends a mandate in the realm. The payer or the payee may cancel, each with their own key (never a session). A payer should also revoke the session on chain (the payer page shows the command); cancelling alone already makes every later Pull fail.
- OID
- 0a1979…b7a4:29
Cancel details
directCaller
func() .uverse.address- OID
- 0a1979…b7a4:30
directCaller details
planOf
func(id uint64) *mandate.Plan- OID
- 0a1979…b7a4:31
planOf details
payeeOf
func(a .uverse.address) *mandate.Payee- OID
- 0a1979…b7a4:32
payeeOf details
validateTitle
func(s string) stringvalidateTitle returns "" or the reason the title is refused: blank, too long, not UTF-8, or containing control characters or line separators.
- OID
- 0a1979…b7a4:33
validateTitle details
pad
func(id uint64) stringpad formats an id with a fixed width so tree keys sort numerically.
- OID
- 0a1979…b7a4:34
pad details
itoa
func(n int64) string- OID
- 0a1979…b7a4:35
itoa details
utoa
func(n uint64) string- OID
- 0a1979…b7a4:36
utoa details
collectorFunded
func(addr .uverse.address) boolcollectorFunded reports whether a collector key's address holds coins. Receiving any coin makes an address an account for good, and the chain refuses to create a session for a key whose address is an account (tm2/pkg/sdk/auth/handler.go:63-65): no new supporter could join. A balance cannot see an account that received coins and was emptied; the free query auth/accounts/\<address> can, and the collector runs it.
- OID
- 0a1979…b7a4:37
collectorFunded details
PlanInfo
typePlanInfo is a copy of a plan.
Value
mandate.PlanInfo
MandateInfo
typeMandateInfo is a copy of a mandate with the realm's view of it.
Value
mandate.MandateInfo
PayeeInfo
typePayeeInfo is a copy of a payee's totals and collector key.
Value
mandate.PayeeInfo
GetPlan
func(id uint64) (mandate.PlanInfo, bool)GetPlan returns the plan with this id.
- OID
- 0a1979…b7a4:38
GetPlan details
MandateOf
func(payer .uverse.address, sessionAddr .uverse.address) (mandate.MandateInfo, bool)MandateOf returns the latest mandate of payer for this session address.
- OID
- 0a1979…b7a4:40
MandateOf details
PaidThrough
func(payer .uverse.address, planID uint64) int64PaidThrough is the read for services that deliver something to paying supporters. It returns the unix time until which the payer's payments for the plan cover them: the latest payment's time plus one period. Paid time stays the payer's when a mandate is cancelled (by either side) or expires, and a new mandate for the same plan starts when it ends, so it is not charged twice. The one exception: a payer who already holds 16 kept periods (MaxCreditsPerPayer). 0 when they never paid for the plan. Deliver while now \< PaidThrough. It turns false at the due time and moves on only when the payee's collector pulls the next payment: allow a grace equal to how often the collector runs (an hour, say) before treating a supporter as lapsed. A payment is proof; a mandate is not: anyone can record a mandate without creating a session and without paying. A realm also cannot see a session revoked on chain: a revoked supporter simply stops paying, so PaidThrough stops moving and runs out within one period.
- OID
- 0a1979…b7a4:41
PaidThrough details
IsPaidUp
func(payer .uverse.address, planID uint64) boolIsPaidUp reports whether payer's latest payment for the plan still covers now (now \< PaidThrough). See PaidThrough.
- OID
- 0a1979…b7a4:42
IsPaidUp details
HasMandate
func(payer .uverse.address, planID uint64) boolHasMandate reports whether payer has a mandate for the plan that is neither cancelled nor expired in the realm. It says nothing about payment (a mandate costs only a storage deposit to record) and cannot see a session revoked on chain: do not grant anything on it; use PaidThrough.
- OID
- 0a1979…b7a4:43
HasMandate details
NextPullAt
func(payer .uverse.address, planID uint64) int64NextPullAt returns when the next pull of payer's active mandate for the plan is allowed (unix seconds), or 0 if there is no active mandate.
- OID
- 0a1979…b7a4:44
NextPullAt details
GetPayee
func(payee .uverse.address) (mandate.PayeeInfo, bool)GetPayee returns a payee's totals and collector key.
- OID
- 0a1979…b7a4:45
GetPayee details
Totals
func() (plansCount int, mandatesCount int, pulls int64, paid int64)Totals returns the number of plans and mandates, and all pulls so far.
- OID
- 0a1979…b7a4:46
Totals details
Plans
func(page int) []mandate.PlanInfoPlans lists all plans, newest first, PageSize per page (page 1 first).
- OID
- 0a1979…b7a4:47
Plans details
PlansOf
func(payee .uverse.address, page int) []mandate.PlanInfoPlansOf lists a payee's plans, oldest first.
- OID
- 0a1979…b7a4:48
PlansOf details
payeePlans
func(payee .uverse.address, page int) ([]*mandate.Plan, bool)payeePlans returns page \`page\` of a payee's plans and whether more follow.
- OID
- 0a1979…b7a4:49
payeePlans details
MandatesOf
func(payer .uverse.address, page int) []mandate.MandateInfoMandatesOf lists a payer's mandates (all states), newest first.
- OID
- 0a1979…b7a4:50
MandatesOf details
payerPage
func(payer .uverse.address, page int) ([]*mandate.Mandate, bool)payerPage returns page \`page\` of the payer's mandates, newest first, and whether another page follows. It walks the payer's history, which only free reads do.
- OID
- 0a1979…b7a4:51
payerPage details
SupportersOf
func(planID uint64, page int) []mandate.MandateInfoSupportersOf lists a plan's active mandates (not cancelled, replaced or expired), oldest first. Page n covers entries (n-1)\*PageSize to n\*PageSize-1 of the plan's list, so a page may hold fewer rows than PageSize; inactive ones are on the payers' own pages.
- OID
- 0a1979…b7a4:52
SupportersOf details
ScanLimit
untyped bigintScanLimit is the most supporter-list entries one free read resolves (looks up in its payer's record); WalkLimit is the most it reads at all. Entries carry their status, so cancelled ones, and for some reads unpaid ones, are skipped without a lookup. Reads that filter return a cursor to continue from, so junk can delay but never hide a real entry.
Value
(200 <untyped> bigint)
WalkLimit
untyped bigintScanLimit is the most supporter-list entries one free read resolves (looks up in its payer's record); WalkLimit is the most it reads at all. Entries carry their status, so cancelled ones, and for some reads unpaid ones, are skipped without a lookup. Reads that filter return a cursor to continue from, so junk can delay but never hide a real entry.
Value
(1000 <untyped> bigint)
CollectorPlans
func(payee .uverse.address, page int) stringCollectorPlans lists a payee's plans for a collector script, one per line: <plan id> <amount ugnot> <period seconds> <mandates> PageSize per page; the last line is "more" or "end".
- OID
- 0a1979…b7a4:53
CollectorPlans details
CollectorScan
func(planID uint64, sessionAddr .uverse.address, from int) stringCollectorScan walks at most ScanLimit entries of a plan's supporter list, from index \`from\` (0 = oldest), and returns the active mandates whose session key is sessionAddr, one per line: <index> <mandate id> <payer> <amount ugnot> <next pull unix> <due|wait> <pulls> <paid> \<paid> is 1 when the payer has paid for this plan (this mandate pulled, or it started with paid time carried over from an earlier one), 0 when it never has. The last line is "next \<index>" when more entries follow, "end" otherwise. Cancelled and expired mandates, and mandates for other keys, are skipped here, so a collector never needs to read them. Anyone can record a mandate without a session, so a collector should check on chain that the session exists, at least before the first pull of a mandate whose payer never paid.
- OID
- 0a1979…b7a4:54
CollectorScan details
payingFrom
func(p *mandate.Plan, from int, now int64) ([]*mandate.Mandate, int)payingFrom lists a plan's supporters: mandates that have paid at least once and are active now, newest first, up to PageSize, starting at list index \`from\` (or the newest when from \< 0). It reads at most WalkLimit entries and resolves at most ScanLimit of them (only entries marked paid are resolved), and returns the index to continue from (-1 when the list is exhausted).
- OID
- 0a1979…b7a4:55
payingFrom details
PayingSupporters
func(planID uint64, from int) ([]mandate.MandateInfo, int)PayingSupporters lists a plan's supporters the way its gnoweb page does: mandates that have paid at least once and are active now, newest first, at most PageSize per call. Pass from = -1 for the newest; the second result is where to continue. A client must stop when it is -1 (the list is exhausted): -1 passed back in starts again from the newest, so a client that feeds the cursor back unchecked loops for ever. Each call walks at most WalkLimit entries and looks up at most ScanLimit of them, so a call may return fewer than PageSize (even none) and still a cursor.
- OID
- 0a1979…b7a4:56
PayingSupporters details
PlanCounts
func(planID uint64) (paidThisPeriod int, paidLastPeriod int, unpaid int, unpaidExact bool)PlanCounts returns the numbers the gnoweb plan page shows: how many supporters paid in the plan's current period window and in the one before (as in GetPlan), and how many active mandates have never paid, among the latest ScanLimit entries (unpaidExact is false when there were more entries than that).
- OID
- 0a1979…b7a4:57
PlanCounts details
countUnpaid
func(p *mandate.Plan, now int64) (int, bool)countUnpaid counts active mandates that have never paid, among the plan's latest ScanLimit mandates, and says whether that covered them all.
- OID
- 0a1979…b7a4:58
countUnpaid details
infos
func(list []*mandate.Mandate) []mandate.MandateInfo- OID
- 0a1979…b7a4:59
infos details
offset
func(page int) intoffset turns a 1-based page number into a row offset; pages below 1 and absurdly large pages are clamped.
- OID
- 0a1979…b7a4:60
offset details
pageBounds
func(n int, page int) (lo int, hi int, more bool)pageBounds returns the slice bounds of page \`page\` (1-based, PageSize rows) in a list of n rows, and whether another page follows.
- OID
- 0a1979…b7a4:61
pageBounds details
paidFlag
func(m *mandate.Mandate) stringpaidFlag is CollectorScan's last column: "1" once the payer has paid for the plan through this mandate or carried paid time into it, else "0".
- OID
- 0a1979…b7a4:62
paidFlag details
SourceRepo
untyped stringSourceRepo is where the source code is published, shown in the footer of every page.
Value
"https://github.com/elangrr/mandate"
ChainID
untyped stringNetwork the copy-ready commands are pinned to.
Value
"onyx-1"
Remote
untyped stringNetwork the copy-ready commands are pinned to.
Value
"https://rpc.onyx.testnets.gno.land:443"
callGas
untyped stringGas settings used in the commands. The chain charges the whole fee set, whatever gas is used, and accepts it when fee / gas wanted is at least the current gas price (1 ugnot per 1,000 gas on Onyx). Measured on a local chain: Offer and Subscribe use 7M to 10M gas, Pull 8M to 9M. Reads on Onyx cost more per object (the chain prices a read by its store's depth, and Onyx's store is far larger), so gas wanted keeps about 2x headroom. The Pull fee counts against the session's spend limit (see FeeAllowance).
Value
"-gas-fee 100000ugnot -gas-wanted 60000000"
pullGas
untyped stringGas settings used in the commands. The chain charges the whole fee set, whatever gas is used, and accepts it when fee / gas wanted is at least the current gas price (1 ugnot per 1,000 gas on Onyx). Measured on a local chain: Offer and Subscribe use 7M to 10M gas, Pull 8M to 9M. Reads on Onyx cost more per object (the chain prices a read by its store's depth, and Onyx's store is far larger), so gas wanted keeps about 2x headroom. The Pull fee counts against the session's spend limit (see FeeAllowance).
Value
"-gas-fee 20000ugnot -gas-wanted 20000000"
Render
func(path string) stringRender returns the gnoweb page for path, with the footer.
- OID
- 0a1979…b7a4:63
Render details
footer
func() string- OID
- 0a1979…b7a4:65
footer details
renderPage
func(raw string) string- OID
- 0a1979…b7a4:66
renderPage details
renderHome
func(from int) string- OID
- 0a1979…b7a4:67
renderHome details
homeScanPlans
untyped biginthomeScanPlans is how many plans one home page walks. Each check reads only the plan itself (its payment counters), never its supporters.
Value
(200 <untyped> bigint)
plansWithSupporters
func(from int) stringplansWithSupporters lists, newest first, the plans that someone paid in the current or the previous period, walking at most homeScanPlans plans per page: plans nobody pays for (spam included) never fill this list, and a "more" link continues the walk. A plan someone keeps paying for stays, whatever the churn of its supporter list.
- OID
- 0a1979…b7a4:68
plansWithSupporters details
renderAllPlans
func(page int) string- OID
- 0a1979…b7a4:69
renderAllPlans details
renderPlan
func(id uint64, from int) string- OID
- 0a1979…b7a4:70
renderPlan details
renderPayer
func(payer .uverse.address, page int) string- OID
- 0a1979…b7a4:71
renderPayer details
renderPayee
func(payee .uverse.address, page int) string- OID
- 0a1979…b7a4:72
renderPayee details
renderHelp
func() string- OID
- 0a1979…b7a4:73
renderHelp details
renderNotFound
func() string- OID
- 0a1979…b7a4:74
renderNotFound details
payingText
func(p *mandate.Plan, now int64) stringpayingText is the plan headline's count of payments per period. It counts payments, not distinct people: a creator paying its own plan from a second wallet counts too.
- OID
- 0a1979…b7a4:75
payingText details
payingCell
func(p *mandate.Plan, now int64) stringpayingCell is the count in tables: paid this period / the one before.
- OID
- 0a1979…b7a4:76
payingCell details
infoPayingCell
func(p mandate.PlanInfo) string- OID
- 0a1979…b7a4:77
infoPayingCell details
intParam
func(query string, key string, def int) intintParam returns the integer value of key in the query, or def.
- OID
- 0a1979…b7a4:78
intParam details
link
func(page string) stringlink returns the gnoweb link to a page of this realm.
- OID
- 0a1979…b7a4:79
link details
pager
func(page string, n int, more bool) string- OID
- 0a1979…b7a4:80
pager details
pageParam
func(query string) int- OID
- 0a1979…b7a4:81
pageParam details
plural
func(n int, one string, many string) string- OID
- 0a1979…b7a4:82
plural details
netFlags
func() string- OID
- 0a1979…b7a4:83
netFlags details
price
func(amount int64, period int64) string- OID
- 0a1979…b7a4:84
price details
formatUgnot
func(n int64) stringformatUgnot shows an amount in GNOT with up to six decimals.
- OID
- 0a1979…b7a4:85
formatUgnot details
formatPeriod
func(sec int64) stringformatPeriod shows a number of seconds in the largest exact unit.
- OID
- 0a1979…b7a4:86
formatPeriod details
formatTime
func(unix int64) string- OID
- 0a1979…b7a4:87
formatTime details
formatTimeOrNever
func(unix int64) string- OID
- 0a1979…b7a4:88
formatTimeOrNever details
short
func(a .uverse.address) string- OID
- 0a1979…b7a4:89
short details
fanout
untyped bigintfanout is the number of entries per chunk, and of chunks per super-chunk.
Value
(32 <untyped> bigint)
fixedList
typefixedList is an append-only list of strings of one fixed width, in two levels of chunks. It holds values, never pointers to shared objects (on chain, rewriting an array costs about 0.37M gas for every pointer to a shared object it holds; docs/notes.md), and no array in it grows with the list's length except supers, by one entry per fanout\*fanout appends: - tail: the newest N % fanout entries, inside the owner object; - when tail is full it becomes a chunk, appended to the last super-chunk (at most fanout chunks each); - supers: the list of super-chunks. So an append rewrites the owner and its tail; every fanout appends it also creates a chunk and rewrites one super-chunk (at most fanout pointers to objects that only it holds); every fanout\*fanout appends it rewrites supers. set replaces an entry in place with one of the same width, so it never changes the storage size. Appends happen only in transactions signed with someone's own key (Subscribe, Offer), never under a session budget.
Value
mandate.fixedList
superChunk
typeValue
mandate.superChunk
strChunk
typeValue
mandate.strChunk
statusUnpaid
runeSupporter entries: the payer's 40-character address, the mandate id padded to 10 digits, and one status character. Pull flips '0' to '1' at a mandate's first payment and Cancel sets 'x', both in place.
Value
48
statusPaid
runeSupporter entries: the payer's 40-character address, the mandate id padded to 10 digits, and one status character. Pull flips '0' to '1' at a mandate's first payment and Cancel sets 'x', both in place.
Value
49
statusCancelled
runeSupporter entries: the payer's 40-character address, the mandate id padded to 10 digits, and one status character. Pull flips '0' to '1' at a mandate's first payment and Cancel sets 'x', both in place.
Value
120
entryWidth
untyped bigintSupporter entries: the payer's 40-character address, the mandate id padded to 10 digits, and one status character. Pull flips '0' to '1' at a mandate's first payment and Cancel sets 'x', both in place.
Value
(51 <untyped> bigint)
entry
typeentry is a decoded supporter entry.
Value
mandate.entry
encodeEntry
func(payer .uverse.address, id uint64, status uint8) string- OID
- 0a1979…b7a4:90
encodeEntry details
decodeEntry
func(s string) mandate.entry- OID
- 0a1979…b7a4:92
decodeEntry details
activeMandate
func(e mandate.entry) *mandate.MandateactiveMandate returns the mandate an entry names if it is still in its payer's active list (cancelled and replaced ones are not), or nil. It may have expired: callers check isActive.
- OID
- 0a1979…b7a4:93
activeMandate details
MaxActivePerPayer
untyped bigintMaxActivePerPayer is how many active mandates one payer may hold: the chain allows 16 sessions per account (tm2 std.MaxSessionsPerAccount), and each active mandate needs its own session key.
Value
(16 <untyped> bigint)
Payer
typePayer holds one payer's own lookups and nothing of anyone else's, so no address can make another payer's Pull, Subscribe or Cancel read or write more than the payer tree's depth. - Active: the payer's current mandates, at most MaxActivePerPayer that are not expired. Cancel removes an entry at once; an expired entry is removed at the payer's next Subscribe. Each entry carries the session address and plan id inline, so finding a mandate reads one small array and loads only the mandate found. - Head: the payer's newest mandate; older ones follow through prevOfPayer (history, walked only by free reads). - Credits: time the payer has paid for on a plan where they no longer have an active mandate (cancelled by either side, or expired and pruned), at most MaxCreditsPerPayer, each still in the future. A new mandate for that plan starts when the credit ends, so paid time is not lost or charged twice, unless 16 credits are already held (see MaxCreditsPerPayer for who can then lose what).
Value
mandate.Payer
credit
typecredit is paid time kept for a plan: the payer is covered until Until.
Value
mandate.credit
MaxCreditsPerPayer
untyped bigintMaxCreditsPerPayer bounds a payer's kept credits: 16 plans left while each is still paid ahead. At the bound, the payer's own Cancel or expiry lets the credit ending soonest give way to a later one (that plan's time is lost); a payee's Cancel never evicts: its new credit is not kept.
Value
(16 <untyped> bigint)
activeRef
typeValue
mandate.activeRef
payerOf
func(a .uverse.address) *mandate.PayerpayerOf returns a copy of the payer's record, or nil. Records are stored by value (no heap item, about 400 bytes less per payer); after changing one, write it back with save.
- OID
- 0a1979…b7a4:94
payerOf details
activeBySession
func(payer .uverse.address, sess .uverse.address) *mandate.MandateactiveBySession returns the payer's active-list mandate for this session key (it may have expired but not been pruned yet), or nil.
- OID
- 0a1979…b7a4:95
activeBySession details
activeByPlan
func(payer .uverse.address, planID uint64) *mandate.MandateactiveByPlan returns the payer's active-list mandate for the plan, or nil.
- OID
- 0a1979…b7a4:96
activeByPlan details
latestBySession
func(payer .uverse.address, sess .uverse.address) *mandate.MandatelatestBySession returns the payer's newest mandate for this session key, active or not, walking the history when it is no longer active. For free reads only.
- OID
- 0a1979…b7a4:97
latestBySession details
payerHead
func(payer .uverse.address) *mandate.MandatepayerHead returns the payer's newest mandate.
- OID
- 0a1979…b7a4:98