diff --git a/chain.js b/chain.js
index cec8924..f572f09 100644
--- a/chain.js
+++ b/chain.js
@@ -101,6 +101,14 @@ const pol = wei => Number(wei / 1000000000000n) / 1e6; // 6-decimal POL
const encU = v => BigInt(v).toString(16).padStart(64, '0');
async function ethCall(data) { return await rpc('eth_call', [{ to: CONTRACT, data }, 'latest']); }
+// Native POL balance of a wallet (public on-chain data). Used ONLY to derive a
+// funded / not-funded flag for a member's next upgrade — the API never returns
+// the raw balance, only the boolean, to keep members' holdings private.
+async function balanceOf(address) {
+ if (!/^0x[0-9a-fA-F]{40}$/.test(address || '')) return null;
+ try { const hex = await rpc('eth_getBalance', [address, 'latest'], 6000); return Number(BigInt(hex)) / 1e18; }
+ catch (e) { return null; }
+}
function decodeMemberStruct(r) {
// members(uint48): account, joinedAt, referrerId, uplineId, tier, level, directCount,
@@ -617,4 +625,4 @@ async function getIncome(id) {
};
}
-module.exports = { startIndexer, getPayoutsPublic, verifyMember, memberLookup, memberPublic, getIncome, getOwnerUpgradeNeeds, getOrgRouting, getOrgShare, getMatrixTree, isInTeam, CONTRACT };
+module.exports = { startIndexer, getPayoutsPublic, verifyMember, memberLookup, memberPublic, getIncome, getOwnerUpgradeNeeds, getOrgRouting, getOrgShare, getMatrixTree, isInTeam, balanceOf, CONTRACT };
diff --git a/public/my.html b/public/my.html
index e05217a..0f9d740 100644
--- a/public/my.html
+++ b/public/my.html
@@ -7,6 +7,7 @@
New here? What you're looking at
This is a live member dashboard for the RM Circle Premium team build — a team-first strategy on the Polygon blockchain where every payment happens on a public smart contract that nobody can fake or edit. The plan is simple: get your 2, then help your 2 get their 2. Every number on this page is this member's real position, read straight from the blockchain.
Independent team training resource • Participation involves risk • No income is guaranteed
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.
Email me my alerts
Get an email the moment this position is paid, and when it needs an upgrade to catch incoming pay — so you never miss one. Opt in with your email; unsubscribe anytime.
No payments yet — they appear here the moment they land on-chain.
';
+ renderNextStep(d);
renderPipeline(d);
renderAlerts(d);
renderShare(d);
@@ -113,6 +114,33 @@
}catch(e){return ''}
}
const LEVELS=['Scintilla','Ascensus','Fabrica','Culmen','Apex','Fastigium','Vertex','Corona'];
+ // "My Next Step" — the single clearest action + the level ladder + a funded
+ // badge (server tells us funded true/false; it never sends the raw balance).
+ function renderNextStep(d){
+ const el=document.getElementById('dNextStep');if(!el)return;
+ const ns=d.nextStep||{},lvl=d.level||1;
+ const ladder=LEVELS.map((nm,i)=>{
+ const L=i+1;let cls='nlv';
+ if(LYOU':(ns.kind==='upgrade'&&L===ns.nextLevel?'NEXT':'');
+ return `
${tag}${nm}
`;
+ }).join('');
+ let head='',body='',badge='';
+ if(ns.kind==='qualify'){
+ head='Your next step — get qualified';
+ body=`You need ${ns.need} more direct${ns.need===1?'':'s'} (people who join on your link) to unlock upgrade payments. Grab your link from Share this position below and go get them.`;
+ }else if(ns.kind==='upgrade'){
+ const nm=LEVELS[ns.nextLevel-1]||('Level '+ns.nextLevel);
+ head=`Your next step — upgrade to ${esc(nm)}`;
+ body=`Stay one level ahead of your deepest active team so the pass-ups from below land on you instead of skipping past. Upgrade with your earned POL when you can.`;
+ if(ns.funded===true)badge='✓ Funded — you can upgrade now';
+ else if(ns.funded===false)badge='Keep building — not funded yet';
+ }else if(ns.kind==='max'){
+ head="You're at the top level 🏆";
+ body='Keep helping your team duplicate — every level they climb still pays up to you.';
+ }else{el.innerHTML='';return;}
+ el.innerHTML=`