diff --git a/public/my.js b/public/my.js index 34c91f5..963fb27 100644 --- a/public/my.js +++ b/public/my.js @@ -192,8 +192,27 @@ const ns=d.nextStep||{}; if(ns.kind!=='upgrade'||d.directCount<2){el.innerHTML='';return;} const name=LEVELS[ns.nextLevel-1]||('Level '+ns.nextLevel); + // What this rung buys, in their own numbers. A price with no reason attached + // is just a bill — this is the reason. + const op=ns.opens||{}; + let why=''; + if(op.perCatch>0){ + const gname=LEVELS[op.gen]||('Level '+(op.gen+1)); + const have=(op.genSize!=null&&op.genSize>0) + ? `You already have ${op.genSize} ${op.genSize===1?'person':'people'} there.` + : `That generation is still filling.`; + why=`
+ What this unlocks: ${esc(name)} extends your reach to + generation ${op.gen}. ${have} + Each of them pays you ${fmt(op.perCatch)} POL when they buy ${esc(gname)}. +
Your first catch at this level is ${fmt(op.perCatch)} POL — + exactly double what this upgrade costs, because every rung is twice the last. + That is the whole idea behind Lesson 8 — time your upgrades to your catches.
+
`; + } el.innerHTML=`

⬆️ Upgrade to ${esc(name)} — right from this page

+ ${why}

Exact cost ${fmt(ns.cost)} POL, read live from the contract. Connect the wallet that owns position #${d.id}, confirm once, done. ${ns.funded?'Your wallet already covers it ✓':'Your wallet does not cover it yet — you can time it to your next catches, or top up below.'}

${ns.funded?'':``} diff --git a/server.js b/server.js index ca02d1d..eee0b65 100644 --- a/server.js +++ b/server.js @@ -590,6 +590,19 @@ async function handleApi(req,res,pathname){ let funded=null; try{ if(r.account&&cost){ const bal=await chain.balanceOf(r.account); if(bal!=null) funded=bal>=cost; } }catch(e){} r.nextStep={kind:'upgrade',nextLevel:lvl+1,cost,funded}; + // What the upgrade actually BUYS. The panel used to show a price with no + // reason attached, which is how 53 qualified members read it and closed + // the tab. Owning level L catches generation L, so this rung opens the + // generation numbered nextLevel — and because upgrade costs double every + // rung, the first catch there is exactly twice what this rung costs. + try{ + const opensGen=lvl+1; + const perCatch=(r.upgradeCosts&&r.upgradeCosts[tier]&&r.upgradeCosts[tier][lvl])||0; + const share=chain.getOrgShare(id); + const genSize=(share&&share.ready&&share.found&&Array.isArray(share.genCounts)) + ? (share.genCounts[opensGen-1]||0) : null; + r.nextStep.opens={gen:opensGen,perCatch,genSize}; + }catch(e){} }else{ r.nextStep={kind:'max'}; }