@microcosmmoney/portal-react 2.3.4 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/components/auction/auction-page.js +118 -25
  2. package/dist/components/dashboard/assets-summary.d.ts +2 -1
  3. package/dist/components/dashboard/assets-summary.js +11 -6
  4. package/dist/components/dashboard/dashboard-overview.d.ts +2 -1
  5. package/dist/components/dashboard/dashboard-overview.js +11 -2
  6. package/dist/components/dashboard/ecosystem-stats.d.ts +4 -1
  7. package/dist/components/dashboard/ecosystem-stats.js +12 -9
  8. package/dist/components/dashboard/lock-periods.d.ts +4 -1
  9. package/dist/components/dashboard/lock-periods.js +2 -2
  10. package/dist/components/dashboard/market-overview-bar.d.ts +4 -1
  11. package/dist/components/dashboard/market-overview-bar.js +9 -6
  12. package/dist/components/dashboard/mcc-token-stats.d.ts +4 -1
  13. package/dist/components/dashboard/mcc-token-stats.js +12 -9
  14. package/dist/components/dashboard/mcd-stats.d.ts +4 -1
  15. package/dist/components/dashboard/mcd-stats.js +14 -11
  16. package/dist/components/dashboard/mining-weight.d.ts +4 -1
  17. package/dist/components/dashboard/mining-weight.js +10 -7
  18. package/dist/components/dashboard/minting-stats.d.ts +4 -1
  19. package/dist/components/dashboard/minting-stats.js +6 -3
  20. package/dist/components/dashboard/my-mining.d.ts +2 -1
  21. package/dist/components/dashboard/my-mining.js +4 -2
  22. package/dist/components/dashboard/price-chart.d.ts +4 -1
  23. package/dist/components/dashboard/price-chart.js +6 -4
  24. package/dist/components/dashboard/quick-actions.d.ts +2 -1
  25. package/dist/components/dashboard/quick-actions.js +52 -37
  26. package/dist/components/fragment/fragment-page.js +53 -9
  27. package/dist/components/lending/lending-page.js +124 -22
  28. package/dist/components/mcd/mcd-page.js +139 -18
  29. package/dist/components/mining/mining-page.js +46 -15
  30. package/dist/components/organization/organization-page.js +90 -22
  31. package/dist/components/territory/territory-page.js +126 -29
  32. package/dist/components/voting/voting-page.js +10 -10
  33. package/dist/components/wallet/wallet-page.js +186 -23
  34. package/dist/index.d.ts +8 -0
  35. package/package.json +4 -4
@@ -6,40 +6,203 @@ exports.MicrocosmWalletPage = MicrocosmWalletPage;
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
7
  const react_1 = require("react");
8
8
  const auth_react_1 = require("@microcosmmoney/auth-react");
9
+ /* ── helpers ── */
9
10
  const fmt = (n, d = 2) => n.toLocaleString('en-US', { minimumFractionDigits: d, maximumFractionDigits: d });
10
- function Spinner() {
11
- return (0, jsx_runtime_1.jsx)("span", { className: "inline-block w-5 h-5 border-2 border-cyan-400 border-t-transparent rounded-full animate-spin" });
11
+ const fmtUSD = (n) => '$' + n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
12
+ /* ── inline SVG icons (16-20px, stroke-based, matching lucide style) ── */
13
+ function IconWallet({ className = '' }) {
14
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M21 12V7H5a2 2 0 0 1 0-4h14v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 5v14a2 2 0 0 0 2 2h16v-5" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 12a1 1 0 0 0 0 4h4v-4Z" })] }));
15
+ }
16
+ function IconLock({ className = '' }) {
17
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }), (0, jsx_runtime_1.jsx)("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })] }));
18
+ }
19
+ function IconTrendingUp({ className = '' }) {
20
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("polyline", { points: "22 7 13.5 15.5 8.5 10.5 2 17" }), (0, jsx_runtime_1.jsx)("polyline", { points: "16 7 22 7 22 13" })] }));
21
+ }
22
+ function IconRefresh({ className = '' }) {
23
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 3v5h5" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16" }), (0, jsx_runtime_1.jsx)("path", { d: "M21 21v-5h-5" })] }));
24
+ }
25
+ function IconInfo({ className = '' }) {
26
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "10" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 16v-4" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 8h.01" })] }));
27
+ }
28
+ function IconGift({ className = '' }) {
29
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { x: "3", y: "8", width: "18", height: "4", rx: "1" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 8v13" }), (0, jsx_runtime_1.jsx)("path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7" }), (0, jsx_runtime_1.jsx)("path", { d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5" })] }));
30
+ }
31
+ function IconCreditCard({ className = '' }) {
32
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("rect", { width: "20", height: "14", x: "2", y: "5", rx: "2" }), (0, jsx_runtime_1.jsx)("line", { x1: "2", x2: "22", y1: "10", y2: "10" })] }));
33
+ }
34
+ function IconEye({ className = '' }) {
35
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "3" })] }));
36
+ }
37
+ function IconEyeOff({ className = '' }) {
38
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.084 14.158a3 3 0 0 1-4.242-4.242" }), (0, jsx_runtime_1.jsx)("path", { d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143" }), (0, jsx_runtime_1.jsx)("path", { d: "m2 2 20 20" })] }));
39
+ }
40
+ function IconExternalLink({ className = '' }) {
41
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M15 3h6v6" }), (0, jsx_runtime_1.jsx)("path", { d: "M10 14 21 3" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })] }));
42
+ }
43
+ function IconAlertTriangle({ className = '' }) {
44
+ return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 9v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 17h.01" })] }));
45
+ }
46
+ /* ── spinner ── */
47
+ function Spinner({ size = 'w-5 h-5' }) {
48
+ return (0, jsx_runtime_1.jsx)("span", { className: `inline-block ${size} border-2 border-cyan-400 border-t-transparent rounded-full animate-spin` });
49
+ }
50
+ /* ── lock period card ── */
51
+ function LockPeriodCard({ lock, hideBalance }) {
52
+ const [progress, setProgress] = (0, react_1.useState)(0);
53
+ (0, react_1.useEffect)(() => {
54
+ const start = new Date(lock.lock_start).getTime();
55
+ const end = new Date(lock.lock_end).getTime();
56
+ const now = Date.now();
57
+ const p = Math.min(100, Math.max(0, ((now - start) / (end - start)) * 100));
58
+ // Animate in
59
+ const timer = setTimeout(() => setProgress(p), 50);
60
+ return () => clearTimeout(timer);
61
+ }, [lock.lock_start, lock.lock_end]);
62
+ const start = new Date(lock.lock_start);
63
+ const end = new Date(lock.lock_end);
64
+ const now = Date.now();
65
+ const msLeft = Math.max(0, end.getTime() - now);
66
+ const daysLeft = Math.floor(msLeft / 86400000);
67
+ const hoursLeft = Math.floor((msLeft % 86400000) / 3600000);
68
+ const fmtDT = (d) => d.toLocaleString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: false });
69
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-start mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: ["reason: ", lock.reason] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-white font-mono", children: [hideBalance ? '****' : fmt(lock.amount), " MCC"] })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 px-2 py-0.5 rounded font-mono", children: "LOCKED" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-neutral-400", children: [(0, jsx_runtime_1.jsx)("span", { children: "lock_start" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: fmtDT(start) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-neutral-400", children: [(0, jsx_runtime_1.jsx)("span", { children: "lock_end" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: fmtDT(end) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between font-bold mt-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: "remaining" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: [daysLeft, "d ", hoursLeft, "h"] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-700 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all duration-700", style: { width: `${progress}%` } }) }) })] }));
70
+ }
71
+ /* ── token icon ── */
72
+ function TokenIcon({ symbol, color }) {
73
+ return ((0, jsx_runtime_1.jsx)("div", { className: `w-10 h-10 rounded-full flex items-center justify-center text-white font-bold text-sm ${color}`, children: symbol.slice(0, 2) }));
74
+ }
75
+ function AssetList({ holdings, hideBalance, showWalletColumn, isLoading, }) {
76
+ if (isLoading) {
77
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "py-8 px-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-500 text-sm", children: "Syncing on-chain data..." })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3 max-w-xs mx-auto", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-1.5 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400/60 h-1.5 rounded-full animate-pulse", style: { width: '60%' } }) }) })] }));
78
+ }
79
+ if (holdings.length === 0) {
80
+ return ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500", children: (0, jsx_runtime_1.jsx)("p", { className: "text-sm", children: "No valued assets found" }) }));
81
+ }
82
+ const gridCols = showWalletColumn ? 'grid-cols-4' : 'grid-cols-3';
83
+ return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: `gap-4 py-2 px-4 border-b border-neutral-700 text-xs font-medium text-neutral-400 tracking-wider grid ${gridCols}`, children: [(0, jsx_runtime_1.jsx)("div", { children: "Token" }), showWalletColumn && (0, jsx_runtime_1.jsx)("div", { children: "Wallet" }), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: "Amount" }), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: "Valuation" })] }), (0, jsx_runtime_1.jsx)("div", { className: "divide-y divide-neutral-800", children: holdings.map((h, idx) => ((0, jsx_runtime_1.jsxs)("div", { className: `gap-4 py-3 px-4 items-center hover:bg-neutral-700 transition-colors rounded grid ${gridCols}`, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)(TokenIcon, { symbol: h.symbol, color: h.color }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-medium text-sm", children: h.symbol }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: h.name })] })] }), showWalletColumn && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("code", { className: "text-xs text-neutral-400 font-mono", children: h.walletShort }), h.isPrimary && (0, jsx_runtime_1.jsx)("span", { className: "ml-1 text-[10px] text-cyan-400", children: "Primary" })] })), (0, jsx_runtime_1.jsx)("div", { className: "text-right", children: (0, jsx_runtime_1.jsx)("div", { className: "text-white text-sm font-mono", children: hideBalance ? '****' : fmt(h.balance, h.balance < 1 ? 6 : 4) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-right", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-300 text-sm font-mono", children: hideBalance ? '****' : fmtUSD(h.usdValue) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: fmtUSD(h.price) })] })] }, `${h.symbol}-${h.wallet || idx}`))) })] }));
12
84
  }
13
85
  function MicrocosmWalletPage({ basePath = '', onNavigate }) {
14
- const { balance: mccData, loading: mccLoading } = (0, auth_react_1.useMCC)(60000);
15
- const { balance: mcdData, loading: mcdLoading } = (0, auth_react_1.useMCD)(60000);
86
+ const { balance: mccData, price: mccPrice, loading: mccLoading, refresh: refreshMCC } = (0, auth_react_1.useMCC)(60000);
87
+ const { balance: mcdData, loading: mcdLoading, refresh: refreshMCD } = (0, auth_react_1.useMCD)(60000);
16
88
  const { data: wallets, loading: walletsLoading } = (0, auth_react_1.useWallets)();
17
89
  const { data: locks } = (0, auth_react_1.useMCCLocks)();
18
90
  const { data: marketData } = (0, auth_react_1.useMarketData)();
19
- const { data: multiBalance } = (0, auth_react_1.useMultiWalletBalance)();
91
+ const { data: multiBalance, loading: multiLoading, refresh: refreshMulti } = (0, auth_react_1.useMultiWalletBalance)();
20
92
  const [hideBalance, setHideBalance] = (0, react_1.useState)(false);
21
93
  const [activeTab, setActiveTab] = (0, react_1.useState)('all');
94
+ const [isRefreshing, setIsRefreshing] = (0, react_1.useState)(false);
95
+ const walletList = Array.isArray(wallets) ? wallets : [];
22
96
  const mccBalance = mccData?.balance ?? 0;
97
+ const price = marketData?.price_usd ?? mccPrice?.price ?? 0;
98
+ const totalUsd = mccBalance * price;
23
99
  const mcdAmount = parseFloat(mcdData?.available_balance ?? '0');
24
- const mcdReceived = parseFloat(mcdData?.total_balance ?? '0');
100
+ const mcdTotalReceived = parseFloat(mcdData?.total_balance ?? '0');
25
101
  const mcdSpent = parseFloat(mcdData?.frozen_balance ?? '0');
26
- const price = marketData?.price_usd ?? 0;
27
- const totalUsd = mccBalance * price;
28
- const walletList = Array.isArray(wallets) ? wallets : [];
29
102
  const activeLocks = Array.isArray(locks) ? locks.filter((l) => l.status === 'locked') : [];
30
103
  const lockedAmount = activeLocks.reduce((s, l) => s + (l.amount || 0), 0);
31
- const mask = (v) => hideBalance ? '****' : v;
32
- const resolvePath = (p) => basePath ? `${basePath.replace(/\/$/, '')}${p}` : p;
33
- return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto font-mono space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white", children: "Wallet" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-sm mt-1", children: "On-chain assets & balances" })] }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setHideBalance(!hideBalance), className: "flex items-center gap-2 px-3 py-1.5 text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 bg-transparent", children: hideBalance ? '👁 Show' : '🙈 Hide' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-xs font-mono tracking-wider mb-2", children: "TOTAL_ASSET_VALUE" }), (0, jsx_runtime_1.jsx)("div", { className: "text-3xl font-bold font-mono text-cyan-400", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(`$${fmt(totalUsd)}`) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 font-mono mt-1", children: [mask(fmt(mccBalance, 3)), " MCC \u00D7 $", fmt(price, 4)] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-1 bg-black p-0.5 rounded w-fit", children: [(0, jsx_runtime_1.jsx)("button", { onClick: () => setActiveTab('all'), className: `px-3 py-1 text-xs font-mono rounded ${activeTab === 'all' ? 'bg-cyan-700 text-white' : 'text-neutral-500 hover:text-neutral-300'}`, children: "All Wallets" }), walletList.map((w, i) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setActiveTab(w.wallet_address), className: `px-3 py-1 text-xs font-mono rounded ${activeTab === w.wallet_address ? 'bg-cyan-700 text-white' : 'text-neutral-500 hover:text-neutral-300'}`, children: w.is_primary ? 'Primary' : `Wallet ${i + 1}` }, w.wallet_address)))] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-xs font-mono tracking-wider", children: "MCC_BALANCE" }), (0, jsx_runtime_1.jsx)("button", { onClick: () => onNavigate?.(resolvePath('/mcc/mining')), className: "text-xs text-cyan-400 hover:text-cyan-300 font-mono", children: "Start Mining \u2192" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold font-mono text-cyan-400", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mccBalance, 3)) }), totalUsd > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 font-mono mt-1", children: ["\u2248 ", mask(`$${fmt(totalUsd)}`)] })), walletList.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-4 space-y-2", children: walletList.map((w) => {
34
- const wb = Array.isArray(multiBalance) ? multiBalance.find((b) => b.wallet_address === w.wallet_address) : null;
35
- const bal = wb?.portfolio?.mcc_balance ?? 0;
36
- return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 font-mono", children: [w.wallet_address.slice(0, 6), "...", w.wallet_address.slice(-4)] }), w.is_primary && (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 px-1.5 py-0.5 rounded", children: "PRIMARY" })] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono font-bold", children: [mask(fmt(bal, 3)), " MCC"] })] }, w.wallet_address));
37
- }) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-xs font-mono tracking-wider mb-2", children: "MCD_BALANCE" }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold font-mono text-white", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdAmount)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 font-mono mt-1 space-x-3", children: [(0, jsx_runtime_1.jsxs)("span", { children: ["Income: ", (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: mask(fmt(mcdReceived, 0)) })] }), (0, jsx_runtime_1.jsxs)("span", { children: ["Spent: ", (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: mask(fmt(mcdSpent, 0)) })] })] })] }), activeLocks.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-6 hover:border-cyan-400/50 transition-colors", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-xs font-mono tracking-wider mb-4", children: "LOCK_PERIODS" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: activeLocks.map((lock, i) => {
38
- const start = new Date(lock.start_date || lock.created_at).getTime();
39
- const end = new Date(lock.end_date || start + 14 * 86400000).getTime();
40
- const now = Date.now();
41
- const progress = Math.min(100, ((now - start) / (end - start)) * 100);
42
- const daysLeft = Math.max(0, Math.ceil((end - now) / 86400000));
43
- return ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono font-bold", children: [mask(fmt(lock.amount, 2)), " MCC"] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-400", children: [daysLeft, "d remaining"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-neutral-700 rounded-full h-2", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all", style: { width: `${progress}%` } }) })] }, i));
44
- }) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 text-xs text-neutral-500 font-mono", children: ["Total locked: ", mask(fmt(lockedAmount, 2)), " MCC"] })] }))] }));
104
+ const mask = (v) => (hideBalance ? '****' : v);
105
+ const resolvePath = (p) => (basePath ? `${basePath.replace(/\/$/, '')}${p}` : p);
106
+ /* ── build on-chain asset holdings from multiBalance ── */
107
+ const TOKEN_META = {
108
+ SOL: { name: 'Solana', color: 'bg-purple-600' },
109
+ MCC: { name: 'Microcosm Coin', color: 'bg-cyan-600' },
110
+ USDC: { name: 'USD Coin', color: 'bg-blue-600' },
111
+ USDT: { name: 'Tether', color: 'bg-green-600' },
112
+ };
113
+ const TOKEN_PRICES = {
114
+ SOL: 0, // we don't have SOL price from market data, show 0
115
+ MCC: price,
116
+ USDC: 1,
117
+ USDT: 1,
118
+ };
119
+ function buildHoldings(walletAddr) {
120
+ if (!multiBalance)
121
+ return [];
122
+ const items = [];
123
+ const sources = walletAddr
124
+ ? multiBalance.filter((w) => w.wallet_address === walletAddr)
125
+ : multiBalance;
126
+ for (const wb of sources) {
127
+ const p = wb.portfolio || {};
128
+ const entries = [
129
+ ['SOL', p.sol_balance ?? 0],
130
+ ['MCC', p.mcc_balance ?? 0],
131
+ ['USDC', p.usdc_balance ?? 0],
132
+ ['USDT', p.usdt_balance ?? 0],
133
+ ];
134
+ for (const [sym, bal] of entries) {
135
+ if (bal <= 0)
136
+ continue;
137
+ const meta = TOKEN_META[sym] || { name: sym, color: 'bg-neutral-600' };
138
+ const tp = TOKEN_PRICES[sym] ?? 0;
139
+ const usdVal = bal * tp;
140
+ items.push({
141
+ symbol: sym,
142
+ name: meta.name,
143
+ color: meta.color,
144
+ balance: bal,
145
+ usdValue: usdVal,
146
+ price: tp,
147
+ wallet: wb.wallet_address,
148
+ walletShort: `${wb.wallet_address.slice(0, 4)}...${wb.wallet_address.slice(-4)}`,
149
+ isPrimary: wb.is_primary,
150
+ });
151
+ }
152
+ }
153
+ return items;
154
+ }
155
+ function buildAggregatedHoldings() {
156
+ if (!multiBalance)
157
+ return [];
158
+ const agg = {};
159
+ for (const wb of multiBalance) {
160
+ const p = wb.portfolio || {};
161
+ agg['SOL'] = (agg['SOL'] || 0) + (p.sol_balance ?? 0);
162
+ agg['MCC'] = (agg['MCC'] || 0) + (p.mcc_balance ?? 0);
163
+ agg['USDC'] = (agg['USDC'] || 0) + (p.usdc_balance ?? 0);
164
+ agg['USDT'] = (agg['USDT'] || 0) + (p.usdt_balance ?? 0);
165
+ }
166
+ const items = [];
167
+ for (const [sym, bal] of Object.entries(agg)) {
168
+ if (bal <= 0)
169
+ continue;
170
+ const meta = TOKEN_META[sym] || { name: sym, color: 'bg-neutral-600' };
171
+ const tp = TOKEN_PRICES[sym] ?? 0;
172
+ items.push({
173
+ symbol: sym,
174
+ name: meta.name,
175
+ color: meta.color,
176
+ balance: bal,
177
+ usdValue: bal * tp,
178
+ price: tp,
179
+ });
180
+ }
181
+ return items;
182
+ }
183
+ const isAllTab = activeTab === 'all';
184
+ const showWalletCol = isAllTab && walletList.length > 1;
185
+ const rawHoldings = isAllTab
186
+ ? (walletList.length > 1 ? buildHoldings() : buildAggregatedHoldings())
187
+ : buildHoldings(activeTab);
188
+ // Only show assets >= $1 (matching portal)
189
+ const activeHoldings = rawHoldings.filter((h) => h.usdValue >= 1);
190
+ const activeUsdValue = isAllTab
191
+ ? rawHoldings.reduce((s, h) => s + h.usdValue, 0)
192
+ : rawHoldings.filter((h) => h.wallet === activeTab || !h.wallet).reduce((s, h) => s + h.usdValue, 0);
193
+ const handleRefresh = async () => {
194
+ setIsRefreshing(true);
195
+ try {
196
+ await Promise.all([refreshMCC(), refreshMCD(), refreshMulti()]);
197
+ }
198
+ finally {
199
+ setIsRefreshing(false);
200
+ }
201
+ };
202
+ const anyError = false; // hooks don't expose combined error state cleanly
203
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto p-6 space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white tracking-wider", children: "Wallet" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400 mt-1", children: "On-chain assets & balances" })] }), (0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-2 px-3 py-1.5 text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors disabled:opacity-50", onClick: handleRefresh, disabled: isRefreshing || multiLoading, children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: isRefreshing || multiLoading ? 'animate-spin' : '' }), "Refresh"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between mb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { children: isAllTab ? 'Total Asset Value' : 'Wallet Asset Value' }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setHideBalance(!hideBalance), className: "hover:text-white transition-colors", children: hideBalance ? (0, jsx_runtime_1.jsx)(IconEyeOff, {}) : (0, jsx_runtime_1.jsx)(IconEye, {}) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-baseline gap-2 mb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-3xl font-bold text-white font-mono", children: hideBalance ? '****' : (activeUsdValue > 0 ? fmtUSD(activeUsdValue) : '--') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: hideBalance ? '****' : 'Aggregated from on-chain token balances' })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [walletList.length > 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 mb-4 overflow-x-auto pb-1", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab('all'), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors ${activeTab === 'all'
204
+ ? 'bg-cyan-700 text-white'
205
+ : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: ["Overview (", walletList.length, " wallets)"] }), walletList.map((w) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab(w.wallet_address), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors flex items-center gap-1 ${activeTab === w.wallet_address
206
+ ? 'bg-cyan-700 text-white'
207
+ : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [(0, jsx_runtime_1.jsxs)("code", { className: "font-mono", children: [w.wallet_address.slice(0, 4), "...", w.wallet_address.slice(-4)] }), w.is_primary && (0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 text-[10px]", children: "Primary" })] }, w.wallet_address)))] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "On-Chain Assets" }), multiLoading && (0, jsx_runtime_1.jsx)(Spinner, { size: "w-3 h-3" })] }), multiLoading ? ((0, jsx_runtime_1.jsx)("div", { className: "py-10", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center gap-3", children: [(0, jsx_runtime_1.jsx)(Spinner, { size: "w-6 h-6" }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400", children: "Syncing on-chain data..." }), (0, jsx_runtime_1.jsx)("div", { className: "w-48 h-1 bg-neutral-800 rounded-full overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-full bg-cyan-400/60 rounded-full animate-pulse", style: { width: '60%' } }) })] }) })) : ((0, jsx_runtime_1.jsx)(AssetList, { holdings: activeHoldings, hideBalance: hideBalance, showWalletColumn: showWalletCol, isLoading: multiLoading })), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 pt-3 border-t border-neutral-700 space-y-2", children: isAllTab ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: ["Aggregated on-chain balances across ", walletList.length, " wallet", walletList.length !== 1 ? 's' : '', ". Low-value assets (<$1) are hidden."] })] })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: "Current wallet:" }), (0, jsx_runtime_1.jsx)("code", { className: "text-neutral-400 bg-neutral-800 px-2 py-0.5 rounded font-mono", children: activeTab }), walletList.find((w) => w.wallet_address === activeTab)?.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-cyan-400 bg-cyan-400/20 px-1.5 py-0.5 rounded text-[10px]", children: "Primary" }))] }), (0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/account/${activeTab}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 text-xs flex items-center gap-1", children: ["View on Solscan ", (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-3 h-3" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconInfo, { className: "mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: "Showing on-chain balances for this wallet only. Low-value assets (<$1) are hidden." })] })] })) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "p-4 bg-cyan-400/20 rounded-xl border border-cyan-400/30", children: (0, jsx_runtime_1.jsx)(IconWallet, { className: "w-8 h-8 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "MCC Balance" }), (0, jsx_runtime_1.jsx)("div", { className: "text-4xl font-bold text-white font-mono", children: mccLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mccBalance)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm text-neutral-500 mt-1", children: [mccLoading ? '' : mask(`${fmtUSD(totalUsd)}`), !mccLoading && price > 0 && ((0, jsx_runtime_1.jsxs)("span", { className: "ml-2 text-xs text-neutral-600", children: ["@ ", fmtUSD(price), "/MCC"] }))] })] })] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => onNavigate?.(resolvePath('/mcc/mining')), className: "flex items-center gap-2 px-4 py-2 bg-cyan-700 hover:bg-cyan-600 text-white rounded text-sm transition-colors", children: [(0, jsx_runtime_1.jsx)(IconExternalLink, { className: "h-4 w-4" }), "Mining Records"] })] }), walletList.length > 1 && mccData?.wallets && mccData.wallets.length > 1 && ((0, jsx_runtime_1.jsx)("div", { className: "mt-4 space-y-2", children: mccData.wallets.map((wb) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 font-mono", children: [wb.wallet_address.slice(0, 6), "...", wb.wallet_address.slice(-4)] }), wb.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 px-1.5 py-0.5 rounded", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 font-mono font-bold", children: [mask(fmt(wb.balance ?? 0, 3)), " MCC"] })] }, wb.wallet_address))) }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "MCD Points" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(IconCreditCard, { className: "h-4 w-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "Current Balance" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdAmount, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "MCD" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-2", children: [(0, jsx_runtime_1.jsx)(IconTrendingUp, { className: "h-4 w-4 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: "Total Received" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white font-mono", children: mcdLoading ? (0, jsx_runtime_1.jsx)(Spinner, {}) : mask(fmt(mcdTotalReceived, 6)) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "MCD" })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-4 pt-3 border-t border-neutral-700 space-y-2", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-2 text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsx)(IconGift, { className: "w-3 h-3 mt-0.5 shrink-0" }), (0, jsx_runtime_1.jsxs)("span", { children: ["Income: ", (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: mask(fmt(mcdTotalReceived, 0)) }), ' · ', "Spent: ", (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: mask(fmt(mcdSpent, 0)) }), ' · ', "MCD is distributed daily to eligible miners."] })] }) })] }) }), activeLocks.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconLock, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "Lock Period (14 days)" })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsx)(LockPeriodCard, { lock: lock, hideBalance: hideBalance }, lock.lock_id))) }), (0, jsx_runtime_1.jsxs)("div", { className: "mt-3 text-xs text-neutral-500 font-mono", children: ["Total locked: ", mask(fmt(lockedAmount, 2)), " MCC"] })] }) })), walletList.length > 0 && ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm mb-4", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "tracking-wider", children: "Connected Wallets" })] }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: walletList.map((w) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between p-3 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-sm text-neutral-300 font-mono", children: w.wallet_address }), w.is_primary && ((0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 px-1.5 py-0.5 rounded font-mono", children: "PRIMARY" }))] }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${w.wallet_address}`, target: "_blank", rel: "noopener noreferrer", className: "text-cyan-400 hover:text-cyan-300 transition-colors", children: (0, jsx_runtime_1.jsx)(IconExternalLink, { className: "w-4 h-4" }) })] }, w.wallet_address))) })] }) }))] }));
45
208
  }
package/dist/index.d.ts CHANGED
@@ -26,19 +26,27 @@ export type { KPIRadialChartProps } from './components/kpi-radial-chart';
26
26
  export { MicrocosmDashboardOverview } from './components/dashboard/dashboard-overview';
27
27
  export type { MicrocosmDashboardOverviewProps } from './components/dashboard/dashboard-overview';
28
28
  export { MicrocosmMarketBar } from './components/dashboard/market-overview-bar';
29
+ export type { MicrocosmMarketBarProps } from './components/dashboard/market-overview-bar';
29
30
  export { MicrocosmQuickActions } from './components/dashboard/quick-actions';
30
31
  export type { MicrocosmQuickActionsProps } from './components/dashboard/quick-actions';
31
32
  export { MicrocosmAssetsSummary } from './components/dashboard/assets-summary';
32
33
  export type { MicrocosmAssetsSummaryProps } from './components/dashboard/assets-summary';
33
34
  export { MicrocosmPriceChart } from './components/dashboard/price-chart';
35
+ export type { MicrocosmPriceChartProps } from './components/dashboard/price-chart';
34
36
  export { MicrocosmMintingStats } from './components/dashboard/minting-stats';
37
+ export type { MicrocosmMintingStatsProps } from './components/dashboard/minting-stats';
35
38
  export { MicrocosmMiningWeight } from './components/dashboard/mining-weight';
39
+ export type { MicrocosmMiningWeightProps } from './components/dashboard/mining-weight';
36
40
  export { MicrocosmMyMining } from './components/dashboard/my-mining';
37
41
  export type { MicrocosmMyMiningProps } from './components/dashboard/my-mining';
38
42
  export { MicrocosmEcosystemStats } from './components/dashboard/ecosystem-stats';
43
+ export type { MicrocosmEcosystemStatsProps } from './components/dashboard/ecosystem-stats';
39
44
  export { MicrocosmMCCTokenStats } from './components/dashboard/mcc-token-stats';
45
+ export type { MicrocosmMCCTokenStatsProps } from './components/dashboard/mcc-token-stats';
40
46
  export { MicrocosmMCDStats } from './components/dashboard/mcd-stats';
47
+ export type { MicrocosmMCDStatsProps } from './components/dashboard/mcd-stats';
41
48
  export { MicrocosmLockPeriods } from './components/dashboard/lock-periods';
49
+ export type { MicrocosmLockPeriodsProps } from './components/dashboard/lock-periods';
42
50
  export { MicrocosmFragmentPage } from './components/fragment/fragment-page';
43
51
  export type { MicrocosmFragmentPageProps } from './components/fragment/fragment-page';
44
52
  export { MicrocosmLendingPage } from './components/lending/lending-page';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microcosmmoney/portal-react",
3
- "version": "2.3.4",
3
+ "version": "3.1.0",
4
4
  "description": "Microcosm Portal UI components for React/Next.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,12 +14,12 @@
14
14
  "peerDependencies": {
15
15
  "react": ">=18.0.0",
16
16
  "react-dom": ">=18.0.0",
17
- "recharts": ">=2.0.0"
17
+ "recharts": ">=2.0.0",
18
+ "lucide-react": ">=0.300.0"
18
19
  },
19
20
  "dependencies": {
20
21
  "@microcosmmoney/auth-core": "file:../auth-core",
21
- "@microcosmmoney/auth-react": "file:../auth-react",
22
- "lucide-react": ">=0.300.0"
22
+ "@microcosmmoney/auth-react": "file:../auth-react"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/react": "^18.0.0",