VBB v1: Marty's approved numbers as config defaults (1 free credit/day; packs 10 for $3, 40 for $10; look $2; split 30/70 kept for later; 150 views per cycle; weekly prizes $15/$7/$3 per leaderboard, display only); packages page shows planned prices as coming soon; smoke test (99/99); OG image + icon; env example + compose (not deployed)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 15:30:19 -06:00
parent 9d0dde4b57
commit 832395daa4
16 changed files with 379 additions and 16 deletions
+4 -3
View File
@@ -120,7 +120,8 @@ function signedIn(addr, patch) {
function grantDaily(m) {
const day = store.ctDay(); if (m.freeDay === day) return false;
m.freeDay = day; let granted = false;
if (m.credits < C.freeCreditCap) { m.credits++; granted = true; }
const add = Math.min(C.freeCreditsPerDay, Math.max(0, C.freeCreditCap - m.credits));
if (add > 0) { m.credits += add; granted = true; }
store.save(); return granted;
}
function myData(addr) {
@@ -202,7 +203,7 @@ const server = http.createServer(async (req, res) => {
if (p === '/api/config' && req.method === 'GET') {
return json(res, 200, { site: C.site, siteName: C.siteName, chainId: C.chainId, chainName: C.chainName, rpc: C.publicRpc, walletConnectProjectId: C.walletConnectProjectId,
loopSize: C.loopSize, perShift: C.perShift, viewsPerCycle: C.viewsPerCycle, visitSeconds: C.visitSeconds, freeCreditCap: C.freeCreditCap, maxQueued: C.maxQueuedPerMember,
sso: networksso.enabled() });
freeCreditsPerDay: C.freeCreditsPerDay, packs: C.packs, lookUsd: C.lookUsd, prizes: C.prizes, sso: networksso.enabled() });
}
if (p === '/api/splash' && req.method === 'GET') return json(res, 200, loop.view(24), { 'Cache-Control': 'no-store' });
if (p === '/api/leaders' && req.method === 'GET') {
@@ -312,7 +313,7 @@ const server = http.createServer(async (req, res) => {
if (p === '/api/admin/status' && req.method === 'GET') {
const S = store.state(); const L = store.ledger(); const t = store.today();
const byStatus = {}; for (const e of L) byStatus[e.status] = (byStatus[e.status] || 0) + e.views;
return json(res, 200, { day: store.ctDay(), week: store.ctWeek(), config: { loopSize: C.loopSize, perShift: C.perShift, viewsPerCycle: C.viewsPerCycle, visitSeconds: C.visitSeconds, perIpDay: C.perIpDay, freeCreditCap: C.freeCreditCap, maxQueued: C.maxQueuedPerMember },
return json(res, 200, { day: store.ctDay(), week: store.ctWeek(), config: { split: C.split, packs: C.packs, lookUsd: C.lookUsd, prizes: C.prizes, freeCreditsPerDay: C.freeCreditsPerDay, loopSize: C.loopSize, perShift: C.perShift, viewsPerCycle: C.viewsPerCycle, visitSeconds: C.visitSeconds, perIpDay: C.perIpDay, freeCreditCap: C.freeCreditCap, maxQueued: C.maxQueuedPerMember },
loop: { filled: S.loop.length, size: C.loopSize, ids: S.loop, nextOut: S.loop.length ? S.loop[S.loop.length - 1] : null },
queue: { length: S.queue.length, next: S.queue.slice(0, 20) }, progress: S.progress, held: S.progress >= C.perShift && !S.queue.length,
today: { visits: t.visits || 0, shifts: t.shifts || 0, cycles: t.cycles || 0, posts: t.posts || 0, clicks: t.clicks || 0 },