From 1c203eba8a04875496e08d83a9e350cbff5c35fa Mon Sep 17 00:00:00 2001 From: Marty Bostick Date: Fri, 13 Nov 2026 06:35:32 -0600 Subject: [PATCH] Banner Line web app v1: gate, board, buy, My Spots, dashboard, chain index, keeper, local smoke test Co-Authored-By: Claude Opus 5.5 --- .dockerignore | 5 + .env.example | 14 + .gitignore | 5 + Dockerfile | 10 + abi.js | 43 ++ board.js | 81 +++ chain.js | 221 +++++++++ config.js | 68 +++ contract-abi.json | 908 ++++++++++++++++++++++++++++++++++ docker-compose.yml | 25 + keeper.js | 96 ++++ package-lock.json | 124 +++++ package.json | 16 + public/art/house-games.svg | 1 + public/art/house-iap.svg | 1 + public/art/house-line.svg | 1 + public/art/house-linkspin.svg | 1 + public/assets/board.js | 14 + public/assets/common.js | 55 ++ public/assets/gate.js | 79 +++ public/assets/how.js | 1 + public/assets/join.js | 39 ++ public/assets/line.css | 40 ++ public/assets/my.js | 63 +++ public/assets/site.css | 866 ++++++++++++++++++++++++++++++++ public/assets/wallet.js | 271 ++++++++++ public/board.html | 23 + public/how.html | 30 ++ public/index.html | 43 ++ public/join.html | 41 ++ public/logo-icon.png | Bin 0 -> 63715 bytes public/my.html | 33 ++ public/robots.txt | 4 + qa/smoke.mjs | 233 +++++++++ qa/sync-abi.js | 5 + safety.js | 57 +++ server.js | 331 +++++++++++++ store.js | 70 +++ 38 files changed, 3918 insertions(+) create mode 100644 .dockerignore create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 abi.js create mode 100644 board.js create mode 100644 chain.js create mode 100644 config.js create mode 100644 contract-abi.json create mode 100644 docker-compose.yml create mode 100644 keeper.js create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 public/art/house-games.svg create mode 100644 public/art/house-iap.svg create mode 100644 public/art/house-line.svg create mode 100644 public/art/house-linkspin.svg create mode 100644 public/assets/board.js create mode 100644 public/assets/common.js create mode 100644 public/assets/gate.js create mode 100644 public/assets/how.js create mode 100644 public/assets/join.js create mode 100644 public/assets/line.css create mode 100644 public/assets/my.js create mode 100644 public/assets/site.css create mode 100644 public/assets/wallet.js create mode 100644 public/board.html create mode 100644 public/how.html create mode 100644 public/index.html create mode 100644 public/join.html create mode 100644 public/logo-icon.png create mode 100644 public/my.html create mode 100644 public/robots.txt create mode 100644 qa/smoke.mjs create mode 100644 qa/sync-abi.js create mode 100644 safety.js create mode 100644 server.js create mode 100644 store.js diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b4456b2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +node_modules +data +qa/out +.git +.env diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..61a1363 --- /dev/null +++ b/.env.example @@ -0,0 +1,14 @@ +# Banner Line app env (Coolify). Never commit real values. +CONTRACT_ADDRESS= # default on 137: 0x6c77fc0664f58cf17e81966160fc80005a110f9b (mainnet). Required for 80002/31337 +CHAIN_ID=137 # 137 Polygon mainnet (default), 80002 Amoy, 31337 local anvil +RPC_URLS= # comma list; default = public nodes for CHAIN_ID +START_BLOCK= # index start block; default on 137: 97245075 (DEPLOY_BLOCK also accepted) +CONFIRMATIONS= # default 3 (0 on anvil) +PRICE_FEED= # only if the contract has no quoteWei() (it does) +WALLETCONNECT_PROJECT_ID= # Reown project id (same as InstantAdPay) +SITE_HOST=downlinebanners.com +SESSION_SECRET= # random hex; default = generated into DATA_DIR/.secret +ADMIN_TOKEN= # x-admin-token for /api/admin/status +IAP_RESOLVE_URL= # optional: ?ref= lookup, URL + username -> {"address":"0x.."} +KEEPER_ENABLED=0 # 1 to run fund buys +KEEPER_KEY= # keeper wallet private key (only read at signing time) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9c03e52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +node_modules/ +data/ +*.log +qa/out/ +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2375d3f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM node:22-alpine +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev --no-audit --no-fund +COPY . . +RUN mkdir -p /app/data +ENV NODE_ENV=production +ENV PORT=3000 +EXPOSE 3000 +CMD ["node","server.js"] diff --git a/abi.js b/abi.js new file mode 100644 index 0000000..fd9119f --- /dev/null +++ b/abi.js @@ -0,0 +1,43 @@ +// Banner Line contract ABI: the ONE place the app learns the contract's shape. +// Primary: contract-abi.json = the compiled abi copied from ../contracts/out/BannerLine.sol/BannerLine.json +// (refresh it with `node qa/sync-abi.js` after a contract rebuild). Fallback: the SPEC.md shape below. +// Nothing else in the app hard-codes a selector or a topic. +// Reads are tried and skipped if missing (price falls back to the Chainlink feed math, same formula as InstantAdPay). +const { Interface } = require('ethers'); + +const SPEC_ABI = [ + // writes + 'function buy(address sponsor) payable', + 'function buyFor(address owner, address sponsor) payable', + 'function fundBuy(address giftee)', + // reads (OPTIONAL, any missing one is skipped) + 'function quoteWei() view returns (uint256)', + 'function requiredWei() view returns (uint256)', + 'function priceFeed() view returns (address)', + 'function fundBalance() view returns (uint256)', + 'function lastGiftAt(address) view returns (uint256)', + 'function paidSpots(address) view returns (uint256)', + 'function spotCount() view returns (uint256)', + 'function keeper() view returns (address)', + 'function paused() view returns (bool)', + // events (names and argument order exactly as SPEC.md) + 'event SpotBought(uint256 id, address owner, address payer, address sponsor, uint8 kind, uint256 valueWei, uint256 usdPrice)', + 'event Paid(uint256 indexed spotId, address indexed to, uint256 amount, uint8 role)', + 'event FundBuy(uint256 spotId, address giftee)', + 'event MemberJoined(address member, address sponsor)', + 'event PaymentFailed(uint256 indexed spotId, address indexed to, uint256 amount, uint8 role)' +]; +let ABI = SPEC_ABI, ABI_SOURCE = 'spec'; +try { const j = require('./contract-abi.json'); if (Array.isArray(j) && j.length) { ABI = j; ABI_SOURCE = 'compiled'; } } catch (e) {} + +// Chainlink AggregatorV3 (POL/USD, 8 decimals), used only when the contract has no quote view +const FEED_ABI = ['function latestRoundData() view returns (uint80 roundId, int256 answer, uint256 startedAt, uint256 updatedAt, uint80 answeredInRound)']; + +const PRICE_CENTS = 500; // $5 a spot (SPEC.md Money) +const KINDS = { 0: 'paid', 1: 'bought for', 2: 'fund gift', 3: 'fund kept' }; +const ROLES = { 0: 'sponsor', 1: 'line', 2: 'company A', 3: 'company B', 4: 'fund' }; + +const iface = new Interface(ABI); +const feedIface = new Interface(FEED_ABI); + +module.exports = { ABI, ABI_SOURCE, FEED_ABI, iface, feedIface, PRICE_CENTS, KINDS, ROLES }; diff --git a/board.js b/board.js new file mode 100644 index 0000000..b25d440 --- /dev/null +++ b/board.js @@ -0,0 +1,81 @@ +// Board rotation, creatives, and the frame check for gate visits. +// A spot is owed cfg.viewsOwed views (300) inside cfg.spotDays (30) from purchase. Newest spots sit on top; +// the 3 newest are always shown, the rest of the slots go to the spots furthest behind on delivery +// (views still owed per hour left), and any empty slot is filled with member Banner Spins, then house ads. +const cfgMod = require('./config'); +const chain = require('./chain'); +const store = require('./store'); + +const DAY = 86400000; + +function creative(spot) { + const m = store.spotMeta(spot.id); + if (m && m.img && m.link) return { img: m.img, link: m.link, from: 'spot' }; + const d = store.memberDefault(spot.owner); + if (d && d.img && d.link) return { img: d.img, link: (m && m.link) || d.link, from: 'default' }; + if ((m && m.link) || (d && d.link)) return { img: (m && m.img) || (d && d.img) || houseFor(spot.id).img, link: (m && m.link) || d.link, from: 'link-only' }; + const h = houseFor(spot.id); return { img: h.img, link: h.link, from: 'house' }; +} +function houseFor(n) { const h = cfgMod.house(); return h[Math.abs(Number(n) || 0) % h.length]; } + +function eligible(now) { + const c = cfgMod.get(); now = now || Date.now(); + return chain.spots().filter(s => s.kind !== 3 && now - s.boughtAt < c.spotDays * DAY && store.views(s.id).total < c.viewsOwed); +} + +// Hook: member LinkSpin Banner Spins fill empty slots before house ads (SPEC "house fill"). Returns +// [{ img, link, title }]. Not wired in v1: needs a LinkSpin endpoint listing members' active 468x60 spins. +function memberSpins() { return []; } + +function spotTile(s) { + const c = cfgMod.get(); const cr = creative(s); const v = store.views(s.id); + return { t: 'spot', id: s.id, owner: s.owner, img: cr.img, href: '/go/' + s.id, views: v.total, owed: c.viewsOwed, kind: s.kind }; +} +function pick(n) { + n = n || cfgMod.get().boardSlots; const now = Date.now(); const c = cfgMod.get(); + const el = eligible(now); // newest first + const chosen = el.slice(0, Math.min(3, n)); + const rest = el.slice(chosen.length).map(s => { + const left = Math.max(1, c.spotDays * DAY - (now - s.boughtAt)) / 3600000; + return { s, u: (c.viewsOwed - store.views(s.id).total) / left + Math.random() * 1e-6 }; + }).sort((a, b) => b.u - a.u).slice(0, n - chosen.length).map(x => x.s); + const tiles = chosen.concat(rest).sort((a, b) => b.id - a.id).map(spotTile); + for (const sp of memberSpins()) { if (tiles.length >= n) break; tiles.push({ t: 'spin', img: sp.img, href: sp.link, title: sp.title }); } + const house = cfgMod.house(); let i = Math.floor(Math.random() * house.length); + const stop = Math.min(n, tiles.length + house.length); // each house entry at most once per board + while (tiles.length < stop) { const h = house[i++ % house.length]; tiles.push({ t: 'house', key: h.key, img: h.img, href: '/go/h-' + h.key, title: h.title, note: h.note || '' }); } + return tiles; +} + +// newest spot of an address (gate step 1), any kind except fund-kept +function newestOf(addr) { const a = String(addr || '').toLowerCase(); return chain.spots().find(s => s.owner === a && s.kind !== 3) || null; } +function newest(k, exclude) { const ex = new Set(exclude || []); return chain.spots().filter(s => s.kind !== 3 && !ex.has(s.id)).slice(0, k); } + +// ---- frame check (IAP login-gate pattern): a site that refuses framing opens in a new tab instead ---- +const frameCache = new Map(); +async function frameable(url) { + if (!/^https:\/\//i.test(url || '')) return url && url.startsWith('/'); + const hit = frameCache.get(url); if (hit && Date.now() - hit.at < 6 * 3600000) return hit.ok; + let ok = false; + try { + const ac = new AbortController(); const t = setTimeout(() => ac.abort(), 4000); + const r = await fetch(url, { method: 'GET', redirect: 'follow', signal: ac.signal, headers: { 'User-Agent': 'Mozilla/5.0 (compatible; BannerLineFrameCheck/1.0)' } }); + clearTimeout(t); + const xfo = String(r.headers.get('x-frame-options') || '').toLowerCase(); + const csp = String(r.headers.get('content-security-policy') || '').toLowerCase(); + const fa = /frame-ancestors([^;]*)/.exec(csp); + ok = !xfo && !(fa && !/\*|https:/.test(fa[1])); + try { r.body && r.body.cancel && r.body.cancel(); } catch (e) {} + } catch (e) { ok = false; } + frameCache.set(url, { at: Date.now(), ok }); + if (frameCache.size > 5000) frameCache.clear(); + return ok; +} + +function target(ref) { + if (/^h-/.test(ref)) { const h = cfgMod.house().find(x => 'h-' + x.key === ref); return h ? { link: h.link, spotId: null } : null; } + const s = chain.spot(Number(ref)); if (!s || s.kind === 3) return null; + return { link: creative(s).link, spotId: s.id }; +} + +module.exports = { creative, eligible, pick, newestOf, newest, frameable, target, memberSpins, houseFor }; diff --git a/chain.js b/chain.js new file mode 100644 index 0000000..83e37e2 --- /dev/null +++ b/chain.js @@ -0,0 +1,221 @@ +// On-chain reader + indexer for the Banner Line contract (pattern from InstantAdPay site/chain.js): +// RPC pool with rotation + circuit breaker, a resumable eth_getLogs tail persisted in DATA_DIR, and the +// price quote. Encoding/decoding goes through abi.js only, so the compiled ABI can drop in later. +const fs = require('fs'); +const path = require('path'); +const http = require('http'); +const https = require('https'); +const { EventFragment, Interface } = require('ethers'); +const { iface, feedIface, PRICE_CENTS } = require('./abi'); +const cfgMod = require('./config'); + +const CHUNK = 5000; +let state = null, busy = false, onEvent = null, timer = null; +const stateFile = () => path.join(cfgMod.get().dataDir, 'chain-index.json'); + +// ---- JSON-RPC with fallback rotation (http for a local anvil, https for public nodes) ---- +let rpcIdx = 0; +const RPC_BENCH_MS = 10 * 60 * 1000; const rpcBenched = new Map(); +const benchable = e => /timeout|timed out|abort|ECONN|EAI_AGAIN|ENOTFOUND|EPIPE|socket|hang up|429|too many|rate.?limit|temporar|internal error|service unavailable|50[234]/i.test(String(e && e.message || e)); +function rpcOnce(url, method, params, timeoutMs) { + return new Promise((resolve, reject) => { + const body = JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }); + const u = new URL(url); const mod = u.protocol === 'http:' ? http : https; + const req = mod.request({ hostname: u.hostname, port: u.port || undefined, path: u.pathname + u.search, method: 'POST', + headers: { 'Content-Type': 'application/json', 'Content-Length': Buffer.byteLength(body) }, timeout: timeoutMs || 15000 }, + res => { let d = ''; res.on('data', c => d += c); res.on('end', () => { + try { const j = JSON.parse(d); if (j.error) { const er = new Error(j.error.message || 'rpc error'); er.data = j.error.data; reject(er); } else resolve(j.result); } + catch (e) { reject(e); } }); }); + req.on('error', reject); req.on('timeout', () => req.destroy(new Error('rpc timeout'))); + req.end(body); + }); +} +async function rpc(method, params, timeoutMs) { + const urls = cfgMod.get().rpcs; let last; + for (let round = 0; round < 2; round++) { + const now = Date.now(); const order = [], benched = []; + for (let i = 0; i < urls.length; i++) { const url = urls[(rpcIdx + i) % urls.length]; ((rpcBenched.get(url) || 0) > now ? benched : order).push(url); } + order.push(...benched); + for (const url of order) { + try { const r = await rpcOnce(url, method, params, timeoutMs); rpcIdx = urls.indexOf(url); rpcBenched.delete(url); return r; } + catch (e) { last = e; if (/execution reverted|revert/i.test(String(e.message))) throw e; if (benchable(e)) rpcBenched.set(url, Date.now() + RPC_BENCH_MS); console.warn('rpc', method, 'failed on', url.replace(/\/\/([^/]+).*/, '//$1'), '->', String(e && e.message || e).slice(0, 80)); } + } + if (round < 1) await new Promise(r => setTimeout(r, 400)); + } + throw last || new Error('all RPCs failed'); +} +async function bestTip() { + const urls = cfgMod.get().rpcs; let best = { block: -1, url: urls[0] }; + await Promise.all(urls.map(async u => { try { const b = parseInt(await rpcOnce(u, 'eth_blockNumber', [], 8000), 16); if (b > best.block) best = { block: b, url: u }; } catch (e) {} })); + if (best.block < 0) throw new Error('no RPC answered eth_blockNumber'); + return best; +} + +// ---- reads ---- +async function read(fn, args, to) { + const data = (to ? feedIface : iface).encodeFunctionData(fn, args || []); + const r = await rpc('eth_call', [{ to: to || cfgMod.get().contract, data }, 'latest'], 5000); + if (!r || r === '0x') throw new Error('no such function ' + fn); + return (to ? feedIface : iface).decodeFunctionResult(fn, r); +} +async function tryRead(fn, args) { try { return (await read(fn, args))[0]; } catch (e) { return null; } } + +// Required POL for one $5 spot. Order: contract quote view, else Chainlink feed math (wei = cents * 1e24 / answer, +// the InstantAdPay formula). Cached 20 s. Returns { wei, sendWei, source } or throws. +let quoteCache = null; +async function quote() { + if (quoteCache && Date.now() - quoteCache.at < 20000) return quoteCache.v; + const c = cfgMod.get(); let wei = null, source = ''; + for (const fn of ['quoteWei', 'requiredWei']) { const v = await tryRead(fn); if (v && v > 0n) { wei = v; source = 'contract.' + fn; break; } } + if (!wei) { + let feed = c.priceFeed || await tryRead('priceFeed'); + if (!feed) throw new Error('No price available (contract has no quote view and PRICE_FEED is not set)'); + const r = await read('latestRoundData', [], feed); + const ans = BigInt(r[1]); const upd = Number(r[3]); + if (ans <= 0n) throw new Error('Price feed answer is not positive'); + if (Math.floor(Date.now() / 1000) - upd > 3600 && !c.allowStaleFeed) throw new Error('Price feed is stale (older than 1 hour); buys pause until it updates'); + wei = (BigInt(PRICE_CENTS) * 10n ** 24n) / ans; source = 'feed'; + } + // the contract accepts [required, required * 1.02] and refunds the excess: send +1% for price drift + const v = { wei: wei.toString(), sendWei: (wei + wei / 100n).toString(), source }; + quoteCache = { at: Date.now(), v }; + return v; +} + +// ---- event decode (tolerant of indexed-flag differences between the spec ABI and the compiled one) ---- +const altCache = new Map(); +function decodeLog(log) { + let parsed = null; + try { parsed = iface.parseLog(log); } catch (e) {} + if (!parsed) { + let ev; try { ev = iface.getEvent(log.topics[0]); } catch (e) { return null; } + if (!ev) return null; + const k = log.topics.length - 1, key = ev.name + ':' + k; + if (!altCache.has(key)) { + const sig = 'event ' + ev.name + '(' + ev.inputs.map((p, i) => p.type + (i < k ? ' indexed ' : ' ') + p.name).join(', ') + ')'; + altCache.set(key, new Interface([EventFragment.from(sig)])); + } + try { parsed = altCache.get(key).parseLog(log); } catch (e) { return null; } + } + if (!parsed) return null; + const a = parsed.args, lc = x => String(x).toLowerCase(); + const base = { type: parsed.name, block: parseInt(log.blockNumber, 16), tx: log.transactionHash, li: parseInt(log.logIndex, 16) }; + switch (parsed.name) { + case 'SpotBought': return Object.assign(base, { id: Number(a[0]), owner: lc(a[1]), payer: lc(a[2]), sponsor: lc(a[3]), kind: Number(a[4]), valueWei: a[5].toString(), usdPrice: a[6].toString() }); + case 'Paid': return Object.assign(base, { spotId: Number(a[0]), to: lc(a[1]), amount: a[2].toString(), role: Number(a[3]) }); + case 'FundBuy': return Object.assign(base, { spotId: Number(a[0]), giftee: lc(a[1]) }); + case 'MemberJoined': return Object.assign(base, { member: lc(a[0]), sponsor: lc(a[1]) }); + case 'PaymentFailed': return Object.assign(base, { spotId: Number(a[0]), to: lc(a[1]), amount: a[2].toString(), role: Number(a[3]) }); + } + return null; +} + +// ---- derived index ---- +const ZERO = '0x0000000000000000000000000000000000000000'; +function blank(c) { return { v: 1, key: c.chainId + ':' + String(c.contract).toLowerCase(), lastBlock: c.deployBlock - 1, events: [], blockTs: {} }; } +function derive() { + const d = { spots: new Map(), members: new Map(), wallets: new Map(), fundBuys: [], totals: { spots: 0, paidInWei: 0n, paidOutWei: 0n, members: 0, fundBuys: 0 } }; + for (const ev of state.events) apply(d, ev); + state.d = d; +} +function wallet(d, a) { let w = d.wallets.get(a); if (!w) { w = { inWei: 0n, outWei: 0n, byRole: {}, payouts: 0 }; d.wallets.set(a, w); } return w; } +function apply(d, ev) { + const ts = state.blockTs[ev.block] ? state.blockTs[ev.block] * 1000 : (ev.ts || Date.now()); + if (ev.type === 'SpotBought') { + d.spots.set(ev.id, { id: ev.id, owner: ev.owner, payer: ev.payer, sponsor: ev.sponsor, kind: ev.kind, valueWei: ev.valueWei, usdPrice: ev.usdPrice, boughtAt: ts, block: ev.block, tx: ev.tx }); + d.totals.spots += 1; + if (ev.kind === 0 || ev.kind === 1) { d.totals.paidInWei += BigInt(ev.valueWei); wallet(d, ev.payer).inWei += BigInt(ev.valueWei); } + } else if (ev.type === 'Paid') { + const w = wallet(d, ev.to); w.outWei += BigInt(ev.amount); w.payouts += 1; w.byRole[ev.role] = (BigInt(w.byRole[ev.role] || 0) + BigInt(ev.amount)).toString(); + if (ev.role !== 4 && ev.to !== String(cfgMod.get().contract).toLowerCase()) d.totals.paidOutWei += BigInt(ev.amount); // to == contract: credited to the fund + } else if (ev.type === 'PaymentFailed') { + wallet(d, ev.to).failed = (wallet(d, ev.to).failed || 0) + 1; // the amount went to the fund instead + } else if (ev.type === 'FundBuy') { + d.fundBuys.push({ spotId: ev.spotId, giftee: ev.giftee, at: ts, tx: ev.tx }); d.totals.fundBuys += 1; + } else if (ev.type === 'MemberJoined') { + if (!d.members.has(ev.member)) { d.members.set(ev.member, { address: ev.member, sponsor: ev.sponsor === ZERO ? null : ev.sponsor, joinedAt: ts }); d.totals.members += 1; } + } +} +function loadState() { + const c = cfgMod.get(); + try { state = JSON.parse(fs.readFileSync(stateFile(), 'utf8')); } catch (e) { state = null; } + if (!state || state.v !== 1 || state.key !== c.chainId + ':' + String(c.contract).toLowerCase()) state = blank(c); + state.blockTs = state.blockTs || {}; + derive(); +} +function saveState() { + try { const { d, ...out } = state; const tmp = stateFile() + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(out)); fs.renameSync(tmp, stateFile()); } + catch (e) { console.error('chain state save failed', e.message); } +} +async function blockTime(n) { + if (state.blockTs[n]) return state.blockTs[n]; + const b = await rpc('eth_getBlockByNumber', ['0x' + n.toString(16), false]); + const t = b ? parseInt(b.timestamp, 16) : Math.floor(Date.now() / 1000); + state.blockTs[n] = t; return t; +} +async function tail() { + const c = cfgMod.get(); + if (busy || !c.contract) return; busy = true; + try { + const tip = await bestTip(); + const latest = tip.block - c.confirmations; + let changed = false; + while (state.lastBlock < latest) { + const from = state.lastBlock + 1, to = Math.min(from + CHUNK - 1, latest); + const q = [{ address: c.contract, fromBlock: '0x' + from.toString(16), toBlock: '0x' + to.toString(16) }]; + let logs; try { logs = await rpcOnce(tip.url, 'eth_getLogs', q); } catch (e) { logs = await rpc('eth_getLogs', q); } + logs.sort((x, y) => parseInt(x.blockNumber, 16) - parseInt(y.blockNumber, 16) || parseInt(x.logIndex, 16) - parseInt(y.logIndex, 16)); + for (const lg of logs) { + const ev = decodeLog(lg); if (!ev) continue; + if (state.events.some(e => e.tx === ev.tx && e.li === ev.li)) continue; + await blockTime(ev.block); ev.ts = state.blockTs[ev.block] * 1000; + state.events.push(ev); apply(state.d, ev); changed = true; + if (onEvent) { try { onEvent(ev); } catch (e) { console.error('chain onEvent', e.message); } } + } + state.lastBlock = to; changed = true; + } + if (changed) saveState(); + state.lastOk = Date.now(); + } catch (e) { state.lastErr = e.message; console.error('chain tail', e.message); } + busy = false; +} + +// ---- getters ---- +const d = () => state.d; +function spots() { return [...d().spots.values()].sort((a, b) => b.id - a.id); } +function spot(id) { return d().spots.get(Number(id)) || null; } +function spotsOf(addr) { const a = String(addr).toLowerCase(); return spots().filter(s => s.owner === a); } +function member(addr) { return d().members.get(String(addr).toLowerCase()) || null; } +function isMember(addr) { const a = String(addr || '').toLowerCase(); if (a === String(cfgMod.get().contract).toLowerCase()) return false; return d().members.has(a) || spots().some(s => s.owner === a && s.kind !== 3); } +function directs(addr) { const a = String(addr).toLowerCase(); return [...d().members.values()].filter(m => m.sponsor === a); } +function walletTotals(addr) { const w = d().wallets.get(String(addr).toLowerCase()); return w ? { inWei: w.inWei.toString(), outWei: w.outWei.toString(), byRole: w.byRole, payouts: w.payouts } : { inWei: '0', outWei: '0', byRole: {}, payouts: 0 }; } +function paidOf(addr) { const a = String(addr).toLowerCase(); return state.events.filter(e => e.type === 'Paid' && e.to === a).slice(-200).reverse(); } +function fundBuys() { return d().fundBuys.slice(); } +function totals() { const t = d().totals; return { spots: t.spots, members: t.members, fundBuys: t.fundBuys, paidInWei: t.paidInWei.toString(), paidOutWei: t.paidOutWei.toString() }; } +function status() { return { lastBlock: state.lastBlock, events: state.events.length, lastOk: state.lastOk || null, lastErr: state.lastErr || null }; } +function recent(n) { return state.events.slice(-(n || 50)).reverse(); } + +async function receipt(hash) { + const r = await rpc('eth_getTransactionReceipt', [hash]); + if (!r) return { found: false }; + return { found: true, status: r.status, blockNumber: r.blockNumber }; +} +async function suggestedFees() { + let tip = 0n, base = 0n; + try { tip = BigInt(await rpc('eth_maxPriorityFeePerGas', [])); } catch (e) {} + try { const blk = await rpc('eth_getBlockByNumber', ['latest', false]); base = BigInt((blk && blk.baseFeePerGas) || '0x0'); } catch (e) {} + const MIN_TIP = cfgMod.get().chainId === 31337 ? 1000000000n : 30000000000n; // 30 gwei clears Polygon's ~25 gwei floor + const priority = tip > MIN_TIP ? tip : MIN_TIP; + return { maxPriorityFeePerGas: '0x' + priority.toString(16), maxFeePerGas: '0x' + (base * 2n + priority).toString(16) }; +} + +function init(opts) { + if (opts && opts.onEvent) onEvent = opts.onEvent; + loadState(); + if (!cfgMod.get().contract) { console.warn('CONTRACT_ADDRESS not set: chain index idle'); return; } + tail(); + timer = setInterval(tail, cfgMod.get().pollMs); timer.unref && timer.unref(); +} + +module.exports = { init, tail, rpc, read, tryRead, quote, decodeLog, receipt, suggestedFees, spots, spot, spotsOf, member, isMember, + directs, walletTotals, paidOf, fundBuys, totals, status, recent, ZERO }; diff --git a/config.js b/config.js new file mode 100644 index 0000000..531d81a --- /dev/null +++ b/config.js @@ -0,0 +1,68 @@ +// All runtime config comes from env (Coolify sets these). Read once; the house-ad list can also be +// overridden by DATA_DIR/house.json so it changes without a redeploy. +const fs = require('fs'); +const path = require('path'); + +const NETS = { + 80002: { name: 'Polygon Amoy (testnet rehearsal)', explorer: 'https://amoy.polygonscan.com', rpcs: ['https://polygon-amoy-bor-rpc.publicnode.com', 'https://polygon-amoy.drpc.org'] }, + // drpc first: publicnode refuses some log/archive queries (kept as fallback, InstantAdPay-style rotation) + 137: { name: 'Polygon', explorer: 'https://polygonscan.com', rpcs: ['https://polygon.drpc.org', 'https://polygon-bor-rpc.publicnode.com', 'https://polygon-rpc.com'] }, + 31337: { name: 'Local anvil', explorer: '', rpcs: ['http://127.0.0.1:8545'] } +}; + +// Production default: the BannerLine contract on Polygon mainnet (deployed 2026-11-13, owner = Marty's Tangem, +// keeper 0xcAF8EF6eFDFC9597780Db5a1F6b2efE525868e37). Other chains (80002 Amoy, 31337 anvil) need CONTRACT_ADDRESS set. +const MAINNET = { contract: '0x6c77fc0664f58cf17e81966160fc80005a110f9b', deployBlock: 97245075 }; + +let cfg = null; +function get() { + if (cfg) return cfg; + const e = process.env; + const chainId = Number(e.CHAIN_ID || 137); + const main = chainId === 137; + const net = NETS[chainId] || NETS[137]; + const list = s => String(s || '').split(',').map(x => x.trim()).filter(Boolean); + cfg = { + port: Number(e.PORT || 3000), + isProd: e.NODE_ENV === 'production', + site: e.SITE_HOST || 'downlinebanners.com', + dataDir: e.DATA_DIR || path.join(__dirname, 'data'), + contract: (e.CONTRACT_ADDRESS || (main ? MAINNET.contract : '')).trim(), + chainId, + chainName: e.CHAIN_NAME || net.name, + explorer: e.EXPLORER_URL !== undefined ? e.EXPLORER_URL : net.explorer, + rpcs: list(e.RPC_URLS).length ? list(e.RPC_URLS) : net.rpcs, + publicRpc: e.PUBLIC_RPC || (list(e.RPC_URLS)[0] || net.rpcs[0]), // handed to the wallet for add/switch chain + deployBlock: Number(e.START_BLOCK || e.DEPLOY_BLOCK || (main && String(e.CONTRACT_ADDRESS || MAINNET.contract).trim().toLowerCase() === MAINNET.contract ? MAINNET.deployBlock : 0)), + confirmations: Number(e.CONFIRMATIONS !== undefined ? e.CONFIRMATIONS : (chainId === 31337 ? 0 : 3)), + pollMs: Number(e.POLL_MS || 20000), + priceFeed: (e.PRICE_FEED || '').trim(), + allowStaleFeed: e.ALLOW_STALE_FEED === '1', + walletConnectProjectId: (e.WALLETCONNECT_PROJECT_ID || '').trim(), + // board + gate + viewsOwed: 300, spotDays: 30, boardSlots: Number(e.BOARD_SLOTS || 12), + gateVisitSeconds: 9, gateBoardSeconds: 10, + // keeper (fund buys). KEEPER_KEY is never stored in cfg: keeper.js reads it from env at signing time only. + keeperEnabled: e.KEEPER_ENABLED === '1', + keeperStallHours: Number(e.KEEPER_STALL_HOURS || 4), + keeperMaxPerDay: Number(e.KEEPER_MAX_PER_DAY || 12), + keeperEveryMs: Number(e.KEEPER_EVERY_MIN || 15) * 60000, + iapResolveUrl: (e.IAP_RESOLVE_URL || '').trim() // optional: https://instantadpay.com/api/... returning {address} for ?ref= + }; + return cfg; +} + +// House ads fill empty board slots. Order of fill: member LinkSpin Banner Spins (hook in board.js), then these. +// Image paths avoid ad-blocker patterns (no size tokens, no /banners/ folder). +const HOUSE_DEFAULT = [ + { key: 'iap', title: 'InstantAdPay', img: '/art/house-iap.svg', link: 'https://instantadpay.com/', note: 'Ad credits buy advertising, not income.' }, + { key: 'linkspin', title: 'LinkSpin', img: '/art/house-linkspin.svg', link: 'https://linkspin.app/' }, + { key: 'games', title: 'Network games', img: '/art/house-games.svg', link: 'https://enjoybestgames.com/' }, + { key: 'self', title: 'Banner Line', img: '/art/house-line.svg', link: '/join' } +]; +function house() { + try { const h = JSON.parse(fs.readFileSync(path.join(get().dataDir, 'house.json'), 'utf8')); if (Array.isArray(h) && h.length) return h; } catch (e) {} + return HOUSE_DEFAULT; +} + +module.exports = { get, house, reset: () => { cfg = null; } }; diff --git a/contract-abi.json b/contract-abi.json new file mode 100644 index 0000000..adf967e --- /dev/null +++ b/contract-abi.json @@ -0,0 +1,908 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "_feeA", + "type": "address", + "internalType": "address" + }, + { + "name": "_feeB", + "type": "address", + "internalType": "address" + }, + { + "name": "_keeper", + "type": "address", + "internalType": "address" + }, + { + "name": "_priceFeed", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "BPS_DENOM", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "FEE_A_BPS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "FEE_B_BPS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "FUND_BPS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "GIFT_COOLDOWN", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "KIND_BOUGHT_FOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "KIND_FUND_GIFT", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "KIND_FUND_KEPT", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "KIND_PAID", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "LEVELS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "LEVEL_BPS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "MAX_ORACLE_AGE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "PRICE_CENTS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "PRICE_GRACE", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "ROLE_FEE_A", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "ROLE_FEE_B", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "ROLE_FUND", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "ROLE_LEVEL", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "ROLE_SPONSOR", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint8", + "internalType": "uint8" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "SEND_GAS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "SPONSOR_BPS", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "buy", + "inputs": [ + { + "name": "sponsor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "buyFor", + "inputs": [ + { + "name": "spotOwner", + "type": "address", + "internalType": "address" + }, + { + "name": "sponsor", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "payable" + }, + { + "type": "function", + "name": "feeA", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "feeB", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "fundBalance", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "fundBuy", + "inputs": [ + { + "name": "giftee", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "id", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "isMember", + "inputs": [ + { + "name": "a", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "keeper", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lastGiftAt", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lastGoodAnswer", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "lastGoodAt", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "paidSpots", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "pause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "paused", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "bool", + "internalType": "bool" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "priceFeed", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "contract IAggregatorV3" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "quoteWei", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "setKeeper", + "inputs": [ + { + "name": "k", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "sponsorOf", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "spotCount", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "spots", + "inputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [ + { + "name": "owner", + "type": "address", + "internalType": "address" + }, + { + "name": "kind", + "type": "uint8", + "internalType": "uint8" + }, + { + "name": "boughtAt", + "type": "uint64", + "internalType": "uint64" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "spotsOwned", + "inputs": [ + { + "name": "", + "type": "address", + "internalType": "address" + } + ], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "transferOwnership", + "inputs": [ + { + "name": "a", + "type": "address", + "internalType": "address" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "unpause", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "FallbackPriceUsed", + "inputs": [ + { + "name": "answer", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "feedUpdatedAt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "FundBuy", + "inputs": [ + { + "name": "spotId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "giftee", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "KeeperChanged", + "inputs": [ + { + "name": "oldKeeper", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newKeeper", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "MemberJoined", + "inputs": [ + { + "name": "member", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sponsor", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "OwnershipTransferred", + "inputs": [ + { + "name": "oldOwner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "newOwner", + "type": "address", + "indexed": true, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paid", + "inputs": [ + { + "name": "spotId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "role", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Paused", + "inputs": [ + { + "name": "paused", + "type": "bool", + "indexed": false, + "internalType": "bool" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "PaymentFailed", + "inputs": [ + { + "name": "spotId", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "to", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "amount", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "role", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "PriceCached", + "inputs": [ + { + "name": "answer", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "feedUpdatedAt", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "SpotBought", + "inputs": [ + { + "name": "id", + "type": "uint256", + "indexed": true, + "internalType": "uint256" + }, + { + "name": "owner", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "payer", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "sponsor", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "kind", + "type": "uint8", + "indexed": false, + "internalType": "uint8" + }, + { + "name": "valueWei", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "usdPrice", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + } +] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6fc0b88 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,25 @@ +services: + bannerline: + build: . + restart: unless-stopped + environment: + NODE_ENV: production + PORT: 3000 + DATA_DIR: /app/data + SITE_HOST: ${SITE_HOST:-downlinebanners.com} + CONTRACT_ADDRESS: ${CONTRACT_ADDRESS:-} + CHAIN_ID: ${CHAIN_ID:-137} + RPC_URLS: ${RPC_URLS:-} + START_BLOCK: ${START_BLOCK:-} + WALLETCONNECT_PROJECT_ID: ${WALLETCONNECT_PROJECT_ID:-} + SESSION_SECRET: ${SESSION_SECRET:-} + ADMIN_TOKEN: ${ADMIN_TOKEN:-} + IAP_RESOLVE_URL: ${IAP_RESOLVE_URL:-} + KEEPER_ENABLED: ${KEEPER_ENABLED:-0} + KEEPER_KEY: ${KEEPER_KEY:-} + volumes: + - bannerline-data:/app/data + ports: + - "3000:3000" +volumes: + bannerline-data: diff --git a/keeper.js b/keeper.js new file mode 100644 index 0000000..236b194 --- /dev/null +++ b/keeper.js @@ -0,0 +1,96 @@ +// Keeper engine: momentum-fund buys (SPEC "Momentum fund"). OFF unless KEEPER_ENABLED=1 and KEEPER_KEY is set. +// Every 15 min: if no spot has SOLD (kind 0 paid / 1 bought-for) for 4 h and fewer than 12 fund buys happened +// today (US Central), call fundBuy(giftee). Giftee = an active member (signed in or bought within 7 days) who owns +// a paid spot and had no gift in 7 days; builders (sponsored someone in the last 30 days) first, then the longest +// wait; nobody eligible -> address(0) (the fund keeps the spot). The contract enforces the money + 7-day rules. +// KEEPER_KEY is read from env only at signing time and is never logged, stored or returned. +const { Wallet, JsonRpcProvider } = require('ethers'); +const cfgMod = require('./config'); +const chain = require('./chain'); +const store = require('./store'); +const { iface } = require('./abi'); + +const DAY = 86400000; +let running = false, timer = null, lastDecision = null; + +function centralDay(ms) { return new Intl.DateTimeFormat('en-CA', { timeZone: 'America/Chicago', year: 'numeric', month: '2-digit', day: '2-digit' }).format(new Date(ms)); } + +function lastGiftMap() { const m = new Map(); for (const f of chain.fundBuys()) if (f.giftee !== chain.ZERO) m.set(f.giftee, Math.max(m.get(f.giftee) || 0, f.at)); return m; } + +function candidates(now) { + now = now || Date.now(); + const spots = chain.spots(); const gifts = lastGiftMap(); + const owners = new Map(); + for (const s of spots) { if (!owners.has(s.owner)) owners.set(s.owner, []); owners.get(s.owner).push(s); } + const out = []; + for (const [addr, list] of owners) { + if (addr === chain.ZERO || addr === String(cfgMod.get().contract).toLowerCase()) continue; + const paid = list.filter(s => s.kind === 0); + if (!paid.length) continue; + const boughtRecently = list.some(s => (s.kind === 0 || s.kind === 1) && now - s.boughtAt < 7 * DAY); + const seenRecently = now - store.lastSeen(addr) < 7 * DAY; + if (!boughtRecently && !seenRecently) continue; + const lastGift = gifts.get(addr) || 0; + if (lastGift && now - lastGift < 7 * DAY) continue; + const builder = chain.directs(addr).some(m => now - m.joinedAt < 30 * DAY); + const waitingSince = lastGift || Math.min(...paid.map(s => s.boughtAt)); + out.push({ address: addr, builder, waitingSince }); + } + out.sort((a, b) => (b.builder - a.builder) || (a.waitingSince - b.waitingSince)); + return out; +} + +function decide(now) { + now = now || Date.now(); const c = cfgMod.get(); + const sold = chain.spots().filter(s => s.kind === 0 || s.kind === 1); + const lastSale = sold.length ? Math.max(...sold.map(s => s.boughtAt)) : 0; + const today = centralDay(now); + const fundToday = chain.fundBuys().filter(f => centralDay(f.at) === today).length + + store.keeperEntries().filter(e => e.status === 'sent' && centralDay(e.at) === today && !chain.fundBuys().some(f => f.tx === e.tx)).length; + if (!chain.spots().length) return { act: false, why: 'no spots in the line yet' }; + if (now - lastSale < c.keeperStallHours * 3600000) return { act: false, why: 'a spot sold in the last ' + c.keeperStallHours + ' h' }; + if (fundToday >= c.keeperMaxPerDay) return { act: false, why: fundToday + ' fund buys today (Central), limit ' + c.keeperMaxPerDay }; + const cands = candidates(now); + return { act: true, giftee: cands.length ? cands[0].address : chain.ZERO, candidates: cands.length, fundToday }; +} + +async function tick() { + const c = cfgMod.get(); + if (running || !c.keeperEnabled || !process.env.KEEPER_KEY || !c.contract) return; + running = true; + try { + await chain.tail(); // decide on fresh data + const d = decide(); lastDecision = Object.assign({ at: Date.now() }, d); + if (!d.act) return; + let giftee = d.giftee; + // the contract's own 7-day check is authoritative: re-read it when the view exists + if (giftee !== chain.ZERO) { const lg = await chain.tryRead('lastGiftAt', [giftee]); if (lg && Date.now() / 1000 - Number(lg) < 7 * 86400) giftee = chain.ZERO; } + const q = await chain.quote(); + const fb = await chain.tryRead('fundBalance'); + if (fb !== null && BigInt(fb) < BigInt(q.wei)) { store.keeperLog({ status: 'skipped', why: 'fund balance below one spot', giftee }); return; } + const provider = new JsonRpcProvider(c.rpcs[0], c.chainId, { staticNetwork: true }); + const signer = new Wallet(process.env.KEEPER_KEY, provider); + const fees = await chain.suggestedFees(); + const tx = await signer.sendTransaction({ to: c.contract, data: iface.encodeFunctionData('fundBuy', [giftee]), + maxFeePerGas: BigInt(fees.maxFeePerGas), maxPriorityFeePerGas: BigInt(fees.maxPriorityFeePerGas) }); + store.keeperLog({ status: 'sent', tx: tx.hash, giftee }); + console.log('keeper fundBuy sent', tx.hash, 'giftee', giftee); + const r = await tx.wait(1, 180000).catch(e => null); + store.keeperLog({ status: r && r.status === 1 ? 'mined' : 'unconfirmed', tx: tx.hash, giftee }); + await chain.tail(); + } catch (e) { + const msg = String(e && (e.shortMessage || e.message) || e).slice(0, 200); + store.keeperLog({ status: 'error', why: msg }); console.error('keeper', msg); + } finally { running = false; } +} + +function init() { + const c = cfgMod.get(); + if (!c.keeperEnabled || !process.env.KEEPER_KEY) { console.log('keeper: off (needs KEEPER_ENABLED=1 and KEEPER_KEY)'); return; } + console.log('keeper: on, every ' + Math.round(c.keeperEveryMs / 60000) + ' min'); + setTimeout(tick, 15000).unref(); + timer = setInterval(tick, c.keeperEveryMs); timer.unref && timer.unref(); +} +function statusInfo() { const c = cfgMod.get(); return { enabled: c.keeperEnabled && !!process.env.KEEPER_KEY, last: lastDecision, preview: decide(), log: store.keeperEntries().slice(-20).reverse() }; } + +module.exports = { init, tick, decide, candidates, statusInfo, centralDay }; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..0a0d98d --- /dev/null +++ b/package-lock.json @@ -0,0 +1,124 @@ +{ + "name": "banner-line", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "banner-line", + "version": "0.1.0", + "dependencies": { + "ethers": "^6.13.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", + "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==", + "license": "MIT" + }, + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "license": "MIT", + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@types/node": { + "version": "22.7.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", + "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "license": "MIT" + }, + "node_modules/ethers": { + "version": "6.17.0", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.17.0.tgz", + "integrity": "sha512-BpyrpIPJ3ydEVow8zGaz1DuPS7YU8DcWxuBnY9a0UA/lvAPwrMr+EPXsfrul628SRaekPNeIM4UFh/91GWZang==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "1.11.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "22.7.5", + "aes-js": "4.0.0-beta.5", + "tslib": "2.7.0", + "ws": "8.21.0" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tslib": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", + "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==", + "license": "0BSD" + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..721d8fd --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "banner-line", + "version": "0.1.0", + "private": true, + "description": "Banner Line (downlinebanners.com): 468x60 spots in one global line, split on-chain when spots sell.", + "main": "server.js", + "scripts": { + "start": "node server.js", + "dev": "node --watch server.js", + "qa": "node qa/smoke.mjs" + }, + "engines": { "node": ">=20" }, + "dependencies": { + "ethers": "^6.13.0" + } +} diff --git a/public/art/house-games.svg b/public/art/house-games.svg new file mode 100644 index 0000000..5a46d5a --- /dev/null +++ b/public/art/house-games.svg @@ -0,0 +1 @@ +Network gamesFree browser games from the Crypto Team Build Network.Play diff --git a/public/art/house-iap.svg b/public/art/house-iap.svg new file mode 100644 index 0000000..f4bfd29 --- /dev/null +++ b/public/art/house-iap.svg @@ -0,0 +1 @@ +InstantAdPayAdvertise to members. Ad credits buy advertising, not income.Visit diff --git a/public/art/house-line.svg b/public/art/house-line.svg new file mode 100644 index 0000000..74e83f7 --- /dev/null +++ b/public/art/house-line.svg @@ -0,0 +1 @@ +Banner Line: this slot is openA $5 spot = 300 guaranteed views and a place in the line.Get a spot diff --git a/public/art/house-linkspin.svg b/public/art/house-linkspin.svg new file mode 100644 index 0000000..8d6d65f --- /dev/null +++ b/public/art/house-linkspin.svg @@ -0,0 +1 @@ +LinkSpinRotate your links and banners across the network.Visit diff --git a/public/assets/board.js b/public/assets/board.js new file mode 100644 index 0000000..18d7a2b --- /dev/null +++ b/public/assets/board.js @@ -0,0 +1,14 @@ +// Organic board page: shows the rotation, counts views after 5 s on screen (one-time server token). +(async function () { + await BL.renderNav('/board'); BL.renderFooter(); + const $ = BL.$; + const [b, s] = await Promise.all([BL.getJSON('/api/board'), BL.getJSON('/api/stats')]); + const box = $('lots'); + for (const t of b.tiles || []) box.appendChild(BL.tile(t, { meta: true })); + const spots = (b.tiles || []).filter(t => t.t === 'spot').length; + $('boardNote').textContent = spots ? spots + ' member spot' + (spots === 1 ? '' : 's') + ' on this view. Reload to see the rotation.' : 'No member spots are delivering right now. Network sites fill the open slots.'; + if (b.token) setTimeout(() => { if (document.visibilityState === 'visible') BL.post('/api/board/seen', { token: b.token }); }, 5500); + const t = (s && s.totals) || {}; + $('stats').innerHTML = [['Spots in the line', t.spots || 0], ['Members', t.members || 0], ['POL paid in', BL.fmtPol(t.paidInWei || 0)], ['POL paid out to members and fees', BL.fmtPol(t.paidOutWei || 0)]] + .map(x => '
' + BL.esc(x[1]) + '' + BL.esc(x[0]) + '
').join(''); +})(); diff --git a/public/assets/common.js b/public/assets/common.js new file mode 100644 index 0000000..14acc04 --- /dev/null +++ b/public/assets/common.js @@ -0,0 +1,55 @@ +// Shared page helpers (BL namespace, modelled on InstantAdPay common.js). +window.BL = (function () { + let cfgP = null; + const $ = id => document.getElementById(id); + const esc = s => String(s == null ? '' : s).replace(/[&<>"']/g, c => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }[c])); + const getConfig = () => cfgP || (cfgP = fetch('/api/config').then(r => r.json())); + function fmtPol(wei, dp) { + try { const w = BigInt(wei || 0); const whole = w / 10n ** 18n; const frac = (w % 10n ** 18n).toString().padStart(18, '0').slice(0, dp || 4).replace(/0+$/, ''); + return whole.toString() + (frac ? '.' + frac : ''); } catch (e) { return '0'; } + } + const short = a => a ? a.slice(0, 6) + '...' + a.slice(-4) : ''; + const framed = (() => { try { return window.top !== window.self; } catch (e) { return true; } })(); + function status(msg, cls) { const el = $('status'); if (!el) return; el.hidden = !msg; el.className = 'note ' + (cls || ''); el.textContent = msg || ''; } + async function getJSON(url, opts) { const r = await fetch(url, opts); let j = {}; try { j = await r.json(); } catch (e) {} if (!r.ok && !j.error) j.error = 'Request failed (' + r.status + ')'; return j; } + const post = (url, body) => getJSON(url, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body || {}) }); + + async function renderNav(active) { + const c = await getConfig().catch(() => ({})); + const n = document.createElement('nav'); + const links = [['/', 'Home'], ['/board', 'Board'], ['/how', 'How it works'], ['/join', 'Get a spot'], ['/my', 'My Spots']]; + n.innerHTML = '
' + + '
'; + document.body.prepend(n); + if (c && c.chainId && c.chainId !== 137) { + const r = document.createElement('div'); r.className = 'rehearsal'; + r.innerHTML = 'Rehearsal: this runs on ' + esc(c.chainName) + '. Test POL only, no real money.'; + n.after(r); + } + // inside a traffic-exchange frame, member and buy pages open in a new tab with the sponsor carried along + if (framed) document.querySelectorAll('nav a[href="/join"], nav a[href="/my"]').forEach(a => { a.target = '_blank'; a.rel = 'noopener'; }); + } + function renderFooter() { + const f = document.createElement('footer'); + f.className = 'bl-foot'; + f.innerHTML = '

Part of the Crypto Team Build Network

' + + '

A spot buys 300 guaranteed views on the board and a place in the line. Nothing is promised: you are paid only when spots sell after yours, and a spot can earn back less than it cost.

' + + '

How it works · Board · My Spots

'; + document.body.appendChild(f); + } + // one spot tile; href goes through the /go relay, which counts the click + function tile(t, opts) { + const a = document.createElement('a'); + a.className = 'lot' + (t.t !== 'spot' ? ' house' : ''); + a.href = t.href; a.target = '_blank'; a.rel = 'noopener'; + const img = document.createElement('img'); img.src = t.img; img.width = 468; img.height = 60; img.alt = t.t === 'spot' ? 'Spot #' + t.id : (t.title || 'Network'); + img.loading = 'lazy'; img.referrerPolicy = 'no-referrer'; + img.onerror = () => { img.onerror = null; img.src = '/art/house-line.svg'; }; + a.appendChild(img); + if (opts && opts.meta) { const m = document.createElement('span'); m.className = 'lot-meta'; m.textContent = t.t === 'spot' ? '#' + t.id : 'network'; a.appendChild(m); } + return a; + } + function withRef(href, sponsor) { if (!sponsor) return href; return href + (href.includes('?') ? '&' : '?') + 'ref=' + encodeURIComponent(sponsor); } + return { $, esc, getConfig, fmtPol, short, framed, status, getJSON, post, renderNav, renderFooter, tile, withRef }; +})(); diff --git a/public/assets/gate.js b/public/assets/gate.js new file mode 100644 index 0000000..b032203 --- /dev/null +++ b/public/assets/gate.js @@ -0,0 +1,79 @@ +// Home page gate: (1) the sponsor's newest spot, (2) the whole board ~10 s, (3) the 3 newest spots, each on a timer, +// then Join unlocks. The server keeps the plan and checks every step's time; this script only drives the screens. +// Visits load inside a frame under our timer bar (IAP login-gate pattern); a site that refuses framing opens in a +// new tab and the timer runs from the moment it is opened. +(async function () { + await BL.renderNav('/'); BL.renderFooter(); + const $ = BL.$; + const me = await BL.getJSON('/api/me').catch(() => ({})); + const g = await BL.getJSON('/api/gate'); + if (g.error) { BL.status(g.error, 'err'); return; } + if (g.passed) return showOpen(); + + $('gate').hidden = false; + const labels = g.steps.map(s => s.type === 'board' ? 'The board' : s.role === 'sponsor' ? 'Your sponsor' : 'Newest spot'); + const paint = i => { $('gateSteps').innerHTML = labels.map((l, k) => '
  • ' + (k + 1) + '. ' + BL.esc(l) + '
  • ').join(''); }; + + let i = 0; + async function run() { + paint(i); + const st = g.steps[i]; const stage = $('gStage'); stage.innerHTML = ''; $('gNext').hidden = true; $('gOpen').hidden = true; $('gProg').style.width = '0'; + let opened = st.type === 'board' || st.frame; // a new-tab visit starts its clock when the visitor opens it + const startClock = async () => { + const b = await BL.post('/api/gate/begin', { gid: g.gid, i }); + if (b.error) { BL.status(b.error, 'err'); return; } + countdown(st.seconds, () => finish()); + }; + if (st.type === 'board') { + $('gWhat').textContent = 'The board: every spot shown here counts as a view.'; + const box = document.createElement('div'); box.className = 'lots'; for (const t of st.tiles) box.appendChild(BL.tile(t)); stage.appendChild(box); + startClock(); + } else { + const href = st.open + '?g=' + encodeURIComponent(g.gid) + '&i=' + i; + $('gOpen').href = href; + if (st.frame) { + $('gWhat').textContent = (st.role === 'sponsor' ? 'Your sponsor\'s newest spot' : st.title || 'Newest spot') + '. Have a look while the timer runs.'; + const f = document.createElement('iframe'); f.className = 'gate-frame'; f.src = href; f.referrerPolicy = 'no-referrer'; + f.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox'); + stage.appendChild(f); $('gOpen').hidden = false; $('gOpen').textContent = 'Open site in a new tab'; + startClock(); + } else { + $('gWhat').textContent = (st.role === 'sponsor' ? 'Your sponsor\'s newest spot' : st.title || 'Newest spot') + ' opens in a new tab. The timer starts when you open it.'; + const box = document.createElement('div'); box.className = 'gate-out'; + const pic = BL.tile({ t: 'spot', img: st.img, href, id: st.ref }); box.appendChild(pic); + const b = document.createElement('a'); b.className = 'btn'; b.href = href; b.target = '_blank'; b.rel = 'noopener'; b.textContent = 'Open the site'; b.style.marginTop = '14px'; + box.appendChild(b); stage.appendChild(box); + const go = () => { if (opened) return; opened = true; startClock(); }; + b.addEventListener('click', go); pic.addEventListener('click', go); + $('gCount').textContent = st.seconds; + } + } + } + function countdown(sec, done) { + let left = sec * 10; $('gCount').textContent = sec; + const t = setInterval(() => { + left -= 1; + $('gCount').textContent = Math.max(0, Math.ceil(left / 10)); + $('gProg').style.width = Math.min(100, 100 * (1 - left / (sec * 10))) + '%'; + if (left <= 0) { clearInterval(t); done(); } + }, 100); + } + async function finish() { + const r = await BL.post('/api/gate/done', { gid: g.gid, i }); + if (r.error) { BL.status(r.error, 'err'); return; } + if (r.passed) { paint(g.steps.length); $('gNext').hidden = false; $('gNext').textContent = 'Continue'; $('gWhat').textContent = 'Done. Join is open.'; $('gNext').onclick = () => { $('gate').hidden = true; showOpen(); }; return; } + $('gNext').hidden = false; $('gNext').textContent = 'Next'; + $('gNext').onclick = () => { i += 1; run(); }; + } + run(); + + async function showOpen() { + $('open').hidden = false; + const sp = me && me.sponsor; + if (BL.framed) { const j = $('joinBtn'); j.href = BL.withRef('/join', sp); j.target = '_blank'; j.rel = 'noopener'; } + const b = await BL.getJSON('/api/board'); + const box = $('lots'); box.innerHTML = ''; + for (const t of b.tiles || []) box.appendChild(BL.tile(t)); + if (b.token) setTimeout(() => { if (document.visibilityState === 'visible') BL.post('/api/board/seen', { token: b.token }); }, 5500); + } +})(); diff --git a/public/assets/how.js b/public/assets/how.js new file mode 100644 index 0000000..193b37a --- /dev/null +++ b/public/assets/how.js @@ -0,0 +1 @@ +(async function () { await BL.renderNav("/how"); BL.renderFooter(); })(); diff --git a/public/assets/join.js b/public/assets/join.js new file mode 100644 index 0000000..7d14605 --- /dev/null +++ b/public/assets/join.js @@ -0,0 +1,39 @@ +// Buy page: gate check, live price from /api/quote, buy(sponsor) or buyFor(owner, sponsor) from the visitor's wallet. +(async function () { + await BL.renderNav('/join'); BL.renderFooter(); + const $ = BL.$; + const c = await BL.getConfig(); + const [g, me] = await Promise.all([BL.getJSON('/api/gate'), BL.getJSON('/api/me')]); + if (!g.passed) { $('locked').hidden = false; $('tourLink').href = BL.withRef('/', me.sponsor); return; } + $('buyCard').hidden = false; + if (!c.ready) { BL.status('The contract address is not configured yet. Buying opens once it is.', 'err'); $('buyBtn').disabled = true; $('buyForBtn').disabled = true; } + + let sponsor = null; + const sp = await BL.getJSON('/api/sponsor'); + if (sp.address && sp.member) { sponsor = sp.address; $('sponsor').textContent = BL.short(sp.address); } + else $('sponsor').textContent = sp.address ? 'not a member yet (none)' : 'none'; + + let q = null; + async function loadQuote() { + q = await BL.getJSON('/api/quote'); + $('price').textContent = q.error ? 'unavailable' : BL.fmtPol(q.sendWei, 5); + if (q.error) BL.status('Price unavailable: ' + q.error, 'err'); + } + await loadQuote(); setInterval(loadQuote, 30000); + + async function doBuy(forAddr) { + BL.status(''); + try { + await loadQuote(); if (!q || q.error) throw new Error('No price right now. Try again in a minute.'); + BL.status('Confirm the payment in your wallet. The contract refunds anything above the price in the same transaction.'); + const r = forAddr ? await BLWallet.buyFor(forAddr, sponsor, q.sendWei) : await BLWallet.buy(sponsor, q.sendWei); + if (r.receipt.status !== '0x1') throw new Error('The transaction reverted. Nothing was charged except gas.'); + BL.status(''); + $('doneCard').hidden = false; $('buyCard').hidden = true; + $('txLink').innerHTML = c.explorer ? 'View the transaction' : BL.esc(r.hash); + if (forAddr) $('doneCard').querySelector('h3').textContent = 'The spot is in the line for ' + BL.short(forAddr); + } catch (e) { BL.status(String(e && e.message || e).slice(0, 300), 'err'); } + } + $('buyBtn').onclick = () => doBuy(null); + $('buyForBtn').onclick = () => { const a = $('forAddr').value.trim(); if (!/^0x[0-9a-fA-F]{40}$/.test(a)) return BL.status('Enter a full wallet address (0x followed by 40 characters).', 'err'); doBuy(a); }; +})(); diff --git a/public/assets/line.css b/public/assets/line.css new file mode 100644 index 0000000..ef7e849 --- /dev/null +++ b/public/assets/line.css @@ -0,0 +1,40 @@ +/* Banner Line additions on top of the InstantAdPay site.css look. Neutral class names (no ad/banner words: + ad blockers hide those). */ +.hero{padding:34px 0 10px;text-align:center} +.hero h1{font-size:clamp(28px,4vw,44px);line-height:1.1;margin:0 0 10px} +.hero h1 em{font-style:normal;color:var(--mint)} +.hero p.lead{color:var(--muted);max-width:680px;margin:0 auto 14px;font-size:16px} +.card{background:var(--panel-grad);border:1px solid var(--line-strong);border-radius:var(--radius);padding:20px 22px;margin:16px 0} +.card h2,.card h3{margin:0 0 8px} +.muted{color:var(--muted)} .small{font-size:13px} .mono{font-family:var(--mono)} +.note{border-radius:12px;padding:10px 14px;margin:10px 0;background:var(--mint-faint);border:1px solid var(--line)} +.note.err{background:var(--bad-soft);border-color:var(--bad);color:var(--ink)} +.note.ok{background:var(--ok-soft);border-color:var(--ok)} +.lots{display:flex;flex-direction:column;align-items:center;gap:10px;margin:14px 0} +.lot{position:relative;display:block;width:468px;max-width:100%;line-height:0;border-radius:6px;overflow:hidden;border:1px solid var(--line)} +.lot img{width:100%;height:auto;aspect-ratio:468/60;object-fit:cover;display:block;background:var(--panel-solid)} +.lot.house{opacity:.92} +.lot-meta{position:absolute;right:4px;bottom:3px;font:11px/1.2 var(--mono);background:rgba(0,0,0,.6);color:#fff;padding:1px 5px;border-radius:4px} +.steps{display:flex;gap:6px;flex-wrap:wrap;margin:8px 0 14px;padding:0;list-style:none} +.steps li{font-size:12.5px;padding:5px 11px;border-radius:999px;border:1px solid var(--line);color:var(--muted)} +.steps li.on{border-color:var(--mint);color:var(--mint)} .steps li.done{color:var(--ok);border-color:var(--ok)} +.gate-bar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:14px 14px 0 0;padding:10px 14px} +.gate-bar .count{font:700 22px/1 var(--disp);color:var(--mint);min-width:44px} +.gate-bar .what{flex:1;min-width:180px;font-size:14px} +.gate-frame{width:100%;height:min(62vh,560px);border:1px solid var(--line-strong);border-top:0;border-radius:0 0 14px 14px;background:#fff;display:block} +.gate-out{border:1px solid var(--line-strong);border-top:0;border-radius:0 0 14px 14px;padding:22px;text-align:center} +.progress{height:6px;border-radius:3px;background:var(--line);overflow:hidden;margin-top:6px;width:100%} +.progress i{display:block;height:100%;background:var(--mint);width:0;transition:width .25s linear} +table.tbl{width:100%;border-collapse:collapse;font-size:14px} +table.tbl th,table.tbl td{text-align:left;padding:8px 6px;border-bottom:1px solid var(--line);vertical-align:top} +table.tbl th{color:var(--muted);font-weight:600;font-size:12.5px} +.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:12px} +.stat{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:14px} +.stat b{display:block;font:700 22px/1.2 var(--disp);color:var(--ink)} .stat span{color:var(--muted);font-size:13px} +.field{display:flex;flex-direction:column;gap:4px;margin:8px 0} +.field input{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:10px;padding:9px 12px;color:var(--ink);font:14px var(--mono);width:100%} +.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center} +.spot-ed{border-top:1px solid var(--line);padding:14px 0} +.bl-foot{margin-top:40px;padding:26px 0;border-top:1px solid var(--line);text-align:center} +.bl-foot p{margin:6px 0} +@media (max-width:520px){.gate-frame{height:58vh}.card{padding:16px}} diff --git a/public/assets/my.js b/public/assets/my.js new file mode 100644 index 0000000..2382f18 --- /dev/null +++ b/public/assets/my.js @@ -0,0 +1,63 @@ +// My Spots + dashboard: wallet signature sign-in, per-spot image + link editing, default creative, payouts, directs. +(async function () { + await BL.renderNav('/my'); BL.renderFooter(); + const $ = BL.$, esc = BL.esc; + const ROLE = { 0: 'sponsor share', 1: 'line level', 2: 'company A', 3: 'company B', 4: 'fund' }; + const KIND = { 0: 'paid', 1: 'bought for you', 2: 'fund gift', 3: 'fund kept' }; + const c = await BL.getConfig(); + const me = await BL.getJSON('/api/me'); + if (!me.signedIn) { + $('signin').hidden = false; + $('signBtn').onclick = async () => { + try { BL.status('Check your wallet for the sign-in message.'); await BLWallet.signIn(); location.reload(); } + catch (e) { BL.status(String(e && e.message || e).slice(0, 300), 'err'); } + }; + return; + } + $('outBtn').onclick = async () => { await BL.post('/api/auth/logout'); location.reload(); }; + async function load() { + const d = await BL.getJSON('/api/my'); + if (d.error) return BL.status(d.error, 'err'); + $('dash').hidden = false; $('me').textContent = d.address; + const delivered = d.spots.reduce((t, s) => t + s.views, 0); + $('stats').innerHTML = [['Spots owned', d.spots.length], ['Views delivered', delivered + ' of ' + d.spots.filter(s => s.kind !== 3).length * c.viewsOwed], + ['POL paid in', BL.fmtPol(d.paidInWei)], ['POL paid out to you', BL.fmtPol(d.paidOutWei)]] + .map(x => '
    ' + esc(x[1]) + '' + esc(x[0]) + '
    ').join(''); + $('share').value = d.share; + $('copyBtn').onclick = () => { $('share').select(); try { navigator.clipboard.writeText(d.share); } catch (e) { document.execCommand('copy'); } BL.status('Link copied.', 'ok'); }; + const box = $('spots'); box.innerHTML = ''; + if (!d.spots.length) box.innerHTML = '

    You have no spots yet. Get one.

    '; + for (const s of d.spots) box.appendChild(editor('spot', s)); + $('defaults').innerHTML = ''; $('defaults').appendChild(editor('default', { img: d.defaults.img || '', link: d.defaults.link || '', showing: { img: d.defaults.img || '/art/house-line.svg' } })); + $('payouts').innerHTML = d.payouts.length ? '' + d.payouts.map(p => '').join('') + '
    Spot soldWhyPOLTx
    #' + p.spotId + '' + esc(ROLE[p.role] || p.role) + '' + BL.fmtPol(p.amount, 6) + '' + txLink(p.tx) + '
    ' : '

    No payments yet. You are paid when spots sell after yours, or when someone you referred buys.

    '; + $('directs').innerHTML = d.directs.length ? '' + d.directs.map(m => '').join('') + '
    MemberJoinedSpotsPaid spotsPOL paid in
    ' + esc(BL.short(m.address)) + '' + new Date(m.joinedAt).toLocaleDateString() + '' + m.spots + '' + m.paidSpots + '' + BL.fmtPol(m.paidInWei) + '
    ' : '

    Nobody has joined through your link yet.

    '; + } + const txLink = h => c.explorer ? '' + esc(h.slice(0, 10)) + '...' : esc(h.slice(0, 10)) + '...'; + function editor(kind, s) { + const el = document.createElement('div'); el.className = 'spot-ed'; + const head = kind === 'spot' ? '
    Spot #' + s.id + '' + esc(KIND[s.kind] || '') + ' · ' + s.views + ' of ' + s.owed + ' views' + + (s.kind === 3 ? '' : s.delivering ? ' · ' + s.daysLeft + ' days left' : ' · delivery finished') + ' · clicks ' + (s.clicks.organic + s.clicks.gate) + '
    ' : ''; + el.innerHTML = head + '
    ' + + '
    ' + + '
    ' + + '
    '; + const prev = el.querySelector('.lots'); prev.appendChild(BL.tile({ t: 'x', img: (s.showing && s.showing.img) || '/art/house-line.svg', href: s.link || '#' })); + const url = kind === 'spot' ? '/api/my/spot/' + s.id : '/api/my/default'; + el.querySelector('[data-a=save]').onclick = async () => { + const link = el.querySelector('[data-k=link]').value.trim(), img = el.querySelector('[data-k=img]').value.trim(); + const body = { link }; if (img || !String(s.img || '').startsWith('/art/u/')) body.img = img; + const r = await BL.post(url, body); + if (r.error) return BL.status(r.error, 'err'); + BL.status('Saved.', 'ok'); load(); + }; + el.querySelector('input[type=file]').onchange = async ev => { + const f = ev.target.files[0]; if (!f) return; + if (f.size > 150 * 1024) return BL.status('That file is ' + Math.ceil(f.size / 1024) + ' KB. The limit is 150 KB.', 'err'); + const r = await BL.getJSON('/api/my/upload?for=' + (kind === 'spot' ? s.id : 'default'), { method: 'POST', headers: { 'Content-Type': f.type || 'application/octet-stream' }, body: f }); + if (r.error) return BL.status(r.error, 'err'); + BL.status('Image uploaded.', 'ok'); load(); + }; + return el; + } + load(); +})(); diff --git a/public/assets/site.css b/public/assets/site.css new file mode 100644 index 0000000..d09c29e --- /dev/null +++ b/public/assets/site.css @@ -0,0 +1,866 @@ +/* InstantAdPay visual system v4 — built to Marty's picked reference + (Behance 243562211 "ChainLock"): near-black ground, ONE neon-mint accent, + sweeping light-trail hero, glowing icon plates, mockup-anchored sections, + ghost wordmark footer. Discipline over decoration. */ +:root{ + --ground:#040807; --ground2:#071009; + --panel:rgba(16,28,24,.55); --panel-solid:#0b1512; + --line:rgba(84,150,128,.16); --line-strong:rgba(84,150,128,.36); + --ink:#eef7f3; --muted:#8ba69c; + --mint:#43e8c3; --mint-hi:#8ffbe3; --mint-ink:#03211a; + --mint-soft:rgba(67,232,195,.09); --bad:#ff8f7d; + --cyan:#54ccff; --violet:#9d7dff; --amber:#ffb238; + --mono:"Consolas","JetBrains Mono",monospace; + --disp:"Sora","Segoe UI",system-ui,sans-serif; + --radius:18px; + /* 2026-11-01 theme tokens (mirrored from LinkSpin): every surface, text, border and soft fill that used to be a literal + in this file, the page inline styles and the UI-drawing scripts. Light values live in :root[data-theme="light"] at + the end of this file; themehead.js sets data-theme on before the first paint. */ + --mint-deep:#1fb894; --mint-pale:#8ffbe3; + --mint-faint:rgba(67,232,195,.06); --mint-soft-2:rgba(67,232,195,.16); --mint-line:rgba(67,232,195,.38); --mint-line-2:rgba(67,232,195,.6); + --ok:#22c55e; --ok-ink:#04140a; --ok-soft:rgba(34,197,94,.15); --warn:#f0a742; --bad-soft:rgba(255,143,125,.12); + --gold:#ffd15c; --gold-2:#f2c94c; --gold-ink:#1a1206; --gold-soft:rgba(242,201,76,.14); --gold-faint:rgba(242,201,76,.04); --gold-line:rgba(242,201,76,.55); + --amber-soft:rgba(255,178,56,.12); --amber-line:rgba(255,178,56,.4); --amber-ink:#1a1206; + --cyan-soft:rgba(84,204,255,.1); --cyan-line:rgba(84,204,255,.3); --violet-soft:rgba(157,125,255,.12); --violet-line:rgba(157,125,255,.32); + --muted-soft:rgba(139,166,156,.12); --muted-line:rgba(139,166,156,.4); --ink-faint:rgba(255,255,255,.04); --line-soft:rgba(84,150,128,.08); + --ground-soft:rgba(4,8,7,.5); --field-bg:rgba(4,8,7,.65); --nav-bg:rgba(4,8,7,.75); --side-bg:rgba(10,18,15,.92); --pill-bg:rgba(16,28,24,.7); + --panel-grad:linear-gradient(165deg,rgba(24,36,31,.6),rgba(13,19,17,.66)); --panel-grad-deep:linear-gradient(170deg,#0e1c17,#080f0c); --plate-grad:linear-gradient(160deg,#12241e,#0a1411); + --sh-lg:0 30px 80px rgba(0,0,0,.6),0 0 60px rgba(67,232,195,.08); + color-scheme:dark; +} +*{box-sizing:border-box} +[hidden]{display:none!important} /* beats any display: set by a class (chat panel bug) */ +html{scroll-behavior:smooth} +body{margin:0;background:var(--ground);color:var(--ink);font:16px/1.65 "Segoe UI",system-ui,sans-serif;overflow-x:hidden} +/* topo-contour ground texture, very faint */ +body::before{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.5; + background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560' viewBox='0 0 560 560'%3E%3Cg fill='none' stroke='%2343e8c3' stroke-opacity='.05'%3E%3Cpath d='M60 280c40-90 160-130 220-90s60 150 160 150 120-90 120-90'/%3E%3Cpath d='M40 340c60-110 190-160 260-110s60 170 180 170'/%3E%3Cpath d='M20 400c80-130 220-190 300-130s60 190 200 190'/%3E%3Cpath d='M80 220c30-70 130-100 180-70s50 120 130 120 100-70 100-70'/%3E%3C/g%3E%3C/svg%3E")} +a{color:var(--mint);text-decoration:none} +a:hover{text-decoration:underline} +.wrap{max-width:1100px;margin:0 auto;padding:0 22px} +h1,h2,h3{font-family:var(--disp);letter-spacing:-.015em} +/* ── nav: capsule pill ─────────────────────────────── */ +nav{position:sticky;top:0;z-index:10;background:var(--nav-bg);backdrop-filter:blur(16px); + -webkit-backdrop-filter:blur(16px);border-bottom:1px solid var(--line)} +nav .wrap{display:flex;align-items:center;gap:20px;min-height:66px;flex-wrap:wrap;padding-top:8px;padding-bottom:8px} +.logo{font-family:var(--disp);font-weight:800;font-size:20px;color:var(--ink)} +.logo b{color:var(--mint)} +.logo-wrap{display:flex;flex-direction:column;gap:3px;min-width:0} +.byline{display:block;font-size:10.5px;line-height:1.2;letter-spacing:.05em;color:var(--muted);white-space:nowrap} +.byline b{color:var(--ink);font-weight:600} +.bo-side .byline{padding:4px 8px 10px;white-space:normal} +@media (max-width:560px){nav .byline{font-size:9.5px}} +nav .links{display:flex;gap:4px;flex:1;flex-wrap:wrap;background:var(--pill-bg);border:1px solid var(--line); + border-radius:999px;padding:5px 8px;width:fit-content;flex:0 1 auto;margin:0 auto} +nav .links a{color:var(--muted);font-size:13.5px;font-weight:600;padding:7px 14px;border-radius:999px} +nav .links a:hover{color:var(--ink);text-decoration:none} +nav .links a.active{color:var(--mint);background:var(--mint-soft)} +#navWallet{font-size:13px;margin-left:auto} +.rehearsal{background:var(--mint-faint);border-bottom:1px solid var(--line);color:var(--muted); + text-align:center;font-size:12.5px;padding:7px 12px} +.rehearsal b{color:var(--mint)} +/* ── buttons ───────────────────────────────────────── */ +.btn{display:inline-block;background:var(--mint);color:var(--mint-ink);border:0;border-radius:999px; + padding:13px 26px;font-weight:700;font-size:15px;cursor:pointer;font-family:var(--disp); + box-shadow:0 4px 30px rgba(67,232,195,.35);transition:transform .16s ease,box-shadow .16s ease,background .16s ease} +.btn:hover{transform:translateY(-2px);background:var(--mint-hi);box-shadow:0 8px 44px rgba(67,232,195,.5);text-decoration:none} +.btn.sec{background:transparent;color:var(--mint);border:1px solid var(--mint-line-2);box-shadow:none} +.btn.sec:hover{background:var(--mint-soft);box-shadow:0 4px 26px rgba(67,232,195,.2)} +.btn.small{padding:8px 17px;font-size:13px} +/* a third, quieter button for actions that are not the main move (Archive). NOT ".ghost": that is + the giant footer wordmark and it sets color:transparent, which made the Archive button invisible + (Marty, 2026-09-23). */ +.btn.quiet{background:transparent;color:var(--muted);border:1px solid var(--line-strong);box-shadow:none} +.btn.quiet:hover{background:var(--muted-soft);color:var(--ink);border-color:var(--muted);box-shadow:none} +/* the member's campaign actions sat flush against each other on desktop; the mobile rule already + had a gap, this gives the wide layout the same room */ +/* Campaign actions (Marty, 2026-09-23): the column is narrow, so these stack. Left-aligned pills + of different widths read as a ragged edge, and a wrapped label inside a 999px radius turns into + a tall oval. They are a centred, even-width stack with a modest corner instead. */ +.camp-table td.act{text-align:center;vertical-align:middle} +.camp-table td.act .btn{display:block;width:100%;min-width:118px;margin:0 0 8px;border-radius:10px; + text-align:center;line-height:1.25;white-space:normal} +.camp-table td.act .btn:last-child{margin-bottom:0} +.btn:disabled{opacity:.45;cursor:default;transform:none;box-shadow:none} +/* ── segmented control + the Light / Dark / Auto theme switch (2026-11-01): member-area header, Profile pane, admin header ── */ +.seg{display:inline-flex;border:1px solid var(--line-strong);border-radius:999px;overflow:hidden;background:var(--pill-bg);vertical-align:middle} +.seg button{background:transparent;border:0;border-right:1px solid var(--line-strong);padding:6px 12px;font:700 12px var(--disp);color:var(--muted);cursor:pointer;line-height:1.2} +.seg button:last-child{border-right:0} .seg button:hover{color:var(--ink)} .seg button.on{background:var(--mint);color:var(--mint-ink)} +.theme-seg button{min-width:0} +.bo-top .theme-seg{margin-left:auto;flex:none} .bo-top .bo-rehearsal:not([hidden]) + .theme-seg{margin-left:0} +@media (max-width:560px){.bo-top .theme-seg button{padding:6px 9px;font-size:11px}} +/* ── hero: centered, light-trail set-piece ─────────── */ +.hero{position:relative;text-align:center;padding:120px 0 84px;overflow:visible} +.hero h1{font-size:clamp(36px,5.4vw,62px);font-weight:700;line-height:1.08;margin:0 auto 18px;max-width:820px;text-wrap:balance} +.hero h1 em{font-style:normal;color:var(--mint)} +.hero p.lead{color:var(--muted);font-size:17.5px;max-width:600px;margin:0 auto 32px} +.hero p.lead b{color:var(--ink)} +.hero .ctas{display:flex;gap:14px;justify-content:center;flex-wrap:wrap} +/* neon arcs behind the hero text */ +.arcs{position:absolute;inset:-40px 0 0 0;z-index:-1;pointer-events:none} +.arcs svg{width:100%;height:100%;overflow:visible} +.arc{fill:none;stroke:url(#arcGrad);stroke-width:5;stroke-linecap:round;filter:url(#arcGlow)} +.arc2{fill:none;stroke:url(#arcGrad);stroke-width:3;stroke-linecap:round;filter:url(#arcGlow);opacity:.8} +/* falling glow streaks */ +.streak{position:absolute;top:-140px;width:1.5px;height:110px;pointer-events:none; + background:linear-gradient(180deg,transparent,rgba(143,251,227,.8));border-radius:2px;opacity:0} +@media(prefers-reduced-motion:no-preference){ + .streak{animation:fall 7s linear infinite} + @keyframes fall{0%{transform:translateY(0);opacity:0}12%{opacity:.7}55%{opacity:.5}75%{transform:translateY(72vh);opacity:0}100%{transform:translateY(72vh);opacity:0}} +} +/* ── counters ──────────────────────────────────────── */ +.stats{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin:60px auto 0;max-width:900px} +@media(min-width:760px){.stats{grid-template-columns:repeat(4,1fr)}} +.stat{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:18px 12px;text-align:center} +.stat .n{font-family:var(--disp);font-size:30px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--mint)} +.stat .l{font-size:11.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.1em;margin-top:3px} +/* ── sections ──────────────────────────────────────── */ +section{padding:64px 0 8px} +.sectionhead{text-align:center;max-width:640px;margin:0 auto 40px} +.cmp{width:100%;border-collapse:separate;border-spacing:0;font-size:15px;background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden} +.cmp th,.cmp td{padding:13px 16px;border-bottom:1px solid var(--line);vertical-align:top;text-align:left} +.cmp th{font-family:var(--disp);font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)} +.cmp th:last-child,.cmp td:last-child{color:var(--ink);background:var(--mint-faint)} +.cmp td:first-child{font-weight:700;white-space:nowrap} +.cmp td:nth-child(2){color:var(--muted)} +.cmp tr:last-child td{border-bottom:0} +@media (max-width:640px){.cmp td:first-child{white-space:normal}.cmp th,.cmp td{padding:10px 10px;font-size:14px}} +h2{font-size:clamp(26px,3.2vw,36px);font-weight:700;margin:0 0 12px;text-wrap:balance} +.sectionhead p{color:var(--muted);font-size:15.5px;margin:0} +h3{font-size:16.5px;margin:0 0 8px;font-weight:700} +.muted{color:var(--muted)} +.small{font-size:13.5px} +.mono{font-family:var(--mono)} +/* icon-plate feature cards */ +.plates{display:grid;gap:16px;grid-template-columns:1fr} +@media(min-width:760px){.plates{grid-template-columns:1fr 1fr 1fr}} +.platecard{background:var(--panel-grad);border:1px solid var(--line); + border-radius:var(--radius);padding:26px 22px;text-align:center;transition:border-color .2s ease,transform .2s ease} +.platecard:hover{border-color:var(--line-strong);transform:translateY(-4px)} +.plate{width:88px;height:88px;margin:0 auto 18px;border-radius:22px;display:grid;place-items:center; + background:var(--plate-grad);border:1px solid var(--line-strong); + box-shadow:0 0 34px rgba(67,232,195,.15),inset 0 1px 0 rgba(143,251,227,.15)} +.plate svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round} +.platecard p{color:var(--muted);font-size:14px;margin:0} +/* two-col flank layout (icons around a central mockup) */ +.flank{display:grid;gap:26px;align-items:center;grid-template-columns:1fr} +@media(min-width:920px){.flank{grid-template-columns:1fr 1.15fr 1fr}} +.flankitem{margin:0 0 26px} +.flankitem .plate{width:52px;height:52px;border-radius:14px;margin:0 0 12px} +.flankitem .plate svg{width:24px;height:24px} +.flankitem p{color:var(--muted);font-size:13.5px;margin:0} +/* ledger mockup frame */ +.mockup{background:var(--panel-grad-deep);border:1px solid var(--line-strong);border-radius:20px; + box-shadow:var(--sh-lg);overflow:hidden} +.mockup .bar{display:flex;gap:6px;align-items:center;padding:11px 14px;border-bottom:1px solid var(--line)} +.mockup .bar i{width:9px;height:9px;border-radius:50%;background:var(--line-strong);display:inline-block} +.mockup .bar .addr{font-family:var(--mono);font-size:11px;color:var(--muted);margin-left:8px;background:var(--ground-soft); + border-radius:999px;padding:3px 12px} +.mockup .body{padding:6px 0} +.mockup .mrow{display:flex;justify-content:space-between;gap:10px;padding:9px 16px;font-family:var(--mono); + font-size:12px;border-bottom:1px solid var(--line-soft)} +.mockup .mrow span:last-child{color:var(--mint)} +.mockup .mrow.dim span:last-child{color:var(--muted)} +/* 2-col story block: iso illustration + checklist */ +.story{display:grid;gap:36px;align-items:center;grid-template-columns:1fr} +@media(min-width:880px){.story{grid-template-columns:1fr 1fr}} +.checks{list-style:none;padding:0;margin:14px 0 0} +.checks li{padding:7px 0 7px 30px;position:relative;color:var(--muted);font-size:14.5px} +.checks li::before{content:"✓";position:absolute;left:0;top:6px;width:20px;height:20px;border-radius:50%; + background:var(--mint-soft);color:var(--mint);font-size:12px;font-weight:700;display:grid;place-items:center; + border:1px solid var(--mint-line)} +.chips{display:flex;gap:8px;margin:14px 0 4px;flex-wrap:wrap} +.chip-t{border:1px solid var(--line-strong);border-radius:999px;padding:5px 16px;font-size:12.5px;color:var(--muted);font-family:var(--disp);font-weight:600} +.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)} +.iso{filter:drop-shadow(0 24px 50px rgba(0,0,0,.5))} +/* level cycler: light the paying generation */ +#genViz .edge path{stroke:var(--line-strong);transition:stroke .5s ease} +#genViz .node-o{fill:var(--panel-solid);stroke:var(--mint-line);stroke-width:1.3;transition:stroke .5s ease,fill .5s ease} +#genViz .node-d{fill:var(--mint-deep);transition:fill .5s ease} +#genViz[data-lvl="1"] .e1 path,#genViz[data-lvl="2"] .e2 path,#genViz[data-lvl="3"] .e3 path{stroke:var(--mint)} +#genViz[data-lvl="1"] .g1 .node-o,#genViz[data-lvl="2"] .g2 .node-o,#genViz[data-lvl="3"] .g3 .node-o{stroke:var(--mint);fill:var(--mint-soft-2)} +#genViz[data-lvl="1"] .g1 .node-d,#genViz[data-lvl="2"] .g2 .node-d,#genViz[data-lvl="3"] .g3 .node-d{fill:var(--mint)} +.chips button{cursor:pointer;background:transparent;font:inherit} +.chips button.chip-t{border:1px solid var(--line-strong);color:var(--muted)} +.chips button.chip-t.on{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)} +/* pricing tiles: mint discipline */ +.tiles{display:grid;gap:16px;grid-template-columns:repeat(auto-fit,minmax(185px,1fr));align-items:stretch} +.tile{position:relative;background:var(--panel-grad);border:1px solid var(--line); + border-radius:var(--radius);padding:26px 18px;text-align:center;display:flex;flex-direction:column;gap:6px; + transition:transform .2s ease,border-color .2s ease} +.tile:hover{transform:translateY(-5px);border-color:var(--line-strong)} +.tile .name{font-family:var(--disp);font-weight:700;font-size:13px;color:var(--muted);text-transform:uppercase;letter-spacing:.12em} +.tile .price{font-family:var(--disp);font-size:36px;font-weight:700} +.tile .cr{color:var(--mint);font-weight:700;font-size:14.5px} +.tile .bonus{font-size:12px;color:var(--mint-hi)} +.tile .pol{font-family:var(--mono);font-size:12px;color:var(--muted);flex:1} +.tile.hot{border:1px solid var(--mint-line-2);box-shadow:0 0 44px rgba(67,232,195,.14)} +.tile.hot::before{content:"MOST POPULAR";position:absolute;top:-11px;left:50%;transform:translateX(-50%); + background:var(--mint);color:var(--mint-ink);font-family:var(--disp);font-size:10px;font-weight:800; + letter-spacing:.12em;border-radius:999px;padding:4px 14px} +/* split strip: mint opacities */ +.split{display:flex;gap:8px;margin:18px 0} +.split div{border-radius:12px;padding:16px 6px;text-align:center;font-size:13px;font-weight:700;font-family:var(--disp); + border:1px solid var(--line-strong);color:var(--mint)} +.split .s50{flex:5;background:var(--mint-soft-2);box-shadow:0 0 30px rgba(67,232,195,.12)} +.split .s20{flex:2;background:var(--mint-soft)} +.split .s10{flex:1;background:var(--mint-faint)} +.split .sa{flex:2;background:var(--muted-soft);color:var(--muted)} +section[id]{scroll-margin-top:84px} /* anchored menu targets clear the sticky nav */ +/* ticker */ +.ticker{overflow:hidden;contain:layout paint;border-top:1px solid var(--line);border-bottom:1px solid var(--line); + background:var(--mint-faint);white-space:nowrap;padding:10px 0; + -webkit-mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent); + mask-image:linear-gradient(90deg,transparent,#000 6%,#000 94%,transparent)} +.ticker .inner{display:inline-block;font-family:var(--mono);font-size:12.5px;padding-left:100%;animation:tick 120s linear infinite} +.ticker .inner span{margin-right:48px;color:var(--muted)} +.ticker .inner span b{color:var(--mint);font-weight:600} +@keyframes tick{to{transform:translateX(-100%)}} +@media(prefers-reduced-motion:reduce){.ticker .inner{animation:none;padding-left:0}} +/* cards / tables / feed (inner pages) */ +.card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:24px;margin:0 0 16px} +.card:hover{border-color:var(--line-strong)} +.grid{display:grid;gap:16px} +.grid>*,.flank>*,.story>*{min-width:0} /* let grid children shrink so inner tablewraps scroll instead of widening the page */ +@media(min-width:760px){.grid.c3{grid-template-columns:1fr 1fr 1fr}.grid.c2{grid-template-columns:1fr 1fr}} +table{width:100%;border-collapse:collapse;font-size:15px} +th,td{text-align:left;padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle} +th{color:var(--muted);font-size:11.5px;text-transform:uppercase;letter-spacing:.1em;font-family:var(--disp)} +td.num,th.num{font-variant-numeric:tabular-nums} +tr:last-child td{border-bottom:0} +.tablewrap{overflow-x:auto} +.feed{font-family:var(--mono);font-size:13.5px;line-height:1.7} +.feed .row{padding:9px 14px;border-bottom:1px solid var(--line);display:flex;gap:10px;align-items:baseline;flex-wrap:wrap} +.feed .row:first-child{background:var(--mint-soft)} +.feed .row .when{font-family:var(--mono);font-size:11px;color:var(--muted);white-space:nowrap;min-width:92px} +.feed .t-Purchase,.feed .t-AwardPaid{color:var(--mint-hi)} +.feed .t-TierPaid{color:var(--mint)} +.feed .t-AdminPaid{color:var(--muted)} +.feed .tx a{color:var(--muted);font-size:12px} +.badge{display:inline-block;background:var(--mint-soft);color:var(--mint);border:1px solid var(--mint-line); + border-radius:999px;padding:3px 13px;font-size:12px;font-weight:700} +.spend-banner{background:linear-gradient(160deg,var(--gold-soft),var(--gold-faint));border-color:var(--gold-line);text-align:center;padding:22px 20px} +.spend-banner .lbl{font-family:var(--disp);font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--gold-2)} +.spend-banner .big{font-family:var(--disp);font-size:clamp(40px,6vw,64px);font-weight:800;color:var(--gold-2);line-height:1.05;margin:6px 0 4px;font-variant-numeric:tabular-nums} +.spend-banner .big .unit{font-size:20px;font-weight:700;color:var(--ink)} +.spend-banner .sub{color:var(--ink);font-size:15px} +.spend-banner .rates{display:flex;gap:8px 18px;flex-wrap:wrap;justify-content:center;margin-top:12px;font-size:12.5px;color:var(--muted)} +.spend-banner .rates b{color:var(--ink)} +.boot-spin{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:14px;min-height:60vh} +.boot-spin .ring{width:46px;height:46px;border-radius:50%;border:4px solid var(--mint-soft-2);border-top-color:var(--mint);animation:bootspin .9s linear infinite} +@keyframes bootspin{to{transform:rotate(360deg)}} +.bo-top{flex-wrap:wrap} +.ad-strip{flex:1 1 100%;font-size:13.5px;padding:8px 0 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} +.ad-strip a{color:var(--ink)} +.ad-strip b{color:var(--mint)} +.ad-foot{text-align:center} +.pv{border:1px solid var(--line);border-radius:14px;padding:16px 18px;margin:0 0 16px;background:var(--ground-soft)} +.pv-head b{display:block;font-size:18px;margin:4px 0 2px} +.done-big{display:flex;flex-direction:column;align-items:center;gap:6px;padding:26px 16px;text-align:center} +.done-big .tick{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-size:48px;font-weight:800;color:var(--mint-ink);background:var(--mint);box-shadow:0 0 0 10px rgba(67,232,195,.15),0 10px 30px rgba(67,232,195,.35)} +.done-big b{font-family:var(--disp);font-size:22px;margin-top:8px} +.badge.amber{background:var(--muted-soft);border-color:var(--muted-line);color:var(--muted)} +/* faq */ +details{border:1px solid var(--line);border-radius:14px;margin:0 0 10px;background:var(--panel)} +details[open]{border-color:var(--mint-line)} +summary{cursor:pointer;padding:16px 20px;font-weight:700;font-family:var(--disp);font-size:15px;list-style:none} +summary::before{content:"+";color:var(--mint);font-weight:800;margin-right:12px} +details[open] summary::before{content:"−"} +details p{margin:0;padding:0 20px 18px 42px;color:var(--muted);font-size:14.5px} +/* closing cta card */ +.closer{position:relative;display:grid;gap:26px;align-items:center;grid-template-columns:1fr; + padding:44px 36px;border-radius:24px;overflow:hidden;margin:80px 0 0; + background:var(--panel-grad-deep);border:1px solid var(--line-strong)} +@media(min-width:880px){.closer{grid-template-columns:1.2fr .8fr}} +.closer::before{content:"";position:absolute;width:460px;height:460px;right:-140px;top:-260px;border-radius:50%; + background:radial-gradient(circle,rgba(67,232,195,.2),transparent 65%);pointer-events:none} +.closer h2{margin:0 0 12px} +/* footer + ghost wordmark */ +footer{border-top:1px solid var(--line);margin-top:90px;padding:34px 0 0;color:var(--muted);font-size:13.5px;overflow:hidden} +.ghost{font-family:var(--disp);font-weight:800;font-size:clamp(64px,13vw,170px);line-height:.9;text-align:center; + margin:34px 0 -20px;letter-spacing:-.02em;user-select:none; + background:linear-gradient(180deg,rgba(67,232,195,.14),transparent 78%); + -webkit-background-clip:text;background-clip:text;color:transparent;white-space:nowrap} +/* misc */ +#status{position:fixed;left:50%;transform:translateX(-50%);bottom:22px;background:var(--panel-solid); + border:1px solid var(--line-strong);border-radius:14px;padding:13px 22px;font-size:14px;max-width:90vw;z-index:30; + box-shadow:0 12px 40px rgba(0,0,0,.55)} +#status.ok{border-color:var(--mint)} +#status.bad{border-color:var(--bad)} +input,select,textarea{background:var(--field-bg);border:1px solid var(--line-strong);color:var(--ink);border-radius:11px; + padding:11px 14px;font-size:14.5px;font-family:inherit} +input[type=range]{padding:0;border:0;background:transparent;accent-color:var(--mint);height:28px;vertical-align:middle} +input:focus,select:focus,textarea:focus{border-color:var(--mint)} +textarea{resize:vertical;font:inherit} +:focus-visible{outline:2px solid var(--mint);outline-offset:2px} +.hero-note{font-family:var(--mono);font-size:12px;color:var(--muted);margin-top:26px} +/* ── member back-office shell ─────────────────────────── */ +.bo-body{background:var(--ground)} +.bo{display:grid;grid-template-columns:236px 1fr;min-height:100vh} +.bo-side{position:sticky;top:0;height:100vh;overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none;display:flex;flex-direction:column;gap:22px; + padding:22px 16px;background:var(--side-bg);border-right:1px solid var(--line)} +.bo-side .logo{font-size:19px;padding:0 8px} +.bo-menu{display:flex;flex-direction:column;gap:4px} +.bo-menu button{display:flex;align-items:center;gap:11px;background:transparent;border:0;color:var(--muted); + font:600 14px var(--disp);padding:11px 12px;border-radius:11px;cursor:pointer;text-align:left; + border-left:3px solid transparent} +.bo-menu a{display:flex;align-items:center;gap:11px;color:var(--muted);font:600 14px var(--disp);padding:11px 12px;border-radius:11px;text-align:left;border-left:3px solid transparent;text-decoration:none} +.bo-menu a:hover{color:var(--ink);background:var(--mint-faint)} +.bo-menu a svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto} +.bo-menu button svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto} +.bo-menu button:hover{color:var(--ink);background:var(--mint-faint)} +.bo-menu button.on{color:var(--mint);background:var(--mint-soft);border-left-color:var(--mint)} +.bo-links{display:flex;flex-direction:column;gap:2px;padding:14px 12px;border-top:1px solid var(--line)} +.bo-cap{font-family:var(--mono);font-size:10.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--muted);margin-bottom:6px} +.bo-links a{color:var(--muted);font-size:13.5px;padding:5px 0} +.bo-links a:hover{color:var(--ink);text-decoration:none} +.bo-foot{margin-top:auto;padding:14px 12px 0;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:6px;overflow-wrap:anywhere} +.bo-main{min-width:0;display:flex;flex-direction:column} +.bo-side::-webkit-scrollbar{width:0;height:0;display:none} +.bo-pagefoot{margin-top:auto;padding:22px 26px;border-top:1px solid var(--line);display:flex;gap:20px;flex-wrap:wrap;justify-content:center;font-size:13px} +.bo-pagefoot a{color:var(--muted)} +.bo-pagefoot a:hover{color:var(--ink);text-decoration:none} +.bo-top{display:flex;align-items:center;gap:16px;padding:16px 26px;border-bottom:1px solid var(--line); + background:var(--nav-bg);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);position:sticky;top:0;z-index:5} +.bo-top h2{font-size:20px} +#boBurger{display:none;background:transparent;border:1px solid var(--line-strong);color:var(--ink); + border-radius:9px;font-size:17px;padding:5px 11px;cursor:pointer} +.bo-rehearsal{margin-left:auto;color:var(--muted)} +.bo-rehearsal b{color:var(--mint)} +.bo-content{padding:26px;max-width:1060px;width:100%} +@media(max-width:959px){ + .bo{grid-template-columns:1fr} + .bo-side{position:fixed;left:0;top:0;bottom:0;width:250px;z-index:20;transform:translateX(-100%); + transition:transform .22s ease;height:100dvh} + .bo.side-open .bo-side{transform:none;box-shadow:0 0 60px rgba(0,0,0,.6)} + #boBurger{display:block} + .bo-content{padding:18px} +} +/* ── promo banners ── */ +.promo-banners{display:flex;flex-direction:column;gap:10px;margin-top:12px} +.pb-note{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 14px;padding:10px 16px 12px;font-size:13.5px;color:var(--muted);border-bottom:1px solid var(--line)} +.pb-note b.mono{color:var(--ink);font-family:var(--mono);font-size:12.5px;word-break:break-all} +.pb-acc{margin:0} +.pb-acc>summary{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:13px 16px;font-size:14.5px} +.pb-acc>summary::before{content:none} +.pb-acc>summary>span:first-child::before{content:"+";color:var(--mint);font-weight:800;margin-right:10px} +.pb-acc[open]>summary>span:first-child::before{content:"−"} +.pb-acc .pb-count{font-family:var(--mono);font-size:11px;color:var(--muted);white-space:nowrap} +.pb-acc .pb-grid{display:flex;flex-direction:column;gap:14px;padding:0 16px 16px} +.pb-item img{max-width:100%;border-radius:8px;border:1px solid var(--line-strong);display:block} +.pb-item .pb-row{display:flex;gap:10px;align-items:center;margin-top:6px;flex-wrap:wrap} +.pb-item .pb-size{font-family:var(--mono);font-size:11px;color:var(--muted)} +/* ── featured day-slot picker ── */ +.feat-days{display:flex;gap:8px;flex-wrap:wrap} +.feat-day{flex:0 0 auto;min-width:82px;padding:8px 10px;border:1px solid var(--line-strong);border-radius:10px; + background:var(--panel);cursor:pointer;text-align:center} +.feat-day.on{border-color:var(--mint);box-shadow:0 0 0 1px var(--mint)} +.feat-day.full{opacity:.45;cursor:not-allowed} +.feat-day .fd-day{font-weight:700;font-size:12px} +.feat-day .fd-occ{font-family:var(--mono);font-size:11px;color:var(--muted)} +.feat-day.open2 .fd-occ{color:var(--mint)} +/* ── featured rotation strip ── */ +.feat-top{max-width:760px;margin:16px auto;border:1px solid var(--amber-line)} +.feat-strip{display:flex;justify-content:center;margin-top:10px} +.feat-strip a{max-width:728px;width:100%;display:flex;justify-content:space-between;gap:10px;padding:11px 14px;border-radius:10px; + background:var(--panel);border:1px solid var(--amber);color:var(--ink);text-decoration:none;font-weight:600} +.feat-strip a:hover{border-color:var(--gold);box-shadow:0 0 0 1px var(--amber-line)} +.feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap} +.feat-strip .by{font-size:12px;color:var(--muted);font-weight:500;white-space:nowrap} +/* ── achievement badges ── */ +.badges{display:flex;gap:18px;flex-wrap:wrap;margin-top:12px} +.badge-a{display:flex;flex-direction:column;align-items:center;gap:6px;width:150px;text-align:center} +.badge-a .badge-img{width:150px;height:150px;border-radius:14px;object-fit:cover;border:1px solid var(--line-strong)} +.badge-a.locked .badge-img{filter:grayscale(.85) brightness(.5);opacity:.7} +.badge-a .medal{width:76px;height:76px;border-radius:50%;display:grid;place-items:center;position:relative; + background:radial-gradient(circle at 50% 35%,var(--mint-soft-2),var(--panel-solid)); + border:2px solid var(--mint);box-shadow:0 0 18px rgba(67,232,195,.3)} +.badge-a.locked .medal{background:var(--muted-soft);border-color:var(--line-strong);box-shadow:none;filter:grayscale(1);opacity:.5} +.badge-a .medal svg{width:38px;height:38px;stroke:var(--mint);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round} +.badge-a.locked .medal svg{stroke:var(--muted)} +.badge-a .bl{font-size:12px;font-weight:700;line-height:1.2} +.badge-a .bs{font-size:10.5px;color:var(--muted)} +.badge-a .share{font-size:11px;color:var(--mint);cursor:pointer;background:none;border:0;padding:0;text-decoration:underline} +/* ── "Your next move": milestone stepper card ── */ +.next-card{position:relative;overflow:hidden;border-color:var(--mint-line)} +.next-card::before{content:"";position:absolute;inset:0;pointer-events:none;background: + radial-gradient(420px 150px at 10% 0%,rgba(67,232,195,.12),transparent 70%), + radial-gradient(360px 130px at 90% 100%,rgba(157,125,255,.09),transparent 70%)} +.nc-head{display:flex;gap:14px;align-items:flex-start;position:relative} +.nc-head .pl{flex:0 0 auto;width:44px;height:44px;border-radius:12px;display:grid;place-items:center; + background:var(--mint-soft-2);border:1px solid var(--mint-line)} +.nc-head .pl svg{width:20px;height:20px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round} +.nc-steps{display:flex;margin-top:20px;position:relative;flex-wrap:wrap;row-gap:14px} +.nc-step{flex:1;min-width:88px;display:flex;flex-direction:column;align-items:center;gap:7px; + position:relative;text-align:center;padding:0 4px} +.nc-step::before{content:"";position:absolute;top:13px;left:-50%;width:100%;height:2px;background:var(--line-strong)} +.nc-step:first-child::before{display:none} +.nc-step.hit::before{background:linear-gradient(90deg,var(--mint),var(--mint-hi))} +.nc-step .dot{width:27px;height:27px;border-radius:50%;display:grid;place-items:center;font-size:12px; + font-weight:800;background:var(--panel-solid);border:2px solid var(--line-strong);color:var(--muted); + position:relative;z-index:1} +.nc-step.hit .dot{background:var(--mint);border-color:var(--mint);color:var(--mint-ink); + box-shadow:0 0 14px rgba(67,232,195,.35)} +.nc-step.cur .dot{border-color:var(--amber);color:var(--amber);box-shadow:0 0 12px rgba(255,178,56,.4)} +.nc-step .lb{font-size:12px;font-weight:700;line-height:1.25} +.nc-step .lb i{display:block;font-style:normal;font-weight:500;font-size:10.5px;color:var(--muted);margin-top:2px} +.nc-step.cur .lb{color:var(--amber)} +/* ── overview v3: stat cards w/ plates+chips, hand-rolled charts ── */ +.statx{display:flex;gap:14px;align-items:flex-start;background:var(--panel);border:1px solid var(--line); + border-radius:var(--radius);padding:18px;position:relative;overflow:hidden} +.statx .pl{flex:0 0 auto;width:46px;height:46px;border-radius:13px;display:grid;place-items:center; + background:var(--mint-soft);border:1px solid var(--mint-line)} +.statx .pl svg{width:22px;height:22px;stroke:var(--mint);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round} +.statx.c-cyan .pl{background:var(--cyan-soft);border-color:var(--cyan-line)} +.statx.c-cyan .pl svg{stroke:var(--cyan)} +.statx.c-violet .pl{background:var(--violet-soft);border-color:var(--violet-line)} +.statx.c-violet .pl svg{stroke:var(--violet)} +.statx.c-amber .pl{background:var(--amber-soft);border-color:var(--amber-line)} +.statx.c-amber .pl svg{stroke:var(--amber)} +.statx .nv{font-family:var(--disp);font-size:26px;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.1} +.statx .lb{font-size:12px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-top:2px} +.chip{display:inline-block;margin-top:7px;font-size:11.5px;font-weight:700;border-radius:999px;padding:2px 10px; + background:var(--mint-soft);color:var(--mint)} +.chip.flat{background:var(--muted-soft);color:var(--muted)} +.chip.warm{background:var(--amber-soft);color:var(--amber)} +.card-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px} +.card-head .sub{font-size:12px;color:var(--muted)} +/* dismiss on the announcement cards at the top of the Overview (Marty, 2026-09-22): + hides the card for the rest of this browser session, back at the next sign-in */ +.card-x{flex:none;align-self:center;margin:-4px -6px 0 2px;width:28px;height:28px;border-radius:50%; + border:1px solid var(--line);background:transparent;color:var(--muted);font-size:19px;line-height:1; + cursor:pointer;display:grid;place-items:center;padding:0} +.card-x:hover{border-color:var(--line-strong);color:var(--ink);background:var(--muted-soft)} +/* bar chart (divs, real data) */ +.barchart{display:flex;align-items:flex-end;gap:6px;height:120px;margin-top:14px} +.barchart .bar{flex:1;min-width:6px;background:linear-gradient(180deg,var(--mint),var(--mint-line)); + border-radius:5px 5px 2px 2px;position:relative;transition:height .5s ease} +.barchart .bar.alt{background:linear-gradient(180deg,var(--violet),var(--violet-line))} +.barchart .bar:hover::after{content:attr(data-v);position:absolute;bottom:calc(100% + 4px);left:50%; + transform:translateX(-50%);background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:7px; + padding:2px 8px;font-family:var(--mono);font-size:11px;white-space:nowrap;z-index:3} +.barchart .bar.empty{background:var(--muted-soft);height:4px!important} +.chart-x{display:flex;gap:6px;margin-top:6px} +.chart-x span{flex:1;text-align:center;font-family:var(--mono);font-size:10px;color:var(--muted);overflow:hidden;white-space:nowrap} +/* donut + ring (SVG) */ +.donut-wrap{display:flex;gap:22px;align-items:center;margin-top:10px;flex-wrap:wrap} +.donut-legend{display:flex;flex-direction:column;gap:8px;font-size:13px} +.donut-legend i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:8px} +.donut-center{font-family:var(--disp);font-weight:800} +/* ── login ad interstitial: sponsor opens in a new tab, timer runs here ── */ +.lgate{position:fixed;inset:0;z-index:90;display:flex;flex-direction:column;background:var(--ground)} +.lgate-bar{display:flex;align-items:center;gap:14px;padding:10px 16px;background:var(--panel-solid); + border-bottom:1px solid var(--line);flex-wrap:wrap} +.lg-brand{font-family:var(--disp);font-weight:800;font-size:15px;white-space:nowrap} +.lg-brand em{color:var(--mint);font-style:normal} +.lgate-note{flex:1;min-width:140px} +.lg-timer{font-weight:700;font-size:14px;border:1px solid var(--line-strong);border-radius:999px; + padding:5px 14px;min-width:150px;text-align:center} +.lg-timer.done{color:var(--mint);border-color:var(--mint)} +.lgate-body{flex:1;display:grid;place-items:center;padding:24px;overflow:auto} +.lgate-card{max-width:560px;text-align:center} +.lgate-card img{max-width:100%;max-height:50vh;border-radius:12px;border:1px solid var(--line-strong)} +#lgCreative .lg-linkcard{display:inline-block;background:var(--panel);border:1px solid var(--line-strong); + border-radius:14px;padding:22px 28px;font-family:var(--disp);font-weight:700;font-size:18px;overflow-wrap:anywhere} +/* ── welcome tour (gauntlet): framed line sites + countdown ── */ +.lgate-frame{flex:1;border:0;width:100%;background:#fff;min-height:0} +.ggmeta{padding:8px 16px;background:var(--panel-solid);border-bottom:1px solid var(--line)} +/* ── bio header (wall/profile page) ── */ +.bio-head{display:flex;gap:22px;align-items:center;flex-wrap:wrap;padding:8px 0 4px} +.bio-avatar{width:96px;height:96px;border-radius:50%;object-fit:cover;border:2px solid var(--mint);flex:0 0 auto} +.bio-badge{width:74px;height:74px;border-radius:12px;object-fit:cover;flex:0 0 auto;border:1px solid var(--line-strong)} +.btn.disabled{opacity:.45;pointer-events:none;filter:grayscale(.3)} +.bio-meta{flex:1;min-width:220px} +.bio-socials{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px} +.bio-video{margin:14px auto 8px;max-width:760px} +@media (max-width:720px){.bio-head{flex-direction:column;align-items:center;text-align:center;gap:14px}.bio-head .bio-avatar,.bio-head .bio-badge{margin:0 auto}.bio-meta{min-width:0;width:100%}.bio-socials{justify-content:center}.bio-qr{margin:4px auto 0}.bio-video .eyebrow{text-align:center}} +.bio-video iframe,.bio-video video{width:100%;aspect-ratio:16/9;border:1px solid var(--line-strong);border-radius:16px;background:#000;display:block} +.bio-socials a{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--mint);border:1px solid var(--line-strong); + border-radius:999px;padding:4px 12px 4px 9px;text-decoration:none} +.bio-socials a svg{flex:0 0 auto} +.bio-socials a:hover{border-color:var(--mint)} +.bio-qr{flex:0 0 auto;background:var(--panel);border:1px solid var(--line-strong);border-radius:14px;padding:10px} +.bio-qr img{display:block;border-radius:8px;background:#eef7f3} +/* ── wall page ── */ +.wall-card{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:16px;text-align:center} +.wall-card img{max-width:100%;border-radius:10px;border:1px solid var(--line-strong)} +.wall-pos{font-family:var(--mono);font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.08em;margin-bottom:8px} +.wc-creative img{max-width:100%;border-radius:10px;border:1px solid var(--line-strong)} +.wc-action{margin-top:10px;min-height:32px;display:flex;justify-content:center;align-items:center} +.wc-check{color:var(--mint);font-weight:800;border:1px solid var(--mint);border-radius:999px;padding:4px 14px; + box-shadow:0 0 14px rgba(67,232,195,.3)} +.wc-timer{color:var(--amber);font-weight:700;font-family:var(--mono);font-size:13px} +/* ── modal (sponsor message) ── */ +.modal-back{position:fixed;inset:0;z-index:100;background:rgba(2,6,5,.72);display:flex;align-items:center;justify-content:center;padding:20px} +.modal-card{background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:var(--radius); + padding:24px;max-width:520px;width:100%;box-shadow:0 20px 60px rgba(0,0,0,.5)} +/* ── downline lineage list ── */ +.lin-lvl{margin:10px 0} +.lin-lvl>.cap{display:inline-block;font-size:13px;font-weight:800;text-transform:uppercase;letter-spacing:.06em; + color:var(--mint);background:var(--mint-soft);border:1px solid var(--line-strong);border-radius:8px;padding:4px 10px;margin-bottom:10px} +.lin-row{display:grid;grid-template-columns:minmax(110px,1.2fr) minmax(0,2fr) auto auto auto auto;gap:6px 14px; + align-items:center;padding:9px 0;border-bottom:1px solid var(--line)} +.lin-row .nm{font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.lin-row .em{font-size:12px;color:var(--mint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.lin-row .id{font-family:var(--mono);font-size:11px;color:var(--muted)} +.lin-row .sp{display:block;font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis} .lin-row .em{min-width:0} +.lin-row .dt{font-size:12px;color:var(--muted);text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap} +.lin-row .chat-msg-btn{justify-self:end} +.lin-row .sp.wrap{white-space:normal;line-height:1.7} +/* list toolbar: sort + filter chips shared by the tank, roster and downline (2026-09-29) */ +.lst-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:4px 0 10px;padding:8px 10px;border:1px solid var(--line);border-radius:12px;background:var(--ink-faint)} +.lst-q{flex:1 1 100%;min-width:0;background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:6px 10px;font-size:13px} +.lst-sort{font-size:12px;color:var(--muted);display:inline-flex;align-items:center;gap:6px} +.lst-sort select{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:4px 8px;font-size:12.5px} +.lst-dir{background:transparent;color:var(--ink);border:1px solid var(--line-strong);border-radius:8px;padding:4px 9px;font-size:12px;cursor:pointer;white-space:nowrap} +.lst-chips{display:flex;flex-wrap:wrap;gap:6px} +.lst-chip{font-size:12px;color:var(--muted);background:transparent;border:1px solid var(--line);border-radius:999px;padding:3px 10px;cursor:pointer;white-space:nowrap} +.lst-chip.on{border-color:var(--mint);color:var(--ink);background:var(--mint-soft)} +.lst-n{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums} +.roster-em{color:var(--mint);word-break:break-all;margin-top:2px} +.lst-copy{background:transparent;color:var(--muted);border:1px solid var(--line);border-radius:6px;padding:0 6px;font-size:11px;cursor:pointer;margin-left:4px} +.lchip{display:inline-block;font-size:11.5px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:1px 8px;white-space:nowrap;vertical-align:middle} +.lchip.on{border-color:var(--mint-line);color:var(--ink)} .lchip.warn{border-color:var(--gold-line);color:var(--gold)} +.roster td:nth-child(3){white-space:normal;line-height:1.8} +.lin-row .lin-act-btn{justify-self:end;white-space:nowrap} +.lin-act{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 10px 10px;margin:-1px 0 6px;border-bottom:1px solid var(--line);background:var(--ink-faint);border-radius:0 0 10px 10px} +.lin-chip{font-size:12px;color:var(--muted);border:1px solid var(--line);border-radius:999px;padding:3px 10px;white-space:nowrap} .lin-chip b{font-weight:600;color:var(--ink);margin-right:5px} .lin-chip.on{border-color:var(--mint-line);color:var(--ink)} .lin-chip.warn{border-color:var(--gold-line)} +.lin-verdict{margin-left:auto;font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)} .lin-verdict.on{color:var(--mint)} +@media (max-width:560px){.lin-chip{white-space:normal}.lin-act{padding:8px 4px 10px}} +@media (max-width:560px){.lin-row{grid-template-columns:1fr auto;gap:2px 10px} + .lin-row .em{grid-column:1/2}.lin-row .dt{grid-column:1/2;text-align:left}.lin-row .chat-msg-btn{grid-row:1/3;grid-column:2} + .lin-row .lin-act-btn{grid-column:2;grid-row:3/5}.lin-row:not(:has(.chat-msg-btn)) .lin-act-btn{grid-row:1/3}} +/* ── solo composer: toolbar + contenteditable editor ── */ +.ed-bar{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:8px} +.ed-bar button{background:var(--panel);color:var(--ink);border:1px solid var(--line-strong);border-radius:8px; + padding:5px 11px;font-size:12.5px;cursor:pointer} +.ed-bar button:hover,.ed-bar button:focus-visible{border-color:var(--mint);outline:none} +.ed-body{background:var(--field-bg);border:1px solid var(--line-strong);border-radius:11px; + min-height:180px;padding:12px 14px;outline:none;overflow-wrap:anywhere} +.ed-body:focus{border-color:var(--mint)} +.ed-body:empty::before{content:attr(data-ph);color:var(--muted)} +.ed-body img,.ed-body video,.ib-rich img,.ib-rich video{max-width:100%;border-radius:10px;margin:6px 0;display:block} +.ed-sep{width:1px;align-self:stretch;background:var(--line-strong);margin:2px 3px} +.ed-bar sub{font-size:9px} +textarea.ed-body{width:100%;min-height:180px;resize:vertical} +.ed-body a,.ib-rich a{color:var(--mint)} +.ed-body h3,.ib-rich h3,.ed-body h4,.ib-rich h4{margin:.5em 0 .3em} +.ed-media{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:10px 0 0} +/* ── earn sub-tabs (Watch ads | Inbox) ── */ +.subtabs{display:flex;gap:6px;margin:0 0 16px;border-bottom:1px solid var(--line);padding-bottom:0} +.subtab{background:none;border:0;border-bottom:2px solid transparent;color:var(--muted); + font:inherit;font-weight:700;font-size:14px;padding:8px 14px;cursor:pointer;margin-bottom:-1px; + display:inline-flex;align-items:center;gap:7px} +.subtab:hover{color:var(--ink)} +.subtab.on{color:var(--mint);border-bottom-color:var(--mint)} +.subtab .pill{position:static} +/* ── solo-ads inbox ── */ +.bo-menu .pill{margin-left:auto;background:var(--amber);color:var(--amber-ink);font-size:11px;font-weight:800; + border-radius:999px;padding:1px 8px;line-height:1.5} +.ib-row{display:flex;gap:10px;align-items:baseline;padding:11px 6px;border-bottom:1px solid var(--line); + cursor:pointer;flex-wrap:wrap} +.ib-row:hover{background:var(--mint-faint)} +.ib-row .sub{font-weight:700;flex:1;min-width:160px;overflow-wrap:anywhere} +.ib-row.unread .sub{color:var(--mint)} +.ib-row .from,.ib-row .when{font-size:12px;color:var(--muted);white-space:nowrap} +.cta-need{box-shadow:0 0 0 2px var(--amber),0 0 16px rgba(255,178,56,.4)!important;animation:ctapulse 1.6s ease-in-out infinite} +@keyframes ctapulse{50%{box-shadow:0 0 0 2px var(--amber),0 0 24px rgba(255,178,56,.65)!important}} +@media (prefers-reduced-motion:reduce){.cta-need{animation:none}} +/* ── back-office accent family: green leads, cyan/violet/amber season the cards ── */ +.bo .stats .stat:nth-child(2) .n{color:var(--cyan)} +.bo .stats .stat:nth-child(2)::before{background:linear-gradient(90deg,transparent,var(--cyan),transparent)} +.bo .stats .stat:nth-child(3) .n{color:var(--violet)} +.bo .stats .stat:nth-child(3)::before{background:linear-gradient(90deg,transparent,var(--violet),transparent)} +.bo .stats .stat:nth-child(4) .n{color:var(--amber)} +.bo .stats .stat:nth-child(4)::before{background:linear-gradient(90deg,transparent,var(--amber),transparent)} +.bo .card h3::before{content:"";display:inline-block;width:9px;height:9px;border-radius:2.5px; + background:var(--mint);margin-right:10px;transform:rotate(45deg);vertical-align:1px} +#pane-line .card h3::before{background:var(--cyan)} +#pane-buy .card h3::before,#pane-campaigns .card h3::before{background:var(--amber)} +#pane-earn .card h3::before,#pane-earnings .card h3::before{background:var(--violet)} +#pane-promo .card h3::before{background:var(--cyan)} +#pane-wallet .card h3::before,#pane-profile .card h3::before{background:var(--mint)} +.bo .card{background:var(--panel-grad)} +#pane-line .qualbar,#nextCard{border-left:3px solid var(--mint-line)} +.promo-block{background:var(--ground-soft);border:1px solid var(--line);border-radius:12px; + padding:14px 16px;margin:0 0 12px;font-size:13.5px;line-height:1.6;white-space:pre-wrap} +.promo-block .btn{margin-top:10px} +/* back-office polish: pane transitions, quick actions */ +@media(prefers-reduced-motion:no-preference){ + .pane:not([hidden]){animation:panein .25s ease} + @keyframes panein{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}} +} +.qa{display:flex;flex-direction:column;gap:8px} +.qa button{display:flex;align-items:center;gap:10px;background:var(--mint-faint);border:1px solid var(--line); + color:var(--ink);font:600 14px var(--disp);padding:11px 14px;border-radius:11px;cursor:pointer;text-align:left; + transition:border-color .15s ease,background .15s ease} +.qa button:hover{border-color:var(--mint);background:var(--mint-soft)} +/* member sub-navigation */ +.subnav{display:flex;gap:6px;flex-wrap:wrap;background:var(--pill-bg);border:1px solid var(--line); + border-radius:999px;padding:6px 8px;width:fit-content;margin:0 0 22px} +.subnav button{background:transparent;border:0;color:var(--muted);font:600 13.5px var(--disp); + padding:8px 16px;border-radius:999px;cursor:pointer} +.subnav button:hover{color:var(--ink)} +.subnav button.on{color:var(--mint-ink);background:var(--mint)} +/* member dashboard: qualification progress + roster */ +.qualbar{position:relative;height:12px;border-radius:999px;background:var(--ground-soft);border:1px solid var(--line-strong); + margin:26px 0 30px;max-width:520px} +.qualbar #qualFill{height:100%;border-radius:999px;background:linear-gradient(90deg,var(--mint),var(--mint-hi)); + box-shadow:0 0 18px rgba(67,232,195,.4);width:0;transition:width .6s ease} +.qb-mark{position:absolute;top:16px;transform:translateX(-50%);font-family:var(--mono);font-size:11px;color:var(--muted);white-space:nowrap} +.qb-mark.end{left:auto!important;right:0;transform:none} /* keeps the last label inside the card on mobile */ +#inviteLine,#pitchPreview{overflow-wrap:anywhere} +img{max-width:100%} +.roster{width:100%;border-collapse:collapse;font-size:13.5px} +.roster td{padding:8px 10px;border-bottom:1px solid var(--line)} +.roster td:first-child{font-family:var(--mono)} +.roster tr:last-child td{border-bottom:0} +/* chat widget */ +#iapChatBtn{position:fixed;right:20px;bottom:20px;z-index:40;width:56px;height:56px;border-radius:50%; + border:0;background:var(--mint);color:var(--mint-ink);font-size:24px;cursor:pointer; + box-shadow:0 8px 30px rgba(67,232,195,.4)} +#iapChatBtn:hover{transform:scale(1.06)} +#iapChatPanel{position:fixed;right:20px;bottom:88px;z-index:40;width:min(360px,calc(100vw - 40px)); + background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:18px;overflow:hidden; + box-shadow:0 24px 70px rgba(0,0,0,.65);display:flex;flex-direction:column} +.ch-head{padding:14px 16px;border-bottom:1px solid var(--line);font-family:var(--disp);position:relative} +.ch-head .ch-sub{display:block;font-size:12px;color:var(--muted);font-family:"Segoe UI",system-ui,sans-serif} +#iapChatClose{position:absolute;right:10px;top:10px;background:transparent;border:0;color:var(--muted); + font-size:22px;cursor:pointer;line-height:1} +.ch-msgs{padding:14px;overflow-y:auto;max-height:340px;display:flex;flex-direction:column;gap:10px} +.ch-m{border-radius:12px;padding:9px 13px;font-size:13.5px;line-height:1.5;max-width:86%} +.ch-m.bot{background:var(--mint-soft);border:1px solid var(--mint-line);align-self:flex-start} +.ch-m.me{background:var(--muted-soft);border:1px solid var(--line);align-self:flex-end} +.ch-m a{word-break:break-all} +.ch-input{display:flex;gap:8px;padding:11px;border-top:1px solid var(--line)} +.ch-input input{flex:1;min-width:0} +.ch-input button{background:var(--mint);color:var(--mint-ink);border:0;border-radius:10px;padding:0 16px; + font-weight:700;cursor:pointer;font-family:var(--disp)} +@media(prefers-reduced-motion:no-preference){ + .feed .row:first-child{animation:landed .9s ease} + @keyframes landed{from{background:var(--mint-soft-2)}to{background:var(--mint-soft)}} +} + +/* ── Sponsor chat: FAB, slide-in drawer, threads, bubbles, presence ── */ +.bo-chat{display:flex;align-items:center} +.bo-chat .pill{margin-left:auto;min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--mint); + color:var(--mint-ink);font:700 12px/20px var(--disp);text-align:center} +.chat-drawer{position:fixed;right:0;top:0;bottom:0;width:380px;max-width:92vw;z-index:70;display:flex;flex-direction:column; + background:var(--panel-solid);border-left:1px solid var(--line-strong);box-shadow:-16px 0 40px rgba(0,0,0,.45); + transform:translateX(0);animation:chatIn .16s ease} +@keyframes chatIn{from{transform:translateX(24px);opacity:.4}to{transform:translateX(0);opacity:1}} +@media (prefers-reduced-motion:reduce){.chat-drawer{animation:none}.chat-fab{transition:none}} +.chat-head{display:flex;align-items:center;gap:8px;padding:12px 12px;border-bottom:1px solid var(--line)} +.chat-who{display:flex;flex-direction:column;line-height:1.15;min-width:0;flex:1} +.chat-who b{font:700 15px var(--disp);white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.chat-icon{background:none;border:0;color:var(--muted);font-size:26px;line-height:1;cursor:pointer;padding:0 6px} +.chat-icon:hover{color:var(--ink)} +.pres-dot{width:9px;height:9px;border-radius:50%;background:var(--muted);flex:0 0 auto} +.pres-dot.on{background:var(--mint);box-shadow:0 0 8px var(--mint)} +.chat-threads{flex:1;overflow:auto} +.chat-thread{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--line);cursor:pointer} +.chat-thread:hover{background:var(--mint-soft)} +.chat-thread .ct-main{flex:1;min-width:0} +.chat-thread .ct-name{font:700 14px var(--disp)} +.chat-thread .ct-last{color:var(--muted);font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.chat-thread .ct-un{min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--mint);color:var(--mint-ink); + font:700 12px/20px var(--disp);text-align:center} +.chat-empty{padding:22px 16px;color:var(--muted);font-size:14px} +.chat-convo{flex:1;display:flex;flex-direction:column;min-height:0} +.chat-msgs{flex:1;overflow:auto;padding:14px;display:flex;flex-direction:column;gap:8px} +.cbub{max-width:78%;padding:9px 12px;border-radius:14px;font-size:14px;line-height:1.4;white-space:pre-wrap;word-wrap:break-word} +.cbub.them{align-self:flex-start;background:var(--panel);border:1px solid var(--line);border-bottom-left-radius:4px} +.cbub.me{align-self:flex-end;background:var(--mint);color:var(--mint-ink);border-bottom-right-radius:4px} +.cbub .ct-time{display:block;margin-top:4px;font-size:10.5px;opacity:.6} +.chat-day{align-self:center;color:var(--muted);font-size:11px;text-transform:uppercase;letter-spacing:.05em;margin:6px 0} +.chat-banner{padding:8px 14px;border-top:1px solid var(--line);color:var(--muted);font-size:12.5px;background:var(--ground2)} +.chat-compose{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line);align-items:flex-end} +.chat-compose textarea{flex:1;resize:vertical;min-height:44px;max-height:45vh;line-height:1.45;background:var(--ground2);border:1px solid var(--line); + border-radius:12px;color:var(--ink);padding:9px 11px;font:400 14px var(--disp)} +.chat-compose .btn{padding:9px 16px} +.chat-msg-btn{margin-left:auto;font-size:12px;padding:3px 10px} +.switch{display:flex;align-items:center;gap:10px;cursor:pointer;font-size:14px} +.switch input{width:18px;height:18px;accent-color:var(--mint)} + +/* ── Overview line tree ── */ +.line-tree{margin-top:6px} +.lt-top{margin-left:26px} +.lt-you{display:inline-block;background:var(--mint);color:var(--mint-ink);font-weight:800;padding:6px 18px;border-radius:999px;font-size:13px} +.lt-stem{height:12px;border-left:2px solid var(--line-strong);width:0;margin:0 0 6px 30px} +.lt-row{display:flex;align-items:center;gap:10px;margin:7px 0} +.lt-cap{font:700 11px var(--mono);color:var(--muted);width:22px;flex:0 0 auto} +.lt-nodes{display:flex;gap:8px;flex-wrap:wrap} +.lt-node{background:var(--panel);border:1px solid var(--line-strong);border-radius:10px;padding:6px 12px;font-size:13px;font-weight:600;white-space:nowrap} +.lt-node.deep{color:var(--muted)} +.lt-node.qualified{border-color:var(--amber);color:var(--gold);box-shadow:0 0 0 1px var(--amber-line)} +.lt-node.open{border-style:dashed;color:var(--muted);background:transparent} +.lt-node .lt-n{display:inline-block;font-style:normal;font-size:10px;line-height:16px;min-width:16px;text-align:center;border-radius:8px;background:var(--amber-soft);color:var(--gold);margin-left:6px;padding:0 4px;font-variant-numeric:tabular-nums} + +.sh-report{display:block;text-align:center;margin-top:10px;color:var(--muted);font-size:12px} +.sh-report:hover{color:var(--ink)} + +/* ── promo tools (2026-09-09) ── */ +.promo-strip{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:16px 20px} +.angle-list{display:flex;flex-direction:column;gap:8px} +.hp-field{position:absolute;left:-9999px;top:auto;width:1px;height:1px;opacity:0;overflow:hidden} +.hbars{display:flex;align-items:flex-end;gap:2px;height:20px;margin-top:6px;width:120px} +.hbars i{flex:1 1 0;background:var(--mint);opacity:.75;border-radius:1px 1px 0 0;min-width:2px} +.hbars i:hover{opacity:1} +.icon-check{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 12px} +.icon-check .ic-btn{font-size:26px;line-height:1;padding:10px 14px;border-radius:12px;border:1px solid var(--line-strong);background:var(--panel);cursor:pointer} +.icon-check .ic-btn:hover{border-color:var(--mint)} +.angle-row.pb-acc>summary{padding:12px 14px;font-size:14.5px} +.angle-row .angle-body{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;padding:0 14px 14px} +.angle-row .angle-txt{flex:1 1 320px;min-width:0} +.angle-name{font-family:var(--disp);font-weight:700;font-size:15px} +.angle-hook{color:var(--mint);font-size:13px;font-weight:500} +.angle-tag{font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);border:1px solid var(--line-strong);border-radius:999px;padding:1px 7px} +.angle-url{overflow-wrap:anywhere;margin-top:4px;display:block;color:var(--mint);text-decoration:none} +.angle-url:hover{text-decoration:underline} +.angle-btns{display:flex;gap:8px;flex-wrap:wrap} +.angle-btns .btn{margin-top:0} +.promo-pills{margin:4px 0 14px} +.promo-block .pb-head{display:flex;gap:8px;align-items:center;margin-bottom:8px;font-size:13.5px} +.promo-block .pb-net{font-family:var(--mono);font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--mint)} +.promo-block .pb-text{white-space:pre-wrap;font-size:14.5px;line-height:1.5} +.promo-block .pb-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px} +.promo-block .pb-actions .btn{margin-top:0} +.promo-bv{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-top:16px;padding:14px 16px;border:1px dashed var(--line-strong);border-radius:12px} +.promo-bv b{font-family:var(--disp)} +.obj-wrap{display:flex;flex-direction:column;gap:8px} +.obj{border:1px solid var(--line);border-radius:12px;background:var(--ground-soft)} +.obj summary{cursor:pointer;padding:12px 16px;font-family:var(--disp);font-weight:700;font-size:15px;list-style:none;display:flex;justify-content:space-between;gap:10px} +.obj summary::after{content:"+";color:var(--mint);font-weight:800} +.obj[open] summary::after{content:"–"} +.obj summary::-webkit-details-marker{display:none} +.obj summary::marker{content:""} +.obj summary{text-align:left} +.obj-body{padding:0 16px 14px;display:grid;gap:12px} +.obj .lab{display:inline-block;font-family:var(--mono);font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:var(--mint);margin-bottom:4px} +.obj .lab-say{color:var(--amber)} +.obj-truth p{margin:0;font-size:14.5px;color:var(--ink)} +.obj-say{margin:0} + +.lin-row .earn{font-family:var(--mono);font-size:12px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums} +.lin-row .earn.on{color:var(--mint);font-weight:700} + +.wo-slot{border:1px solid var(--line);border-radius:12px;padding:12px 14px} +.wo-slot.locked{opacity:.6} +.wo-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:6px} +.wo-slot img{max-width:100%;border-radius:8px} + +/* getting-started stepper on the Overview (Jim could not find the wallet step, 2026-09-14) */ +.gs{border-color:var(--mint-line)} +.gs-steps{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:8px;margin:4px 0 12px} +.gs-step{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:10px 12px;color:var(--muted);font-size:14px} +.gs-step .n{flex:0 0 26px;width:26px;height:26px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;border:1px solid var(--line);font-size:13px} +.gs-step.done{color:var(--ink)} .gs-step.done .n{background:var(--mint);color:var(--mint-ink);border-color:var(--mint)} +.gs-step.now{color:var(--ink);border-color:var(--mint);background:var(--mint-faint)} .gs-step.now .n{border-color:var(--mint);color:var(--mint)} +.gs-now{display:flex;gap:14px;align-items:center;flex-wrap:wrap;border-top:1px solid var(--line);padding-top:12px} +.gs-now p{margin:0;flex:1;min-width:240px;max-width:60ch} .gs-now p b{display:block;font-family:var(--disp);font-size:16px;margin-bottom:2px} +@keyframes gsPulse{0%{box-shadow:0 0 0 0 rgba(67,232,195,.7)}70%{box-shadow:0 0 0 14px rgba(67,232,195,0)}100%{box-shadow:0 0 0 0 rgba(67,232,195,0)}} +.pulse{animation:gsPulse 1.2s ease-out 4} + +/* promo toolkit tiers */ +.tk-tiers{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:10px} +.tk-tier{border:1px solid var(--line);border-radius:12px;padding:12px 14px;font-size:13.5px;color:var(--muted)} +.tk-tier.reached{border-color:var(--mint-line);color:var(--ink)} .tk-tier.current{background:var(--mint-faint)} +.tk-tier b{display:block;font-family:var(--disp);font-size:15px;color:var(--ink)} .tk-tier .need{font-size:12px;margin:2px 0 8px;color:var(--muted)} +.tk-tier ul{margin:0;padding-left:16px} .tk-tier li{margin:3px 0} .tk-tier li.soon{opacity:.65} .tk-tier li.soon::after{content:' (coming)';font-size:11px;color:var(--muted)} +.tk-tier .lock{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--gold)} +.tk-hist{border-top:1px solid var(--line);padding:8px 0;font-size:13px} .tk-hist .muted{font-size:12px} +.tk-sec{margin-top:18px;padding-top:14px;border-top:1px solid var(--line)} .tk-grid{display:flex;gap:8px;flex-wrap:wrap} +.tk-vids{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:8px} .tk-vid{border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:13px} .tk-vid b{display:block;font-weight:600;margin-bottom:4px} .tk-vid .st{font-size:12px;color:var(--muted)} +.tk-bar{height:8px;border-radius:99px;background:var(--muted-soft);overflow:hidden;margin:6px 0 4px} .tk-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,var(--mint-deep),var(--mint));transition:width .6s ease;min-width:4px} +.tk-table{width:100%;border-collapse:collapse;font-size:13px} .tk-table th,.tk-table td{text-align:left;padding:6px 8px;border-bottom:1px solid var(--line)} .tk-table th{font-size:11px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)} .tk-table td.n{font-variant-numeric:tabular-nums;text-align:right} .tk-table th.n{text-align:right} .tk-table tr.best td{color:var(--mint)} +.tk-team{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:6px 0;font-size:13px;display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:space-between} .tk-team .who b{font-weight:600} .tk-team .who span{color:var(--muted);font-size:12px} .tk-team.stalled{border-color:var(--gold-line)} +.tk-nudge{width:100%;margin:8px 0 0;padding:8px 12px;border:1px dashed var(--line);border-radius:10px;font-size:13px} +/* click sources stack one per line so the Clicks column stays narrow (Marty, 2026-09-15) */ +.clk-src span{display:block;white-space:nowrap} .camp-table td{white-space:normal} .camp-table td:first-child{max-width:260px} +/* campaigns list on phones and tablets: each row becomes a card, buttons at the bottom, no sideways scroll (Jim, 2026-09-15) */ +@media (max-width:900px){ + .tablewrap:has(.camp-table){overflow:visible} + .camp-table{display:block;width:100%;border-collapse:separate} + .camp-table thead{display:none} + .camp-table tbody{display:block} + .camp-table tr{display:block;border:1px solid var(--line);border-radius:12px;padding:10px 12px 12px;margin:0 0 10px;background:var(--panel)} + .camp-table td{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:5px 0;border:0;text-align:left;max-width:100%;overflow:hidden} + .camp-table td.num{text-align:right;font-variant-numeric:tabular-nums} + .camp-table td::before{content:attr(data-l);color:var(--muted);font-size:11px;letter-spacing:.06em;text-transform:uppercase;flex:0 0 auto} + .camp-table td:first-child{display:block;padding:0 0 6px;font-size:16px} .camp-table td:first-child::before{display:none} + .camp-table td:first-child > *{max-width:100%} + .camp-table td.act{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px;margin-top:8px;padding-top:10px;border-top:1px solid var(--line)} .camp-table td.act::before{display:none} + /* on a phone the card is wide enough for them to share a row, so undo the desktop stack */ + .camp-table td.act .btn{flex:1 1 auto;text-align:center;display:inline-block;width:auto;min-width:0;margin:0} +} + +/* Pipeline board (Marty, 2026-09-15): columns scroll sideways inside their own box, never the page */ +.pipe-board{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 10px;scroll-snap-type:x proximity} +.pipe-col{flex:0 0 220px;scroll-snap-align:start;background:var(--ground-soft);border:1px solid var(--line);border-radius:12px;padding:10px;min-height:120px} +.pipe-col h4{margin:0 0 2px;font-size:13px;letter-spacing:.06em;text-transform:uppercase;color:var(--mint);display:flex;justify-content:space-between;gap:8px} +.pipe-col h4 span{color:var(--muted);font-variant-numeric:tabular-nums} +.pipe-col .hint{font-size:11.5px;color:var(--muted);margin:0 0 8px;line-height:1.35} +.pipe-card{background:var(--ink-faint);border:1px solid var(--line);border-radius:10px;padding:8px 10px;margin:0 0 8px;cursor:pointer;transition:border-color .15s} +.pipe-card:hover,.pipe-card:focus-visible{border-color:var(--mint);outline:none} +.pipe-card.on{border-color:var(--gold,#e6c15a)} +.pipe-card .nm{font-weight:700;font-size:14px;display:flex;justify-content:space-between;gap:6px;align-items:baseline} +.pipe-card .nm small{font-weight:400;font-size:11px;color:var(--muted);white-space:nowrap} +.pipe-card .sub{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.35} +.pipe-card .note{font-size:12px;color:var(--ink);margin-top:4px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis} +.pipe-card .chip{margin-top:5px;margin-right:4px} +.pipe-due{display:grid;gap:6px} +.pipe-due .pipe-card{margin:0} +@media (max-width:640px){.pipe-form{grid-template-columns:1fr !important}.pipe-col{flex-basis:200px}} +/* Overview chips drill down to My line (Marty, 2026-09-15) */ +.lt-node.lt-go{cursor:pointer;transition:border-color .15s,transform .15s} .lt-node.lt-go:hover,.lt-node.lt-go:focus-visible{border-color:var(--mint);transform:translateY(-1px);outline:none} +.lin-row.lin-focus{box-shadow:0 0 0 2px var(--mint);border-radius:10px} +/* paged lists: 25 rows, then a control bar that reads as a control, not more list (Marty, 2026-09-19) */ +.pgr{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin:12px 0 4px;padding:10px 12px;border:1px solid var(--line-strong);border-radius:12px;background:var(--mint-faint)} +.pgr-n{color:var(--ink);font-size:13px} .pgr-n b{color:var(--mint);font-variant-numeric:tabular-nums} +.pgr-b{display:flex;align-items:center;gap:8px;flex-wrap:wrap} +.pgr-pg{font-size:11px;color:var(--muted);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap} +.pgr-btn{background:var(--mint);color:var(--mint-ink);border:0;border-radius:999px;padding:8px 14px;font-weight:800;font-size:13px;cursor:pointer;white-space:nowrap} +.pgr-btn:hover{background:var(--mint-hi)} .pgr-btn[disabled]{opacity:.35;cursor:default} +.pipe-col .pgr{padding:8px;gap:6px;margin-top:8px} .pipe-col .pgr-btn{padding:6px 10px;font-size:12px} +#chatThreads .pgr{margin:8px 10px} + +/* Five Dollar Friday strip (landing) */ +.fdf{margin:18px auto 0;max-width:760px;padding:12px 16px;border-radius:12px;background:var(--mint-soft);border:1px solid var(--mint-line);color:var(--ink);font-size:14px;line-height:1.5;text-align:center} +.fdf a{color:var(--mint);font-weight:600} + +/* My line: section pills, sticky under the top bar (Marty, 2026-09-26) */ +.line-jump{position:sticky;top:var(--jumpTop,64px);z-index:4;margin:0 0 14px;padding:10px 0;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none; + background:var(--nav-bg);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line)} +.line-jump::-webkit-scrollbar{display:none} +.line-jump .chip-t{flex:none;white-space:nowrap} +#pane-line > .card[data-jump]{scroll-margin-top:calc(var(--jumpTop,64px) + 64px)} +.tablewrap > .pgr{margin-top:10px} + +/* a game return bar sits at the bottom: lift the status toast above it (Marty 2026-10-08: the bar hid the purchase result) */ +body.hasback #status{bottom:92px} + +/* ── Light theme (2026-11-01, mirrored from LinkSpin): light mint-grey ground, white panels, dark ink, the mint family + darkened to a teal that reads as text on white (every pair below clears WCAG AA 4.5:1, measured by qa/theme-contrast.mjs). + themehead.js resolves auto | light | dark to data-theme on before the first paint; nothing stored keeps dark. ── */ +:root[data-theme="light"]{ + --ground:#E8F0EC; --ground2:#F2F7F4; --panel:#FFFFFF; --panel-solid:#FFFFFF; + --line:#C9D8D1; --line-strong:#A6BBB1; --line-soft:#DDE7E2; --ink:#0B1A14; --muted:#50665C; + --mint:#0A6B56; --mint-hi:#075744; --mint-deep:#064A3A; --mint-ink:#FFFFFF; --mint-pale:#075744; + --mint-faint:#EDF6F2; --mint-soft:#DDF0E8; --mint-soft-2:#C6E6DA; --mint-line:#8FC9B6; --mint-line-2:#3E9E85; + --cyan:#0A6F8C; --violet:#5B3FD6; --amber:#8A5200; --bad:#B42318; --bad-soft:#FDE8E6; + --ok:#0B7A52; --ok-ink:#FFFFFF; --ok-soft:#E3F6EC; --warn:#9A4A00; + --gold:#7A5200; --gold-2:#7F5C00; --gold-ink:#FFFFFF; --gold-soft:#FFF4D1; --gold-faint:#FFFBEB; --gold-line:#E6C25E; + --amber-soft:#FFF1D6; --amber-line:#E8C27A; --amber-ink:#FFFFFF; + --cyan-soft:#DDF1F8; --cyan-line:#9FD3E6; --violet-soft:#EEE9FF; --violet-line:#C4B5FF; + --muted-soft:rgba(80,102,92,.12); --muted-line:rgba(80,102,92,.45); --ink-faint:rgba(11,26,20,.05); + --ground-soft:#F2F7F4; --field-bg:#FFFFFF; --nav-bg:rgba(242,247,244,.88); --side-bg:rgba(242,247,244,.97); --pill-bg:rgba(255,255,255,.85); + --panel-grad:linear-gradient(180deg,#FFFFFF,#F5FAF7); --panel-grad-deep:linear-gradient(180deg,#F2F7F4,#E2ECE7); --plate-grad:linear-gradient(160deg,#FFFFFF,#E6F1EC); + --sh-lg:0 0 0 1px rgba(11,26,20,.04),0 14px 34px -20px rgba(11,26,20,.35); + color-scheme:light; +} +:root[data-theme="light"] body::before{opacity:.7} +:root[data-theme="light"] .ghost{background:linear-gradient(180deg,rgba(10,107,86,.22),transparent 78%);-webkit-background-clip:text;background-clip:text} +:root[data-theme="light"] .btn{box-shadow:0 4px 18px rgba(10,107,86,.22)} :root[data-theme="light"] .btn:hover{box-shadow:0 8px 26px rgba(10,107,86,.3)} +:root[data-theme="light"] .mockup,:root[data-theme="light"] .modal-card,:root[data-theme="light"] #status,:root[data-theme="light"] #iapChatPanel,:root[data-theme="light"] .chat-drawer{box-shadow:0 18px 50px -20px rgba(11,26,20,.35)} +:root[data-theme="light"] .bo.side-open .bo-side{box-shadow:0 0 60px rgba(11,26,20,.25)} +:root[data-theme="light"] .plate{box-shadow:0 0 24px rgba(10,107,86,.12),inset 0 1px 0 rgba(255,255,255,.8)} diff --git a/public/assets/wallet.js b/public/assets/wallet.js new file mode 100644 index 0000000..0865c87 --- /dev/null +++ b/public/assets/wallet.js @@ -0,0 +1,271 @@ +// Banner Line wallet plumbing: InstantAdPay's wallet.js (same AppKit build, chain guard, fee fix, dead-session +// recovery), with buy(sponsor) / buyFor(owner, sponsor) in place of the IAP product buy. Selectors come from +// /api/config (server abi.js), so the ABI lives in one module. +// Wallet plumbing via Reown AppKit — the universal connector every wallet is +// built for (all wallets, QR + mobile deep-links, working icons). AppKit is +// lazy-loaded from the CDN on first use; once connected we drive the raw +// EIP-1193 provider for chain switch, SIWE sign-in, and contract transactions. +window.BLWallet = (function () { + const pad = v => BigInt(v).toString(16).padStart(64, '0'); + const padAddr = a => { if (!a) return pad(0); if (!/^0x[0-9a-fA-F]{40}$/.test(a)) throw new Error('Bad address: ' + a); return a.slice(2).toLowerCase().padStart(64, '0'); }; + // Normalize a chainId to a decimal number. eth_chainId is meant to return a + // hex string, but some wallets return a number or a decimal string — compare + // numerically so a wallet's shape never crashes the flow. + const chainNum = v => { + if (v == null) return NaN; + if (typeof v === 'number') return v; + const s = String(v).trim(); + return /^0x/i.test(s) ? parseInt(s, 16) : parseInt(s, 10); + }; + const APPKIT_URL = 'https://cdn.jsdelivr.net/npm/@reown/appkit-cdn@1.8.23/dist/appkit.js'; + + let modal = null, akPromise = null, provider = null; + + async function initAppKit(c) { + if (modal) return modal; + if (akPromise) return akPromise; + akPromise = (async () => { + const mod = await import(APPKIT_URL); + const { createAppKit, WagmiAdapter, networks } = mod; + const netMap = { 80002: networks.polygonAmoy, 137: networks.polygon, 31337: networks.hardhat || networks.localhost }; + const base = netMap[Number(c.chainId)] || networks.polygonAmoy; + // Override the chain's RPC with our clean public endpoint. AppKit's built-in + // networks advertise the WalletConnect RPC proxy + // (rpc.walletconnect.org/v1/?chainId=…&projectId=…) as the chain RPC, and + // wallets reject that query-string URL as "Invalid URL" when adding/switching + // the network — the cause of Trust's "Invalid URL", MetaMask's switch loop, + // and the failed mobile buy (the chain switch never completed). + const rpc = String(c.rpc || '').trim(); + const net = rpc ? Object.assign({}, base, { rpcUrls: { default: { http: [rpc] }, public: { http: [rpc] } } }) : base; + // Accept the wallet's usual networks too, so AppKit doesn't trap the user in + // its own "Switch Network" modal — that modal loops on a testnet the wallet + // can't auto-add. We switch to `net` ourselves (wallet_addEthereumChain adds + // + switches in one step) and sendTx hard-guards the chain before signing. + const allNets = [net]; + for (const k of ['polygon', 'mainnet']) { + try { const n = networks[k]; if (n && n.id !== net.id) allNets.push(n); } catch (e) {} + } + const projectId = String(c.walletConnectProjectId || '').trim(); + const wagmiAdapter = new WagmiAdapter({ networks: allNets, projectId }); + modal = createAppKit({ + adapters: [wagmiAdapter], networks: allNets, projectId, defaultNetwork: net, + metadata: { name: 'Banner Line', description: 'Spots on the board, split on-chain when spots sell.', + url: location.origin, icons: [location.origin + '/logo-icon.png'] }, + features: { analytics: false, email: false, socials: [] }, + // Picker order: wallets without Trust's balance-proportion block go first. + // Trust Wallet is NOT excluded; it just drops out of the featured row into + // "All wallets" (Marty, 2026-09-09: move Trust to the bottom, not off). + featuredWalletIds: [ + 'c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96', // MetaMask + 'a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393', // Phantom + '0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150', // SafePal + 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa' // Coinbase Wallet + ] + }); + return modal; + })(); + return akPromise; + } + + function currentAddress() { try { return (modal && modal.getAddress && modal.getAddress()) || null; } catch (e) { return null; } } + + function waitForConnection(timeoutMs) { + if (currentAddress()) return Promise.resolve(currentAddress()); + return new Promise((resolve, reject) => { + let done = false, unsub = null; + const finish = (addr, err) => { if (done) return; done = true; try { unsub && unsub(); } catch (e) {} err ? reject(err) : resolve(addr); }; + try { unsub = modal.subscribeAccount(acc => { if (acc && acc.isConnected && acc.address) finish(acc.address); }); } catch (e) {} + const t0 = Date.now(); + (function poll() { + if (done) return; + const a = currentAddress(); + if (a) return finish(a); + if (Date.now() - t0 > (timeoutMs || 180000)) return finish(null, new Error('Wallet connection timed out. Tap Connect and try again.')); + setTimeout(poll, 400); + })(); + }); + } + + async function resolveProvider() { + for (let i = 0; i < 20; i++) { + try { const p = modal.getWalletProvider ? await Promise.resolve(modal.getWalletProvider()) : null; if (p && p.request) return p; } catch (e) {} + await new Promise(r => setTimeout(r, 300)); + } + throw new Error('Could not reach your wallet. Try connecting again.'); + } + + function eth() { if (!provider) throw new Error('Connect your wallet first.'); return provider; } + const isInjected = () => !!(provider && window.ethereum && (provider === window.ethereum || provider.isMetaMask)); + // the account the wallet will actually sign with: for an injected wallet (MetaMask + // extension) that is its active account, which can differ from AppKit's cached one + async function activeAddress(fallback) { + if (isInjected()) { try { const a = await provider.request({ method: 'eth_accounts' }); if (a && a[0]) return a[0]; } catch (e) {} } + return fallback || currentAddress(); + } + // Force the wallet's own account picker. Injected wallets stay connected to the + // site, so a plain disconnect/reconnect never shows one: asking for permissions + // again makes MetaMask open its account-selection prompt, and whatever the user + // ticks becomes the active account. WalletConnect wallets fall back to a fresh + // session (the picker + the wallet app's own account choice). + async function pickAccount() { + const c = await BL.getConfig(); + await initAppKit(c); + const inj = window.ethereum; + if (inj && inj.request) { + try { + await inj.request({ method: 'wallet_requestPermissions', params: [{ eth_accounts: {} }] }); + const accs = await inj.request({ method: 'eth_accounts' }); + if (accs && accs[0]) { provider = inj; await ensureChain(c).catch(() => {}); return accs[0]; } + } catch (e) { + if (e && (e.code === 4001 || /reject|denied/i.test(String(e.message || '')))) throw new Error('You closed the account picker. Pick the account you want and try again.'); + } + } + return freshConnect(c); + } + + // A WalletConnect session can die underneath AppKit's cached "connected" + // state: the wallet app rejects or kills it (Trust does this after its own + // security stop), the phone sleeps, the relay drops. AppKit still reports an + // address, so the next request fails with a "disconnected" style error. + // Detect that, wipe the stale session, and re-open the picker for a fresh one. + const DEAD_RE = /disconnect|not connected|no matching key|session (topic|expired|deleted|not found)|call connect|please call connect|missing or invalid|relay/i; + const isDead = e => DEAD_RE.test(String((e && e.message) || e || '')); + async function freshConnect(c) { + try { BL.status('Your wallet session dropped. Reconnect in the picker…'); } catch (e) {} + await disconnect(); + try { await modal.open(); } catch (e) {} + const addr = await waitForConnection(180000); + try { if (modal && modal.close) await modal.close(); } catch (e) {} + provider = await resolveProvider(); + await ensureChain(c).catch(() => {}); + return addr; + } + + async function connect() { + const c = await BL.getConfig(); + await initAppKit(c); + let addr = currentAddress(); + if (!addr) { + // give AppKit a moment to rehydrate an existing session before popping the + // picker — otherwise an already-connected wallet still gets the modal + for (let i = 0; i < 8 && !addr; i++) { await new Promise(r => setTimeout(r, 150)); addr = currentAddress(); } + } + if (!addr) { try { await modal.open(); } catch (e) {} addr = await waitForConnection(180000); } + try { if (modal && modal.close) await modal.close(); } catch (e) {} // dismiss the picker once we're connected + provider = await resolveProvider(); + // probe the session: a dead WalletConnect session answers with a disconnect error + try { await provider.request({ method: 'eth_chainId' }); } + catch (e) { if (isDead(e)) return freshConnect(c); } + await ensureChain(c).catch(() => {}); // AppKit already connects on the right network; switch is best-effort + return addr; + } + + async function ensureChain(c) { + const want = '0x' + Number(c.chainId).toString(16); + let cur; try { cur = await eth().request({ method: 'eth_chainId' }); } catch (e) { return; } + if (chainNum(cur) === Number(c.chainId)) return; + try { + await eth().request({ method: 'wallet_switchEthereumChain', params: [{ chainId: want }] }); + } catch (e) { + // any failure (not just 4902): try to add the chain — wallet_addEthereumChain + // adds AND switches in one step, which is what unblocks wallets that can't + // otherwise reach a chain they don't already have (e.g. a testnet). + const addParams = { chainId: want, chainName: c.chainName, nativeCurrency: { name: 'POL', symbol: 'POL', decimals: 18 }, rpcUrls: [c.rpc] }; + if (c.explorer && /^https?:\/\//i.test(c.explorer)) addParams.blockExplorerUrls = [c.explorer]; + try { await eth().request({ method: 'wallet_addEthereumChain', params: [addParams] }); } catch (e2) {} + } + } + + // SIWE: challenge -> personal_sign -> verify (server sets the session cookie) + async function signIn(opts) { + const addr = (opts && opts.pick) ? await pickAccount() : await activeAddress(await connect()); + const ch = await (await fetch('/api/auth/challenge', { method: 'POST', + headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address: addr }) })).json(); + if (ch.error) throw new Error(ch.error); + // hex-encode the message (Trust and others require hex for personal_sign) + const hexMsg = '0x' + Array.from(new TextEncoder().encode(ch.message)).map(b => b.toString(16).padStart(2, '0')).join(''); + const sig = await eth().request({ method: 'personal_sign', params: [hexMsg, addr] }); + const r = await (await fetch('/api/auth/verify', { method: 'POST', + headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ address: addr, signature: sig, asPosition: !!(opts && opts.asPosition) }) })).json(); + if (r.error) throw new Error(r.error); + return r; + } + + async function sendTx(data, valueWei) { + const c = await BL.getConfig(); + const addr = await connect(); + // Hard chain guard: connect()'s switch is best-effort and some wallets (or + // AppKit's own modal) don't complete it. Never sign on the wrong chain — + // a value tx to a contract that doesn't exist on that chain would look like + // it "succeeded" while doing nothing. + const wantNum = Number(c.chainId); + let cur; try { cur = await eth().request({ method: 'eth_chainId' }); } catch (e) {} + if (!isNaN(chainNum(cur)) && chainNum(cur) !== wantNum) { + await ensureChain(c); + try { cur = await eth().request({ method: 'eth_chainId' }); } catch (e) {} + if (!isNaN(chainNum(cur)) && chainNum(cur) !== wantNum) + throw new Error('Your wallet is on the wrong network. Switch it to ' + (c.chainName || 'the correct network') + ', then try again.'); + } + const tx = { from: await activeAddress(addr), to: c.contract, data }; + if (valueWei) tx.value = '0x' + BigInt(valueWei).toString(16); + // Amoy's Bor nodes enforce a ~25 gwei minimum priority fee that MetaMask's + // own estimate misses ("gas tip below minimum"). Pull the network's correct + // fees from the server and set them so the tx clears the floor. + try { + const g = await (await fetch('/api/gas')).json(); + if (g && g.maxPriorityFeePerGas && g.maxFeePerGas) { + tx.maxPriorityFeePerGas = g.maxPriorityFeePerGas; + tx.maxFeePerGas = g.maxFeePerGas; + } + } catch (e) {} + try { + return await eth().request({ method: 'eth_sendTransaction', params: [tx] }); + } catch (e) { + if (!isDead(e)) throw e; + // session died between connect and send: reconnect once and resend + tx.from = await freshConnect(c); + return eth().request({ method: 'eth_sendTransaction', params: [tx] }); + } + } + + async function waitTx(hash) { + for (let i = 0; i < 90; i++) { + try { + const r = await (await fetch('/api/tx/' + hash)).json(); + if (r.found) return { status: r.status, blockNumber: r.blockNumber }; + } catch (e) { /* transient fetch failure (e.g. mobile app-switch) — keep polling */ } + await new Promise(res => setTimeout(res, 2500)); + } + throw new Error('Timed out waiting for the transaction. Check the explorer.'); + } + + // sendWei = quoteWei plus ~1% headroom (from /api/quote); the contract refunds anything above the price in the same tx + async function buy(sponsor, sendWei) { + const c = await BL.getConfig(); + const hash = await sendTx(c.sel.buy + padAddr(sponsor), sendWei); + return { hash, receipt: await waitTx(hash) }; + } + async function buyFor(owner, sponsor, sendWei) { + const c = await BL.getConfig(); + if (!owner) throw new Error('Enter the wallet address that should own the spot.'); + const hash = await sendTx(c.sel.buyFor + padAddr(owner) + padAddr(sponsor), sendWei); + return { hash, receipt: await waitTx(hash) }; + } + + async function disconnect() { + // AppKit's disconnect can hang on the WalletConnect relay (esp. mobile) — + // never block on it, so the UI can't get stuck "disconnecting". + try { if (modal && modal.disconnect) await Promise.race([modal.disconnect(), new Promise(r => setTimeout(r, 1200))]); } catch (e) {} + provider = null; + try { Object.keys(localStorage).forEach(k => { if (/wc@2|walletconnect|w3m|wcm|reown|wagmi|appkit/i.test(k)) localStorage.removeItem(k); }); } catch (e) {} + } + + // native balance of the connected wallet (pre-flight check before a buy) + async function balance(addr) { + await connect(); + const h = await eth().request({ method: 'eth_getBalance', params: [addr || currentAddress(), 'latest'] }); + return BigInt(h); + } + function walletName() { try { const w = modal && modal.getWalletInfo && modal.getWalletInfo(); return (w && w.name) || ''; } catch (e) { return ''; } } + return { connect, signIn, buy, buyFor, waitTx, disconnect, balance, address: currentAddress, activeAddress, pickAccount, walletName }; +})(); diff --git a/public/board.html b/public/board.html new file mode 100644 index 0000000..b635d2d --- /dev/null +++ b/public/board.html @@ -0,0 +1,23 @@ + + + + +Board | Banner Line + + + + + + + +
    +

    The board

    +

    Every spot is owed 300 views. Newest spots sit on top, and the board rotates until each spot has its views (30-day limit). Open slots show network sites.

    +

    +

    The line so far

    + +
    + + + + diff --git a/public/how.html b/public/how.html new file mode 100644 index 0000000..42ca8ab --- /dev/null +++ b/public/how.html @@ -0,0 +1,30 @@ + + + + +How it works | Banner Line + + + + + + + +
    +

    How Banner Line works

    One global line of 468x60 spots. Plain rules, all on-chain, nothing held by the site.

    +

    What a spot buys

    A spot costs $5 in POL at the Chainlink POL/USD price. It buys two things: 300 guaranteed views on the board for your image and link (delivered within 30 days, newest spots on top), and a place in the line.

    +

    Where the $5 goes, in the same transaction

    + + + + +
    ShareTo
    30% ($1.50)the buyer's sponsor (no sponsor: the momentum fund)
    55% ($0.275 x 10)the owners of the 10 spots bought just before this one
    10%the company
    5%the momentum fund, which can only buy spots
    +

    The contract holds nothing except the momentum fund. The splits cannot be changed and there is no owner withdraw.

    +

    What is not promised

    Nothing is promised. You are paid only when spots sell after yours. The line pays each spot at most 10 times ($2.75), so a member who refers nobody always gets back less than $5. This is advertising with a share of later sales, not an investment.

    +

    The momentum fund

    When no spot has sold for 4 hours, the fund buys one (at most 12 a day). It gifts the spot to an active member who owns a paid spot and has not had a gift in 7 days, members who referred someone recently first. If nobody qualifies, the fund keeps the spot and its line money goes back into the fund.

    +

    The rest of the network

    Open board slots show network sites such as InstantAdPay and LinkSpin. On InstantAdPay, ad credits buy advertising, not income.

    +
    + + + + diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..6e99bc5 --- /dev/null +++ b/public/index.html @@ -0,0 +1,43 @@ + + + + +Banner Line | Banner real estate in one line + + + + + + + +
    +
    +

    Banner real estate on every page in your line, paid instantly on-chain when spots sell.

    +

    A $5 spot buys 300 guaranteed views on the board and a place in the line. When a later spot sells, the contract pays the 10 spots above it and the buyer's sponsor in the same transaction. Nothing is promised.

    +
    + + + + + +
    + + + + diff --git a/public/join.html b/public/join.html new file mode 100644 index 0000000..9d481d5 --- /dev/null +++ b/public/join.html @@ -0,0 +1,41 @@ + + + + +Get a spot | Banner Line + + + + + + + +
    +

    Get a spot

    +

    $5 in POL, paid from your own wallet straight to the contract. The site never holds your money.

    + + + + +
    + + + + + diff --git a/public/logo-icon.png b/public/logo-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..87a53d83f79a57ca998f6debbe3179f7c9c76e25 GIT binary patch literal 63715 zcmV)IK)k<+P)I#I07IB;sUty zct*z>GV{w^>s&z9n?c-j_St*wwQ}X~tz4P88)wg5ol-caM2$v+ZcKi=C&28Xw_4kIfn|_Pmr5$}Tf10KX>|$Qa>DSyjxGDa}tcmCI z5QQ!@;RzBNOfx^rh#ERRJJ%DKk7lA*ycZcejm*qRxW=#-Q%9Ie1SwrElQ-jVGR9-% z$3z;7K=N?08*;q}FZ|LL0mIJWHGEGNj!3{vX=V~jIC*5ehnWO>*T9*>@n@nc+gRbS z%E8h|hLkjpP6nzK?Ya?CRvyUaLNsP6z9BQHUKyB5m59*=(gX{G_C3%su|^Uy%Y!FZLi4(O)Wt!#zV)CjP4uZNI@Y1Ha{=)zm)o zVQL-b%=h2eoRb8tc0fPn-qdCgd*7P$B{K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;Q(!q?>bZoy@B1rQKS;aj zao5AQU9H?!mgo8UV-XmV$Yrl;))k?58NbOgmnzbfV3J)dbkT^hw8cLKD8)P#vit^* zrNB>ANc-8AIovPl8D>#;x^4Lw1!%sQM<{>ze9~LIZE7uhvibNEH0(mN=L8NRV5jUZ zlhP{=BSR33>t6Zac4dutROzp`N~yxV5$I%HdLzItysAQ(dA|!iDD*UwpU5N1T2x}3 oP1>i0aD{)NL)QzX{`1TK1N0tg=lqT3?EnA(07*qoM6N<$f}EndC;$Ke literal 0 HcmV?d00001 diff --git a/public/my.html b/public/my.html new file mode 100644 index 0000000..9f106a9 --- /dev/null +++ b/public/my.html @@ -0,0 +1,33 @@ + + + + +My Spots | Banner Line + + + + + + + +
    +

    My Spots

    Your spots, your images and links, and every payment the contract sent you.

    + + + +
    + + + + + diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..27d3e51 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Allow: / +Disallow: /my +Disallow: /api/ diff --git a/qa/smoke.mjs b/qa/smoke.mjs new file mode 100644 index 0000000..a239dd5 --- /dev/null +++ b/qa/smoke.mjs @@ -0,0 +1,233 @@ +// Banner Line local smoke test. Everything runs on this machine: a throwaway anvil chain, the REAL BannerLine +// contract (compiled artifacts read from ../contracts/out, nothing written there) with its mock $2000 feed, +// the app server against that chain, HTTP checks of every API, and Playwright page renders + a full UI gate run. +// No real network, no real wallet, no real money. Keys used are anvil's public test keys. +// +// node qa/smoke.mjs (needs ~/.foundry/bin/anvil.exe and contracts/out built) +// SKIP_UI=1 node qa/smoke.mjs (API checks only) +import { spawn } from 'node:child_process'; +import fs from 'node:fs'; +import path from 'node:path'; +import zlib from 'node:zlib'; +import os from 'node:os'; +import { createRequire } from 'node:module'; +import { fileURLToPath } from 'node:url'; +const require = createRequire(import.meta.url); +const { ethers } = require('ethers'); + +const APP = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..'); +const OUT = path.join(APP, 'qa', 'out'); fs.mkdirSync(OUT, { recursive: true }); +const ART = path.resolve(APP, '..', 'contracts', 'out'); +const ANVIL = process.env.ANVIL || path.join(os.homedir(), '.foundry', 'bin', 'anvil.exe'); +const PW = process.env.PLAYWRIGHT || 'D:/Projects/MarketingAgent/qa-tester/node_modules/playwright'; +const RPC_PORT = Number(process.env.SMOKE_RPC_PORT || 18645), APP_PORT = Number(process.env.SMOKE_APP_PORT || 3111), BASE = 'http://127.0.0.1:' + APP_PORT; +const ADMIN = 'smoke-admin'; +const sleep = ms => new Promise(r => setTimeout(r, ms)); +let pass = 0, fail = 0; const procs = []; +const ok = (cond, what, extra) => { if (cond) { pass++; console.log(' ok ' + what); } else { fail++; console.log(' FAIL ' + what + (extra !== undefined ? ' -> ' + JSON.stringify(extra).slice(0, 300) : '')); } }; +function cleanup() { for (const p of procs) { try { p.kill(); } catch (e) {} } } +process.on('exit', cleanup); + +// ---- tiny cookie-jar HTTP client ---- +function client(ua) { + const jar = {}; + return { + jar, + async req(p, opts = {}) { + const headers = Object.assign({ 'User-Agent': ua || 'Mozilla/5.0 smoke', Cookie: Object.entries(jar).map(([k, v]) => k + '=' + v).join('; ') }, opts.headers || {}); + const r = await fetch(BASE + p, { method: opts.method || 'GET', headers, body: opts.body, redirect: 'manual' }); + for (const c of r.headers.getSetCookie ? r.headers.getSetCookie() : []) { const [kv] = c.split(';'); const i = kv.indexOf('='); jar[kv.slice(0, i)] = kv.slice(i + 1); } + return r; + }, + async json(p, body, extraHeaders) { const r = await this.req(p, body === undefined ? { headers: extraHeaders } : { method: 'POST', headers: Object.assign({ 'Content-Type': 'application/json' }, extraHeaders), body: JSON.stringify(body) }); return Object.assign({ _status: r.status }, await r.json().catch(() => ({}))); } + }; +} +function png(w, h) { + const crcT = Array.from({ length: 256 }, (_, n) => { let c = n; for (let k = 0; k < 8; k++) c = c & 1 ? 0xedb88320 ^ (c >>> 1) : c >>> 1; return c >>> 0; }); + const crc = b => { let c = 0xffffffff; for (const x of b) c = crcT[(c ^ x) & 255] ^ (c >>> 8); return (c ^ 0xffffffff) >>> 0; }; + const chunk = (t, d) => { const len = Buffer.alloc(4); len.writeUInt32BE(d.length); const td = Buffer.concat([Buffer.from(t), d]); const c = Buffer.alloc(4); c.writeUInt32BE(crc(td)); return Buffer.concat([len, td, c]); }; + const ihdr = Buffer.alloc(13); ihdr.writeUInt32BE(w, 0); ihdr.writeUInt32BE(h, 4); ihdr[8] = 8; ihdr[9] = 2; + const raw = Buffer.alloc((w * 3 + 1) * h); for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) { const o = y * (w * 3 + 1) + 1 + x * 3; raw[o] = 40 + x % 200; raw[o + 1] = 120; raw[o + 2] = 90 + y * 2; } + return Buffer.concat([Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]), chunk('IHDR', ihdr), chunk('IDAT', zlib.deflateSync(raw)), chunk('IEND', Buffer.alloc(0))]); +} + +async function main() { + // ---- 1. chain ---- + console.log('1. anvil + contract'); + // never talk to someone else's node: the port must be free before our anvil starts + const busy = await fetch('http://127.0.0.1:' + RPC_PORT, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}' }).then(() => true, () => false); + if (busy) throw new Error('port ' + RPC_PORT + ' is already in use; set SMOKE_RPC_PORT'); + const appBusy = await fetch('http://127.0.0.1:' + APP_PORT).then(() => true, () => false); + if (appBusy) throw new Error('port ' + APP_PORT + ' is already in use; set SMOKE_APP_PORT'); + const anvil = spawn(ANVIL, ['--port', String(RPC_PORT), '--silent'], { stdio: 'ignore' }); procs.push(anvil); + const provider = new ethers.JsonRpcProvider('http://127.0.0.1:' + RPC_PORT, 31337, { staticNetwork: true, pollingInterval: 200 }); + for (let i = 0; i < 50; i++) { try { await provider.getBlockNumber(); break; } catch (e) { await sleep(200); } } + const W = Array.from({ length: 10 }, (_, i) => new ethers.NonceManager(ethers.HDNodeWallet.fromPhrase('test test test test test test test test test test test junk', undefined, "m/44'/60'/0'/0/" + i).connect(provider))); + const addr = await Promise.all(W.map(w => w.getAddress())); + const art = n => JSON.parse(fs.readFileSync(path.join(ART, n + '.sol', n + '.json'), 'utf8')); + const feedA = art('MockV3Aggregator'), lineA = art('BannerLine'); + const feed = await (await new ethers.ContractFactory(feedA.abi, feedA.bytecode.object, W[0]).deploy(200000000000n)).waitForDeployment(); + const deployBlock = await provider.getBlockNumber(); + const line = await (await new ethers.ContractFactory(lineA.abi, lineA.bytecode.object, W[0]).deploy(addr[8], addr[9], addr[7], await feed.getAddress())).waitForDeployment(); + const CA = await line.getAddress(); + const q = await line.quoteWei(); ok(q === 2500000000000000n, 'quoteWei = 0.0025 POL at $2000', q.toString()); + const send = q + q / 100n; + const [A, B, Cc, D, E, F] = [1, 2, 3, 4, 5, 6]; + const buy = async (i, sponsor) => (await line.connect(W[i]).buy(sponsor, { value: send })).wait(); + await buy(A, ethers.ZeroAddress); await buy(B, addr[A]); await buy(Cc, addr[B]); await buy(D, addr[B]); + await (await line.connect(W[F]).buyFor(addr[E], addr[A], { value: send })).wait(); + await buy(A, ethers.ZeroAddress); await buy(0, ethers.ZeroAddress); // no-sponsor buys feed the momentum fund enough for one keeper buy + ok(Number(await line.spotCount()) === 7, '7 spots bought on anvil'); + const paidTo = async a => (await line.queryFilter(line.filters.Paid(null, a), deployBlock)).reduce((t, e) => t + e.args.amount, 0n); + + // ---- 2. server ---- + console.log('2. server'); + const DATA = path.join(OUT, 'data-' + Date.now()); fs.mkdirSync(DATA, { recursive: true }); + // house list for tests: reserved example domains only, so no real site sees test traffic + fs.writeFileSync(path.join(DATA, 'house.json'), JSON.stringify([{ key: 'one', title: 'Test house 1', img: '/art/house-iap.svg', link: 'https://example.com/' }, { key: 'two', title: 'Test house 2', img: '/art/house-linkspin.svg', link: 'https://example.net/' }])); + const env = Object.assign({}, process.env, { PORT: String(APP_PORT), DATA_DIR: DATA, CHAIN_ID: '31337', RPC_URLS: 'http://127.0.0.1:' + RPC_PORT, CONTRACT_ADDRESS: CA, + DEPLOY_BLOCK: String(deployBlock), POLL_MS: '1000', ADMIN_TOKEN: ADMIN, KEEPER_ENABLED: '1', KEEPER_KEY: W[7].signer.privateKey, KEEPER_STALL_HOURS: '0.01', KEEPER_EVERY_MIN: '0.25', NODE_ENV: 'development' }); + const srv = spawn(process.execPath, ['server.js'], { cwd: APP, env, stdio: ['ignore', 'pipe', 'pipe'] }); procs.push(srv); + const log = fs.createWriteStream(path.join(OUT, 'server.log')); srv.stdout.pipe(log); srv.stderr.pipe(log); + const u = client(); + for (let i = 0; i < 60; i++) { try { const s = await u.json('/api/stats'); if (s.totals && s.totals.spots >= 7) break; } catch (e) {} await sleep(300); } + const st = await u.json('/api/stats'); + ok(st.totals && st.totals.spots === 7, 'index parsed 7 SpotBought', st.totals); + ok(st.totals && st.totals.members === 6, 'index parsed 6 MemberJoined (payer of a buyFor is not a member)', st.totals); + ok(BigInt(st.totals.paidInWei) === 7n * q, 'paid in = 7 x quote (refunds excluded)', st.totals.paidInWei); + const cfg = await u.json('/api/config'); ok(cfg.ready && cfg.sel.buy === '0xf088d547', '/api/config has contract + selectors'); + const qq = await u.json('/api/quote'); ok(qq.wei === q.toString() && qq.source === 'contract.quoteWei', '/api/quote reads quoteWei()', qq); + for (const p of ['/', '/board', '/join', '/my', '/how', '/assets/site.css', '/art/house-line.svg']) { const r = await u.req(p); ok(r.status === 200, 'GET ' + p + ' 200'); } + const r404 = await u.req('/nope'); ok(r404.status === 404, 'unknown path 404'); + const myHdr = await u.req('/my'); ok(myHdr.headers.get('x-frame-options') === 'DENY' && !(await u.req('/')).headers.get('x-frame-options'), '/my not frameable, / frameable'); + + // ---- 3. gate (HTTP) ---- + console.log('3. gate over HTTP (about 50 s of timers)'); + const v = client(); await v.req('/?ref=' + addr[B]); + ok(!!v.jar['bl.ref'], 'ref cookie set from ?ref='); + const g = await v.json('/api/gate'); + ok(!g.passed && g.steps && g.steps[0].role === 'sponsor', 'gate starts with the sponsor spot', g.steps && g.steps.map(s => s.role || s.type)); + ok(g.steps && g.steps[1].type === 'board' && g.steps.filter(s => s.role === 'newest').length === 3, 'board step then 3 newest spots'); + const early = await v.json('/api/gate/done', { gid: g.gid, i: 0 }); ok(early._status === 400, 'done before begin is refused'); + let passedGate = false; + for (let i = 0; i < g.steps.length; i++) { + const s = g.steps[i]; + await v.json('/api/gate/begin', { gid: g.gid, i }); + if (s.type === 'visit') { const r = await v.req(s.open + '?g=' + g.gid + '&i=' + i); ok(r.status === 302, 'step ' + i + ' visit relays (302 to ' + r.headers.get('location') + ')'); } + if (i === 0) { const tooSoon = await v.json('/api/gate/done', { gid: g.gid, i }); ok(tooSoon._status === 400, 'done before the timer is refused'); } + await sleep(s.seconds * 1000); + const d = await v.json('/api/gate/done', { gid: g.gid, i }); + if (d.passed) passedGate = true; else if (d.error) ok(false, 'step ' + i + ' done', d); + } + ok(passedGate && !!v.jar['bl.pass'], 'gate passed, pass cookie set'); + ok((await v.json('/api/gate')).passed === true, 'gate reports passed on return'); + const st2 = await u.json('/api/stats'); const day = Object.values(st2.daily || {}).pop() || {}; + ok(day.views_gate >= 7 && day.clicks_gate >= 4, 'gate views + gate clicks stored apart', day); + const bot = client('Googlebot/2.1'); ok((await bot.json('/api/gate')).passed === true, 'bots skip the gate'); + + // ---- 4. organic board view ---- + const bd = await v.json('/api/board'); ok(bd.tiles && bd.tiles.filter(t => t.t === 'spot').length >= 7 && bd.tiles[0].id > bd.tiles[1].id && bd.tiles.some(t => t.t === 'house'), 'board: all spots newest first + house fill', bd.tiles && bd.tiles.map(t => t.id || t.key)); + const fast = await v.json('/api/board/seen', { token: bd.token }); ok(fast.counted === 0, 'board view before 5 s not counted'); + const bd2 = await v.json('/api/board'); await sleep(5000); + const gateIds = new Set(g.steps[1].tiles.filter(t => t.t === 'spot').map(t => t.id)); const fresh = bd2.tiles.filter(t => t.t === 'spot' && !gateIds.has(t.id)).length; // a keeper spot may be new + const seen = await v.json('/api/board/seen', { token: bd2.token }); ok(seen.counted === fresh, 'same visitor within the hour: views not double counted', [seen, fresh]); + const v2 = client('Mozilla/5.0 other'); const bd3 = await v2.json('/api/board'); await sleep(5000); + const seen3 = await v2.json('/api/board/seen', { token: bd3.token }); ok(seen3.counted === bd3.tiles.filter(t => t.t === 'spot').length && seen3.counted > 0, 'new visitor organic views counted', seen3); + ok((await v2.json('/api/board/seen', { token: bd3.token })).counted === 0, 'board token is one-time'); + + // ---- 5. sign in + My Spots ---- + console.log('5. sign-in + My Spots'); + const m = client(); + const ch = await m.json('/api/auth/challenge', { address: addr[A] }); + const sig = await W[A].signer.signMessage(ch.message); + const bad = await m.json('/api/auth/verify', { address: addr[A], signature: await W[B].signer.signMessage(ch.message) }); ok(bad._status === 400, 'signature from another wallet refused'); + const ch2 = await m.json('/api/auth/challenge', { address: addr[A] }); + const ver = await m.json('/api/auth/verify', { address: addr[A], signature: await W[A].signer.signMessage(ch2.message) }); + ok(ver.ok && !!m.jar['bl.sid'], 'wallet signature sign-in sets session', ver); + const my = await m.json('/api/my'); + ok(my.spots && my.spots.length >= 2, 'A owns 2+ spots', my.spots && my.spots.length); + let my2 = my, onChain = await paidTo(addr[A]); + if (BigInt(my2.paidOutWei) !== onChain) { await sleep(2500); my2 = await m.json('/api/my'); onChain = await paidTo(addr[A]); } // a keeper buy may land in between + ok(BigInt(my2.paidOutWei) === onChain && onChain > 0n, 'A paid out matches Paid events on chain (' + ethers.formatEther(onChain) + ' POL)', my2.paidOutWei); + ok(BigInt(my.paidInWei) === 2n * q, 'A paid in = 2 spots', my.paidInWei); + ok(my.directs && my.directs.length === 2 && my.directs.some(x => x.address === addr[B].toLowerCase()), 'A directs = B and E (buyFor sponsor)', my.directs); + ok(my.share.endsWith('?ref=' + addr[A].toLowerCase()), 'share link'); + const sid = my.spots[my.spots.length - 1].id; + ok((await m.json('/api/my/spot/' + sid, { link: 'http://example.org/' }))._status === 400, 'http link refused'); + ok((await m.json('/api/my/spot/' + sid, { link: 'https://192.168.1.1/' }))._status === 400, 'IP link refused'); + ok((await m.json('/api/my/spot/' + sid, { link: 'https://bit.ly/x' }))._status === 400, 'shortener refused'); + ok((await m.json('/api/my/spot/' + sid, { link: 'javascript:alert(1)' }))._status === 400, 'javascript: refused'); + ok((await m.json('/api/my/spot/' + sid, { link: 'https://example.org/landing' })).ok, 'https link saved'); + const otherSpot = (await u.json('/api/stats')).recent.find(s => s.owner === addr[B].toLowerCase()); + ok((await m.json('/api/my/spot/' + otherSpot.id, { link: 'https://example.org/' }))._status === 403, 'cannot edit someone else\'s spot'); + const up = await (await m.req('/api/my/upload?for=' + sid, { method: 'POST', headers: { 'Content-Type': 'image/png' }, body: png(468, 60) })).json(); + ok(up.ok && /^\/art\/u\//.test(up.img), 'PNG 468x60 upload saved', up); + ok((await m.req(up.img)).status === 200, 'uploaded image served'); + const upBad = await (await m.req('/api/my/upload?for=' + sid, { method: 'POST', headers: { 'Content-Type': 'image/png' }, body: png(300, 250) })).json(); + ok(!!upBad.error, 'wrong size refused', upBad); + const upBig = await m.req('/api/my/upload?for=' + sid, { method: 'POST', headers: { 'Content-Type': 'image/png' }, body: Buffer.concat([png(468, 60), Buffer.alloc(160 * 1024)]) }); + ok(upBig.status === 400, 'over 150 KB refused'); + ok((await m.json('/api/my/default', { link: 'https://example.org/default' })).ok, 'default link saved'); + const bd4 = await v.json('/api/board'); const t = bd4.tiles.find(x => x.id === sid); + ok(t && t.img === up.img, 'board shows the uploaded image for that spot'); + const go = await v.req('/go/' + sid); ok(go.headers.get('location') === 'https://example.org/landing', 'click relay goes to the member link'); + + // ---- 6. keeper ---- + console.log('6. keeper (stall set to 36 s for the test)'); + const adm = await u.json('/api/admin/status', undefined, { 'x-admin-token': ADMIN }); + ok(adm.keeper && adm.keeper.enabled && !JSON.stringify(adm).includes(W[7].signer.privateKey.slice(2, 20)), 'keeper on, key never in output'); + let fb = null; + for (let i = 0; i < 40 && !fb; i++) { const s = await u.json('/api/stats'); fb = (s.recent || []).find(x => x.kind === 2 || x.kind === 3); if (!fb) await sleep(2000); } + ok(fb && fb.kind === 2 && fb.owner === addr[A].toLowerCase(), 'keeper fundBuy gifted a spot to A (builder, longest wait)', fb); + const adm2 = await u.json('/api/admin/status', undefined, { 'x-admin-token': ADMIN }); + ok(adm2.keeper.log.some(e => e.status === 'mined'), 'keeper log shows the mined tx', adm2.keeper.log.slice(0, 3)); + const logTxt = fs.readFileSync(path.join(OUT, 'server.log'), 'utf8'); + ok(!logTxt.includes(W[7].signer.privateKey.slice(2)), 'keeper key not in server log'); + + // ---- 7. pages in a browser ---- + if (!process.env.SKIP_UI) { + console.log('7. Playwright: page renders + full UI gate'); + const { chromium } = require(PW); + const browser = await chromium.launch(); + const errors = []; + const watch = (pg, name) => { pg.on('console', msg => { if (msg.type() === 'error') errors.push(name + ': ' + msg.text() + ' @ ' + ((msg.location() || {}).url || '')); }); pg.on('pageerror', e => errors.push(name + ': ' + e.message)); }; + // member context: signed in, gate skipped + const ctxM = await browser.newContext(); await ctxM.addCookies([{ name: 'bl.sid', value: m.jar['bl.sid'], url: BASE }]); + for (const p of ['/', '/board', '/how', '/join', '/my']) { + const pg = await ctxM.newPage(); watch(pg, 'member ' + p); + await pg.goto(BASE + p, { waitUntil: 'networkidle' }); + await pg.screenshot({ path: path.join(OUT, 'member' + (p === '/' ? '-home' : p.replace('/', '-')) + '.png'), fullPage: true }); + const foot = await pg.textContent('footer').catch(() => ''); ok(/Part of the Crypto Team Build Network/.test(foot || ''), 'member ' + p + ' renders with footer'); + if (p === '/my') { await pg.waitForSelector('#dash:not([hidden])', { timeout: 8000 }).catch(() => {}); ok(await pg.isVisible('#dash'), '/my dashboard visible'); ok((await pg.$$('.spot-ed')).length >= 3, '/my spot editors listed'); } + if (p === '/join') { await pg.waitForSelector('#buyCard:not([hidden])', { timeout: 8000 }).catch(() => {}); const price = await pg.textContent('#price'); ok(/^0\.0025/.test(price), '/join shows price ' + price); } + const em = await pg.evaluate(() => document.body.innerText.includes('\u2014')); ok(!em, p + ' has no em dash'); + await pg.close(); + } + // visitor context: full gate in the UI + const ctxV = await browser.newContext(); const pg = await ctxV.newPage(); watch(pg, 'visitor /'); + await pg.goto(BASE + '/?ref=' + addr[B], { waitUntil: 'domcontentloaded' }); + await pg.waitForSelector('#gate:not([hidden])'); + for (let i = 0; i < 8; i++) { + await pg.waitForSelector('#gNext:not([hidden])', { timeout: 20000 }); + const label = await pg.textContent('#gNext'); await pg.click('#gNext'); + if (label === 'Continue') break; + } + await pg.waitForSelector('#open:not([hidden])', { timeout: 5000 }).catch(() => {}); + ok(await pg.isVisible('#joinBtn'), 'UI gate completes and Join unlocks'); + await pg.screenshot({ path: path.join(OUT, 'visitor-after-gate.png'), fullPage: true }); + const pj = await ctxV.newPage(); watch(pj, 'visitor /join'); await pj.goto(BASE + '/join', { waitUntil: 'networkidle' }); + ok(await pj.isVisible('#buyCard'), 'visitor /join unlocked after gate'); + // fresh visitor: /join is locked + // visitor = IP + UA, so a fresh visitor needs its own UA + const ctxL = await browser.newContext({ userAgent: 'Mozilla/5.0 (fresh visitor) Chrome/130' }); const pl = await ctxL.newPage(); watch(pl, 'locked /join'); await pl.goto(BASE + '/join', { waitUntil: 'networkidle' }); + ok(await pl.isVisible('#locked'), 'fresh visitor /join is locked'); + const pm = await ctxL.newPage(); watch(pm, 'signed-out /my'); await pm.goto(BASE + '/my', { waitUntil: 'networkidle' }); ok(await pm.isVisible('#signin'), 'signed-out /my shows sign-in'); + await browser.close(); + // example.com pages inside the gate frame may log their own errors; only ours count + const ours = errors.filter(e => !/example\.(com|net|org)/.test(e)); // gate frames load example.* sites; their own 404s (favicon) are not ours + ok(ours.length === 0, 'no console errors on our pages', ours); + } + console.log('\n' + pass + ' passed, ' + fail + ' failed. Output in ' + OUT); + cleanup(); process.exit(fail ? 1 : 0); +} +main().catch(e => { console.error(e); cleanup(); process.exit(1); }); diff --git a/qa/sync-abi.js b/qa/sync-abi.js new file mode 100644 index 0000000..f848fd8 --- /dev/null +++ b/qa/sync-abi.js @@ -0,0 +1,5 @@ +// Copy the compiled BannerLine abi into the app (run after `forge build` in ../contracts). +const fs = require('fs'), path = require('path'); +const src = path.join(__dirname, '..', '..', 'contracts', 'out', 'BannerLine.sol', 'BannerLine.json'); +fs.writeFileSync(path.join(__dirname, '..', 'contract-abi.json'), JSON.stringify(require(src).abi, null, 1)); +console.log('contract-abi.json updated from', src); diff --git a/safety.js b/safety.js new file mode 100644 index 0000000..989336e --- /dev/null +++ b/safety.js @@ -0,0 +1,57 @@ +// Link + image checks for My Spots. https only, a real public hostname, no tricks; uploads must be a real +// PNG/JPG/GIF at 468x60 (or 936x120 retina) and at most 150 KB. +const net = require('net'); + +const MAX_UPLOAD = 150 * 1024; +const BAD_HOST = /(^|\.)(localhost|local|internal|lan|home|corp|onion|test|invalid|example)$/i; +// shorteners and redirectors hide where a click goes; a member link must show its real destination +const REDIRECTORS = /(^|\.)(bit\.ly|tinyurl\.com|t\.co|goo\.gl|is\.gd|cutt\.ly|ow\.ly|rebrand\.ly|shorturl\.at|rb\.gy|s\.id|t\.ly|v\.gd|bl\.ink|tiny\.cc)$/i; + +function checkLink(raw, what) { + what = what || 'Link'; + const s = String(raw || '').trim(); + if (!s) return { error: what + ' is empty.' }; + if (s.length > 600) return { error: what + ' is too long (600 characters max).' }; + if (/[\s<>"'`\\]/.test(s)) return { error: what + ' has spaces or characters a web address cannot have.' }; + let u; try { u = new URL(s); } catch (e) { return { error: what + ' is not a valid web address.' }; } + if (u.protocol !== 'https:') return { error: what + ' must start with https://' }; + if (u.username || u.password) return { error: what + ' cannot contain a username or password.' }; + const h = u.hostname.toLowerCase().replace(/\.$/, ''); + if (net.isIP(h.replace(/^\[|\]$/g, ''))) return { error: what + ' must use a domain name, not an IP address.' }; + if (!h.includes('.') || BAD_HOST.test(h)) return { error: what + ' must point to a public website.' }; + if (!/^[a-z0-9.-]+$/.test(h) && !/^xn--/.test(h)) return { error: what + ' has an unusual domain name.' }; + if (REDIRECTORS.test(h)) return { error: 'Use the real destination, not a link shortener.' }; + if (u.port && !['443', ''].includes(u.port)) return { error: what + ' must use the normal https port.' }; + return { ok: true, url: u.toString() }; +} + +function imageInfo(buf) { + if (!buf || buf.length < 24) return null; + if (buf.slice(0, 8).equals(Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]))) + return { type: 'png', ext: '.png', w: buf.readUInt32BE(16), h: buf.readUInt32BE(20) }; + if (buf.slice(0, 6).toString('latin1') === 'GIF87a' || buf.slice(0, 6).toString('latin1') === 'GIF89a') + return { type: 'gif', ext: '.gif', w: buf.readUInt16LE(6), h: buf.readUInt16LE(8) }; + if (buf[0] === 0xff && buf[1] === 0xd8) { + let i = 2; + while (i + 9 < buf.length) { + if (buf[i] !== 0xff) { i++; continue; } + const m = buf[i + 1]; + if (m >= 0xc0 && m <= 0xcf && m !== 0xc4 && m !== 0xc8 && m !== 0xcc) return { type: 'jpg', ext: '.jpg', h: buf.readUInt16BE(i + 5), w: buf.readUInt16BE(i + 7) }; + if (m === 0xd8 || m === 0x01 || (m >= 0xd0 && m <= 0xd7)) { i += 2; continue; } + i += 2 + buf.readUInt16BE(i + 2); + } + return { type: 'jpg', ext: '.jpg', w: 0, h: 0 }; + } + return null; +} +function checkImage(buf) { + if (!buf || !buf.length) return { error: 'No file received.' }; + if (buf.length > MAX_UPLOAD) return { error: 'That file is ' + Math.ceil(buf.length / 1024) + ' KB. The limit is 150 KB.' }; + const info = imageInfo(buf); + if (!info) return { error: 'Upload a PNG, JPG or GIF file.' }; + const ok = (info.w === 468 && info.h === 60) || (info.w === 936 && info.h === 120); + if (!ok) return { error: 'The image is ' + info.w + 'x' + info.h + '. It must be 468x60 (or 936x120).' }; + return { ok: true, info }; +} + +module.exports = { checkLink, checkImage, imageInfo, MAX_UPLOAD }; diff --git a/server.js b/server.js new file mode 100644 index 0000000..baa57d2 --- /dev/null +++ b/server.js @@ -0,0 +1,331 @@ +// Banner Line web app (downlinebanners.com). Plain Node http server, no framework (InstantAdPay pattern). +// Pages: / (gate, then board + join), /board, /join (buy), /my (My Spots + dashboard), /how. +// Chain index: chain.js. Board/rotation: board.js. Creative + link checks: safety.js. Keeper: keeper.js. +const http = require('http'); +const fs = require('fs'); +const path = require('path'); +const crypto = require('crypto'); +const { verifyMessage, getAddress } = require('ethers'); +const cfgMod = require('./config'); +const chain = require('./chain'); +const store = require('./store'); +const board = require('./board'); +const safety = require('./safety'); +const keeper = require('./keeper'); +const { iface } = require('./abi'); +const SEL = { buy: iface.getFunction('buy').selector, buyFor: iface.getFunction('buyFor').selector }; // the browser builds calldata from these (ABI stays in abi.js) + +const C = cfgMod.get(); +fs.mkdirSync(path.join(C.dataDir, 'art'), { recursive: true }); +store.load(); +chain.init(); +keeper.init(); + +const PUB = path.join(__dirname, 'public'); +const ADDR_RE = /^0x[0-9a-fA-F]{40}$/; +const BOT_UA = /bot|crawl|spider|slurp|facebookexternalhit|preview|monitor|wget|curl|python-requests|httpclient|scrapy|semrush|ahrefs/i; +const SECRET = (() => { + if (process.env.SESSION_SECRET) return process.env.SESSION_SECRET; + const f = path.join(C.dataDir, '.secret'); + try { return fs.readFileSync(f, 'utf8').trim(); } catch (e) {} + const s = crypto.randomBytes(32).toString('hex'); try { fs.writeFileSync(f, s, { mode: 0o600 }); } catch (e) {} return s; +})(); +const hmac = s => crypto.createHmac('sha256', SECRET).update(s).digest('hex').slice(0, 32); + +// ---- http helpers ---- +const MIME = { '.html': 'text/html; charset=utf-8', '.css': 'text/css', '.js': 'text/javascript', '.png': 'image/png', '.jpg': 'image/jpeg', + '.gif': 'image/gif', '.svg': 'image/svg+xml', '.ico': 'image/x-icon', '.json': 'application/json', '.txt': 'text/plain; charset=utf-8' }; +const CSP = "default-src 'self'; script-src 'self' https://cdn.jsdelivr.net; worker-src 'self' blob:; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; " + + "img-src 'self' data: blob: https:; connect-src 'self' https://*.walletconnect.com wss://*.walletconnect.com https://*.walletconnect.org wss://*.walletconnect.org " + + "https://*.reown.com wss://*.reown.com https://*.reown.org wss://*.reown.org https://*.web3modal.org https://*.drpc.org https://*.publicnode.com https://*.coinbase.com; " + + "font-src 'self' data: https://fonts.gstatic.com https://fonts.reown.com; form-action 'self'; frame-src https: 'self'"; +function headers(extra) { return Object.assign({ 'Content-Security-Policy': CSP, 'X-Content-Type-Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin' }, extra || {}); } +function json(res, code, obj, extra) { res.writeHead(code, headers(Object.assign({ 'Content-Type': 'application/json', 'Cache-Control': 'no-store' }, extra))); res.end(JSON.stringify(obj)); } +function sendFile(res, file, extra) { + fs.readFile(file, (err, data) => { + if (err) { res.writeHead(404, headers({ 'Content-Type': 'text/plain' })); return res.end('Not found'); } + const ext = path.extname(file).toLowerCase(); + res.writeHead(200, headers(Object.assign({ 'Content-Type': MIME[ext] || 'application/octet-stream', 'Cache-Control': ext === '.html' ? 'no-store, must-revalidate' : 'public, max-age=3600' }, extra))); + res.end(data); + }); +} +function readRaw(req, max) { + return new Promise((resolve, reject) => { const ch = []; let n = 0; + // over the limit: keep draining (so the 400 reaches the client) but store nothing; cut the socket only far past it + req.on('data', c => { n += c.length; if (n > max * 8) { req.destroy(); return; } if (n <= max) ch.push(c); }); + req.on('end', () => n > max ? reject(new Error('too big')) : resolve(Buffer.concat(ch))); req.on('error', reject); }); +} +async function readBody(req) { const b = await readRaw(req, 32 * 1024); try { return b.length ? JSON.parse(b.toString('utf8')) : {}; } catch (e) { return {}; } } +function cookies(req) { const o = {}; for (const p of (req.headers.cookie || '').split(';')) { const i = p.indexOf('='); if (i > 0) { try { o[p.slice(0, i).trim()] = decodeURIComponent(p.slice(i + 1).trim()); } catch (e) {} } } return o; } +function cookie(name, val, maxAgeSec, httpOnly) { return name + '=' + encodeURIComponent(val) + '; Path=/; SameSite=Lax; Max-Age=' + maxAgeSec + (httpOnly ? '; HttpOnly' : '') + (C.isProd ? '; Secure' : ''); } +function ip(req) { return String(req.headers['cf-connecting-ip'] || (req.headers['x-forwarded-for'] || '').split(',')[0] || req.socket.remoteAddress || '').trim(); } +const isBot = req => BOT_UA.test(req.headers['user-agent'] || '') || !req.headers['user-agent']; +// visitor = IP + user agent (not a cookie: traffic-exchange frames drop cookies, and the gate must work there) +function visitorKey(req) { return crypto.createHash('sha256').update(ip(req) + '|' + (req.headers['user-agent'] || '')).digest('hex').slice(0, 20); } + +// per-IP fixed-window limiter +const buckets = new Map(); +function limited(req, name, max, windowMs) { + const k = name + ':' + ip(req); const now = Date.now(); let b = buckets.get(k); + if (!b || now - b.t > windowMs) { b = { t: now, n: 0 }; buckets.set(k, b); } + if (buckets.size > 100000) buckets.clear(); + return ++b.n > max; +} + +// ---- sponsor ref (?ref=
    ) ---- +const refCache = new Map(); +async function resolveRef(raw) { + const r = String(raw || '').trim(); + if (ADDR_RE.test(r)) return r.toLowerCase(); + if (!/^[a-zA-Z0-9_.-]{2,32}$/.test(r) || !C.iapResolveUrl) return null; + const hit = refCache.get(r.toLowerCase()); if (hit && Date.now() - hit.at < 3600000) return hit.a; + let a = null; + try { const ac = new AbortController(); setTimeout(() => ac.abort(), 4000).unref(); + const j = await (await fetch(C.iapResolveUrl + encodeURIComponent(r), { signal: ac.signal })).json(); + if (j && ADDR_RE.test(j.address || '')) a = j.address.toLowerCase(); } catch (e) {} + refCache.set(r.toLowerCase(), { at: Date.now(), a }); return a; +} +const sponsorOf = req => { const v = cookies(req)['bl.ref']; return ADDR_RE.test(v || '') ? v.toLowerCase() : null; }; + +// ---- sessions (wallet signature sign-in) ---- +const challenges = new Map(); +function session(req) { const s = store.session(cookies(req)['bl.sid']); return s; } + +// ---- gate ---- +const gates = new Map(); // gid -> plan +const GATE_TTL = 2 * 3600000; +function passToken(vk) { const exp = Date.now() + 24 * 3600000; return exp + '.' + hmac('pass:' + vk + ':' + exp); } +const passedKeys = new Map(); // vk -> expiry, for visitors whose browser dropped the pass cookie (framed) +function passed(req) { + const vk = visitorKey(req); + if ((passedKeys.get(vk) || 0) > Date.now()) return true; + const t = cookies(req)['bl.pass'] || ''; const [exp, sig] = t.split('.'); + return Number(exp) > Date.now() && sig === hmac('pass:' + vk + ':' + exp); +} +async function visitStep(role, ref, img, link, title) { + return { type: 'visit', role, ref: String(ref), img, title: title || '', seconds: C.gateVisitSeconds, frame: await board.frameable(link), open: '/go/' + ref }; +} +async function makeGate(req) { + const vk = visitorKey(req); const steps = []; + const sp = sponsorOf(req); const sSpot = sp && board.newestOf(sp); + if (sSpot) { const cr = board.creative(sSpot); steps.push(await visitStep('sponsor', sSpot.id, cr.img, cr.link, 'Your sponsor\'s newest spot')); } + steps.push({ type: 'board', tiles: board.pick(), seconds: C.gateBoardSeconds }); + const nw = board.newest(3, sSpot ? [sSpot.id] : []); + for (const s of nw) { const cr = board.creative(s); steps.push(await visitStep('newest', s.id, cr.img, cr.link, 'Spot #' + s.id)); } + const house = cfgMod.house().filter(h => h.link.startsWith('https://')); let hi = 0; + while (steps.filter(x => x.role === 'newest' || x.role === 'house').length < 3 && house.length) { const h = house[hi++ % house.length]; steps.push(await visitStep('house', 'h-' + h.key, h.img, h.link, h.title)); if (hi > 6) break; } + const gid = crypto.randomBytes(12).toString('hex'); + const g = { gid, vk, created: Date.now(), steps, idx: 0, stepStart: 0 }; + gates.set(gid, g); + if (gates.size > 20000) { const cut = Date.now() - GATE_TTL; for (const [k, v] of gates) if (v.created < cut) gates.delete(k); } + return g; +} + +// one-time board tokens for organic views +const boardTokens = new Map(); + +// ---- dashboard data ---- +function spotView(s) { + const v = store.views(s.id); const m = store.spotMeta(s.id) || {}; const cr = board.creative(s); const now = Date.now(); + const left = Math.max(0, C.spotDays - Math.floor((now - s.boughtAt) / 86400000)); + return { id: s.id, kind: s.kind, boughtAt: s.boughtAt, tx: s.tx, valueWei: s.valueWei, views: v.total, gateViews: v.gate, owed: C.viewsOwed, + clicks: store.clicks(s.id), daysLeft: left, delivering: s.kind !== 3 && left > 0 && v.total < C.viewsOwed, + img: m.img || '', link: m.link || '', showing: cr }; +} +function myData(addr) { + const a = addr.toLowerCase(); + const mine = chain.spotsOf(a).map(spotView); + const w = chain.walletTotals(a); + const dir = chain.directs(a).map(m => { const ss = chain.spotsOf(m.address); return { address: m.address, joinedAt: m.joinedAt, spots: ss.length, paidSpots: ss.filter(x => x.kind === 0).length, + paidInWei: ss.filter(x => x.kind === 0 || x.kind === 1).reduce((t, x) => t + BigInt(x.valueWei), 0n).toString() }; }); + const me = chain.member(a); + return { address: a, member: chain.isMember(a), sponsor: me ? me.sponsor : null, spots: mine, paidInWei: w.inWei, paidOutWei: w.outWei, byRole: w.byRole, + payouts: chain.paidOf(a).slice(0, 50), directs: dir, defaults: store.memberDefault(a) || {}, share: 'https://' + C.site + '/?ref=' + a }; +} + +// ---- server ---- +const server = http.createServer(async (req, res) => { + const u = new URL(req.url, 'http://x'); const p = u.pathname; + try { + // visitor cookie (used for rate limits only) + const ck = cookies(req); const setVid = !ck['bl.vid'] && !isBot(req) ? cookie('bl.vid', crypto.randomBytes(9).toString('hex'), 365 * 86400, true) : null; + const extra = setVid ? { 'Set-Cookie': setVid } : {}; + + // -- pages + if (req.method === 'GET' || req.method === 'HEAD') { + const PAGES = { '/': 'index.html', '/board': 'board.html', '/join': 'join.html', '/my': 'my.html', '/how': 'how.html' }; + if (PAGES[p]) { + const set = []; + if (setVid) set.push(setVid); + if (u.searchParams.get('ref')) { const a = await resolveRef(u.searchParams.get('ref')); if (a) set.push(cookie('bl.ref', a, 90 * 86400, false)); } + const ex = set.length ? { 'Set-Cookie': set } : {}; + if (p === '/my') ex['X-Frame-Options'] = 'DENY'; // member board: never framed (public pages stay frameable for traffic exchanges) + return sendFile(res, path.join(PUB, PAGES[p]), ex); + } + if (/^\/r\/[^/]+$/.test(p)) { res.writeHead(302, { Location: '/?ref=' + encodeURIComponent(decodeURIComponent(p.slice(3))) }); return res.end(); } + if (p.startsWith('/assets/') || p.startsWith('/art/house-') || p === '/logo-icon.png' || p === '/robots.txt') { + const f = path.normalize(path.join(PUB, p)); if (!f.startsWith(PUB)) { res.writeHead(400); return res.end(); } + return sendFile(res, f); + } + if (p.startsWith('/art/u/')) { + const name = path.basename(p); if (!/^[a-z0-9-]+\.(png|jpg|gif)$/.test(name)) { res.writeHead(404); return res.end(); } + return sendFile(res, path.join(C.dataDir, 'art', name), { 'Cache-Control': 'public, max-age=86400' }); + } + // click relay: /go/[?g=&i=] (gate visits counted apart from organic clicks) + if (/^\/go\/[\w-]+$/.test(p)) { + const ref = p.slice(4); const t = board.target(ref); + if (!t) { res.writeHead(302, { Location: '/' }); return res.end(); } + if (t.spotId && !isBot(req)) { + const g = gates.get(u.searchParams.get('g') || ''); const gi = Number(u.searchParams.get('i')); + const isGate = g && g.vk === visitorKey(req) && g.steps[gi] && g.steps[gi].ref === ref; + store.addClick(t.spotId, visitorKey(req), isGate ? 'gate' : 'organic'); + } + const loc = t.link.startsWith('/') ? t.link : t.link; + res.writeHead(302, { Location: loc, 'Cache-Control': 'no-store', 'Referrer-Policy': 'origin' }); return res.end(); + } + } + + // -- public API + if (p === '/api/config' && req.method === 'GET') { + return json(res, 200, { site: C.site, chainId: C.chainId, chainName: C.chainName, contract: C.contract, rpc: C.publicRpc, explorer: C.explorer, + walletConnectProjectId: C.walletConnectProjectId, viewsOwed: C.viewsOwed, spotDays: C.spotDays, priceUsd: 5, ready: !!C.contract, sel: SEL }, extra); + } + if (p === '/api/quote' && req.method === 'GET') { + try { return json(res, 200, await chain.quote()); } catch (e) { return json(res, 503, { error: e.message }); } + } + if (p === '/api/gas' && req.method === 'GET') { try { return json(res, 200, await chain.suggestedFees()); } catch (e) { return json(res, 200, {}); } } + if (/^\/api\/tx\/0x[0-9a-fA-F]{64}$/.test(p)) { try { return json(res, 200, await chain.receipt(p.slice(8))); } catch (e) { return json(res, 200, { found: false }); } } + if (p === '/api/stats' && req.method === 'GET') { + const t = chain.totals(); const recent = chain.spots().slice(0, 10).map(s => ({ id: s.id, owner: s.owner, kind: s.kind, boughtAt: s.boughtAt, tx: s.tx })); + return json(res, 200, { totals: t, index: chain.status(), recent, daily: store.daily() }); + } + if (p === '/api/sponsor' && req.method === 'GET') { + const raw = u.searchParams.get('ref'); const a = raw ? await resolveRef(raw) : sponsorOf(req); + return json(res, 200, { address: a || null, member: a ? chain.isMember(a) : false }); + } + + // board: organic view counting with a one-time token, after 5 s on screen + if (p === '/api/board' && req.method === 'GET') { + const tiles = board.pick(); const token = crypto.randomBytes(12).toString('hex'); + if (!isBot(req)) boardTokens.set(token, { at: Date.now(), vk: visitorKey(req), ids: tiles.filter(t => t.t === 'spot').map(t => t.id) }); + if (boardTokens.size > 50000) { const cut = Date.now() - 600000; for (const [k, v] of boardTokens) if (v.at < cut) boardTokens.delete(k); } + return json(res, 200, { tiles, token }, extra); + } + if (p === '/api/board/seen' && req.method === 'POST') { + const b = await readBody(req); const t = boardTokens.get(String(b.token || '')); + if (!t || t.vk !== visitorKey(req) || Date.now() - t.at < 4500 || Date.now() - t.at > 600000) return json(res, 200, { counted: 0 }); + boardTokens.delete(b.token); + if (limited(req, 'views', 400, 3600000)) return json(res, 200, { counted: 0 }); + let n = 0; for (const id of t.ids) if (store.addView(id, t.vk, 'organic')) n++; + return json(res, 200, { counted: n }); + } + + // gate + if (p === '/api/gate' && req.method === 'GET') { + const s = session(req); + if (isBot(req)) return json(res, 200, { passed: true, bot: true }); + if (passed(req) || (s && chain.isMember(s.address))) return json(res, 200, { passed: true }); + if (limited(req, 'gate', 60, 3600000)) return json(res, 429, { error: 'Too many gate starts from this connection. Try again in a while.' }); + const g = await makeGate(req); + return json(res, 200, { passed: false, gid: g.gid, steps: g.steps.map(st => Object.assign({}, st)) }, extra); + } + if (p === '/api/gate/begin' && req.method === 'POST') { + const b = await readBody(req); const g = gates.get(String(b.gid || '')); + if (!g || g.vk !== visitorKey(req)) return json(res, 400, { error: 'Gate expired. Reload the page.' }); + if (Number(b.i) !== g.idx) return json(res, 400, { error: 'Out of order.', idx: g.idx }); + g.stepStart = Date.now(); return json(res, 200, { ok: true }); + } + if (p === '/api/gate/done' && req.method === 'POST') { + const b = await readBody(req); const g = gates.get(String(b.gid || '')); + if (!g || g.vk !== visitorKey(req)) return json(res, 400, { error: 'Gate expired. Reload the page.' }); + const st = g.steps[g.idx]; + if (Number(b.i) !== g.idx || !st || !g.stepStart) return json(res, 400, { error: 'Out of order.', idx: g.idx }); + if (Date.now() - g.stepStart < (st.seconds - 1.5) * 1000) return json(res, 400, { error: 'Keep the page open until the timer ends.' }); + if (st.type === 'board' && !limited(req, 'views', 400, 3600000)) for (const t of st.tiles) if (t.t === 'spot') store.addView(t.id, g.vk, 'gate'); + g.idx += 1; g.stepStart = 0; + if (g.idx >= g.steps.length) { gates.delete(g.gid); passedKeys.set(g.vk, Date.now() + 86400000); if (passedKeys.size > 100000) passedKeys.clear(); return json(res, 200, { ok: true, passed: true }, { 'Set-Cookie': cookie('bl.pass', passToken(g.vk), 86400, true) }); } + return json(res, 200, { ok: true, idx: g.idx }); + } + + // wallet sign-in + if (p === '/api/auth/challenge' && req.method === 'POST') { + if (limited(req, 'auth', 30, 600000)) return json(res, 429, { error: 'Too many sign-in attempts. Wait a few minutes.' }); + const b = await readBody(req); if (!ADDR_RE.test(b.address || '')) return json(res, 400, { error: 'Bad address' }); + const a = b.address.toLowerCase(); const nonce = crypto.randomBytes(16).toString('hex'); + const message = C.site + ' wants you to sign in with your wallet:\n' + getAddress(a) + '\n\nBanner Line sign-in. This signature is free and cannot move funds or approve anything.\n\nChain ID: ' + C.chainId + '\nNonce: ' + nonce + '\nIssued At: ' + new Date().toISOString(); + challenges.set(a, { message, exp: Date.now() + 600000 }); + if (challenges.size > 20000) challenges.clear(); + return json(res, 200, { message }); + } + if (p === '/api/auth/verify' && req.method === 'POST') { + const b = await readBody(req); const a = String(b.address || '').toLowerCase(); const ch = challenges.get(a); + if (!ch || ch.exp < Date.now()) return json(res, 400, { error: 'Sign-in request expired. Tap sign in again.' }); + let rec; try { rec = verifyMessage(ch.message, String(b.signature || '')).toLowerCase(); } catch (e) { return json(res, 400, { error: 'Invalid signature.' }); } + if (rec !== a) return json(res, 400, { error: 'Your wallet signed with a different account (' + rec.slice(0, 6) + '...' + rec.slice(-4) + '). Switch accounts and try again.' }); + challenges.delete(a); + const token = store.mintSession(a); + return json(res, 200, { ok: true, address: a }, { 'Set-Cookie': cookie('bl.sid', token, store.SESSION_TTL / 1000, true) }); + } + if (p === '/api/auth/logout' && req.method === 'POST') { + const s = session(req); if (s) store.dropSession(s.token); + return json(res, 200, { ok: true }, { 'Set-Cookie': cookie('bl.sid', '', 0, true) }); + } + if (p === '/api/me' && req.method === 'GET') { + const s = session(req); if (!s) return json(res, 200, { signedIn: false, sponsor: sponsorOf(req) }); + store.touch(s.address); + return json(res, 200, { signedIn: true, address: s.address, member: chain.isMember(s.address), sponsor: sponsorOf(req) }); + } + + // -- member API (signed in) + if (p.startsWith('/api/my')) { + const s = session(req); if (!s) return json(res, 401, { error: 'Sign in with your wallet first.' }); + const me = s.address; + if (p === '/api/my' && req.method === 'GET') return json(res, 200, myData(me)); + let m = /^\/api\/my\/spot\/(\d+)$/.exec(p); + if (m && req.method === 'POST') { + const sp = chain.spot(m[1]); if (!sp || sp.owner !== me) return json(res, 403, { error: 'That spot is not yours.' }); + const b = await readBody(req); const out = {}; + if (b.link !== undefined) { if (b.link === '') out.link = ''; else { const r = safety.checkLink(b.link, 'Target link'); if (r.error) return json(res, 400, r); out.link = r.url; } } + if (b.img !== undefined && !String(b.img).startsWith('/art/u/')) { if (b.img === '') out.img = ''; else { const r = safety.checkLink(b.img, 'Image URL'); if (r.error) return json(res, 400, r); out.img = r.url; } } + return json(res, 200, { ok: true, meta: store.setSpotMeta(sp.id, out) }); + } + if (p === '/api/my/default' && req.method === 'POST') { + const b = await readBody(req); const out = {}; + if (b.link !== undefined) { if (b.link === '') out.link = ''; else { const r = safety.checkLink(b.link, 'Default link'); if (r.error) return json(res, 400, r); out.link = r.url; } } + if (b.img !== undefined && !String(b.img).startsWith('/art/u/')) { if (b.img === '') out.img = ''; else { const r = safety.checkLink(b.img, 'Image URL'); if (r.error) return json(res, 400, r); out.img = r.url; } } + return json(res, 200, { ok: true, defaults: store.setMemberDefault(me, out) }); + } + if (p === '/api/my/upload' && req.method === 'POST') { + if (limited(req, 'upload', 40, 3600000)) return json(res, 429, { error: 'Too many uploads this hour.' }); + const target = u.searchParams.get('for') || ''; + let sp = null; + if (target !== 'default') { sp = chain.spot(target); if (!sp || sp.owner !== me) return json(res, 403, { error: 'That spot is not yours.' }); } + let buf; try { buf = await readRaw(req, safety.MAX_UPLOAD + 1); } catch (e) { return json(res, 400, { error: 'The file is over 150 KB.' }); } + const r = safety.checkImage(buf); if (r.error) return json(res, 400, r); + const name = (sp ? 's' + sp.id : 'd' + me.slice(2, 10)) + '-' + crypto.randomBytes(5).toString('hex') + r.info.ext; + fs.writeFileSync(path.join(C.dataDir, 'art', name), buf); + const img = '/art/u/' + name; + if (sp) store.setSpotMeta(sp.id, { img }); else store.setMemberDefault(me, { img }); + return json(res, 200, { ok: true, img }); + } + return json(res, 404, { error: 'Not found' }); + } + + // -- admin (ADMIN_TOKEN header): keeper preview + index status. No key material is ever returned. + if (p === '/api/admin/status' && req.method === 'GET') { + const tok = process.env.ADMIN_TOKEN; if (!tok || req.headers['x-admin-token'] !== tok) return json(res, 401, { error: 'no' }); + return json(res, 200, { index: chain.status(), totals: chain.totals(), keeper: keeper.statusInfo() }); + } + + if (p.startsWith('/api/')) return json(res, 404, { error: 'Not found' }); + res.writeHead(404, headers({ 'Content-Type': 'text/html; charset=utf-8' })); + return res.end('Not found

    Not found. Banner Line home

    '); + } catch (e) { + console.error('request', p, e.message); + if (!res.headersSent) json(res, 500, { error: 'Server error' }); + } +}); + +server.listen(C.port, () => console.log('Banner Line on :' + C.port + ' chain ' + C.chainName + ' (' + C.chainId + ') contract ' + (C.contract || '(not set)'))); +process.on('SIGTERM', () => { store.flush(); process.exit(0); }); +process.on('SIGINT', () => { store.flush(); process.exit(0); }); diff --git a/store.js b/store.js new file mode 100644 index 0000000..1510514 --- /dev/null +++ b/store.js @@ -0,0 +1,70 @@ +// JSON volume store (the InstantAdPay JSON-mode pattern: one file in DATA_DIR, atomic tmp+rename, debounced). +// Holds only what the chain does not: banner + link per spot, member defaults, views/visits delivered, +// sign-in sessions, last-seen times and the keeper log. Every function is sync and small so a MySQL +// version can replace this file behind the same names later. +const fs = require('fs'); +const path = require('path'); +const crypto = require('crypto'); +const cfgMod = require('./config'); + +let S = null, saveT = null; +const FILE = () => path.join(cfgMod.get().dataDir, 'store.json'); +function load() { + try { S = JSON.parse(fs.readFileSync(FILE(), 'utf8')); } catch (e) { S = null; } + S = Object.assign({ v: 1, spotMeta: {}, defaults: {}, views: {}, clicks: {}, seen: {}, sessions: {}, keeper: { log: [] }, daily: {} }, S || {}); + const now = Date.now(); + for (const [k, s] of Object.entries(S.sessions)) if (s.expires < now) delete S.sessions[k]; +} +function save(now) { + if (saveT && !now) return; + const run = () => { saveT = null; try { const tmp = FILE() + '.tmp'; fs.writeFileSync(tmp, JSON.stringify(S), { mode: 0o600 }); fs.renameSync(tmp, FILE()); } catch (e) { console.error('store save failed', e.message); } }; + if (now) { clearTimeout(saveT); run(); } else saveT = setTimeout(run, 1500); +} +function flush() { save(true); } + +// ---- creative per spot + member default ---- +function spotMeta(id) { return S.spotMeta[id] || null; } +function setSpotMeta(id, m) { S.spotMeta[id] = Object.assign({}, S.spotMeta[id] || {}, m, { updatedAt: Date.now() }); save(); return S.spotMeta[id]; } +function memberDefault(addr) { return S.defaults[String(addr).toLowerCase()] || null; } +function setMemberDefault(addr, m) { const a = String(addr).toLowerCase(); S.defaults[a] = Object.assign({}, S.defaults[a] || {}, m, { updatedAt: Date.now() }); save(); return S.defaults[a]; } + +// ---- views + clicks (gate and organic kept apart) ---- +// Rate limit: one counted view per visitor per spot per hour, one counted click per visitor per spot per hour. +const seenView = new Map(), seenClick = new Map(); +const HOUR = 3600000; +function prune(m) { if (m.size < 50000) return; const cut = Date.now() - HOUR; for (const [k, t] of m) if (t < cut) m.delete(k); } +function addView(spotId, visitorKey, source) { + const k = visitorKey + ':' + spotId; const t = seenView.get(k); + if (t && Date.now() - t < HOUR) return false; + seenView.set(k, Date.now()); prune(seenView); + const v = S.views[spotId] || (S.views[spotId] = { organic: 0, gate: 0 }); + v[source === 'gate' ? 'gate' : 'organic'] += 1; bumpDaily('views_' + (source === 'gate' ? 'gate' : 'organic')); save(); + return true; +} +function views(spotId) { const v = S.views[spotId] || { organic: 0, gate: 0 }; return { organic: v.organic, gate: v.gate, total: v.organic + v.gate }; } +function addClick(spotId, visitorKey, source) { + const k = visitorKey + ':' + spotId + ':' + source; const t = seenClick.get(k); + if (t && Date.now() - t < HOUR) return false; + seenClick.set(k, Date.now()); prune(seenClick); + const c = S.clicks[spotId] || (S.clicks[spotId] = { organic: 0, gate: 0 }); + c[source === 'gate' ? 'gate' : 'organic'] += 1; bumpDaily('clicks_' + (source === 'gate' ? 'gate' : 'organic')); save(); + return true; +} +function clicks(spotId) { return S.clicks[spotId] || { organic: 0, gate: 0 }; } +function bumpDaily(k) { const day = new Date().toISOString().slice(0, 10); const d = S.daily[day] || (S.daily[day] = {}); d[k] = (d[k] || 0) + 1; } +function daily() { return S.daily; } + +// ---- sessions + last seen ---- +const SESSION_TTL = 7 * 24 * HOUR; +function mintSession(address) { const token = crypto.randomBytes(32).toString('hex'); S.sessions[token] = { address: address.toLowerCase(), expires: Date.now() + SESSION_TTL }; touch(address); save(); return token; } +function session(token) { const s = token && S.sessions[token]; return s && s.expires > Date.now() ? Object.assign({ token }, s) : null; } +function dropSession(token) { delete S.sessions[token]; save(); } +function touch(address) { S.seen[String(address).toLowerCase()] = Date.now(); save(); } +function lastSeen(address) { return S.seen[String(address).toLowerCase()] || 0; } + +// ---- keeper ---- +function keeperLog(entry) { S.keeper.log.push(Object.assign({ at: Date.now() }, entry)); if (S.keeper.log.length > 2000) S.keeper.log = S.keeper.log.slice(-2000); save(true); } +function keeperEntries() { return S.keeper.log.slice(); } + +module.exports = { load, flush, spotMeta, setSpotMeta, memberDefault, setMemberDefault, addView, views, addClick, clicks, daily, + mintSession, session, dropSession, touch, lastSeen, keeperLog, keeperEntries, SESSION_TTL };