Repository navigation
Credit codes + invites: spend-only ad credit through crawlproof grants - #18
Merged
Merged
Conversation
…f grants) Credit codes (@profullstack/redeem-credits 0.2.0, unit usd_cents) and scarce invites (@profullstack/affiliates 0.3.0, 3 each, one accepted per account). Every grant goes to crawlproof first (POST /api/ads/v1/grants: ad_bonus_credits on the shared advertiser account, runs ads, pays no publisher), then a deposits row (coin 'credit') adds it to the person's balance. Both idempotent on the source. /me "Have a code?", /invites, /i/<code> (accepted at CoinPay sign-in), API, CLI (redeem, invites, invite, accept), MCP. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
@profullstack/redeem-credits0.2.0, unitusd_cents= ad credit, prefixAD-). Redeem on/me("Have a code?"),POST /api/v1/credits/redeem,adnetwork redeem <code>, MCPredeem_credit_code. Mint on dev2 with the module CLI against the app DB (README).@profullstack/affiliates0.3.0): 3 per account,/invites,/i/<code>(cookiean_invite, accepted at the CoinPay sign-in; or paste the code on/invitesfrom another device), APIGET/POST /api/v1/invites,POST /api/v1/invites/accept, CLIinvites|invite|accept, MCPlist_invites|create_invite. One accepted invite per account (already_invited, the other invite stays unused); bonus decided only afterredeemInvite().ok. Accounts under 7 days old accept; senders must be 24 h old. Both getADNETWORK_INVITE_BONUS_CENTS(default $5) of ad credit, except throwaway addresses (mailchecker), the inviter's own mailbox (+tag / Gmail dots), house accounts, accounts with no email; inviter half capped atADNETWORK_INVITE_MONTHLY_CAP(5) per 30 days.Money: how ad credit meets crawlproof
A deposit lands on two books: crawlproof's shared advertiser account (credit_purchases -> credits_balance, cash) and our
depositstable (the person's share). A grant goes the same way, in this order:POST /api/ads/v1/grants(Spend-only partner ad credit grants; code credits count as promo, not cash profullstack/crawlproof.com#394):ad_bonus_creditson the advertiser account, once per reference.ad_charge_clickspends bonus first and pays publishers only from cash, so ad credit is spend-only: it runs ads, it can never be withdrawn as crypto, and clicks bought with it pay publishers nothing.depositsrow (coincredit, status complete, idcredit:<source>) so the person's balance and the run/pause sweep see it.Both writes are idempotent on the source; if crawlproof is down the redemption stands and the grant is finished on the next try (
already_redeemed-> repair;/invitesrepairs invite bonuses).Security sweep
Sign-in is CoinPay OAuth, identity by
sub(not email);/auth/start?next=only takes/[a-z]{1,20}; no client-supplied ids; admin-like powers (ADNETWORK_HOUSE_SUBS) are by sub. Nothing to fix found.Tests
bun test: 23 pass (6 new: code once + spend-only grant, crawlproof-down repair, concurrent double-accept, /i/-> CoinPay sign-in, invite rules, API).tsc --noEmitclean.🤖 Generated with Claude Code