From 69420ab9e4ec776e9ab1b341495a39200f791eb5 Mon Sep 17 00:00:00 2001 From: Mukan Erkin Date: Sat, 25 Apr 2026 12:19:45 +0300 Subject: [PATCH] feat(mse): separate LD lending tokens in spot wallet view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit LD* assets split into a collapsible sub-table "Lending Tokenları" below the main spot table, with a note that they mirror Simple Earn positions. Main spot list stays clean; LD section hidden when empty. Co-Authored-By: Claude Sonnet 4.6 --- src/web/wallet.html | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/src/web/wallet.html b/src/web/wallet.html index 41d26fc..40ae8cb 100644 --- a/src/web/wallet.html +++ b/src/web/wallet.html @@ -56,6 +56,9 @@ .loading { padding: 32px 18px; color: var(--muted); font-size: 13px; text-align: center; } .usdt-row td { background: rgba(46,204,113,.04); } .usdt-row .asset-name { color: var(--green); } + .ld-section { margin-top: 16px; } + .ld-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 18px 6px; border-top: 1px solid var(--border); background: rgba(243,156,18,.03); } + .ld-label span { color: var(--yellow); } @@ -82,6 +85,13 @@ VarlıkKullanılabilirKilitli Yükleniyor... + @@ -162,23 +172,39 @@ async function loadSpot() { const balances = await res.json(); if (!balances.length) { tbody.innerHTML = 'Bakiye yok'; return; } - balances.sort((a, b) => { + const spot = balances.filter(b => !b.asset.startsWith('LD')); + const ld = balances.filter(b => b.asset.startsWith('LD')); + + spot.sort((a, b) => { if (a.asset === 'USDT') return -1; if (b.asset === 'USDT') return 1; return (b.free + b.locked) - (a.free + a.locked); }); - const usdt = balances.find(b => b.asset === 'USDT'); + const usdt = spot.find(b => b.asset === 'USDT'); if (usdt) { document.getElementById('usdt-total').textContent = `${fmt(usdt.free)} serbest / ${fmt(usdt.free + usdt.locked)} USDT toplam`; } - tbody.innerHTML = balances.map(b => ` - ${b.asset} - ${fmt(b.free)} - ${b.locked > 0 ? `${fmt(b.locked)}` : ''} - `).join(''); + function rowHtml(b) { + return ` + ${b.asset} + ${fmt(b.free)} + ${b.locked > 0 ? `${fmt(b.locked)}` : ''} + `; + } + + tbody.innerHTML = spot.map(rowHtml).join(''); + + const ldSection = document.getElementById('ld-section'); + if (ld.length) { + ld.sort((a, b) => (b.free + b.locked) - (a.free + a.locked)); + document.getElementById('ld-body').innerHTML = ld.map(rowHtml).join(''); + ldSection.style.display = ''; + } else { + ldSection.style.display = 'none'; + } } async function loadEarn() {