func AdvertiserBalance
ActionAdvertiserBalance returns the ugnot balance for an advertiser address.
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
AdvertiserBalance returns the ugnot balance for an advertiser address.
ApproveTask marks a task claim as approved. Only the task's advertiser or the admin may approve. Coin reward is handled server-side via the minter.
ClaimRefEarnings moves the caller's accumulated referral earnings into a pending payout queue. The treasury server reads RefPendingClaim(), sends GNOT from the treasury wallet, then calls ClearRefClaim() to zero it.
ClearRefClaim is called by the admin/treasury after disbursing GNOT to a referrer. Zeroes the pending payout entry.
DepositBid credits the caller's advertiser balance with the declared ugnot amount. The caller must attach matching coins to the MsgCall (the VM holds them in the realm's address). The amount is passed explicitly so the realm can credit it without importing chain/banker.
Security: the treasury server MUST verify the on-chain balance before approving any campaign spend — it should call AdvertiserBalance() to cross-check the declared amount matches what was actually deposited.
GetCampaign returns the JSON string for a single campaign, or "null".
GetTask returns the JSON for a single task, or "null".
GetTaskClaim returns the claim status string for a taskId+claimerAddr pair.
ListCampaigns returns a JSON array of campaigns submitted by advertiserAddr.
ListTasks returns a JSON array of tasks submitted by advertiserAddr.
PendingReviews returns a JSON array of campaigns awaiting admin review.
RecordView bills the advertiser one bid_per_view for a player watching an ad. Deduplicated per (campaignId, callerAddr, UTC day). Splits 50% of the bid to the referrer if one is registered for the advertiser.
RefEarnings returns the claimable referral earnings for an address.
RefPendingClaim returns the pending payout amount for a referrer address. The treasury server calls this before sending GNOT.
RegisterReferral permanently links the calling advertiser to a referrer. Each advertiser may register exactly one referrer; cannot be changed.
ReviewCampaign approves or rejects a campaign. Approved campaigns transition to "active" and can receive views.
SelectAd returns the JSON of the winning campaign for the given viewer level, chosen by weighted auction (higher bid_per_view = proportionally more weight). Returns "null" if no eligible campaign exists.
NOTE: uses time.Now().UnixNano() % totalWeight as deterministic pseudo-random. Not cryptographic — sufficient for ad placement.
SubmitCampaign stores a campaign JSON and queues it for admin review. Returns the generated campaignId. Status is forced to "pending_review" regardless of what the client sends.
SubmitTask records a player's proof-of-completion claim on a paid task.
SubmitTaskDef creates a new paid social task. Returns the taskId.
TotalViews returns the total recorded view count for a campaign.