diff --git a/chain.js b/chain.js index 795a63f..9e3e58f 100644 --- a/chain.js +++ b/chain.js @@ -454,6 +454,7 @@ async function memberPublic(id) { out.income = inc.map(p => ({ fromId: p.fromId, pol: p.pol, ts: p.ts, desc: describeIncome(p.fromTier, p.level, p.pol) })).reverse().slice(0, 50); } catch (e) { out.income = []; } out.subtree = getSubtree(id, 99); // full leg — the dashboard drills down client-side + if (costs) out.upgradeCosts = costs.up; // {1:[8 std], 2:[8 prem]} POL — for the pipeline widget // moving-link automation: the first position below (breadth-first, left→right) // that still needs directs is where a qualified member's effort goes next if (out.subtree) { diff --git a/public/my.html b/public/my.html index 44c572d..8a4a143 100644 --- a/public/my.html +++ b/public/my.html @@ -8,6 +8,7 @@
Member position

Position #— Verified on-chain

Your team

Your position's matrix — the rollup line on each card counts everyone underneath, all the way down. Click a position to drill into that leg. Open slots are where the next placements land.

✓ qualified (2/2 directs) · P Premium · S Standard · ⬇ everyone below that position (all generations) and the POL they've earned · ↧ spillover = placed there by upline activity; only members who join with a position's own ID count toward its 2/2

+

Your pipeline

Money forming below you. Each generation in your leg pays your position at exactly one level — when a member's level catches up to their depth, their next upgrade comes to you.

Share this position

Just joined under this position?

Welcome to the team! Enter the new member ID the RM Circle dApp gave you — we'll verify it on the blockchain and let the team know you're in.

Payments received

Every payment your position has received, straight from the smart contract.

diff --git a/public/my.js b/public/my.js index 3f9fd1c..3b63691 100644 --- a/public/my.js +++ b/public/my.js @@ -99,6 +99,7 @@ document.getElementById('dIncome').innerHTML=inc.length ?`
${inc.map(p=>``).join('')}
WhenFrom memberForAmount
${date(p.ts)}#${p.fromId}${esc(p.desc)}${fmt(p.pol)} POL
` :'
No payments yet — they appear here the moment they land on-chain.
'; + renderPipeline(d); renderShare(d); document.getElementById('dLineage').innerHTML=d.uplineChain&&d.uplineChain.length ?`#${d.id} → ${d.uplineChain.map(i=>'#'+i).join(' → ')} (root)` @@ -110,6 +111,49 @@ return q.createSvgTag({cellSize:4,margin:3,scalable:true}); }catch(e){return ''} } + const LEVELS=['Scintilla','Ascensus','Fabrica','Culmen','Apex','Fastigium','Vertex','Corona']; + function renderPipeline(d){ + const el=document.getElementById('dPipeline'); + if(!el)return; + if(!d.subtree||(!d.subtree.left&&!d.subtree.right)){el.innerHTML='
Your pipeline starts when your first team members are placed below you.
';return} + if(!d.upgradeCosts){el.innerHTML='
Pipeline data is loading — check back in a minute.
';return} + const up=d.upgradeCosts; + // walk the subtree with depth: a member at depth D pays THIS position when + // they buy the upgrade OUT of level D (cost index D-1) — first in line + const ready=[],building=[],passedCount={n:0}; + (function walk(n,depth){ + if(!n||depth>16)return; + const lvl=n.level||1,tier=n.tier===2?2:1; + if(depth>=1){ + if(lvl===depth){ + const amt=(up[tier]||[])[depth-1]; + if(amt)ready.push({id:n.id,depth,tier,amt,toLevel:LEVELS[depth]||('Level '+(depth+1)),needLevel:depth}); + }else if(lvla.depth-b.depth||a.id-b.id); + const eligible=r=>d.directCount>=2&&(d.level||1)>=r.needLevel; + const readyTotal=ready.filter(eligible).reduce((s,r)=>s+r.amt,0); + let html=''; + if(ready.length){ + html+=`

Ready now — one upgrade from your wallet:

`; + html+=ready.slice(0,10).map(r=>{ + const warn=!eligible(r)?(d.directCount<2?' ⚠ needs you qualified (2 directs)':` ⚠ needs you at ${esc(LEVELS[r.needLevel-1])}+`):''; + return `
⏳
#${r.id} · gen ${r.depth} · their ${esc(r.toLevel)} upgrade pays you ${fmt(r.amt)} POL${warn}
`; + }).join(''); + if(ready.length>10)html+=`

…and ${ready.length-10} more.

`; + if(readyTotal>0){ + const myNext=(up[d.tier===2?2:1]||[])[(d.level||1)-1]; + const fundNote=myNext?` Your next upgrade (${esc(LEVELS[d.level]||'max')}) costs ${fmt(myNext)} — ${readyTotal>=myNext?'the pipeline above covers it':'these payments put you '+fmt(readyTotal)+' toward it'}.`:''; + html+=`

${fmt(readyTotal)} POL is one upgrade away from your wallet.${fundNote}

`; + } + }else html+='

Nobody is at their pay-you milestone yet — the members below are still climbing toward it.

'; + if(building.length)html+=`

${building.length} more member${building.length===1?' is':'s are'} building toward their pay-you level${passedCount.n?`; ${passedCount.n} already passed theirs`:''}. Helping your leg upgrade IS your income.

`; + else if(passedCount.n)html+=`

${passedCount.n} member${passedCount.n===1?' has':'s have'} already passed their pay-you milestone.

`; + el.innerHTML=html; + } function renderShare(d){ const el=document.getElementById('dShare'); if(!el)return;