Denom
untyped stringDenom is the only asset this realm accepts.
Value
"ugnot"
MaxFeeBps
int64MaxFeeBps is the hard protocol-fee cap: 1000 bps = 10%.
Value
1000
PlanActive
untyped stringPlan status values.
Value
"active"
PlanRetired
untyped stringPlan status values.
Value
"retired"
SubActive
untyped stringSubscription status values. Cancelled and Expired are terminal.
Value
"active"
SubCancelled
untyped stringSubscription status values. Cancelled and Expired are terminal.
Value
"cancelled"
SubExpired
untyped stringSubscription status values. Cancelled and Expired are terminal.
Value
"expired"
MaxTitleLen
untyped bigintInput bounds.
Value
(80 <untyped> bigint)
MaxDescLen
untyped bigintInput bounds.
Value
(2000 <untyped> bigint)
MinPrice
int64Input bounds.
Value
1
MinPeriodBlocks
int64Input bounds.
Value
10
MaxPeriodBlocks
int64Input bounds.
Value
7500000
MaxPlansPerProvider
untyped bigintInput bounds.
Value
(20 <untyped> bigint)
MaxSubsPerSubscriber
untyped bigintInput bounds.
Value
(100 <untyped> bigint)
RenderLimit
untyped bigintInput bounds.
Value
(20 <untyped> bigint)
plan
typeValue
subscriptions.plan
sub
typeValue
subscriptions.sub
admin
.uverse.address// may set fee, fee recipient, stage successor
Value
<gnolang.StringValue>
pendingAdmin
.uverse.address// staged by TransferAdmin, completes via AcceptAdmin
Value
<zero>
feeRecipient
.uverse.address// may withdraw fees and sweep surplus
Value
<gnolang.StringValue>
feeBps
int64// fee snapshotted into NEW plans
Value
0
self
.uverse.address// this realm's address, captured at deploy
Value
<gnolang.StringValue>
nextPlan
int64Value
2
nextSub
int64Value
2
plans
*v0.Tree// padID(id) -> \*plan
- OID
- 014e9d…a80d:11
plans details
subs
*v0.Tree// padID(id) -> \*sub
- OID
- 014e9d…a80d:14
subs details
activeByKey
*v0.Tree// padID(planID)|subscriber -> int64 sub id, while Active
- OID
- 014e9d…a80d:17
activeByKey details
latestByKey
*v0.Tree// padID(planID)|subscriber -> most recent sub id, never removed
- OID
- 014e9d…a80d:20
latestByKey details
providerNum
*v0.Tree// address -> \*int64, live plans per provider
- OID
- 014e9d…a80d:23
providerNum details
subNum
*v0.Tree// address -> \*int64, Active subs per subscriber
- OID
- 014e9d…a80d:26
subNum details
ledger
*feeledger.Ledger- OID
- 014e9d…a80d:29
ledger details
init.31
func()- OID
- 014e9d…a80d:33
init.31 details
CreatePlan
func(title string, description string, price int64, periodBlocks int64, maxFeeBps int64) int64CreatePlan publishes a subscription plan and returns its id. No coins are accepted; the storage deposit the caller pays is the anti-spam. The current protocol fee is snapshotted into the plan and must not exceed maxFeeBps, the ceiling the provider signed for — pass MaxFeeBps to accept any legal fee. Plans are immutable once created: price and period changes are a new plan, so nothing a subscriber agreed to can move underneath them.
- OID
- 014e9d…a80d:35
CreatePlan details
RetirePlan
func(planID int64)RetirePlan takes a plan off the market: no new subscriptions and no renewals. Provider only. Existing entitlements run to their paidThrough untouched; refusing renewals is subscriber protection — nobody keeps paying for a service whose provider announced its end. The provider's plan-quota slot frees.
- OID
- 014e9d…a80d:36
RetirePlan details
Subscribe
func(planID int64) int64Subscribe pays for the first billing period of a plan and returns the new subscription id. The transaction must attach EXACTLY the plan's price in ugnot — over- and underpayment are both refused, so a mistaken double-attach cannot silently become a donation. One subscriber holds at most one live subscription per plan: if an Active one exists the call is refused (the renewal path is Renew, never a second Subscribe — that is the duplicate-payment guard at the identity level); an incumbent past its grace window is collapsed to Expired in place, so a fresh start never waits on housekeeping. The payment settles immediately: price minus the plan's snapshotted fee to the provider's claimable balance, fee to the protocol pot. Entitlement runs from this block: paidThrough = height + periodBlocks.
- OID
- 014e9d…a80d:37
Subscribe details
Renew
func(subID int64)Renew pays for the next billing period of the caller's own subscription. The transaction must attach exactly the subscription's price. The renewal window is deterministic and stated in the header: accepted iff paidThrough - height \<= periodBlocks (at most one full unstarted period prepaid — the duplicate-payment bound) and height \< paidThrough + periodBlocks (the grace bound, exclusive — a renewal always buys at least one block). Extension is always FROM paidThrough, so period boundaries never drift, and a renewal inside grace covers the lapsed span — that is the price of keeping the original schedule, and it is the documented, deterministic choice.
- OID
- 014e9d…a80d:38
Renew details
Cancel
func(subID int64)Cancel ends the caller's own subscription. Terminal: it can never be renewed afterwards, by anyone. No refund and no funds move — every payment settled when it was made, and the entitlement already bought (height \< paidThrough) remains until it runs out. The plan slot and the subscriber's quota slot free immediately.
- OID
- 014e9d…a80d:39
Cancel details
Expire
func(subID int64)Expire marks a lapsed subscription Expired once its grace window is over: height >= paidThrough + periodBlocks. Permissionless by design — like the sibling realms' valves, no slot's liveness may depend on either party showing up. No funds move.
- OID
- 014e9d…a80d:40
Expire details
Claim
func(amount int64)Claim sends amount ugnot of the caller's claimable balance back to the caller. Providers earn into this balance at every payment.
- OID
- 014e9d…a80d:41
Claim details
ClaimAll
func()ClaimAll sends the caller's entire claimable balance back to the caller. Fails if there is nothing to claim.
- OID
- 014e9d…a80d:42
ClaimAll details
WithdrawFees
func()WithdrawFees sends the accrued fee pot to the fee recipient. Only the fee recipient may call it, and only the pot moves.
- OID
- 014e9d…a80d:43
WithdrawFees details
SweepDenom
func(denom string)SweepDenom recovers out-of-band coins (sent by raw bank transfer, outside any entrypoint) to the fee recipient. For the ledger denom the reserve is Liabilities() — user balances and the fee pot are structurally unreachable. Fee recipient only.
- OID
- 014e9d…a80d:44
SweepDenom details
SetFeeBps
func(bps int64)SetFeeBps sets the protocol fee snapshotted into FUTURE plans. Bounded by MaxFeeBps; existing plans and subscriptions are untouched — their fee was fixed the moment the provider consented to it.
- OID
- 014e9d…a80d:45
SetFeeBps details
SetFeeRecipient
func(recipient .uverse.address)SetFeeRecipient points future fee withdrawals and sweeps at a new address. Admin only. The zero address is refused — it would strand the pot.
- OID
- 014e9d…a80d:46
SetFeeRecipient details
TransferAdmin
func(successor .uverse.address)TransferAdmin stages a two-step admin handover. The successor holds nothing until AcceptAdmin.
- OID
- 014e9d…a80d:47
TransferAdmin details
AcceptAdmin
func()AcceptAdmin completes the handover; only the staged successor may.
- OID
- 014e9d…a80d:48
AcceptAdmin details
Entitled
func(subID int64) boolEntitled reports whether the subscription's paid entitlement covers the current block: height \< paidThrough. Status deliberately does not enter into it — a cancelled subscriber keeps what they paid for, and an expirable-but-unexpired one has already lapsed here.
- OID
- 014e9d…a80d:49
Entitled details
EntitledFor
func(planID int64, subscriber .uverse.address) boolEntitledFor reports whether subscriber currently holds paid entitlement to planID, through their MOST RECENT subscription to it. This is the one-call integration surface for other realms and services, and it honors the entitlement contract across status: a cancelled subscription keeps answering true until its paidThrough — what was bought stays bought (audit finding Y1). One self-inflicted edge is fail-closed: cancelling a prepaid subscription and re-subscribing at once points this surface at the NEW, earlier paidThrough; the old subscription's remaining span stays queryable per-id via Entitled.
- OID
- 014e9d…a80d:50
EntitledFor details
ActiveSubID
func(planID int64, subscriber .uverse.address) (int64, bool)ActiveSubID returns the caller-facing id of subscriber's live subscription to planID, or (0, false) if none is Active.
- OID
- 014e9d…a80d:51
ActiveSubID details
PlanInfo
func(planID int64) (provider .uverse.address, title string, price int64, periodBlocks int64, planFeeBps int64, status string, lifetimeSubs int64)- OID
- 014e9d…a80d:52
PlanInfo details
SubInfo
func(subID int64) (planID int64, subscriber .uverse.address, provider .uverse.address, price int64, paidThrough int64, periods int64, status string)- OID
- 014e9d…a80d:53
SubInfo details
PaidThrough
func(subID int64) int64PaidThrough returns the absolute height a subscription is paid to.
- OID
- 014e9d…a80d:54
PaidThrough details
RenewableFrom
func(subID int64) (from int64, until int64)RenewableFrom returns the earliest height at which Renew will accept a payment for this subscription, and the last height at which it still will (inclusive) — the deterministic window, precomputed for integrators. From until+1 the subscription is expirable instead; the two sets partition exactly.
- OID
- 014e9d…a80d:55
RenewableFrom details
Admin
func() .uverse.address- OID
- 014e9d…a80d:56
Admin details
PendingAdmin
func() .uverse.address- OID
- 014e9d…a80d:57
PendingAdmin details
FeeRecipient
func() .uverse.address- OID
- 014e9d…a80d:58
FeeRecipient details
FeeBps
func() int64- OID
- 014e9d…a80d:59
FeeBps details
NumPlans
func() int64- OID
- 014e9d…a80d:60
NumPlans details
NumSubs
func() int64- OID
- 014e9d…a80d:61
NumSubs details
UsersTotal
func() int64- OID
- 014e9d…a80d:62
UsersTotal details
FeesAccrued
func() int64- OID
- 014e9d…a80d:63
FeesAccrued details
Liabilities
func() int64- OID
- 014e9d…a80d:64
Liabilities details
BalanceOf
func(a .uverse.address) int64- OID
- 014e9d…a80d:65
BalanceOf details
Address
func() .uverse.address- OID
- 014e9d…a80d:66
Address details
Held
func() int64- OID
- 014e9d…a80d:67
Held details
Render
func(path string) string- OID
- 014e9d…a80d:68
Render details
renderHome
func() string- OID
- 014e9d…a80d:69
renderHome details
expireInPlace
func(s *subscriptions.sub)expireInPlace flips an Active subscription to Expired and frees its slots. Callers have already established expirability.
- OID
- 014e9d…a80d:70
expireInPlace details
releaseSlots
func(s *subscriptions.sub)releaseSlots removes the plan|subscriber activity index entry and decrements the subscriber's quota counter. Exactly once per terminal transition, which both terminal paths guarantee by requiring SubActive first.
- OID
- 014e9d…a80d:71
releaseSlots details
assertNoSend
func()- OID
- 014e9d…a80d:72
assertNoSend details
assertAdmin
func(caller .uverse.address)- OID
- 014e9d…a80d:73
assertAdmin details
mustGetPlan
func(id int64) *subscriptions.plan- OID
- 014e9d…a80d:74
mustGetPlan details
mustGetSub
func(id int64) *subscriptions.sub- OID
- 014e9d…a80d:75
mustGetSub details
counter
func(tree *v0.Tree, a .uverse.address) *int64counter returns the persistent per-address counter in tree, allocating a zero on first use.
- OID
- 014e9d…a80d:76
counter details
padID
func(id int64) string- OID
- 014e9d…a80d:77
padID details
itoa
func(n int64) string- OID
- 014e9d…a80d:78