Trust pack (Marty 2026-11-14): legal pages, network footer, Telegram image + week stats.

- /terms, /disclaimer (Earnings Disclaimer), /privacy: TrustClickz, 615 Green Valley Drive, Moody, AL 35004; written from the real mechanics: a $5 spot buys advertising (300 guaranteed views + a place in the line), same-transaction split 30/55/10/5, the contract holds only the momentum fund, paid only when later spots sell, nothing held or withdrawn, no refunds on-chain, one-time purchases, crypto risk, data (wallet, username from the hub, hashed visit checks, cookies, no email stored) and one account across the network through the hub. No earnings cap shown. Sitemap.
- Footer: Terms, Earnings Disclaimer, Privacy, Contract, Ledger, Support, company line, 'Part of the network' from the hub (netsites.js, GET /api/network-sites, 10 min cache, fallback list), Downline Banners marked current.
- tgproof.js: each sale message adds this week's spot numbers (Central-time week, bought vs gifted) and shows a large kit image above the text via link_preview_options (rotated, no caption length limit); TG_API for the test stand-in.
common.js?v=20261114t, line.css?v=8. Smoke 122/122 (stand-in Telegram: one message per sale, never two per tx; stand-in hub serves the list; legal pages; footer on phone).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-14 10:50:37 -06:00
parent 920efd72d6
commit da16bfaf4d
18 changed files with 266 additions and 26 deletions
+9 -3
View File
@@ -4,16 +4,20 @@
// dollar value at the contract's own price, then one line for the company + momentum fund share, then the Polygonscan link.
// Built from the chain events of the transaction (SpotBought first, then Paid / PaymentFailed in contract order). Sent once across
// app copies (docstore.claim). Never posts events older than 2 hours (a re-index after downtime must not flood the topic).
// Trust pack (Marty 2026-11-14, "post a Telegram with some kind of image and stats"): the message also carries this week's spot
// numbers (weekLine from server.js) and shows a large image above the text (Downline Banners' own kit art, rotated) through
// Telegram's link preview, so the full payout list never hits a photo caption's length limit. TG_API (tests only) = a stand-in.
'use strict';
const docstore = require('./docstore');
const ROLE = { SPONSOR: 0, LEVEL: 1, FEE_A: 2, FEE_B: 3, FUND: 4 };
let X = null; const buf = new Map();
const CARDS = ['/art/kit/dlb-spot-social.png', '/art/kit/dlb-line-social.png', '/art/kit/dlb-instant-social.png']; let card = 0;
const on = () => !!(process.env.TG_TOKEN && process.env.TG_CHAT);
const esc = s => String(s == null ? '' : s).replace(/[&<>]/g, c => ({ '&': '&amp;', '<': '&lt;', '>': '&gt;' }[c]));
const pol = wei => { const v = Number(BigInt(wei) / 10n ** 12n) / 1e6; return v >= 100 ? v.toFixed(2) : v.toFixed(4); };
function init(deps) { X = deps; } // { nameOf(addr) -> username|null, contract, explorer, site }
function init(deps) { X = deps; } // { nameOf(addr) -> username|null, contract, explorer, site, feeWallets, weekLine() -> text|null }
function onEvent(ev) {
if (!on() || !ev || !ev.tx || !['SpotBought', 'Paid', 'PaymentFailed'].includes(ev.type)) return;
if (ev.ts && Date.now() - ev.ts > 2 * 3600000) return;
@@ -30,9 +34,10 @@ async function who(addr) {
async function send(tx, evs) {
const text = await compose(tx, evs); if (!text) return;
if (!(await docstore.claim('tgproof:' + tx))) return; // another app copy already posted this sale
const body = { chat_id: process.env.TG_CHAT, text, parse_mode: 'HTML', disable_web_page_preview: true };
const img = 'https://' + X.site + CARDS[card++ % CARDS.length];
const body = { chat_id: process.env.TG_CHAT, text, parse_mode: 'HTML', link_preview_options: { url: img, prefer_large_media: true, show_above_text: true } };
if (process.env.TG_PAY_TOPIC) body.message_thread_id = Number(process.env.TG_PAY_TOPIC);
const r = await fetch('https://api.telegram.org/bot' + process.env.TG_TOKEN + '/sendMessage', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), signal: AbortSignal.timeout(15000) });
const r = await fetch(String(process.env.TG_API || 'https://api.telegram.org').replace(/\/+$/, '') + '/bot' + process.env.TG_TOKEN + '/sendMessage', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), signal: AbortSignal.timeout(15000) });
const j = await r.json().catch(() => ({}));
if (!j.ok) console.error('tgproof send failed', r.status, String(j.description || '').slice(0, 120));
else console.log('tgproof posted', String(tx).slice(0, 12));
@@ -59,6 +64,7 @@ async function compose(tx, evs) {
else if (e.role === ROLE.LEVEL) lines.push('\u{1F4B8} Line ' + level + ' (spot #' + (sb.id - level) + '): ' + pol(e.amount) + ' POL' + usd(e.amount) + ' → ' + await who(e.to));
}
if (house > 0n) lines.push('\u{1F3E6} Company + momentum fund: ' + pol(house.toString()) + ' POL' + usd(house.toString()));
if (X.weekLine) { try { const w = X.weekLine(); if (w) lines.push(w); } catch (e) {} }
lines.push('· <a href="' + esc(X.explorer) + '/tx/' + esc(tx) + '">Verify on Polygonscan</a> · <a href="https://' + esc(X.site) + '/ledger">Live ledger</a>');
return lines.join('\n');
}