Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v1 state

Back to all declarations

maxMembers

untyped bigint

Limits 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 bigint

Limits 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

type

Kind 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

type

Member 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

type

Entry 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

type

Group is one shared account.

Value

v1.Group

groups

v0.Tree

// key(ID) → \*Group

Open
OID
0b1470…bdd7:4
groups details

Inspect ref

byAddr

v0.Tree

// addr + "/" + key(ID) → true, the groups a wallet belongs to

Open
OID
0b1470…bdd7:6
byAddr details

Inspect ref

nextID

int

Value

1

self

string

self 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

string

self 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"

CreateGroup

func(name string, currency string, you string, others string) int

CreateGroup 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.

Open
OID
0b1470…bdd7:12
CreateGroup details

Inspect func

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.

Open
OID
0b1470…bdd7:13
AddMember details

Inspect func

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.

Open
OID
0b1470…bdd7:14
LinkMember details

Inspect func

AddExpense

func(group string, title string, amount string, paidBy string, forWhom string, category string) int

AddExpense 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.

Open
OID
0b1470…bdd7:15
AddExpense details

Inspect func

AddByShares

func(group string, title string, amount string, paidBy string, shares string, category string) int

AddByShares records an expense split by shares: shares is "Alice:2, Bob:1", so Alice owes two thirds.

Open
OID
0b1470…bdd7:16
AddByShares details

Inspect func

AddByAmounts

func(group string, title string, paidBy string, amounts string, category string) int

AddByAmounts records an expense split by exact amounts: amounts is "Alice:12.50, Bob:7.50", and the expense is their sum.

Open
OID
0b1470…bdd7:17
AddByAmounts details

Inspect func

AddIncome

func(group string, title string, amount string, receivedBy string, forWhom string) int

AddIncome records money receivedBy got on behalf of forWhom (a refund, a deposit returned), split equally: it lowers what each of them paid.

Open
OID
0b1470…bdd7:18
AddIncome details

Inspect func

AddTransfer

func(group string, from string, to string, amount string) int

AddTransfer records that from paid amount to to, outside the chain.

Open
OID
0b1470…bdd7:19
AddTransfer details

Inspect func

Delete

func(group string, entry string)

Delete removes an entry and undoes its effect on every balance.

Open
OID
0b1470…bdd7:20
Delete details

Inspect func

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.

Open
OID
0b1470…bdd7:21
Remind details

Inspect func

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.

Open
OID
0b1470…bdd7:22
editable details

Inspect func

getGroup

func(group string) *v1.Group
Open
OID
0b1470…bdd7:23
getGroup details

Inspect func

mustGroup

func(group string) *v1.Group
Open
OID
0b1470…bdd7:24
mustGroup details

Inspect func

mustAmount

func(s string) (int64, string)
Open
OID
0b1470…bdd7:25
mustAmount details

Inspect func

parseAddr

func(s string) .uverse.address
Open
OID
0b1470…bdd7:26
parseAddr details

Inspect func

splitList

func(s string) []string

splitList cuts a comma-separated list, dropping blanks.

Open
OID
0b1470…bdd7:27
splitList details

Inspect func

validText

func(s string, max int) bool

validText is 1 to max bytes with no control character.

Open
OID
0b1470…bdd7:28
validText details

Inspect func

validName

func(s string) bool

validName also refuses the separators the forms use.

Open
OID
0b1470…bdd7:29
validName details

Inspect func

key

func(id int) string

key pads an ID so the trees keep numeric order.

Open
OID
0b1470…bdd7:30
key details

Inspect func

EventGroupCreated

untyped string

Events. 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 string

Events. 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 string

Events. 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 string

Events. 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 string

Events. 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 string

Events. 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 string

Events. 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 string

Events. 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 string

Events. 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.

Open
OID
0b1470…bdd7:32
declareTriggers details

Inspect func

notifyEntry

func(g *v1.Group, e *v1.Entry, by int)
Open
OID
0b1470…bdd7:34
notifyEntry details

Inspect func

notifyReminder

func(g *v1.Group, m *v1.Member, by string)
Open
OID
0b1470…bdd7:35
notifyReminder details

Inspect func

notifyJoined

func(g *v1.Group, a .uverse.address, by string)
Open
OID
0b1470…bdd7:36
notifyJoined details

Inspect func

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.

Open
OID
0b1470…bdd7:40
setUp details

Inspect func

Successor

func() string

Successor is the pkgpath of the release that takes groups over, "" if none.

Open
OID
0b1470…bdd7:43
Successor details

Inspect func

isOwner

func(a .uverse.address) bool
Open
OID
0b1470…bdd7:44
isOwner details

Inspect func

Transfer

func(to .uverse.address)

Transfer offers the role to another address, which takes it with Accept.

Open
OID
0b1470…bdd7:45
Transfer details

Inspect func

Accept

func()

Accept takes the role a Transfer offered the caller.

Open
OID
0b1470…bdd7:46
Accept details

Inspect func

Renounce

func()

Renounce gives the role up for good.

Open
OID
0b1470…bdd7:47
Renounce details

Inspect func

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.

Open
OID
0b1470…bdd7:48
SetSuccessor details

Inspect func

MoveOut

func(group string) string

MoveOut 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.

Open
OID
0b1470…bdd7:49
MoveOut details

Inspect func

categories

[]struct{...} (len=8)

categories are an expense's kinds, in the order ByCat counts them. The last one is the default. A form sends the name.

Open
OID
0b1470…bdd7:51
categories details (len=8)

+8 more Inspect slice

categoryOf

func(name string) int
Open
OID
0b1470…bdd7:60
categoryOf details

Inspect func

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) string

Render 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".

Open
OID
0b1470…bdd7:62
Render details

Inspect func

renderWallet

func(a .uverse.address) string
Open
OID
0b1470…bdd7:64
renderWallet details

Inspect func

renderGroup

func(g *v1.Group) string
Open
OID
0b1470…bdd7:65
renderGroup details

Inspect func

transfers

func(g *v1.Group, short bool) string

transfers lists the payments that settle the group, each with a link that fills in the form to record it.

Open
OID
0b1470…bdd7:66
transfers details

Inspect func

renderAdd

func(g *v1.Group) string
Open
OID
0b1470…bdd7:67
renderAdd details

Inspect func

renderSettle

func(g *v1.Group, from int, to int, amount int64) string
Open
OID
0b1470…bdd7:68
renderSettle details

Inspect func

renderMembers

func(g *v1.Group) string
Open
OID
0b1470…bdd7:69
renderMembers details

Inspect func

renderStats

func(g *v1.Group) string
Open
OID
0b1470…bdd7:70
renderStats details

Inspect func

renderHistory

func(g *v1.Group, page int) string
Open
OID
0b1470…bdd7:71
renderHistory details

Inspect func

renderEntry

func(g *v1.Group, e *v1.Entry) string
Open
OID
0b1470…bdd7:72
renderEntry details

Inspect func

entryTable

func(g *v1.Group, offset int, count int) string

entryTable writes count entries, newest first, from offset.

Open
OID
0b1470…bdd7:73
entryTable details

Inspect func

header

func(g *v1.Group, page string) string
Open
OID
0b1470…bdd7:74
header details

Inspect func

Export

func(group string) string

Export writes a group as CSV: its members, then every entry, oldest first. MoveOut hands it to the successor, and the /csv page shows it.

Open
OID
0b1470…bdd7:75
Export details

Inspect func

input

func(name string, placeholder string, value string, required bool) string
Open
OID
0b1470…bdd7:76
input details

Inspect func

readonly

func(name string, placeholder string, value string) string
Open
OID
0b1470…bdd7:77
readonly details

Inspect func

groupField

func(g *v1.Group) string
Open
OID
0b1470…bdd7:78
groupField details

Inspect func

selectOpt

func(name string, value string, description string, selected bool) string

selectOpt is one option of a select; gnoweb reads the description off the first one, so only that one carries it.

Open
OID
0b1470…bdd7:79
selectOpt details

Inspect func

memberSelect

func(g *v1.Group, name string, description string, selected int) string
Open
OID
0b1470…bdd7:80
memberSelect details

Inspect func

first

func(i int, s string) string

first is s for the first item of a list, "" after.

Open
OID
0b1470…bdd7:81
first details

Inspect func

memberChecks

func(g *v1.Group, name string, description string) string
Open
OID
0b1470…bdd7:82
memberChecks details

Inspect func

categorySelect

func() string
Open
OID
0b1470…bdd7:83
categorySelect details

Inspect func

balanceBar

func(v int64, max int64) string

balanceBar draws a balance against the largest one: right and teal when the group owes the member, left and orange when they owe.

Open
OID
0b1470…bdd7:84
balanceBar details

Inspect func

categoryBar

func(byCat []int64, total int64) string

categoryBar is one bar split by category, in the table's order.

Open
OID
0b1470…bdd7:85
categoryBar details

Inspect func

svg

func(w int, h int, body string) string
Open
OID
0b1470…bdd7:87
svg details

Inspect func

entryIcon

func(e *v1.Entry) string
Open
OID
0b1470…bdd7:89
entryIcon details

Inspect func

forWhom

func(g *v1.Group, e *v1.Entry) string
Open
OID
0b1470…bdd7:91
forWhom details

Inspect func

date

func(unix int64, layout string) string
Open
OID
0b1470…bdd7:92
date details

Inspect func

short

func(a .uverse.address) string
Open
OID
0b1470…bdd7:93
short details

Inspect func

percent

func(part int64, whole int64) string
Open
OID
0b1470…bdd7:94
percent details

Inspect func

plural

func(n int, word string) string
Open
OID
0b1470…bdd7:95
plural details

Inspect func

cents

func(c int64) string

cents writes an amount for CSV: "42.50", no thousands separator.

Open
OID
0b1470…bdd7:96
cents details

Inspect func

cellText

func(s string) string

cellText is link text inside a table cell: InlineText leaves "|" alone, and a bare one would end the cell.

Open
OID
0b1470…bdd7:99
cellText details

Inspect func

atoi

func(s string) int

atoi is a non-negative number, -1 for anything else.

Open
OID
0b1470…bdd7:101
atoi details

Inspect func
maxMembers : untyped bigint =(30 <untyped> bigint)
maxEntries : untyped bigint =(5000 <untyped> bigint)
maxName : untyped bigint =(24 <untyped> bigint)
maxGroup : untyped bigint =(40 <untyped> bigint)
maxTitle : untyped bigint =(60 <untyped> bigint)
maxCurrency : untyped bigint =(8 <untyped> bigint)
remindEvery : untyped bigint =(43200 <untyped> bigint)
Kind : type =v1.Kind
KindExpense : v1.Kind =<zero>
KindIncome : v1.Kind =<zero>
KindTransfer : v1.Kind =<zero>
Member : type =v1.Member
Entry : type =v1.Entry
Group : type =v1.Group
groups : v0.Tree Inspect
byAddr : v0.Tree Inspect
nextID : int =1
self : string ="gno.land/r/nym-alexiscolin000/gnosplit/v1"
hub : string ="/r/nym-alexiscolin000/gnosplit/v1"
init.19 : func() Inspect
CreateGroup : func(name string, currency string, you string, others string) int Inspect
AddMember : func(group string, name string, addr string) Inspect
LinkMember : func(group string, name string, addr string) Inspect
AddExpense : func(group string, title string, amount string, paidBy string, forWhom string, category string) int Inspect
AddByShares : func(group string, title string, amount string, paidBy string, shares string, category string) int Inspect
AddByAmounts : func(group string, title string, paidBy string, amounts string, category string) int Inspect
AddIncome : func(group string, title string, amount string, receivedBy string, forWhom string) int Inspect
AddTransfer : func(group string, from string, to string, amount string) int Inspect
Delete : func(group string, entry string) Inspect
Remind : func(group string, member string) Inspect
editable : func(group string) (*v1.Group, int) Inspect
getGroup : func(group string) *v1.Group Inspect
mustGroup : func(group string) *v1.Group Inspect
mustAmount : func(s string) (int64, string) Inspect
parseAddr : func(s string) .uverse.address Inspect
splitList : func(s string) []string Inspect
validText : func(s string, max int) bool Inspect
validName : func(s string) bool Inspect
key : func(id int) string Inspect
itoa : func(n int) string Inspect
EventGroupCreated : untyped string ="GroupCreated"
EventMemberAdded : untyped string ="MemberAdded"
EventMemberLinked : untyped string ="MemberLinked"
EventEntryAdded : untyped string ="EntryAdded"
EventEntryDeleted : untyped string ="EntryDeleted"
EventGroupMoved : untyped string ="GroupMoved"
EventOwnerOffered : untyped string ="OwnerOffered"
EventOwnerChanged : untyped string ="OwnerChanged"
EventSuccessorSet : untyped string ="SuccessorSet"
NotifyExpense : untyped string ="Expense"
NotifyIncome : untyped string ="Income"
NotifyTransfer : untyped string ="Transfer"
NotifyReminder : untyped string ="Reminder"
NotifyJoined : untyped string ="Joined"
declareTriggers : func() Inspect
notifyEntry : func(g *v1.Group, e *v1.Entry, by int) Inspect
notifyReminder : func(g *v1.Group, m *v1.Member, by string) Inspect
notifyJoined : func(g *v1.Group, a .uverse.address, by string) Inspect
owner : .uverse.address =<gnolang.StringValue>
pending : .uverse.address =<zero>
successor : string =""
setUp : func(deployer .uverse.address, chainID string) Inspect
Owner : func() .uverse.address Inspect
Successor : func() string Inspect
isOwner : func(a .uverse.address) bool Inspect
Transfer : func(to .uverse.address) Inspect
Accept : func() Inspect
Renounce : func() Inspect
SetSuccessor : func(pkgpath string) Inspect
MoveOut : func(group string) string Inspect
categories : []struct{...} (len=8) Inspect
categoryOf : func(name string) int Inspect
pageSize : untyped bigint =(25 <untyped> bigint)
latest : untyped bigint =(8 <untyped> bigint)
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderWallet : func(a .uverse.address) string Inspect
renderGroup : func(g *v1.Group) string Inspect
transfers : func(g *v1.Group, short bool) string Inspect
renderAdd : func(g *v1.Group) string Inspect
renderSettle : func(g *v1.Group, from int, to int, amount int64) string Inspect
renderMembers : func(g *v1.Group) string Inspect
renderStats : func(g *v1.Group) string Inspect
renderHistory : func(g *v1.Group, page int) string Inspect
renderEntry : func(g *v1.Group, e *v1.Entry) string Inspect
entryTable : func(g *v1.Group, offset int, count int) string Inspect
header : func(g *v1.Group, page string) string Inspect
Export : func(group string) string Inspect
input : func(name string, placeholder string, value string, required bool) string Inspect
readonly : func(name string, placeholder string, value string) string Inspect
groupField : func(g *v1.Group) string Inspect
selectOpt : func(name string, value string, description string, selected bool) string Inspect
memberSelect : func(g *v1.Group, name string, description string, selected int) string Inspect
first : func(i int, s string) string Inspect
memberChecks : func(g *v1.Group, name string, description string) string Inspect
categorySelect : func() string Inspect
balanceBar : func(v int64, max int64) string Inspect
categoryBar : func(byCat []int64, total int64) string Inspect
swatch : func(color string) string Inspect
svg : func(w int, h int, body string) string Inspect
entryIcon : func(e *v1.Entry) string Inspect
verb : func(e *v1.Entry) string Inspect
forWhom : func(g *v1.Group, e *v1.Entry) string Inspect
date : func(unix int64, layout string) string Inspect
short : func(a .uverse.address) string Inspect
percent : func(part int64, whole int64) string Inspect
plural : func(n int, word string) string Inspect
cents : func(c int64) string Inspect
csv : func(s string) string Inspect
attr : func(s string) string Inspect
cellText : func(s string) string Inspect
abs : func(v int64) int64 Inspect
atoi : func(s string) int Inspect