func Cancel
crossing ActionCancel refunds all unclaimed funds to the original sender.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package warmpocket implements on-chain gift envelopes and recurring care plans.
Package warmpocket implements on-chain gift envelopes and recurring care plans.
WarmPocket (中文名:暖袋) keeps funds inside the realm until a recipient claims them. Two modes are supported:
All money flows are push-only (the sender attaches ugnot to the transaction), and payouts are made from the realm's own balance with BankerTypeRealmSend.
Cancel refunds all unclaimed funds to the original sender.
Claim pays one installment to the caller. For an instant gift the envelope is marked claimed; for a plan the next due date is advanced by its period.
CreateInstant funds a single-use envelope. A recipient address restricts the claim to one wallet; leaving it empty turns the code into a bearer link.
1func CreatePlan(cur realm, code, title, theme, recipient string, amount int64, periodMonths, installments int, startUnix int64) stringCreatePlan funds a recurring allowance. Funds are held by the realm and released one installment at a time when the recipient calls Claim.
GetGift returns pipe-separated fields: id|kind|sender|recipient|code|title|theme|amount|remaining|period|installments|paid|nextDue|createdAt|claimed|canceled
Render gives gnoweb a usable, text-only dashboard for the realm.
1type Gift struct {
2 ID string
3 Kind string
4 Sender address
5 Recipient address
6 Code string
7 Title string
8 Theme string
9 Amount int64 // per claim, in ugnot
10 Total int64 // originally funded amount
11 Remaining int64 // still held by the realm for this gift
12 PeriodMonths int // 0 for instant, otherwise 1 / 3 / 12
13 Installments int
14 Paid int
15 NextDue int64 // unix seconds
16 CreatedAt int64
17 Claimed bool
18 Canceled bool
19}Gift is the persisted record of one envelope or one recurring plan.