Payment proof + transparency (Marty 2026-11-13): every spot sale posts ONE message to the group's payments topic (tgproof.js: buyer, each member paid with POL and $ at the contract's price, company + fund line, Polygonscan verify + live ledger links; once across app copies via docstore.claim; never older than 2 h). New /ledger (every sale and payout, live, verify links) and /contract (verified source, owner, keeper, fee wallets, price feed, live reads, fixed split, how to check). Live sale toasts bottom-left on every page (real ledger rows only, newest 30 min). Nav + footer links. common.js?v=3, line.css?v=5. Smoke 76/76.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-13 10:35:08 -06:00
parent c6ca40a241
commit 87354e29b6
14 changed files with 259 additions and 15 deletions
+27 -2
View File
@@ -17,7 +17,7 @@ window.BL = (function () {
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']];
const links = [['/', 'Home'], ['/board', 'Board'], ['/how', 'How it works'], ['/ledger', 'Ledger'], ['/join', 'Get a spot'], ['/my', 'My Spots']];
n.innerHTML = '<div class="wrap"><a class="brand" href="/"><img src="/art/mark.svg" alt="" width="38" height="38"><span class="logo-wrap"><span class="logo">Downline <b>Banners</b></span>'
+ '<span class="byline">Part of the <b>Crypto Team Build</b> Network</span></span></a><div class="links">'
+ links.map(l => '<a href="' + l[0] + '"' + (l[0] === active ? ' class="active"' : '') + '>' + l[1] + '</a>').join('') + '</div></div>';
@@ -35,8 +35,9 @@ window.BL = (function () {
f.className = 'bl-foot';
f.innerHTML = '<div class="wrap"><p>Part of the Crypto Team Build Network</p>'
+ '<p class="muted small">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.</p>'
+ '<p class="small"><a href="/how">How it works</a> &middot; <a href="/board">Board</a> &middot; <a href="/my">My Spots</a></p></div>';
+ '<p class="small"><a href="/how">How it works</a> &middot; <a href="/board">Board</a> &middot; <a href="/ledger">Live ledger</a> &middot; <a href="/contract">Contract proof</a> &middot; <a href="/my">My Spots</a></p></div>';
document.body.appendChild(f);
toasts();
}
// one spot tile; href goes through the /go relay, which counts the click
function tile(t, opts) {
@@ -50,6 +51,30 @@ window.BL = (function () {
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;
}
// live sale toasts (Marty 2026-11-13): real sales from the ledger only, bottom-left, one at a time, never older than 30 minutes
let toastsOn = false;
async function toasts() {
if (toastsOn) return; toastsOn = true;
const seen = new Set(); let first = true;
const box = document.createElement('div'); box.className = 'bl-toasts'; box.setAttribute('aria-live', 'polite'); document.body.appendChild(box);
const show = it => {
const top = it.pays.filter(p => !p.failed).sort((a, b) => (BigInt(b.wei) > BigInt(a.wei) ? 1 : -1))[0];
const name = it.ownerName ? '@' + esc(it.ownerName) : 'A member';
const el = document.createElement('a'); el.className = 'bl-toast'; el.href = '/ledger';
el.innerHTML = '<b>' + name + '</b> took spot #' + it.spotId
+ (top ? '<br><span>' + (it.pays.length > 1 ? it.pays.length + ' members paid, ' : '') + (top.name ? '@' + esc(top.name) : 'a member') + ' got ' + fmtPol(top.wei, 2) + ' POL</span>' : '<br><span>paid on-chain, $5</span>');
box.appendChild(el); requestAnimationFrame(() => el.classList.add('in'));
setTimeout(() => { el.classList.remove('in'); setTimeout(() => el.remove(), 400); }, 7000);
};
const tick = async () => {
let d; try { d = await getJSON('/api/ledger?n=5'); } catch (e) { return; } if (!d || !d.items) return;
const fresh = d.items.filter(it => !seen.has(it.tx) && (!it.at || Date.now() - it.at < 30 * 60000));
d.items.forEach(it => seen.add(it.tx));
const list = first ? fresh.slice(0, 1) : fresh.reverse(); first = false;
list.forEach((it, i) => setTimeout(() => show(it), 1500 + i * 8000));
};
tick(); setInterval(tick, 25000);
}
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 };
})();