You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Required runtime config fields (per T2.1's resolved getAirdropConfig()): SIWE_DOMAIN, SIWE_URI, SIWE_STATEMENT, SIWE_CHAIN_ID, PLOTLINK_X_HANDLE, PLOTLINK_FC_FID. These may be code constants OR env vars depending on T2.1 implementation — check the effective value, not the env var source.
activation_count = raw SELECT COUNT(*) FROM pl_activations WHERE activated_at IS NOT NULL (marketing/growth narrative on hero strip)
eligible_activation_count = additionally filtered by is_blacklisted = FALSE (matches T2.4b helper's eligibility; distribution accounting)
When T0.1 picks "skip blacklist", the two activation counts are identical
(b) src/app/api/airdrop/leaderboard/route.ts
Rewrite ranking to v5 by consuming the T2.4b shared helper (whichever form T2.4b chose — option A SQL fragment OR option B view; this ticket is helper-agnostic).
Expected use: call the helper to get all activated, non-blacklisted wallets with their weighted_spend, then ORDER BY weighted_spend DESC LIMIT N in the consuming code.
Do NOT hardcode SELECT * FROM v_weighted_spend — that assumes option B. Reference the T2.4b helper export by name (e.g., weightedSpendQuery(config) from lib/airdrop/sql.ts if option A; or SELECT * FROM v_weighted_spend if option B).
Used by optional /airdrop/leaderboard subpage
If endpoint accepts { message, signature }, also migrate auth to siwe-verify.ts here (T2.5e scope catches this if missed)
OR delete the route file entirely if no internal callers remain — confirm via grep -r "/api/airdrop/points" src before deciding
(d) src/app/api/airdrop/referral-code/route.ts — DO NOT TOUCH GET (RE1 round-12)
The GET handler (line 14-37) returns {code, is_farcaster_username} without auth and is consumed by src/hooks/useReferralCode.ts → src/components/ShareButtons.tsx:15 on every story page. No shape change, no auth change to GET. POST migration handled by T2.5e (#1246). If this ticket touches the route file at all, only for the leaderboard cross-audit (no edits expected).
Epic: #1229 · Spec: §6.2, §8 Phase 2 (T2.5f) · Type: CODE · Estimate: 0.5 day · Depends on: T2.4b (#1241)
Scope
(a)
src/app/api/airdrop/status/route.tsenv_check.all_present(boolean) — true iff all required effective runtime config + secrets are present. Validates:TWITTERAPI_IO_KEY,NEYNAR_API_KEY,SUPABASE_SERVICE_ROLE_KEY,CRON_SECRET(always env vars)getAirdropConfig()):SIWE_DOMAIN,SIWE_URI,SIWE_STATEMENT,SIWE_CHAIN_ID,PLOTLINK_X_HANDLE,PLOTLINK_FC_FID. These may be code constants OR env vars depending on T2.1 implementation — check the effective value, not the env var source.POOL_AMOUNT > 0,CAMPAIGN_START < CAMPAIGN_END, all 4MILESTONESdefined.trueonly if ALL above resolve to non-null/valid values.activation_count= rawSELECT COUNT(*) FROM pl_activations WHERE activated_at IS NOT NULL(marketing/growth narrative on hero strip)eligible_activation_count= additionally filtered byis_blacklisted = FALSE(matches T2.4b helper's eligibility; distribution accounting)(b)
src/app/api/airdrop/leaderboard/route.tsweighted_spend, thenORDER BY weighted_spend DESC LIMIT Nin the consuming code.SELECT * FROM v_weighted_spend— that assumes option B. Reference the T2.4b helper export by name (e.g.,weightedSpendQuery(config)fromlib/airdrop/sql.tsif option A; orSELECT * FROM v_weighted_spendif option B)./airdrop/leaderboardsubpage{ message, signature }, also migrate auth tosiwe-verify.tshere (T2.5e scope catches this if missed)(c)
src/app/api/airdrop/points/route.ts{ address, buy_volume_plot, fetched_at }Deprecation: true+Link: </api/airdrop/projection>; rel="successor-version"grep -r "/api/airdrop/points" srcbefore deciding(d)
src/app/api/airdrop/referral-code/route.ts— DO NOT TOUCH GET (RE1 round-12)The GET handler (line 14-37) returns
{code, is_farcaster_username}without auth and is consumed bysrc/hooks/useReferralCode.ts→src/components/ShareButtons.tsx:15on every story page. No shape change, no auth change to GET. POST migration handled by T2.5e (#1246). If this ticket touches the route file at all, only for the leaderboard cross-audit (no edits expected).Acceptance
/statusreturns v5 milestones +env_check.all_present+activation_count+eligible_activation_count/leaderboardconsumes the T2.4b helper (whichever option A or B was chosen) — no hardcoded view assumption in PR/pointseither returns deprecation shim with headers OR is removed (PR notes which)/referral-codeGET shape preserved (verified by curl on staging post-deploy)verifyWalletOwnershipusage remains in any of the modified filesDependencies
T2.4b (shared helper, whichever form chosen)