001878bdae
- Free text ad for network members (InstantAdPay / LinkSpin sign-in or wallet, membership through the hub), one per member - Member pages viraladblitz.com/<username>: own ad + the first 5 people above in the hub line with a live ad (by place) + 2 Boosted places - Front page: amber ticker (Boosted starred), Top ads this week by verified clicks, today's numbers, ledger, contract proof - Verified visitors / views / clicks (ticket + dwell + per-visitor dedupe + per-connection cap + bot filter, owner excluded) - Boost $5 = 500 guaranteed views through VABShop: keeper-signed EIP-712 line voucher from the hub line, watcher, delivery counted per verified view with an audit row each, Network Ad Space text-ad finishing after 30 days (vabnas.js) - Trust pack: /ledger, /contract, toasts, Telegram card per Boost (once), Terms / Earnings Disclaimer / Privacy (TrustClickz), network footer from the hub with tracked links, promo kit (21 creatives) + /promote, LinkSpin zone placeholders, hub report - Old YFW links via the oldrefs map (admin load route); docstore MySQL documents + row tables - qa/smoke.mjs 162/162 (stand-in hub, chain, Telegram, NAS; Playwright desktop + phone), qa/chain.mjs 20/20 (real VABShop on anvil) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
2.8 KiB
JavaScript
29 lines
2.8 KiB
JavaScript
// Live ledger (trust pack): every Boost with every level paid in the same transaction (and its place in the buyer's line), who was
|
|
// passed over, the company share and the Boost's delivery, from /api/ledger, refreshed every 30 seconds.
|
|
(function () {
|
|
VAB.renderNav('/ledger'); VAB.renderFooter(); VAB.wire('other').catch(() => {});
|
|
const esc = VAB.esc;
|
|
const pol = w => VAB.polOf(w) + ' POL';
|
|
const usd = c => '$' + (Number(c || 0) / 100).toFixed(2);
|
|
const who = (a, nm) => nm ? '@' + esc(nm) : '<span class="mono">' + esc(VAB.short(a || '')) + '</span>';
|
|
async function load() {
|
|
let d; try { d = await VAB.getJSON('/api/ledger?n=100'); } catch (e) { return; } if (!d || !d.items) return;
|
|
const ex = d.explorer || 'https://polygonscan.com'; const t = d.totals || {};
|
|
document.getElementById('totals').innerHTML = '<div class="stat"><b>' + VAB.n(t.boosts) + '</b><span>Boosts on-chain</span></div>'
|
|
+ '<div class="stat"><b>' + pol(t.levelsWei) + '</b><span>paid to sponsor levels, same transaction</span></div>'
|
|
+ '<div class="stat"><b>' + usd(t.usdCents) + '</b><span>in Boosts, at the price when bought</span></div>'
|
|
+ '<div class="stat"><b>0</b><span>withdrawals needed: every Boost pays out in the same transaction</span></div>';
|
|
const body = document.querySelector('#rows tbody');
|
|
if (!d.items.length) { body.innerHTML = '<tr><td colspan="4" class="muted">No Boosts yet. The first one shows here within a minute of its transaction.</td></tr>'; return; }
|
|
body.innerHTML = d.items.map(r => {
|
|
const link = '<a href="' + esc(ex) + '/tx/' + esc(r.tx) + '" target="_blank" rel="noopener">verify</a>';
|
|
const pays = (r.pays || []).map(p => p.level === 0 ? 'ViralAdBlitz: ' + pol(p.wei)
|
|
: 'Level ' + p.level + ': ' + pol(p.wei) + ' to ' + (p.to ? who(p.to, p.name) : 'sponsor') + (p.depth && p.depth !== p.level ? ' <span class="muted">(place ' + p.depth + ')</span>' : '') + (p.failed ? ' <span class="muted">(bounced, waiting in the contract for them to claim)</span>' : '')).join('<br>');
|
|
const over = (r.passedOver || []).length ? '<br><span class="muted small">Passed over (no Boost yet): ' + r.passedOver.map(o => (o.name ? '@' + esc(o.name) : esc(VAB.short(o.who))) + ' at place ' + o.depth).join(', ') + '</span>' : '';
|
|
const dv = r.delivery ? '<br><span class="muted small">Views delivered: ' + VAB.n(r.delivery.delivered) + ' of ' + VAB.n(r.delivery.views) + '</span>' : '';
|
|
return '<tr><td class="small">' + VAB.when(r.at) + '</td><td><span class="pill on">Boost</span><br>' + who(r.buyer, r.buyerName) + ' bought ' + esc(r.what) + ' for ' + usd(r.usdCents) + (r.ad ? '<br><span class="small">"' + esc(r.ad.headline) + '"</span>' : '') + dv + '</td><td class="small">' + pays + over + '</td><td>' + link + '</td></tr>';
|
|
}).join('');
|
|
}
|
|
load(); setInterval(load, 30000);
|
|
})();
|