1package bond
2
3import (
4 "strconv"
5
6 "gno.land/p/nt/ufmt/v0"
7)
8
9func Render(path string) string {
10 _ = path
11 out := "# gnomi create-bond policy\n\n"
12 out += "Separate realm — pad upgrades do not replace this schedule.\n\n"
13 if !inited {
14 out += "> [!CAUTION]\n> Call Init first.\n"
15 return out
16 }
17 out += ufmt.Sprintf("- **Current bond:** %d ugnot (~%d GNOT)\n", CurrentBondUgnot(), CurrentBondUgnot()/1_000_000)
18 out += ufmt.Sprintf("- **Normal bond:** %d ugnot\n", normalBondUgnot)
19 out += ufmt.Sprintf("- **Promo bond:** %d ugnot\n", promoBondUgnot)
20 if IsPromoActive() {
21 out += ufmt.Sprintf("- **Promo active** — ends at unix %d (~%d s left)\n", promoEndsAt, PromoSecondsLeft())
22 } else {
23 out += "- Promo: inactive (using normal bond)\n"
24 }
25 out += ufmt.Sprintf("- Admin: `%s`\n\n", admin.String())
26 out += "## API\n\n"
27 out += "- `CurrentBondUgnot()` — pad reads this on Create\n"
28 out += "- `StartPromo(promoUgnot, durationSec)` — admin; 0 amount keeps set promo bond; 0 duration → 10d\n"
29 out += "- `EndPromo()` — admin → normal bond immediately\n"
30 out += "- `SetNormalBond` / `SetPromoBond` / `ExtendPromo`\n"
31 out += "- `BondInfo()` → status|current|normal|promo|endsAt|left|admin\n"
32 _ = strconv.Itoa(0)
33 return out
34}
35Admin() string
BondInfo() string
CurrentBondUgnot() int64
EndPromo(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})
ExtendPromo(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, extraSec int64)
Init(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})
IsPromoActive() bool
NormalBondUgnot() int64
PromoBondUgnot() int64
PromoEndsAt() int64
PromoSecondsLeft() int64
Render(path string) string
SetNormalBond(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, ugnot int64)
SetPromoBond(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, ugnot int64)
StartPromo(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, promoUgnot int64, durationSec int64)
Status() int
TransferAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, newAdmin string)
Signatures reconstructed verbatim from vm/qfuncs — interface params keep their inline definitions.
vm/qrender output, sanitized (docs/render-security.md) and displayed in an empty-sandbox iframe — scripts, forms and popups cannot run. Links stay inert in-preview; right-click to open.