Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9b7b166097 | |||
| 4c470d8e3c | |||
| 084d1ea3d6 | |||
| 4d6a0f2f83 |
+6
-3
@@ -20,8 +20,10 @@ function key() {
|
||||
function enabled() { return !!key(); }
|
||||
|
||||
// ---- canned answers: instant, free, always in voice ----
|
||||
const KNOWLEDGE_DATE = '2026-10-15'; // bump whenever the canned answers / prompt are brought up to date
|
||||
const KNOWLEDGE_DATE = '2026-10-16'; // bump whenever the canned answers / prompt are brought up to date
|
||||
const CANNED = [
|
||||
{ re: /(game ?pass|pass tournament|daily (pol )?cap|pol cap|cap(ped|s)? (on|in|for) (the )?games?|hit (the|my|today.s) (free )?cap|carr(y|ied) (over|forward))/i,
|
||||
a: 'The Game Pass is $5 for 7 days and covers all nine games on your InstantAdPay account (linked positions included). Free play keeps paying real POL every day; the Pass plays more: higher daily POL caps across every game (1.50 POL a day on repeatable rewards instead of 0.30, and 5 POL a day in all instead of 2), a seat in the weekly Pass Tournament (POL prizes from 5% of pass sales, settled Mondays, top 3 posted to Game Achievements), extra plays or a perk in each game, and the Pass badge. Caps are account-wide and reset at midnight Central. A one-time progress reward (a boss, a chapter, a sector) is never lost: whatever is over the day\u2019s total carries to the next day until it is paid in full; repeatable daily play over the daily cap is simply not paid that day. The Pass never changes how much any reward pays, so it is more game, not more payback. Buy it in Members > Games > Game Pass: it costs 500 purchased credits (credits from a package you bought; earned credits do not count). If you have none, buy a $5 package and the pass starts the moment it settles, and you keep every credit of the package for your ads. Buying while a pass is active adds 7 days.' },
|
||||
{ re: /(road ?agent|night.?highway|fuel stop|weapons truck)/i,
|
||||
a: 'Road Agent is the network’s night-highway shooter, live since October 15 for every member: Games tab > Road Agent > Play, or roadagent.app with your InstantAdPay email. First clear of each sector pays POL to the wallet on your InstantAdPay account, plus a daily patrol reward. Fuel comes from a sponsor visit (a fuel stop), which is a normal verified visit, so advertisers’ visits campaigns get traffic from the game automatically.' },
|
||||
{ re: /(presentation|build ?wide (video|presentation)|narrated (video|presentation)|share the (video|presentation)|\?v=wide|wide angle)/i,
|
||||
@@ -110,7 +112,7 @@ const CANNED = [
|
||||
{ re: /(overview video|four.minute|4.minute|what is (this|instantadpay)|explain (the )?platform|how does (this|it) work)/i,
|
||||
a: 'The quickest answer is the four-minute overview video: it is the first card on Members > Training and on the home page at https://instantadpay.com/#overview-video. It covers what the platform is, what free members get, the campaign formats, how the contract splits every purchase, wallet and payouts, Qualified Start, the payment trace and the tools for building a line.' },
|
||||
{ re: /(\b(price|prices|pricing|costs?)\b|how much (is|are|does|do)|package (price|cost|size)|which package|what packages|what do i get|what am i buying|should i (buy|get|start with|go with)|worth (buying|getting|it to buy))/i,
|
||||
a: 'Five packages, priced in dollars and settled in POL at the live rate when you buy: Micro $5 for 500 credits, Activation $20 for 2,000, Builder $50 for 5,500, Growth $100 for 12,000, Leader $250 for 32,500. One credit is one cent of ad delivery in any format. Packages of $20 or more count toward qualification, and every purchase is split by the contract in the same transaction: 50 percent to your sponsor, 20 to level 2, 10 to level 3, 20 to the platform. The live POL prices are on the home page and the Buy packages tab.' },
|
||||
a: 'Seven packages, priced in dollars and settled in POL at the live rate when you buy: Micro $5 for 500 credits, Starter $10 for 1,000, Activation $20 for 2,000, Builder $50 for 5,500, Growth $100 for 12,000, Leader $250 for 32,500, Elite $500 for 70,000. One credit is one cent of ad delivery in any format. Packages of $20 or more count toward qualification, and every purchase is split by the contract in the same transaction: 50 percent to your sponsor, 20 to level 2, 10 to level 3, 20 to the platform. The live POL prices are on the home page and the Buy packages tab.' },
|
||||
{ re: /(what (is|are) (a |an )?(ad )?credits?|credits? (worth|value|mean)|one credit|impression|cpm)/i,
|
||||
a: 'Packages mint ad credits on-chain, and every new member also gets a small batch of welcome credits just for joining. One credit is one cent of ad delivery: banners and text ads (also syndicated to the wider network), full-screen login ads, watch-to-earn video ads, solo ads into member inboxes, featured links in the strip on every Overview, and verified-visit packs, all managed from Members > Campaigns. Only your campaigns can spend your credits.' },
|
||||
{ re: /(which|what) (crypto|coin|token|currency|chain|network)|paid in what|get paid in|supported (crypto|coins|wallets)|do you (support|accept)/i,
|
||||
@@ -139,7 +141,7 @@ FACTS:
|
||||
- WALLET DRAIN WARNING: Trust Wallet hard-blocks any purchase that spends most of the wallet's POL ("this transaction will drain your wallet", only "Stop and go back"). It is a balance-proportion heuristic, not a contract issue (there are no token approvals; a buy is one native-POL payable call). Advice: smaller package first, or add POL so the buy is well under half the balance, or use MetaMask/Phantom/SafePal (no hard block). The dashboard warns Trust Wallet users before sending when a buy would use more than ~55% of the balance; other wallets are not prompted. After a blocked attempt the WalletConnect session may be dead: Wallet tab > Disconnect > Connect again.
|
||||
- WALL OWNERSHIP LADDER: the public wall has 3 positions. Position 1 = the member's line banner. Positions 2 and 3 show upline banners (then house ads) UNTIL the member earns them: 2 qualifying buyers ($20+) unlock position 2, 5 unlock position 3; a fully qualified member's wall is 100% their own links/offers (set in Profile > Your wall: label, https link, optional banner image). Empty unlocked slots fall back to upline banners, then house ads.
|
||||
- LINE BANNER (free, set in Profile): every member can set a destination URL (must allow framing) plus an optional banner image. It is shown to their next THREE levels of new members during welcome tours (position 1 for directs, 2, 3 below), and on their public BANNER WALL at /wall/<username> — a shareable page showing their line ladder with their join link. Free viral traffic that compounds as the team grows; no credits spent.
|
||||
- Ad packages: Micro $5/500 credits, Activation $20/2,000, Builder $50/5,500, Growth $100/12,000, Leader $250/32,500. Dollar-priced, settled in POL (Polygon) at the live Chainlink rate. 1 credit = 1 cent of ad delivery.
|
||||
- Ad packages: Micro $5/500 credits, Starter $10/1,000, Activation $20/2,000, Builder $50/5,500, Growth $100/12,000, Leader $250/32,500, Elite $500/70,000. Dollar-priced, settled in POL (Polygon) at the live Chainlink rate. 1 credit = 1 cent of ad delivery.
|
||||
- Live formats: display banners (per impression), text ads (per impression), full-screen LOGIN ADS (per day: right after a member signs in they land on a sponsor interstitial — they click "Open Ad", the advertiser's page opens in a NEW tab, a countdown runs on the interstitial, and at zero a "Go to dashboard" button appears. Just a CTA link is enough; an optional banner image can be the clickable creative. No framing requirement since it opens in its own tab), WATCH-TO-EARN VIDEO ADS (advertiser uploads an MP4/WebM or gives a direct https .mp4/.webm link and picks a required watch length — 10s/30s/60s — which sets the per-view price; viewers watch in an escape-proof player under Earn credits > Watch videos, the watch time is enforced on the server clock, and they earn credits per completed watch; you never see your own videos), and solo ads. Banner ads also require a size (standard IAB sizes like 728x90, 300x250). Video watching is capped at 8 a day per member and pays 1, 2 or 4 credits for a 10, 30 or 60 second watch. FEATURED LINKS (live): a headline + link in the Featured strip at the top of every member's Overview, booked for 1, 2 or 7 days at 40 credits a day, up to 7 days ahead, at most 10 links sharing any day; flat buy paid when booked; the row shows days left and 'runs through <date>', counts views (one per viewer per hour) and clicks, and offers Extend run. VERIFIED-VISIT PACKS (live): 3 credits per visit, minimum 20 visits, paid up front; each visit is a distinct member who opens the site in a new tab, stays 8 seconds and passes a check, at most 20 visits per member per day; the row shows 'N of M visits delivered' and Buy more visits adds to the pack; the visitor earns 1 credit.
|
||||
- WALLETS + BUYING POL (Training > Wallets and buying POL, /wallets, members only): preferred MetaMask (recommended; extra accounts for Qualified Start), Phantom (PHANTOM GOTCHA: Polygon is OFF by default; Settings > Active Networks > turn on Polygon, otherwise connect/buy fails or shows the wrong network; seen with Jim Watts' EB team 2026-09-13), SafePal, Coinbase Wallet; Trust works but blocks buys spending most of its POL (keep ~2x). MoonPay flow: connect wallet, Buy packages > "Buy POL with a card" opens MoonPay with POL on Polygon + the member's address prefilled; card/Apple Pay/Google Pay; first-time ID check; minimum order ~$30; buy package cost + 2-3 POL for fees; POL arrives in minutes; then buy. Exchanges: withdraw POL on the Polygon network. Never MATIC on Ethereum, never share the recovery phrase.
|
||||
- INTRO VIDEO ON THE WALL: Profile > social links has an "Intro video" field (YouTube, Vimeo or direct .mp4 link). It embeds on the member's public wall page (/wall/<username>) right under their bio, above the three-level line and the join button.
|
||||
@@ -160,6 +162,7 @@ FACTS:
|
||||
- VISIT PACKS ARE PAID UP FRONT (2026-09-15, Michael's question): a verified-visits campaign charges the whole pack when it is created (3 credits per visit, so 1,000 visits = 3,000 credits) and then delivers over time as members complete verified visits (each member can do at most 20 a day, so packs fill gradually: tens per day at today's size). The Campaigns row shows 'paid up front' and 'N of M visits delivered'; the credits are not being consumed again, they were reserved once. Same for featured-day bookings: a featured link is a flat buy (featuredPerDay credits per day, whole run charged when booked), its row shows 'paid up front', the day count and 'runs through <date>', and it ends on its last day ('run ended'). FEATURED CANNOT TAKE ADDED CREDITS (2026-09-16, Hugh and Michael both tried): the row offers 'Extend run' which books more days after the current run (or from today if it ended) and charges them right away; there is no 'Buy more views' on a featured row any more. Visit packs offer 'Buy more visits' (charged now, adds to the pack). Credits added to a campaign are set aside immediately (Available drops at once) and whatever is unspent returns to Available when the campaign ends.
|
||||
- BANNER CREATIVE MUST BE AN IMAGE LINK (2026-09-16): the New campaign image field needs a direct image URL (ends in .png/.jpg/.gif/.webp/.svg) or an upload; a web-page link (a join page, an imgbb/ibb.co page) is refused with a message. Easiest source: Promo tools > Banners > Copy image URL. A campaign created with a page link before this check served a broken banner and was repaired by admin.
|
||||
- PAYMENT TRACE (2026-09-16): Members > Earnings > "Trace a payment": enter a member number or @username (yourself, anyone up to 3 levels below you, or your own 3 uplines) and every purchase they were part of is listed tier by tier — who was paid at level 1/2/3 (50/20/10%), who was skipped and why ("not qualified: had N of 2 qualifying buyers then"), the platform's 20%, and a verify link to the transaction. Use it to answer "why didn't my sponsor / why didn't I get paid on X's purchase" — the usual answers are (a) the sponsor had not unlocked that level when the purchase settled (qualification never applies backwards), (b) the buyer used Qualified Start, so the purchase came from a linked wallet whose on-chain sponsor is the buyer's own main position (level 1 goes to the buyer themselves), (c) the sponsor's payouts were not switched on. Admins see the same trace under the member card in Admin > Members.
|
||||
- GAME PASS (2026-10-16, Members > Games > Game Pass): $5 for 7 days, one pass per account covering ALL NINE games (linked positions share it). Paid with 500 PURCHASED-grade credits (ads.gamePurchase purchasedOnly, the PolyWarriors mint rule; earned credits never buy a pass); with no purchased credits the pass waits and a $5 package bought meanwhile starts it automatically (the member keeps the package credits). Buying while active extends by 7 days. ACCOUNT-WIDE DAILY POL CAPS across the games, reset at midnight Central: free 0.30 POL/day on repeatable daily-play rewards and 2.0 POL/day for everything; Pass 1.50 and 5.0. Caps apply only from the announced start date (capsStartDate); until then the games' own caps stand. A one-time PROGRESS reward (stage, boss, chapter, sector, room) over the day's total is DEFERRED and carried to the next day, never lost (a 10 POL Gem Kingdom boss still pays 10 POL, over a few days); repeatable DAILY-play POL over the daily cap is dropped for that day. Reward AMOUNTS never change with the pass: say 'free play pays; the Pass plays more', NEVER 'earn more' or 'pays for itself' (max repeatable per pass week is 10.5 POL, under the $5). Pass perks per game: PolHunter 5 missions/day and Ad Detective twice; Gem Kingdom a free continue a day; SpellWheel streak 0.30 and a free hint; PolyWarriors +1 mission, defense 25 Circuits, Pass mark; Road Agent 2 patrols and +25% scrap; ClutterHunt 2 free hints; PolyBreak gem cap 1.5 and an extra paddle; Drip Runner a starting shield; Spooky Doors +1 door while the season runs. WEEKLY PASS TOURNAMENT: pass holders ranked by plays reported across the games Monday to Sunday Central; prize pool = 5% of that week's pass sales in POL (50/30/20 to the top 3), settled Mondays 9 AM Central, top 3 posted to the Game Achievements Telegram topic, prizes paid in POL by the games to the winner's InstantAdPay wallet. Members see the card, state and expiry in Members > Games (deep link /my#games?pass=1); an Overview nudge appears once a day after a game reports a free-cap hit.
|
||||
- PLATFORM FACTS (2026-10-06): instantadpay.com/facts (footer link 'Platform facts') and instantadpay.com/llms.txt are the verified reference for how InstantAdPay works: contract 0xBE1ECA72AFF47d13D8E907e523F55eB9e2d365E0 on Polygon; split 50% L1 / 20% L2 (needs 2 referred $20+ buyers) / 10% L3 (needs 5) / 10% platform wallet A / 10% platform wallet B, unqualified shares pass up (25 steps) then go to wallet A; purchased credits are on-chain (engine burns them in batches), earned credits are in the site database; credits are not transferable or cashable; POL payments are final, platform may return credits when a campaign fails because of a platform problem. When someone asks how the platform, payouts, credits or refunds work, answer from these facts and link /facts.
|
||||
- CREDIT ACTIVITY LEDGER (2026-09-16): Members > Campaigns has a 'Credit activity' list (last 40 lines, newest first; also linked from the Earn credits pane) showing every real credit movement with a reason: welcome credits, sign-in bonus with streak, daily claim, inbox reads, video watches, verified visits, milestone and leaderboard bonuses, partner codes, admin/team grants, AI Copy Engine charges and refunds, flat buys (featured runs, extensions, visit packs, more visits), login-ad days, and metered delivery rolled up as one line per campaign per day ('Ad views: NAME', 'Inbox deliveries: NAME', 'Video views: NAME'); lines marked '(purchased credits)' spent on-chain purchased credits rather than the earned pool. Reservations (credits set aside for a live campaign) are NOT ledger lines; they show as 'in live campaigns'. Earned credits are spent before purchased ones, so an earn followed by a buy appears as two lines. The ledger starts 2026-09-16; nothing earlier is listed.
|
||||
- PAYMENT + MISSED-PAYMENT NOTICES (2026-09-15): every payout that lands (who bought, level, share in POL and dollars, transaction link) and every missed payout is delivered BOTH by email and as an on-site inbox message from the company account, shown in the login pop-up and the Messages card, so it is waiting when the member signs in. MISSED-PAYOUT detail: when a level-2 or level-3 share passes a member by because that level is not open on their account, the member gets an email the same minute: who bought, the POL and dollar amount they missed, how many qualifying buyers they have versus the 2 or 5 needed, and the two ways to close the gap (bring buyers, or Qualified Start). Qualified members whose wallet rejected a transfer get a different email telling them to link a regular wallet. MISSED PAYOUTS ARE ALSO PUBLIC (2026-09-16): the team's Telegram payments feed posts, by username, who was passed over on a purchase, why (not qualified yet with N of 2 buyers, or payouts not switched on), the amount, and who received it instead; the same for a sale that routed past an unactivated sponsor. Nothing about the contract changed; it is visibility.
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
# Release note draft: the Game Pass (not sent)
|
||||
|
||||
Status: DRAFT for Marty's review. Nothing below has been posted, emailed or published. Dates are placeholders until the caps start
|
||||
date is set in Admin > Settings (`capsStartDate`) and `gamePassEnabled` is switched on.
|
||||
|
||||
## Short version (Telegram / feed)
|
||||
|
||||
The games now have a Game Pass: $5 for 7 days, all nine games on one account. Free play keeps paying real POL every day. The Pass
|
||||
plays more: higher daily caps across every game, a seat in the weekly Pass Tournament with POL prizes, extra plays or a perk in each
|
||||
game, and the Pass badge. Members > Games > Game Pass. From [DATE] the daily POL caps are account-wide: free play 0.30 POL a day on
|
||||
repeatable rewards and 2 POL a day in all; with the Pass 1.50 and 5. One-time rewards you earn over the cap are never lost; they pay
|
||||
over the next days.
|
||||
|
||||
## Release note (Admin > Releases, member-facing)
|
||||
|
||||
**The Game Pass: more game across all nine games**
|
||||
|
||||
Every member earns real POL in our games, and that does not change. What is new:
|
||||
|
||||
- **The Game Pass.** $5 for 7 days, one pass for your whole account (linked positions share it), covering PolHunter, Gem Kingdom,
|
||||
SpellWheel, PolyWarriors, Road Agent, ClutterHunt, PolyBreak, Drip Runner and Spooky Doors while its season runs.
|
||||
- **What it does.** Higher daily POL caps in every game (1.50 POL a day on repeatable play instead of 0.30, and 5 POL a day in all
|
||||
instead of 2), a place in the weekly **Pass Tournament**, extra plays or a perk in each game (more PolHunter missions, a free
|
||||
continue in Gem Kingdom, a free hint in SpellWheel and ClutterHunt, an extra patrol in Road Agent, a starting shield in Drip
|
||||
Runner, an extra paddle in PolyBreak, an extra mission in PolyWarriors, an extra door in Spooky Doors), and the Pass badge.
|
||||
- **How to get it.** Members > Games > Game Pass. It costs 500 purchased credits, the credits from a package you bought. If you
|
||||
have none, buy a $5 package and the pass starts the moment it settles; you keep every credit of that package for your ads. Buying
|
||||
while a pass is active adds 7 days.
|
||||
- **Account-wide daily caps, from [DATE].** Until now each game had its own daily limit. From [DATE] the limit is one number for
|
||||
your whole account across all the games, reset at midnight Central: free play 0.30 POL a day on repeatable rewards (finds, daily
|
||||
puzzles, patrols, gems, drips) and 2 POL a day for everything; with the Pass 1.50 and 5. A one-time reward (a boss, a chapter, a
|
||||
sector, a room) never changes and is never lost: whatever is over the day's total carries to the next day until it is paid in
|
||||
full. A 10 POL boss still pays 10 POL, over a few days.
|
||||
- **The weekly Pass Tournament.** Monday to Sunday, Central time, pass holders are ranked by their plays across all the games. The
|
||||
prize pool is 5% of that week's pass sales, paid in POL to the top three (50 / 30 / 20) and posted in Game Achievements on
|
||||
Monday morning.
|
||||
|
||||
The Pass does not change what any reward pays. Free play pays; the Pass plays more.
|
||||
|
||||
## Announcement timing
|
||||
|
||||
- One week before `capsStartDate`: post the short version, publish this note, switch `gamePassEnabled` on so members can buy
|
||||
ahead of the caps.
|
||||
- On `capsStartDate`: the caps enforce themselves at midnight Central; nothing to deploy.
|
||||
- First Monday 9 AM Central after launch: the first tournament settles and posts by itself (only while `gamePassEnabled` is on).
|
||||
|
||||
## Wording rules (chatbot, posts, pages)
|
||||
|
||||
Never "earn more", "pays for itself", "income". Always "free play pays; the Pass plays more". Reward amounts never change with the
|
||||
Pass. Caps are per account, per Central day. Deferred progress rewards are "paid over the next days", never "lost".
|
||||
@@ -0,0 +1,288 @@
|
||||
# Game Pass: draft spec (2026-10-16)
|
||||
|
||||
Marty's direction (10-16): a $5 weekly Game Pass that covers all nine games and raises the daily POL cap; a tighter
|
||||
free cap so nobody farms the games all day for free. Pass = "more game", never pitched as payback. Free play keeps
|
||||
paying real POL (the "paid before they ever pay" funnel in the presentation, deck and guide).
|
||||
|
||||
## 1. What the games pay today (live settings, 7-day earnings to 2026-10-16)
|
||||
|
||||
Two kinds of POL rewards exist in every game:
|
||||
|
||||
- **Progress rewards**: one-time per account (first clear of a stage, boss, sector, rival, chapter, room). Finite.
|
||||
- **Daily play rewards**: repeatable every day (finds, daily puzzle, patrol, gems, drips). This is the "all day" risk.
|
||||
|
||||
| Game | Progress rewards (one-time, POL) | Daily play rewards (repeatable) | Game cap/day | Players (7d) | Median / p90 / max per player-day | POL out / week |
|
||||
|---|---|---|---|---|---|---|
|
||||
| PolHunter | none | finds 0.05-1.00 (skewed small), 3 missions/day | 40 | 38 | 0.48 / 0.97 / 4.04 | **102.1** |
|
||||
| Gem Kingdom | stages 0.02-0.15; bosses 0.25 / 0.5 / 2 / 5 / 7.5 / **10** | none | 40 | 25 | 0.46 / 11.35 / **25.49** | **101.4** |
|
||||
| SpellWheel | levels 0.02-0.05; chapters 0.25-1 | daily puzzle 0.03, streak 0.15 | 20 | 102 | 0.04 / 0.16 / 1.50 | 17.6 |
|
||||
| Spooky Doors (to Oct 31) | ladder 0.1 / 0.25 / 0.5 / 1 / 2 | none | 25 | 11 | 0.85 / 1.00 / 2.00 | 10.7 |
|
||||
| PolyWarriors | rivals 0.02-0.10, ladder 0.5, elite 0.12-0.5, elite clear 2 | none (PvP pays Circuits) | 20 | 10 | 0.18 / 1.09 / 4.94 | 8.8 |
|
||||
| ClutterHunt | per room: clear 0.05, 3-star 0.05, expert 0.15, expert stars 0.10 | none | 20 | 13 | 0.20 / 0.95 / 1.05 | 6.4 |
|
||||
| PolyBreak | rounds 0.02 / 0.03 / 0.05 | gems 0.01-0.15, up to 0.5/day | 5 | 39 | 0.02 / 0.06 / 0.12 | 1.3 |
|
||||
| Drip Runner | chapters | drips 0.05, items | 5 | 15 | 0.05 / 0.15 / 0.25 | 1.2 |
|
||||
| Road Agent | sectors 0.05-1.00 (3.60 total) | patrol 0.03/day | 25 | 5 | 0.08 / 0.16 / 0.16 | 0.5 |
|
||||
| **All games** | | | | | | **~250 POL/week (~$23 at 9c)** |
|
||||
|
||||
PolHunter and Gem Kingdom are 81% of the burn. PolHunter is repeatable play (and every find is a delivered sponsor
|
||||
visit, so that burn delivers advertiser inventory). Gem Kingdom's burn is its boss amounts: one player took 25.5 POL in
|
||||
a single day. No other game pays more than 2 POL for any single reward.
|
||||
|
||||
## 2. The pass
|
||||
|
||||
- **$5, 7 days, all nine games.** One pass per account; buying while active extends by 7 days.
|
||||
- Paid with **purchased-grade credits only** (500 credits = the $5 package), through the existing game-purchase path
|
||||
(`ads.gamePurchase` with `purchasedOnly`, the same rule as PolyWarriors mint passes). A $5 package bought while a pass
|
||||
order waits fulfils it (the `pwpasses` pattern). Earned credits never buy a pass, or no money enters and the pass is
|
||||
just a free cap increase.
|
||||
- Money flow is the normal on-chain split of the $5 package: $2.50 sponsor, $1.00 level 2, $0.50 level 3, $1.00 company.
|
||||
The company's $1 is what funds the extra POL; the games' 30% pool-share rule is an allowance, not cash.
|
||||
|
||||
## 3. Caps (account-wide, across all nine games)
|
||||
|
||||
| | Free | Pass |
|
||||
|---|---|---|
|
||||
| Daily play rewards (repeatable) | **0.30 POL/day** | **1.50 POL/day** |
|
||||
| Everything (progress + daily), paced | **2.0 POL/day** | **5.0 POL/day** |
|
||||
| Progress rewards | unchanged amounts for everyone; excess over the daily total **carries to the next day** (never lost) | same |
|
||||
|
||||
Why these numbers:
|
||||
- Free 0.30/day sits under PolHunter's median (0.48) and SpellWheel's p90 (0.16 stays free). The regular PolHunter
|
||||
hunter is the natural pass buyer; the casual SpellWheel player never notices.
|
||||
- Pass 1.50/day is above today's p90 for every game, so a pass holder keeps everything they earn today and more.
|
||||
Max repeatable per pass week = 10.5 POL (~$0.98), so the pass can never pay for itself and multi-accounting can't win.
|
||||
- The paced total cap stops the Gem Kingdom spike (25 POL in a day) without changing any reward amount: a 10 POL boss
|
||||
still pays 10 POL, over a few days.
|
||||
- Company per pass: $1.00 in, at most $0.98 out if a holder maxes the repeatable cap every day. Realistic use (about
|
||||
half) nets about $0.50 a pass. Progress rewards were payable to free players already, so the pass adds no cost there.
|
||||
|
||||
**DECIDED (Marty, 2026-10-16): Gem Kingdom's bosses stay at 5 / 7.5 / 10 POL.** "We need one that pays out bigger like
|
||||
that anyway." The paced total cap spreads a big boss payout over a few days; the amounts do not change.
|
||||
|
||||
## 3a. API contract (both sides build to this)
|
||||
|
||||
> **Built 2026-10-16 (IAP side). Clarifications and additions to this contract, none of them breaking:**
|
||||
>
|
||||
> 1. **Where the endpoints live.** `GET /api/partner/player` exists today on each GAME (IAP reads the player's card line from it).
|
||||
> The pass and caps version below is served by **IAP** (`https://instantadpay.com/api/partner/player`), so a game CALLS it; nothing
|
||||
> changes on the game's own endpoint. Same for `polgrant`, `polgrant/void` and `tournament/*`: all on IAP.
|
||||
> 2. **Signature, spelled out.** Each game signs with the shared secret it already holds (its `*_SSO_SECRET`; PolHunter uses
|
||||
> `HUNT_SSO_SECRET`). 10-minute window on `ts` (ms).
|
||||
> - `GET /api/partner/player?game=<slug>&m=<memberId>&e=<email>&ts=<ms>&sig=<hex>` with
|
||||
> `sig = HMAC-SHA256(secret, 'player:' + who + ':' + ts)`, `who` = memberId when > 0, else the lowercased email (the same string
|
||||
> the games already compute for IAP's calls to them, with `game` added so IAP knows which secret to check).
|
||||
> - `POST` endpoints: JSON body that includes `game: <slug>`, headers `X-Game-Ts: <ms>` and
|
||||
> `X-Game-Sig: HMAC-SHA256(secret, ts + '\n' + rawBody)` hex (sign the exact bytes you send).
|
||||
> - `GET /api/partner/tournament/pending?game=<slug>&ts&sig` with `who = 'tournament'`.
|
||||
> 3. **`email` is accepted beside `memberId`.** Players who have not linked a wallet have `memberId: 0` in every hand-off token; send
|
||||
> `email` too (the token has it) and IAP resolves the account by email. A linked position's member id resolves to the owner's
|
||||
> account: the pass and the caps are per ACCOUNT.
|
||||
> 4. **Extra fields in answers** (additive): `polgrant` also returns `carried` (POL paid from an earlier day's deferral, already
|
||||
> inside `allowed`), `capHit` (`'daily'|'total'|null`), `enforced` (false before `capsStartDate`), `repeat` (true when the ref was
|
||||
> already answered), `voided`. `caps` also has `enforced`, `pass` and `pending` (POL deferred for this game, not yet paid).
|
||||
> `player` also returns `memberId, username, wallet, suspended, gamePassEnabled`. A suspended account gets `allowed: 0,
|
||||
> suspended: true` and nothing is recorded (a cleared account can replay the ref).
|
||||
> 5. **Carry-forward counts against the later day's total cap** (that is what "paced" means): a 10 POL boss on a 2 POL/day free
|
||||
> account pays 1.7-2.0 a day until done, paid before that day's new grants. Carry-forward only happens on a LATER Central day
|
||||
> than the deferral and only to the same game; the reply that carries it says `carried`.
|
||||
> 6. **`void` reverses only that ref's own share** (its `allowed` on its day and whatever of its deferral is still queued). POL it
|
||||
> already caused to be carried on a later day belongs to that later day and stays. The ref remains answered as voided.
|
||||
> 7. **Hand-off tokens carry the flag** as `gamePass: { active, until }` (not `pass`, which the in-game sign-in flow already uses for
|
||||
> its session token). Apply perks from it at sign-in; refresh from `player`/`polgrant` answers.
|
||||
> 8. **Tournament prize payout seam.** IAP records the winners and POL amounts; a game faucet (Road Agent pattern) pays them:
|
||||
> `GET /api/partner/tournament/pending` answers `{ ok, rows: [{ week, place, email, memberId, wallet, pol, ... }] }` (the same
|
||||
> list is also under `pending`, the admin pane's name) for the rows still unpaid, and the paying game calls
|
||||
> `POST /api/partner/tournament/paid { game, week, place, tx }` so the row leaves the list. PolHunter's faucet pays them
|
||||
> (`polhunter/lib/tournament.js`, see "Games: as built"); Admin > Game Pass shows the unpaid rows meanwhile.
|
||||
> 9. **Not deviations, just dev conveniences (non-production only):** `devDay: 'YYYY-MM-DD'` on `polgrant`/`player`/`buy` fakes the
|
||||
> Central day; `POST /api/dev/gamepass-purchase` fakes a package event; `devPaid: true` on `buy` skips the credit charge.
|
||||
|
||||
IAP is the single source of truth for the pass and for the account-wide caps. Every game already signs partner calls
|
||||
with its shared secret (the `/api/partner/player` pattern); the new calls use the same auth.
|
||||
|
||||
- `GET /api/partner/player?...` (existing) additionally returns `pass: { active: bool, until: ms|null }` and
|
||||
`caps: { daily: n, total: n, used: { daily: n, total: n }, day: 'YYYY-MM-DD' }` (Central day).
|
||||
- `POST /api/partner/polgrant` body `{ memberId, game, kind: 'daily'|'progress', pol, ref }` (ref = the game's own
|
||||
idempotency key, e.g. `sector:3`, `find:<id>`). Response `{ allowed: n, deferred: n, pass: bool, day }`.
|
||||
- `kind: 'daily'`: `allowed = min(pol, dailyCapRemaining, totalCapRemaining)`, the rest is DROPPED (never deferred).
|
||||
- `kind: 'progress'`: `allowed = min(pol, totalCapRemaining)`, the rest is DEFERRED: IAP stores it and the game's
|
||||
next call (any kind) on a later day gets it added to `allowed` first (carry-forward). Nothing is ever lost.
|
||||
- Same `ref` twice = same answer (idempotent). Fail closed: if the game cannot reach IAP it grants nothing and retries
|
||||
the same ref later.
|
||||
- `POST /api/partner/polgrant/void` `{ memberId, game, ref }` when a game decides not to pay after all (rare).
|
||||
- Settings on IAP (Admin > Settings, no deploy): `gamePassEnabled`, `gamePassPriceCredits` (500), `gamePassDays` (7),
|
||||
`capFreeDaily` 0.30, `capFreeTotal` 2.0, `capPassDaily` 1.50, `capPassTotal` 5.0, `capsStartDate` (the free caps apply
|
||||
only from this Central date; before it, the games' own caps stand, so the change can be announced a week ahead),
|
||||
`passTournamentPct` 5.
|
||||
- Pass purchase: `POST /api/my/gamepass/buy` spends 500 purchased-grade credits (`ads.gamePurchase` with
|
||||
`purchasedOnly`); a $5 package bought while a pass order waits fulfils it (the `pwpasses` pattern). Buying while active
|
||||
extends `until` by 7 days. The Games tab shows the card, the state, and the expiry.
|
||||
- Games get the pass flag at the sign-in hand-off and on every `polgrant` response; apply perks locally.
|
||||
|
||||
## 4. Pass perks per game (more game, not more payback)
|
||||
|
||||
| Game | Pass perk (besides the higher caps) |
|
||||
|---|---|
|
||||
| PolHunter | 5 missions/day instead of 3; Ad Detective twice a day. Finds still require the sponsor visit. |
|
||||
| Gem Kingdom | one free continue per day (small, so Crowns sales are not undercut) |
|
||||
| SpellWheel | streak bonus 0.15 -> 0.30; one free hint a day |
|
||||
| PolyWarriors | +1 daily mission; defense pay 15 -> 25 Circuits; Pass mark on the warrior card |
|
||||
| Road Agent | 2 patrols/day; +25% scrap. Fuel stays a sponsor visit. |
|
||||
| ClutterHunt | 2 free hints a day |
|
||||
| PolyBreak | gem cap 0.5 -> 1.5/day; one extra paddle per round |
|
||||
| Drip Runner | a shield at the start of every run |
|
||||
| Spooky Doors | +1 door a day while the season runs |
|
||||
| All games | **Weekly Pass Tournament**: cross-game leaderboard (finds, clears, wins), prizes from 5% of pass sales (25c per pass) in POL; Pass badge; gold profile frame |
|
||||
|
||||
Ad-visit mechanics (fuel, Crowns, hints, refuels) stay as they are. Those verified visits are what advertisers pay for.
|
||||
|
||||
## 5. Build outline
|
||||
|
||||
1. **IAP (central):** durable `gamepass` map {email: {until, history}}; `GET /api/partner/player` returns `pass:{active, until}`;
|
||||
new `POST /api/partner/polgrant` {member, game, kind: progress|daily, pol} -> {allowed, deferred} enforcing the
|
||||
account-wide caps (fail closed when IAP is unreachable; games retry); Games tab card "Game Pass: $5 for 7 days, all
|
||||
games"; buy flow via purchased credits or the $5 package; admin: passes sold, POL out per pass, cap hits.
|
||||
2. **Each game:** read the pass flag at the sign-in hand-off; call `polgrant` before every POL grant (replaces each game's
|
||||
own `dailyCapPol` for the account-wide rule; keep the local cap as a backstop); pace deferred progress rewards (queue,
|
||||
pays out next day); apply its perk; show "Pass" state and a "Get the Pass" nudge when the free cap is hit.
|
||||
3. **Tournament:** weekly job on IAP ranks pass holders across games, pays prizes from the games' wallets, posts to the
|
||||
Game Achievements topic.
|
||||
4. **Chatbot, release note, presentation games slide, and the guide's games section**: say "free play pays; the Pass
|
||||
plays more" (never "earn more").
|
||||
5. **QA:** iap-qa plus a scripted run per game: free cap hit -> nudge; pass bought -> cap raised; progress reward over
|
||||
the cap -> paid the next day; pass expiry -> back to free caps.
|
||||
|
||||
## 6. Rollout
|
||||
|
||||
- Announce one week ahead (the free cap change affects today's PolHunter regulars). First week: pass at $5 with a
|
||||
launch tournament; watch passes sold, POL out per pass, free-tier burn, verified visits delivered.
|
||||
- Review after 14 days against: company net per pass >= $0.40, free burn under 150 POL/week, no drop in visit deliveries.
|
||||
|
||||
## Built (IAP side, 2026-10-16)
|
||||
|
||||
Everything below is on IAP, behind `gamePassEnabled` (default off). The caps are recorded from day one and ENFORCED only from
|
||||
`capsStartDate`, so the change can be announced a week ahead and Admin can read what the caps would have done meanwhile.
|
||||
|
||||
**Files**
|
||||
- `gamepass.js` (new): pass store, waiting orders, cap ledger (`DATA_DIR/gamepass-ledger.json`, refs kept 90 days), tournament,
|
||||
admin stats, prune. Durable persisted maps `gamepass`, `gporders`, `gpprizes` (added to the DURABLE set in server.js so a deploy
|
||||
never wipes them).
|
||||
- `server.js`: settings defaults, init + hourly tournament tick + 6-hourly prune, purchase-event fulfilment (inside the
|
||||
`marks.claim` block, so two app copies never double-fulfil), partner helpers (`GP_SECRETS`, `gpPartnerCheck`, `gpResolve`,
|
||||
`gpDevNow`), `polUsdLive()` (catalog rate, 10-minute cache), `gpClaim` (the `gamePass` claim on every sign-in hand-off token,
|
||||
including PolHunter's), and the endpoints below.
|
||||
- `public/my.html` + `public/assets/my.js`: the Game Pass card at the top of Members > Games (state, caps line, Buy/Extend with
|
||||
`IAP.confirmBox`, waiting state with a Buy-a-package button), deep link `/my#games?pass=1` (setPane now strips a `?query` from
|
||||
the hash and highlights the card), the Overview nudge card `gpNudge` (shown once a day per browser after a game reports a free-cap
|
||||
hit, never to pass holders). Asset tag bumped to `my.js?v=20261016a`.
|
||||
- `public/admin.html` + `public/assets/admin.js`: Admin > Game Pass pane (passes sold week/total, active, POL out per pass week,
|
||||
free/pass cap hits, deferred queue, tournament last run + unpaid prizes, "Settle last week now", comp a pass). Tag
|
||||
`admin.js?v=20261016gp`.
|
||||
- `chatbot.js`: canned answer + FACTS line, `KNOWLEDGE_DATE` 2026-10-16.
|
||||
- `qa/gamepass.mjs` (new, `bash qa/run.sh gamepass`), `qa/walk.mjs` (Games tab card on/off + admin pane), `qa/run.sh`.
|
||||
- `docs/GAME-PASS-RELEASE.md`: the member-facing release note draft (not sent).
|
||||
|
||||
**Settings** (Admin > Settings > Site settings; all read live, no deploy): `gamePassEnabled` ('0'), `gamePassPriceCredits` (500),
|
||||
`gamePassDays` (7), `capFreeDaily` (0.30), `capFreeTotal` (2.0), `capPassDaily` (1.50), `capPassTotal` (5.0), `capsStartDate` ('',
|
||||
Central YYYY-MM-DD), `passTournamentPct` (5), `telegramGamesTopicId` ('661565'), `telegramGamesChatId` ('' = the shared echo chat).
|
||||
|
||||
**Endpoints**
|
||||
- Members: `GET /api/my/gamepass` -> `{ enabled, active, until, price, days, usd, waiting, bought, caps, capsStart, lastCapHit,
|
||||
tournament }`; `POST /api/my/gamepass/buy` -> `{ ok, active, until }` or `{ needPay: true, payUrl: '/my?from=gamepass#buy',
|
||||
order, price, need }`. Spends `gamePassPriceCredits` purchased-grade credits through `ads.gamePurchase(purchasedOnly)` with the
|
||||
credit-log label "Game Pass (7 days)"; short = waiting order, fulfilled by the next $5+ package purchase event.
|
||||
- Games (signed, see 3a): `GET /api/partner/player`, `POST /api/partner/polgrant`, `POST /api/partner/polgrant/void`,
|
||||
`GET /api/partner/tournament/pending`, `POST /api/partner/tournament/paid`.
|
||||
- Admin: `GET /api/admin/gamepass/stats`, `POST /api/admin/gamepass/comp { email, why }`,
|
||||
`POST /api/admin/gamepass/tournament/run { week?, force? }`.
|
||||
|
||||
**Tournament job**: hourly tick; once Monday 9 AM Central has passed and the closed week (Mon 00:00 to Mon 00:00 Central) has no
|
||||
row, exactly one app copy (`marks.claim('gamepass-tournament:<week>')`) ranks the week's pass holders by grants reported through
|
||||
`polgrant` (progress and daily weigh the same, one point per ref with pol > 0), pool = `passTournamentPct` of the week's pass sales
|
||||
in USD at the live catalog POL rate, split 50/30/20, rows recorded in `gpprizes` as pending, top 3 posted to the Game Achievements
|
||||
topic (`telegramGamesTopicId`, only when enabled), winners get an inbox notice (kind `notice`). Comps (`/comp`) are passes, not
|
||||
sales. If the POL rate is unavailable the tick retries next hour.
|
||||
|
||||
**Known limits / follow-ups**
|
||||
- The cap ledger is a JSON file on the volume (like the other IAP side stores), not a MySQL table: during the ~30 s deploy overlap
|
||||
two app copies each hold their own copy and the last save wins. A grant answered by the copy that is about to stop could be
|
||||
re-answered fresh by the other on retry. Move `refs`/`days` into MySQL if the games report drift.
|
||||
- `qa/gamepass.mjs` stubs the credit charge (`devPaid`) for the "buy -> active" step: `ads.gamePurchase(purchasedOnly)` needs a
|
||||
position with on-chain package credits, which a local copy without RPC cannot have. The "short -> waiting order -> package fulfils
|
||||
it" step runs the real path. The purchasedOnly charge itself is the live PolyWarriors mint path.
|
||||
- Prize POL is not sent by IAP (see 3a item 8): PolHunter's faucet pays the pending rows every 10 minutes behind `GAMEPASS=on`;
|
||||
the Games pane lists whatever is still unpaid.
|
||||
- Settings pass through `/api/admin/site` like every other site setting (that endpoint accepts any key; the defaults above make the
|
||||
Game Pass keys show in the Site settings form).
|
||||
|
||||
## Games: as built (2026-10-16, local commits only, nothing deployed)
|
||||
|
||||
Everything is behind `GAMEPASS=on` (env, default off = today's behaviour, so the games can be deployed before launch). `IAP_URL` is
|
||||
read where it already existed (default `https://instantadpay.com`). No reward amount changed anywhere; every game's local
|
||||
`dailyCapPol` / pool / hidden ceiling still stands in FRONT of the IAP call as a backstop and none was raised.
|
||||
|
||||
**The shared client `polgrant.js`** (byte-identical copy in every repo, md5 `f3c00b90…116a`; change one, copy to the rest):
|
||||
`spooky-doors/server/`, `road-agent/server/`, `match3-game/server/`, `seek-game/`, `spellwheel/`, `polybreak/`, `cyber-battle/game/`,
|
||||
`polhunter/lib/`, `drip-runner/lib/`.
|
||||
- `grant({ memberId, email, kind, pol, ref })` -> `POST /api/partner/polgrant` `{ game, memberId, email, kind, pol, ref }`, headers
|
||||
`X-Game-Ts` + `X-Game-Sig` (plus an informational `X-Game`), 6 s timeout. Returns `{ allowed, deferred, carried, pass, day, capHit,
|
||||
enforced, repeat, suspended, retry: false }` or `{ allowed: 0, retry: true, error }` on ANY non-200 / non-JSON / network error
|
||||
(fail closed; a 404 "no such member" is also a retry, so the games only call it for signed-in IAP members).
|
||||
- `email` always rides along (wallet-less members have `memberId: 0`; Drip Runner maps its negative `emailId` to 0). `whoOf()` = the
|
||||
member id when > 0, else the lowercased email; the pass cache and the retry queue key on it.
|
||||
- `voidGrant`, `fetchPass` (`GET /api/partner/player`, cached 10 min, fail-soft), `passOf` / `rememberPass` (hand-off claim
|
||||
`gamePass: { active, until }` + every answer), `view()` for the lobby, `note(resp, kind, nominal)` = the player-facing line.
|
||||
- Retry queue `polgrantq` in each game's store: `enqueue` dedupes per (who, ref); `retry(pay)` every 5 min, 48 h then `stuck` +
|
||||
`notify('gpstuck')` once (each game routes it to its faucet alert path); `queued()` keeps a waiting ref from being re-asked.
|
||||
- Carry-forward collection (SD-pattern games): `carrySweep()` on the existing tick, once a Central day per account with `gpOwed > 0`,
|
||||
a zero-POL `progress` call with ref `carry:<YYYY-MM-DD>`; IAP folds the carry into `allowed` (`carried`). `gpOwed` is bookkeeping
|
||||
(`+= deferred`, `-= carried`); the money truth is IAP's. **IAP accepts `pol: 0`** (verified by the integration test below).
|
||||
- `tournamentPending()` reads `rows` from `GET /api/partner/tournament/pending`; `tournamentPaid(row, tx)` posts
|
||||
`{ game, id?, week, place, memberId, email, tx }` (PolHunter only).
|
||||
|
||||
**Per game**
|
||||
|
||||
| Game | Files | Refs (kind) | Pass perk | Tests |
|
||||
|---|---|---|---|---|
|
||||
| Spooky Doors (`spooky-doors`) | server/pol.js (quote/settleGrant/grantGated/payQueued/carrySweep), server/game.js, server/server.js, server/social.js, src/main.js, test/gamepass.mjs | `rung:<n>` (progress) | +1 door/day while the season runs | sim 63/63, gamepass 37/37, e2e 200 pass / 3 pre-existing timing fails |
|
||||
| Road Agent (`road-agent`) | server/pol.js, server/game.js, server/server.js, server/social.js, src/main.js, test/gamepass.mjs | `sector:<n>` (progress); `patrol:<day>`, `patrol:<day>:2` (daily) | 2 patrols/day, +25% scrap | sim pass, gamepass 22/22, e2e pass |
|
||||
| Gem Kingdom (`match3-game`) | server/pol.js, server/server.js (`/api/continue/free`), src/world.js, src/battle.js, src/game.js, test/gamepass.cjs | `stage:<n>` (progress, bosses included) | one free continue/day, no sponsor visit | kingdom.test pass, gamepass 26/26, vite build ok |
|
||||
| ClutterHunt (`seek-game`) | pol.js, server.js, public/game.js, public/index.html (`game.js?v=20261016gp`), test/gamepass.js | `<season>:<room>:<clear or stars or xclear or xstars>` (progress) | 2 bonus hints banked once per Central day | gamepass 23/23 |
|
||||
| SpellWheel (`spellwheel`) | pol.js (`streakPassPol: 0.30`), server.js, public/play.js, public/play.html (`play.js?v=7`), test/gamepass.js | `level:<ch>:<n>`, `chapter:<ch>` (progress); `daily:<day>`, `streak:<day>` (daily) | streak 0.15 -> 0.30, 1 free hint/day | gamepass 25/25 |
|
||||
| PolyBreak (`polybreak`) | pol.js (`gemDailyPassPol: 1.5`), server.js, public/play.js, public/play.html (`play.js?v=6`), test/gamepass.js | `round:<n>` (progress); `gem:<run>:<id>` (daily) | gem ceiling 0.5 -> 1.5/day; +1 paddle per round | gamepass 27/27, run.js 70/70 |
|
||||
| PolyWarriors (`cyber-battle/game`) | pol.js, server.js (DEF_PAY_PASS 25), missions.js (3 + pass), public/game.js, public/game.html (`game.js?v=30`), test/gamepass.js | `rival:<id>`, `ladder`, `elite` (progress) | +1 daily mission (4), held defense 15 -> 25 Circuits, Pass row on the profile (card.js untouched) | gamepass 26/26 |
|
||||
| Drip Runner (`drip-runner`) | lib/ledger.js (chapterDripGated), lib/game.js, server.js, public/play.js, public/play.html (`play.js?v=20261016gp`), test/gamepass.js | `chapter:<n>` (progress; the only POL it pays) | a shield at every run start | gamepass 28/28, run.js pass |
|
||||
| PolHunter (`polhunter`) | lib/rewards.js (status `capped` / `gp-wait`), lib/detective.js, lib/faucet.js (`HUNT_DRY_RUN`), lib/tournament.js (new), server.js, public/app.js, public/app.html (`app.js?v=22`), test/gamepass.js | `find:<missionId>:<day>`, `detective:<boxId>` (daily) | 5 missions/day (+2), 2 Ad Detective cases/day | gamepass 42/42, run.js pass |
|
||||
|
||||
Game commits (local, not pushed): spooky-doors f54ef0c, road-agent d345bbf, match3-game 972dd71, seek-game 9751329, spellwheel b582b72,
|
||||
polybreak e9c3a54, cyber-battle/game fa76d30, drip-runner a7b1fd9, polhunter 7391fd7 + 08486e1. Spooky Doors, Road Agent and Gem
|
||||
Kingdom are Vite builds (hashed assets, no `?v=` bump).
|
||||
|
||||
**Decisions taken on the games side (flip if wanted)**
|
||||
1. Advertiser-funded PolHunter missions (`mission.paid`) are NOT gated: the advertiser paid for that completion. Gate them in
|
||||
polhunter/server.js (`gp.on() && !m.paid`) if the cap should cover them too.
|
||||
2. A 0-allowed daily reward is still "done": a capped find counts as today's find (status `capped`, never reaches the faucet); a capped
|
||||
gem/patrol/daily puzzle is recorded as handled with `pol: 0`. The player sees the cap line with the Pass link.
|
||||
3. Fail closed, visibly: IAP unreachable = the reward is recorded (SD pattern: nothing written until IAP answers, ref queued; PolHunter:
|
||||
a `gp-wait` row settled by the queue), the player sees "Your reward is recorded and pays as soon as InstantAdPay confirms it."
|
||||
4. Perks read the cached flag (hand-off claim -> every grant answer -> `fetchPass` every 10 min); a pass bought mid-session shows
|
||||
within 10 minutes or on the next grant.
|
||||
5. Deferred progress rewards: the ledger row is written with `pol: allowed` (0 included) so the achievement is marked done; carry comes
|
||||
back through `carry:<day>` or any later grant.
|
||||
6. Not built: a per-game admin view of the queue (PolHunter's admin state shows queue + stuck counts and the tournament payer).
|
||||
|
||||
**Pass Tournament payer (PolHunter `lib/tournament.js`)**: every 10 min behind `GAMEPASS=on`, only with the faucet wallet configured.
|
||||
Per pending row: a durable claim in `tourney-claims` BEFORE sending (`id:<id>` or `wk:<week>:<place>`), the tx hash written the
|
||||
moment the chain has it, then `POST /api/partner/tournament/paid`. A claimed row with a hash is only re-reported, never re-sent; a
|
||||
claim without a hash is retried after 10 min; a send failure releases the claim, leaves the row pending on IAP and alerts
|
||||
(`tourneyfail`); low balance alerts once a day. `HUNT_DRY_RUN=on` records `wouldPay` and sends nothing. **Trap:** a claim written
|
||||
during a dry run is permanent (`c.dry` rows are skipped forever), so a prize row seen while `HUNT_DRY_RUN=on` is never paid after the
|
||||
flag is turned off unless `tourney-claims.json` on the PolHunter volume is cleared. Prizes bypass the per-find daily cap and the
|
||||
payout threshold. Admin: `/api/admin/state` -> `tournament` and `gamepass` blocks.
|
||||
|
||||
**Integration test (both sides, local)**: `bash qa/run.sh gamepass-games` (qa/gamepass-games.cjs) boots IAP like qa/gamepass.mjs and
|
||||
drives the REAL `spooky-doors/server/polgrant.js` and `polhunter/lib/tournament.js` against it (needs the sibling game repos under
|
||||
`../..`): fetchPass free/pass, daily within/over cap, progress deferral, the `carry:<day>` zero-POL call on the next Central day
|
||||
(`carried` > 0, idempotent repeat), void, bad secret and IAP-down -> `{ allowed: 0, retry: true }`, the retry queue, and the
|
||||
tournament payer in dry run and live (mocked faucet.send) until IAP's pending list is empty. 2026-10-16: 44/44 after the `rows`
|
||||
fix on the pending endpoint (the games read `rows`; IAP answered only `pending`).
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
{
|
||||
"hours": 192,
|
||||
"subject": "The one thing nobody tells you about ad platforms..",
|
||||
"body": "This might be the most important email I send you about InstantAdPay.\n\nBecause there is a detail in how this works that most people do not notice until it is too late.\n\nIt is not about the ad credits, the formats, or even the commission structure.\n\nIt is about timing.\n\nHere is how it works. Your invite link is already live. If someone clicks it, signs up, and buys their first ad package, any package from $5 to $250, you receive 50 percent of that payment. The smart contract pays you in the same transaction. No holding tank, no withdrawal minimum, no waiting.\n\nThat is the upside everyone talks about.\n\nHere is what nobody mentions.\n\nThe moment a person buys their first package through any link, they are locked to that sponsor permanently. Every future package they buy pays that sponsor's line.\n\nSo if someone you know (a friend, a subscriber, a group contact) joins InstantAdPay through someone else's link and buys their first package there, they are locked to that other person for good.\n\n{{paid:You already bought, so your own placement is settled. Your link is live and paying.|If you have not bought yet, your link is still live. It still pays you 50 percent from anyone who clicks it today and buys.}}\n\nBut it will not capture the people you know unless you send it to them.\n\nOne person this week. Just put {{link}} where they will see it. That is all it takes.\n\n{{sponsor}} got their link from somewhere too. Same deal. Now it is your turn to pass it forward.\n\nMarty\n\n{{footer}}"
|
||||
"body": "This might be the most important email I send you about InstantAdPay.\n\nBecause there is a detail in how this works that most people do not notice until it is too late.\n\nIt is not about the ad credits, the formats, or even the commission structure.\n\nIt is about timing.\n\nHere is how it works. Your invite link is already live. If someone clicks it, signs up, and buys their first ad package, any package from $5 to $500, you receive 50 percent of that payment. The smart contract pays you in the same transaction. No holding tank, no withdrawal minimum, no waiting.\n\nThat is the upside everyone talks about.\n\nHere is what nobody mentions.\n\nThe moment a person buys their first package through any link, they are locked to that sponsor permanently. Every future package they buy pays that sponsor's line.\n\nSo if someone you know (a friend, a subscriber, a group contact) joins InstantAdPay through someone else's link and buys their first package there, they are locked to that other person for good.\n\n{{paid:You already bought, so your own placement is settled. Your link is live and paying.|If you have not bought yet, your link is still live. It still pays you 50 percent from anyone who clicks it today and buys.}}\n\nBut it will not capture the people you know unless you send it to them.\n\nOne person this week. Just put {{link}} where they will see it. That is all it takes.\n\n{{sponsor}} got their link from somewhere too. Same deal. Now it is your turn to pass it forward.\n\nMarty\n\n{{footer}}"
|
||||
},
|
||||
{
|
||||
"hours": 264,
|
||||
|
||||
+319
@@ -0,0 +1,319 @@
|
||||
// Game Pass (2026-10-16): the $5 weekly pass across all nine games, and the account-wide POL cap service the games call
|
||||
// before every POL grant. IAP is the single source of truth for both; the games keep their own caps only as a backstop.
|
||||
// Spec: docs/GAME-PASS.md (section 3a is the contract the games build against).
|
||||
//
|
||||
// What lives here:
|
||||
// - the pass store email -> { until, bought: [{ ts, via, tx | credits, usd }], lastCapHit } (durable persisted map 'gamepass')
|
||||
// - waiting orders order -> { status, email, ts, tx } (a $5+ package bought while an order waits fulfils it: the pwpasses pattern)
|
||||
// - the cap ledger per member per Central day: used daily/total, deferred queue per game, every answered (game, ref) kept 90 days
|
||||
// - the weekly Pass Tournament: ranks pass holders by grants reported through polgrant, records POL prizes for the games to pay
|
||||
// - admin stats
|
||||
//
|
||||
// Not to be confused with the in-game SIGN-IN pass (server.js gamePassMint/gamePassOpen): that is a session token the games keep
|
||||
// in localStorage. This module is the paid Game Pass product. Fields on the wire are `pass: { active, until }` (3a).
|
||||
'use strict';
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const TZ = 'America/Chicago';
|
||||
const GAMES = ['polhunter', 'gemkingdom', 'spellwheel', 'spookydoors', 'polywarriors', 'clutterhunt', 'polybreak', 'driprunner', 'roadagent'];
|
||||
const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', driprunner: 'Drip Runner', roadagent: 'Road Agent' };
|
||||
const SHARES = [0.5, 0.3, 0.2]; // tournament prize split, places 1-3
|
||||
const KEEP_DAYS = 90; // answered refs and day rows are kept this long (idempotency window)
|
||||
const r6 = x => Math.round((Number(x) || 0) * 1e6) / 1e6;
|
||||
|
||||
let R = null; // deps from server.js
|
||||
let passes, orders, prizes; // durable persisted maps (server.js open-tokens store, DURABLE set)
|
||||
let L = null; // the cap ledger: { members: { email: { days: {}, deferred: {}, weeks: {} } }, refs: { 'game:ref': {...} } }
|
||||
let saveTimer = null;
|
||||
|
||||
// ---- Central time (no tz lib; same arithmetic as leaderboard.js) ----
|
||||
function ctParts(ts) {
|
||||
const s = new Date(ts).toLocaleString('en-US', { timeZone: TZ, hour12: false, year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', weekday: 'short' });
|
||||
const m = /(\w{3}), (\d{2})\/(\d{2})\/(\d{4}), (\d{2}):(\d{2})/.exec(s);
|
||||
return { wd: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'].indexOf(m[1]), y: +m[4], mo: +m[2], d: +m[3], h: +m[5] % 24, mi: +m[6] };
|
||||
}
|
||||
function ctMidnight(ts) { const p = ctParts(ts); const guess = Date.UTC(p.y, p.mo - 1, p.d, 5, 0, 0); const q = ctParts(guess); return (q.h === 0 && q.d === p.d) ? guess : guess + 3600000; }
|
||||
function weekStart(ts) { const p = ctParts(ts); const mid = ctMidnight(ts); return mid - ((p.wd + 6) % 7) * 86400000; }
|
||||
const dayKey = ts => new Date(ts).toLocaleDateString('en-CA', { timeZone: TZ });
|
||||
const weekKey = ts => dayKey(weekStart(ts));
|
||||
const dayLabel = key => new Date(key + 'T12:00:00Z').toLocaleDateString('en-US', { month: 'short', day: 'numeric', timeZone: 'UTC' });
|
||||
|
||||
// ---- settings (Admin > Settings, no deploy) ----
|
||||
function cfg() {
|
||||
const sc = R.siteConfig();
|
||||
const n = (k, d) => { const raw = sc[k]; if (raw === undefined || raw === null || String(raw).trim() === '') return d; const v = Number(raw); return Number.isFinite(v) ? v : d; };
|
||||
const start = String(sc.capsStartDate || '').trim();
|
||||
return {
|
||||
enabled: ['1', 'true', 'on', 'yes'].includes(String(sc.gamePassEnabled).trim().toLowerCase()),
|
||||
price: Math.max(1, Math.round(n('gamePassPriceCredits', 500))),
|
||||
days: Math.max(1, Math.round(n('gamePassDays', 7))),
|
||||
free: { daily: Math.max(0, n('capFreeDaily', 0.30)), total: Math.max(0, n('capFreeTotal', 2.0)) },
|
||||
pass: { daily: Math.max(0, n('capPassDaily', 1.50)), total: Math.max(0, n('capPassTotal', 5.0)) },
|
||||
start: /^\d{4}-\d{2}-\d{2}$/.test(start) ? start : '',
|
||||
pct: Math.max(0, n('passTournamentPct', 5)),
|
||||
gamesChat: String(sc.telegramGamesChatId || sc.telegramEchoChatId || '').trim(),
|
||||
gamesTopic: String(sc.telegramGamesTopicId || '').trim(),
|
||||
};
|
||||
}
|
||||
const enforcedOn = (c, day) => !!(c.start && day >= c.start);
|
||||
|
||||
// ---- ledger file ----
|
||||
const FILE = () => path.join(R.dataDir, 'gamepass-ledger.json');
|
||||
function load() { try { L = JSON.parse(fs.readFileSync(FILE(), 'utf8')); } catch (e) { L = null; } if (!L || typeof L !== 'object') L = { members: {}, refs: {} }; L.members = L.members || {}; L.refs = L.refs || {}; }
|
||||
function save() { saveTimer = null; try { fs.writeFileSync(FILE(), JSON.stringify(L)); } catch (e) { console.error('gamepass ledger save', e.message); } }
|
||||
function touch() { if (!saveTimer) saveTimer = setTimeout(save, 500); }
|
||||
function member(e) { return (L.members[e] = L.members[e] || { days: {}, deferred: {}, weeks: {} }); }
|
||||
function dayRow(M, day) {
|
||||
return (M.days[day] = M.days[day] || { daily: 0, total: 0, carried: 0, dropped: 0, deferredOut: 0, grants: 0, hits: { daily: 0, total: 0 },
|
||||
tier: { free: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, pass: { allowed: 0, hitsDaily: 0, hitsTotal: 0 } },
|
||||
would: { dropped: 0, deferred: 0, hitsDaily: 0, hitsTotal: 0 } }); // would = what the caps would have done before capsStartDate
|
||||
}
|
||||
|
||||
function init(deps) {
|
||||
R = deps;
|
||||
passes = R.persistedMap('gamepass');
|
||||
orders = R.persistedMap('gporders');
|
||||
prizes = R.persistedMap('gpprizes');
|
||||
load();
|
||||
}
|
||||
|
||||
// ---- the pass ----
|
||||
function rec(e) { return passes.get(e) || null; }
|
||||
function flag(email, now) { const p = rec(String(email || '').toLowerCase()); const t = now || Date.now(); const until = p && Number(p.until) || 0; return { active: until > t, until: until || null }; }
|
||||
function extend(e, via, extra, now) {
|
||||
const c = cfg(); const t = now || Date.now(); const cur = passes.get(e) || { until: 0, bought: [] };
|
||||
const base = Math.max(t, Number(cur.until) || 0);
|
||||
const until = base + c.days * 86400000;
|
||||
const bought = [Object.assign({ ts: t, via, usd: c.price / 100, days: c.days }, extra || {})].concat(cur.bought || []).slice(0, 200);
|
||||
passes.set(e, Object.assign({}, cur, { until, bought, ts: t }));
|
||||
return { until, days: c.days };
|
||||
}
|
||||
function waitingOrder(e) { for (const [k, o] of orders) if (o.status === 'waiting' && o.email === e) return Object.assign({ order: k }, o); return null; }
|
||||
function comp(email, why) { const e = String(email || '').toLowerCase(); const x = extend(e, 'admin', { note: why || 'support', usd: 0 }); return { active: true, until: x.until, days: x.days }; } // support comp: counts as no sale
|
||||
|
||||
// GET /api/my/gamepass
|
||||
function view(email, now) {
|
||||
const e = String(email || '').toLowerCase(); const c = cfg(); const t = now || Date.now(); const f = flag(e, t); const p = rec(e); const w = waitingOrder(e);
|
||||
const caps = capsFor(e, t);
|
||||
return { enabled: c.enabled, active: f.active, until: f.until, price: c.price, days: c.days, usd: c.price / 100,
|
||||
waiting: !!w, waitingSince: w ? w.ts : null, bought: p ? (p.bought || []).length : 0,
|
||||
caps, capsStart: c.start || null, lastCapHit: p && p.lastCapHit && (t - p.lastCapHit.ts) < 2 * 86400000 ? p.lastCapHit : null,
|
||||
tournament: { pct: c.pct, shares: SHARES, next: nextTournamentAt(t) } };
|
||||
}
|
||||
|
||||
// POST /api/my/gamepass/buy. `charge(price, label)` runs ads.gamePurchase(purchasedOnly) and resolves { ok } | { error: 'short', ... } | { error }.
|
||||
async function buy(email, charge, now) {
|
||||
const e = String(email || '').toLowerCase(); const c = cfg(); const t = now || Date.now();
|
||||
if (!c.enabled) return { error: 'The Game Pass is not open yet.' };
|
||||
const r = await charge(c.price, 'Game Pass (' + c.days + ' days)');
|
||||
if (r && r.ok) {
|
||||
const x = extend(e, 'credits', { credits: c.price, campaignId: r.campaignId || null }, t);
|
||||
console.log('gamepass bought with credits', e, c.price, 'until', new Date(x.until).toISOString());
|
||||
return { ok: true, active: true, until: x.until, days: c.days, paid: 'credits' };
|
||||
}
|
||||
if (r && r.error === 'short') {
|
||||
// no purchased-grade credits on a position: the pass waits for a $5 package (bought while the order waits, it fulfils it)
|
||||
let w = waitingOrder(e);
|
||||
if (!w) { const k = 'gp-' + t.toString(36) + '-' + Math.random().toString(36).slice(2, 8); orders.set(k, { status: 'waiting', email: e, ts: t }); w = Object.assign({ order: k }, orders.get(k)); }
|
||||
return { ok: false, needPay: true, payUrl: '/my?from=gamepass#buy', order: w.order, price: c.price, usd: c.price / 100, available: r.available || 0, need: r.need || c.price,
|
||||
message: 'The pass is paid with purchased credits. Buy a $' + (c.price / 100) + ' package and the pass starts the moment it settles; you keep every credit of the package for your ads.' };
|
||||
}
|
||||
return { error: (r && r.error) || 'The purchase did not go through. Nothing was taken.' };
|
||||
}
|
||||
|
||||
// a package purchase landing on chain fulfils this account's waiting order (one pass per purchase of $5 or more)
|
||||
async function onEvent(ev) {
|
||||
if (!ev || ev.type !== 'Purchase' || (ev.priceCents || 0) < 500) return null;
|
||||
const c = cfg(); if ((ev.priceCents || 0) < c.price) return null;
|
||||
const a = (ev.devEmail && !R.isProd) ? { email: ev.devEmail } : await R.accounts.byMemberId(ev.buyerId); if (!a || !a.email) return null;
|
||||
const e = String(a.email).toLowerCase();
|
||||
const p = passes.get(e); if (p && (p.bought || []).some(b => b.tx && b.tx === ev.tx)) return null; // each purchase counts once
|
||||
const w = waitingOrder(e); if (!w) return null;
|
||||
orders.set(w.order, Object.assign({}, orders.get(w.order), { status: 'paid', tx: ev.tx, cents: ev.priceCents, paidAt: Date.now() }));
|
||||
const x = extend(e, 'package', { tx: ev.tx, cents: ev.priceCents, order: w.order }, ev.ts || Date.now());
|
||||
console.log('gamepass fulfilled by package', e, 'tx', String(ev.tx).slice(0, 12), 'until', new Date(x.until).toISOString());
|
||||
return { order: w.order, until: x.until };
|
||||
}
|
||||
|
||||
// ---- the caps ----
|
||||
function capsFor(email, now, game) {
|
||||
const e = String(email || '').toLowerCase(); const c = cfg(); const t = now || Date.now(); const day = dayKey(t); const pass = flag(e, t).active;
|
||||
const lim = pass ? c.pass : c.free; const M = L.members[e]; const D = M && M.days[day];
|
||||
const used = { daily: r6(D ? D.daily : 0), total: r6(D ? D.total : 0) };
|
||||
const out = { daily: lim.daily, total: lim.total, used, day, enforced: enforcedOn(c, day), pass };
|
||||
if (game && M) out.pending = r6((M.deferred[game] || []).reduce((n, x) => n + x.left, 0));
|
||||
return out;
|
||||
}
|
||||
|
||||
// POST /api/partner/polgrant. Returns { allowed, deferred, pass, day } (+ carried, capHit, enforced, repeat).
|
||||
function grant(o) {
|
||||
const e = String(o.email || '').toLowerCase(); const game = String(o.game || '').toLowerCase(); const kind = o.kind === 'progress' ? 'progress' : 'daily';
|
||||
const pol = r6(o.pol); const ref = String(o.ref || '').slice(0, 120); const t = o.now || Date.now(); const day = dayKey(t);
|
||||
if (!e || !GAMES.includes(game) || !ref || !(pol >= 0)) return { error: 'memberId/email, game, kind, pol and ref are required' };
|
||||
const key = game + ':' + ref;
|
||||
const prev = L.refs[key];
|
||||
if (prev) return { allowed: prev.allowed, deferred: prev.deferred, pass: prev.pass, day: prev.day, carried: prev.carried || 0, capHit: prev.capHit || null, enforced: !!prev.enforced, repeat: true, voided: !!prev.voided };
|
||||
const c = cfg(); const pass = flag(e, t).active; const lim = pass ? c.pass : c.free; const enforced = enforcedOn(c, day);
|
||||
const M = member(e); const D = dayRow(M, day); const tier = D.tier[pass ? 'pass' : 'free'];
|
||||
let totalRem = Math.max(0, r6(lim.total - D.total)), dailyRem = Math.max(0, r6(lim.daily - D.daily));
|
||||
// carry-forward: progress POL deferred on an EARLIER day for this game is paid first, inside today's total cap
|
||||
let carried = 0; const q = M.deferred[game] || [];
|
||||
for (const d of q) {
|
||||
if (d.day >= day || d.left <= 0) continue;
|
||||
const take = enforced ? Math.min(d.left, Math.max(0, r6(totalRem - carried))) : d.left;
|
||||
if (take <= 0) break;
|
||||
d.left = r6(d.left - take); carried = r6(carried + take); d.paid = (d.paid || []).concat([{ day, pol: take, ref }]).slice(-20);
|
||||
}
|
||||
M.deferred[game] = q.filter(d => d.left > 0);
|
||||
if (carried) { D.total = r6(D.total + carried); D.carried = r6(D.carried + carried); tier.allowed = r6(tier.allowed + carried); totalRem = Math.max(0, r6(totalRem - carried)); }
|
||||
// the new grant
|
||||
let allowed = pol, deferred = 0, dropped = 0, capHit = null;
|
||||
const wouldAllowed = kind === 'daily' ? Math.min(pol, dailyRem, totalRem) : Math.min(pol, totalRem);
|
||||
const wouldHit = wouldAllowed < pol ? (kind === 'daily' && dailyRem <= totalRem ? 'daily' : 'total') : null;
|
||||
if (enforced) {
|
||||
allowed = r6(wouldAllowed); capHit = wouldHit;
|
||||
if (kind === 'daily') { dropped = r6(pol - allowed); if (dropped) D.dropped = r6(D.dropped + dropped); }
|
||||
else { deferred = r6(pol - allowed); if (deferred) { q.push({ ref, pol, left: deferred, ts: t, day }); M.deferred[game] = q; D.deferredOut = r6(D.deferredOut + deferred); } }
|
||||
if (capHit) { D.hits[capHit] += 1; tier[capHit === 'daily' ? 'hitsDaily' : 'hitsTotal'] += 1; }
|
||||
} else if (wouldHit) { // before capsStartDate: everything is allowed, but Admin sees what the caps would have done
|
||||
D.would[kind === 'daily' ? 'dropped' : 'deferred'] = r6(D.would[kind === 'daily' ? 'dropped' : 'deferred'] + (pol - wouldAllowed));
|
||||
D.would[wouldHit === 'daily' ? 'hitsDaily' : 'hitsTotal'] += 1;
|
||||
}
|
||||
if (kind === 'daily') D.daily = r6(D.daily + allowed);
|
||||
D.total = r6(D.total + allowed); tier.allowed = r6(tier.allowed + allowed); D.grants += 1;
|
||||
// tournament activity: one point per reported grant (progress and daily weigh the same)
|
||||
if (pol > 0) { const wk = weekKey(t); M.weeks[wk] = M.weeks[wk] || {}; M.weeks[wk][game] = (M.weeks[wk][game] || 0) + 1; }
|
||||
if (capHit) { const p = passes.get(e) || { until: 0, bought: [] }; passes.set(e, Object.assign({}, p, { lastCapHit: { ts: t, day, game, kind: capHit, pass } })); }
|
||||
const out = { allowed: r6(carried + allowed), deferred, pass, day, carried, capHit, enforced, kind, pol, email: e, ts: t, own: allowed };
|
||||
L.refs[key] = out; touch();
|
||||
return { allowed: out.allowed, deferred, pass, day, carried, capHit, enforced, repeat: false };
|
||||
}
|
||||
|
||||
// POST /api/partner/polgrant/void: the game decided not to pay after all. Reverses this ref's own share (the carry it triggered
|
||||
// belongs to earlier refs and stays). The ref stays answered, as voided, so a replay is still idempotent.
|
||||
function voidGrant(o) {
|
||||
const game = String(o.game || '').toLowerCase(); const ref = String(o.ref || '').slice(0, 120); const key = game + ':' + ref;
|
||||
const prev = L.refs[key]; if (!prev) return { ok: true, unknown: true };
|
||||
if (prev.voided) return { ok: true, voided: true, repeat: true };
|
||||
const M = member(prev.email); const D = dayRow(M, prev.day);
|
||||
const own = r6(prev.own || 0);
|
||||
D.total = Math.max(0, r6(D.total - own)); if (prev.kind === 'daily') D.daily = Math.max(0, r6(D.daily - own));
|
||||
const tier = D.tier[prev.pass ? 'pass' : 'free']; tier.allowed = Math.max(0, r6(tier.allowed - own));
|
||||
let removed = 0; const q = M.deferred[game] || []; for (const d of q) if (d.ref === ref) { removed = r6(removed + d.left); d.left = 0; } M.deferred[game] = q.filter(d => d.left > 0);
|
||||
if (removed) D.deferredOut = Math.max(0, r6(D.deferredOut - removed));
|
||||
const wk = weekKey(prev.ts || Date.now()); if (M.weeks[wk] && M.weeks[wk][game]) M.weeks[wk][game] -= 1;
|
||||
Object.assign(prev, { voided: true, allowed: 0, deferred: 0, carried: 0, voidedAt: Date.now(), reversed: { allowed: own, deferred: removed } }); touch();
|
||||
return { ok: true, voided: true, reversed: { allowed: own, deferred: removed } };
|
||||
}
|
||||
|
||||
// ---- the weekly Pass Tournament (Monday 9 AM Central, the week that just closed) ----
|
||||
function nextTournamentAt(now) { const t = now || Date.now(); const ws = weekStart(t); const thisMon = ws + 9 * 3600000; return t < thisMon ? thisMon : ws + 7 * 86400000 + 9 * 3600000; }
|
||||
function holdersIn(start, end) {
|
||||
const out = [];
|
||||
for (const [e, p] of passes) { if (!p || !(p.until > start)) continue; if ((p.bought || []).some(b => b.ts < end)) out.push(e); }
|
||||
return out;
|
||||
}
|
||||
const isSale = b => b && b.via !== 'admin'; // comps are passes, not sales
|
||||
function salesIn(start, end) { let n = 0, usd = 0; for (const [, p] of passes) for (const b of (p && p.bought) || []) if (isSale(b) && b.ts >= start && b.ts < end) { n += 1; usd += Number(b.usd) || 0; } return { n, usd: Math.round(usd * 100) / 100 }; }
|
||||
function scoresFor(wk, emails) {
|
||||
return emails.map(e => { const M = L.members[e]; const g = (M && M.weeks[wk]) || {}; const score = Object.values(g).reduce((n, x) => n + x, 0); const first = ((passes.get(e) || {}).bought || []).reduce((m, b) => Math.min(m, b.ts), Infinity);
|
||||
return { email: e, score, games: g, first }; }).filter(x => x.score > 0).sort((a, b) => b.score - a.score || a.first - b.first || (a.email < b.email ? -1 : 1));
|
||||
}
|
||||
async function runTournament(startTs, opts) {
|
||||
const c = cfg(); const start = weekStart(startTs); const end = start + 7 * 86400000; const wk = dayKey(start);
|
||||
if (prizes.get(wk) && !(opts && opts.force)) return prizes.get(wk);
|
||||
const polUsd = await R.polUsd().catch(() => 0);
|
||||
if (!(polUsd > 0)) return { error: 'POL rate unavailable; the tournament for the week of ' + wk + ' will be settled on the next hourly pass.' };
|
||||
const sales = salesIn(start, end); const poolUsd = Math.round(sales.usd * c.pct) / 100;
|
||||
const poolPol = r6(poolUsd / polUsd);
|
||||
const ranked = scoresFor(wk, holdersIn(start, end));
|
||||
const winners = [];
|
||||
for (let i = 0; i < Math.min(3, ranked.length); i++) {
|
||||
const x = ranked[i]; let a = null; try { a = await R.accounts.byEmail(x.email); } catch (e) {}
|
||||
winners.push({ place: i + 1, email: x.email, username: (a && a.username) || null, memberId: (a && a.memberId) || 0, wallet: (a && a.address) || null, score: x.score, games: x.games, pol: r6(poolPol * SHARES[i]), usd: Math.round(poolUsd * SHARES[i] * 100) / 100, status: 'pending', tx: null });
|
||||
}
|
||||
const row = { week: wk, label: 'week of ' + dayLabel(wk), start, end, sales: sales.n, salesUsd: sales.usd, pct: c.pct, poolUsd, polUsd, poolPol, holders: holdersIn(start, end).length, ranked: ranked.length, winners,
|
||||
unallocatedPol: r6(poolPol - winners.reduce((n, w) => n + w.pol, 0)), ranAt: Date.now(), posted: false };
|
||||
prizes.set(wk, row);
|
||||
console.log('gamepass tournament', wk, 'sales', sales.n, 'pool', poolPol, 'POL', 'winners', winners.length);
|
||||
if (winners.length && c.enabled) {
|
||||
const medal = ['\u{1F947}', '\u{1F948}', '\u{1F949}'];
|
||||
const lines = winners.map(w => medal[w.place - 1] + ' ' + (w.username ? '@' + w.username : 'member #' + (w.memberId || '?')) + ' · ' + w.score + ' plays · ' + w.pol.toFixed(2) + ' POL');
|
||||
const html = '\u{1F3AE} <b>Game Pass Tournament</b> · ' + row.label + '\n' + lines.join('\n') + '\n' + sales.n + ' pass' + (sales.n === 1 ? '' : 'es') + ' sold · prize pool ' + poolPol.toFixed(2) + ' POL (' + c.pct + '% of pass sales)\n'
|
||||
+ 'Prizes are paid in POL by the games to the winners’ InstantAdPay wallets. Get the Pass: https://instantadpay.com/my#games?pass=1';
|
||||
try { await R.telegram(html); row.posted = true; prizes.set(wk, row); } catch (e) { console.error('gamepass tournament post', e.message); }
|
||||
for (const w of winners) { try { await R.notify(w.email, 'Game Pass Tournament: you placed #' + w.place, '<p>You finished <b>#' + w.place + '</b> in the Game Pass Tournament for the ' + row.label + ' with ' + w.score + ' plays across the games. Your prize of <b>' + w.pol.toFixed(2) + ' POL</b> is paid to the wallet on your InstantAdPay account by the games this week.</p>'); } catch (e) {} }
|
||||
}
|
||||
return row;
|
||||
}
|
||||
// hourly: once Monday 9 AM Central has passed and the closed week has no row yet, exactly one app copy settles it (marks.claim)
|
||||
async function tournamentTick(now) {
|
||||
const t = now || Date.now(); const c = cfg(); if (!c.enabled) return null;
|
||||
const ws = weekStart(t); if (t < ws + 9 * 3600000) return null; // not yet 9 AM Monday for the week that just closed
|
||||
const prev = ws - 7 * 86400000; const wk = dayKey(prev);
|
||||
if (prizes.get(wk)) return null;
|
||||
if (!holdersIn(prev, ws).length && !salesIn(prev, ws).n) { prizes.set(wk, { week: wk, label: 'week of ' + dayLabel(wk), start: prev, end: ws, sales: 0, salesUsd: 0, poolPol: 0, winners: [], ranAt: Date.now(), empty: true }); return null; }
|
||||
if (!(await R.marks.claim('gamepass-tournament:' + wk))) return null;
|
||||
return runTournament(prev);
|
||||
}
|
||||
// GET /api/partner/tournament/pending: prize rows the games still have to pay (the Road Agent faucet pattern)
|
||||
function pending() { const out = []; for (const [, row] of prizes) for (const w of row.winners || []) if (w.status === 'pending') out.push({ week: row.week, label: row.label, place: w.place, email: w.email, username: w.username, memberId: w.memberId, wallet: w.wallet, pol: w.pol, usd: w.usd, score: w.score }); return out.sort((a, b) => a.week < b.week ? -1 : a.week > b.week ? 1 : a.place - b.place); }
|
||||
function markPaid(week, place, tx, by) {
|
||||
const row = prizes.get(String(week)); if (!row) return { error: 'no such week' };
|
||||
const w = (row.winners || []).find(x => x.place === Number(place)); if (!w) return { error: 'no such place' };
|
||||
if (w.status === 'paid') return { ok: true, repeat: true, tx: w.tx };
|
||||
Object.assign(w, { status: 'paid', tx: String(tx || '').slice(0, 80), paidAt: Date.now(), paidBy: by || null }); prizes.set(String(week), row);
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
// ---- admin ----
|
||||
function adminStats(now) {
|
||||
const t = now || Date.now(); const c = cfg(); const ws = weekStart(t); const day = dayKey(t); const wkFrom = dayKey(ws);
|
||||
let active = 0, soldTotal = 0, usdTotal = 0, soldWeek = 0, usdWeek = 0, waiting = 0, comped = 0;
|
||||
for (const [, p] of passes) { if (!p) continue; if ((p.until || 0) > t) active += 1; for (const b of p.bought || []) { if (!isSale(b)) { comped += 1; continue; } soldTotal += 1; usdTotal += Number(b.usd) || 0; if (b.ts >= ws) { soldWeek += 1; usdWeek += Number(b.usd) || 0; } } }
|
||||
for (const [, o] of orders) if (o.status === 'waiting') waiting += 1;
|
||||
const wk = { pass: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, free: { allowed: 0, hitsDaily: 0, hitsTotal: 0 }, carried: 0, dropped: 0, deferredOut: 0, grants: 0, would: { dropped: 0, deferred: 0, hitsDaily: 0, hitsTotal: 0 }, players: 0 };
|
||||
const today = { allowed: 0, grants: 0, players: 0 };
|
||||
let qEntries = 0, qPol = 0, qMembers = 0; const byGame = {};
|
||||
for (const [e, M] of Object.entries(L.members)) {
|
||||
let inWeek = false;
|
||||
for (const [d, D] of Object.entries(M.days)) {
|
||||
if (d < wkFrom) continue; inWeek = true;
|
||||
for (const k of ['pass', 'free']) { wk[k].allowed = r6(wk[k].allowed + D.tier[k].allowed); wk[k].hitsDaily += D.tier[k].hitsDaily; wk[k].hitsTotal += D.tier[k].hitsTotal; }
|
||||
wk.carried = r6(wk.carried + D.carried); wk.dropped = r6(wk.dropped + D.dropped); wk.deferredOut = r6(wk.deferredOut + D.deferredOut); wk.grants += D.grants;
|
||||
for (const k of ['dropped', 'deferred']) wk.would[k] = r6(wk.would[k] + D.would[k]); wk.would.hitsDaily += D.would.hitsDaily; wk.would.hitsTotal += D.would.hitsTotal;
|
||||
if (d === day) { today.allowed = r6(today.allowed + D.total); today.grants += D.grants; today.players += 1; }
|
||||
}
|
||||
if (inWeek) wk.players += 1;
|
||||
let mine = 0; for (const [g, q] of Object.entries(M.deferred)) for (const x of q) { qEntries += 1; qPol = r6(qPol + x.left); mine += 1; byGame[g] = r6((byGame[g] || 0) + x.left); }
|
||||
if (mine) qMembers += 1;
|
||||
const W = M.weeks[wkFrom] || {}; for (const [g, n] of Object.entries(W)) { byGame['plays:' + g] = (byGame['plays:' + g] || 0) + n; }
|
||||
void e;
|
||||
}
|
||||
const rows = [...prizes.values()].sort((a, b) => a.week < b.week ? 1 : -1);
|
||||
return { enabled: c.enabled, settings: { price: c.price, days: c.days, free: c.free, pass: c.pass, capsStart: c.start || null, pct: c.pct, enforced: enforcedOn(c, day) },
|
||||
week: { start: ws, label: 'week of ' + dayLabel(wkFrom), day },
|
||||
passes: { soldWeek, soldTotal, usdWeek: Math.round(usdWeek * 100) / 100, usdTotal: Math.round(usdTotal * 100) / 100, active, comped, waitingOrders: waiting },
|
||||
pol: { week: { pass: wk.pass.allowed, free: wk.free.allowed, carried: wk.carried, dropped: wk.dropped, deferredOut: wk.deferredOut, grants: wk.grants, players: wk.players, perPass: soldWeek ? r6(wk.pass.allowed / soldWeek) : 0 }, today },
|
||||
capHits: { week: { free: { daily: wk.free.hitsDaily, total: wk.free.hitsTotal }, pass: { daily: wk.pass.hitsDaily, total: wk.pass.hitsTotal } }, would: wk.would },
|
||||
deferredQueue: { entries: qEntries, pol: qPol, members: qMembers, byGame },
|
||||
tournament: { lastRun: rows[0] ? rows[0].ranAt : null, last: rows[0] || null, next: nextTournamentAt(t), pending: pending().length, history: rows.slice(0, 8) } };
|
||||
}
|
||||
|
||||
// ---- housekeeping: answered refs and day rows older than KEEP_DAYS, week tallies older than 10 weeks ----
|
||||
function prune(now) {
|
||||
const t = now || Date.now(); const cut = t - KEEP_DAYS * 86400000; const cutDay = dayKey(cut); const cutWeek = dayKey(weekStart(t - 70 * 86400000)); let n = 0;
|
||||
for (const [k, r] of Object.entries(L.refs)) if ((r.ts || 0) < cut) { delete L.refs[k]; n++; }
|
||||
for (const [e, M] of Object.entries(L.members)) {
|
||||
for (const d of Object.keys(M.days)) if (d < cutDay) { delete M.days[d]; n++; }
|
||||
for (const w of Object.keys(M.weeks)) if (w < cutWeek) { delete M.weeks[w]; n++; }
|
||||
if (!Object.keys(M.days).length && !Object.keys(M.weeks).length && !Object.values(M.deferred).some(q => q.length)) delete L.members[e];
|
||||
}
|
||||
for (const [k, o] of orders) if (o.status === 'waiting' && t - o.ts > 30 * 86400000) orders.delete(k); // a pass order nobody paid for in a month is forgotten
|
||||
if (n) touch();
|
||||
return n;
|
||||
}
|
||||
|
||||
module.exports = { init, cfg, GAMES, NAMES, flag, view, buy, comp, onEvent, capsFor, grant, voidGrant, tournamentTick, runTournament, pending, markPaid, adminStats, prune, weekStart, dayKey,
|
||||
_ledger: () => L };
|
||||
+22
-1
@@ -101,6 +101,7 @@
|
||||
<button data-pane="blog" type="button"><svg viewBox="0 0 24 24"><path d="M4 4h12l4 4v12H4z"/><path d="M8 12h8M8 16h8M8 8h4"/></svg>Blog</button>
|
||||
<button data-pane="releases" type="button"><svg viewBox="0 0 24 24"><path d="M4 6h16M4 12h10M4 18h7"/><circle cx="18" cy="17" r="3"/></svg>Releases</button>
|
||||
<button data-pane="pnl" type="button"><svg viewBox="0 0 24 24"><path d="M4 19V5M4 19h16"/><path d="M8 15l3-4 3 2 5-6"/></svg>P&L</button>
|
||||
<button data-pane="gamepass" type="button"><svg viewBox="0 0 24 24"><rect x="2.5" y="7" width="19" height="11" rx="5.5"/><path d="M7 11v3M5.5 12.5h3"/><circle cx="15.5" cy="11.5" r="1.1"/><circle cx="18" cy="13.5" r="1.1"/></svg>Game Pass</button>
|
||||
<button data-pane="settings" type="button"><svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"/></svg>Settings</button>
|
||||
</nav>
|
||||
<div class="bo-links">
|
||||
@@ -479,6 +480,26 @@
|
||||
<p><button class="btn small sec" type="button" id="burnerRun">Run now</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pane" id="pane-gamepass" hidden>
|
||||
<div class="grid" style="grid-template-columns:repeat(auto-fit,minmax(200px,1fr));margin-top:0" id="gpStats"><p class="small muted">…</p></div>
|
||||
<div class="grid c2" style="margin-top:16px">
|
||||
<div class="card">
|
||||
<div class="card-head"><h3>This week</h3><span class="sub" id="gpWeekSub"></span></div>
|
||||
<div id="gpWeek" class="small">…</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-head"><h3>Pass Tournament</h3><span class="sub" id="gpTourSub"></span></div>
|
||||
<div id="gpTour" class="small">…</div>
|
||||
<p style="margin:12px 0 0;display:flex;gap:8px;flex-wrap:wrap"><button class="btn small sec" id="gpTourRun" type="button">Settle last week now</button></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-head"><h3>Comp a pass</h3><span class="sub">support: one pass week, recorded as no sale</span></div>
|
||||
<p style="display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin:0"><input id="gpCompEmail" placeholder="member email" style="max-width:260px"><input id="gpCompWhy" placeholder="why" style="max-width:220px"><button class="btn small" id="gpComp" type="button">Give one pass week</button></p>
|
||||
</div>
|
||||
<p class="small muted">Settings live in Settings › Site settings: gamePassEnabled (1/0), gamePassPriceCredits, gamePassDays, capFreeDaily, capFreeTotal, capPassDaily, capPassTotal, capsStartDate (Central YYYY-MM-DD; empty = caps recorded, not enforced), passTournamentPct, telegramGamesTopicId. Prize POL is paid by the games from their faucets (GET /api/partner/tournament/pending), not from here.</p>
|
||||
</div>
|
||||
|
||||
<div class="pane" id="pane-settings" hidden>
|
||||
<div class="card">
|
||||
<div class="card-head"><h3>Follow-up emails</h3><span class="sub" id="dripSub">sent to every new free member, hours after sign-up</span></div>
|
||||
@@ -521,6 +542,6 @@
|
||||
</div>
|
||||
|
||||
<script src="/assets/common.js?v=20261015a"></script><script src="/assets/welcome.js?v=20260923b"></script>
|
||||
<script src="/assets/admin.js?v=20261006gm"></script>
|
||||
<script src="/assets/admin.js?v=20261016gp"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+36
-2
@@ -44,8 +44,8 @@
|
||||
});
|
||||
|
||||
// ── panes ──
|
||||
const TITLES = { overview: 'Overview', house: 'House ads', campaigns: 'All campaigns', members: 'Members', reports: 'Reports', traffic: 'Traffic', blog: 'Blog', releases: 'Releases and roadmap', pnl: 'Profit and loss', settings: 'Settings' };
|
||||
const loaders = { overview: loadOverview, house: loadHouse, campaigns: loadCampaigns, members: loadMembers, reports: loadReports, traffic: loadTraffic, blog: loadBlog, releases: loadReleases, pnl: loadPnl, settings: loadSettings };
|
||||
const TITLES = { overview: 'Overview', house: 'House ads', campaigns: 'All campaigns', members: 'Members', reports: 'Reports', traffic: 'Traffic', blog: 'Blog', releases: 'Releases and roadmap', pnl: 'Profit and loss', gamepass: 'Game Pass', settings: 'Settings' };
|
||||
const loaders = { overview: loadOverview, house: loadHouse, campaigns: loadCampaigns, members: loadMembers, reports: loadReports, traffic: loadTraffic, blog: loadBlog, releases: loadReleases, pnl: loadPnl, gamepass: loadGamePass, settings: loadSettings };
|
||||
function setPane(name) {
|
||||
if (!TITLES[name]) name = 'overview';
|
||||
document.querySelectorAll('.pane').forEach(p => { p.hidden = p.id !== 'pane-' + name; });
|
||||
@@ -1008,6 +1008,40 @@
|
||||
catch (e) { $('siteErr').textContent = e.message; $('siteErr').hidden = false; }
|
||||
}));
|
||||
|
||||
// ---- Game Pass (2026-10-16): passes sold, active, POL out per pass week, cap hits, deferred queue, tournament ----
|
||||
async function loadGamePass() {
|
||||
const r = await api('/api/admin/gamepass/stats');
|
||||
const pol = n => Number(n || 0).toFixed(2); const usd = n => '$' + Number(n || 0).toFixed(2);
|
||||
const tile = (v, lb, cls, sub) => '<div class="statx' + (cls ? ' ' + cls : '') + '"><div><div class="nv">' + v + '</div><div class="lb">' + lb + '</div>' + (sub ? '<span class="chip flat">' + sub + '</span>' : '') + '</div></div>';
|
||||
const P = r.passes || {}, W = (r.pol && r.pol.week) || {}, H = (r.capHits && r.capHits.week) || { free: {}, pass: {} }, Q = r.deferredQueue || {}, T = r.tournament || {}, S = r.settings || {};
|
||||
$('gpStats').innerHTML = tile(r.enabled ? 'ON' : 'OFF', 'Game Pass', r.enabled ? 'c-cyan' : '', S.enforced ? 'caps enforced' : S.capsStart ? 'caps from ' + S.capsStart : 'caps recorded only')
|
||||
+ tile(P.soldWeek || 0, 'Passes sold this week', 'c-violet', usd(P.usdWeek) + ' · ' + (P.soldTotal || 0) + ' all time')
|
||||
+ tile(P.active || 0, 'Active passes', 'c-cyan', (P.waitingOrders || 0) + ' waiting for a package')
|
||||
+ tile(pol(W.pass), 'POL to pass holders this week', 'c-amber', (P.soldWeek ? pol(W.perPass) + ' per pass sold' : 'no passes sold yet'))
|
||||
+ tile(pol(W.free), 'POL to free players this week', '', (W.players || 0) + ' players · ' + (W.grants || 0) + ' grants')
|
||||
+ tile((H.free.daily || 0) + (H.free.total || 0), 'Free cap hits this week', 'c-amber', (H.free.daily || 0) + ' daily · ' + (H.free.total || 0) + ' total')
|
||||
+ tile((H.pass.daily || 0) + (H.pass.total || 0), 'Pass cap hits this week', '', (H.pass.daily || 0) + ' daily · ' + (H.pass.total || 0) + ' total')
|
||||
+ tile(Q.entries || 0, 'Deferred queue', 'c-violet', pol(Q.pol) + ' POL · ' + (Q.members || 0) + ' members');
|
||||
$('gpWeekSub').textContent = r.week ? r.week.label + ' · today ' + r.week.day : '';
|
||||
const would = (r.capHits && r.capHits.would) || {};
|
||||
$('gpWeek').innerHTML = '<table class="adm-table">'
|
||||
+ '<tr><td>Carried forward (deferred progress paid on a later day)</td><td class="num">' + pol(W.carried) + ' POL</td></tr>'
|
||||
+ '<tr><td>Dropped (daily play over the daily cap)</td><td class="num">' + pol(W.dropped) + ' POL</td></tr>'
|
||||
+ '<tr><td>Deferred out (progress over the total cap, pays later)</td><td class="num">' + pol(W.deferredOut) + ' POL</td></tr>'
|
||||
+ (S.enforced ? '' : '<tr><td colspan="2" class="muted">Before capsStartDate, what the caps WOULD have done: ' + pol(would.dropped) + ' POL dropped, ' + pol(would.deferred) + ' POL deferred, ' + ((would.hitsDaily || 0) + (would.hitsTotal || 0)) + ' cap hits.</td></tr>')
|
||||
+ '<tr><td>Caps: free ' + S.free.daily + ' / ' + S.free.total + ' · pass ' + S.pass.daily + ' / ' + S.pass.total + ' POL (daily play / everything, per day)</td><td class="num">' + S.price + ' credits · ' + S.days + ' days</td></tr>'
|
||||
+ '</table>'
|
||||
+ (Q.byGame && Object.keys(Q.byGame).length ? '<p class="muted" style="margin:8px 0 0">By game: ' + Object.entries(Q.byGame).filter(([k]) => !k.startsWith('plays:')).map(([k, v]) => esc(k) + ' ' + pol(v) + ' POL queued').concat(Object.entries(Q.byGame).filter(([k]) => k.startsWith('plays:')).map(([k, v]) => esc(k.slice(6)) + ' ' + v + ' plays')).join(' · ') + '</p>' : '');
|
||||
$('gpTourSub').textContent = (T.lastRun ? 'last settled ' + when(T.lastRun) : 'never run') + ' · next Monday 9 AM Central (' + when(T.next) + ') · ' + (T.pending || 0) + ' prize' + (T.pending === 1 ? '' : 's') + ' unpaid';
|
||||
const L = T.last;
|
||||
$('gpTour').innerHTML = !L ? '<p class="muted">No week settled yet. The job runs hourly and settles the closed week once Monday 9 AM Central has passed; ' + S.pct + '% of that week\u2019s pass sales becomes the POL prize pool (50 / 30 / 20).</p>'
|
||||
: '<p><b>' + esc(L.label) + '</b>: ' + (L.sales || 0) + ' pass' + (L.sales === 1 ? '' : 'es') + ' sold (' + usd(L.salesUsd) + '), pool ' + pol(L.poolPol) + ' POL at $' + Number(L.polUsd || 0).toFixed(4) + ' per POL, ' + (L.holders || 0) + ' holders, ' + (L.ranked || 0) + ' with plays' + (L.posted ? ' · posted to Telegram' : '') + '</p>'
|
||||
+ (L.winners && L.winners.length ? '<table class="adm-table">' + L.winners.map(w => '<tr><td>#' + w.place + ' ' + esc(w.username ? '@' + w.username : w.email) + '</td><td>' + w.score + ' plays</td><td class="num">' + pol(w.pol) + ' POL</td><td>' + esc(w.status) + (w.tx ? ' · ' + esc(String(w.tx).slice(0, 12)) : '') + '</td></tr>').join('') + '</table>' : '<p class="muted">No pass holder reported any plays that week.</p>')
|
||||
+ ((T.history || []).length > 1 ? '<p class="muted" style="margin:8px 0 0">Earlier: ' + T.history.slice(1).map(h => esc(h.label) + ' (' + (h.sales || 0) + ' sold, ' + pol(h.poolPol) + ' POL)').join(' · ') + '</p>' : '');
|
||||
}
|
||||
$('gpTourRun').addEventListener('click', busy($('gpTourRun'), async () => { const r = await api('/api/admin/gamepass/tournament/run', {}); IAP.status('Settled ' + r.label + ': ' + (r.winners || []).length + ' winner(s), pool ' + Number(r.poolPol || 0).toFixed(2) + ' POL.', 'ok'); await loadGamePass(); }));
|
||||
$('gpComp').addEventListener('click', busy($('gpComp'), async () => { const r = await api('/api/admin/gamepass/comp', { email: $('gpCompEmail').value, why: $('gpCompWhy').value }); IAP.status('Pass on ' + r.email + ' until ' + when(r.until) + '.', 'ok'); $('gpCompEmail').value = ''; await loadGamePass(); }));
|
||||
|
||||
async function loadSettings() {
|
||||
const [r, s, d] = await Promise.all([api('/api/admin/rates'), api('/api/admin/site'), api('/api/admin/drip')]);
|
||||
ratesObj = r.rates || {}; drawRates();
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
const { products } = await (await fetch('/api/catalog')).json();
|
||||
const wrap = document.getElementById('tiles');
|
||||
wrap.innerHTML = '';
|
||||
const NAMES = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader' };
|
||||
const NAMES = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader', 6: 'Starter', 7: 'Elite' };
|
||||
products.sort((a, b) => a.priceCents - b.priceCents);
|
||||
for (const p of products) {
|
||||
const bonus = p.creditAmount - p.priceCents; // credits above 1cr/cent = bulk bonus
|
||||
const div = document.createElement('div');
|
||||
@@ -153,7 +154,7 @@
|
||||
setB($id('dcB3'), l3open, qualifies ? (5 - d) + ' more buyer(s)' : 'needs $20+ buyers');
|
||||
$id('dcQualNote').textContent = qualifies
|
||||
? 'Buyers of $20 or more count toward your qualification. 2 unlock level 2, 5 unlock level 3.'
|
||||
: 'Heads up: $5 packages pay your level 1 but do not qualify buyers, so levels 2 and 3 stay locked in this scenario.';
|
||||
: 'Heads up: packages under $20 pay your level 1 but do not qualify buyers, so levels 2 and 3 stay locked in this scenario.';
|
||||
};
|
||||
['dcDirects', 'dcPkg', 'dcSpread'].forEach(x => $id(x).addEventListener('input', recalc));
|
||||
recalc();
|
||||
|
||||
@@ -130,10 +130,10 @@
|
||||
}
|
||||
}).catch(() => {});
|
||||
// package ladder (dollar constants + live POL quote)
|
||||
const NAMES = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader' };
|
||||
const NAMES = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader', 6: 'Starter', 7: 'Elite' };
|
||||
fetch('/api/catalog').then(r => r.json()).then(c => {
|
||||
const wrap = $('jnLadder'); if (!wrap || !c.products) return;
|
||||
wrap.innerHTML = c.products.filter(p => p.active !== false).map(p =>
|
||||
wrap.innerHTML = c.products.filter(p => p.active !== false).sort((a, b) => a.priceCents - b.priceCents).map(p =>
|
||||
'<div class="jn-pk"><div class="n">' + (NAMES[p.id] || 'Package ' + p.id) + '</div><div class="p">' + IAP.fmtUsd(p.priceCents) + '</div><div class="c">' + Number(p.creditAmount).toLocaleString() + ' credits</div>'
|
||||
+ (p.costWei ? '<div class="small muted">' + IAP.fmtPol(p.costWei) + ' POL now</div>' : '') + '</div>').join('');
|
||||
}).catch(() => {});
|
||||
|
||||
+61
-4
@@ -788,6 +788,7 @@
|
||||
earn: 'Earn credits', earnings: 'Earnings', promo: 'Promo tools', training: 'Training', games: 'Games',
|
||||
wallet: 'Wallet & account', profile: 'Profile' };
|
||||
function setPane(name) {
|
||||
const paneQ = String(name || '').split('?')[1] || ''; name = String(name || '').split('?')[0]; // /my#games?pass=1 opens the Game Pass card (deep link from the games)
|
||||
if (!PANES.includes(name)) name = 'overview';
|
||||
for (const p of PANES) {
|
||||
const el = $('pane-' + p);
|
||||
@@ -806,7 +807,7 @@
|
||||
if (name === 'campaigns') ['cTarget', 'cImage', 'cVideoUrl'].forEach(id => { if ($(id)) $(id).value = ''; }); // no residual URL between visits
|
||||
if (name === 'training') loadTraining();
|
||||
if (name === 'pipeline') loadPipeline();
|
||||
if (name === 'games') loadGames();
|
||||
if (name === 'games') loadGames(paneQ);
|
||||
document.getElementById('memberArea').classList.remove('side-open'); // close mobile drawer
|
||||
if (location.hash !== '#' + name) history.replaceState(null, '', '#' + name);
|
||||
}
|
||||
@@ -1681,6 +1682,60 @@
|
||||
} catch (e) {}
|
||||
}
|
||||
loadWednesdayCard(); setInterval(loadWednesdayCard, 120000);
|
||||
|
||||
// ---- Game Pass (2026-10-16, docs/GAME-PASS.md): $5 for 7 days across all nine games. More game, never "earn more". ----
|
||||
const gpDate = ms => new Date(Number(ms)).toLocaleDateString([], { weekday: 'short', month: 'short', day: 'numeric' });
|
||||
const gpPol = n => Number(n || 0).toFixed(2).replace(/\.?0+$/, '');
|
||||
async function loadGamePassCard(highlight) {
|
||||
const card = $('gpCard'); if (!card) return;
|
||||
let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {}
|
||||
if (!gp || !gp.enabled) { card.hidden = true; return; }
|
||||
const caps = gp.caps || {}; const price = gp.price || 500;
|
||||
const state = gp.active ? '<span class="badge" style="background:var(--gold,#e2b04a);color:#111">Pass active \u00b7 until ' + esc(gpDate(gp.until)) + '</span>'
|
||||
: gp.waiting ? '<span class="badge amber">Waiting for a $' + (gp.usd || 5) + ' package</span>' : '<span class="badge">Not active</span>';
|
||||
const capsLine = caps.enforced
|
||||
? 'Today: <b>' + gpPol(caps.used && caps.used.total) + '</b> of ' + gpPol(caps.total) + ' POL used across the games (' + gpPol(caps.used && caps.used.daily) + ' of ' + gpPol(caps.daily) + ' on daily play).'
|
||||
: gp.capsStart ? 'Account-wide caps start on ' + esc(gpDate(Date.parse(gp.capsStart + 'T17:00:00Z'))) + ': free play ' + gpPol(caps.daily) + ' POL a day on repeatable rewards, 2 POL a day in all; with the Pass 1.50 and 5.'
|
||||
: 'Account-wide caps are not switched on yet; the games\u2019 own caps stand for now.';
|
||||
card.hidden = false; card.classList.toggle('gp-hl', !!highlight);
|
||||
card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F Game Pass</h3><span class="sub">$' + (gp.usd || 5) + ' for ' + (gp.days || 7) + ' days \u00b7 all nine games</span></div>'
|
||||
+ '<p style="margin:0 0 8px">' + state + '</p>'
|
||||
+ '<p>Free play pays real POL every day. The Pass plays <b>more</b>: higher daily POL caps across every game (1.50 a day on repeatable rewards instead of 0.30, 5 a day in all instead of 2), a seat in the weekly <b>Pass Tournament</b> with POL prizes from ' + (gp.tournament && gp.tournament.pct || 5) + '% of pass sales, extra plays and perks in each game, and the Pass badge. One pass covers your whole account, linked positions included.</p>'
|
||||
+ '<p class="small muted">' + capsLine + '</p>'
|
||||
+ (gp.waiting ? '<p class="small">Your pass is waiting: buy a $' + (gp.usd || 5) + ' package and it starts the moment the purchase settles. You keep every credit of the package for your ads.</p>' : '')
|
||||
+ '<p style="display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:10px 0 0">'
|
||||
+ (gp.waiting ? '<button class="btn" type="button" id="gpGoBuy">Buy a $' + (gp.usd || 5) + ' package</button>' : '<button class="btn" type="button" id="gpBuy">' + (gp.active ? 'Extend ' + (gp.days || 7) + ' more days' : 'Get the Pass') + ' \u00b7 ' + price + ' credits</button>')
|
||||
+ '<span class="small muted">Paid with purchased credits from your packages (earned credits never buy a pass). Short? A $' + (gp.usd || 5) + ' package starts it the moment it settles.</span></p>';
|
||||
const b = $('gpBuy'); if (b) b.addEventListener('click', async () => {
|
||||
const yes = await IAP.confirmBox((gp.active ? 'Extend your Game Pass by ' + (gp.days || 7) + ' days' : 'Get the Game Pass for ' + (gp.days || 7) + ' days') + ' for ' + price + ' purchased credits? Higher daily caps across all nine games, the weekly Pass Tournament and the Pass perks start at once.', { title: 'Game Pass', ok: gp.active ? 'Extend the Pass' : 'Get the Pass', cancel: 'Not now' });
|
||||
if (!yes) return;
|
||||
b.disabled = true;
|
||||
try {
|
||||
const r = await api('/api/my/gamepass/buy');
|
||||
if (r.needPay) { IAP.status(r.message || 'Buy a $5 package and the pass starts when it settles.', 'bad'); await loadGamePassCard(true); return; }
|
||||
IAP.status('Game Pass active until ' + gpDate(r.until) + '. Have fun out there.', 'ok');
|
||||
await loadGamePassCard(true);
|
||||
} catch (e) { IAP.status(e.message, 'bad'); b.disabled = false; }
|
||||
});
|
||||
const g = $('gpGoBuy'); if (g) g.addEventListener('click', () => setPane('buy'));
|
||||
if (highlight) { try { card.scrollIntoView({ behavior: 'smooth', block: 'start' }); } catch (e) {} }
|
||||
}
|
||||
// Overview nudge: a game reported this member hit the free cap (polgrant lastCapHit). Shown once a day per browser, never to pass holders.
|
||||
async function loadGpNudge() {
|
||||
const card = $('gpNudge'); if (!card) return;
|
||||
if (cardHidden('gpnudge')) { card.hidden = true; return; }
|
||||
let gp = null; try { gp = await (await fetch('/api/my/gamepass')).json(); } catch (e) {}
|
||||
if (!gp || !gp.enabled || gp.active || !gp.lastCapHit || gp.lastCapHit.pass) { card.hidden = true; return; }
|
||||
const NAMES = { polhunter: 'PolHunter', gemkingdom: 'Gem Kingdom', spellwheel: 'SpellWheel', spookydoors: 'Spooky Doors', polywarriors: 'PolyWarriors', clutterhunt: 'ClutterHunt', polybreak: 'PolyBreak', driprunner: 'Drip Runner', roadagent: 'Road Agent' };
|
||||
card.hidden = false;
|
||||
card.innerHTML = '<div class="card-head"><h3>\u{1F39F}\uFE0F You reached today\u2019s free cap in ' + esc(NAMES[gp.lastCapHit.game] || 'the games') + '</h3><span class="sub">free play keeps paying; the Pass plays more</span></div>'
|
||||
+ '<p>Every member earns real POL in the games up to the daily cap. The <b>Game Pass</b> raises the caps across all nine games for ' + (gp.days || 7) + ' days ($' + (gp.usd || 5) + ', paid with purchased credits), adds the weekly Pass Tournament and a perk in every game.</p>'
|
||||
+ '<button class="btn" type="button" id="gpNudgeGo">See the Game Pass</button>';
|
||||
$('gpNudgeGo').addEventListener('click', () => setPane('games?pass=1'));
|
||||
try { localStorage.setItem('iap-hide-gpnudge', String(Date.now())); } catch (e) {} // once a day
|
||||
cardDismiss(card, 'gpnudge');
|
||||
}
|
||||
loadGpNudge();
|
||||
// launch-day surprise (Marty, 2026-09-20): PolHunter appears at siteConfig.launchAt, not a minute before.
|
||||
// The card and the menu entry flip on their own if the dashboard is already open.
|
||||
let phShown = false;
|
||||
@@ -1712,8 +1767,9 @@
|
||||
if (!j || !j.show) { card.hidden = true; return; }
|
||||
card.hidden = false; $('pdPre').hidden = !j.preview; $('pdLine').textContent = j.line || '';
|
||||
}
|
||||
async function loadGames() {
|
||||
async function loadGames(q) {
|
||||
const el = $('gamesGrid'); if (!el) return;
|
||||
loadGamePassCard(/(^|&)pass=1(&|$)/.test(q || '')).catch(() => {});
|
||||
let g = null; try { g = await (await fetch('/api/my/games')).json(); } catch (e) {}
|
||||
const list = (g && g.games) || [];
|
||||
if (!list.length) { el.innerHTML = '<p class="muted small">No games are open yet. Check back soon.</p>'; return; }
|
||||
@@ -1941,7 +1997,7 @@
|
||||
// ── Qualified Start calculator ──
|
||||
(function () {
|
||||
const n = $('qcN'), pk = $('qcPkg'), out = $('qcOut'); if (!n || !pk || !out) return;
|
||||
const CR = { 20: 2000, 50: 5500, 100: 12000, 250: 32500 };
|
||||
const CR = { 20: 2000, 50: 5500, 100: 12000, 250: 32500, 500: 70000 };
|
||||
const calc = () => {
|
||||
const k = Math.max(1, Math.min(10, Number(n.value) || 1)), usd = Number(pk.value) || 20;
|
||||
const gross = k * usd, back = gross / 2, net = gross - back, credits = k * (CR[usd] || 0);
|
||||
@@ -2439,7 +2495,7 @@
|
||||
}));
|
||||
|
||||
// ── in-dashboard package buying ──
|
||||
const PKG = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader' };
|
||||
const PKG = { 1: 'Micro', 2: 'Activation', 3: 'Builder', 4: 'Growth', 5: 'Leader', 6: 'Starter', 7: 'Elite' };
|
||||
// Card on-ramp: buy POL with a card via MoonPay, delivered to the buyer's own
|
||||
// wallet. Signed + wallet-prefilled once MoonPay keys are set; generic page
|
||||
// otherwise. The site never touches funds — MoonPay is merchant of record.
|
||||
@@ -2525,6 +2581,7 @@
|
||||
const { products } = await (await fetch('/api/catalog')).json();
|
||||
const wrap = $('boTiles');
|
||||
wrap.innerHTML = '';
|
||||
products.sort((a, b) => a.priceCents - b.priceCents);
|
||||
for (const p of products) {
|
||||
const bonus = p.creditAmount - p.priceCents;
|
||||
const div = document.createElement('div');
|
||||
|
||||
@@ -29,8 +29,8 @@ window.IAPPromo = (function () {
|
||||
{ net: 'X', label: 'X · advertiser', text: 'Marketers: you were buying traffic anyway. Here the ad spend in your line pays you, in the same transaction, on a public ledger. Packages from $5. Join free: {{LINK:adspend}}' },
|
||||
{ net: 'X', label: 'X · free join', text: 'Join free. View a few ads, earn credits, run your first campaign for zero dollars. Seven ad formats, real dwell-timed attention, every payout public on Polygon. {{LINK:free}}' },
|
||||
{ net: 'Facebook', label: 'Facebook · story post', text: 'I got tired of "your commission is pending." So I joined a platform where there is no pending. A smart contract on the Polygon blockchain splits every ad package the moment it sells: half to the sponsor, then levels two and three, then the platform. It lands in your own wallet in seconds. No approval queue, no withdrawal button, no 15th of the month.\n\nYou are buying real advertising: banners, text ads, login ads, solo ads to member inboxes, video ads, featured links and verified visits. Members earn credits for their attention, so the ads actually get seen.\n\nJoin free, look around, and check the public ledger before you spend a dollar: {{LINK:instant}}\n\nNo income promises. It is advertising, not investing, and crypto carries risk.' },
|
||||
{ net: 'Facebook', label: 'Facebook · skeptic angle', text: 'Every online program I ever joined asked me to trust a back office. This one does not. Every payout is a public transaction on Polygon you can look up yourself, with the wallet addresses and amounts right there. The split is written in a verified smart contract nobody can quietly edit.\n\nFree to join with just an email. The wallet comes out only if you buy a package or switch on payouts. Packages run $5 to $250, and every one of them is ad delivery you can watch running.\n\nTake the tour: {{LINK:ledger}}' },
|
||||
{ net: 'LinkedIn', label: 'LinkedIn · professional', text: 'An experiment in transparent affiliate payouts: InstantAdPay sells advertising packages ($5 to $250) whose sponsor commissions are settled by a verified smart contract on Polygon in the same transaction as the purchase. 50 / 20 / 10 across three levels, 20 percent to the platform, every payment public on the chain.\n\nWhat I find interesting is not the commission. It is that "pending payout" stops being a concept. If you buy traffic for a living and want to see how same-transaction settlement works in practice, the tour is free: {{LINK:adspend}}' },
|
||||
{ net: 'Facebook', label: 'Facebook · skeptic angle', text: 'Every online program I ever joined asked me to trust a back office. This one does not. Every payout is a public transaction on Polygon you can look up yourself, with the wallet addresses and amounts right there. The split is written in a verified smart contract nobody can quietly edit.\n\nFree to join with just an email. The wallet comes out only if you buy a package or switch on payouts. Packages run $5 to $500, and every one of them is ad delivery you can watch running.\n\nTake the tour: {{LINK:ledger}}' },
|
||||
{ net: 'LinkedIn', label: 'LinkedIn · professional', text: 'An experiment in transparent affiliate payouts: InstantAdPay sells advertising packages ($5 to $500) whose sponsor commissions are settled by a verified smart contract on Polygon in the same transaction as the purchase. 50 / 20 / 10 across three levels, 20 percent to the platform, every payment public on the chain.\n\nWhat I find interesting is not the commission. It is that "pending payout" stops being a concept. If you buy traffic for a living and want to see how same-transaction settlement works in practice, the tour is free: {{LINK:adspend}}' },
|
||||
{ net: 'Telegram', label: 'Telegram or WhatsApp group', text: 'Quick one for the group. Ad platform on Polygon where every package splits to sponsor wallets the second it sells. No withdrawals, no pending. Free to join by email, packages from $5, seven ad formats, and you earn credits for viewing. Tour here: {{LINK:instant}}' },
|
||||
{ net: 'Telegram', label: 'Telegram or WhatsApp group · free angle', text: 'If you want to test an ad network without spending anything: join free, view a handful of ads, earn credits, run your first campaign on the house. Payouts are on the public Polygon ledger. {{LINK:free}}' }
|
||||
];
|
||||
@@ -51,8 +51,8 @@ window.IAPPromo = (function () {
|
||||
{ tier: 'Five Dollar Friday', subject: 'Tomorrow is Five Dollar Friday', body: 'Quick heads-up.\n\nTomorrow is Five Dollar Friday on InstantAdPay. Any ad package from $5 up, bought on Friday (Central time), earns +20% bonus credits the moment it settles.\n\nHere is why it matters: every pack pays its sponsor line in the same transaction, on the Polygon blockchain. When the whole network buys on the same day, every line gets paid at once, and you can watch it happen on the public ledger.\n\nIt is free to join. Line up your pack tonight so you are ready when Friday starts:\n{{LINK}}\n\nAdvertising with a referral program. Not an investment, no income guaranteed.' },
|
||||
{ tier: 'Wired Wednesday', subject: 'Tomorrow is Wired Wednesday', body: 'Quick heads-up.\n\nTomorrow is Wired Wednesday on InstantAdPay. Any ad package from $20 up, bought on Wednesday (Central time), earns +25% bonus credits, wired into your balance the moment the purchase settles. They are purchased-grade, so they run on any format, login ads included. Nothing to set up, nothing to claim.\n\nAnd like every pack, it pays the sponsor line in the same transaction on the Polygon blockchain, public on the ledger.\n\nIf you have been meaning to get a pack, tomorrow is the day: {{WEDNESDAY}}\n\nNo income promises. Advertising, not investing.' },
|
||||
{ tier: 'Short', subject: 'Paid the second it sells', body: 'Quick one.\n\nI joined an ad platform where every package splits to sponsor wallets in the same transaction as the sale. No pending payouts, no withdraw button. It is on the Polygon blockchain, and every payment is public.\n\nJoin free, look at the ledger, decide later: {{LINK:instant}}\n\nNo income promises. Advertising, not investing.' },
|
||||
{ tier: 'Standard', subject: 'Your wallet gets paid instantly', body: 'You know the usual drill. Someone buys on your link, you wait for a payout. Maybe days. Maybe an approval hold. Maybe a "your account is under review."\n\nInstantAdPay does not work like that.\n\nA smart contract on the Polygon blockchain handles every purchase the second it happens. 50% to the sponsor. 20% to the next level. 10% to the one after that. 20% to the platform. Each split lands directly in your own wallet. No withdrawal button. No "request payout." No approval queue.\n\nThe money just shows up.\n\nYou can watch every transaction on the public ledger. Real time. Anyone can verify it.\n\nFree to join. Packages from $5 to $250. No income promises. It is advertising, not investing.\n\n{{LINK}}' },
|
||||
{ tier: 'Long', subject: 'The ad network with no pending payouts', body: 'Let me tell you what you are actually looking at, because "crypto ad platform" can mean anything.\n\nInstantAdPay sells advertising. Five packages, $5 to $250. A package mints ad credits, and one credit is one cent of delivery across seven formats: display banners, text ads, full-screen login ads, solo ads delivered into member inboxes, video ads, featured links, and verified visits. Members earn credits for their attention, with a timer that pauses when they look away, so your ad is seen by a person, not a script.\n\nNow the part that made me join.\n\nWhen anyone in your line buys a package, a verified smart contract on Polygon splits the payment in that same transaction: 50 percent to their direct sponsor, 20 percent to level two, 10 percent to level three, 20 percent to the platform. It lands in real wallets in seconds. There is no balance to withdraw because nothing is ever held.\n\nEvery one of those payments is public. Open the ledger, click a transaction, read it on Polygonscan.\n\nJoining is free and only needs an email. Your wallet comes out when you buy a package or switch on payouts. If you never spend a dollar, you can still view ads, earn credits, and run a small campaign on those.\n\nHave a look: {{LINK:instant}}\n\nOne honest line: nobody is promising you an income. Results depend on your effort, and crypto carries risk of loss.' },
|
||||
{ tier: 'Standard', subject: 'Your wallet gets paid instantly', body: 'You know the usual drill. Someone buys on your link, you wait for a payout. Maybe days. Maybe an approval hold. Maybe a "your account is under review."\n\nInstantAdPay does not work like that.\n\nA smart contract on the Polygon blockchain handles every purchase the second it happens. 50% to the sponsor. 20% to the next level. 10% to the one after that. 20% to the platform. Each split lands directly in your own wallet. No withdrawal button. No "request payout." No approval queue.\n\nThe money just shows up.\n\nYou can watch every transaction on the public ledger. Real time. Anyone can verify it.\n\nFree to join. Packages from $5 to $500. No income promises. It is advertising, not investing.\n\n{{LINK}}' },
|
||||
{ tier: 'Long', subject: 'The ad network with no pending payouts', body: 'Let me tell you what you are actually looking at, because "crypto ad platform" can mean anything.\n\nInstantAdPay sells advertising. Seven packages, $5 to $500. A package mints ad credits, and one credit is one cent of delivery across seven formats: display banners, text ads, full-screen login ads, solo ads delivered into member inboxes, video ads, featured links, and verified visits. Members earn credits for their attention, with a timer that pauses when they look away, so your ad is seen by a person, not a script.\n\nNow the part that made me join.\n\nWhen anyone in your line buys a package, a verified smart contract on Polygon splits the payment in that same transaction: 50 percent to their direct sponsor, 20 percent to level two, 10 percent to level three, 20 percent to the platform. It lands in real wallets in seconds. There is no balance to withdraw because nothing is ever held.\n\nEvery one of those payments is public. Open the ledger, click a transaction, read it on Polygonscan.\n\nJoining is free and only needs an email. Your wallet comes out when you buy a package or switch on payouts. If you never spend a dollar, you can still view ads, earn credits, and run a small campaign on those.\n\nHave a look: {{LINK:instant}}\n\nOne honest line: nobody is promising you an income. Results depend on your effort, and crypto carries risk of loss.' },
|
||||
{ tier: 'Follow-up', subject: 'Did you see the ledger?', body: 'Following up on the ad platform I sent over.\n\nIf you only look at one thing, look at the live ledger. Every purchase and every payout, with real wallet addresses, in the order they happened. That is the whole pitch: nothing to take on faith.\n\n{{LINK:ledger}}\n\nIf it is not for you, no worries at all.' }
|
||||
];
|
||||
|
||||
@@ -61,7 +61,7 @@ window.IAPPromo = (function () {
|
||||
{ q: 'Which crypto do I get paid in?', truth: 'One coin, one network: POL, the native coin of Polygon. Packages are dollar-priced and settled in POL at the live Chainlink rate; every payout is sent as POL to the recipient\'s own Polygon wallet in the same transaction. No tokens, no other chains, no stablecoins.', say: 'You get paid in POL, which is Polygon\'s own coin, straight into your wallet the moment a package in your line sells. Any Polygon wallet works, MetaMask, SafePal, Phantom, and if you have never held crypto you can buy POL with a card inside the member area. {{LINK}}' },
|
||||
{ q: 'Is this a pyramid scheme?', truth: 'You are buying advertising that actually runs: a credit is one cent of delivery across seven live formats, and members earn credits for dwell-timed attention. Sponsor payments are referral commissions written as constants in a verified contract, paid only when a real package sells. Nobody has to recruit to use the ads, and joining costs nothing.', say: 'Fair question. Here is the test I use: is there a real product that people would buy with no referral involved? Here the product is ad delivery, seven formats, one cent per credit, and you can watch your campaign serving. The sponsor split is a referral commission on those sales, fixed in a public contract. Join free and run the ads with zero referrals if you like. {{LINK:free}}' },
|
||||
{ q: 'I do not have a crypto wallet. I am not technical.', truth: 'Joining needs only an email and a 6-digit code. The wallet comes out only when someone buys a package or switches on payouts, and the site walks them through it. A card on-ramp (MoonPay) delivers POL straight to their own wallet. Email first, wallet second.', say: 'You do not need one to join. It is email only, no password even. The wallet shows up later, only if you decide to buy a package or want payouts, and the site walks you through it step by step. Start here and look around first: {{LINK}}' },
|
||||
{ q: 'What am I actually buying?', truth: 'Ad credits minted on-chain the moment a package is bought: $5 = 500, $20 = 2,000, $50 = 5,500, $100 = 12,000, $250 = 32,500. Credits spend on banners, text ads, login ads, solo ads to member inboxes, video ads, featured links and verified visits, with live stats per campaign. Only the buyer\'s campaigns can spend them.', say: 'Advertising. A package mints credits, one credit is one cent of delivery, and you spend them on seven ad formats from your own dashboard with live stats. The $5 package is 500 credits, the $250 package is 32,500. You can see the formats before you spend anything: {{LINK:adspend}}' },
|
||||
{ q: 'What am I actually buying?', truth: 'Ad credits minted on-chain the moment a package is bought: $5 = 500, $10 = 1,000, $20 = 2,000, $50 = 5,500, $100 = 12,000, $250 = 32,500, $500 = 70,000. Credits spend on banners, text ads, login ads, solo ads to member inboxes, video ads, featured links and verified visits, with live stats per campaign. Only the buyer\'s campaigns can spend them.', say: 'Advertising. A package mints credits, one credit is one cent of delivery, and you spend them on seven ad formats from your own dashboard with live stats. The $5 package is 500 credits, the $500 package is 70,000. You can see the formats before you spend anything: {{LINK:adspend}}' },
|
||||
{ q: 'Who holds my money?', truth: 'Nobody. A purchase is one Polygon transaction that splits to the sponsor line and the platform wallets immediately. The site never holds balances, and the contract source is verified on Polygonscan and Sourcify. Overpayment refunds itself in the same transaction.', say: 'That is the part I like most: nobody holds it. The purchase is a single blockchain transaction that pays the sponsor line and the platform in the same moment. There is no balance sitting anywhere waiting for a withdrawal. The contract code is public and verified, and every payment is on the ledger: {{LINK:ledger}}' },
|
||||
{ q: 'What if POL drops?', truth: 'Packages are priced in dollars and settled in POL at the live Chainlink rate at the moment of purchase. Payouts arrive as POL in the recipient\'s own wallet immediately, so what they do with it is their call. This is advertising, not an investment, and POL is volatile like any crypto asset.', say: 'Packages are dollar priced, so $20 is $20 worth of POL at that moment. Payouts land in your wallet right away, and it is your money from that second. Crypto does move, so treat it as advertising you bought, not an investment. {{LINK}}' },
|
||||
{ q: 'Why would anyone buy ads here?', truth: 'The members are marketers who already buy traffic. Viewers earn credits only after a server-timed dwell, so impressions are real people. Solo ads reach member inboxes with a guaranteed delivery count, verified visits are one unique member per visit, and banner and text ads also syndicate to a partner ad network.', say: 'Because the people on it are marketers, and they get paid to actually look. Every view is dwell-timed on the server, solo ads land in real inboxes with a guaranteed count, and verified visits are one real person each. You can watch your own campaign serve: {{LINK:adspend}}' },
|
||||
|
||||
@@ -200,254 +200,254 @@ dieser Käufer an den nächsten Sponsor über
|
||||
dir, für immer.
|
||||
|
||||
43
|
||||
00:02:38.550 --> 00:02:41.586
|
||||
Die Pakete reichen von $5 bis $250.
|
||||
00:02:38.550 --> 00:02:41.517
|
||||
Die Pakete reichen von $5 bis $500.
|
||||
|
||||
44
|
||||
00:02:41.940 --> 00:02:46.219
|
||||
00:02:41.963 --> 00:02:46.823
|
||||
Ab $20 wird jemand zum qualifizierenden
|
||||
Käufer, und das ist wichtig für das,
|
||||
|
||||
45
|
||||
00:02:46.259 --> 00:02:48.134
|
||||
00:02:46.863 --> 00:02:48.877
|
||||
was jetzt kommt.
|
||||
|
||||
46
|
||||
00:02:49.380 --> 00:02:51.662
|
||||
00:02:50.130 --> 00:02:52.412
|
||||
Das ist das Herz der Strategie.
|
||||
|
||||
47
|
||||
00:02:51.853 --> 00:02:54.274
|
||||
00:02:52.603 --> 00:02:55.024
|
||||
Ebene 1 ist ab dem ersten Tag offen.
|
||||
|
||||
48
|
||||
00:02:54.407 --> 00:02:57.467
|
||||
00:02:55.157 --> 00:02:58.217
|
||||
Ebene 2 öffnet sich, wenn zwei deiner
|
||||
direkt Geworbenen jeweils für $20
|
||||
|
||||
49
|
||||
00:02:57.507 --> 00:02:59.359
|
||||
00:02:58.257 --> 00:03:00.109
|
||||
oder mehr gekauft haben.
|
||||
|
||||
50
|
||||
00:02:59.492 --> 00:03:01.484
|
||||
00:03:00.242 --> 00:03:02.234
|
||||
Ebene 3 öffnet sich bei fünf.
|
||||
|
||||
51
|
||||
00:03:01.617 --> 00:03:03.725
|
||||
00:03:02.367 --> 00:03:04.475
|
||||
Breite ersetzt also nicht die Tiefe.
|
||||
|
||||
52
|
||||
00:03:03.765 --> 00:03:06.627
|
||||
00:03:04.515 --> 00:03:07.377
|
||||
Breite ist das, was die Tiefe
|
||||
freischaltet.
|
||||
|
||||
53
|
||||
00:03:14.480 --> 00:03:17.644
|
||||
00:03:15.230 --> 00:03:18.394
|
||||
Das passiert, wenn du in die Tiefe baust,
|
||||
ohne in die Breite zu bauen.
|
||||
|
||||
54
|
||||
00:03:17.835 --> 00:03:21.023
|
||||
00:03:18.585 --> 00:03:21.773
|
||||
Angenommen, du hast zwei Käufer und ein
|
||||
tiefes Team darunter.
|
||||
|
||||
55
|
||||
00:03:21.063 --> 00:03:24.668
|
||||
00:03:21.813 --> 00:03:25.418
|
||||
Wenn jemand in deiner Ebene 3 kauft,
|
||||
wartet dieser Anteil nicht auf dich.
|
||||
|
||||
56
|
||||
00:03:24.859 --> 00:03:28.523
|
||||
00:03:25.609 --> 00:03:29.273
|
||||
Er geht an die nächste Person über dir,
|
||||
die fünf Käufer hat.
|
||||
|
||||
57
|
||||
00:03:29.770 --> 00:03:34.316
|
||||
00:03:30.520 --> 00:03:35.066
|
||||
Stell dir zwei Leader vor, und jeder macht
|
||||
einen Kauf für $20.
|
||||
|
||||
58
|
||||
00:03:34.391 --> 00:03:38.774
|
||||
00:03:35.141 --> 00:03:39.524
|
||||
Leader A sponsert zehn, jeder davon
|
||||
sponsert fünf, und jeder
|
||||
|
||||
59
|
||||
00:03:38.814 --> 00:03:40.411
|
||||
00:03:39.564 --> 00:03:41.161
|
||||
von denen sponsert fünf.
|
||||
|
||||
60
|
||||
00:03:40.672 --> 00:03:43.616
|
||||
00:03:41.422 --> 00:03:44.366
|
||||
Das sind $800 aus einem einzigen Kauf pro
|
||||
Person.
|
||||
|
||||
61
|
||||
00:03:43.807 --> 00:03:47.307
|
||||
00:03:44.557 --> 00:03:48.057
|
||||
Leader B sponsert zwei, und jeder davon
|
||||
sponsert zwei.
|
||||
|
||||
62
|
||||
00:03:47.870 --> 00:03:51.116
|
||||
00:03:48.620 --> 00:03:51.866
|
||||
$36, und B's Ebene 3 wird nach oben
|
||||
weitergegeben.
|
||||
|
||||
63
|
||||
00:03:51.307 --> 00:03:54.413
|
||||
00:03:52.057 --> 00:03:55.163
|
||||
Das ist ein Beispiel, kein
|
||||
Einkommensversprechen.
|
||||
|
||||
64
|
||||
00:03:54.604 --> 00:03:58.163
|
||||
00:03:55.354 --> 00:03:58.913
|
||||
Ob jemand kauft, ist seine eigene
|
||||
Entscheidung.
|
||||
|
||||
65
|
||||
00:03:59.410 --> 00:04:01.460
|
||||
00:04:00.160 --> 00:04:02.210
|
||||
Du willst nicht auf deine ersten
|
||||
Geworbenen warten?
|
||||
|
||||
66
|
||||
00:04:01.488 --> 00:04:05.651
|
||||
00:04:02.238 --> 00:04:06.401
|
||||
Qualified Start lässt dich bis zu fünf
|
||||
eigene Wallets als Positionen verknüpfen.
|
||||
|
||||
67
|
||||
00:04:05.784 --> 00:04:10.074
|
||||
00:04:06.534 --> 00:04:10.824
|
||||
Jeder $20-Kauf einer Position zählt als
|
||||
qualifizierender Käufer, und die Hälfte
|
||||
|
||||
68
|
||||
00:04:10.114 --> 00:04:12.187
|
||||
00:04:10.864 --> 00:04:12.937
|
||||
geht direkt zurück an deine Haupt-Wallet.
|
||||
|
||||
69
|
||||
00:04:12.320 --> 00:04:16.332
|
||||
00:04:13.070 --> 00:04:17.082
|
||||
Fünf Positionen: Du gibst $100 aus, $50
|
||||
kommen zurück, du hast 10.000
|
||||
|
||||
70
|
||||
00:04:16.372 --> 00:04:20.186
|
||||
00:04:17.122 --> 00:04:20.936
|
||||
Werbe-Credits, und die Ebenen 2 und 3 sind
|
||||
offen.
|
||||
|
||||
71
|
||||
00:04:21.440 --> 00:04:23.536
|
||||
00:04:22.190 --> 00:04:24.286
|
||||
Du hast echte Werkzeuge zum Aufbauen.
|
||||
|
||||
72
|
||||
00:04:24.238 --> 00:04:28.900
|
||||
00:04:24.988 --> 00:04:29.650
|
||||
Die Pipeline ist dein Follow-up-Board:
|
||||
alle, mit denen du arbeitest, in Spalten,
|
||||
die sich von selbst
|
||||
|
||||
73
|
||||
00:04:28.940 --> 00:04:33.161
|
||||
00:04:29.690 --> 00:04:33.911
|
||||
bewegen, wenn Leute den nächsten Schritt
|
||||
machen, damit du immer weißt, mit wem du
|
||||
|
||||
74
|
||||
00:04:33.201 --> 00:04:34.451
|
||||
00:04:33.951 --> 00:04:35.201
|
||||
als Nächstes sprichst.
|
||||
|
||||
75
|
||||
00:04:34.698 --> 00:04:38.211
|
||||
00:04:35.448 --> 00:04:38.961
|
||||
Dazu bekommst du Coaching für dein Team,
|
||||
und Promo-Tools mit
|
||||
|
||||
76
|
||||
00:04:38.251 --> 00:04:39.662
|
||||
00:04:39.001 --> 00:04:40.412
|
||||
deinem Link schon eingetragen.
|
||||
|
||||
77
|
||||
00:04:41.910 --> 00:04:44.540
|
||||
00:04:42.660 --> 00:04:45.290
|
||||
Es gibt eine zweite Einkommensquelle auf
|
||||
derselben Wallet.
|
||||
|
||||
78
|
||||
00:04:44.673 --> 00:04:50.543
|
||||
00:04:45.423 --> 00:04:51.293
|
||||
LinkSpin gibt deinem Team Werkzeuge, um
|
||||
alles zu bewerben: rotierende Links,
|
||||
echtes Tracking,
|
||||
|
||||
79
|
||||
00:04:50.583 --> 00:04:52.203
|
||||
00:04:51.333 --> 00:04:52.953
|
||||
Seiten und Werbezonen.
|
||||
|
||||
80
|
||||
00:04:52.336 --> 00:04:57.555
|
||||
00:04:53.086 --> 00:04:58.305
|
||||
Es zahlt dieselben 50, 20, 10, mit
|
||||
denselben Freischaltungen.
|
||||
|
||||
81
|
||||
00:04:57.583 --> 00:04:59.668
|
||||
00:04:58.333 --> 00:05:00.418
|
||||
Der Pre-Launch öffnet am 1. November.
|
||||
|
||||
82
|
||||
00:05:00.920 --> 00:05:02.668
|
||||
00:05:01.670 --> 00:05:03.418
|
||||
Deine Wallet ist dein Schlüssel.
|
||||
|
||||
83
|
||||
00:05:03.114 --> 00:05:07.184
|
||||
00:05:03.864 --> 00:05:07.934
|
||||
Jede Plattform im Netzwerk erkennt dich
|
||||
daran, und dein Team folgt dir.
|
||||
|
||||
84
|
||||
00:05:07.445 --> 00:05:10.714
|
||||
00:05:08.195 --> 00:05:11.464
|
||||
Wenn eine neue Plattform startet, sind
|
||||
deine Leute schon unter dir platziert.
|
||||
|
||||
85
|
||||
00:05:10.754 --> 00:05:16.913
|
||||
00:05:11.504 --> 00:05:17.663
|
||||
Ein Sponsor wird nie übergangen, weil er
|
||||
ruhig ist, und ein Kauf wird nie
|
||||
aufgehalten.
|
||||
|
||||
86
|
||||
00:05:18.160 --> 00:05:20.639
|
||||
00:05:18.910 --> 00:05:21.389
|
||||
Deine erste Woche: Schalte die
|
||||
Auszahlungen ein.
|
||||
|
||||
87
|
||||
00:05:20.830 --> 00:05:22.265
|
||||
00:05:21.580 --> 00:05:23.015
|
||||
Finde deine ersten zwei Käufer.
|
||||
|
||||
88
|
||||
00:05:22.305 --> 00:05:23.147
|
||||
00:05:23.055 --> 00:05:23.897
|
||||
Komm auf fünf.
|
||||
|
||||
89
|
||||
00:05:23.187 --> 00:05:24.494
|
||||
00:05:23.937 --> 00:05:25.244
|
||||
Bau weiter in die Breite.
|
||||
|
||||
90
|
||||
00:05:24.627 --> 00:05:28.162
|
||||
00:05:25.377 --> 00:05:28.912
|
||||
Und bring jeder Person, die du dazuholst,
|
||||
denselben Plan bei.
|
||||
|
||||
91
|
||||
00:05:36.010 --> 00:05:37.386
|
||||
00:05:36.760 --> 00:05:38.136
|
||||
Das Ziel ist fünf.
|
||||
|
||||
92
|
||||
00:05:37.647 --> 00:05:42.297
|
||||
00:05:38.397 --> 00:05:43.047
|
||||
Fünf starke Käufer schalten jede Ebene,
|
||||
jeden Meilenstein und jedes Werkzeug frei.
|
||||
|
||||
93
|
||||
00:05:42.651 --> 00:05:43.901
|
||||
00:05:43.401 --> 00:05:44.651
|
||||
Bereit zu starten?
|
||||
|
||||
94
|
||||
00:05:44.857 --> 00:05:47.394
|
||||
00:05:45.607 --> 00:05:48.144
|
||||
Melde dich bei der Person, die dir das
|
||||
geteilt hat.
|
||||
|
||||
95
|
||||
00:05:47.434 --> 00:05:50.865
|
||||
00:05:48.184 --> 00:05:51.615
|
||||
Sie hilft dir, in wenigen Minuten
|
||||
startklar zu sein, und sie wird dein
|
||||
Sponsor
|
||||
|
||||
96
|
||||
00:05:50.905 --> 00:05:52.792
|
||||
00:05:51.655 --> 00:05:53.542
|
||||
auf jeder Plattform im Netzwerk.
|
||||
|
||||
@@ -190,249 +190,249 @@ buyer move to the next sponsor above you,
|
||||
for good.
|
||||
|
||||
43
|
||||
00:02:38.550 --> 00:02:41.586
|
||||
Packages run from five dollars to two
|
||||
hundred fifty.
|
||||
00:02:38.550 --> 00:02:41.517
|
||||
Packages run from five dollars to five
|
||||
hundred.
|
||||
|
||||
44
|
||||
00:02:41.940 --> 00:02:46.219
|
||||
00:02:41.963 --> 00:02:46.823
|
||||
Twenty dollars or more makes someone a
|
||||
qualifying buyer, and that matters for
|
||||
|
||||
45
|
||||
00:02:46.259 --> 00:02:48.134
|
||||
00:02:46.863 --> 00:02:48.877
|
||||
what comes next.
|
||||
|
||||
46
|
||||
00:02:49.380 --> 00:02:51.662
|
||||
00:02:50.130 --> 00:02:52.412
|
||||
This is the heart of the strategy.
|
||||
|
||||
47
|
||||
00:02:51.853 --> 00:02:54.274
|
||||
00:02:52.603 --> 00:02:55.024
|
||||
Level one is open from day one.
|
||||
|
||||
48
|
||||
00:02:54.407 --> 00:02:57.467
|
||||
00:02:55.157 --> 00:02:58.217
|
||||
Level two opens when two of your personal
|
||||
referrals have each bought
|
||||
|
||||
49
|
||||
00:02:57.507 --> 00:02:59.359
|
||||
00:02:58.257 --> 00:03:00.109
|
||||
twenty dollars or more.
|
||||
|
||||
50
|
||||
00:02:59.492 --> 00:03:01.484
|
||||
00:03:00.242 --> 00:03:02.234
|
||||
Level three opens at five.
|
||||
|
||||
51
|
||||
00:03:01.617 --> 00:03:03.725
|
||||
00:03:02.367 --> 00:03:04.475
|
||||
So width isn't instead of depth.
|
||||
|
||||
52
|
||||
00:03:03.765 --> 00:03:06.627
|
||||
00:03:04.515 --> 00:03:07.377
|
||||
Width is what unlocks depth.
|
||||
|
||||
53
|
||||
00:03:14.480 --> 00:03:17.644
|
||||
00:03:15.230 --> 00:03:18.394
|
||||
Here's what happens if you build deep
|
||||
without building wide.
|
||||
|
||||
54
|
||||
00:03:17.835 --> 00:03:21.023
|
||||
00:03:18.585 --> 00:03:21.773
|
||||
Say you have two buyers and a deep team
|
||||
below them.
|
||||
|
||||
55
|
||||
00:03:21.063 --> 00:03:24.668
|
||||
00:03:21.813 --> 00:03:25.418
|
||||
When someone in your level three buys,
|
||||
that share doesn't wait for you.
|
||||
|
||||
56
|
||||
00:03:24.859 --> 00:03:28.523
|
||||
00:03:25.609 --> 00:03:29.273
|
||||
It passes to the next person above you who
|
||||
has five buyers.
|
||||
|
||||
57
|
||||
00:03:29.770 --> 00:03:34.316
|
||||
00:03:30.520 --> 00:03:35.066
|
||||
Picture two leaders, and everyone makes
|
||||
one twenty-dollar purchase.
|
||||
|
||||
58
|
||||
00:03:34.391 --> 00:03:38.774
|
||||
00:03:35.141 --> 00:03:39.524
|
||||
Leader A sponsors ten, each of them
|
||||
sponsors five, and each
|
||||
|
||||
59
|
||||
00:03:38.814 --> 00:03:40.411
|
||||
00:03:39.564 --> 00:03:41.161
|
||||
of those sponsors five.
|
||||
|
||||
60
|
||||
00:03:40.672 --> 00:03:43.616
|
||||
00:03:41.422 --> 00:03:44.366
|
||||
That's eight hundred dollars from one
|
||||
purchase each.
|
||||
|
||||
61
|
||||
00:03:43.807 --> 00:03:47.307
|
||||
00:03:44.557 --> 00:03:48.057
|
||||
Leader B sponsors two, and each of them
|
||||
sponsors two.
|
||||
|
||||
62
|
||||
00:03:47.870 --> 00:03:51.116
|
||||
00:03:48.620 --> 00:03:51.866
|
||||
Thirty-six dollars, and B's level three
|
||||
passes up.
|
||||
|
||||
63
|
||||
00:03:51.307 --> 00:03:54.413
|
||||
00:03:52.057 --> 00:03:55.163
|
||||
This is an illustration, not a promise of
|
||||
income.
|
||||
|
||||
64
|
||||
00:03:54.604 --> 00:03:58.163
|
||||
00:03:55.354 --> 00:03:58.913
|
||||
Whether anyone buys is their own choice.
|
||||
|
||||
65
|
||||
00:03:59.410 --> 00:04:01.460
|
||||
00:04:00.160 --> 00:04:02.210
|
||||
Don't want to wait for your first
|
||||
referrals?
|
||||
|
||||
66
|
||||
00:04:01.488 --> 00:04:05.651
|
||||
00:04:02.238 --> 00:04:06.401
|
||||
Qualified Start lets you link up to five
|
||||
wallets of your own as positions.
|
||||
|
||||
67
|
||||
00:04:05.784 --> 00:04:10.074
|
||||
00:04:06.534 --> 00:04:10.824
|
||||
Each twenty-dollar position purchase
|
||||
counts as a qualifying buyer, and half of
|
||||
|
||||
68
|
||||
00:04:10.114 --> 00:04:12.187
|
||||
00:04:10.864 --> 00:04:12.937
|
||||
it comes straight back to your main
|
||||
wallet.
|
||||
|
||||
69
|
||||
00:04:12.320 --> 00:04:16.332
|
||||
00:04:13.070 --> 00:04:17.082
|
||||
Five positions: you spend a hundred
|
||||
dollars, fifty comes back, you hold ten
|
||||
|
||||
70
|
||||
00:04:16.372 --> 00:04:20.186
|
||||
00:04:17.122 --> 00:04:20.936
|
||||
thousand ad credits, and levels two and
|
||||
three are open.
|
||||
|
||||
71
|
||||
00:04:21.440 --> 00:04:23.536
|
||||
00:04:22.190 --> 00:04:24.286
|
||||
You'll have real tools to build with.
|
||||
|
||||
72
|
||||
00:04:24.238 --> 00:04:28.900
|
||||
00:04:24.988 --> 00:04:29.650
|
||||
The Pipeline is your follow-up board:
|
||||
everyone you're working with, in columns
|
||||
|
||||
73
|
||||
00:04:28.940 --> 00:04:33.161
|
||||
00:04:29.690 --> 00:04:33.911
|
||||
that move on their own as people take each
|
||||
step, so you always know who
|
||||
|
||||
74
|
||||
00:04:33.201 --> 00:04:34.451
|
||||
00:04:33.951 --> 00:04:35.201
|
||||
to talk to next.
|
||||
|
||||
75
|
||||
00:04:34.698 --> 00:04:38.211
|
||||
00:04:35.448 --> 00:04:38.961
|
||||
You also get coaching for your team, and
|
||||
promo tools with your
|
||||
|
||||
76
|
||||
00:04:38.251 --> 00:04:39.662
|
||||
00:04:39.001 --> 00:04:40.412
|
||||
link already filled in.
|
||||
|
||||
77
|
||||
00:04:41.910 --> 00:04:44.540
|
||||
00:04:42.660 --> 00:04:45.290
|
||||
There's a second income stream on the same
|
||||
wallet.
|
||||
|
||||
78
|
||||
00:04:44.673 --> 00:04:50.543
|
||||
00:04:45.423 --> 00:04:51.293
|
||||
LinkSpin gives your team tools to promote
|
||||
anything: rotating links, real tracking,
|
||||
|
||||
79
|
||||
00:04:50.583 --> 00:04:52.203
|
||||
00:04:51.333 --> 00:04:52.953
|
||||
pages and ad zones.
|
||||
|
||||
80
|
||||
00:04:52.336 --> 00:04:57.555
|
||||
00:04:53.086 --> 00:04:58.305
|
||||
It pays the same fifty, twenty, ten, with
|
||||
the same unlocks.
|
||||
|
||||
81
|
||||
00:04:57.583 --> 00:04:59.668
|
||||
00:04:58.333 --> 00:05:00.418
|
||||
Pre-launch opens November first.
|
||||
|
||||
82
|
||||
00:05:00.920 --> 00:05:02.668
|
||||
00:05:01.670 --> 00:05:03.418
|
||||
Your wallet is your key.
|
||||
|
||||
83
|
||||
00:05:03.114 --> 00:05:07.184
|
||||
00:05:03.864 --> 00:05:07.934
|
||||
Every platform in the network knows you by
|
||||
it, and your team follows you.
|
||||
|
||||
84
|
||||
00:05:07.445 --> 00:05:10.714
|
||||
00:05:08.195 --> 00:05:11.464
|
||||
When a new platform launches, your people
|
||||
are already placed under you.
|
||||
|
||||
85
|
||||
00:05:10.754 --> 00:05:16.913
|
||||
00:05:11.504 --> 00:05:17.663
|
||||
A sponsor is never passed over for being
|
||||
quiet, and a purchase is never held up.
|
||||
|
||||
86
|
||||
00:05:18.160 --> 00:05:20.639
|
||||
00:05:18.910 --> 00:05:21.389
|
||||
Your first week: switch on payouts.
|
||||
|
||||
87
|
||||
00:05:20.830 --> 00:05:22.265
|
||||
00:05:21.580 --> 00:05:23.015
|
||||
Find your first two buyers.
|
||||
|
||||
88
|
||||
00:05:22.305 --> 00:05:23.147
|
||||
00:05:23.055 --> 00:05:23.897
|
||||
Get to five.
|
||||
|
||||
89
|
||||
00:05:23.187 --> 00:05:24.494
|
||||
00:05:23.937 --> 00:05:25.244
|
||||
Keep going wide.
|
||||
|
||||
90
|
||||
00:05:24.627 --> 00:05:28.162
|
||||
00:05:25.377 --> 00:05:28.912
|
||||
And teach the same plan to every person
|
||||
you bring in.
|
||||
|
||||
91
|
||||
00:05:36.010 --> 00:05:37.386
|
||||
00:05:36.760 --> 00:05:38.136
|
||||
The target is five.
|
||||
|
||||
92
|
||||
00:05:37.647 --> 00:05:42.297
|
||||
00:05:38.397 --> 00:05:43.047
|
||||
Five strong buyers unlock every level,
|
||||
every milestone and every tool.
|
||||
|
||||
93
|
||||
00:05:42.651 --> 00:05:43.901
|
||||
00:05:43.401 --> 00:05:44.651
|
||||
Ready to start?
|
||||
|
||||
94
|
||||
00:05:44.857 --> 00:05:47.394
|
||||
00:05:45.607 --> 00:05:48.144
|
||||
Reach out to the person who shared this
|
||||
with you.
|
||||
|
||||
95
|
||||
00:05:47.434 --> 00:05:50.865
|
||||
00:05:48.184 --> 00:05:51.615
|
||||
They'll help you get set up in a few
|
||||
minutes, and they'll be your sponsor on
|
||||
|
||||
96
|
||||
00:05:50.905 --> 00:05:52.792
|
||||
00:05:51.655 --> 00:05:53.542
|
||||
every platform in the network.
|
||||
|
||||
@@ -196,252 +196,252 @@ comprador pasan al siguiente patrocinador
|
||||
por encima de ti, para siempre.
|
||||
|
||||
43
|
||||
00:02:38.550 --> 00:02:41.586
|
||||
Los paquetes van de $5 a $250.
|
||||
00:02:38.550 --> 00:02:41.517
|
||||
Los paquetes van de $5 a $500.
|
||||
|
||||
44
|
||||
00:02:41.940 --> 00:02:46.219
|
||||
00:02:41.963 --> 00:02:46.823
|
||||
Con $20 o más alguien se convierte en
|
||||
comprador calificado, y eso importa para
|
||||
|
||||
45
|
||||
00:02:46.259 --> 00:02:48.134
|
||||
00:02:46.863 --> 00:02:48.877
|
||||
lo que viene.
|
||||
|
||||
46
|
||||
00:02:49.380 --> 00:02:51.662
|
||||
00:02:50.130 --> 00:02:52.412
|
||||
Este es el corazón de la estrategia.
|
||||
|
||||
47
|
||||
00:02:51.853 --> 00:02:54.274
|
||||
00:02:52.603 --> 00:02:55.024
|
||||
El nivel 1 está abierto desde el primer
|
||||
día.
|
||||
|
||||
48
|
||||
00:02:54.407 --> 00:02:57.467
|
||||
00:02:55.157 --> 00:02:58.217
|
||||
El nivel 2 se abre cuando dos de tus
|
||||
referidos directos han comprado
|
||||
|
||||
49
|
||||
00:02:57.507 --> 00:02:59.359
|
||||
00:02:58.257 --> 00:03:00.109
|
||||
cada uno $20 o más.
|
||||
|
||||
50
|
||||
00:02:59.492 --> 00:03:01.484
|
||||
00:03:00.242 --> 00:03:02.234
|
||||
El nivel 3 se abre con cinco.
|
||||
|
||||
51
|
||||
00:03:01.617 --> 00:03:03.725
|
||||
00:03:02.367 --> 00:03:04.475
|
||||
Así que el ancho no reemplaza a la
|
||||
profundidad.
|
||||
|
||||
52
|
||||
00:03:03.765 --> 00:03:06.627
|
||||
00:03:04.515 --> 00:03:07.377
|
||||
El ancho es lo que desbloquea la
|
||||
profundidad.
|
||||
|
||||
53
|
||||
00:03:14.480 --> 00:03:17.644
|
||||
00:03:15.230 --> 00:03:18.394
|
||||
Esto es lo que pasa si construyes en
|
||||
profundidad sin construir a lo ancho.
|
||||
|
||||
54
|
||||
00:03:17.835 --> 00:03:21.023
|
||||
00:03:18.585 --> 00:03:21.773
|
||||
Digamos que tienes dos compradores y un
|
||||
equipo profundo debajo de ellos.
|
||||
|
||||
55
|
||||
00:03:21.063 --> 00:03:24.668
|
||||
00:03:21.813 --> 00:03:25.418
|
||||
Cuando alguien de tu nivel 3 compra, esa
|
||||
parte no te espera.
|
||||
|
||||
56
|
||||
00:03:24.859 --> 00:03:28.523
|
||||
00:03:25.609 --> 00:03:29.273
|
||||
Pasa a la siguiente persona por encima de
|
||||
ti que tiene cinco compradores.
|
||||
|
||||
57
|
||||
00:03:29.770 --> 00:03:34.316
|
||||
00:03:30.520 --> 00:03:35.066
|
||||
Imagina dos líderes, y cada persona hace
|
||||
una compra de $20.
|
||||
|
||||
58
|
||||
00:03:34.391 --> 00:03:38.774
|
||||
00:03:35.141 --> 00:03:39.524
|
||||
El líder A patrocina a diez, cada uno
|
||||
patrocina a cinco, y cada uno
|
||||
|
||||
59
|
||||
00:03:38.814 --> 00:03:40.411
|
||||
00:03:39.564 --> 00:03:41.161
|
||||
de esos patrocina a cinco.
|
||||
|
||||
60
|
||||
00:03:40.672 --> 00:03:43.616
|
||||
00:03:41.422 --> 00:03:44.366
|
||||
Son $800 de una sola compra por persona.
|
||||
|
||||
61
|
||||
00:03:43.807 --> 00:03:47.307
|
||||
00:03:44.557 --> 00:03:48.057
|
||||
El líder B patrocina a dos, y cada uno
|
||||
patrocina a dos.
|
||||
|
||||
62
|
||||
00:03:47.870 --> 00:03:51.116
|
||||
00:03:48.620 --> 00:03:51.866
|
||||
$36, y el nivel 3 de B pasa hacia arriba.
|
||||
|
||||
63
|
||||
00:03:51.307 --> 00:03:54.413
|
||||
00:03:52.057 --> 00:03:55.163
|
||||
Esto es una ilustración, no una promesa de
|
||||
ingresos.
|
||||
|
||||
64
|
||||
00:03:54.604 --> 00:03:58.163
|
||||
00:03:55.354 --> 00:03:58.913
|
||||
Comprar o no es decisión de cada persona.
|
||||
|
||||
65
|
||||
00:03:59.410 --> 00:04:01.460
|
||||
00:04:00.160 --> 00:04:02.210
|
||||
¿No quieres esperar a tus primeros
|
||||
referidos?
|
||||
|
||||
66
|
||||
00:04:01.488 --> 00:04:05.651
|
||||
00:04:02.238 --> 00:04:06.401
|
||||
Qualified Start te permite vincular hasta
|
||||
cinco wallets propios como posiciones.
|
||||
|
||||
67
|
||||
00:04:05.784 --> 00:04:10.074
|
||||
00:04:06.534 --> 00:04:10.824
|
||||
Cada compra de $20 de una posición cuenta
|
||||
como comprador calificado, y la
|
||||
|
||||
68
|
||||
00:04:10.114 --> 00:04:12.187
|
||||
00:04:10.864 --> 00:04:12.937
|
||||
mitad vuelve directo a tu wallet
|
||||
principal.
|
||||
|
||||
69
|
||||
00:04:12.320 --> 00:04:16.332
|
||||
00:04:13.070 --> 00:04:17.082
|
||||
Cinco posiciones: gastas $100, te vuelven
|
||||
$50, tienes 10.000 créditos publicitarios,
|
||||
|
||||
70
|
||||
00:04:16.372 --> 00:04:20.186
|
||||
00:04:17.122 --> 00:04:20.936
|
||||
y los niveles 2 y 3 quedan abiertos.
|
||||
|
||||
71
|
||||
00:04:21.440 --> 00:04:23.536
|
||||
00:04:22.190 --> 00:04:24.286
|
||||
Tendrás herramientas reales para
|
||||
construir.
|
||||
|
||||
72
|
||||
00:04:24.238 --> 00:04:28.900
|
||||
00:04:24.988 --> 00:04:29.650
|
||||
El Pipeline es tu tablero de seguimiento:
|
||||
todas las personas con las que trabajas,
|
||||
en columnas que
|
||||
|
||||
73
|
||||
00:04:28.940 --> 00:04:33.161
|
||||
00:04:29.690 --> 00:04:33.911
|
||||
avanzan solas a medida que cada uno da su
|
||||
paso, para que siempre sepas con
|
||||
|
||||
74
|
||||
00:04:33.201 --> 00:04:34.451
|
||||
00:04:33.951 --> 00:04:35.201
|
||||
quién hablar después.
|
||||
|
||||
75
|
||||
00:04:34.698 --> 00:04:38.211
|
||||
00:04:35.448 --> 00:04:38.961
|
||||
También tienes coaching para tu equipo, y
|
||||
herramientas promocionales con
|
||||
|
||||
76
|
||||
00:04:38.251 --> 00:04:39.662
|
||||
00:04:39.001 --> 00:04:40.412
|
||||
tu enlace ya incluido.
|
||||
|
||||
77
|
||||
00:04:41.910 --> 00:04:44.540
|
||||
00:04:42.660 --> 00:04:45.290
|
||||
Hay una segunda fuente de ingresos en el
|
||||
mismo wallet.
|
||||
|
||||
78
|
||||
00:04:44.673 --> 00:04:50.543
|
||||
00:04:45.423 --> 00:04:51.293
|
||||
LinkSpin le da a tu equipo herramientas
|
||||
para promocionar cualquier cosa: enlaces
|
||||
rotativos, seguimiento real, páginas
|
||||
|
||||
79
|
||||
00:04:50.583 --> 00:04:52.203
|
||||
00:04:51.333 --> 00:04:52.953
|
||||
y zonas de anuncios.
|
||||
|
||||
80
|
||||
00:04:52.336 --> 00:04:57.555
|
||||
00:04:53.086 --> 00:04:58.305
|
||||
Paga el mismo 50, 20, 10, con los mismos
|
||||
desbloqueos.
|
||||
|
||||
81
|
||||
00:04:57.583 --> 00:04:59.668
|
||||
00:04:58.333 --> 00:05:00.418
|
||||
El prelanzamiento abre el 1 de noviembre.
|
||||
|
||||
82
|
||||
00:05:00.920 --> 00:05:02.668
|
||||
00:05:01.670 --> 00:05:03.418
|
||||
Tu wallet es tu llave.
|
||||
|
||||
83
|
||||
00:05:03.114 --> 00:05:07.184
|
||||
00:05:03.864 --> 00:05:07.934
|
||||
Cada plataforma de la red te reconoce por
|
||||
él, y tu equipo te sigue.
|
||||
|
||||
84
|
||||
00:05:07.445 --> 00:05:10.714
|
||||
00:05:08.195 --> 00:05:11.464
|
||||
Cuando se lanza una nueva plataforma, tu
|
||||
gente ya está colocada debajo de ti.
|
||||
|
||||
85
|
||||
00:05:10.754 --> 00:05:16.913
|
||||
00:05:11.504 --> 00:05:17.663
|
||||
A un patrocinador nunca se le salta por
|
||||
estar callado, y una compra nunca se
|
||||
detiene.
|
||||
|
||||
86
|
||||
00:05:18.160 --> 00:05:20.639
|
||||
00:05:18.910 --> 00:05:21.389
|
||||
Tu primera semana: activa los pagos.
|
||||
|
||||
87
|
||||
00:05:20.830 --> 00:05:22.265
|
||||
00:05:21.580 --> 00:05:23.015
|
||||
Encuentra a tus dos primeros compradores.
|
||||
|
||||
88
|
||||
00:05:22.305 --> 00:05:23.147
|
||||
00:05:23.055 --> 00:05:23.897
|
||||
Llega a cinco.
|
||||
|
||||
89
|
||||
00:05:23.187 --> 00:05:24.494
|
||||
00:05:23.937 --> 00:05:25.244
|
||||
Sigue construyendo a lo ancho.
|
||||
|
||||
90
|
||||
00:05:24.627 --> 00:05:28.162
|
||||
00:05:25.377 --> 00:05:28.912
|
||||
Y enseña el mismo plan a cada persona que
|
||||
traigas.
|
||||
|
||||
91
|
||||
00:05:36.010 --> 00:05:37.386
|
||||
00:05:36.760 --> 00:05:38.136
|
||||
La meta es cinco.
|
||||
|
||||
92
|
||||
00:05:37.647 --> 00:05:42.297
|
||||
00:05:38.397 --> 00:05:43.047
|
||||
Cinco compradores sólidos desbloquean cada
|
||||
nivel, cada hito y cada herramienta.
|
||||
|
||||
93
|
||||
00:05:42.651 --> 00:05:43.901
|
||||
00:05:43.401 --> 00:05:44.651
|
||||
¿Listo para empezar?
|
||||
|
||||
94
|
||||
00:05:44.857 --> 00:05:47.394
|
||||
00:05:45.607 --> 00:05:48.144
|
||||
Contacta a la persona que te compartió
|
||||
este video.
|
||||
|
||||
95
|
||||
00:05:47.434 --> 00:05:50.865
|
||||
00:05:48.184 --> 00:05:51.615
|
||||
Te ayudará a empezar en pocos minutos, y
|
||||
será tu patrocinador en
|
||||
|
||||
96
|
||||
00:05:50.905 --> 00:05:52.792
|
||||
00:05:51.655 --> 00:05:53.542
|
||||
cada plataforma de la red.
|
||||
|
||||
@@ -202,258 +202,258 @@ cet acheteur passent au parrain suivant
|
||||
au-dessus de vous, définitivement.
|
||||
|
||||
43
|
||||
00:02:38.550 --> 00:02:41.586
|
||||
Les packs vont de $5 à $250.
|
||||
00:02:38.550 --> 00:02:41.517
|
||||
Les packs vont de $5 à $500.
|
||||
|
||||
44
|
||||
00:02:41.940 --> 00:02:46.219
|
||||
00:02:41.963 --> 00:02:46.823
|
||||
À partir de $20, on devient acheteur
|
||||
qualifiant, et c'est important pour
|
||||
|
||||
45
|
||||
00:02:46.259 --> 00:02:48.134
|
||||
00:02:46.863 --> 00:02:48.877
|
||||
la suite.
|
||||
|
||||
46
|
||||
00:02:49.380 --> 00:02:51.662
|
||||
00:02:50.130 --> 00:02:52.412
|
||||
C'est le cœur de la stratégie.
|
||||
|
||||
47
|
||||
00:02:51.853 --> 00:02:54.274
|
||||
00:02:52.603 --> 00:02:55.024
|
||||
Le niveau 1 est ouvert dès le premier
|
||||
jour.
|
||||
|
||||
48
|
||||
00:02:54.407 --> 00:02:57.467
|
||||
00:02:55.157 --> 00:02:58.217
|
||||
Le niveau 2 s'ouvre quand deux de vos
|
||||
filleuls directs ont chacun acheté
|
||||
|
||||
49
|
||||
00:02:57.507 --> 00:02:59.359
|
||||
00:02:58.257 --> 00:03:00.109
|
||||
pour $20 ou plus.
|
||||
|
||||
50
|
||||
00:02:59.492 --> 00:03:01.484
|
||||
00:03:00.242 --> 00:03:02.234
|
||||
Le niveau 3 s'ouvre à cinq.
|
||||
|
||||
51
|
||||
00:03:01.617 --> 00:03:03.725
|
||||
00:03:02.367 --> 00:03:04.475
|
||||
La largeur ne remplace donc pas la
|
||||
profondeur.
|
||||
|
||||
52
|
||||
00:03:03.765 --> 00:03:06.627
|
||||
00:03:04.515 --> 00:03:07.377
|
||||
C'est la largeur qui débloque la
|
||||
profondeur.
|
||||
|
||||
53
|
||||
00:03:14.480 --> 00:03:17.644
|
||||
00:03:15.230 --> 00:03:18.394
|
||||
Voici ce qui arrive si vous construisez en
|
||||
profondeur sans construire en largeur.
|
||||
|
||||
54
|
||||
00:03:17.835 --> 00:03:21.023
|
||||
00:03:18.585 --> 00:03:21.773
|
||||
Disons que vous avez deux acheteurs et une
|
||||
équipe profonde en dessous.
|
||||
|
||||
55
|
||||
00:03:21.063 --> 00:03:24.668
|
||||
00:03:21.813 --> 00:03:25.418
|
||||
Quand quelqu'un de votre niveau 3 achète,
|
||||
cette part ne vous attend pas.
|
||||
|
||||
56
|
||||
00:03:24.859 --> 00:03:28.523
|
||||
00:03:25.609 --> 00:03:29.273
|
||||
Elle passe à la prochaine personne
|
||||
au-dessus de vous qui a cinq acheteurs.
|
||||
|
||||
57
|
||||
00:03:29.770 --> 00:03:34.316
|
||||
00:03:30.520 --> 00:03:35.066
|
||||
Imaginez deux leaders, et chacun fait un
|
||||
achat de $20.
|
||||
|
||||
58
|
||||
00:03:34.391 --> 00:03:38.774
|
||||
00:03:35.141 --> 00:03:39.524
|
||||
Le leader A parraine dix personnes,
|
||||
chacune en parraine cinq, et chacune
|
||||
|
||||
59
|
||||
00:03:38.814 --> 00:03:40.411
|
||||
00:03:39.564 --> 00:03:41.161
|
||||
de celles-ci en parraine cinq.
|
||||
|
||||
60
|
||||
00:03:40.672 --> 00:03:43.616
|
||||
00:03:41.422 --> 00:03:44.366
|
||||
Cela fait $800 pour un seul achat chacun.
|
||||
|
||||
61
|
||||
00:03:43.807 --> 00:03:47.307
|
||||
00:03:44.557 --> 00:03:48.057
|
||||
Le leader B en parraine deux, et chacun
|
||||
d'eux en parraine deux.
|
||||
|
||||
62
|
||||
00:03:47.870 --> 00:03:51.116
|
||||
00:03:48.620 --> 00:03:51.866
|
||||
$36, et le niveau 3 de B remonte
|
||||
au-dessus.
|
||||
|
||||
63
|
||||
00:03:51.307 --> 00:03:54.413
|
||||
00:03:52.057 --> 00:03:55.163
|
||||
Ceci est une illustration, pas une
|
||||
promesse de revenus.
|
||||
|
||||
64
|
||||
00:03:54.604 --> 00:03:58.163
|
||||
00:03:55.354 --> 00:03:58.913
|
||||
Acheter ou non reste le libre choix de
|
||||
chacun.
|
||||
|
||||
65
|
||||
00:03:59.410 --> 00:04:01.460
|
||||
00:04:00.160 --> 00:04:02.210
|
||||
Vous ne voulez pas attendre vos premiers
|
||||
filleuls ?
|
||||
|
||||
66
|
||||
00:04:01.488 --> 00:04:05.651
|
||||
00:04:02.238 --> 00:04:06.401
|
||||
Qualified Start vous permet de lier
|
||||
jusqu'à cinq de vos propres wallets comme
|
||||
positions.
|
||||
|
||||
67
|
||||
00:04:05.784 --> 00:04:10.074
|
||||
00:04:06.534 --> 00:04:10.824
|
||||
Chaque achat de $20 d'une position compte
|
||||
comme un acheteur qualifiant, et la
|
||||
|
||||
68
|
||||
00:04:10.114 --> 00:04:12.187
|
||||
00:04:10.864 --> 00:04:12.937
|
||||
moitié revient directement sur votre
|
||||
wallet principal.
|
||||
|
||||
69
|
||||
00:04:12.320 --> 00:04:16.332
|
||||
00:04:13.070 --> 00:04:17.082
|
||||
Cinq positions : vous dépensez $100, $50
|
||||
vous reviennent, vous détenez 10 000
|
||||
|
||||
70
|
||||
00:04:16.372 --> 00:04:20.186
|
||||
00:04:17.122 --> 00:04:20.936
|
||||
crédits publicitaires, et les niveaux 2 et
|
||||
3 sont ouverts.
|
||||
|
||||
71
|
||||
00:04:21.440 --> 00:04:23.536
|
||||
00:04:22.190 --> 00:04:24.286
|
||||
Vous aurez de vrais outils pour
|
||||
construire.
|
||||
|
||||
72
|
||||
00:04:24.238 --> 00:04:28.900
|
||||
00:04:24.988 --> 00:04:29.650
|
||||
La Pipeline est votre tableau de suivi :
|
||||
toutes les personnes avec qui vous
|
||||
travaillez, dans
|
||||
|
||||
73
|
||||
00:04:28.940 --> 00:04:33.161
|
||||
00:04:29.690 --> 00:04:33.911
|
||||
des colonnes qui avancent d'elles-mêmes à
|
||||
chaque étape franchie, pour que vous
|
||||
sachiez toujours à
|
||||
|
||||
74
|
||||
00:04:33.201 --> 00:04:34.451
|
||||
00:04:33.951 --> 00:04:35.201
|
||||
qui parler ensuite.
|
||||
|
||||
75
|
||||
00:04:34.698 --> 00:04:38.211
|
||||
00:04:35.448 --> 00:04:38.961
|
||||
Vous avez aussi du coaching pour votre
|
||||
équipe, et des outils promo
|
||||
|
||||
76
|
||||
00:04:38.251 --> 00:04:39.662
|
||||
00:04:39.001 --> 00:04:40.412
|
||||
avec votre lien déjà intégré.
|
||||
|
||||
77
|
||||
00:04:41.910 --> 00:04:44.540
|
||||
00:04:42.660 --> 00:04:45.290
|
||||
Il y a une deuxième source de revenus sur
|
||||
le même wallet.
|
||||
|
||||
78
|
||||
00:04:44.673 --> 00:04:50.543
|
||||
00:04:45.423 --> 00:04:51.293
|
||||
LinkSpin donne à votre équipe des outils
|
||||
pour promouvoir n'importe quoi : liens
|
||||
rotatifs, vrai suivi,
|
||||
|
||||
79
|
||||
00:04:50.583 --> 00:04:52.203
|
||||
00:04:51.333 --> 00:04:52.953
|
||||
pages et zones publicitaires.
|
||||
|
||||
80
|
||||
00:04:52.336 --> 00:04:57.555
|
||||
00:04:53.086 --> 00:04:58.305
|
||||
Il paie les mêmes 50, 20, 10, avec les
|
||||
mêmes déblocages.
|
||||
|
||||
81
|
||||
00:04:57.583 --> 00:04:59.668
|
||||
00:04:58.333 --> 00:05:00.418
|
||||
La pré-ouverture démarre le 1er novembre.
|
||||
|
||||
82
|
||||
00:05:00.920 --> 00:05:02.668
|
||||
00:05:01.670 --> 00:05:03.418
|
||||
Votre wallet est votre clé.
|
||||
|
||||
83
|
||||
00:05:03.114 --> 00:05:07.184
|
||||
00:05:03.864 --> 00:05:07.934
|
||||
Chaque plateforme du réseau vous reconnaît
|
||||
grâce à lui, et votre équipe vous suit.
|
||||
|
||||
84
|
||||
00:05:07.445 --> 00:05:10.714
|
||||
00:05:08.195 --> 00:05:11.464
|
||||
Quand une nouvelle plateforme est lancée,
|
||||
vos personnes sont déjà placées sous vous.
|
||||
|
||||
85
|
||||
00:05:10.754 --> 00:05:16.913
|
||||
00:05:11.504 --> 00:05:17.663
|
||||
Un parrain n'est jamais écarté parce qu'il
|
||||
est discret, et un achat n'est jamais
|
||||
bloqué.
|
||||
|
||||
86
|
||||
00:05:18.160 --> 00:05:20.639
|
||||
00:05:18.910 --> 00:05:21.389
|
||||
Votre première semaine : activez les
|
||||
paiements.
|
||||
|
||||
87
|
||||
00:05:20.830 --> 00:05:22.265
|
||||
00:05:21.580 --> 00:05:23.015
|
||||
Trouvez vos deux premiers acheteurs.
|
||||
|
||||
88
|
||||
00:05:22.305 --> 00:05:23.147
|
||||
00:05:23.055 --> 00:05:23.897
|
||||
Atteignez cinq.
|
||||
|
||||
89
|
||||
00:05:23.187 --> 00:05:24.494
|
||||
00:05:23.937 --> 00:05:25.244
|
||||
Continuez à construire en largeur.
|
||||
|
||||
90
|
||||
00:05:24.627 --> 00:05:28.162
|
||||
00:05:25.377 --> 00:05:28.912
|
||||
Et enseignez le même plan à chaque
|
||||
personne que vous faites entrer.
|
||||
|
||||
91
|
||||
00:05:36.010 --> 00:05:37.386
|
||||
00:05:36.760 --> 00:05:38.136
|
||||
L'objectif, c'est cinq.
|
||||
|
||||
92
|
||||
00:05:37.647 --> 00:05:42.297
|
||||
00:05:38.397 --> 00:05:43.047
|
||||
Cinq acheteurs solides débloquent chaque
|
||||
niveau, chaque palier et chaque outil.
|
||||
|
||||
93
|
||||
00:05:42.651 --> 00:05:43.901
|
||||
00:05:43.401 --> 00:05:44.651
|
||||
Prêt à commencer ?
|
||||
|
||||
94
|
||||
00:05:44.857 --> 00:05:47.394
|
||||
00:05:45.607 --> 00:05:48.144
|
||||
Contactez la personne qui vous a partagé
|
||||
cette vidéo.
|
||||
|
||||
95
|
||||
00:05:47.434 --> 00:05:50.865
|
||||
00:05:48.184 --> 00:05:51.615
|
||||
Elle vous aidera à démarrer en quelques
|
||||
minutes, et elle sera votre parrain
|
||||
|
||||
96
|
||||
00:05:50.905 --> 00:05:52.792
|
||||
00:05:51.655 --> 00:05:53.542
|
||||
sur chaque plateforme du réseau.
|
||||
|
||||
@@ -198,252 +198,252 @@ e quell'acquirente passano allo sponsor
|
||||
successivo sopra di te, per sempre.
|
||||
|
||||
43
|
||||
00:02:38.550 --> 00:02:41.586
|
||||
I pacchetti vanno da $5 a $250.
|
||||
00:02:38.550 --> 00:02:41.517
|
||||
I pacchetti vanno da $5 a $500.
|
||||
|
||||
44
|
||||
00:02:41.940 --> 00:02:46.219
|
||||
00:02:41.963 --> 00:02:46.823
|
||||
Da $20 in su si diventa acquirente
|
||||
qualificante, e questo conta per quello
|
||||
|
||||
45
|
||||
00:02:46.259 --> 00:02:48.134
|
||||
00:02:46.863 --> 00:02:48.877
|
||||
che viene dopo.
|
||||
|
||||
46
|
||||
00:02:49.380 --> 00:02:51.662
|
||||
00:02:50.130 --> 00:02:52.412
|
||||
Questo è il cuore della strategia.
|
||||
|
||||
47
|
||||
00:02:51.853 --> 00:02:54.274
|
||||
00:02:52.603 --> 00:02:55.024
|
||||
Il livello 1 è aperto dal primo giorno.
|
||||
|
||||
48
|
||||
00:02:54.407 --> 00:02:57.467
|
||||
00:02:55.157 --> 00:02:58.217
|
||||
Il livello 2 si apre quando due tuoi
|
||||
invitati diretti hanno acquistato
|
||||
|
||||
49
|
||||
00:02:57.507 --> 00:02:59.359
|
||||
00:02:58.257 --> 00:03:00.109
|
||||
ciascuno $20 o più.
|
||||
|
||||
50
|
||||
00:02:59.492 --> 00:03:01.484
|
||||
00:03:00.242 --> 00:03:02.234
|
||||
Il livello 3 si apre a cinque.
|
||||
|
||||
51
|
||||
00:03:01.617 --> 00:03:03.725
|
||||
00:03:02.367 --> 00:03:04.475
|
||||
Quindi la larghezza non sostituisce la
|
||||
profondità.
|
||||
|
||||
52
|
||||
00:03:03.765 --> 00:03:06.627
|
||||
00:03:04.515 --> 00:03:07.377
|
||||
È la larghezza che sblocca la profondità.
|
||||
|
||||
53
|
||||
00:03:14.480 --> 00:03:17.644
|
||||
00:03:15.230 --> 00:03:18.394
|
||||
Ecco cosa succede se costruisci in
|
||||
profondità senza costruire in larghezza.
|
||||
|
||||
54
|
||||
00:03:17.835 --> 00:03:21.023
|
||||
00:03:18.585 --> 00:03:21.773
|
||||
Diciamo che hai due acquirenti e un team
|
||||
profondo sotto di loro.
|
||||
|
||||
55
|
||||
00:03:21.063 --> 00:03:24.668
|
||||
00:03:21.813 --> 00:03:25.418
|
||||
Quando qualcuno nel tuo livello 3
|
||||
acquista, quella quota non ti aspetta.
|
||||
|
||||
56
|
||||
00:03:24.859 --> 00:03:28.523
|
||||
00:03:25.609 --> 00:03:29.273
|
||||
Passa alla prossima persona sopra di te
|
||||
che ha cinque acquirenti.
|
||||
|
||||
57
|
||||
00:03:29.770 --> 00:03:34.316
|
||||
00:03:30.520 --> 00:03:35.066
|
||||
Immagina due leader, e ognuno fa un
|
||||
acquisto da $20.
|
||||
|
||||
58
|
||||
00:03:34.391 --> 00:03:38.774
|
||||
00:03:35.141 --> 00:03:39.524
|
||||
Il leader A sponsorizza dieci persone,
|
||||
ognuna ne sponsorizza cinque, e ognuna
|
||||
|
||||
59
|
||||
00:03:38.814 --> 00:03:40.411
|
||||
00:03:39.564 --> 00:03:41.161
|
||||
di quelle ne sponsorizza cinque.
|
||||
|
||||
60
|
||||
00:03:40.672 --> 00:03:43.616
|
||||
00:03:41.422 --> 00:03:44.366
|
||||
Sono $800 da un solo acquisto a testa.
|
||||
|
||||
61
|
||||
00:03:43.807 --> 00:03:47.307
|
||||
00:03:44.557 --> 00:03:48.057
|
||||
Il leader B ne sponsorizza due, e ognuno
|
||||
di loro ne sponsorizza due.
|
||||
|
||||
62
|
||||
00:03:47.870 --> 00:03:51.116
|
||||
00:03:48.620 --> 00:03:51.866
|
||||
$36, e il livello 3 di B passa sopra.
|
||||
|
||||
63
|
||||
00:03:51.307 --> 00:03:54.413
|
||||
00:03:52.057 --> 00:03:55.163
|
||||
Questo è un esempio, non una promessa di
|
||||
guadagno.
|
||||
|
||||
64
|
||||
00:03:54.604 --> 00:03:58.163
|
||||
00:03:55.354 --> 00:03:58.913
|
||||
Se qualcuno acquista è una sua libera
|
||||
scelta.
|
||||
|
||||
65
|
||||
00:03:59.410 --> 00:04:01.460
|
||||
00:04:00.160 --> 00:04:02.210
|
||||
Non vuoi aspettare i tuoi primi invitati?
|
||||
|
||||
66
|
||||
00:04:01.488 --> 00:04:05.651
|
||||
00:04:02.238 --> 00:04:06.401
|
||||
Qualified Start ti permette di collegare
|
||||
fino a cinque wallet tuoi come posizioni.
|
||||
|
||||
67
|
||||
00:04:05.784 --> 00:04:10.074
|
||||
00:04:06.534 --> 00:04:10.824
|
||||
Ogni acquisto da $20 di una posizione
|
||||
conta come acquirente qualificante, e
|
||||
|
||||
68
|
||||
00:04:10.114 --> 00:04:12.187
|
||||
00:04:10.864 --> 00:04:12.937
|
||||
metà torna direttamente al tuo wallet
|
||||
principale.
|
||||
|
||||
69
|
||||
00:04:12.320 --> 00:04:16.332
|
||||
00:04:13.070 --> 00:04:17.082
|
||||
Cinque posizioni: spendi $100, te ne
|
||||
tornano $50, hai 10.000 crediti
|
||||
pubblicitari,
|
||||
|
||||
70
|
||||
00:04:16.372 --> 00:04:20.186
|
||||
00:04:17.122 --> 00:04:20.936
|
||||
e i livelli 2 e 3 sono aperti.
|
||||
|
||||
71
|
||||
00:04:21.440 --> 00:04:23.536
|
||||
00:04:22.190 --> 00:04:24.286
|
||||
Avrai strumenti veri con cui costruire.
|
||||
|
||||
72
|
||||
00:04:24.238 --> 00:04:28.900
|
||||
00:04:24.988 --> 00:04:29.650
|
||||
La Pipeline è la tua bacheca di follow-up:
|
||||
tutte le persone con cui stai lavorando,
|
||||
in colonne
|
||||
|
||||
73
|
||||
00:04:28.940 --> 00:04:33.161
|
||||
00:04:29.690 --> 00:04:33.911
|
||||
che si aggiornano da sole man mano che
|
||||
ognuno fa il passo successivo, così sai
|
||||
|
||||
74
|
||||
00:04:33.201 --> 00:04:34.451
|
||||
00:04:33.951 --> 00:04:35.201
|
||||
sempre con chi parlare.
|
||||
|
||||
75
|
||||
00:04:34.698 --> 00:04:38.211
|
||||
00:04:35.448 --> 00:04:38.961
|
||||
Hai anche il coaching per il tuo team, e
|
||||
strumenti promozionali con
|
||||
|
||||
76
|
||||
00:04:38.251 --> 00:04:39.662
|
||||
00:04:39.001 --> 00:04:40.412
|
||||
il tuo link già inserito.
|
||||
|
||||
77
|
||||
00:04:41.910 --> 00:04:44.540
|
||||
00:04:42.660 --> 00:04:45.290
|
||||
C'è una seconda fonte di reddito sullo
|
||||
stesso wallet.
|
||||
|
||||
78
|
||||
00:04:44.673 --> 00:04:50.543
|
||||
00:04:45.423 --> 00:04:51.293
|
||||
LinkSpin dà al tuo team gli strumenti per
|
||||
promuovere qualsiasi cosa: link a
|
||||
rotazione, tracciamento reale,
|
||||
|
||||
79
|
||||
00:04:50.583 --> 00:04:52.203
|
||||
00:04:51.333 --> 00:04:52.953
|
||||
pagine e zone pubblicitarie.
|
||||
|
||||
80
|
||||
00:04:52.336 --> 00:04:57.555
|
||||
00:04:53.086 --> 00:04:58.305
|
||||
Paga lo stesso 50, 20, 10, con gli stessi
|
||||
sblocchi.
|
||||
|
||||
81
|
||||
00:04:57.583 --> 00:04:59.668
|
||||
00:04:58.333 --> 00:05:00.418
|
||||
Il pre-lancio apre il primo novembre.
|
||||
|
||||
82
|
||||
00:05:00.920 --> 00:05:02.668
|
||||
00:05:01.670 --> 00:05:03.418
|
||||
Il tuo wallet è la tua chiave.
|
||||
|
||||
83
|
||||
00:05:03.114 --> 00:05:07.184
|
||||
00:05:03.864 --> 00:05:07.934
|
||||
Ogni piattaforma del network ti riconosce
|
||||
da esso, e il tuo team ti segue.
|
||||
|
||||
84
|
||||
00:05:07.445 --> 00:05:10.714
|
||||
00:05:08.195 --> 00:05:11.464
|
||||
Quando lancia una nuova piattaforma, le
|
||||
tue persone sono già posizionate sotto di
|
||||
te.
|
||||
|
||||
85
|
||||
00:05:10.754 --> 00:05:16.913
|
||||
00:05:11.504 --> 00:05:17.663
|
||||
Uno sponsor non viene mai scavalcato
|
||||
perché è silenzioso, e un acquisto non
|
||||
viene mai bloccato.
|
||||
|
||||
86
|
||||
00:05:18.160 --> 00:05:20.639
|
||||
00:05:18.910 --> 00:05:21.389
|
||||
La tua prima settimana: attiva i
|
||||
pagamenti.
|
||||
|
||||
87
|
||||
00:05:20.830 --> 00:05:22.265
|
||||
00:05:21.580 --> 00:05:23.015
|
||||
Trova i tuoi primi due acquirenti.
|
||||
|
||||
88
|
||||
00:05:22.305 --> 00:05:23.147
|
||||
00:05:23.055 --> 00:05:23.897
|
||||
Arriva a cinque.
|
||||
|
||||
89
|
||||
00:05:23.187 --> 00:05:24.494
|
||||
00:05:23.937 --> 00:05:25.244
|
||||
Continua a costruire in larghezza.
|
||||
|
||||
90
|
||||
00:05:24.627 --> 00:05:28.162
|
||||
00:05:25.377 --> 00:05:28.912
|
||||
E insegna lo stesso piano a ogni persona
|
||||
che porti dentro.
|
||||
|
||||
91
|
||||
00:05:36.010 --> 00:05:37.386
|
||||
00:05:36.760 --> 00:05:38.136
|
||||
L'obiettivo è cinque.
|
||||
|
||||
92
|
||||
00:05:37.647 --> 00:05:42.297
|
||||
00:05:38.397 --> 00:05:43.047
|
||||
Cinque acquirenti solidi sbloccano ogni
|
||||
livello, ogni traguardo e ogni strumento.
|
||||
|
||||
93
|
||||
00:05:42.651 --> 00:05:43.901
|
||||
00:05:43.401 --> 00:05:44.651
|
||||
Pronto a iniziare?
|
||||
|
||||
94
|
||||
00:05:44.857 --> 00:05:47.394
|
||||
00:05:45.607 --> 00:05:48.144
|
||||
Contatta la persona che ti ha condiviso
|
||||
questo video.
|
||||
|
||||
95
|
||||
00:05:47.434 --> 00:05:50.865
|
||||
00:05:48.184 --> 00:05:51.615
|
||||
Ti aiuterà a partire in pochi minuti, e
|
||||
sarà il tuo sponsor
|
||||
|
||||
96
|
||||
00:05:50.905 --> 00:05:52.792
|
||||
00:05:51.655 --> 00:05:53.542
|
||||
su ogni piattaforma del network.
|
||||
|
||||
@@ -195,252 +195,252 @@ comprador passam para o próximo
|
||||
patrocinador acima de você, para sempre.
|
||||
|
||||
43
|
||||
00:02:38.550 --> 00:02:41.586
|
||||
Os pacotes vão de $5 a $250.
|
||||
00:02:38.550 --> 00:02:41.517
|
||||
Os pacotes vão de $5 a $500.
|
||||
|
||||
44
|
||||
00:02:41.940 --> 00:02:46.219
|
||||
00:02:41.963 --> 00:02:46.823
|
||||
Com $20 ou mais a pessoa vira compradora
|
||||
qualificada, e isso importa para o que
|
||||
|
||||
45
|
||||
00:02:46.259 --> 00:02:48.134
|
||||
00:02:46.863 --> 00:02:48.877
|
||||
vem a seguir.
|
||||
|
||||
46
|
||||
00:02:49.380 --> 00:02:51.662
|
||||
00:02:50.130 --> 00:02:52.412
|
||||
Este é o coração da estratégia.
|
||||
|
||||
47
|
||||
00:02:51.853 --> 00:02:54.274
|
||||
00:02:52.603 --> 00:02:55.024
|
||||
O nível 1 está aberto desde o primeiro
|
||||
dia.
|
||||
|
||||
48
|
||||
00:02:54.407 --> 00:02:57.467
|
||||
00:02:55.157 --> 00:02:58.217
|
||||
O nível 2 abre quando dois dos seus
|
||||
indicados diretos compraram, cada
|
||||
|
||||
49
|
||||
00:02:57.507 --> 00:02:59.359
|
||||
00:02:58.257 --> 00:03:00.109
|
||||
um, $20 ou mais.
|
||||
|
||||
50
|
||||
00:02:59.492 --> 00:03:01.484
|
||||
00:03:00.242 --> 00:03:02.234
|
||||
O nível 3 abre com cinco.
|
||||
|
||||
51
|
||||
00:03:01.617 --> 00:03:03.725
|
||||
00:03:02.367 --> 00:03:04.475
|
||||
Então a largura não substitui a
|
||||
profundidade.
|
||||
|
||||
52
|
||||
00:03:03.765 --> 00:03:06.627
|
||||
00:03:04.515 --> 00:03:07.377
|
||||
É a largura que desbloqueia a
|
||||
profundidade.
|
||||
|
||||
53
|
||||
00:03:14.480 --> 00:03:17.644
|
||||
00:03:15.230 --> 00:03:18.394
|
||||
Veja o que acontece se você construir em
|
||||
profundidade sem construir na largura.
|
||||
|
||||
54
|
||||
00:03:17.835 --> 00:03:21.023
|
||||
00:03:18.585 --> 00:03:21.773
|
||||
Digamos que você tem dois compradores e
|
||||
uma equipe profunda abaixo deles.
|
||||
|
||||
55
|
||||
00:03:21.063 --> 00:03:24.668
|
||||
00:03:21.813 --> 00:03:25.418
|
||||
Quando alguém do seu nível 3 compra, essa
|
||||
parte não espera por você.
|
||||
|
||||
56
|
||||
00:03:24.859 --> 00:03:28.523
|
||||
00:03:25.609 --> 00:03:29.273
|
||||
Ela passa para a próxima pessoa acima de
|
||||
você que tem cinco compradores.
|
||||
|
||||
57
|
||||
00:03:29.770 --> 00:03:34.316
|
||||
00:03:30.520 --> 00:03:35.066
|
||||
Imagine dois líderes, e cada pessoa faz
|
||||
uma compra de $20.
|
||||
|
||||
58
|
||||
00:03:34.391 --> 00:03:38.774
|
||||
00:03:35.141 --> 00:03:39.524
|
||||
O líder A patrocina dez, cada um deles
|
||||
patrocina cinco, e cada
|
||||
|
||||
59
|
||||
00:03:38.814 --> 00:03:40.411
|
||||
00:03:39.564 --> 00:03:41.161
|
||||
um desses patrocina cinco.
|
||||
|
||||
60
|
||||
00:03:40.672 --> 00:03:43.616
|
||||
00:03:41.422 --> 00:03:44.366
|
||||
São $800 de uma única compra por pessoa.
|
||||
|
||||
61
|
||||
00:03:43.807 --> 00:03:47.307
|
||||
00:03:44.557 --> 00:03:48.057
|
||||
O líder B patrocina dois, e cada um deles
|
||||
patrocina dois.
|
||||
|
||||
62
|
||||
00:03:47.870 --> 00:03:51.116
|
||||
00:03:48.620 --> 00:03:51.866
|
||||
$36, e o nível 3 de B passa para cima.
|
||||
|
||||
63
|
||||
00:03:51.307 --> 00:03:54.413
|
||||
00:03:52.057 --> 00:03:55.163
|
||||
Isto é uma ilustração, não uma promessa de
|
||||
renda.
|
||||
|
||||
64
|
||||
00:03:54.604 --> 00:03:58.163
|
||||
00:03:55.354 --> 00:03:58.913
|
||||
Comprar ou não é escolha de cada um.
|
||||
|
||||
65
|
||||
00:03:59.410 --> 00:04:01.460
|
||||
00:04:00.160 --> 00:04:02.210
|
||||
Não quer esperar pelos seus primeiros
|
||||
indicados?
|
||||
|
||||
66
|
||||
00:04:01.488 --> 00:04:05.651
|
||||
00:04:02.238 --> 00:04:06.401
|
||||
O Qualified Start permite vincular até
|
||||
cinco wallets suas como posições.
|
||||
|
||||
67
|
||||
00:04:05.784 --> 00:04:10.074
|
||||
00:04:06.534 --> 00:04:10.824
|
||||
Cada compra de $20 de uma posição conta
|
||||
como compradora qualificada, e metade
|
||||
|
||||
68
|
||||
00:04:10.114 --> 00:04:12.187
|
||||
00:04:10.864 --> 00:04:12.937
|
||||
volta direto para a sua wallet principal.
|
||||
|
||||
69
|
||||
00:04:12.320 --> 00:04:16.332
|
||||
00:04:13.070 --> 00:04:17.082
|
||||
Cinco posições: você gasta $100, $50
|
||||
voltam, você fica com 10.000 créditos de
|
||||
|
||||
70
|
||||
00:04:16.372 --> 00:04:20.186
|
||||
00:04:17.122 --> 00:04:20.936
|
||||
anúncio, e os níveis 2 e 3 ficam abertos.
|
||||
|
||||
71
|
||||
00:04:21.440 --> 00:04:23.536
|
||||
00:04:22.190 --> 00:04:24.286
|
||||
Você terá ferramentas de verdade para
|
||||
construir.
|
||||
|
||||
72
|
||||
00:04:24.238 --> 00:04:28.900
|
||||
00:04:24.988 --> 00:04:29.650
|
||||
O Pipeline é o seu quadro de
|
||||
acompanhamento: todas as pessoas com quem
|
||||
você está trabalhando, em
|
||||
|
||||
73
|
||||
00:04:28.940 --> 00:04:33.161
|
||||
00:04:29.690 --> 00:04:33.911
|
||||
colunas que avançam sozinhas conforme cada
|
||||
um dá o próximo passo, para você sempre
|
||||
saber com
|
||||
|
||||
74
|
||||
00:04:33.201 --> 00:04:34.451
|
||||
00:04:33.951 --> 00:04:35.201
|
||||
quem falar a seguir.
|
||||
|
||||
75
|
||||
00:04:34.698 --> 00:04:38.211
|
||||
00:04:35.448 --> 00:04:38.961
|
||||
Você também tem coaching para a sua
|
||||
equipe, e ferramentas de divulgação com
|
||||
|
||||
76
|
||||
00:04:38.251 --> 00:04:39.662
|
||||
00:04:39.001 --> 00:04:40.412
|
||||
o seu link já preenchido.
|
||||
|
||||
77
|
||||
00:04:41.910 --> 00:04:44.540
|
||||
00:04:42.660 --> 00:04:45.290
|
||||
Existe uma segunda fonte de renda na mesma
|
||||
wallet.
|
||||
|
||||
78
|
||||
00:04:44.673 --> 00:04:50.543
|
||||
00:04:45.423 --> 00:04:51.293
|
||||
O LinkSpin dá à sua equipe ferramentas
|
||||
para divulgar qualquer coisa: links
|
||||
rotativos, rastreamento real, páginas
|
||||
|
||||
79
|
||||
00:04:50.583 --> 00:04:52.203
|
||||
00:04:51.333 --> 00:04:52.953
|
||||
e zonas de anúncio.
|
||||
|
||||
80
|
||||
00:04:52.336 --> 00:04:57.555
|
||||
00:04:53.086 --> 00:04:58.305
|
||||
Ele paga os mesmos 50, 20, 10, com os
|
||||
mesmos desbloqueios.
|
||||
|
||||
81
|
||||
00:04:57.583 --> 00:04:59.668
|
||||
00:04:58.333 --> 00:05:00.418
|
||||
O pré-lançamento abre em 1º de novembro.
|
||||
|
||||
82
|
||||
00:05:00.920 --> 00:05:02.668
|
||||
00:05:01.670 --> 00:05:03.418
|
||||
Sua wallet é a sua chave.
|
||||
|
||||
83
|
||||
00:05:03.114 --> 00:05:07.184
|
||||
00:05:03.864 --> 00:05:07.934
|
||||
Cada plataforma da rede reconhece você por
|
||||
ela, e a sua equipe segue você.
|
||||
|
||||
84
|
||||
00:05:07.445 --> 00:05:10.714
|
||||
00:05:08.195 --> 00:05:11.464
|
||||
Quando uma nova plataforma é lançada, o
|
||||
seu pessoal já está posicionado abaixo de
|
||||
você.
|
||||
|
||||
85
|
||||
00:05:10.754 --> 00:05:16.913
|
||||
00:05:11.504 --> 00:05:17.663
|
||||
Um patrocinador nunca é pulado por estar
|
||||
quieto, e uma compra nunca fica parada.
|
||||
|
||||
86
|
||||
00:05:18.160 --> 00:05:20.639
|
||||
00:05:18.910 --> 00:05:21.389
|
||||
Sua primeira semana: ative os pagamentos.
|
||||
|
||||
87
|
||||
00:05:20.830 --> 00:05:22.265
|
||||
00:05:21.580 --> 00:05:23.015
|
||||
Encontre seus dois primeiros compradores.
|
||||
|
||||
88
|
||||
00:05:22.305 --> 00:05:23.147
|
||||
00:05:23.055 --> 00:05:23.897
|
||||
Chegue a cinco.
|
||||
|
||||
89
|
||||
00:05:23.187 --> 00:05:24.494
|
||||
00:05:23.937 --> 00:05:25.244
|
||||
Continue construindo na largura.
|
||||
|
||||
90
|
||||
00:05:24.627 --> 00:05:28.162
|
||||
00:05:25.377 --> 00:05:28.912
|
||||
E ensine o mesmo plano a cada pessoa que
|
||||
você trouxer.
|
||||
|
||||
91
|
||||
00:05:36.010 --> 00:05:37.386
|
||||
00:05:36.760 --> 00:05:38.136
|
||||
A meta é cinco.
|
||||
|
||||
92
|
||||
00:05:37.647 --> 00:05:42.297
|
||||
00:05:38.397 --> 00:05:43.047
|
||||
Cinco compradores fortes desbloqueiam cada
|
||||
nível, cada marco e cada ferramenta.
|
||||
|
||||
93
|
||||
00:05:42.651 --> 00:05:43.901
|
||||
00:05:43.401 --> 00:05:44.651
|
||||
Pronto para começar?
|
||||
|
||||
94
|
||||
00:05:44.857 --> 00:05:47.394
|
||||
00:05:45.607 --> 00:05:48.144
|
||||
Fale com a pessoa que compartilhou isto
|
||||
com você.
|
||||
|
||||
95
|
||||
00:05:47.434 --> 00:05:50.865
|
||||
00:05:48.184 --> 00:05:51.615
|
||||
Ela vai te ajudar a começar em poucos
|
||||
minutos, e será seu patrocinador em
|
||||
|
||||
96
|
||||
00:05:50.905 --> 00:05:52.792
|
||||
00:05:51.655 --> 00:05:53.542
|
||||
todas as plataformas da rede.
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@
|
||||
<h3>3. Pricing and ad credits</h3>
|
||||
<ul class="muted small">
|
||||
<li><b>Prices are set in US dollars and paid in POL.</b> The contract converts the dollar price to POL at the moment of purchase using the Chainlink POL/USD price feed on Polygon. If the feed goes quiet, the contract uses the last fresh price for up to 24 hours, then pauses new sales until the feed recovers.</li>
|
||||
<li><b>Base rate: 1 credit = $0.01.</b> Current packages: $5 = 500 credits, $20 = 2,000, $50 = 5,500, $100 = 12,000, $250 = 32,500 (larger packages include bonus credits). Package prices are bounded in the contract between $1 and $500, and any price change waits 24 hours before it takes effect.</li>
|
||||
<li><b>Base rate: 1 credit = $0.01.</b> Current packages: $5 = 500 credits, $10 = 1,000, $20 = 2,000, $50 = 5,500, $100 = 12,000, $250 = 32,500, $500 = 70,000 (larger packages include bonus credits). Package prices are bounded in the contract between $1 and $500, and any price change waits 24 hours before it takes effect.</li>
|
||||
<li><b>Purchased credits are recorded on-chain.</b> A purchase adds credits to the member's balance inside the contract. As campaigns run, the platform's engine wallet burns the spent credits on-chain in batches, each burn tagged with its campaign reference, so the public ledger shows credits in and credits used. Only the engine wallet can reduce a balance, and only by burning.</li>
|
||||
<li><b>Earned credits are kept by the site, not on-chain.</b> Welcome credits, surfing and viewing rewards, promo codes and other bonuses are tracked in the site's database and labeled separately from purchased credits.</li>
|
||||
<li><b>Credits are advertising credit, not currency.</b> They cannot be transferred between members and cannot be exchanged back into POL or cash.</li>
|
||||
|
||||
+4
-2
@@ -401,10 +401,12 @@
|
||||
<p class="small muted" style="margin-bottom:4px">The package they buy</p>
|
||||
<p><select id="dcPkg" style="width:100%">
|
||||
<option value="5">Micro, $5</option>
|
||||
<option value="10">Starter, $10</option>
|
||||
<option value="20" selected>Activation, $20</option>
|
||||
<option value="50">Builder, $50</option>
|
||||
<option value="100">Growth, $100</option>
|
||||
<option value="250">Leader, $250</option>
|
||||
<option value="500">Elite, $500</option>
|
||||
</select></p>
|
||||
<p class="small muted" style="margin-bottom:4px">Referrals each of them brings who also buy</p>
|
||||
<p><input type="range" id="dcSpread" min="0" max="10" value="2" style="width:100%">
|
||||
@@ -468,7 +470,7 @@
|
||||
<details><summary>What am I actually buying?</summary>
|
||||
<p>You are buying ad delivery. Credits are one cent of delivery each, recorded on-chain when you buy.
|
||||
The 5 dollar package mints 500 credits, and the bigger packages mint bonus credits on top, up to
|
||||
32,500 on the 250 dollar package. That is the product, plain and simple. Your earnings come from
|
||||
70,000 on the 500 dollar package. That is the product, plain and simple. Your earnings come from
|
||||
referring people who also buy real ad delivery, and the contract splits every purchase automatically.</p></details>
|
||||
|
||||
<div class="closer">
|
||||
@@ -500,7 +502,7 @@
|
||||
|
||||
<script src="/assets/common.js?v=20261015a"></script><script src="/assets/welcome.js?v=20260923b"></script>
|
||||
<script src="/assets/wallet.js?v=20260909c"></script>
|
||||
<script src="/assets/home.js?v=20260929b"></script>
|
||||
<script src="/assets/home.js?v=20261016p"></script>
|
||||
<script src="/assets/chat.js?v=20260906m"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+1
-1
@@ -158,6 +158,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261015a"></script><script src="/assets/welcome.js?v=20260923b"></script>
|
||||
<script src="/assets/join.js?v=20261015a"></script>
|
||||
<script src="/assets/join.js?v=20261016p"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -116,10 +116,12 @@ footer{color:var(--muted);font-size:14.5px;border-top:1px solid var(--line);padd
|
||||
<thead><tr><th>Package</th><th>Price</th><th>Credits</th><th>You get as direct sponsor</th></tr></thead>
|
||||
<tbody>
|
||||
<tr><td>Micro</td><td>$5</td><td>500</td><td>$2.50</td></tr>
|
||||
<tr><td>Starter</td><td>$10</td><td>1,000</td><td>$5</td></tr>
|
||||
<tr><td>Activation (the qualifying buy)</td><td>$20</td><td>2,000</td><td>$10</td></tr>
|
||||
<tr><td>Builder</td><td>$50</td><td>5,500</td><td>$25</td></tr>
|
||||
<tr><td>Growth</td><td>$100</td><td>12,000</td><td>$50</td></tr>
|
||||
<tr><td>Leader</td><td>$250</td><td>32,500</td><td>$125</td></tr>
|
||||
<tr><td>Elite</td><td>$500</td><td>70,000</td><td>$250</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
|
||||
## Pricing and ad credits
|
||||
- Prices are set in US dollars and paid in POL, converted at purchase time with the Chainlink POL/USD feed on Polygon. If the feed is stale, the last fresh price is used for up to 24 hours, then new sales pause until the feed recovers.
|
||||
- Base rate: 1 credit = $0.01. Packages: $5 = 500 credits, $20 = 2,000, $50 = 5,500, $100 = 12,000, $250 = 32,500 (larger packages include bonus credits).
|
||||
- Base rate: 1 credit = $0.01. Packages: $5 = 500 credits, $10 = 1,000, $20 = 2,000, $50 = 5,500, $100 = 12,000, $250 = 32,500, $500 = 70,000 (larger packages include bonus credits).
|
||||
- Package prices are bounded in the contract between $1 and $500; a price change waits 24 hours before taking effect.
|
||||
- Purchased credits are recorded in the contract. As campaigns run, the platform's engine wallet burns spent credits on-chain in batches, each tagged with a campaign reference. Only the engine wallet can reduce a balance, and only by burning.
|
||||
- Earned credits (welcome credits, viewing and surfing rewards, promo codes, bonuses) are tracked in the site database, not on-chain, and are labeled separately from purchased credits.
|
||||
|
||||
+6
-3
@@ -182,6 +182,7 @@
|
||||
<div class="card" id="phLaunch" hidden></div>
|
||||
<div class="card" id="fdfCard" hidden></div>
|
||||
<div class="card" id="wwCard" hidden></div>
|
||||
<div class="card" id="gpNudge" hidden></div>
|
||||
<div class="card gs" id="gsCard" hidden>
|
||||
<div class="card-head"><h3>Getting started</h3><span class="sub" id="gsSub"></span></div>
|
||||
<div class="gs-steps" id="gsSteps"></div>
|
||||
@@ -464,7 +465,7 @@
|
||||
<p class="muted small">What it costs to open each level with your own positions, what comes straight back to your main wallet, and the ad credits you end up holding.</p>
|
||||
<p style="display:flex;gap:12px;flex-wrap:wrap;align-items:center">
|
||||
<label class="small">Positions <input type="number" id="qcN" min="1" max="10" value="2" style="width:80px;margin-left:6px"></label>
|
||||
<label class="small">Package each <select id="qcPkg" style="margin-left:6px"><option value="20">$20 · 2,000 credits</option><option value="50">$50 · 5,500 credits</option><option value="100">$100 · 12,000 credits</option><option value="250">$250 · 32,500 credits</option></select></label>
|
||||
<label class="small">Package each <select id="qcPkg" style="margin-left:6px"><option value="20">$20 · 2,000 credits</option><option value="50">$50 · 5,500 credits</option><option value="100">$100 · 12,000 credits</option><option value="250">$250 · 32,500 credits</option><option value="500">$500 · 70,000 credits</option></select></label>
|
||||
</p>
|
||||
<div id="qcOut" class="small"></div>
|
||||
</div>
|
||||
@@ -1061,6 +1062,7 @@
|
||||
|
||||
<div class="pane" id="pane-games" hidden>
|
||||
<div class="card"><h3>Games</h3><p class="muted small">Games in the InstantAdPay network, the Polygon wing of the <a href="https://cryptoteambuild.com" target="_blank" rel="noopener">Crypto Team Build Network</a>. They pay in POL to the wallet on your InstantAdPay account, and one tap signs you in.</p></div>
|
||||
<div class="card" id="gpCard" hidden></div>
|
||||
<div class="games-grid" id="gamesGrid"><p class="muted small">Loading games…</p></div>
|
||||
<style>.games-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px;margin-top:4px}
|
||||
.game-card{background:var(--panel-solid);border:1px solid var(--line-strong);border-radius:var(--radius);overflow:hidden;display:flex;flex-direction:column}
|
||||
@@ -1072,6 +1074,7 @@
|
||||
.game-card .gc-pre{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:2px 6px;border-radius:5px;background:#fde68a;color:#7c2d12;margin-left:6px}
|
||||
.game-card .btn{margin-top:auto;text-align:center}
|
||||
.game-card{position:relative}
|
||||
#gpCard.gp-hl{outline:2px solid var(--gold,#e2b04a);outline-offset:2px}
|
||||
.game-card .gc-ribbon{position:absolute;top:10px;right:10px;display:inline-flex;align-items:center;gap:6px;background:#FF5FA2;color:#2b0418;font-weight:700;font-size:11px;letter-spacing:.1em;text-transform:uppercase;padding:5px 10px;border-radius:6px;box-shadow:0 3px 0 #9c2a5d}
|
||||
.game-card .gc-ribbon i{width:7px;height:7px;border-radius:50%;background:#2b0418;display:inline-block;animation:gcPulse 1.4s ease-in-out infinite}
|
||||
@keyframes gcPulse{50%{opacity:.25}}
|
||||
@@ -1155,8 +1158,8 @@
|
||||
</div>
|
||||
<script src="/assets/common.js?v=20261015a"></script><script src="/assets/welcome.js?v=20260923b"></script>
|
||||
<script src="/assets/wallet.js?v=20260911a"></script>
|
||||
<script src="/assets/promo.js?v=20261015a"></script>
|
||||
<script src="/assets/my.js?v=20261015a"></script>
|
||||
<script src="/assets/promo.js?v=20261016p"></script>
|
||||
<script src="/assets/my.js?v=20261016p"></script>
|
||||
<script src="/assets/chat.js?v=20260907l"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -74,10 +74,12 @@
|
||||
<table>
|
||||
<tr><th>Package</th><th>Price</th><th>Credits</th></tr>
|
||||
<tr><td>Micro</td><td>$5</td><td>500</td></tr>
|
||||
<tr><td>Starter</td><td>$10</td><td>1,000</td></tr>
|
||||
<tr><td>Activation, the qualifying buy</td><td>$20</td><td>2,000</td></tr>
|
||||
<tr><td>Builder</td><td>$50</td><td>5,500</td></tr>
|
||||
<tr><td>Growth</td><td>$100</td><td>12,000</td></tr>
|
||||
<tr><td>Leader</td><td>$250</td><td>32,500</td></tr>
|
||||
<tr><td>Elite</td><td>$500</td><td>70,000</td></tr>
|
||||
</table>
|
||||
|
||||
<h2>What your members get</h2>
|
||||
|
||||
+10
-10
@@ -8,12 +8,12 @@
|
||||
<meta property="og:type" content="video.other"><meta property="og:site_name" content="InstantAdPay">
|
||||
<meta property="og:title" content="Build wide. Get paid instantly. | InstantAdPay presentation">
|
||||
<meta property="og:description" content="The whole plan in six minutes, narrated, with captions in six languages.">
|
||||
<meta property="og:image" content="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.jpg?v=20261015a"><meta property="og:image:width" content="1280"><meta property="og:image:height" content="720">
|
||||
<meta property="og:image" content="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.jpg?v=20261016p"><meta property="og:image:width" content="1280"><meta property="og:image:height" content="720">
|
||||
<meta property="og:url" content="https://instantadpay.com/presentation">
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="Build wide. Get paid instantly.">
|
||||
<meta name="twitter:description" content="The InstantAdPay presentation: narrated, with captions in six languages.">
|
||||
<meta name="twitter:image" content="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.jpg?v=20261015a">
|
||||
<meta name="twitter:image" content="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.jpg?v=20261016p">
|
||||
<link rel="canonical" href="https://instantadpay.com/presentation">
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Sora:wght@600;700;800&display=swap">
|
||||
<link rel="icon" type="image/png" href="/logo-icon.png">
|
||||
@@ -56,14 +56,14 @@
|
||||
|
||||
<div class="pr-player">
|
||||
<video id="prVideo" controls playsinline preload="metadata"
|
||||
poster="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.jpg?v=20261015a"
|
||||
src="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.mp4?v=20261015a">
|
||||
<track kind="captions" srclang="en" label="English" src="/captions/iap-presentation.en.vtt?v=20261015a">
|
||||
<track kind="captions" srclang="it" label="Italiano" src="/captions/iap-presentation.it.vtt?v=20261015a">
|
||||
<track kind="captions" srclang="fr" label="Français" src="/captions/iap-presentation.fr.vtt?v=20261015a">
|
||||
<track kind="captions" srclang="es" label="Español" src="/captions/iap-presentation.es.vtt?v=20261015a">
|
||||
<track kind="captions" srclang="de" label="Deutsch" src="/captions/iap-presentation.de.vtt?v=20261015a">
|
||||
<track kind="captions" srclang="pt" label="Português" src="/captions/iap-presentation.pt.vtt?v=20261015a">
|
||||
poster="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.jpg?v=20261016p"
|
||||
src="https://coolify-saasytop.nyc3.digitaloceanspaces.com/training/iap-presentation.mp4?v=20261016p">
|
||||
<track kind="captions" srclang="en" label="English" src="/captions/iap-presentation.en.vtt?v=20261016p">
|
||||
<track kind="captions" srclang="it" label="Italiano" src="/captions/iap-presentation.it.vtt?v=20261016p">
|
||||
<track kind="captions" srclang="fr" label="Français" src="/captions/iap-presentation.fr.vtt?v=20261016p">
|
||||
<track kind="captions" srclang="es" label="Español" src="/captions/iap-presentation.es.vtt?v=20261016p">
|
||||
<track kind="captions" srclang="de" label="Deutsch" src="/captions/iap-presentation.de.vtt?v=20261016p">
|
||||
<track kind="captions" srclang="pt" label="Português" src="/captions/iap-presentation.pt.vtt?v=20261016p">
|
||||
</video>
|
||||
</div>
|
||||
<div class="cap-bar" id="prCaps"></div>
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
// Game Pass integration test (2026-10-16): the REAL games' shared client (spooky-doors/server/polgrant.js) and PolHunter's tournament
|
||||
// payer (polhunter/lib/tournament.js) against a LOCAL copy of this server, booted the way qa/gamepass.mjs boots it (JSON store,
|
||||
// throwaway DATA_DIR, devCode sign-in, throwaway game secrets). Nothing touches production.
|
||||
// node qa/gamepass-games.cjs (or: bash qa/run.sh gamepass-games)
|
||||
// Needs the sibling game repos (GAMES_ROOT, default ../.. = D:/Projects/HighRisk): spooky-doors/server/{polgrant,store}.js and
|
||||
// polhunter/lib/{polgrant,store,tournament,faucet}.js. The games' client has no devDay field, so for the "next Central day" calls a
|
||||
// fetch wrapper adds devDay to the already-built body and re-signs it with the same secret; every "today" call goes through untouched.
|
||||
'use strict';
|
||||
const crypto = require('crypto');
|
||||
const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const { spawn } = require('child_process');
|
||||
|
||||
const SITE = path.resolve(__dirname, '..');
|
||||
const GAMES = (process.env.GAMES_ROOT || path.resolve(SITE, '..', '..')).replace(/\\/g, '/');
|
||||
const SD = GAMES + '/spooky-doors/server';
|
||||
const PH = GAMES + '/polhunter/lib';
|
||||
const PORT = Number(process.env.GP_PORT || 8798);
|
||||
const B = 'http://127.0.0.1:' + PORT;
|
||||
const SDS = crypto.randomBytes(24).toString('hex'), HUNT = crypto.randomBytes(24).toString('hex');
|
||||
const ADMIN = 'localtest', ADMIN_EMAIL = 'qa-admin@example.com';
|
||||
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'iap-gpint-')); fs.mkdirSync(path.join(DATA, 'uploads'));
|
||||
const SDDATA = fs.mkdtempSync(path.join(os.tmpdir(), 'sd-gpint-'));
|
||||
const PHDATA = fs.mkdtempSync(path.join(os.tmpdir(), 'ph-gpint-'));
|
||||
let fails = 0; const ok = (c, label, extra) => { console.log((c ? 'PASS ' : 'FAIL ') + label + (extra ? ' ' + extra : '')); if (!c) fails++; };
|
||||
const near = (a, b, tol) => Math.abs(Number(a) - Number(b)) <= (tol || 1e-6);
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||
const ctDay = t => new Date(t).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' });
|
||||
|
||||
const srv = spawn(process.execPath, ['server.js'], { cwd: SITE, stdio: ['ignore', 'pipe', 'pipe'],
|
||||
env: Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, NODE_ENV: 'development', ADMIN_EMAIL, ADMIN_PASSWORD: ADMIN, SD_SSO_SECRET: SDS, HUNT_SSO_SECRET: HUNT, DEV_POL_USD: '0.10' }) });
|
||||
let srvLog = ''; srv.stdout.on('data', d => srvLog += d); srv.stderr.on('data', d => srvLog += d);
|
||||
const cleanup = () => { try { srv.kill(); } catch (e) {} for (const d of [DATA, SDDATA, PHDATA]) { try { fs.rmSync(d, { recursive: true, force: true }); } catch (e) {} } };
|
||||
|
||||
async function api(p, o, headers) {
|
||||
const opts = { method: (o && o.method) || (o && 'data' in o ? 'POST' : 'GET'), headers: Object.assign({ 'Content-Type': 'application/json' }, headers || {}) };
|
||||
if (o && 'data' in o) opts.body = JSON.stringify(o.data);
|
||||
const r = await fetch(B + p, opts); let j = null; try { j = await r.json(); } catch (e) {}
|
||||
return { status: r.status, j, headers: r.headers };
|
||||
}
|
||||
const adminH = { Authorization: 'Bearer ' + ADMIN };
|
||||
// harness-side signed GET of the player card (to READ caps; the client's fetchPass caches 10 min and only returns the pass)
|
||||
async function rawPlayer(secret, game, email, devDay) {
|
||||
const ts = String(Date.now()); const sig = crypto.createHmac('sha256', secret).update('player:' + email + ':' + ts).digest('hex');
|
||||
const q = Object.assign({ game, m: 0, e: email, ts, sig }, devDay ? { devDay } : {});
|
||||
const r = await fetch(B + '/api/partner/player?' + new URLSearchParams(q)); let j = null; try { j = await r.json(); } catch (e) {} return { status: r.status, j };
|
||||
}
|
||||
|
||||
(async () => {
|
||||
try {
|
||||
for (let i = 0; i < 40; i++) { try { if ((await fetch(B + '/api/config')).ok) break; } catch (e) {} await sleep(500); }
|
||||
async function signIn(email, username) {
|
||||
const s = await api('/api/auth/email/start', { data: { email, fts: Date.now() - 5000 } });
|
||||
const v = await fetch(B + '/api/auth/email/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, code: s.j && s.j.devCode }) });
|
||||
const cookie = (v.headers.getSetCookie ? v.headers.getSetCookie() : [v.headers.get('set-cookie')]).map(c => String(c).split(';')[0]).join('; ');
|
||||
if (username) await api('/api/my/profile', { data: { username } }, { Cookie: cookie });
|
||||
return { Cookie: cookie };
|
||||
}
|
||||
await api('/api/admin/site', { method: 'PATCH', data: { fraudMaxSignupsPerIpDay: 10, gamePassEnabled: '1', capsStartDate: '2026-01-01' } }, adminH);
|
||||
const F = 'qa-int-free@example.com', P = 'qa-int-pass@example.com';
|
||||
const hF = await signIn(F, 'qaintfree'), hP = await signIn(P, 'qaintpass');
|
||||
// the pass holder: buy (charge stubbed, local only) -> active 7 days
|
||||
let r = await api('/api/my/gamepass/buy', { data: { devPaid: true } }, hP);
|
||||
ok(r.status === 200 && r.j.ok && r.j.active === true, 'setup: P buys the pass (devPaid) -> active', new Date(r.j.until).toISOString());
|
||||
const untilP = r.j.until;
|
||||
// the pass holder links a wallet through the real challenge/verify flow (signed locally with ethers) so tournament.js has somewhere to pay
|
||||
const { ethers } = require(SITE + '/node_modules/ethers');
|
||||
const w = ethers.Wallet.createRandom();
|
||||
const ch = await api('/api/auth/challenge', { data: { address: w.address } });
|
||||
const sigm = await w.signMessage(ch.j.message);
|
||||
const lv = await api('/api/auth/verify', { data: { address: w.address, signature: sigm } }, hP);
|
||||
ok(lv.status === 200 && lv.j.linked === true && lv.j.address === w.address.toLowerCase(), 'setup: P links a wallet via /api/auth/challenge + /verify', JSON.stringify(lv.j));
|
||||
const walletP = w.address.toLowerCase();
|
||||
|
||||
// ---- the REAL games' client, configured the way spooky-doors/server/server.js does (line 17-28) ----
|
||||
process.env.GAMEPASS = 'on'; process.env.IAP_URL = B; process.env.SD_SSO_SECRET = SDS;
|
||||
const sdStore = require(SD + '/store.js'); sdStore.init(SDDATA);
|
||||
const gp = require(SD + '/polgrant.js');
|
||||
const SECRET = String(process.env.SD_SSO_SECRET || '').trim(); const IAP = String(process.env.IAP_URL || 'https://instantadpay.com').replace(/\/+$/, '');
|
||||
const notes = []; gp.use({ game: 'spookydoors', secret: SECRET, iap: IAP, store: sdStore, notify: (k, p) => notes.push([k, p]) });
|
||||
ok(gp.on() && gp._cfg().iap === B && gp._cfg().game === 'spookydoors', 'client: GAMEPASS=on, IAP_URL honoured, slug spookydoors', gp._cfg().iap);
|
||||
// next-Central-day plumbing: the client has no devDay field, so (only while fakeDay is set) the already-built POST body gets
|
||||
// devDay added and is re-signed with the same secret; every "today" call goes through the client untouched
|
||||
let fakeDay = null; const realFetch = globalThis.fetch;
|
||||
gp.use({ fetch: (u, o) => { if (fakeDay && o && o.method === 'POST' && o.body) { const b = JSON.parse(o.body); b.devDay = fakeDay; const raw = JSON.stringify(b); const ts = o.headers['X-Game-Ts']; o = Object.assign({}, o, { body: raw, headers: Object.assign({}, o.headers, { 'X-Game-Sig': crypto.createHmac('sha256', SECRET).update(ts + '\n' + raw).digest('hex') }) }); } return realFetch(u, o); } });
|
||||
|
||||
// 1. fetchPass: free member vs pass holder
|
||||
let pf = await gp.fetchPass(0, F); ok(pf.active === false && pf.until === null, 'fetchPass(free) -> active false', JSON.stringify(pf));
|
||||
let pp = await gp.fetchPass(0, P); ok(pp.active === true && pp.until === untilP, 'fetchPass(pass holder) -> active true, until = IAP until', JSON.stringify(pp));
|
||||
let vw = gp.view(0, P); ok(vw.on === true && vw.active === true && vw.untilText && vw.url === 'https://instantadpay.com/my#games?pass=1', 'view(P) for the lobby', JSON.stringify(vw));
|
||||
|
||||
// 2. daily within / over the cap (free caps 0.30 / 2.0, enforced since capsStartDate 2026-01-01)
|
||||
const today = ctDay(Date.now());
|
||||
let g = await gp.grant({ memberId: 0, email: F, kind: 'daily', pol: 0.2, ref: 'it:d1' });
|
||||
ok(g.retry === false && g.allowed === 0.2 && g.deferred === 0 && g.carried === 0 && g.pass === false && g.enforced === true && g.capHit === null && g.day === today, 'daily 0.2 within cap -> allowed 0.2, enforced, day = Central today', JSON.stringify(g));
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'daily', pol: 0.2, ref: 'it:d2' });
|
||||
ok(g.retry === false && g.allowed === 0.1 && g.capHit === 'daily' && g.deferred === 0, 'daily 0.2 over cap -> allowed 0.1, capHit daily, nothing deferred', JSON.stringify(g));
|
||||
ok(gp.note(g, 'daily', 0.2) === 'Daily cap reached for today. Get the Pass for a higher cap.', 'note() for the capped free daily', gp.note(g, 'daily', 0.2));
|
||||
// 3. progress over the total cap -> deferred
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'progress', pol: 5, ref: 'rung:7' });
|
||||
ok(g.retry === false && g.allowed === 1.7 && g.deferred === 3.3 && g.capHit === 'total', 'progress 5 -> allowed 1.7 (2.0 total minus 0.3 daily), 3.3 deferred', JSON.stringify(g));
|
||||
ok(gp.note(g, 'progress', 5) === '3.3 POL is yours; it pays out over the next days (daily cap).', 'note() for the deferred progress', gp.note(g, 'progress', 5));
|
||||
let pl = await rawPlayer(SDS, 'spookydoors', F); ok(pl.j.caps.used.daily === 0.3 && pl.j.caps.used.total === 2 && pl.j.caps.pending === 3.3, 'IAP caps today: used 0.30 / 2.0, 3.3 pending for spookydoors', JSON.stringify(pl.j.caps));
|
||||
// 4. the carrySweep-style zero-POL call on the NEXT Central day (pol.js carrySweep: kind progress, pol 0, ref carry:<day>)
|
||||
const day2 = ctDay(Date.now() + 86400000), day3 = ctDay(Date.now() + 2 * 86400000);
|
||||
fakeDay = day2;
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'progress', pol: 0, ref: 'carry:' + day2 });
|
||||
ok(g.retry === false && g.allowed === 2 && g.carried === 2 && g.deferred === 0 && g.day === day2, 'NEXT day carry (pol 0) -> accepted, allowed 2.0, carried 2.0 (not rejected)', JSON.stringify(g));
|
||||
const g2 = await gp.grant({ memberId: 0, email: F, kind: 'progress', pol: 0, ref: 'carry:' + day2 });
|
||||
ok(g2.retry === false && g2.repeat === true && g2.allowed === 2 && g2.carried === 2, 'the same carry ref again -> repeat true, same answer (idempotent)', JSON.stringify(g2));
|
||||
pl = await rawPlayer(SDS, 'spookydoors', F, day2); ok(pl.j.caps.used.total === 2 && pl.j.caps.pending === 1.3, 'IAP caps on day 2: total 2.0 used (all carried), 1.3 still pending', JSON.stringify(pl.j.caps));
|
||||
fakeDay = day3;
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'progress', pol: 0, ref: 'carry:' + day3 });
|
||||
ok(g.retry === false && g.allowed === 1.3 && g.carried === 1.3 && g.day === day3, 'day 3 carry -> the last 1.3', JSON.stringify(g));
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'progress', pol: 0, ref: 'carry:x:' + day3 });
|
||||
ok(g.retry === false && g.allowed === 0 && g.carried === 0 && g.deferred === 0, 'a carry call with nothing owed -> allowed 0, no error, not retry', JSON.stringify(g));
|
||||
fakeDay = null;
|
||||
// 5. void: the ref's own share comes back (today's daily 0.2), so a new daily grant fits again
|
||||
let vd = await gp.voidGrant({ memberId: 0, email: F, ref: 'it:d1' }); ok(vd.ok === true, 'voidGrant(it:d1) -> ok', JSON.stringify(vd));
|
||||
pl = await rawPlayer(SDS, 'spookydoors', F); ok(pl.j.caps.used.daily === 0.1 && pl.j.caps.used.total === 1.8, 'IAP caps today after the void: daily 0.1, total 1.8', JSON.stringify(pl.j.caps));
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'daily', pol: 0.2, ref: 'it:d3' });
|
||||
ok(g.allowed === 0.2 && g.capHit === null, 'daily 0.2 after the void -> allowed 0.2', JSON.stringify(g));
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'daily', pol: 0.2, ref: 'it:d1' });
|
||||
ok(g.repeat === true && g.allowed === 0, 'replaying the voided ref -> repeat, allowed 0', JSON.stringify(g));
|
||||
// pass holder: pass caps apply
|
||||
g = await gp.grant({ memberId: 0, email: P, kind: 'daily', pol: 1.0, ref: 'p:d1' });
|
||||
ok(g.allowed === 1 && g.pass === true && g.capHit === null, 'pass holder daily 1.0 -> allowed 1.0, pass true', JSON.stringify(g));
|
||||
ok(gp.passOf(0, P).active === true, 'the grant answer refreshed the cached pass flag', JSON.stringify(gp.passOf(0, P)));
|
||||
// 6. failure modes: bad secret / IAP down / unknown member -> the client answers { allowed: 0, retry: true }
|
||||
gp.use({ secret: crypto.randomBytes(24).toString('hex') });
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'daily', pol: 0.1, ref: 'bad:1' });
|
||||
ok(g.allowed === 0 && g.retry === true && /401/.test(g.error), 'bad secret -> { allowed: 0, retry: true } (IAP 401)', JSON.stringify(g));
|
||||
gp.use({ secret: SECRET, iap: 'http://127.0.0.1:1' });
|
||||
g = await gp.grant({ memberId: 0, email: F, kind: 'daily', pol: 0.1, ref: 'down:1' });
|
||||
ok(g.allowed === 0 && g.retry === true, 'IAP down -> { allowed: 0, retry: true }', JSON.stringify(g));
|
||||
// the retry queue pays once IAP is back
|
||||
gp.enqueue({ memberId: 0, email: F, kind: 'daily', pol: 0.1, ref: 'down:1' });
|
||||
ok(gp.queued(0, F, 'down:1') === true, 'enqueue -> queued() guards the ref', '');
|
||||
let rt = await gp.retry(() => {}, Date.now() + gp.RETRY_MS + 1); ok(rt.tried === 1 && rt.paid === 0 && gp.queued(0, F, 'down:1'), 'retry while IAP is down -> still queued', JSON.stringify(rt));
|
||||
gp.use({ iap: B });
|
||||
let paidItems = []; rt = await gp.retry((item, resp) => paidItems.push([item.ref, resp.allowed, resp.capHit]), Date.now() + 2 * gp.RETRY_MS + 2);
|
||||
ok(rt.tried === 1 && rt.paid === 1 && paidItems.length === 1 && paidItems[0][1] === 0 && paidItems[0][2] === 'daily' && !gp.queued(0, F, 'down:1'), 'retry once IAP is back -> settled (allowed 0: F already used today\'s 0.30 daily cap), dequeued', JSON.stringify(rt) + ' ' + JSON.stringify(paidItems));
|
||||
g = await gp.grant({ memberId: 0, email: 'nobody-here@example.com', kind: 'daily', pol: 0.1, ref: 'nb:1' });
|
||||
ok(g.allowed === 0 && g.retry === true && /404/.test(g.error), 'unknown member -> retry: true (IAP 404; the game would queue it 48 h) [observation]', JSON.stringify(g));
|
||||
// 7. the tournament: P plays in the week of Oct 19 and buys again that week (a sale), then admin settles the week
|
||||
fakeDay = '2026-10-20';
|
||||
g = await gp.grant({ memberId: 0, email: P, kind: 'daily', pol: 0.1, ref: 'wk:1' }); ok(g.allowed === 0.1, 'P plays (Oct 20) #1', JSON.stringify(g));
|
||||
g = await gp.grant({ memberId: 0, email: P, kind: 'progress', pol: 0.1, ref: 'wk:2' }); ok(g.allowed === 0.1, 'P plays (Oct 20) #2', JSON.stringify(g));
|
||||
fakeDay = null;
|
||||
r = await api('/api/my/gamepass/buy', { data: { devPaid: true, devDay: '2026-10-20' } }, hP); ok(r.j.ok, 'P buys again stamped Oct 20 (a sale in the week of Oct 19)', '');
|
||||
let t = await api('/api/admin/gamepass/tournament/run', { data: { week: '2026-10-21' } }, adminH);
|
||||
ok(t.status === 200 && t.j.week === '2026-10-19' && t.j.winners.length === 1 && t.j.winners[0].email === P && near(t.j.winners[0].pol, 1.25) && t.j.winners[0].wallet === walletP, 'tournament settled: P #1, 1.25 POL, wallet set', JSON.stringify(t.j.winners));
|
||||
|
||||
// ---- PolHunter's payer: lib/tournament.js with its own store + polgrant copy, configured like polhunter/server.js line 50-61 ----
|
||||
process.env.HUNT_SSO_SECRET = HUNT;
|
||||
const phStore = require(PH + '/store.js'); phStore.init(PHDATA);
|
||||
const gph = require(PH + '/polgrant.js');
|
||||
const phNotes = []; gph.use({ game: 'polhunter', secret: String(process.env.HUNT_SSO_SECRET || '').trim(), iap: String(process.env.IAP_URL || '').replace(/\/+$/, ''), store: phStore, notify: (k, p) => phNotes.push([k, p]) });
|
||||
let dryFn; try { dryFn = require(PH + '/faucet.js').dry; } catch (e) { console.log(' (faucet.js not requirable here: ' + e.message.slice(0, 80) + '; using the same HUNT_DRY_RUN rule)'); dryFn = () => String(process.env.HUNT_DRY_RUN || 'off').trim().toLowerCase() !== 'off'; }
|
||||
const tournament = require(PH + '/tournament.js');
|
||||
const sends = []; const TX = '0x' + crypto.randomBytes(32).toString('hex');
|
||||
const faucet = { address: () => '0x' + '1'.repeat(40), balance: async () => 50, send: async (to, pol, onHash) => { sends.push({ to, pol }); if (onHash) await onHash(TX); return { tx: TX, ok: true }; } };
|
||||
tournament.init({ faucet, notify: (k, p) => phNotes.push([k, p]), dry: dryFn });
|
||||
const tp = await gph.tournamentPending();
|
||||
ok(tp.ok === true && tp.rows.length === 1 && tp.rows[0].email === P && tp.rows[0].week === '2026-10-19' && tp.rows[0].place === 1 && tp.rows[0].wallet === walletP && near(tp.rows[0].pol, 1.25), 'client tournamentPending() sees the 1 unpaid row', JSON.stringify(tp));
|
||||
process.env.HUNT_DRY_RUN = 'on';
|
||||
let st = await tournament.run();
|
||||
ok(st.on === true && st.dry === true && st.pending === 1 && near(st.wouldPay, 1.25) && st.paid === 0 && sends.length === 0, 'HUNT_DRY_RUN=on: run() lists the row as wouldPay 1.25, sends nothing', JSON.stringify(st));
|
||||
let cl = phStore.read('tourney-claims', {}); ok(cl['wk:2026-10-19:1'] && cl['wk:2026-10-19:1'].dry === true, 'dry claim recorded in tourney-claims', JSON.stringify(cl));
|
||||
process.env.HUNT_DRY_RUN = 'off';
|
||||
st = await tournament.run();
|
||||
ok(st.dry === false && st.paid === 0 && st.skipped === 1 && sends.length === 0, 'dry OFF with the dry claim still there: the row is SKIPPED, never paid (games-side trap: a dry-run claim is permanent)', JSON.stringify(st));
|
||||
phStore.write('tourney-claims', {}); // a fresh volume (what a real deploy without a dry run looks like)
|
||||
st = await tournament.run();
|
||||
ok(st.paid === 1 && st.acked === 1 && st.failures.length === 0 && sends.length === 1 && sends[0].to === walletP && near(sends[0].pol, 1.25), 'dry OFF, fresh claims: faucet.send(wallet, 1.25) + POST /paid acked', JSON.stringify(st) + ' ' + JSON.stringify(sends));
|
||||
cl = phStore.read('tourney-claims', {}); ok(cl['wk:2026-10-19:1'] && cl['wk:2026-10-19:1'].tx === TX && cl['wk:2026-10-19:1'].acked, 'claim carries the tx + acked', JSON.stringify(cl['wk:2026-10-19:1']));
|
||||
ok(phNotes.some(n => n[0] === 'tourneypaid'), 'notify(tourneypaid) fired', phNotes.map(n => n[0]).join(','));
|
||||
let pend = await api('/api/partner/tournament/pending', null, adminH); ok(pend.j.pending.length === 0, 'IAP pending is empty after the payout', JSON.stringify(pend.j));
|
||||
st = await tournament.run(); ok(st.pending === 0 && st.paid === 0 && sends.length === 1, 'next run: nothing pending, nothing re-sent', JSON.stringify(st));
|
||||
const tstate = tournament.state(); ok(tstate.paidTotal === 1 && tstate.recent.length >= 3, 'tournament.state() for the admin: paidTotal 1', JSON.stringify({ paidTotal: tstate.paidTotal, runs: tstate.recent.length }));
|
||||
ok(/gamepass prize paid 2026-10-19 #1 by polhunter/.test(srvLog), 'IAP logged the prize as paid by polhunter', '');
|
||||
} catch (e) { console.error('FAIL harness error', e && e.stack || e); fails++; }
|
||||
finally { cleanup(); }
|
||||
if (fails) console.log('--- server log (gamepass lines) ---\n' + srvLog.split('\n').filter(l => /gamepass|Error|error/.test(l)).slice(-30).join('\n'));
|
||||
console.log(fails ? fails + ' FAILURE(S)' : 'ALL PASS');
|
||||
process.exit(fails ? 1 : 0);
|
||||
})();
|
||||
+215
@@ -0,0 +1,215 @@
|
||||
// Game Pass + account-wide POL caps, end to end against a LOCAL copy (2026-10-16, docs/GAME-PASS.md).
|
||||
// node qa/gamepass.mjs (or: bash qa/run.sh gamepass)
|
||||
// Boots server.js on its own port with a throwaway DATA_DIR (JSON store, no DB, no mail key, devCode sign-in) and throwaway game
|
||||
// secrets. Nothing touches production. Covers: settings on/off; buy without purchased credits -> waiting order -> a $5 package
|
||||
// fulfils it; buy -> active, buy again -> extended (the charge is stubbed with devPaid, the real ads.gamePurchase(purchasedOnly)
|
||||
// path needs a position with on-chain credits and is the live PolyWarriors mint path); partner auth (bad sig / stale / unknown game);
|
||||
// /api/partner/player pass + caps; polgrant before capsStartDate (allowed, recorded); daily within/over the cap; progress deferral
|
||||
// and carry-forward on the next day (the Central day is faked with devDay); caps account-wide across games; idempotent ref; void;
|
||||
// pass expiry back to free caps; the tournament settle + pending + paid seam; admin stats. Exit code 1 on any failure.
|
||||
import crypto from 'node:crypto';
|
||||
import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { spawn } from 'node:child_process';
|
||||
|
||||
const SITE = path.resolve(path.dirname(new URL(import.meta.url).pathname.replace(/^\/([A-Za-z]:)/, '$1')), '..');
|
||||
const PORT = Number(process.env.GP_PORT || 8799);
|
||||
const B = 'http://127.0.0.1:' + PORT;
|
||||
const GK = crypto.randomBytes(24).toString('hex'), HUNT = crypto.randomBytes(24).toString('hex'); // throwaway, never printed
|
||||
const ADMIN = 'localtest', ADMIN_EMAIL = 'qa-admin@example.com';
|
||||
const DATA = fs.mkdtempSync(path.join(os.tmpdir(), 'iap-gamepass-')); fs.mkdirSync(path.join(DATA, 'uploads'));
|
||||
let fails = 0; const ok = (cond, label, extra) => { console.log((cond ? 'PASS ' : 'FAIL ') + label + (extra ? ' ' + extra : '')); if (!cond) fails++; };
|
||||
const near = (a, b, tol) => Math.abs(Number(a) - Number(b)) <= (tol || 1e-6);
|
||||
const sleep = ms => new Promise(r => setTimeout(r, ms));
|
||||
|
||||
const srv = spawn(process.execPath, ['server.js'], { cwd: SITE, stdio: ['ignore', 'pipe', 'pipe'],
|
||||
env: Object.assign({}, process.env, { PORT: String(PORT), DATA_DIR: DATA, NODE_ENV: 'development', ADMIN_EMAIL, ADMIN_PASSWORD: ADMIN, GK_SSO_SECRET: GK, HUNT_SSO_SECRET: HUNT, DEV_POL_USD: '0.10' }) });
|
||||
let srvLog = ''; srv.stdout.on('data', d => srvLog += d); srv.stderr.on('data', d => srvLog += d);
|
||||
const cleanup = () => { try { srv.kill(); } catch (e) {} try { fs.rmSync(DATA, { recursive: true, force: true }); } catch (e) {} };
|
||||
|
||||
async function api(p, o, headers) {
|
||||
const opts = { method: (o && o.method) || (o && 'data' in o ? 'POST' : 'GET'), headers: Object.assign({ 'Content-Type': 'application/json' }, headers || {}) };
|
||||
if (o && 'data' in o) opts.body = JSON.stringify(o.data);
|
||||
const r = await fetch(B + p, opts); let j = null; try { j = await r.json(); } catch (e) {}
|
||||
return { status: r.status, j, headers: r.headers };
|
||||
}
|
||||
const adminH = { Authorization: 'Bearer ' + ADMIN };
|
||||
// a game's signed POST (3a): X-Game-Ts + X-Game-Sig = HMAC(secret, ts + '\n' + rawBody)
|
||||
async function gamePost(p, body, secret, tsOverride) {
|
||||
const raw = JSON.stringify(body); const ts = tsOverride || String(Date.now());
|
||||
const sig = crypto.createHmac('sha256', secret).update(ts + '\n' + raw).digest('hex');
|
||||
const r = await fetch(B + p, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-Game-Ts': ts, 'X-Game-Sig': sig }, body: raw });
|
||||
let j = null; try { j = await r.json(); } catch (e) {} return { status: r.status, j };
|
||||
}
|
||||
// a game's signed GET (3a): sig = HMAC(secret, 'player:' + who + ':' + ts)
|
||||
async function gameGet(p, q, who, secret) {
|
||||
const ts = String(Date.now()); const sig = crypto.createHmac('sha256', secret).update('player:' + who + ':' + ts).digest('hex');
|
||||
const r = await fetch(B + p + '?' + new URLSearchParams(Object.assign({}, q, { ts, sig })).toString()); let j = null; try { j = await r.json(); } catch (e) {} return { status: r.status, j };
|
||||
}
|
||||
const grant = (o, secret, tsOverride) => gamePost('/api/partner/polgrant', o, secret || GK, tsOverride);
|
||||
|
||||
try {
|
||||
for (let i = 0; i < 40; i++) { try { if ((await fetch(B + '/api/config')).ok) break; } catch (e) {} await sleep(500); }
|
||||
async function signIn(email, username) {
|
||||
const s = await api('/api/auth/email/start', { data: { email, fts: Date.now() - 5000 } });
|
||||
const v = await fetch(B + '/api/auth/email/verify', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ email, code: s.j && s.j.devCode }) });
|
||||
const cookie = (v.headers.getSetCookie ? v.headers.getSetCookie() : [v.headers.get('set-cookie')]).map(c => String(c).split(';')[0]).join('; ');
|
||||
if (username) await api('/api/my/profile', { data: { username } }, { Cookie: cookie });
|
||||
return { Cookie: cookie };
|
||||
}
|
||||
await api('/api/admin/site', { method: 'PATCH', data: { fraudMaxSignupsPerIpDay: 10 } }, adminH);
|
||||
const A = 'qa-gp-a@example.com', Bm = 'qa-gp-b@example.com', C = 'qa-gp-c@example.com';
|
||||
const hA = await signIn(A, 'qagpa'), hB = await signIn(Bm, 'qagpb'), hC = await signIn(C, 'qagpc');
|
||||
|
||||
// 1. settings: off by default, member GET says so, buy refused
|
||||
let g = (await api('/api/my/gamepass', null, hA)).j;
|
||||
ok(g && g.enabled === false && g.active === false && g.price === 500 && g.days === 7, 'GET /api/my/gamepass with the pass OFF: enabled false, price 500, days 7', JSON.stringify(g));
|
||||
let r = await api('/api/my/gamepass/buy', { data: {} }, hA);
|
||||
ok(r.status === 400 && /not open/.test(r.j && r.j.error || ''), 'buy refused while the pass is off', JSON.stringify(r.j));
|
||||
await api('/api/admin/site', { method: 'PATCH', data: { gamePassEnabled: '1', capsStartDate: '' } }, adminH);
|
||||
g = (await api('/api/my/gamepass', null, hA)).j;
|
||||
ok(g && g.enabled === true && g.caps && g.caps.enforced === false && g.caps.daily === 0.3 && g.caps.total === 2, 'pass ON: GET shows free caps 0.30 / 2 and enforced false (no capsStartDate)', JSON.stringify(g.caps));
|
||||
|
||||
// 2. buy without purchased credits -> waiting order; a $5 package fulfils it
|
||||
r = await api('/api/my/gamepass/buy', { data: {} }, hA);
|
||||
ok(r.status === 200 && r.j && r.j.needPay === true && r.j.payUrl === '/my?from=gamepass#buy' && r.j.order, 'buy with no purchased credits -> needPay + payUrl + waiting order', JSON.stringify(r.j && { needPay: r.j.needPay, payUrl: r.j.payUrl, need: r.j.need }));
|
||||
const order1 = r.j && r.j.order;
|
||||
r = await api('/api/my/gamepass/buy', { data: {} }, hA);
|
||||
ok(r.j && r.j.order === order1, 'a second buy attempt reuses the same waiting order', r.j && r.j.order);
|
||||
g = (await api('/api/my/gamepass', null, hA)).j; ok(g.waiting === true && g.active === false, 'GET shows waiting: true', '');
|
||||
r = await api('/api/dev/gamepass-purchase', { data: { email: A, cents: 500 } });
|
||||
ok(r.j && r.j.order && r.j.order.order === order1, 'a $5 package purchase event fulfils the waiting order', JSON.stringify(r.j));
|
||||
g = (await api('/api/my/gamepass', null, hA)).j; const until1 = g.until;
|
||||
ok(g.active === true && g.waiting === false && near(g.until, Date.now() + 7 * 86400000, 60000) && g.bought === 1, 'pass active for 7 days, waiting cleared', new Date(g.until).toISOString());
|
||||
r = await api('/api/dev/gamepass-purchase', { data: { email: A, cents: 500 } });
|
||||
ok(r.j && r.j.order === null, 'another package with no waiting order does nothing', JSON.stringify(r.j));
|
||||
// 3. buy while active -> extends from the current until (charge stubbed: devPaid, local only)
|
||||
r = await api('/api/my/gamepass/buy', { data: { devPaid: true } }, hA);
|
||||
ok(r.status === 200 && r.j.ok && near(r.j.until, until1 + 7 * 86400000, 1000) && r.j.paid === 'credits', 'buy while active extends by 7 days from the current until', new Date(r.j.until).toISOString());
|
||||
r = await api('/api/my/gamepass/buy', { data: { devPaid: true, devDay: '2026-10-20' } }, hB);
|
||||
ok(r.status === 200 && r.j.ok && r.j.active === true, 'member B: buy -> active (sale stamped in the week of Oct 19 for the tournament)', '');
|
||||
|
||||
// 4. partner auth + /api/partner/player
|
||||
let pl = await gameGet('/api/partner/player', { game: 'gemkingdom', m: 0, e: A }, A, GK);
|
||||
ok(pl.status === 200 && pl.j.pass && pl.j.pass.active === true && pl.j.pass.until === until1 + 7 * 86400000 && pl.j.caps.daily === 1.5 && pl.j.caps.total === 5 && pl.j.caps.used.total === 0 && /^\d{4}-\d{2}-\d{2}$/.test(pl.j.caps.day), 'player (pass holder): pass.active, pass caps 1.50 / 5, used 0, Central day', JSON.stringify(pl.j.pass) + ' ' + JSON.stringify(pl.j.caps));
|
||||
pl = await gameGet('/api/partner/player', { game: 'gemkingdom', m: 0, e: C }, C, GK);
|
||||
ok(pl.status === 200 && pl.j.pass.active === false && pl.j.pass.until === null && pl.j.caps.daily === 0.3 && pl.j.caps.total === 2, 'player (free): pass false, free caps 0.30 / 2', JSON.stringify(pl.j.caps));
|
||||
pl = await gameGet('/api/partner/player', { game: 'gemkingdom', m: 0, e: C }, C, HUNT);
|
||||
ok(pl.status === 401, 'player signed with another game’s secret -> 401', String(pl.status));
|
||||
pl = await gameGet('/api/partner/player', { game: 'nosuchgame', m: 0, e: C }, C, GK);
|
||||
ok(pl.status === 400, 'unknown game -> 400', String(pl.status));
|
||||
pl = await gameGet('/api/partner/player', { game: 'spellwheel', m: 0, e: C }, C, GK);
|
||||
ok(pl.status === 503, 'a game with no secret configured -> 503', String(pl.status));
|
||||
let gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.1, ref: 'auth-stale' }, GK, String(Date.now() - 20 * 60000));
|
||||
ok(gr.status === 401 && /stale/.test(gr.j.error), 'polgrant with a 20-minute-old timestamp -> 401 stale', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.1, ref: 'auth-bad' }, HUNT);
|
||||
ok(gr.status === 401, 'polgrant signed with the wrong secret -> 401', String(gr.status));
|
||||
gr = await grant({ memberId: 0, email: 'nobody-here@example.com', game: 'gemkingdom', kind: 'daily', pol: 0.1, ref: 'x' });
|
||||
ok(gr.status === 404, 'polgrant for an unknown member -> 404', String(gr.status));
|
||||
|
||||
// 5. before capsStartDate: everything allowed, nothing deferred, usage recorded
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 1.0, ref: 'pre:1', devDay: '2026-10-19' });
|
||||
ok(gr.status === 200 && gr.j.allowed === 1 && gr.j.deferred === 0 && gr.j.pass === false && gr.j.enforced === false && gr.j.day === '2026-10-19', 'before capsStartDate: daily 1.0 -> allowed 1.0 (over the 0.30 free cap), enforced false', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'progress', pol: 5, ref: 'pre:boss', devDay: '2026-10-19' });
|
||||
ok(gr.j.allowed === 5 && gr.j.deferred === 0, 'before capsStartDate: progress 5 -> allowed 5, nothing deferred', JSON.stringify(gr.j));
|
||||
let st = (await api('/api/admin/gamepass/stats', null, adminH)).j;
|
||||
ok(st && st.enabled === true && st.settings.enforced === false, 'admin stats: enabled, caps not enforced', JSON.stringify(st.settings));
|
||||
|
||||
// 6. enforced: daily within / over the cap, idempotent ref, progress deferral
|
||||
await api('/api/admin/site', { method: 'PATCH', data: { capsStartDate: '2026-10-20' } }, adminH);
|
||||
const D1 = '2026-10-20', D2 = '2026-10-21', D3 = '2026-10-22';
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.2, ref: 'f1', devDay: D1 });
|
||||
ok(gr.j.allowed === 0.2 && gr.j.deferred === 0 && gr.j.enforced === true && gr.j.capHit === null, 'D1 daily 0.2 -> allowed 0.2', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.2, ref: 'f2', devDay: D1 });
|
||||
ok(gr.j.allowed === 0.1 && gr.j.deferred === 0 && gr.j.capHit === 'daily', 'D1 daily 0.2 -> allowed 0.1 (daily cap 0.30), the rest dropped, capHit daily', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.1, ref: 'f3', devDay: D1 });
|
||||
ok(gr.j.allowed === 0 && gr.j.deferred === 0 && gr.j.capHit === 'daily', 'D1 daily 0.1 at the cap -> allowed 0, nothing deferred', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.2, ref: 'f2', devDay: D2 });
|
||||
ok(gr.j.allowed === 0.1 && gr.j.repeat === true && gr.j.day === D1, 'same ref f2 again (even on another day) -> the same answer, nothing re-applied', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'progress', pol: 5, ref: 'boss:1', devDay: D1 });
|
||||
ok(gr.j.allowed === 1.7 && gr.j.deferred === 3.3 && gr.j.capHit === 'total', 'D1 progress 5 -> allowed 1.7 (total cap 2 minus 0.3 daily), 3.3 deferred', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'progress', pol: 0.5, ref: 'stage:2', devDay: D1 });
|
||||
ok(gr.j.allowed === 0 && gr.j.deferred === 0.5, 'D1 progress 0.5 with the total cap used -> all 0.5 deferred', JSON.stringify(gr.j));
|
||||
pl = await gameGet('/api/partner/player', { game: 'gemkingdom', m: 0, e: C, devDay: D1 }, C, GK);
|
||||
ok(pl.j.caps.used.daily === 0.3 && pl.j.caps.used.total === 2 && pl.j.caps.pending === 3.8 && pl.j.caps.enforced === true, 'player caps on D1: used 0.30 / 2.0, 3.8 POL pending for Gem Kingdom', JSON.stringify(pl.j.caps));
|
||||
// 7. carry-forward on the next day, inside the total cap, before the new grant
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'daily', pol: 0.1, ref: 'f4', devDay: D2 });
|
||||
ok(gr.j.allowed === 2 && gr.j.carried === 2 && gr.j.deferred === 0 && gr.j.capHit === 'total' && gr.j.day === D2, 'D2 daily 0.1 -> allowed 2.0 (2.0 carried from the boss fills the day), the 0.1 dropped', JSON.stringify(gr.j));
|
||||
pl = await gameGet('/api/partner/player', { game: 'gemkingdom', m: 0, e: C, devDay: D2 }, C, GK);
|
||||
ok(pl.j.caps.used.total === 2 && pl.j.caps.used.daily === 0 && pl.j.caps.pending === 1.8, 'D2 caps: total 2.0 used (all carried), 1.8 still pending', JSON.stringify(pl.j.caps));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'progress', pol: 0.3, ref: 'stage:3', devDay: D3 });
|
||||
ok(gr.j.allowed === 2 && gr.j.carried === 1.8 && gr.j.deferred === 0.1, 'D3 progress 0.3 -> 1.8 carried + 0.2 own = 2.0 allowed, 0.1 deferred', JSON.stringify(gr.j));
|
||||
// account-wide: another game on the same day sees the cap used
|
||||
gr = await grant({ memberId: 0, email: C, game: 'polhunter', kind: 'daily', pol: 0.3, ref: 'find:1', devDay: D3 }, HUNT);
|
||||
ok(gr.j.allowed === 0 && gr.j.capHit === 'total', 'D3 PolHunter daily 0.3 -> allowed 0: the cap is account-wide across games', JSON.stringify(gr.j));
|
||||
// 8. void: this ref's own share is reversed, the carry it triggered stays; a replay stays voided
|
||||
let vd = await gamePost('/api/partner/polgrant/void', { memberId: 0, email: C, game: 'gemkingdom', ref: 'stage:3' }, GK);
|
||||
ok(vd.status === 200 && vd.j.voided === true && vd.j.reversed.allowed === 0.2 && vd.j.reversed.deferred === 0.1, 'void stage:3 -> reversed 0.2 allowed + 0.1 deferred', JSON.stringify(vd.j));
|
||||
pl = await gameGet('/api/partner/player', { game: 'gemkingdom', m: 0, e: C, devDay: D3 }, C, GK);
|
||||
ok(pl.j.caps.used.total === 1.8 && pl.j.caps.pending === 0, 'D3 caps after the void: 1.8 used (the carry stays), nothing pending', JSON.stringify(pl.j.caps));
|
||||
gr = await grant({ memberId: 0, email: C, game: 'gemkingdom', kind: 'progress', pol: 0.3, ref: 'stage:3', devDay: D3 });
|
||||
ok(gr.j.allowed === 0 && gr.j.repeat === true && gr.j.voided === true, 'replaying a voided ref -> allowed 0, voided', JSON.stringify(gr.j));
|
||||
vd = await gamePost('/api/partner/polgrant/void', { memberId: 0, email: C, game: 'gemkingdom', ref: 'never-granted' }, GK);
|
||||
ok(vd.j.ok === true && vd.j.unknown === true, 'voiding an unknown ref is harmless', JSON.stringify(vd.j));
|
||||
// the Overview nudge source: the free player's last cap hit
|
||||
g = (await api('/api/my/gamepass', null, hC)).j;
|
||||
ok(g.lastCapHit && g.lastCapHit.game === 'polhunter' && g.lastCapHit.kind === 'total' && g.lastCapHit.pass === false, 'member GET carries lastCapHit for the Overview nudge', JSON.stringify(g.lastCapHit));
|
||||
|
||||
// 9. a pass holder gets the pass caps; after expiry the free caps are back
|
||||
gr = await grant({ memberId: 0, email: A, game: 'gemkingdom', kind: 'daily', pol: 1.0, ref: 'a:f1', devDay: D1 });
|
||||
ok(gr.j.allowed === 1 && gr.j.pass === true && gr.j.capHit === null, 'pass holder: daily 1.0 -> allowed 1.0 (pass daily cap 1.50)', JSON.stringify(gr.j));
|
||||
gr = await grant({ memberId: 0, email: A, game: 'gemkingdom', kind: 'daily', pol: 1.0, ref: 'a:f2', devDay: D1 });
|
||||
ok(gr.j.allowed === 0.5 && gr.j.capHit === 'daily', 'pass holder: second daily 1.0 -> allowed 0.5 (1.50 reached)', JSON.stringify(gr.j));
|
||||
g = (await api('/api/my/gamepass?devDay=2026-12-01', null, hA)).j;
|
||||
ok(g.active === false && g.caps.daily === 0.3, 'after expiry (faked Dec 1): active false, free caps', JSON.stringify(g.caps));
|
||||
gr = await grant({ memberId: 0, email: A, game: 'gemkingdom', kind: 'daily', pol: 1.0, ref: 'a:dec', devDay: '2026-12-01' });
|
||||
ok(gr.j.allowed === 0.3 && gr.j.pass === false, 'after expiry: daily 1.0 -> allowed 0.30, pass false', JSON.stringify(gr.j));
|
||||
|
||||
// 10. tournament: the week of Oct 19 (A played, B bought); 5% of $5 = $0.25 at $0.10/POL = 2.5 POL pool, 50% to #1
|
||||
let t = await api('/api/admin/gamepass/tournament/run', { data: { week: '2026-10-21' } }, adminH);
|
||||
ok(t.status === 200 && t.j.week === '2026-10-19' && t.j.sales === 1 && near(t.j.poolPol, 2.5) && t.j.winners.length === 1 && t.j.winners[0].email === A && near(t.j.winners[0].pol, 1.25) && t.j.winners[0].score === 2, 'tournament week of Oct 19: 1 sale, pool 2.5 POL, A wins #1 with 2 plays -> 1.25 POL pending', JSON.stringify(t.j && { week: t.j.week, sales: t.j.sales, poolPol: t.j.poolPol, winners: t.j.winners.map(w => [w.email, w.score, w.pol, w.status]) }));
|
||||
t = await api('/api/admin/gamepass/tournament/run', { data: { week: '2026-10-21' } }, adminH);
|
||||
ok(t.j.winners && t.j.winners.length === 1 && t.j.ranAt, 'running the same week again returns the recorded row (no double prizes)', '');
|
||||
let pend = await api('/api/partner/tournament/pending', null, adminH);
|
||||
ok(pend.j.ok && pend.j.pending.length === 1 && pend.j.pending[0].place === 1 && near(pend.j.pending[0].pol, 1.25), 'GET /api/partner/tournament/pending (admin) lists the unpaid prize', JSON.stringify(pend.j.pending));
|
||||
pend = await gameGet('/api/partner/tournament/pending', { game: 'gemkingdom' }, 'tournament', GK);
|
||||
ok(pend.status === 200 && pend.j.pending.length === 1 && pend.j.pending[0].email === A && Array.isArray(pend.j.rows) && pend.j.rows.length === 1, 'a game can read the pending prizes with its signature (answer carries `rows`, the field the games\' polgrant.js reads)', '');
|
||||
let paid = await gamePost('/api/partner/tournament/paid', { game: 'gemkingdom', week: '2026-10-19', place: 1, tx: '0xabc123' }, GK);
|
||||
ok(paid.j.ok === true, 'a game marks the prize paid', JSON.stringify(paid.j));
|
||||
pend = await api('/api/partner/tournament/pending', null, adminH);
|
||||
ok(pend.j.pending.length === 0, 'pending is empty after the payout', '');
|
||||
const inbox = (await api('/api/my/messages', null, hA)).j;
|
||||
const stored = (() => { try { return JSON.parse(fs.readFileSync(path.join(DATA, 'sponsor-messages.json'), 'utf8')).items || []; } catch (e) { return []; } })().find(i => /Game Pass Tournament/.test(i.subject || ''));
|
||||
ok(inbox && JSON.stringify(inbox).includes('Game Pass Tournament') && stored && stored.kind === 'notice', 'the winner got an inbox message of kind notice (never a broadcast pop-up)', stored ? 'kind=' + stored.kind : 'not stored');
|
||||
|
||||
// 11. admin stats + comp
|
||||
st = (await api('/api/admin/gamepass/stats', null, adminH)).j;
|
||||
ok(st.passes.soldTotal === 3 && st.passes.active >= 2 && st.deferredQueue.entries === 0 && st.tournament.last && st.tournament.last.week === '2026-10-19' && typeof st.capHits.week.free.daily === 'number', 'admin stats: 3 passes sold, active >= 2, tournament recorded', JSON.stringify({ passes: st.passes, q: st.deferredQueue, hits: st.capHits.week }));
|
||||
r = await api('/api/admin/gamepass/comp', { data: { email: C, why: 'qa' } }, adminH);
|
||||
g = (await api('/api/my/gamepass', null, hC)).j;
|
||||
ok(r.j.ok && g.active === true && g.caps.daily === 1.5, 'admin comp gives C a pass week: caps now 1.50 / 5', JSON.stringify(g.caps));
|
||||
st = (await api('/api/admin/gamepass/stats', null, adminH)).j;
|
||||
ok(st.passes.soldTotal === 3 && st.passes.usdTotal === 15 && st.passes.comped === 1 && st.passes.active === 3, 'a comp is not a sale (soldTotal 3, $15, comped 1, active 3)', JSON.stringify(st.passes));
|
||||
|
||||
// 12. the hand-off token carries the flag
|
||||
const gkO = { Origin: 'https://gemkingdom.app' }; // the game's own origin, as its sign-in page sends it
|
||||
const hv = await api('/api/game/auth/start', { data: { email: A, game: 'gemkingdom', fts: Date.now() - 5000 } }, gkO);
|
||||
const vv = await api('/api/game/auth/verify', { data: { email: A, game: 'gemkingdom', code: hv.j && hv.j.devCode } }, gkO);
|
||||
if (!(vv.j && vv.j.token)) console.log(' game auth answer:', JSON.stringify(hv.j), JSON.stringify(vv.j));
|
||||
const tokenClaims = vv.j && vv.j.token ? JSON.parse(Buffer.from(String(vv.j.token).split('.')[0].replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('utf8')) : null;
|
||||
ok(tokenClaims && tokenClaims.gamePass && tokenClaims.gamePass.active === true && tokenClaims.gamePass.until === until1 + 7 * 86400000, 'in-game sign-in token carries gamePass { active, until }', JSON.stringify(tokenClaims && tokenClaims.gamePass));
|
||||
|
||||
// the ledger file on the volume (saves are debounced 500 ms)
|
||||
await sleep(1200);
|
||||
ok(fs.existsSync(path.join(DATA, 'gamepass-ledger.json')), 'cap ledger persisted to DATA_DIR/gamepass-ledger.json', fs.readdirSync(DATA).join(','));
|
||||
const ot = JSON.parse(fs.readFileSync(path.join(DATA, 'open-tokens.json'), 'utf8'));
|
||||
ok(ot.gamepass && ot.gamepass[A] && ot.gporders && ot.gpprizes && ot.gpprizes['2026-10-19'], 'pass store, orders and prizes persisted in the durable open-tokens store', Object.keys(ot).join(','));
|
||||
} catch (e) {
|
||||
console.error('FAIL harness error', e && e.stack || e); fails++;
|
||||
} finally {
|
||||
cleanup();
|
||||
}
|
||||
if (fails && /gamepass/i.test(srvLog)) console.log('--- server log (gamepass lines) ---\n' + srvLog.split('\n').filter(l => /gamepass|Error|error/.test(l)).slice(-30).join('\n'));
|
||||
console.log(fails ? fails + ' FAILURE(S)' : 'ALL PASS');
|
||||
process.exit(fails ? 1 : 0);
|
||||
@@ -5,6 +5,8 @@
|
||||
# bash qa/run.sh earn # local copy: earning flows end to end (~2-3 min)
|
||||
# bash qa/run.sh all # public + member + earn
|
||||
# bash qa/run.sh door # Spooky Doors door + costume shop flows on their own local copy (qa/door.mjs boots it)
|
||||
# bash qa/run.sh gamepass # Game Pass buy flow + account-wide POL caps (polgrant) on their own local copy (qa/gamepass.mjs boots it)
|
||||
# bash qa/run.sh gamepass-games # the REAL games' polgrant.js + PolHunter's tournament payer against a local copy (needs the sibling game repos)
|
||||
# Each local run boots server.js on its own port with a throwaway data dir (JSON store, no DB, no
|
||||
# mail key, devCode sign-in), so nothing touches production data. Reports land in qa/out/.
|
||||
set -u
|
||||
@@ -33,6 +35,10 @@ elif [ "$MODE" = "member" ]; then
|
||||
start_local 8796 && { LOCAL=http://127.0.0.1:8796 node qa/walk.mjs member || status=1; }; stop_local 8796
|
||||
elif [ "$MODE" = "door" ]; then
|
||||
node qa/door.mjs || status=1
|
||||
elif [ "$MODE" = "gamepass" ]; then
|
||||
node qa/gamepass.mjs || status=1
|
||||
elif [ "$MODE" = "gamepass-games" ]; then
|
||||
node qa/gamepass-games.cjs || status=1
|
||||
elif [ "$MODE" = "earn" ]; then
|
||||
start_local 8797 && { LOCAL=http://127.0.0.1:8797 node qa/earn.mjs || status=1; }; stop_local 8797
|
||||
else
|
||||
|
||||
+11
-1
@@ -115,6 +115,16 @@ if (MODE === 'member' || MODE === 'all') {
|
||||
await page.screenshot({ path: OUT + '/my-' + pn + '.png' }).catch(() => {});
|
||||
console.log('ok', label, 'subtabs:', subs.length);
|
||||
}
|
||||
// Game Pass card on the Games tab (2026-10-16): hidden while gamePassEnabled is off, rendered with its state and Buy button once on; /my#games?pass=1 highlights it
|
||||
await page.request.patch(LOCAL + '/api/admin/site', { headers: { Authorization: 'Bearer ' + (process.env.ADMIN_PASSWORD || 'localtest'), 'Content-Type': 'application/json' }, data: { gamePassEnabled: '1' } }).catch(() => {});
|
||||
await page.goto(LOCAL + '/my#games?pass=1', { waitUntil: 'networkidle' }); await page.waitForTimeout(1500); await hide(page);
|
||||
const gpVis = await page.evaluate(() => { const c = document.getElementById('gpCard'); return !!(c && !c.hidden && c.offsetHeight > 40 && /Game Pass/.test(c.textContent) && c.querySelector('#gpBuy, #gpGoBuy')); });
|
||||
if (!gpVis) note('bug', L + 'my#games/gamepass', 'Game Pass card did not render with gamePassEnabled on (deep link /my#games?pass=1)');
|
||||
else { await domChecks(page, L + 'my#games/gamepass'); console.log('ok Game Pass card'); }
|
||||
await page.request.patch(LOCAL + '/api/admin/site', { headers: { Authorization: 'Bearer ' + (process.env.ADMIN_PASSWORD || 'localtest'), 'Content-Type': 'application/json' }, data: { gamePassEnabled: '0' } }).catch(() => {});
|
||||
await page.goto(LOCAL + '/my#games'); await page.reload({ waitUntil: 'load' }); await page.waitForTimeout(2500); await hide(page); // a hash-only goto would not reload the card
|
||||
if (await page.evaluate(() => { const c = document.getElementById('gpCard'); return !!(c && !c.hidden); })) note('bug', L + 'my#games/gamepass', 'Game Pass card shows while gamePassEnabled is off');
|
||||
flush(bag, L + 'my#games/gamepass');
|
||||
await page.click('.bo-menu [data-pane="promo"]'); await page.waitForTimeout(800);
|
||||
if (!(await page.$$('#promoPosts .promo-block')).length) note('bug', L + 'promo', 'no post cards rendered');
|
||||
// viral links: the builder renders a ?ref= link; any page + ?ref=<member> redirects clean and sets the sponsor cookie; an unknown ref sets nothing
|
||||
@@ -144,7 +154,7 @@ if (MODE === 'member' || MODE === 'all') {
|
||||
// admin
|
||||
await page.goto(LOCAL + '/admin', { waitUntil: 'networkidle' });
|
||||
await page.fill('#adEmail', process.env.ADMIN_EMAIL || 'martybostick@gmail.com'); await page.click('#adSend'); await page.waitForSelector('#adVerify:not([hidden])'); await page.click('#adVerify'); await page.waitForTimeout(1200);
|
||||
for (const pn of ['overview', 'house', 'campaigns', 'members', 'reports', 'traffic', 'blog', 'releases', 'pnl', 'settings']) {
|
||||
for (const pn of ['overview', 'house', 'campaigns', 'members', 'reports', 'traffic', 'blog', 'releases', 'pnl', 'gamepass', 'settings']) {
|
||||
const label = L + 'admin#' + pn;
|
||||
await page.click('.bo-menu [data-pane="' + pn + '"]'); await page.waitForTimeout(1200);
|
||||
const vis = await page.evaluate(id => { const el = document.getElementById('pane-' + id); return el && !el.hidden && el.offsetHeight > 40; }, pn);
|
||||
|
||||
@@ -50,13 +50,15 @@ function videoNote(c) {
|
||||
}
|
||||
const key = (id, state) => id + ':' + state;
|
||||
|
||||
// the five packages and what each dollar buys, so the ladder is never hand-typed
|
||||
// the seven packages and what each dollar buys, so the ladder is never hand-typed
|
||||
const PACKS = [
|
||||
{ price: 5, credits: 500, bonus: 0 },
|
||||
{ price: 10, credits: 1000, bonus: 0 },
|
||||
{ price: 20, credits: 2000, bonus: 0 },
|
||||
{ price: 50, credits: 5500, bonus: 10 },
|
||||
{ price: 100, credits: 12000, bonus: 20 },
|
||||
{ price: 250, credits: 32500, bonus: 30 },
|
||||
{ price: 500, credits: 70000, bonus: 40 },
|
||||
];
|
||||
|
||||
function ladderText() {
|
||||
|
||||
@@ -45,6 +45,7 @@ const lssync = require('./lssync');
|
||||
const lsinbound = require('./lsinbound'); // reverse registry sync: LinkSpin-first members arrive as waiting accounts (2026-10-15)
|
||||
const gamestats = require('./gamestats');
|
||||
const marks = require('./marks');
|
||||
const gamepass = require('./gamepass'); // the $5 weekly Game Pass + the account-wide POL cap service the games call (2026-10-16)
|
||||
const feedgroup = require('./feedgroup'); // one proof-feed message per purchase: buyer, package, then the tier payouts // one-time claims shared across running instances (deploy overlap) // Google Safe Browsing screen on advertiser destinations
|
||||
const updates = require('./updates');
|
||||
const audit = require('./audit'); // counter audit: views vs delivery logs, charges vs shows (Marty, 2026-09-15) // member update emails from Admin > Releases (Marty, 2026-09-14)
|
||||
@@ -130,7 +131,7 @@ function loadOpenTokens() {
|
||||
const cutoff = Date.now() - 2 * 3600 * 1000; let n = 0;
|
||||
// durable maps are balances and orders, not short-lived tokens: restore every entry whatever its age. Before 2026-10-10 the
|
||||
// age filter silently dropped every PolyWarriors mint pass (no ts on the record) on each deploy; Orlando lost his.
|
||||
const DURABLE = new Set(['pwpasses', 'pwprizes', 'pworders', 'gkorders', 'sdorders']);
|
||||
const DURABLE = new Set(['pwpasses', 'pwprizes', 'pworders', 'gkorders', 'sdorders', 'gamepass', 'gporders', 'gpprizes']);
|
||||
for (const [name, m] of Object.entries(persistedMaps)) {
|
||||
for (const [k, v] of Object.entries(saved[name] || {})) if (v && (DURABLE.has(name) || Number(v.ts || 0) > cutoff)) { Map.prototype.set.call(m, k, v); n++; }
|
||||
}
|
||||
@@ -510,6 +511,7 @@ async function boot() {
|
||||
friday.onEvent(ev).catch(e => console.error('friday bonus', e.message));
|
||||
starter.onEvent(ev).catch(e => console.error('starter bonus', e.message));
|
||||
pwMintOnEvent(ev).catch(e => console.error('polywarriors mint', e.message));
|
||||
gamepass.onEvent(ev).catch(e => console.error('gamepass order', e.message));
|
||||
wednesday.onEvent(ev).catch(e => console.error('wednesday bonus', e.message));
|
||||
sponsorSyncOnEvent(ev).catch(e => console.error('sponsor sync', e.message));
|
||||
}).catch(e => console.error('marks claim', e.message));
|
||||
@@ -579,7 +581,13 @@ async function boot() {
|
||||
promos.init({ dataDir: DATA_DIR });
|
||||
blog.init({ dataDir: DATA_DIR });
|
||||
adminMember.init({ accounts, ads, chain, tank, legacy, promos, messages, dataDir: DATA_DIR });
|
||||
gamepass.init({ dataDir: DATA_DIR, siteConfig, accounts, marks, isProd: IS_PROD, persistedMap, polUsd: polUsdLive,
|
||||
telegram: async html => { const sc = siteConfig(); const chat = String(sc.telegramGamesChatId || sc.telegramEchoChatId || '').trim(); if (!sc.telegramBotToken || !chat) return false; await telegramSend(chat, html, sc.telegramGamesTopicId || null); return true; },
|
||||
notify: (to, subject, html) => messages.deliver(1, ADMIN_EMAIL || 'house@instantadpay.com', [to], subject, html, 'notice') }); // before loadOpenTokens: its maps must exist to be restored
|
||||
loadOpenTokens();
|
||||
setTimeout(() => gamepass.tournamentTick().catch(e => console.error('gamepass tournament', e.message)), 120 * 1000);
|
||||
setInterval(() => gamepass.tournamentTick().catch(e => console.error('gamepass tournament', e.message)), 60 * 60 * 1000);
|
||||
setInterval(() => { try { gamepass.prune(); } catch (e) { console.error('gamepass prune', e.message); } }, 6 * 3600 * 1000).unref();
|
||||
syndicate.init({ dataDir: DATA_DIR, publicDir: PUBLIC_DIR, uploadsDir: UPLOADS_DIR });
|
||||
releases.init({ dataDir: DATA_DIR });
|
||||
ledger.init({ dataDir: DATA_DIR });
|
||||
@@ -643,6 +651,28 @@ async function boot() {
|
||||
}
|
||||
}
|
||||
|
||||
// Game Pass partner helpers (2026-10-16): which secret signs for which game, signature compare, member resolution, dev clock
|
||||
const GP_SECRETS = () => ({ polhunter: String(process.env.HUNT_SSO_SECRET || '').trim(), gemkingdom: GK_SECRET(), spellwheel: SW_SECRET(), spookydoors: SD_SECRET(), polywarriors: PW_SECRET(),
|
||||
clutterhunt: SEEK_SECRET(), polybreak: PB_SECRET(), driprunner: DR_SECRET(), roadagent: RA_SECRET() });
|
||||
function gpPartnerCheck(game) { if (!gamepass.GAMES.includes(game)) return { error: 'unknown game', code: 400 }; const secret = GP_SECRETS()[game] || ''; if (secret.length < 32) return { error: game + ' is not connected', code: 503 }; return { secret }; }
|
||||
const gpSigOk = (want, got) => typeof got === 'string' && want.length === got.length && crypto.timingSafeEqual(Buffer.from(want), Buffer.from(got));
|
||||
async function gpResolve(memberId, email) { // the account behind a game's player: main member id, a linked position's id, or (no wallet yet) the email
|
||||
const id = Number(memberId) || 0; let a = null;
|
||||
if (id) { a = await accounts.byMemberId(id); if (!a) { const pos = await accounts.positionByMember(id); if (pos && pos.email) a = await accounts.byEmail(pos.email); } }
|
||||
if (!a && email && /^[^\s@]+@[^\s@]+$/.test(String(email))) a = await accounts.byEmail(String(email).trim().toLowerCase());
|
||||
return a && a.email ? { email: String(a.email).toLowerCase(), memberId: a.memberId || id || 0, acct: a } : null;
|
||||
}
|
||||
const gpDevNow = devDay => (!IS_PROD && /^\d{4}-\d{2}-\d{2}$/.test(String(devDay || ''))) ? Date.parse(devDay + 'T17:00:00Z') : Date.now(); // local tests fake the Central day
|
||||
// live USD per POL from the catalog quotes (the rate the games use for the tournament pool); cached 10 minutes
|
||||
const polUsdCache = { at: 0, v: 0 };
|
||||
async function polUsdLive() {
|
||||
if (!IS_PROD && Number(process.env.DEV_POL_USD) > 0) return Number(process.env.DEV_POL_USD); // local tests: no RPC
|
||||
if (polUsdCache.at && Date.now() - polUsdCache.at < 600000 && polUsdCache.v > 0) return polUsdCache.v;
|
||||
const cat = await chain.catalog(); const pk = cat.find(x => x.costWei); if (!pk) return polUsdCache.v || 0;
|
||||
const v = (pk.priceCents / 100) / (Number(BigInt(pk.costWei)) / 1e18); if (v > 0) { polUsdCache.v = v; polUsdCache.at = Date.now(); } return v;
|
||||
}
|
||||
// the Game Pass flag rides in every sign-in hand-off token (3a: games get it at sign-in and on every polgrant answer)
|
||||
const gpClaim = c => (c && c.email && (!c.kind || c.kind === 'sso')) ? { gamePass: gamepass.flag(c.email) } : {};
|
||||
function siteConfig() {
|
||||
let saved = {};
|
||||
try { saved = JSON.parse(fs.readFileSync(SITE_FILE, 'utf8')); } catch (e) {}
|
||||
@@ -671,6 +701,9 @@ function siteConfig() {
|
||||
legacyCreditsAdvertiser: 500, legacyCreditsEarner: 150, // welcome-back credits for listed Faucet Wave / Tier One Ads emails arriving via /from/<brand>
|
||||
geoTier1: '', // comma-separated ISO country codes; empty = built-in default (US, CA, GB, AU, NZ, IE, DE, FR, NL, SE, NO, DK, FI, CH, AT, BE)
|
||||
geoTier2: '', // empty = built-in default (rest of Western/Central Europe, JP, KR, SG, HK, TW, IL, Gulf, ZA, BR, MX, AR, CL, CO ...); tier 3 = everything else
|
||||
// Game Pass (2026-10-16, docs/GAME-PASS.md): off until Marty flips it; caps apply from capsStartDate (Central), before it polgrant allows everything and only records
|
||||
gamePassEnabled: '0', gamePassPriceCredits: 500, gamePassDays: 7, capFreeDaily: 0.30, capFreeTotal: 2.0, capPassDaily: 1.50, capPassTotal: 5.0, capsStartDate: '', passTournamentPct: 5,
|
||||
telegramGamesChatId: '', telegramGamesTopicId: '661565', // Game Achievements topic for the weekly Pass Tournament post (chat blank = the shared echo chat)
|
||||
pnlFixedMonthlyUsd: 0
|
||||
}, saved);
|
||||
}
|
||||
@@ -1307,7 +1340,7 @@ const DR_SECRET = () => String(process.env.DR_SSO_SECRET || '').trim();
|
||||
const DR_URL = () => String(process.env.DR_URL || 'https://driprunner.saasy.top').replace(/\/+$/, '');
|
||||
const drB64u = b => Buffer.from(b).toString('base64').replace(/=+$/, '').replace(/\+/g, '-').replace(/\//g, '_');
|
||||
const drSign = payload => drB64u(crypto.createHmac('sha256', DR_SECRET()).update(payload).digest());
|
||||
function drMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + drSign(payload); }
|
||||
function drMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + drSign(payload); }
|
||||
function drOpen(token) {
|
||||
if (DR_SECRET().length < 32) return { error: 'Drip Runner is not connected yet.' };
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -1333,7 +1366,7 @@ async function drCallback(body) {
|
||||
const GK_SECRET = () => String(process.env.GK_SSO_SECRET || '').trim();
|
||||
const GK_URL = () => String(process.env.GK_URL || 'https://gemkingdom.app').replace(/\/+$/, '');
|
||||
const gkSign = p => drB64u(crypto.createHmac('sha256', GK_SECRET()).update(p).digest());
|
||||
function gkMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + gkSign(payload); }
|
||||
function gkMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + gkSign(payload); }
|
||||
function gkOpen(token) {
|
||||
if (GK_SECRET().length < 32) return { error: 'Gem Kingdom is not connected yet.' };
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -1363,7 +1396,7 @@ const SEEK_SECRET = () => String(process.env.SEEK_SSO_SECRET || '').trim();
|
||||
const SEEK_URL = () => String(process.env.SEEK_URL || 'https://clutterhunt.com').replace(/\/+$/, '');
|
||||
const SEEK_ALT = () => String(process.env.SEEK_ALT_URLS || 'https://www.clutterhunt.com,https://clutterhunt.saasy.top').split(',').map(x => x.trim().replace(/\/+$/, '')).filter(Boolean);
|
||||
const seekSign = p => drB64u(crypto.createHmac('sha256', SEEK_SECRET()).update(p).digest());
|
||||
function seekMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + seekSign(payload); }
|
||||
function seekMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + seekSign(payload); }
|
||||
function seekOpen(token) {
|
||||
if (SEEK_SECRET().length < 32) return { error: 'ClutterHunt is not connected yet.' };
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -1383,7 +1416,7 @@ const SW_SECRET = () => String(process.env.SW_SSO_SECRET || '').trim();
|
||||
const SW_URL = () => String(process.env.SW_URL || 'https://spellwheel.com').replace(/\/+$/, '');
|
||||
const SW_ALT = () => String(process.env.SW_ALT_URLS || 'https://www.spellwheel.com,https://spellwheel.saasy.top').split(',').map(x => x.trim().replace(/\/+$/, '')).filter(Boolean);
|
||||
const swSign = p => drB64u(crypto.createHmac('sha256', SW_SECRET()).update(p).digest());
|
||||
function swMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + swSign(payload); }
|
||||
function swMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + swSign(payload); }
|
||||
function swOpen(token) {
|
||||
if (SW_SECRET().length < 32) return { error: 'SpellWheel is not connected yet.' };
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -1399,7 +1432,7 @@ const PB_SECRET = () => String(process.env.PB_SSO_SECRET || '').trim();
|
||||
const PB_URL = () => String(process.env.PB_URL || 'https://polybreak.app').replace(/\/+$/, '');
|
||||
const PB_ALT = () => String(process.env.PB_ALT_URLS || 'https://www.polybreak.app,https://polybreak.saasy.top').split(',').map(x => x.trim().replace(/\/+$/, '')).filter(Boolean);
|
||||
const pbSign = p => drB64u(crypto.createHmac('sha256', PB_SECRET()).update(p).digest());
|
||||
function pbMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + pbSign(payload); }
|
||||
function pbMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + pbSign(payload); }
|
||||
function pbOpen(token) {
|
||||
if (PB_SECRET().length < 32) return { error: 'PolyBreak is not connected yet.' };
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -1419,7 +1452,7 @@ const PW_SECRET = () => String(process.env.PW_SSO_SECRET || '').trim();
|
||||
const PW_URL = () => String(process.env.PW_URL || 'https://polywarriors.com').replace(/\/+$/, '');
|
||||
const PW_ALT = () => String(process.env.PW_ALT_URLS || 'https://www.polywarriors.com,https://polywarriors.saasy.top').split(',').map(x => x.trim().replace(/\/+$/, '')).filter(Boolean);
|
||||
const pwSign = p => drB64u(crypto.createHmac('sha256', PW_SECRET()).update(p).digest());
|
||||
function pwMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + pwSign(payload); }
|
||||
function pwMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + pwSign(payload); }
|
||||
async function swCallback(cbUrl, receipt) {
|
||||
if (!swIsGameUrl(cbUrl)) return false;
|
||||
try { const r = await fetch(cbUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ t: receipt }), signal: AbortSignal.timeout(8000) }); return r.ok; } catch (e) { console.warn('spellwheel callback', e.message); return false; }
|
||||
@@ -1485,7 +1518,7 @@ const SD_URL = () => String(process.env.SD_URL || 'https://spookydoors.com').rep
|
||||
const SD_SEASON = { start: '2026-10-04', end: '2026-11-01' }; // Central days, end exclusive (through Halloween night); start moved up from 10-17 (Marty, 2026-10-02)
|
||||
const sdGoldenBonus = () => { const n = Number(ads.rates().goldenBonusCandy); return Number.isFinite(n) && n >= 0 ? Math.round(n) : 2; }; // extra candy on a Golden Door
|
||||
const sdSign = p => drB64u(crypto.createHmac('sha256', SD_SECRET()).update(p).digest());
|
||||
function sdMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + sdSign(payload); }
|
||||
function sdMint(claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + sdSign(payload); }
|
||||
function sdOpen(token, expiredMsg) {
|
||||
if (SD_SECRET().length < 32) return { error: 'Spooky Doors is not connected yet.' };
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -1501,7 +1534,7 @@ const RA_URL = () => String(process.env.RA_URL || 'https://roadagent.app').repla
|
||||
const DOOR_GAMES = () => ({ spookydoors: { name: 'Spooky Doors', secret: SD_SECRET(), url: SD_URL(), hdr: 'SD', back: 'Go back to Spooky Doors and knock again.' },
|
||||
roadagent: { name: 'Road Agent', secret: RA_SECRET(), url: RA_URL(), hdr: 'RA', back: 'Go back to Road Agent and fuel up again.' } });
|
||||
const gSign = (g, p) => drB64u(crypto.createHmac('sha256', g.secret).update(p).digest());
|
||||
function gMint(g, claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims)); return drB64u(payload) + '.' + gSign(g, payload); }
|
||||
function gMint(g, claims, ttlMs) { const payload = JSON.stringify(Object.assign({ iat: Date.now(), exp: Date.now() + (ttlMs || 300000), nonce: crypto.randomBytes(12).toString('hex') }, claims, gpClaim(claims))); return drB64u(payload) + '.' + gSign(g, payload); }
|
||||
// open a door token from whichever game signed it: { ok, claims, game } or { error }
|
||||
function doorOpen(token, expiredMsg) {
|
||||
const [p, sig] = String(token || '').split('.'); if (!p || !sig) return { error: 'That link is not valid.' };
|
||||
@@ -3046,7 +3079,7 @@ const server = http.createServer(async (req, res) => {
|
||||
let sponsorRef = (acct && acct.sponsorRef) || '';
|
||||
const payload = JSON.stringify({ iat: Date.now(), exp: Date.now() + 5 * 60000, nonce: crypto.randomBytes(12).toString('hex'), memberId: Number(memberId), email: s.email, wallet: (acct && acct.address) || s.address || null, username: (acct && acct.username) || null, sponsorRef: sponsorRef || null, joinedAt: (acct && acct.created) || null,
|
||||
// where they first arrived from, so PolHunter can pay a bounty only for people it sent
|
||||
joinedRef: (acct && acct.joinedRef) || null });
|
||||
joinedRef: (acct && acct.joinedRef) || null, gamePass: gamepass.flag(s.email) });
|
||||
const tok = b64u(payload) + '.' + b64u(crypto.createHmac('sha256', secret).update(payload).digest());
|
||||
res.writeHead(302, { Location: huntUrl + '/auth?t=' + tok, 'Cache-Control': 'no-store', 'Set-Cookie': 'iap.return=; Path=/; SameSite=Lax; Max-Age=0' + (IS_PROD ? '; Secure' : '') }); return res.end(); // the loop is closed
|
||||
}
|
||||
@@ -3557,6 +3590,72 @@ const server = http.createServer(async (req, res) => {
|
||||
const s = await auth.fromRequest(req);
|
||||
res.writeHead(302, { Location: (s && s.email) ? g.play : S.open, 'Cache-Control': 'no-store' }); return res.end(); // signed in here: straight into the game, signed in
|
||||
} }
|
||||
// -- Game Pass + account-wide POL caps (2026-10-16, docs/GAME-PASS.md section 3a) --------------------------------------------
|
||||
// Partner auth: each game signs with the shared secret it already holds (its *_SSO_SECRET), 10-minute window.
|
||||
// GET ...?game=<slug>&m=<memberId>&e=<email>&ts=<ms>&sig=hex sig = HMAC-SHA256(secret, 'player:' + who + ':' + ts), who = memberId when > 0, else the lowercased email
|
||||
// POST JSON body with `game`, headers X-Game-Ts (ms) + X-Game-Sig sig = HMAC-SHA256(secret, ts + '\n' + rawBody)
|
||||
// The pass is per ACCOUNT (email): a linked position's member id resolves to the owner's account. Games fail closed.
|
||||
if (p === '/api/partner/player' && req.method === 'GET') {
|
||||
const game = String(u.searchParams.get('game') || '').toLowerCase(); const chk = gpPartnerCheck(game);
|
||||
if (chk.error) return json(res, chk.code, { error: chk.error });
|
||||
const m = Number(u.searchParams.get('m')) || 0, e = String(u.searchParams.get('e') || '').trim().toLowerCase(), ts = String(u.searchParams.get('ts') || ''), sig = String(u.searchParams.get('sig') || '');
|
||||
if (!/^\d{13}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 600000) return json(res, 401, { error: 'stale' });
|
||||
if (!gpSigOk(crypto.createHmac('sha256', chk.secret).update('player:' + (m > 0 ? String(m) : e) + ':' + ts).digest('hex'), sig)) return json(res, 401, { error: 'bad signature' });
|
||||
const r = await gpResolve(m, e); if (!r) return json(res, 404, { error: 'no such member', pass: { active: false, until: null } });
|
||||
const now = gpDevNow(u.searchParams.get('devDay'));
|
||||
return json(res, 200, { ok: true, memberId: r.memberId, username: r.acct.username || null, wallet: r.acct.address || null, suspended: fraud.isSuspended(r.email),
|
||||
pass: gamepass.flag(r.email, now), caps: gamepass.capsFor(r.email, now, game), gamePassEnabled: gamepass.cfg().enabled });
|
||||
}
|
||||
if ((p === '/api/partner/polgrant' || p === '/api/partner/polgrant/void' || p === '/api/partner/tournament/paid') && req.method === 'POST') {
|
||||
let raw; try { raw = (await readRaw(req, 16384)).toString('utf8'); } catch (e) { return json(res, 413, { error: 'too big' }); }
|
||||
let b; try { b = JSON.parse(raw || '{}'); } catch (e) { return json(res, 400, { error: 'bad json' }); }
|
||||
const game = String(b.game || '').toLowerCase(); const chk = gpPartnerCheck(game); if (chk.error) return json(res, chk.code, { error: chk.error });
|
||||
const ts = String(req.headers['x-game-ts'] || ''), sig = String(req.headers['x-game-sig'] || '');
|
||||
if (!/^\d{13}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 600000) return json(res, 401, { error: 'stale' });
|
||||
if (!gpSigOk(crypto.createHmac('sha256', chk.secret).update(ts + '\n' + raw).digest('hex'), sig)) return json(res, 401, { error: 'bad signature' });
|
||||
if (p === '/api/partner/tournament/paid') { const r = gamepass.markPaid(b.week, b.place, b.tx, game); if (!r.error) console.log('gamepass prize paid', b.week, '#' + b.place, 'by', game, String(b.tx || '').slice(0, 14)); return json(res, r.error ? 400 : 200, r); }
|
||||
const r = await gpResolve(b.memberId, b.email); if (!r) return json(res, 404, { error: 'no such member' });
|
||||
const now = gpDevNow(b.devDay);
|
||||
if (p.endsWith('/void')) return json(res, 200, gamepass.voidGrant({ game, ref: b.ref }));
|
||||
if (fraud.isSuspended(r.email)) return json(res, 200, { allowed: 0, deferred: 0, pass: false, day: gamepass.dayKey(now), suspended: true }); // nothing is recorded: a cleared account replays the ref later
|
||||
const out = gamepass.grant({ email: r.email, game, kind: b.kind, pol: b.pol, ref: b.ref, now });
|
||||
if (!out.error && out.capHit && !out.repeat) console.log('gamepass cap hit', out.capHit, game, r.email.replace(/^(.).*(@.*)$/, '$1***$2'), out.pass ? 'pass' : 'free', out.enforced ? 'enforced' : 'recorded');
|
||||
return json(res, out.error ? 400 : 200, out);
|
||||
}
|
||||
if (p === '/api/partner/tournament/pending' && req.method === 'GET') { // prize rows the games still have to pay out in POL (admin session may read too)
|
||||
if (!isAdmin(req)) {
|
||||
const game = String(u.searchParams.get('game') || '').toLowerCase(); const chk = gpPartnerCheck(game); if (chk.error) return json(res, chk.code, { error: chk.error });
|
||||
const ts = String(u.searchParams.get('ts') || ''), sig = String(u.searchParams.get('sig') || '');
|
||||
if (!/^\d{13}$/.test(ts) || Math.abs(Date.now() - Number(ts)) > 600000) return json(res, 401, { error: 'stale' });
|
||||
if (!gpSigOk(crypto.createHmac('sha256', chk.secret).update('player:tournament:' + ts).digest('hex'), sig)) return json(res, 401, { error: 'bad signature' });
|
||||
}
|
||||
const rows = gamepass.pending();
|
||||
return json(res, 200, { ok: true, rows, pending: rows }); // `rows` is what the games' polgrant.js tournamentPending() reads; `pending` is the admin pane's name
|
||||
}
|
||||
if (p === '/api/my/gamepass' && req.method === 'GET') {
|
||||
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
return json(res, 200, gamepass.view(s.email, gpDevNow(u.searchParams.get('devDay'))));
|
||||
}
|
||||
if (p === '/api/my/gamepass/buy' && req.method === 'POST') {
|
||||
const s = await auth.fromRequest(req); if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
|
||||
if (fraud.isSuspended(s.email)) return json(res, 403, { error: 'This account is suspended.' });
|
||||
const b = await readBody(req); const { ids } = await myMemberIds(s);
|
||||
// purchased-grade credits only, from a position's package balance (the PolyWarriors mint rule); devPaid = local tests only
|
||||
const charge = (!IS_PROD && b.devPaid) ? async () => ({ ok: true, campaignId: 0, dev: true }) : (price, label) => ads.gamePurchase(s.email, ids, price, label, 'https://instantadpay.com/my#games', { purchasedOnly: true });
|
||||
const r = await gamepass.buy(s.email, charge, gpDevNow(b.devDay));
|
||||
return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
if (!IS_PROD && p === '/api/dev/gamepass-purchase' && req.method === 'POST') { const b = await readBody(req); return json(res, 200, { order: await gamepass.onEvent({ type: 'Purchase', priceCents: Number(b.cents) || 500, buyerId: 0, tx: '0x' + crypto.randomBytes(32).toString('hex'), ts: Date.now(), devEmail: b.email }) }); } // local tests only
|
||||
if (p === '/api/admin/gamepass/stats' && req.method === 'GET') { if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); return json(res, 200, gamepass.adminStats()); }
|
||||
if (p === '/api/admin/gamepass/comp' && req.method === 'POST') { // support: give an account a pass week without a purchase
|
||||
if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); const b = await readBody(req); const e = String(b.email || '').trim().toLowerCase(); if (!e) return json(res, 400, { error: 'email required' });
|
||||
const r = gamepass.comp(e, String(b.why || 'support').slice(0, 80)); console.log('gamepass comp', e, b.why || ''); return json(res, 200, Object.assign({ ok: true, email: e }, r));
|
||||
}
|
||||
if (p === '/api/admin/gamepass/tournament/run' && req.method === 'POST') { // settle a week by hand (the Monday job normally does this)
|
||||
if (!isAdmin(req)) return json(res, 401, { error: 'auth' }); const b = await readBody(req);
|
||||
const at = /^\d{4}-\d{2}-\d{2}$/.test(String(b.week || '')) ? Date.parse(b.week + 'T17:00:00Z') : Date.now() - 7 * 86400000;
|
||||
const r = await gamepass.runTournament(at, { force: !!b.force }); return json(res, r.error ? 400 : 200, r);
|
||||
}
|
||||
// -- Games hub (2026-10-01): the registry is here, the live list is site config (gamesLive)
|
||||
if (p === '/api/my/games' && req.method === 'GET') {
|
||||
const s = await auth.fromRequest(req);
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ const COMPLIANCE = [
|
||||
'NEVER promise, guarantee, project or imply income, earnings, returns or profit.',
|
||||
'NEVER use hype: no "guaranteed", "risk-free", "passive income", "get rich", "financial freedom".',
|
||||
'InstantAdPay SELLS ADVERTISING with a performance referral program. It is not an investment. Say so plainly when the length allows.',
|
||||
'The only money facts you may state: packages are $5, $20, $50, $100 and $250 of ad credits (1 credit = 1 cent of ad delivery); when someone in your line buys a package the contract pays the direct sponsor 50% in the same transaction, 20% to level 2, 10% to level 3, 20% to the platform; two qualifying $20+ buyers open level 2, five open level 3. Never invent other numbers or member results.',
|
||||
'The only money facts you may state: packages are $5, $10, $20, $50, $100, $250 and $500 of ad credits (1 credit = 1 cent of ad delivery); when someone in your line buys a package the contract pays the direct sponsor 50% in the same transaction, 20% to level 2, 10% to level 3, 20% to the platform; two qualifying $20+ buyers open level 2, five open level 3. Never invent other numbers or member results.',
|
||||
'Payments are POL on Polygon, wallet to wallet, on a public ledger anyone can check. Cryptocurrency carries real risk; results depend on effort.',
|
||||
'No em dashes and no double hyphens anywhere. No fake urgency, no fake scarcity, no invented testimonials.'
|
||||
].join(' ');
|
||||
|
||||
Reference in New Issue
Block a user