maxMembers
untyped bigintLimits keep every page and every write small.
Value
(30 <untyped> bigint)
maxEntries
untyped bigint// per group
Value
(5000 <untyped> bigint)
maxName
untyped bigint// a member's name, in bytes
Value
(24 <untyped> bigint)
maxGroup
untyped bigint// a group's name
Value
(40 <untyped> bigint)
maxTitle
untyped bigint// an entry's title
Value
(60 <untyped> bigint)
maxCurrency
untyped bigintLimits keep every page and every write small.
Value
(8 <untyped> bigint)
remindEvery
untyped bigint// seconds between two reminders to one member
Value
(43200 <untyped> bigint)
Kind
typeKind is what an entry records.
Value
v1.Kind
KindExpense
v1.Kind// Payer paid Total for Who
Value
<zero>
KindIncome
v1.Kind// Payer received Total that belongs to Who
Value
<zero>
KindTransfer
v1.Kind// Payer paid Total to Who\[0]
Value
<zero>
Member
typeMember is one person in a group. Bal is what they paid minus what they owe, in cents: > 0 the group owes them, \< 0 they owe the group.
Value
v1.Member
Entry
typeEntry is one expense, income or transfer. Owe\[i] is the part of Who\[i]; the parts sum to Total. An income stores Total and Owe as negative amounts, so one rule applies every kind: Payer gains Total, each of Who loses its part.
Value
v1.Entry
Group
typeGroup is one shared account.
Value
v1.Group
groups
v0.Tree// key(ID) → \*Group
- OID
- 0b1470…bdd7:4
groups details
byAddr
v0.Tree// addr + "/" + key(ID) → true, the groups a wallet belongs to
- OID
- 0b1470…bdd7:6
byAddr details
nextID
intValue
1
self
stringself is this realm's pkgpath and hub its gnoweb path, read at init while this realm is current: every link follows from them.
Value
"gno.land/r/nym-alexiscolin000/gnosplit/v1"
hub
stringself is this realm's pkgpath and hub its gnoweb path, read at init while this realm is current: every link follows from them.
Value
"/r/nym-alexiscolin000/gnosplit/v1"
init.19
func()- OID
- 0b1470…bdd7:10
init.19 details
CreateGroup
func(name string, currency string, you string, others string) intCreateGroup opens a group named name, counting in currency, with the caller as member you (wallet linked) and others, comma-separated names, without wallets. It returns the group's ID.
- OID
- 0b1470…bdd7:12
CreateGroup details
AddMember
func(group string, name string, addr string)AddMember adds name to the group, with a wallet if addr is set: that member becomes an editor and is told by gnotif.
- OID
- 0b1470…bdd7:13
AddMember details
LinkMember
func(group string, name string, addr string)LinkMember links a wallet to a member who has none yet, making them an editor. A linked wallet is never replaced, so no editor can take over another's place.
- OID
- 0b1470…bdd7:14
LinkMember details
AddExpense
func(group string, title string, amount string, paidBy string, forWhom string, category string) intAddExpense records that paidBy paid amount for forWhom (comma-separated names, "" for everyone), split equally. amount is "42.50", or a foreign amount with its rate, "50 USD x0.92". It returns the entry's ID.
- OID
- 0b1470…bdd7:15
AddExpense details
AddByShares
func(group string, title string, amount string, paidBy string, shares string, category string) intAddByShares records an expense split by shares: shares is "Alice:2, Bob:1", so Alice owes two thirds.
- OID
- 0b1470…bdd7:16
AddByShares details
AddByAmounts
func(group string, title string, paidBy string, amounts string, category string) intAddByAmounts records an expense split by exact amounts: amounts is "Alice:12.50, Bob:7.50", and the expense is their sum.
- OID
- 0b1470…bdd7:17
AddByAmounts details
AddIncome
func(group string, title string, amount string, receivedBy string, forWhom string) intAddIncome records money receivedBy got on behalf of forWhom (a refund, a deposit returned), split equally: it lowers what each of them paid.
- OID
- 0b1470…bdd7:18
AddIncome details
AddTransfer
func(group string, from string, to string, amount string) intAddTransfer records that from paid amount to to, outside the chain.
- OID
- 0b1470…bdd7:19
AddTransfer details
Delete
func(group string, entry string)Delete removes an entry and undoes its effect on every balance.
- OID
- 0b1470…bdd7:20
Delete details
Remind
func(group string, member string)Remind sends member, who owes the group, a gnotif reminder: at most one every 12 hours, and only to a member with a wallet.
- OID
- 0b1470…bdd7:21
Remind details
editable
func(group string) (*v1.Group, int)editable is the one write check: the group exists, is still kept here, and the immediate caller is one of its members with a wallet.
- OID
- 0b1470…bdd7:22
editable details
getGroup
func(group string) *v1.Group- OID
- 0b1470…bdd7:23
getGroup details
mustGroup
func(group string) *v1.Group- OID
- 0b1470…bdd7:24
mustGroup details
mustAmount
func(s string) (int64, string)- OID
- 0b1470…bdd7:25
mustAmount details
parseAddr
func(s string) .uverse.address- OID
- 0b1470…bdd7:26
parseAddr details
splitList
func(s string) []stringsplitList cuts a comma-separated list, dropping blanks.
- OID
- 0b1470…bdd7:27
splitList details
validText
func(s string, max int) boolvalidText is 1 to max bytes with no control character.
- OID
- 0b1470…bdd7:28
validText details
validName
func(s string) boolvalidName also refuses the separators the forms use.
- OID
- 0b1470…bdd7:29
validName details
key
func(id int) stringkey pads an ID so the trees keep numeric order.
- OID
- 0b1470…bdd7:30
key details
itoa
func(n int) string- OID
- 0b1470…bdd7:31
itoa details
EventGroupCreated
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"GroupCreated"
EventMemberAdded
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"MemberAdded"
EventMemberLinked
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"MemberLinked"
EventEntryAdded
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"EntryAdded"
EventEntryDeleted
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"EntryDeleted"
EventGroupMoved
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"GroupMoved"
EventOwnerOffered
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"OwnerOffered"
EventOwnerChanged
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"OwnerChanged"
EventSuccessorSet
untyped stringEvents. The first ones say what changed, for indexers and apps. The notify ones each carry "to", a wallet: gnotif turns them into a browser notification for whoever opted in with that address. A notify event goes only to members with a wallet, never to the member who acted.
Value
"SuccessorSet"
NotifyExpense
untyped string// to, group, gname, by, title, share
Value
"Expense"
NotifyIncome
untyped string// to, group, gname, by, title, share
Value
"Income"
NotifyTransfer
untyped string// to, group, gname, from, peer, amount
Value
"Transfer"
NotifyReminder
untyped string// to, group, gname, by, amount
Value
"Reminder"
NotifyJoined
untyped string// to, group, gname, by
Value
"Joined"
declareTriggers
func()declareTriggers registers the notify events with gnotif at deploy. The registry marks them verified, since this realm declares its own. ponytail: gnotif is a v0 on onyx; a new registry version means a new release of this realm, which is why every gnotif call lives in this file.
- OID
- 0b1470…bdd7:32
declareTriggers details
notifyEntry
func(g *v1.Group, e *v1.Entry, by int)- OID
- 0b1470…bdd7:34
notifyEntry details
notifyReminder
func(g *v1.Group, m *v1.Member, by string)- OID
- 0b1470…bdd7:35
notifyReminder details
notifyJoined
func(g *v1.Group, a .uverse.address, by string)- OID
- 0b1470…bdd7:36
notifyJoined details
owner
.uverse.address// "" once renounced
Value
<gnolang.StringValue>
pending
.uverse.address// the address a Transfer offered the role to
Value
<zero>
successor
string// the pkgpath of the next release, "" until named
Value
""
setUp
func(deployer .uverse.address, chainID string)setUp is init's owner half. Only \`gno test\` (chain "dev") runs with no signer, and an owner "" holds no power.
- OID
- 0b1470…bdd7:40
setUp details
Owner
func() .uverse.address- OID
- 0b1470…bdd7:42
Owner details
Successor
func() stringSuccessor is the pkgpath of the release that takes groups over, "" if none.
- OID
- 0b1470…bdd7:43
Successor details
isOwner
func(a .uverse.address) bool- OID
- 0b1470…bdd7:44
isOwner details
Transfer
func(to .uverse.address)Transfer offers the role to another address, which takes it with Accept.
- OID
- 0b1470…bdd7:45
Transfer details
Accept
func()Accept takes the role a Transfer offered the caller.
- OID
- 0b1470…bdd7:46
Accept details
Renounce
func()Renounce gives the role up for good.
- OID
- 0b1470…bdd7:47
Renounce details
SetSuccessor
func(pkgpath string)SetSuccessor names the release that takes groups over, once: a realm under this one's namespace, like gno.land/r/\<ns>/gnosplit/v2. From then on that realm can move a group with MoveOut; nothing moves by itself.
- OID
- 0b1470…bdd7:48
SetSuccessor details
MoveOut
func(group string) stringMoveOut marks a group as taken over and returns it, as Export writes it. Only the successor realm can call it, which decides when a group moves (when one of its editors asks). The group stays readable here, frozen.
- OID
- 0b1470…bdd7:49
MoveOut details
categories
[]struct{...}categories are an expense's kinds, in the order ByCat counts them. The last one is the default. A form sends the name.
- OID
- 0b1470…bdd7:51
categories details
categoryOf
func(name string) int- OID
- 0b1470…bdd7:60
categoryOf details
pageSize
untyped bigint// entries per history page
Value
(25 <untyped> bigint)
latest
untyped bigint// entries on a group's page
Value
(8 <untyped> bigint)
Render
func(path string) stringRender serves "" (home), "u/\<address>" (a wallet's groups) and a group's pages: "\<id>", then "/add", "/settle", "/settle/\<from>/\<to>/\<cents>", "/members", "/stats", "/history\[/\<page>]", "/e/\<entry>" and "/csv".
- OID
- 0b1470…bdd7:62
Render details
renderHome
func() string- OID
- 0b1470…bdd7:63
renderHome details
renderWallet
func(a .uverse.address) string- OID
- 0b1470…bdd7:64
renderWallet details
renderGroup
func(g *v1.Group) string- OID
- 0b1470…bdd7:65
renderGroup details
transfers
func(g *v1.Group, short bool) stringtransfers lists the payments that settle the group, each with a link that fills in the form to record it.
- OID
- 0b1470…bdd7:66
transfers details
renderAdd
func(g *v1.Group) string- OID
- 0b1470…bdd7:67
renderAdd details
renderSettle
func(g *v1.Group, from int, to int, amount int64) string- OID
- 0b1470…bdd7:68
renderSettle details
renderMembers
func(g *v1.Group) string- OID
- 0b1470…bdd7:69
renderMembers details
renderStats
func(g *v1.Group) string- OID
- 0b1470…bdd7:70
renderStats details
renderHistory
func(g *v1.Group, page int) string- OID
- 0b1470…bdd7:71
renderHistory details
renderEntry
func(g *v1.Group, e *v1.Entry) string- OID
- 0b1470…bdd7:72
renderEntry details
entryTable
func(g *v1.Group, offset int, count int) stringentryTable writes count entries, newest first, from offset.
- OID
- 0b1470…bdd7:73
entryTable details
header
func(g *v1.Group, page string) string- OID
- 0b1470…bdd7:74
header details
Export
func(group string) stringExport writes a group as CSV: its members, then every entry, oldest first. MoveOut hands it to the successor, and the /csv page shows it.
- OID
- 0b1470…bdd7:75
Export details
input
func(name string, placeholder string, value string, required bool) string- OID
- 0b1470…bdd7:76
input details
readonly
func(name string, placeholder string, value string) string- OID
- 0b1470…bdd7:77
readonly details
groupField
func(g *v1.Group) string- OID
- 0b1470…bdd7:78
groupField details
selectOpt
func(name string, value string, description string, selected bool) stringselectOpt is one option of a select; gnoweb reads the description off the first one, so only that one carries it.
- OID
- 0b1470…bdd7:79
selectOpt details
memberSelect
func(g *v1.Group, name string, description string, selected int) string- OID
- 0b1470…bdd7:80
memberSelect details
first
func(i int, s string) stringfirst is s for the first item of a list, "" after.
- OID
- 0b1470…bdd7:81
first details
memberChecks
func(g *v1.Group, name string, description string) string- OID
- 0b1470…bdd7:82
memberChecks details
categorySelect
func() string- OID
- 0b1470…bdd7:83
categorySelect details
balanceBar
func(v int64, max int64) stringbalanceBar draws a balance against the largest one: right and teal when the group owes the member, left and orange when they owe.
- OID
- 0b1470…bdd7:84
balanceBar details
categoryBar
func(byCat []int64, total int64) stringcategoryBar is one bar split by category, in the table's order.
- OID
- 0b1470…bdd7:85
categoryBar details
swatch
func(color string) string- OID
- 0b1470…bdd7:86
swatch details
svg
func(w int, h int, body string) string- OID
- 0b1470…bdd7:87
svg details
link
func(g *v1.Group, page string) string- OID
- 0b1470…bdd7:88
link details
entryIcon
func(e *v1.Entry) string- OID
- 0b1470…bdd7:89
entryIcon details
verb
func(e *v1.Entry) string- OID
- 0b1470…bdd7:90
verb details
forWhom
func(g *v1.Group, e *v1.Entry) string- OID
- 0b1470…bdd7:91
forWhom details
date
func(unix int64, layout string) string- OID
- 0b1470…bdd7:92
date details
short
func(a .uverse.address) string- OID
- 0b1470…bdd7:93
short details
percent
func(part int64, whole int64) string- OID
- 0b1470…bdd7:94
percent details
plural
func(n int, word string) string- OID
- 0b1470…bdd7:95
plural details
cents
func(c int64) stringcents writes an amount for CSV: "42.50", no thousands separator.
- OID
- 0b1470…bdd7:96
cents details
csv
func(s string) string- OID
- 0b1470…bdd7:97
csv details
attr
func(s string) string- OID
- 0b1470…bdd7:98
attr details
cellText
func(s string) stringcellText is link text inside a table cell: InlineText leaves "|" alone, and a bare one would end the cell.
- OID
- 0b1470…bdd7:99
cellText details
abs
func(v int64) int64- OID
- 0b1470…bdd7:100
abs details
atoi
func(s string) intatoi is a non-negative number, -1 for anything else.
- OID
- 0b1470…bdd7:101