Campaign
typeCampaign holds the state of a single crowdfunding campaign. It carries no ID field: the id belongs to the store, which hands it back on lookup and iteration.
Value
v1.Campaign
campaigns
*v0.Storecampaigns assigns the campaign ids. v0 kept its own nextID plus a key() that zero-padded to width 12, which stopped ordering Render past 10^12, and its own mustGet whose panic did not say which campaign was missing.
- OID
- 05ff28…1f01:4
campaigns details
mustGet
func(id int) *v1.Campaign- OID
- 05ff28…1f01:7
mustGet details
Launch
func(goal uint64, durationBlocks int) intLaunch creates a new campaign owned by the caller and returns its id.
- OID
- 05ff28…1f01:9
Launch details
Pledge
func(id int, amount uint64)Pledge backs campaign id with amount (before the deadline).
- OID
- 05ff28…1f01:10
Pledge details
Unpledge
func(id int, amount uint64)Unpledge withdraws amount from the caller's pledge (before the deadline).
- OID
- 05ff28…1f01:11
Unpledge details
Claim
func(id int)Claim lets the creator take the funds if the goal was met after the deadline.
- OID
- 05ff28…1f01:12
Claim details
Refund
func(id int)Refund returns the caller's pledge if the campaign failed after the deadline.
- OID
- 05ff28…1f01:13
Refund details
pct
func(pledged uint64, goal uint64) intpct returns the funded percentage (0..100).
- OID
- 05ff28…1f01:14
pct details
progressBar
func(pledged uint64, goal uint64) stringprogressBar renders a fixed-width ▓░ bar for pledged/goal.
- OID
- 05ff28…1f01:15
progressBar details
state
func(c *v1.Campaign, height int64) stringstate describes a campaign relative to a given block height.
- OID
- 05ff28…1f01:16
state details
Render
func(path string) stringRender shows all campaigns with a progress bar, goal, pledged and state.
- OID
- 05ff28…1f01:17