@microcosmmoney/portal-react 3.5.0 → 3.5.1
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.
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface MicrocosmReincarnationPageProps {
|
|
2
|
+
basePath?: string;
|
|
3
|
+
onNavigate?: (path: string) => void;
|
|
4
|
+
title?: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function MicrocosmReincarnationPage({ title, subtitle, }?: MicrocosmReincarnationPageProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.MicrocosmReincarnationPage = MicrocosmReincarnationPage;
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const auth_react_1 = require("@microcosmmoney/auth-react");
|
|
8
|
+
const terminal_1 = require("../terminal");
|
|
9
|
+
const POOL_ADDRESS = 'REDEh89TzpwCtoWQuuNPtxskrVoUDQgowR7e7sZpWj9';
|
|
10
|
+
const USDT_VAULT = 'BnHA9jSm88wzQS4c2nCgTXch1Byzc3FWn2G7Wgrvazy3';
|
|
11
|
+
const USDC_VAULT = '5L8vPTvGH14keLq4R6CGGvSFksZFjb7bRPXarCwZbmUA';
|
|
12
|
+
function CopyButton({ text }) {
|
|
13
|
+
const [copied, setCopied] = (0, react_1.useState)(false);
|
|
14
|
+
const handleCopy = async () => {
|
|
15
|
+
try {
|
|
16
|
+
await navigator.clipboard.writeText(text);
|
|
17
|
+
setCopied(true);
|
|
18
|
+
setTimeout(() => setCopied(false), 2000);
|
|
19
|
+
}
|
|
20
|
+
catch { }
|
|
21
|
+
};
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("button", { onClick: handleCopy, className: "text-neutral-400 hover:text-white transition-colors text-xs", "aria-label": "Copy", children: copied ? '✓' : '⧉' }));
|
|
23
|
+
}
|
|
24
|
+
function formatNumber(num, decimals = 2) {
|
|
25
|
+
if (num >= 1000000)
|
|
26
|
+
return (num / 1000000).toFixed(2) + 'M';
|
|
27
|
+
return num.toLocaleString('en-US', { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
28
|
+
}
|
|
29
|
+
function MicrocosmReincarnationPage({ title = 'Reincarnation Pool', subtitle = '2140 Protocol autonomous market making', } = {}) {
|
|
30
|
+
const { data: priceData, loading } = (0, auth_react_1.useMCCPrice)({ refetchInterval: 60000 });
|
|
31
|
+
const basePrice = priceData?.price ?? 0;
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6 font-mono", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: title }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: subtitle })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-4", children: [(0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "BASE PRICE" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-cyan-400", children: [loading ? '—' : formatNumber(basePrice, 4), (0, jsx_runtime_1.jsx)("span", { className: "text-sm font-normal text-neutral-500 ml-1", children: "USD" })] })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "PROTOCOL" }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white", children: "2140" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "EMA weighted" })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "EPOCH" }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-white", children: "1h" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "Auto buyback" })] }), (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: "DEX" }), (0, jsx_runtime_1.jsx)("div", { className: "text-2xl font-bold text-cyan-400", children: "Raydium" }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500 mt-1", children: "CPMM pool" })] })] }), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: "Contract Addresses", children: (0, jsx_runtime_1.jsxs)("div", { className: "space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "Reincarnation Pool PDA" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-sm text-cyan-400 break-all", children: POOL_ADDRESS }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 shrink-0", children: [(0, jsx_runtime_1.jsx)(CopyButton, { text: POOL_ADDRESS }), (0, jsx_runtime_1.jsx)("a", { href: `https://solscan.io/account/${POOL_ADDRESS}`, target: "_blank", rel: "noopener noreferrer", className: "text-neutral-400 hover:text-white text-xs", children: "\u2197" })] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "USDT Vault" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-xs text-neutral-400 break-all", children: USDT_VAULT }), (0, jsx_runtime_1.jsx)(CopyButton, { text: USDT_VAULT })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: "USDC Vault" }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsx)("code", { className: "text-xs text-neutral-400 break-all", children: USDC_VAULT }), (0, jsx_runtime_1.jsx)(CopyButton, { text: USDC_VAULT })] })] })] })] }) }), (0, jsx_runtime_1.jsx)(terminal_1.TerminalCard, { title: "Mechanism", children: (0, jsx_runtime_1.jsxs)("div", { className: "text-sm space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "font-medium text-cyan-400 tracking-wider", children: "Autonomous Market Making" }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 leading-relaxed", children: "The Reincarnation Pool is a Solana PDA-owned autonomous market maker. Every epoch (1 hour), it reads the CPMM spot price, updates an EMA-weighted oracle (weight 2140), and executes a permissionless buyback via CPMM swap. Proceeds flow to the Mining Vault for the next cycle of community mining." }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-wrap items-center gap-2 mt-3 text-xs", children: [(0, jsx_runtime_1.jsx)("span", { className: "px-2 py-1 rounded bg-white/10 text-white", children: "Raydium CPMM" }), (0, jsx_runtime_1.jsx)("span", { className: "px-2 py-1 rounded bg-cyan-400/20 text-cyan-400", children: "PDA Autonomous" }), (0, jsx_runtime_1.jsx)("span", { className: "px-2 py-1 rounded bg-cyan-400/20 text-cyan-400", children: "EMA Oracle" }), (0, jsx_runtime_1.jsx)("span", { className: "px-2 py-1 rounded bg-cyan-400/20 text-cyan-400", children: "Permissionless" })] })] }) })] }));
|
|
33
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -67,3 +67,5 @@ export { MicrocosmOrganizationPage } from './components/organization/organizatio
|
|
|
67
67
|
export type { MicrocosmOrganizationPageProps } from './components/organization/organization-page';
|
|
68
68
|
export { MicrocosmVotingPage } from './components/voting/voting-page';
|
|
69
69
|
export type { MicrocosmVotingPageProps } from './components/voting/voting-page';
|
|
70
|
+
export { MicrocosmReincarnationPage } from './components/reincarnation/reincarnation-page';
|
|
71
|
+
export type { MicrocosmReincarnationPageProps } from './components/reincarnation/reincarnation-page';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MicrocosmTerritoryPage = exports.MicrocosmAuctionPage = exports.MicrocosmMCDPage = 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.useLinkComponent = exports.LinkProvider = exports.MicrocosmMenuSection = void 0;
|
|
4
|
-
exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = void 0;
|
|
4
|
+
exports.MicrocosmReincarnationPage = exports.MicrocosmVotingPage = exports.MicrocosmOrganizationPage = void 0;
|
|
5
5
|
var menu_section_1 = require("./components/menu-section");
|
|
6
6
|
Object.defineProperty(exports, "MicrocosmMenuSection", { enumerable: true, get: function () { return menu_section_1.MicrocosmMenuSection; } });
|
|
7
7
|
var link_context_1 = require("./link-context");
|
|
@@ -89,3 +89,5 @@ var organization_page_1 = require("./components/organization/organization-page")
|
|
|
89
89
|
Object.defineProperty(exports, "MicrocosmOrganizationPage", { enumerable: true, get: function () { return organization_page_1.MicrocosmOrganizationPage; } });
|
|
90
90
|
var voting_page_1 = require("./components/voting/voting-page");
|
|
91
91
|
Object.defineProperty(exports, "MicrocosmVotingPage", { enumerable: true, get: function () { return voting_page_1.MicrocosmVotingPage; } });
|
|
92
|
+
var reincarnation_page_1 = require("./components/reincarnation/reincarnation-page");
|
|
93
|
+
Object.defineProperty(exports, "MicrocosmReincarnationPage", { enumerable: true, get: function () { return reincarnation_page_1.MicrocosmReincarnationPage; } });
|