diff --git a/chatbot.js b/chatbot.js index 71d6105..56ed3e1 100644 --- a/chatbot.js +++ b/chatbot.js @@ -40,7 +40,7 @@ const CANNED = [ // Stack POL (2026-11-09): stackpol.com, every POL payout across the network on one page; members opt in to a page in Promo tools { id: 'stack-pol', title: 'Stack POL', q: ['What is Stack POL?', 'How do I get my Stack POL page?', 'What is stackpol.com?'], tags: ['stack pol', 'stackpol', 'payouts', 'ledger', 'promo tools', 'stack pol pro', 'pro'], re: /\b(stack ?pol|stackpol(\.com)?)\b/i, - a: 'Stack POL (https://stackpol.com) adds up every POL payout in the network: InstantAdPay and LinkSpin referral payments and the rewards from every game that pays POL. It shows the network total, one page per program, and a public ledger of the latest payouts with the username and a Polygonscan link for every payment. It refreshes every 5 minutes. Every member who has been paid has a page by default at stackpol.com/your-username (Promo tools > Stack POL shows the link and the switch "Show my Stack POL page"). It appears at stackpol.com/your-username within 5 minutes and carries your referral link on every program card. Link a wallet so your payouts can be added up. Switch it off any time. Stack POL Pro is a one-time upgrade: your page then shows your own LinkSpin Banner Spins in its ad spots and your spin links, a purple QR code that opens your page, and blog articles opened from your page show your banners and use your referral links on every button. To get it, tap Get Pro in the Stack POL tab, then buy any ad package of $10 or more; Pro switches on when that package settles on chain and you keep every credit of the package. Credits never unlock it. Pro owners also get the Stack POL Pro badge. The totals are what members were paid, not a promise of what anyone will earn.' }, + a: 'Stack POL (https://stackpol.com) adds up every POL payout in the network: InstantAdPay and LinkSpin referral payments and the rewards from every game that pays POL. It shows the network total, one page per program, and a public ledger of the latest payouts with the username and a Polygonscan link for every payment. It refreshes every 5 minutes. Every member who has been paid has a page by default at stackpol.com/your-username (Promo tools > Stack POL shows the link and the switch "Show my Stack POL page"). It appears at stackpol.com/your-username within 5 minutes and carries your referral link on every program card. Link a wallet so your payouts can be added up. Switch it off any time. Stack POL Pro is a one-time upgrade: your page then shows your own LinkSpin Banner Spins in its ad spots and your spin links, a purple QR code that opens your page, and blog articles opened from your page show your banners and use your referral links on every button. Any ad package of $10 or more unlocks it automatically, one time, yours for good: Pro switches on when that package settles on chain, and you keep every credit of the package. Credits never unlock it. Pro owners also get the Stack POL Pro badge. The totals are what members were paid, not a promise of what anyone will earn.' }, // Shards of Valor bonus heroes (2026-11-05, Marty approved): sold one time. The prices and whether they are on sale live in settings, so // this answer names neither; heroesFact() gives the AI the live state. { id: 'sov-bonus-heroes', title: 'Shards of Valor bonus heroes', q: ['What are the bonus heroes in Shards of Valor?', 'How do I get Kestrel, Valda, Morag or Roland?', 'Is the hero a subscription?'], tags: ['shards of valor', 'heroes', 'bonus heroes', 'kestrel', 'valda', 'morag', 'roland', 'party'], @@ -337,7 +337,7 @@ function systemPrompt(kbBlock) { FACTS: - LEVEL 4 OVERRIDE (LIVE 2026-10-26, first payout Monday 2026-11-02): company-paid, off-chain decision, on-chain payment. 3% of every package purchase (the POL actually paid) goes to the buyer's 4th upline on the contract sponsor chain if that member's contract buyerCount is 5 or more (qualifying buyer = direct referral with a $20+ purchase, same bar as level 3); otherwise it hunts up to the next qualified upline, max 25 hops; the company account (#1) or no qualified upline = company keeps it; exactly one recipient per purchase. Paid weekly in POL every Monday after 9 AM Central for the previous Monday to Sunday Central week, from a company payer wallet via the contract's award(memberId), shown in Earnings as 'Level 4 override' with a Polygon link and announced by email and an on-site notice. Under 0.01 POL carries to the next week. Purchases from the start date only, no back pay. Funded from the platform's 20%; the contract split 50/20/10 is unchanged. Never promise amounts. -- STACK POL (LIVE 2026-11-09, https://stackpol.com): one site that adds up every POL payout in the network (InstantAdPay and LinkSpin TierPaid referral payments plus every game's payouts), refreshed every 5 minutes, with per-program pages (/earn/), a public ledger showing each payout's username and Polygonscan link, and a blog. Members get a public page at stackpol.com/ by switching on 'Show my Stack POL page' in Promo tools > Stack POL; it is ON by default for every paid member (since 2026-11-09) and off only when they switch it off. It never holds money. STACK POL PRO (2026-11-09): one-time unlock, NEW MONEY only: Promo tools > Stack POL > Get Pro opens an order, the member's next package of $10 or more (bought after the order, by their own position) fulfils it; credits never count; one package fulfils one order. Pro pages show the member's own LinkSpin Banner Spins in the ad spots (network zones otherwise), their spin links, a purple QR code to the page, a 'Want a personalized page like this?' button, and articles opened from the page (?ref=) use the member's referral on every call to action. Pro owners get the Stack POL Pro badge. Totals are past payouts, never a promise of earnings. +- STACK POL (LIVE 2026-11-09, https://stackpol.com): one site that adds up every POL payout in the network (InstantAdPay and LinkSpin TierPaid referral payments plus every game's payouts), refreshed every 5 minutes, with per-program pages (/earn/), a public ledger showing each payout's username and Polygonscan link, and a blog. Members get a public page at stackpol.com/ by switching on 'Show my Stack POL page' in Promo tools > Stack POL; it is ON by default for every paid member (since 2026-11-09) and off only when they switch it off. It never holds money. STACK POL PRO (2026-11-09): one-time unlock, NEW MONEY only: ANY package of $10 or more bought by the member's own position unlocks it automatically (since 2026-11-09 evening, no order step); credits never count; it never uses up a package that also fulfils a Game Pass or hero order. Pro pages show the member's own LinkSpin Banner Spins in the ad spots (network zones otherwise), their spin links, a purple QR code to the page, a 'Want a personalized page like this?' button, and articles opened from the page (?ref=) use the member's referral on every call to action. Pro owners get the Stack POL Pro badge. Totals are past payouts, never a promise of earnings. ${passTiersFact()}${heroesFact()}${refuelFact()}${synFact()}${polminerFact()}${warpwaresFact()}${bixFact()}${turkeydropFact()}${sovTestFact()}- ROAD AGENT (LIVE 2026-10-15, https://roadagent.app): a night-highway shooter open to every member. Open the Games tab and tap Play on the Road Agent card, or go to roadagent.app and sign in with the InstantAdPay email. Drive the four-lane highway, shoot the hostiles (thug sedans, switchblades, gunner vans), spare the civilians, pull into the weapons truck for oil slicks, smoke and missiles. Clearing a sector for the first time pays POL to the wallet on the member's InstantAdPay account, plus a daily patrol reward; scrap buys garage upgrades. Fuel = a sponsor visit: before a run the player visits an advertiser's page (a FUEL STOP), which is a normal verified visit with the dwell timer and human check, charged to the advertiser like any visit; advertisers' existing visits campaigns are already in the rotation, nothing to set up; to get more traffic from the game, top up the visits campaign. Clickable Pause, Sound and Music buttons sit under the game (P / M / N keys also work), and the Run tab has an Invite a friend card with the member's roadagent.app/?ref= link. - HELP DESK (LIVE 2026-10-16): members open Help in the dashboard (/my#help) to send Marty a support ticket (pick a category, a subject, the message, up to 2 screenshots), see each ticket's status (Open, Waiting on you, Closed) and read and answer his replies; a badge shows when he has replied, and replies also arrive by email. Anyone signed out or locked out uses the public form at https://instantadpay.com/support (name, email, category, subject, message) and gets an email with the ticket number (like IAP-1042) and a private link to view and reply, no sign-in needed. support@instantadpay.com also reaches Marty. Replying to a closed ticket opens it again. In this chat, "Send this to support" turns the conversation into a ticket. Only Marty answers, so replies are not instant; never promise a response time. - PRESENTATION (2026-10-15): instantadpay.com/presentation is a public page (no sign-in) with the narrated InstantAdPay presentation, about six minutes, Marty's voice, captions in 6 languages (English, Italiano, Français, Español, Deutsch, Português) chosen with pills under the player. Sixteen parts: the platform, ad reach, the nine games that pay POL, the $20 split ($10 / $4 / $2 / $4 platform, same transaction), three rules, packages, the 2-then-5 unlock, pass-up, wide versus narrow ($800 vs $36, an illustration), Qualified Start, the Pipeline, LinkSpin (pre-launch Nov 1), one wallet across the network, the first week, and 'the target is five'. Share link: Members > Promo tools > 'Share the presentation' copies instantadpay.com/presentation?ref=; ?ref sets the same 30-day sponsor cookie as the invite link, the page shows 'Shared with you by @name' with avatar and a Join button to /join/. It is in the site menu as 'Presentation'. BUILD WIDE VIDEO: first card in Promo tools > Videos ('Build wide: watch the payments flow'), matched link ?v=wide. diff --git a/gamepass.js b/gamepass.js index 16ecc7a..3db5b22 100644 --- a/gamepass.js +++ b/gamepass.js @@ -287,6 +287,18 @@ function grantStackProForPackage(email, tx, cents, buyerId, note) { console.log('stack pro granted for package', e, tx, cents, 'cents'); return { ok: true, pro: true }; } +// Marty 2026-11-09 (evening): "Any $10 package or higher unlocks it". No Get Pro step: the member's own package purchase of $10 or more, +// on chain, switches Pro on for good. Still new money only (credits never reach onEvent). Only packages from the Pro launch on count +// (a reindex of older history never hands it out). A Pro order left waiting from the first version is closed as paid by the same tx. +const PRO_START = Date.parse('2026-11-09T21:30:00Z'); +function proFromPackage(e, ev, cents) { + if (cents < STACK_PRO_CENTS || stackpro.get(e)) return false; + const t = (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()); if (t < PRO_START) return false; + stackpro.set(e, { ts: t, via: 'package', tx: ev.tx, cents, buyerId: Number(ev.buyerId) || 0 }); + for (const o of stackOrders(e)) orders.set(o.order, Object.assign({}, orders.get(o.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), buyerId: Number(ev.buyerId) || 0 })); + console.log('stack pro unlocked by package', e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents'); + return true; +} function stackProOwners() { return [...stackpro.keys()]; } // A package purchase landing on chain fulfils one of this account's waiting orders: the highest-priced one the package covers. @@ -320,13 +332,15 @@ async function onEvent(ev) { const c = cfg(); const cents = ev.priceCents || 0; if (!TIERS.some(k => cents >= c.tiers[k].price) && !heroOrderPrices(c).some(x => cents >= x) && cents < STACK_PRO_CENTS) return null; const e = await ownerOf(ev); if (!e) return null; - if (!waitingOrders(e).length && !heroOrders(e).length && !stackOrders(e).length) return null; - if (txUsed(ev.tx)) return null; // each purchase counts once, everywhere + const pro = proFromPackage(e, ev, cents); // any $10+ package unlocks Stack POL Pro; it rides along, never takes the package from an order + const withPro = r => pro ? Object.assign(r || {}, { stackPro: true, email: e }) : r; + if (!waitingOrders(e).length && !heroOrders(e).length) return withPro(null); + if (txUsed(ev.tx)) return withPro(null); // each purchase counts once, everywhere const at = await minedAt(ev); // one package fulfils ONE order, pass or bonus hero (2026-11-05): the highest-priced one it covers, then the oldest const all = waitingOrders(e).map(o => Object.assign({ price: c.tiers[o.tier].price }, o)).concat(heroOrders(e).filter(o => heroOrderOpen(e, o.hero)).map(o => Object.assign({ price: heroOrderPrice(c, o.hero) }, o))).concat(stackpro.get(e) ? [] : stackOrders(e).map(o => Object.assign({ price: STACK_PRO_CENTS }, o))); const w = all.filter(o => cents >= o.price && at + ORDER_SKEW_MS >= o.ts).sort((x, y) => y.price - x.price || x.ts - y.ts)[0]; - if (!w) { console.log('gamepass: package', String(ev.tx).slice(0, 12), 'by', e, 'fulfils no order (bought before the order or too small)'); return null; } + if (!w) { console.log('gamepass: package', String(ev.tx).slice(0, 12), 'by', e, 'fulfils no order (bought before the order or too small)'); return withPro(null); } if (w.kind === 'stackpro') { orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 })); stackpro.set(e, { ts: (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()), via: 'package', tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0 }); @@ -337,12 +351,12 @@ async function onEvent(ev) { orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 })); const g = grantHeroes(e, w.hero, 'package', { tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0, usd: heroOrderPrice(c, w.hero) / 100, packageUsd: cents / 100 }, (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now())); console.log('bonus heroes fulfilled by package', w.hero, e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents:', g.heroes.join(',')); - return { order: w.order, hero: w.hero, heroes: g.heroes }; + return withPro({ order: w.order, hero: w.hero, heroes: g.heroes }); } orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents, paidAt: Date.now(), minedAt: at, buyerId: Number(ev.buyerId) || 0 })); const x = extend(e, 'package', { tx: ev.tx, cents, order: w.order, buyerId: Number(ev.buyerId) || 0, usd: c.tiers[w.tier].price / 100, packageUsd: cents / 100 }, (ev.devNow && !R.isProd) ? Number(ev.devNow) : (ev.ts || Date.now()), w.tier); console.log('gamepass fulfilled by package', w.tier, e, 'tx', String(ev.tx).slice(0, 12), cents, 'cents, until', new Date(x.until).toISOString()); - return { order: w.order, until: x.until, tier: w.tier }; + return withPro({ order: w.order, until: x.until, tier: w.tier }); } // ---- bonus heroes (2026-11-05) ---- diff --git a/public/assets/my.js b/public/assets/my.js index b1fc554..fe4c672 100644 --- a/public/assets/my.js +++ b/public/assets/my.js @@ -2799,7 +2799,7 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str function showStackPol(d) { $('spOn').checked = !!d.on; $('spLinkRow').hidden = !d.on; $('spUrl').textContent = d.url || ''; $('spOpen').href = d.url || '#'; $('spNote').textContent = d.on ? (d.wallet ? 'Your page is live once a payout reaches your wallet and updates every 5 minutes.' : 'Link a wallet (Wallet tab) so your payouts can be added up on your page.') : ''; - const pv = d.pro || {}; $('spProOn').hidden = !pv.pro; $('spProWait').hidden = !!pv.pro || !pv.waiting; $('spProOff').hidden = !!pv.pro || !!pv.waiting; + const pv = d.pro || {}; $('spProOn').hidden = !pv.pro; $('spProOff').hidden = !!pv.pro; // any $10+ package unlocks Pro (2026-11-09): no order to wait on } async function stackPolPost(body) { const r = await fetch('/api/my/stackpol', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body) }); const d = await r.json(); if (!r.ok) throw new Error(d.error || 'Could not save that.'); return d; } async function loadStackPol() { try { const r = await fetch('/api/my/stackpol'); const d = await r.json(); if (!r.ok) { $('spNote').textContent = d.error || ''; return; } showStackPol(d); } catch (e) {} } @@ -2811,8 +2811,6 @@ function shareLink(ref) { return SHARE_DOMAIN && /^[A-Za-z0-9_]{1,40}$/.test(Str showStackPol(d); IAP.status(on ? 'Stack POL page switched on.' : 'Stack POL page switched off.', 'ok'); } catch (e) { $('spOn').checked = !on; IAP.status('Could not save that. Try again.', 'bad'); } }); - $('spProBuy').addEventListener('click', async () => { try { const d = await stackPolPost({ pro: 'buy' }); showStackPol(d); if (d.buy && d.buy.message) IAP.status(d.buy.message, 'ok'); } catch (e) { IAP.status(e.message, 'bad'); } }); - $('spProCancel').addEventListener('click', async () => { try { showStackPol(await stackPolPost({ pro: 'cancel' })); IAP.status('Pro order cancelled.', 'ok'); } catch (e) { IAP.status(e.message, 'bad'); } }); $('spCopy').addEventListener('click', async () => { try { await navigator.clipboard.writeText($('spUrl').textContent); IAP.status('Link copied.', 'ok'); } catch (e) { const r = document.createRange(); r.selectNodeContents($('spUrl')); const sel = getSelection(); sel.removeAllRanges(); sel.addRange(r); } }); } document.querySelectorAll('.promo-pills [data-promo]').forEach(b => diff --git a/public/my.html b/public/my.html index dc726e4..bb33a4d 100644 --- a/public/my.html +++ b/public/my.html @@ -860,9 +860,8 @@

⭐ Stack POL Pro

-

Pro puts your own LinkSpin Banner Spins and spin links on your Stack POL page, so the people who visit it see your offers, and adds a shareable stack card. One time, yours for good: it switches on with your next ad package of $10 or more. You keep every credit of that package for your ads, and your sponsor line is paid on chain as usual.

-
- +

Pro puts your own LinkSpin Banner Spins and spin links in the ad spots of your Stack POL page, adds a QR code that opens it, and makes every blog article opened from your page use your referral links. One time, yours for good: any ad package of $10 or more unlocks it automatically. You keep every credit of that package for your ads, and your sponsor line is paid on chain as usual.

+

Your page shows your own results only. Nothing on it is a promise of what anyone else will earn.

@@ -1292,7 +1291,7 @@ - + diff --git a/qa/stackpro.mjs b/qa/stackpro.mjs index 091c27b..8b21de2 100644 --- a/qa/stackpro.mjs +++ b/qa/stackpro.mjs @@ -38,26 +38,17 @@ try { let r = await api('/api/my/stackpol', null, ha); ok(r.status === 200 && r.j.on === true && r.j.url === 'https://stackpol.com/stacka' && r.j.pro && r.j.pro.pro === false, 'GET: on by default, url, not pro', JSON.stringify(r.j)); r = await api('/api/my/stackpol', { data: { on: true } }, ha); ok(r.j.on === true && optin().users.stacka === true, 'switch on writes stack-optin.json'); r = await api('/api/my/stackpol', { data: { on: false } }, ha); ok(r.j.on === false && optin().users.stacka === false, 'switch off'); - // a package with no Pro order unlocks nothing - await buy(A, 1000); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false, 'a $10 package without a Pro order does not unlock Pro'); - // Get Pro opens a waiting order - r = await api('/api/my/stackpol', { data: { pro: 'buy' } }, ha); ok(r.j.buy && r.j.buy.needPay === true && r.j.pro.waiting === true && r.j.buy.usd === 10, 'Get Pro opens a waiting order ($10)', JSON.stringify(r.j.buy)); - const orderTs = r.j.buy.orderTs; - r = await api('/api/my/stackpol', { data: { pro: 'buy' } }, ha); ok(r.j.buy.reused === true, 'Get Pro twice reuses the same order'); - await buy(A, 500); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false && r.j.pro.waiting === true, 'a $5 package does not fulfil Pro'); - await buy(A, 2000, { minedAt: orderTs - 60000 }); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false, 'a package mined BEFORE the order does not fulfil Pro'); - const fx = await buy(A, 1000); r = await api('/api/my/stackpol', null, ha); ok(fx.j.order && fx.j.order.stackPro === true && r.j.pro.pro === true && r.j.pro.waiting === false, 'a $10 package after the order unlocks Pro', JSON.stringify(fx.j)); + // Marty 2026-11-09 evening: ANY $10+ package unlocks Pro, no order step; it rides along with whatever else the package fulfils + await buy(A, 500); r = await api('/api/my/stackpol', null, ha); ok(r.j.pro.pro === false, 'a $5 package does not unlock Pro'); + const fx = await buy(A, 1000); r = await api('/api/my/stackpol', null, ha); ok(fx.j.order && fx.j.order.stackPro === true && r.j.pro.pro === true, 'a $10 package unlocks Pro with no order', JSON.stringify(fx.j)); ok(optin().pro && optin().pro.stacka === true, 'Pro owner lands in stack-optin.json for the indexer'); - const tx = '0x' + 'ab'.repeat(32); - // one package fulfils ONE order: B opens a pass AND a Pro order, a single $20 package unlocks only one (the higher price: Pro) - await api('/api/my/stackpol', { data: { pro: 'buy' } }, hb); - const gp = await api('/api/my/gamepass/buy', { data: {} }, hb); const gpw = await api('/api/my/gamepass', null, hb); ok(gpw.j.waiting === true || !gpw.j.enabled, 'B: a Game Pass order is waiting too (or passes are off locally)', JSON.stringify(gp.j).slice(0, 120)); - await buy(Bm, 2000, { tx }); r = await api('/api/my/stackpol', null, hb); - const st = await api('/api/my/gamepass', null, hb); - ok(r.j.pro.pro === true, 'B: the $20 package unlocked Pro (the higher-priced order)'); - ok(st.j.active === false && (st.j.waiting === true || !gpw.j.waiting), 'B: the same package did NOT also start a Game Pass (still waiting)', 'active=' + st.j.active + ' waiting=' + st.j.waiting); - await buy(Bm, 2000, { tx }); const st2 = await api('/api/my/gamepass', null, hb); ok(st2.j.active === false, 'replaying the same tx fulfils nothing'); - r = await api('/api/my/stackpol', { data: { pro: 'cancel' } }, ha); ok(r.status === 200 && r.j.pro.pro === true, 'cancel after paying keeps Pro'); + const again = await buy(A, 2000); ok(!(again.j.order && again.j.order.stackPro), 'a second package does not re-grant Pro'); + // B: a Game Pass order waiting + a $20 package -> the pass starts AND Pro unlocks (Pro never takes the package from the pass) + const gp = await api('/api/my/gamepass/buy', { data: {} }, hb); const gpw = await api('/api/my/gamepass', null, hb); + const fb = await buy(Bm, 2000); r = await api('/api/my/stackpol', null, hb); const st = await api('/api/my/gamepass', null, hb); + ok(r.j.pro.pro === true, 'B: the $20 package unlocked Pro', JSON.stringify(fb.j)); + ok(!gpw.j.enabled || st.j.active === true, 'B: the same package still started the waiting Game Pass', 'enabled=' + gpw.j.enabled + ' active=' + st.j.active); + r = await api('/api/my/stackpol', { data: { on: false } }, hb); ok(r.j.on === false && r.j.pro.pro === true, 'switching the page off keeps Pro'); } catch (e) { console.log('FAIL exception', e && e.stack || e); fails++; } finally { try { srv.kill(); } catch (e) {} try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} } if (fails) console.log(log.split('\n').filter(l => /stack|gamepass|error/i.test(l)).slice(-15).join('\n'));