Campaign
typeCampaign holds the state of a single crowdfunding campaign.
Value
crowdfund.Campaign
campaigns
*v0.Tree// padded id -> \*Campaign (ordered by id)
- OID
- 0d4c03…b8b9:4
campaigns details
nextID
intValue
1
key
func(id int) stringkey zero-pads an id so avl iteration is in numeric order.
- OID
- 0d4c03…b8b9:7
key details
mustGet
func(id int) *crowdfund.Campaign- OID
- 0d4c03…b8b9:9
mustGet details
Launch
func(goal uint64, durationBlocks int) intLaunch creates a new campaign owned by the caller and returns its id.
- OID
- 0d4c03…b8b9:10
Launch details
Pledge
func(id int, amount uint64)Pledge backs campaign id with amount (before the deadline).
- OID
- 0d4c03…b8b9:11
Pledge details
Unpledge
func(id int, amount uint64)Unpledge withdraws amount from the caller's pledge (before the deadline).
- OID
- 0d4c03…b8b9:12
Unpledge details
Claim
func(id int)Claim lets the creator take the funds if the goal was met after the deadline.
- OID
- 0d4c03…b8b9:13
Claim details
Refund
func(id int)Refund returns the caller's pledge if the campaign failed after the deadline.
- OID
- 0d4c03…b8b9:14
Refund details
pct
func(pledged uint64, goal uint64) intpct returns the funded percentage (0..100).
- OID
- 0d4c03…b8b9:15
pct details
progressBar
func(pledged uint64, goal uint64) stringprogressBar renders a fixed-width ▓░ bar for pledged/goal.
- OID
- 0d4c03…b8b9:16
progressBar details
state
func(c *crowdfund.Campaign, height int64) stringstate describes a campaign relative to a given block height.
- OID
- 0d4c03…b8b9:17
state details
Render
func(path string) stringRender shows all campaigns with a progress bar, goal, pledged and state.
- OID
- 0d4c03…b8b9:18