@microcosmmoney/portal-react 3.13.1 → 3.13.3

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 (37) hide show
  1. package/dist/index.d.ts +19 -0
  2. package/dist/index.js +42 -1
  3. package/dist/main-portal/components/dashboard/EcosystemStatsCard.d.ts +1 -0
  4. package/dist/main-portal/components/dashboard/EcosystemStatsCard.js +37 -0
  5. package/dist/main-portal/components/dashboard/LockPeriodsCard.d.ts +1 -0
  6. package/dist/main-portal/components/dashboard/LockPeriodsCard.js +16 -0
  7. package/dist/main-portal/components/dashboard/MCCPriceChart.d.ts +1 -0
  8. package/dist/main-portal/components/dashboard/MCCPriceChart.js +74 -0
  9. package/dist/main-portal/components/dashboard/MCCTokenStatsCard.d.ts +1 -0
  10. package/dist/main-portal/components/dashboard/MCCTokenStatsCard.js +39 -0
  11. package/dist/main-portal/components/dashboard/MCDStatsCard.d.ts +1 -0
  12. package/dist/main-portal/components/dashboard/MCDStatsCard.js +39 -0
  13. package/dist/main-portal/components/dashboard/MarketOverviewBar.d.ts +1 -0
  14. package/dist/main-portal/components/dashboard/MarketOverviewBar.js +141 -0
  15. package/dist/main-portal/components/dashboard/MiningWeightCard.d.ts +1 -0
  16. package/dist/main-portal/components/dashboard/MiningWeightCard.js +56 -0
  17. package/dist/main-portal/components/dashboard/MintingStatsCard.d.ts +1 -0
  18. package/dist/main-portal/components/dashboard/MintingStatsCard.js +29 -0
  19. package/dist/main-portal/components/dashboard/MyAssetsSummary.d.ts +1 -0
  20. package/dist/main-portal/components/dashboard/MyAssetsSummary.js +69 -0
  21. package/dist/main-portal/components/dashboard/MyMiningCard.d.ts +1 -0
  22. package/dist/main-portal/components/dashboard/MyMiningCard.js +46 -0
  23. package/dist/main-portal/components/dashboard/QuickActions.d.ts +1 -0
  24. package/dist/main-portal/components/dashboard/QuickActions.js +49 -0
  25. package/dist/main-portal/components/dashboard/UserDashboardPage.d.ts +1 -0
  26. package/dist/main-portal/components/dashboard/UserDashboardPage.js +36 -0
  27. package/dist/main-portal/components/mainnet/wave-text.d.ts +8 -0
  28. package/dist/main-portal/components/mainnet/wave-text.js +50 -0
  29. package/dist/main-portal/hooks/useMarketData.d.ts +9 -0
  30. package/dist/main-portal/hooks/useMarketData.js +32 -0
  31. package/dist/main-portal/hooks/usePriceHistory.d.ts +9 -0
  32. package/dist/main-portal/hooks/usePriceHistory.js +36 -0
  33. package/dist/main-portal/lib/api/dexscreener.d.ts +126 -0
  34. package/dist/main-portal/lib/api/dexscreener.js +139 -0
  35. package/dist/main-portal/lib/api/geckoterminal.d.ts +10 -0
  36. package/dist/main-portal/lib/api/geckoterminal.js +43 -0
  37. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -107,3 +107,22 @@ export { default as MainPortalQueueStatusPage } from './main-portal/components/q
107
107
  export { default as MainPortalRewardsPage } from './main-portal/components/rewards/RewardsPage';
108
108
  export { default as MainPortalNotificationsPage } from './main-portal/components/notifications/NotificationsPage';
109
109
  export { default as MainPortalMessagesPage } from './main-portal/components/messages/MessagesPage';
110
+ export { default as MainPortalUserDashboardPage } from './main-portal/components/dashboard/UserDashboardPage';
111
+ export { default as MainPortalMarketOverviewBar } from './main-portal/components/dashboard/MarketOverviewBar';
112
+ export { default as MainPortalQuickActions } from './main-portal/components/dashboard/QuickActions';
113
+ export { default as MainPortalMyAssetsSummary } from './main-portal/components/dashboard/MyAssetsSummary';
114
+ export { default as MainPortalMCCPriceChart } from './main-portal/components/dashboard/MCCPriceChart';
115
+ export { default as MainPortalMyMiningCard } from './main-portal/components/dashboard/MyMiningCard';
116
+ export { default as MainPortalMiningWeightCard } from './main-portal/components/dashboard/MiningWeightCard';
117
+ export { default as MainPortalMintingStatsCard } from './main-portal/components/dashboard/MintingStatsCard';
118
+ export { default as MainPortalEcosystemStatsCard } from './main-portal/components/dashboard/EcosystemStatsCard';
119
+ export { default as MainPortalMCCTokenStatsCard } from './main-portal/components/dashboard/MCCTokenStatsCard';
120
+ export { default as MainPortalMCDStatsCard } from './main-portal/components/dashboard/MCDStatsCard';
121
+ export { default as MainPortalLockPeriodsCard } from './main-portal/components/dashboard/LockPeriodsCard';
122
+ export { WaveText } from './main-portal/components/mainnet/wave-text';
123
+ export { WalletProvider, useWallet } from './main-portal/contexts/WalletContext';
124
+ export { MCCPriceProvider, useMCCPrice } from './main-portal/contexts/MCCPriceContext';
125
+ export { useAuth as useMainPortalAuth } from './main-portal/hooks/useAuth';
126
+ export { useMCC as useMainPortalMCC } from './main-portal/hooks/useMCC';
127
+ export { useMCD as useMainPortalMCD } from './main-portal/hooks/useMCD';
128
+ export { useUserRank as useMainPortalUserRank } from './main-portal/hooks/useUserRank';
package/dist/index.js CHANGED
@@ -4,7 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.MicrocosmMiningPage = exports.MicrocosmWalletPage = exports.MicrocosmLendingPage = exports.MicrocosmFragmentPage = exports.MicrocosmLockPeriods = exports.MicrocosmMCDStats = exports.MicrocosmMCCTokenStats = exports.MicrocosmEcosystemStats = exports.MicrocosmMyMining = exports.MicrocosmMiningWeight = exports.MicrocosmMintingStats = exports.MicrocosmPriceChart = exports.MicrocosmAssetsSummary = exports.MicrocosmQuickActions = exports.MicrocosmMarketBar = exports.MicrocosmDashboardOverview = exports.KPIRadialChart = exports.VoteResultBar = exports.MiningProgressBar = exports.TerritoryCard = exports.TerminalTooltip = exports.TerminalInput = exports.TerminalCountdown = exports.TerminalDialog = exports.TerminalTabs = exports.TerminalTable = exports.TerminalProgress = exports.TerminalDataRow = exports.TerminalBadge = exports.TerminalEmpty = exports.TerminalError = exports.TerminalLoading = exports.TerminalPageHeader = exports.TerminalCommand = exports.StatBox = exports.TerminalCard = exports.getMenuDescription = exports.getMenuTitle = exports.resolveMenuPath = exports.getAllMenuItems = exports.microcosmMenuGroups = exports.dashboardMenu = exports.web3OsMenu = exports.blockchainMenu = exports.useT = exports.useTranslations = exports.MicrocosmI18nProvider = exports.useLinkComponent = exports.LinkProvider = exports.MicrocosmMenuSection = void 0;
7
- exports.MainPortalMessagesPage = exports.MainPortalNotificationsPage = exports.MainPortalRewardsPage = exports.MainPortalQueueStatusPage = exports.MainPortalManagerIncomePage = exports.MainPortalProfilePage = exports.MainPortalStationsPage = exports.MainPortalStationDetailPage = exports.MainPortalStationListPage = exports.MainPortalTerritoryNFTBrowser = exports.MainPortalOrganizationPage = exports.MainPortalReincarnationPage = exports.MainPortalVotingPage = exports.MainPortalLendingPage = exports.MainPortalFragmentPage = exports.MainPortalAuctionsPage = exports.MainPortalMCDPage = exports.MainPortalMCCHistory = exports.MainPortalWalletManagement = exports.MainPortalWalletPage = exports.MainPortalMiningModal = exports.MainPortalMiningPage = exports.MicrocosmTwoFactorSettings = exports.MicrocosmEmailChangeCard = exports.MicrocosmProfilePage = exports.MicrocosmRewardsPage = exports.MicrocosmStationListPage = exports.MicrocosmQueueStatusPage = exports.MicrocosmManagerIncomePage = exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = void 0;
7
+ exports.useWallet = exports.WalletProvider = exports.WaveText = exports.MainPortalLockPeriodsCard = exports.MainPortalMCDStatsCard = exports.MainPortalMCCTokenStatsCard = exports.MainPortalEcosystemStatsCard = exports.MainPortalMintingStatsCard = exports.MainPortalMiningWeightCard = exports.MainPortalMyMiningCard = exports.MainPortalMCCPriceChart = exports.MainPortalMyAssetsSummary = exports.MainPortalQuickActions = exports.MainPortalMarketOverviewBar = exports.MainPortalUserDashboardPage = exports.MainPortalMessagesPage = exports.MainPortalNotificationsPage = exports.MainPortalRewardsPage = exports.MainPortalQueueStatusPage = exports.MainPortalManagerIncomePage = exports.MainPortalProfilePage = exports.MainPortalStationsPage = exports.MainPortalStationDetailPage = exports.MainPortalStationListPage = exports.MainPortalTerritoryNFTBrowser = exports.MainPortalOrganizationPage = exports.MainPortalReincarnationPage = exports.MainPortalVotingPage = exports.MainPortalLendingPage = exports.MainPortalFragmentPage = exports.MainPortalAuctionsPage = exports.MainPortalMCDPage = exports.MainPortalMCCHistory = exports.MainPortalWalletManagement = exports.MainPortalWalletPage = exports.MainPortalMiningModal = exports.MainPortalMiningPage = exports.MicrocosmTwoFactorSettings = exports.MicrocosmEmailChangeCard = exports.MicrocosmProfilePage = exports.MicrocosmRewardsPage = exports.MicrocosmStationListPage = exports.MicrocosmQueueStatusPage = exports.MicrocosmManagerIncomePage = exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = void 0;
8
+ exports.useMainPortalUserRank = exports.useMainPortalMCD = exports.useMainPortalMCC = exports.useMainPortalAuth = exports.useMCCPrice = exports.MCCPriceProvider = void 0;
8
9
  var menu_section_1 = require("./components/menu-section");
9
10
  Object.defineProperty(exports, "MicrocosmMenuSection", { enumerable: true, get: function () { return menu_section_1.MicrocosmMenuSection; } });
10
11
  var link_context_1 = require("./link-context");
@@ -156,3 +157,43 @@ var NotificationsPage_1 = require("./main-portal/components/notifications/Notifi
156
157
  Object.defineProperty(exports, "MainPortalNotificationsPage", { enumerable: true, get: function () { return __importDefault(NotificationsPage_1).default; } });
157
158
  var MessagesPage_1 = require("./main-portal/components/messages/MessagesPage");
158
159
  Object.defineProperty(exports, "MainPortalMessagesPage", { enumerable: true, get: function () { return __importDefault(MessagesPage_1).default; } });
160
+ var UserDashboardPage_1 = require("./main-portal/components/dashboard/UserDashboardPage");
161
+ Object.defineProperty(exports, "MainPortalUserDashboardPage", { enumerable: true, get: function () { return __importDefault(UserDashboardPage_1).default; } });
162
+ var MarketOverviewBar_1 = require("./main-portal/components/dashboard/MarketOverviewBar");
163
+ Object.defineProperty(exports, "MainPortalMarketOverviewBar", { enumerable: true, get: function () { return __importDefault(MarketOverviewBar_1).default; } });
164
+ var QuickActions_1 = require("./main-portal/components/dashboard/QuickActions");
165
+ Object.defineProperty(exports, "MainPortalQuickActions", { enumerable: true, get: function () { return __importDefault(QuickActions_1).default; } });
166
+ var MyAssetsSummary_1 = require("./main-portal/components/dashboard/MyAssetsSummary");
167
+ Object.defineProperty(exports, "MainPortalMyAssetsSummary", { enumerable: true, get: function () { return __importDefault(MyAssetsSummary_1).default; } });
168
+ var MCCPriceChart_1 = require("./main-portal/components/dashboard/MCCPriceChart");
169
+ Object.defineProperty(exports, "MainPortalMCCPriceChart", { enumerable: true, get: function () { return __importDefault(MCCPriceChart_1).default; } });
170
+ var MyMiningCard_1 = require("./main-portal/components/dashboard/MyMiningCard");
171
+ Object.defineProperty(exports, "MainPortalMyMiningCard", { enumerable: true, get: function () { return __importDefault(MyMiningCard_1).default; } });
172
+ var MiningWeightCard_1 = require("./main-portal/components/dashboard/MiningWeightCard");
173
+ Object.defineProperty(exports, "MainPortalMiningWeightCard", { enumerable: true, get: function () { return __importDefault(MiningWeightCard_1).default; } });
174
+ var MintingStatsCard_1 = require("./main-portal/components/dashboard/MintingStatsCard");
175
+ Object.defineProperty(exports, "MainPortalMintingStatsCard", { enumerable: true, get: function () { return __importDefault(MintingStatsCard_1).default; } });
176
+ var EcosystemStatsCard_1 = require("./main-portal/components/dashboard/EcosystemStatsCard");
177
+ Object.defineProperty(exports, "MainPortalEcosystemStatsCard", { enumerable: true, get: function () { return __importDefault(EcosystemStatsCard_1).default; } });
178
+ var MCCTokenStatsCard_1 = require("./main-portal/components/dashboard/MCCTokenStatsCard");
179
+ Object.defineProperty(exports, "MainPortalMCCTokenStatsCard", { enumerable: true, get: function () { return __importDefault(MCCTokenStatsCard_1).default; } });
180
+ var MCDStatsCard_1 = require("./main-portal/components/dashboard/MCDStatsCard");
181
+ Object.defineProperty(exports, "MainPortalMCDStatsCard", { enumerable: true, get: function () { return __importDefault(MCDStatsCard_1).default; } });
182
+ var LockPeriodsCard_1 = require("./main-portal/components/dashboard/LockPeriodsCard");
183
+ Object.defineProperty(exports, "MainPortalLockPeriodsCard", { enumerable: true, get: function () { return __importDefault(LockPeriodsCard_1).default; } });
184
+ var wave_text_1 = require("./main-portal/components/mainnet/wave-text");
185
+ Object.defineProperty(exports, "WaveText", { enumerable: true, get: function () { return wave_text_1.WaveText; } });
186
+ var WalletContext_1 = require("./main-portal/contexts/WalletContext");
187
+ Object.defineProperty(exports, "WalletProvider", { enumerable: true, get: function () { return WalletContext_1.WalletProvider; } });
188
+ Object.defineProperty(exports, "useWallet", { enumerable: true, get: function () { return WalletContext_1.useWallet; } });
189
+ var MCCPriceContext_1 = require("./main-portal/contexts/MCCPriceContext");
190
+ Object.defineProperty(exports, "MCCPriceProvider", { enumerable: true, get: function () { return MCCPriceContext_1.MCCPriceProvider; } });
191
+ Object.defineProperty(exports, "useMCCPrice", { enumerable: true, get: function () { return MCCPriceContext_1.useMCCPrice; } });
192
+ var useAuth_1 = require("./main-portal/hooks/useAuth");
193
+ Object.defineProperty(exports, "useMainPortalAuth", { enumerable: true, get: function () { return useAuth_1.useAuth; } });
194
+ var useMCC_1 = require("./main-portal/hooks/useMCC");
195
+ Object.defineProperty(exports, "useMainPortalMCC", { enumerable: true, get: function () { return useMCC_1.useMCC; } });
196
+ var useMCD_1 = require("./main-portal/hooks/useMCD");
197
+ Object.defineProperty(exports, "useMainPortalMCD", { enumerable: true, get: function () { return useMCD_1.useMCD; } });
198
+ var useUserRank_1 = require("./main-portal/hooks/useUserRank");
199
+ Object.defineProperty(exports, "useMainPortalUserRank", { enumerable: true, get: function () { return useUserRank_1.useUserRank; } });
@@ -0,0 +1 @@
1
+ export default function EcosystemStatsCard(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = EcosystemStatsCard;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const useStats_1 = require("../../hooks/useStats");
8
+ const lucide_react_1 = require("lucide-react");
9
+ const card_1 = require("../ui/card");
10
+ function EcosystemStatsCard() {
11
+ const { data: overview, loading: overviewLoading } = (0, useStats_1.useOverviewStats)();
12
+ const { data: userLevels, loading: levelsLoading } = (0, useStats_1.useUserLevelStats)();
13
+ const loading = overviewLoading || levelsLoading;
14
+ const stats = [
15
+ {
16
+ label: 'total_users',
17
+ value: overview?.total_users ?? userLevels?.total_users,
18
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-3.5 h-3.5 text-cyan-400" }),
19
+ },
20
+ {
21
+ label: '24h_active',
22
+ value: overview?.active_users_24h,
23
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Activity, { className: "w-3.5 h-3.5 text-cyan-400" }),
24
+ },
25
+ {
26
+ label: 'miners',
27
+ value: userLevels?.miners_and_above,
28
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Pickaxe, { className: "w-3.5 h-3.5 text-cyan-400" }),
29
+ },
30
+ {
31
+ label: 'territories',
32
+ value: overview?.total_territories,
33
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-3.5 h-3.5 text-cyan-400" }),
34
+ },
35
+ ];
36
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Globe, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[10px] sm:text-xs font-mono tracking-wider", children: "ECOSYSTEM" })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-cyan-400" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:gap-3", children: stats.map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] sm:text-[10px] text-neutral-400 font-mono tracking-wider", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm sm:text-xl font-bold font-mono text-white", children: s.value != null ? s.value.toLocaleString() : '--' })] }, s.label))) }))] }) }));
37
+ }
@@ -0,0 +1 @@
1
+ export default function LockPeriodsCard(): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = LockPeriodsCard;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const WalletContext_1 = require("../../contexts/WalletContext");
8
+ const card_1 = require("../ui/card");
9
+ const time_remaining_1 = require("../ui/time-remaining");
10
+ function LockPeriodsCard() {
11
+ const { lockPeriods } = (0, WalletContext_1.useWallet)();
12
+ const activeLocks = Array.isArray(lockPeriods) ? lockPeriods.filter((p) => p.status === 'locked') : [];
13
+ if (activeLocks.length === 0)
14
+ return null;
15
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsx)("div", { className: "space-y-2 sm:space-y-3", children: activeLocks.map((lock) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2.5 sm:p-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-start mb-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0 flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-[10px] sm:text-xs font-mono tracking-wider truncate", children: lock.reason }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-xl font-bold font-mono text-cyan-400 mt-1", children: [lock.amount.toLocaleString(), " MCC"] })] }), (0, jsx_runtime_1.jsx)("span", { className: "px-2 py-0.5 bg-cyan-400/20 text-cyan-400 text-xs font-mono rounded", children: "LOCKED" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-500 space-y-1 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: ["unlock_at: ", (0, jsx_runtime_1.jsx)(time_remaining_1.FormattedDateTime, { dateTime: lock.lock_end })] }), (0, jsx_runtime_1.jsxs)("div", { children: ["remaining:", ' ', (0, jsx_runtime_1.jsx)(time_remaining_1.LockDaysRemaining, { endTime: lock.lock_end, className: "text-cyan-400" })] })] })] }, lock.lock_id))) }) }) }));
16
+ }
@@ -0,0 +1 @@
1
+ export default function MCCPriceChart(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MCCPriceChart;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const usePriceHistory_1 = require("../../hooks/usePriceHistory");
9
+ const recharts_1 = require("recharts");
10
+ const TIME_RANGES = [
11
+ { label: '1D', value: '1D' },
12
+ { label: '7D', value: '7D' },
13
+ { label: '30D', value: '30D' },
14
+ { label: '1Y', value: '1Y' },
15
+ ];
16
+ function computeChange(data) {
17
+ if (!data || data.length < 2)
18
+ return null;
19
+ const prices = data
20
+ .map((d) => d.market_price ?? d.close ?? 0)
21
+ .filter((p) => p > 0);
22
+ if (prices.length < 2)
23
+ return null;
24
+ const first = prices[0];
25
+ const last = prices[prices.length - 1];
26
+ if (first <= 0)
27
+ return null;
28
+ return ((last - first) / first) * 100;
29
+ }
30
+ function MCCPriceChart() {
31
+ const [range, setRange] = (0, react_1.useState)('7D');
32
+ const { data, loading } = (0, usePriceHistory_1.usePriceHistory)(range);
33
+ const [rangeChanges, setRangeChanges] = (0, react_1.useState)({});
34
+ (0, react_1.useEffect)(() => {
35
+ const ranges = ['1D', '7D', '30D', '1Y'];
36
+ ranges.forEach(async (r) => {
37
+ try {
38
+ const res = await fetch(`/api/stats/price-history?range=${r}`);
39
+ const json = await res.json();
40
+ if (json.success && json.data) {
41
+ const change = computeChange(json.data);
42
+ setRangeChanges(prev => ({ ...prev, [r]: change }));
43
+ }
44
+ }
45
+ catch { }
46
+ });
47
+ }, []);
48
+ const chartData = (data?.map((item) => ({
49
+ time: item.timestamp * 1000,
50
+ price: item.market_price ?? item.close ?? 0,
51
+ })).filter((d) => d.price > 0)) || [];
52
+ const prices = chartData.map(d => d.price);
53
+ const minPrice = prices.length > 0 ? Math.min(...prices) * 0.995 : 0;
54
+ const maxPrice = prices.length > 0 ? Math.max(...prices) * 1.005 : 1;
55
+ const currentPrice = prices.length > 0 ? prices[prices.length - 1] : null;
56
+ const formatTime = (ts) => {
57
+ const d = new Date(ts);
58
+ if (range === '1D')
59
+ return d.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });
60
+ return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
61
+ };
62
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg overflow-hidden hover:border-cyan-400/50 dash-card", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col sm:flex-row items-stretch border-b border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-1 flex-col justify-center gap-1 px-3 py-2 sm:px-6 sm:py-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-white font-mono font-bold text-sm sm:text-base", children: "MCC Price Trend" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 font-mono text-xs", children: [currentPrice ? `$${currentPrice.toFixed(4)}` : '--', rangeChanges[range] != null && ((0, jsx_runtime_1.jsxs)("span", { className: `ml-2 ${rangeChanges[range] >= 0 ? 'text-cyan-400' : 'text-red-400'}`, children: [rangeChanges[range] >= 0 ? '+' : '', rangeChanges[range].toFixed(2), "%"] }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex", children: TIME_RANGES.map((tr) => {
63
+ const isActive = range === tr.value;
64
+ const change = rangeChanges[tr.value];
65
+ const isPositive = change != null && change >= 0;
66
+ return ((0, jsx_runtime_1.jsxs)("button", { "data-active": isActive, className: `relative z-10 flex flex-1 flex-col justify-center gap-1 border-t border-neutral-700 px-4 py-3 text-left even:border-l even:border-neutral-700 sm:border-t-0 sm:border-l sm:border-neutral-700 sm:px-5 sm:py-4 transition-colors ${isActive ? 'bg-neutral-800' : 'hover:bg-neutral-800/50'}`, onClick: () => setRange(tr.value), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-[10px] text-neutral-500 font-mono tracking-wider", children: tr.label }), change == null ? ((0, jsx_runtime_1.jsx)("span", { className: "text-lg font-bold leading-none text-neutral-600 font-mono sm:text-xl", children: "..." })) : ((0, jsx_runtime_1.jsxs)("span", { className: `text-lg font-bold leading-none font-mono sm:text-xl tabular-nums ${isPositive ? 'text-cyan-400' : 'text-red-400'}`, children: [isPositive ? '+' : '', change.toFixed(2), "%"] }))] }, tr.value));
67
+ }) })] }), (0, jsx_runtime_1.jsx)("div", { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsx)("div", { className: "h-[220px] xs:h-[280px] sm:h-[360px]", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full bg-neutral-800 rounded animate-pulse" })) : chartData.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full flex items-center justify-center text-neutral-500 font-mono text-sm", children: "No price data available" })) : ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, { data: chartData, margin: { top: 5, right: 5, left: -15, bottom: 0 }, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: "priceGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "5%", stopColor: "#22d3ee", stopOpacity: 0.3 }), (0, jsx_runtime_1.jsx)("stop", { offset: "95%", stopColor: "#22d3ee", stopOpacity: 0 })] }) }), (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { vertical: false, strokeDasharray: "3 3", stroke: "#404040" }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: "time", tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: formatTime }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: (v) => `$${v.toFixed(3)}`, domain: [minPrice, maxPrice] }), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { contentStyle: {
68
+ backgroundColor: '#171717',
69
+ border: '1px solid #404040',
70
+ borderRadius: '6px',
71
+ fontFamily: 'monospace',
72
+ fontSize: '11px',
73
+ }, labelFormatter: (ts) => new Date(ts).toLocaleString(), formatter: (value) => [`$${value.toFixed(4)}`, 'Price'] }), (0, jsx_runtime_1.jsx)(recharts_1.Area, { type: "monotone", dataKey: "price", stroke: "#22d3ee", strokeWidth: 2, fill: "url(#priceGradient)" })] }) })) }) })] }));
74
+ }
@@ -0,0 +1 @@
1
+ export default function MCCTokenStatsCard(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MCCTokenStatsCard;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const useStats_1 = require("../../hooks/useStats");
8
+ const lucide_react_1 = require("lucide-react");
9
+ const card_1 = require("../ui/card");
10
+ function MCCTokenStatsCard() {
11
+ const { data, loading } = (0, useStats_1.useMCCStats)();
12
+ const stats = [
13
+ {
14
+ label: 'holders',
15
+ value: data?.holders_count,
16
+ format: (v) => v.toLocaleString(),
17
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-3.5 h-3.5 text-cyan-400" }),
18
+ },
19
+ {
20
+ label: 'circulating',
21
+ value: data?.circulating_supply,
22
+ format: (v) => `${(v / 1e6).toFixed(2)}M`,
23
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-3.5 h-3.5 text-cyan-400" }),
24
+ },
25
+ {
26
+ label: 'total_mining_tx',
27
+ value: data?.total_mining_count,
28
+ format: (v) => v.toLocaleString(),
29
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Pickaxe, { className: "w-3.5 h-3.5 text-cyan-400" }),
30
+ },
31
+ {
32
+ label: 'total_mining_usdc',
33
+ value: data?.total_mining_usdc,
34
+ format: (v) => `$${(v / 1e6).toFixed(2)}`,
35
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-3.5 h-3.5 text-cyan-400" }),
36
+ },
37
+ ];
38
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[10px] sm:text-xs font-mono tracking-wider", children: "MCC_STATS" })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-cyan-400" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:gap-3", children: stats.map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] sm:text-[10px] text-neutral-400 font-mono tracking-wider", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm sm:text-lg font-bold font-mono text-white truncate", children: s.value != null ? s.format(s.value) : '--' })] }, s.label))) }))] }) }));
39
+ }
@@ -0,0 +1 @@
1
+ export default function MCDStatsCard(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MCDStatsCard;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const useStats_1 = require("../../hooks/useStats");
8
+ const lucide_react_1 = require("lucide-react");
9
+ const card_1 = require("../ui/card");
10
+ function MCDStatsCard() {
11
+ const { data, loading } = (0, useStats_1.useMCDStats)();
12
+ const stats = [
13
+ {
14
+ label: 'holders',
15
+ value: data?.holders_count,
16
+ format: (v) => v.toLocaleString(),
17
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Users, { className: "w-3.5 h-3.5 text-cyan-400" }),
18
+ },
19
+ {
20
+ label: 'active_vaults',
21
+ value: data?.active_vaults,
22
+ format: (v) => v.toLocaleString(),
23
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-3.5 h-3.5 text-cyan-400" }),
24
+ },
25
+ {
26
+ label: 'daily_distribution',
27
+ value: data?.daily_distribution,
28
+ format: (v) => v > 0 ? v.toLocaleString('en-US', { maximumFractionDigits: 2 }) : '0',
29
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Clock, { className: "w-3.5 h-3.5 text-cyan-400" }),
30
+ },
31
+ {
32
+ label: 'total_vault_balance',
33
+ value: data?.total_vault_balance,
34
+ format: (v) => v > 0 ? `${(v / 1e6).toFixed(2)}M` : '0',
35
+ icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Banknote, { className: "w-3.5 h-3.5 text-cyan-400" }),
36
+ },
37
+ ];
38
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Banknote, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[10px] sm:text-xs font-mono tracking-wider", children: "MCD_STATS" })] }), loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-cyan-400" }) })) : ((0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 gap-2 sm:gap-3", children: stats.map((s) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 mb-1", children: [s.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-[9px] sm:text-[10px] text-neutral-400 font-mono tracking-wider", children: s.label })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-sm sm:text-lg font-bold font-mono text-white truncate", children: s.value != null ? s.format(s.value) : '--' })] }, s.label))) }))] }) }));
39
+ }
@@ -0,0 +1 @@
1
+ export default function MarketOverviewBar(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MarketOverviewBar;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const useMarketData_1 = require("../../hooks/useMarketData");
9
+ const MCCPriceContext_1 = require("../../contexts/MCCPriceContext");
10
+ function MarketOverviewBar() {
11
+ const { data, loading } = (0, useMarketData_1.useMarketData)();
12
+ const ticker = (0, MCCPriceContext_1.useMCCPrice)();
13
+ const [epoch, setEpoch] = (0, react_1.useState)(null);
14
+ const [buybackPoolUsd, setBuybackPoolUsd] = (0, react_1.useState)(null);
15
+ (0, react_1.useEffect)(() => {
16
+ fetch('/api/stats/custody-vaults')
17
+ .then(r => r.json())
18
+ .then(json => {
19
+ if (json.success !== false && json.data) {
20
+ const d = json.data;
21
+ if (d.epoch)
22
+ setEpoch(d.epoch);
23
+ if (d.buyback?.pool_usd_balance != null)
24
+ setBuybackPoolUsd(d.buyback.pool_usd_balance);
25
+ }
26
+ })
27
+ .catch(() => { });
28
+ }, []);
29
+ if (loading || !data) {
30
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 mb-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: Array.from({ length: 6 }).map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2.5 sm:p-4 animate-pulse", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 bg-neutral-800 rounded w-16 mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "h-5 sm:h-6 bg-neutral-800 rounded w-20 sm:w-24" })] }, i))) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: Array.from({ length: 6 }).map((_, i) => ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2.5 sm:p-4 animate-pulse", children: [(0, jsx_runtime_1.jsx)("div", { className: "h-3 bg-neutral-800 rounded w-16 mb-2" }), (0, jsx_runtime_1.jsx)("div", { className: "h-5 sm:h-6 bg-neutral-800 rounded w-20 sm:w-24" })] }, i))) })] }));
31
+ }
32
+ const displayPrice = ticker.price ?? data.price;
33
+ const priceChange24h = data.priceChange.h24;
34
+ const isPositive = priceChange24h >= 0;
35
+ const miningPrice = ticker.miningPrice ?? 0;
36
+ const basePrice = ticker.basePrice ?? 0;
37
+ const epochYield = epoch?.epoch_yield ?? 0;
38
+ const epochMinted = epoch?.epoch_minted ?? 0;
39
+ const epochRemaining = epochYield > epochMinted ? epochYield - epochMinted : 0;
40
+ const miningVault = epoch?.mining_vault_mcc ?? 0;
41
+ const marketStats = [
42
+ {
43
+ label: 'MCC_PRICE',
44
+ value: `$${displayPrice.toFixed(4)}`,
45
+ sub: `${isPositive ? '~+' : '~'}${priceChange24h.toFixed(2)}%`,
46
+ subColor: isPositive ? 'text-cyan-400' : 'text-red-400',
47
+ color: 'text-cyan-400',
48
+ },
49
+ {
50
+ label: 'MINING_PRICE',
51
+ value: miningPrice > 0 ? `$${miningPrice.toFixed(4)}` : '--',
52
+ sub: basePrice > 0 ? `base: $${basePrice.toFixed(4)}` : '',
53
+ subColor: 'text-neutral-500',
54
+ color: 'text-cyan-300',
55
+ },
56
+ {
57
+ label: '24H_VOLUME',
58
+ value: `$${formatCompact(data.volume.h24)}`,
59
+ color: 'text-white',
60
+ },
61
+ {
62
+ label: 'LIQUIDITY',
63
+ value: data.liquidityUsd > 0 ? `$${formatCompact(data.liquidityUsd)}` : '-',
64
+ color: 'text-white',
65
+ },
66
+ {
67
+ label: 'FDV',
68
+ value: data.fdvUsd > 0 ? `$${formatCompact(data.fdvUsd)}` : '-',
69
+ color: 'text-white',
70
+ },
71
+ {
72
+ label: 'BUY/SELL',
73
+ value: `${data.txns?.h24?.buys ?? 0}/${data.txns?.h24?.sells ?? 0}`,
74
+ sub: `${(data.txns?.h24?.buys ?? 0) + (data.txns?.h24?.sells ?? 0)} trades`,
75
+ subColor: 'text-neutral-500',
76
+ color: 'text-white',
77
+ },
78
+ ];
79
+ const protocolStats = [
80
+ {
81
+ label: 'EPOCH',
82
+ value: epoch ? `#${epoch.current_epoch}` : '--',
83
+ sub: '2140 Protocol',
84
+ subColor: 'text-neutral-500',
85
+ color: 'text-cyan-400',
86
+ },
87
+ {
88
+ label: 'EPOCH_YIELD',
89
+ value: epochYield > 0 ? formatMCC(epochYield) : '--',
90
+ sub: 'MCC / epoch',
91
+ subColor: 'text-neutral-500',
92
+ color: 'text-white',
93
+ },
94
+ {
95
+ label: 'EPOCH_MINTED',
96
+ value: epochMinted > 0 ? formatMCC(epochMinted) : '0',
97
+ sub: epochYield > 0 ? `${((epochMinted / epochYield) * 100).toFixed(1)}% used` : '',
98
+ subColor: 'text-neutral-500',
99
+ color: 'text-cyan-300',
100
+ },
101
+ {
102
+ label: 'REMAINING',
103
+ value: formatMCC(epochRemaining),
104
+ sub: 'this epoch',
105
+ subColor: 'text-neutral-500',
106
+ color: 'text-white',
107
+ },
108
+ {
109
+ label: 'MINING_VAULT',
110
+ value: miningVault > 0 ? formatCompact(miningVault) : '--',
111
+ sub: 'MCC reserve',
112
+ subColor: 'text-neutral-500',
113
+ color: 'text-white',
114
+ },
115
+ {
116
+ label: 'POOL_BALANCE',
117
+ value: buybackPoolUsd != null ? `$${formatCompact(buybackPoolUsd)}` : '--',
118
+ sub: 'USDC+USDT',
119
+ subColor: 'text-neutral-500',
120
+ color: 'text-white',
121
+ },
122
+ ];
123
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 sm:space-y-3 mb-4 sm:mb-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: marketStats.map((stat) => ((0, jsx_runtime_1.jsx)(StatCard, { ...stat }, stat.label))) }), (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 xs:grid-cols-3 lg:grid-cols-6 gap-2 sm:gap-3", children: protocolStats.map((stat) => ((0, jsx_runtime_1.jsx)(StatCard, { ...stat }, stat.label))) })] }));
124
+ }
125
+ function StatCard({ label, value, sub, subColor, color }) {
126
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg p-2.5 sm:p-4 hover:border-cyan-400/50 dash-card", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-[9px] sm:text-[10px] font-mono mb-0.5 sm:mb-1 tracking-wider", children: label }), (0, jsx_runtime_1.jsx)("div", { className: `text-sm xs:text-base sm:text-xl font-bold font-mono truncate ${color}`, children: value }), sub && ((0, jsx_runtime_1.jsx)("div", { className: `text-[10px] sm:text-xs font-mono mt-0.5 truncate ${subColor || 'text-neutral-500'}`, children: sub }))] }));
127
+ }
128
+ function formatCompact(value) {
129
+ if (value >= 1000000)
130
+ return `${(value / 1000000).toFixed(2)}M`;
131
+ if (value >= 1000)
132
+ return `${(value / 1000).toFixed(1)}K`;
133
+ return value.toFixed(2);
134
+ }
135
+ function formatMCC(value) {
136
+ if (value >= 1000000)
137
+ return `${(value / 1000000).toFixed(2)}M`;
138
+ if (value >= 1000)
139
+ return `${(value / 1000).toFixed(2)}K`;
140
+ return value.toFixed(2);
141
+ }
@@ -0,0 +1 @@
1
+ export default function MiningWeightCard(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MiningWeightCard;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const react_1 = require("react");
8
+ const WalletContext_1 = require("../../contexts/WalletContext");
9
+ const api_1 = require("../../lib/api");
10
+ const card_1 = require("../ui/card");
11
+ const api_2 = require("../../lib/types/api");
12
+ const lucide_react_1 = require("lucide-react");
13
+ const RANK_LABELS = {
14
+ [api_2.UserRank.MINER]: 'Miner',
15
+ [api_2.UserRank.COMMANDER]: 'Commander 指挥官',
16
+ [api_2.UserRank.PIONEER]: 'Pioneer 先驱',
17
+ [api_2.UserRank.WARDEN]: 'Warden 守望者',
18
+ [api_2.UserRank.ADMIRAL]: 'Admiral 元帅',
19
+ };
20
+ const RANK_COLORS = {
21
+ [api_2.UserRank.MINER]: 'text-cyan-300',
22
+ [api_2.UserRank.COMMANDER]: 'text-white',
23
+ [api_2.UserRank.PIONEER]: 'text-cyan-400',
24
+ [api_2.UserRank.WARDEN]: 'text-cyan-300',
25
+ [api_2.UserRank.ADMIRAL]: 'text-cyan-300',
26
+ };
27
+ function getCompanionYield(rank) {
28
+ if (!rank)
29
+ return [];
30
+ return [
31
+ { label: '政务官', share: '40%', type: 'MCC', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-3.5 h-3.5 text-cyan-400" }) },
32
+ { label: 'LP', share: '30%', type: 'MCC', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.TreePine, { className: "w-3.5 h-3.5 text-cyan-300" }) },
33
+ { label: '领地金库', share: '30%', type: 'MCD', icon: (0, jsx_runtime_1.jsx)(lucide_react_1.Building2, { className: "w-3.5 h-3.5 text-cyan-300" }) },
34
+ ];
35
+ }
36
+ function MiningWeightCard() {
37
+ const { userRank, holdings, loading } = (0, WalletContext_1.useWallet)();
38
+ const [techBonus, setTechBonus] = (0, react_1.useState)(null);
39
+ const loadTechBonus = (0, react_1.useCallback)(async () => {
40
+ try {
41
+ const res = await (0, api_1.fetchApi)('/organization-service/tech-bonus/bonus');
42
+ if (res.success && res.bonuses) {
43
+ setTechBonus(res.bonuses);
44
+ }
45
+ else if (res.success && res.data) {
46
+ setTechBonus(res.data);
47
+ }
48
+ }
49
+ catch { /* ignore */ }
50
+ }, []);
51
+ (0, react_1.useEffect)(() => { loadTechBonus(); }, [loadTechBonus]);
52
+ const miningDays = holdings.station + holdings.matrix + holdings.sector + holdings.system;
53
+ const companionYield = getCompanionYield(userRank);
54
+ const techDiscount = techBonus?.total_bonus ? `${techBonus.total_bonus > 0 ? '-' : ''}${Math.abs(techBonus.total_bonus)}%` : '--';
55
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-12", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-cyan-400" }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 sm:space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 sm:gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Pickaxe, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[9px] sm:text-xs font-mono tracking-wider", children: "level" })] }), (0, jsx_runtime_1.jsx)("div", { className: `text-xs sm:text-sm font-bold font-mono truncate ${userRank ? RANK_COLORS[userRank] : 'text-neutral-500'}`, children: userRank ? RANK_LABELS[userRank] : 'N/A' })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 sm:gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TreePine, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[9px] sm:text-xs font-mono tracking-wider", children: "tech_bonus" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-bold font-mono text-white", children: techDiscount })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 sm:gap-1.5 mb-1", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Pickaxe, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[9px] sm:text-xs font-mono tracking-wider", children: "mining_days" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-bold font-mono text-white", children: miningDays })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-neutral-400 text-[10px] sm:text-xs font-mono tracking-wider mb-2 sm:mb-3", children: "ecosystem_distribution (\u4F34\u751F\u77FF)" }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] text-neutral-500 font-mono mb-2 sm:mb-3 hidden xs:block", children: "\u6BCF\u6B21\u6316\u77FF\u540C\u6B65\u8FDB\u884C\u4F34\u751F\u77FF\uFF0C\u81EA\u52A8\u6CE8\u5165\u9886\u5730\u751F\u6001" }), (0, jsx_runtime_1.jsx)("div", { className: "space-y-2", children: companionYield.map((row) => ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between px-2 py-1.5 bg-neutral-900 rounded hover:bg-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [row.icon, (0, jsx_runtime_1.jsx)("span", { className: "text-xs font-mono text-neutral-300", children: row.label })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs font-mono font-bold text-white", children: row.share }), (0, jsx_runtime_1.jsx)("span", { className: `text-[10px] font-mono px-1.5 py-0.5 rounded ${row.type === 'MCC' ? 'bg-cyan-400/20 text-cyan-400' : 'bg-cyan-400/20 text-cyan-400'}`, children: row.type })] })] }, row.label))) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-[10px] text-neutral-500 font-mono space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { children: "\u6316\u77FF\u4EF7\u683C = \u5E02\u573A\u4EF7 \u00D7 \u6316\u77FF\u500D\u6570 (\u79D1\u6280\u52A0\u6210\u53EF\u63D0\u5347\u4EA7\u51FA)" }), (0, jsx_runtime_1.jsx)("div", { children: "\u4F34\u751F\u77FF\u4E0E\u7528\u6237\u6316\u77FF\u91CF\u540C\u6B65\u8FDB\u884C" })] })] })) }) }));
56
+ }
@@ -0,0 +1 @@
1
+ export default function MintingStatsCard(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ // AI-generated · AI-managed · AI-maintained
3
+ 'use client';
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.default = MintingStatsCard;
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const card_1 = require("../ui/card");
8
+ const useStats_1 = require("../../hooks/useStats");
9
+ const MCCPriceContext_1 = require("../../contexts/MCCPriceContext");
10
+ const lucide_react_1 = require("lucide-react");
11
+ function MintingStatsCard() {
12
+ const { data: mccStats, loading: mccLoading } = (0, useStats_1.useMCCStats)();
13
+ const ticker = (0, MCCPriceContext_1.useMCCPrice)();
14
+ const loading = mccLoading;
15
+ // total_minted from blockchain stats (raw 9-decimal → human)
16
+ const totalMinted = mccStats?.circulating_supply
17
+ ?? (mccStats?.genesis_pool_balance ? 1000000000 - mccStats.genesis_pool_balance : 0);
18
+ const currentStage = mccStats?.current_phase ?? 0;
19
+ const difficultyRatio = 2 ** currentStage;
20
+ const nextHalving = mccStats?.next_halving_at ?? 100000000;
21
+ const miningPrice = ticker.miningPrice ?? 0;
22
+ return ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 h-full hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-cyan-400" }) })) : ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 sm:space-y-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4 text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-[10px] sm:text-xs font-mono tracking-wider", children: "MINTING_STATS" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-2 sm:gap-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 font-mono tracking-wider mb-1", children: "total_minted" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm sm:text-xl font-bold font-mono text-white truncate", children: [totalMinted > 0
23
+ ? totalMinted.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
24
+ : '0', " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 font-mono tracking-wider mb-1", children: "mining_price" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-sm sm:text-xl font-bold font-mono text-cyan-400", children: ["$", miningPrice > 0 ? miningPrice.toFixed(4) : '--'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] text-neutral-500 font-mono", children: "oracle \u00D7 4" })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2 text-xs sm:text-sm font-mono", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: "next_halving" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [nextHalving > totalMinted
25
+ ? (nextHalving - totalMinted).toLocaleString('en-US', { maximumFractionDigits: 0 })
26
+ : 'N/A', " MCC"] })] }), (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: {
27
+ width: nextHalving > 0 ? `${Math.min((totalMinted % nextHalving) / nextHalving * 100, 100)}%` : '0%',
28
+ } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mt-2 text-[10px] sm:text-xs text-neutral-500 font-mono", children: [(0, jsx_runtime_1.jsxs)("span", { children: ["phase: ", currentStage, " | difficulty: ", difficultyRatio, ":1"] }), (0, jsx_runtime_1.jsxs)("span", { children: ["threshold: ", (nextHalving / 1e6).toFixed(0), "M"] })] })] })] })) }) }));
29
+ }
@@ -0,0 +1 @@
1
+ export default function MyAssetsSummary(): import("react/jsx-runtime").JSX.Element;