@microcosmmoney/portal-react 3.12.8 → 3.13.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.
- package/dist/index.d.ts +22 -0
- package/dist/index.js +48 -1
- package/dist/main-portal/components/auctions/AuctionsPage.d.ts +1 -0
- package/dist/main-portal/components/auctions/AuctionsPage.js +218 -0
- package/dist/main-portal/components/data/asset-stats.d.ts +1 -0
- package/dist/main-portal/components/data/asset-stats.js +33 -0
- package/dist/main-portal/components/data/charts/MCCSupplyChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/MCCSupplyChart.js +27 -0
- package/dist/main-portal/components/data/charts/MiningTrendChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/MiningTrendChart.js +39 -0
- package/dist/main-portal/components/data/charts/PriceChart.d.ts +5 -0
- package/dist/main-portal/components/data/charts/PriceChart.js +99 -0
- package/dist/main-portal/components/data/charts/TeamWalletChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/TeamWalletChart.js +33 -0
- package/dist/main-portal/components/data/charts/TerritoryProgressChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/TerritoryProgressChart.js +35 -0
- package/dist/main-portal/components/data/charts/UserLevelPieChart.d.ts +7 -0
- package/dist/main-portal/components/data/charts/UserLevelPieChart.js +34 -0
- package/dist/main-portal/components/data/charts/index.d.ts +5 -0
- package/dist/main-portal/components/data/charts/index.js +14 -0
- package/dist/main-portal/components/data/data-hero.d.ts +1 -0
- package/dist/main-portal/components/data/data-hero.js +81 -0
- package/dist/main-portal/components/data/mining-history-stats.d.ts +1 -0
- package/dist/main-portal/components/data/mining-history-stats.js +44 -0
- package/dist/main-portal/components/data/team-wallet-stats.d.ts +1 -0
- package/dist/main-portal/components/data/team-wallet-stats.js +34 -0
- package/dist/main-portal/components/data/territory-stats.d.ts +1 -0
- package/dist/main-portal/components/data/territory-stats.js +48 -0
- package/dist/main-portal/components/data/user-level-stats.d.ts +1 -0
- package/dist/main-portal/components/data/user-level-stats.js +36 -0
- package/dist/main-portal/components/fragment/FragmentPage.d.ts +1 -0
- package/dist/main-portal/components/fragment/FragmentPage.js +13 -0
- package/dist/main-portal/components/income/ManagerIncomePage.d.ts +1 -0
- package/dist/main-portal/components/income/ManagerIncomePage.js +147 -0
- package/dist/main-portal/components/layout/AppSidebar.d.ts +3 -0
- package/dist/main-portal/components/layout/AppSidebar.js +88 -0
- package/dist/main-portal/components/layout/DashboardHeader.d.ts +1 -0
- package/dist/main-portal/components/layout/DashboardHeader.js +121 -0
- package/dist/main-portal/components/layout/LocaleSwitcher.d.ts +1 -0
- package/dist/main-portal/components/layout/LocaleSwitcher.js +30 -0
- package/dist/main-portal/components/layout/MainFooter.d.ts +2 -0
- package/dist/main-portal/components/layout/MainFooter.js +50 -0
- package/dist/main-portal/components/layout/ShadcnNavbar.d.ts +1 -0
- package/dist/main-portal/components/layout/ShadcnNavbar.js +155 -0
- package/dist/main-portal/components/layout/TerminalSidebar.d.ts +1 -0
- package/dist/main-portal/components/layout/TerminalSidebar.js +110 -0
- package/dist/main-portal/components/lending/LendingPage.d.ts +1 -0
- package/dist/main-portal/components/lending/LendingPage.js +20 -0
- package/dist/main-portal/components/mcd/MCDPage.d.ts +1 -0
- package/dist/main-portal/components/mcd/MCDPage.js +125 -0
- package/dist/main-portal/components/messages/MessagesPage.d.ts +1 -0
- package/dist/main-portal/components/messages/MessagesPage.js +13 -0
- package/dist/main-portal/components/mining/MiningDistributionHistory.d.ts +11 -0
- package/dist/main-portal/components/mining/MiningDistributionHistory.js +84 -0
- package/dist/main-portal/components/mining/MiningModal.d.ts +12 -0
- package/dist/main-portal/components/mining/MiningModal.js +302 -0
- package/dist/main-portal/components/mining/MiningPage.d.ts +1 -0
- package/dist/main-portal/components/mining/MiningPage.js +237 -0
- package/dist/main-portal/components/mining/index.d.ts +1 -0
- package/dist/main-portal/components/mining/index.js +6 -0
- package/dist/main-portal/components/notifications/NotificationsPage.d.ts +1 -0
- package/dist/main-portal/components/notifications/NotificationsPage.js +13 -0
- package/dist/main-portal/components/organization/OrganizationPage.d.ts +1 -0
- package/dist/main-portal/components/organization/OrganizationPage.js +235 -0
- package/dist/main-portal/components/organization/connection-line.d.ts +12 -0
- package/dist/main-portal/components/organization/connection-line.js +38 -0
- package/dist/main-portal/components/organization/diagram-node.d.ts +17 -0
- package/dist/main-portal/components/organization/diagram-node.js +105 -0
- package/dist/main-portal/components/organization/system-panel.d.ts +11 -0
- package/dist/main-portal/components/organization/system-panel.js +72 -0
- package/dist/main-portal/components/profile/EmailChangeCard.d.ts +1 -0
- package/dist/main-portal/components/profile/EmailChangeCard.js +58 -0
- package/dist/main-portal/components/profile/ProfilePage.d.ts +1 -0
- package/dist/main-portal/components/profile/ProfilePage.js +263 -0
- package/dist/main-portal/components/profile/TwoFactorSettings.d.ts +1 -0
- package/dist/main-portal/components/profile/TwoFactorSettings.js +99 -0
- package/dist/main-portal/components/providers/ClientProviders.d.ts +6 -0
- package/dist/main-portal/components/providers/ClientProviders.js +17 -0
- package/dist/main-portal/components/providers/SolanaWalletProvider.d.ts +7 -0
- package/dist/main-portal/components/providers/SolanaWalletProvider.js +17 -0
- package/dist/main-portal/components/providers/theme-provider.d.ts +5 -0
- package/dist/main-portal/components/providers/theme-provider.js +10 -0
- package/dist/main-portal/components/queue/QueueStatusPage.d.ts +1 -0
- package/dist/main-portal/components/queue/QueueStatusPage.js +245 -0
- package/dist/main-portal/components/reincarnation/ReincarnationPage.d.ts +1 -0
- package/dist/main-portal/components/reincarnation/ReincarnationPage.js +87 -0
- package/dist/main-portal/components/resources/mcc-stats-section.d.ts +1 -0
- package/dist/main-portal/components/resources/mcc-stats-section.js +199 -0
- package/dist/main-portal/components/resources/mcd-stats-section.d.ts +1 -0
- package/dist/main-portal/components/resources/mcd-stats-section.js +76 -0
- package/dist/main-portal/components/resources/minting-entry-section.d.ts +1 -0
- package/dist/main-portal/components/resources/minting-entry-section.js +70 -0
- package/dist/main-portal/components/resources/public-mining-modal.d.ts +7 -0
- package/dist/main-portal/components/resources/public-mining-modal.js +239 -0
- package/dist/main-portal/components/resources/recycle-pool-section.d.ts +1 -0
- package/dist/main-portal/components/resources/recycle-pool-section.js +82 -0
- package/dist/main-portal/components/resources/registration-prompt.d.ts +8 -0
- package/dist/main-portal/components/resources/registration-prompt.js +13 -0
- package/dist/main-portal/components/rewards/RewardsPage.d.ts +1 -0
- package/dist/main-portal/components/rewards/RewardsPage.js +149 -0
- package/dist/main-portal/components/security/domain-verification-bar.d.ts +1 -0
- package/dist/main-portal/components/security/domain-verification-bar.js +32 -0
- package/dist/main-portal/components/stations/StationDetailPage.d.ts +5 -0
- package/dist/main-portal/components/stations/StationDetailPage.js +232 -0
- package/dist/main-portal/components/stations/StationIncomeChart.d.ts +11 -0
- package/dist/main-portal/components/stations/StationIncomeChart.js +57 -0
- package/dist/main-portal/components/stations/StationKPIHistory.d.ts +1 -0
- package/dist/main-portal/components/stations/StationKPIHistory.js +7 -0
- package/dist/main-portal/components/stations/StationListPage.d.ts +1 -0
- package/dist/main-portal/components/stations/StationListPage.js +341 -0
- package/dist/main-portal/components/stations/StationMemberRanking.d.ts +13 -0
- package/dist/main-portal/components/stations/StationMemberRanking.js +64 -0
- package/dist/main-portal/components/stations/StationSummaryCards.d.ts +13 -0
- package/dist/main-portal/components/stations/StationSummaryCards.js +30 -0
- package/dist/main-portal/components/stations/StationsPage.d.ts +1 -0
- package/dist/main-portal/components/stations/StationsPage.js +239 -0
- package/dist/main-portal/components/territory/TerritoryNFTBrowser.d.ts +1 -0
- package/dist/main-portal/components/territory/TerritoryNFTBrowser.js +147 -0
- package/dist/main-portal/components/ui/accordion.d.ts +7 -0
- package/dist/main-portal/components/ui/accordion.js +57 -0
- package/dist/main-portal/components/ui/alert-dialog.d.ts +14 -0
- package/dist/main-portal/components/ui/alert-dialog.js +85 -0
- package/dist/main-portal/components/ui/alert.d.ts +9 -0
- package/dist/main-portal/components/ui/alert.js +28 -0
- package/dist/main-portal/components/ui/aspect-ratio.d.ts +3 -0
- package/dist/main-portal/components/ui/aspect-ratio.js +43 -0
- package/dist/main-portal/components/ui/avatar.d.ts +6 -0
- package/dist/main-portal/components/ui/avatar.js +52 -0
- package/dist/main-portal/components/ui/badge.d.ts +9 -0
- package/dist/main-portal/components/ui/badge.js +26 -0
- package/dist/main-portal/components/ui/breadcrumb.d.ts +11 -0
- package/dist/main-portal/components/ui/breadcrumb.js +35 -0
- package/dist/main-portal/components/ui/button-group.d.ts +11 -0
- package/dist/main-portal/components/ui/button-group.js +34 -0
- package/dist/main-portal/components/ui/button.d.ts +10 -0
- package/dist/main-portal/components/ui/button.js +35 -0
- package/dist/main-portal/components/ui/calendar.d.ts +8 -0
- package/dist/main-portal/components/ui/calendar.js +111 -0
- package/dist/main-portal/components/ui/card.d.ts +17 -0
- package/dist/main-portal/components/ui/card.js +41 -0
- package/dist/main-portal/components/ui/carousel.d.ts +19 -0
- package/dist/main-portal/components/ui/carousel.js +134 -0
- package/dist/main-portal/components/ui/chart.d.ts +40 -0
- package/dist/main-portal/components/ui/chart.js +168 -0
- package/dist/main-portal/components/ui/checkbox.d.ts +4 -0
- package/dist/main-portal/components/ui/checkbox.js +45 -0
- package/dist/main-portal/components/ui/collapsible.d.ts +5 -0
- package/dist/main-portal/components/ui/collapsible.js +51 -0
- package/dist/main-portal/components/ui/command.d.ts +18 -0
- package/dist/main-portal/components/ui/command.js +45 -0
- package/dist/main-portal/components/ui/context-menu.d.ts +25 -0
- package/dist/main-portal/components/ui/context-menu.js +101 -0
- package/dist/main-portal/components/ui/dialog.d.ts +15 -0
- package/dist/main-portal/components/ui/dialog.js +81 -0
- package/dist/main-portal/components/ui/drawer.d.ts +13 -0
- package/dist/main-portal/components/ui/drawer.js +47 -0
- package/dist/main-portal/components/ui/dropdown-menu.d.ts +25 -0
- package/dist/main-portal/components/ui/dropdown-menu.js +101 -0
- package/dist/main-portal/components/ui/empty.d.ts +11 -0
- package/dist/main-portal/components/ui/empty.js +41 -0
- package/dist/main-portal/components/ui/field.d.ts +24 -0
- package/dist/main-portal/components/ui/field.js +85 -0
- package/dist/main-portal/components/ui/form.d.ts +24 -0
- package/dist/main-portal/components/ui/form.js +103 -0
- package/dist/main-portal/components/ui/hover-avatar.d.ts +10 -0
- package/dist/main-portal/components/ui/hover-avatar.js +70 -0
- package/dist/main-portal/components/ui/hover-card.d.ts +6 -0
- package/dist/main-portal/components/ui/hover-card.js +52 -0
- package/dist/main-portal/components/ui/input-group.d.ts +15 -0
- package/dist/main-portal/components/ui/input-group.js +65 -0
- package/dist/main-portal/components/ui/input-otp.d.ts +11 -0
- package/dist/main-portal/components/ui/input-otp.js +60 -0
- package/dist/main-portal/components/ui/input.d.ts +3 -0
- package/dist/main-portal/components/ui/input.js +8 -0
- package/dist/main-portal/components/ui/item.d.ts +23 -0
- package/dist/main-portal/components/ui/item.js +77 -0
- package/dist/main-portal/components/ui/kbd.d.ts +3 -0
- package/dist/main-portal/components/ui/kbd.js +13 -0
- package/dist/main-portal/components/ui/label.d.ts +4 -0
- package/dist/main-portal/components/ui/label.js +44 -0
- package/dist/main-portal/components/ui/menubar.d.ts +26 -0
- package/dist/main-portal/components/ui/menubar.js +105 -0
- package/dist/main-portal/components/ui/navigation-menu.d.ts +14 -0
- package/dist/main-portal/components/ui/navigation-menu.js +75 -0
- package/dist/main-portal/components/ui/pagination.d.ts +13 -0
- package/dist/main-portal/components/ui/pagination.js +37 -0
- package/dist/main-portal/components/ui/popover.d.ts +7 -0
- package/dist/main-portal/components/ui/popover.js +56 -0
- package/dist/main-portal/components/ui/progress.d.ts +4 -0
- package/dist/main-portal/components/ui/progress.js +44 -0
- package/dist/main-portal/components/ui/radio-group.d.ts +5 -0
- package/dist/main-portal/components/ui/radio-group.js +49 -0
- package/dist/main-portal/components/ui/resizable.d.ts +8 -0
- package/dist/main-portal/components/ui/resizable.js +53 -0
- package/dist/main-portal/components/ui/scroll-area.d.ts +5 -0
- package/dist/main-portal/components/ui/scroll-area.js +50 -0
- package/dist/main-portal/components/ui/select.d.ts +15 -0
- package/dist/main-portal/components/ui/select.js +83 -0
- package/dist/main-portal/components/ui/separator.d.ts +4 -0
- package/dist/main-portal/components/ui/separator.js +44 -0
- package/dist/main-portal/components/ui/sheet.d.ts +13 -0
- package/dist/main-portal/components/ui/sheet.js +83 -0
- package/dist/main-portal/components/ui/sidebar.d.ts +69 -0
- package/dist/main-portal/components/ui/sidebar.js +258 -0
- package/dist/main-portal/components/ui/skeleton.d.ts +2 -0
- package/dist/main-portal/components/ui/skeleton.js +9 -0
- package/dist/main-portal/components/ui/slider.d.ts +4 -0
- package/dist/main-portal/components/ui/slider.js +50 -0
- package/dist/main-portal/components/ui/sonner.d.ts +3 -0
- package/dist/main-portal/components/ui/sonner.js +17 -0
- package/dist/main-portal/components/ui/spinner.d.ts +2 -0
- package/dist/main-portal/components/ui/spinner.js +10 -0
- package/dist/main-portal/components/ui/switch.d.ts +4 -0
- package/dist/main-portal/components/ui/switch.js +44 -0
- package/dist/main-portal/components/ui/table.d.ts +10 -0
- package/dist/main-portal/components/ui/table.js +38 -0
- package/dist/main-portal/components/ui/tabs.d.ts +7 -0
- package/dist/main-portal/components/ui/tabs.js +53 -0
- package/dist/main-portal/components/ui/terminal.d.ts +49 -0
- package/dist/main-portal/components/ui/terminal.js +56 -0
- package/dist/main-portal/components/ui/textarea.d.ts +3 -0
- package/dist/main-portal/components/ui/textarea.js +8 -0
- package/dist/main-portal/components/ui/time-remaining.d.ts +54 -0
- package/dist/main-portal/components/ui/time-remaining.js +223 -0
- package/dist/main-portal/components/ui/toast.d.ts +15 -0
- package/dist/main-portal/components/ui/toast.js +77 -0
- package/dist/main-portal/components/ui/toaster.d.ts +1 -0
- package/dist/main-portal/components/ui/toaster.js +14 -0
- package/dist/main-portal/components/ui/toggle-group.d.ts +7 -0
- package/dist/main-portal/components/ui/toggle-group.js +58 -0
- package/dist/main-portal/components/ui/toggle.d.ts +9 -0
- package/dist/main-portal/components/ui/toggle.js +64 -0
- package/dist/main-portal/components/ui/tooltip.d.ts +7 -0
- package/dist/main-portal/components/ui/tooltip.js +56 -0
- package/dist/main-portal/components/ui/use-mobile.d.ts +1 -0
- package/dist/main-portal/components/ui/use-mobile.js +53 -0
- package/dist/main-portal/components/voting/VotingPage.d.ts +1 -0
- package/dist/main-portal/components/voting/VotingPage.js +14 -0
- package/dist/main-portal/components/wallet/MCCHistory.d.ts +9 -0
- package/dist/main-portal/components/wallet/MCCHistory.js +100 -0
- package/dist/main-portal/components/wallet/WalletManagement.d.ts +5 -0
- package/dist/main-portal/components/wallet/WalletManagement.js +144 -0
- package/dist/main-portal/components/wallet/WalletPage.d.ts +1 -0
- package/dist/main-portal/components/wallet/WalletPage.js +130 -0
- package/dist/main-portal/config/menu-config.d.ts +22 -0
- package/dist/main-portal/config/menu-config.js +167 -0
- package/dist/main-portal/contexts/MCCPriceContext.d.ts +38 -0
- package/dist/main-portal/contexts/MCCPriceContext.js +70 -0
- package/dist/main-portal/contexts/WalletContext.d.ts +48 -0
- package/dist/main-portal/contexts/WalletContext.js +94 -0
- package/dist/main-portal/hooks/index.d.ts +4 -0
- package/dist/main-portal/hooks/index.js +11 -0
- package/dist/main-portal/hooks/use-breakpoint.d.ts +45 -0
- package/dist/main-portal/hooks/use-breakpoint.js +91 -0
- package/dist/main-portal/hooks/use-mobile.d.ts +1 -0
- package/dist/main-portal/hooks/use-mobile.js +55 -0
- package/dist/main-portal/hooks/use-toast.d.ts +44 -0
- package/dist/main-portal/hooks/use-toast.js +164 -0
- package/dist/main-portal/hooks/useAuth.d.ts +30 -0
- package/dist/main-portal/hooks/useAuth.js +135 -0
- package/dist/main-portal/hooks/useMCC.d.ts +26 -0
- package/dist/main-portal/hooks/useMCC.js +148 -0
- package/dist/main-portal/hooks/useMCD.d.ts +17 -0
- package/dist/main-portal/hooks/useMCD.js +114 -0
- package/dist/main-portal/hooks/useMarketData.d.ts +9 -0
- package/dist/main-portal/hooks/useMarketData.js +32 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.d.ts +31 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -0
- package/dist/main-portal/hooks/usePriceHistory.d.ts +9 -0
- package/dist/main-portal/hooks/usePriceHistory.js +36 -0
- package/dist/main-portal/hooks/useSolanaBalance.d.ts +21 -0
- package/dist/main-portal/hooks/useSolanaBalance.js +58 -0
- package/dist/main-portal/hooks/useSpeechRecognition.d.ts +6 -0
- package/dist/main-portal/hooks/useSpeechRecognition.js +82 -0
- package/dist/main-portal/hooks/useStats.d.ts +131 -0
- package/dist/main-portal/hooks/useStats.js +161 -0
- package/dist/main-portal/hooks/useStrategies.d.ts +134 -0
- package/dist/main-portal/hooks/useStrategies.js +28 -0
- package/dist/main-portal/hooks/useUserRank.d.ts +16 -0
- package/dist/main-portal/hooks/useUserRank.js +61 -0
- package/dist/main-portal/hooks/useWalletTokenBalances.d.ts +29 -0
- package/dist/main-portal/hooks/useWalletTokenBalances.js +106 -0
- package/dist/main-portal/i18n/navigation.d.ts +341 -0
- package/dist/main-portal/i18n/navigation.js +7 -0
- package/dist/main-portal/i18n/request.d.ts +2 -0
- package/dist/main-portal/i18n/request.js +47 -0
- package/dist/main-portal/i18n/routing.d.ts +18 -0
- package/dist/main-portal/i18n/routing.js +10 -0
- package/dist/main-portal/lib/ai-chat-config.d.ts +8 -0
- package/dist/main-portal/lib/ai-chat-config.js +144 -0
- package/dist/main-portal/lib/analytics/hooks.d.ts +139 -0
- package/dist/main-portal/lib/analytics/hooks.js +277 -0
- package/dist/main-portal/lib/analytics/index.d.ts +2 -0
- package/dist/main-portal/lib/analytics/index.js +19 -0
- package/dist/main-portal/lib/analytics/types.d.ts +611 -0
- package/dist/main-portal/lib/analytics/types.js +2 -0
- package/dist/main-portal/lib/api/account.d.ts +39 -0
- package/dist/main-portal/lib/api/account.js +86 -0
- package/dist/main-portal/lib/api/admin.d.ts +78 -0
- package/dist/main-portal/lib/api/admin.js +195 -0
- package/dist/main-portal/lib/api/analytics.d.ts +217 -0
- package/dist/main-portal/lib/api/analytics.js +55 -0
- package/dist/main-portal/lib/api/blockchain.d.ts +178 -0
- package/dist/main-portal/lib/api/blockchain.js +302 -0
- package/dist/main-portal/lib/api/core.d.ts +3 -0
- package/dist/main-portal/lib/api/core.js +47 -0
- package/dist/main-portal/lib/api/dexscreener.d.ts +126 -0
- package/dist/main-portal/lib/api/dexscreener.js +139 -0
- package/dist/main-portal/lib/api/geckoterminal.d.ts +10 -0
- package/dist/main-portal/lib/api/geckoterminal.js +43 -0
- package/dist/main-portal/lib/api/index.d.ts +16 -0
- package/dist/main-portal/lib/api/index.js +230 -0
- package/dist/main-portal/lib/api/mcc-holders.d.ts +130 -0
- package/dist/main-portal/lib/api/mcc-holders.js +47 -0
- package/dist/main-portal/lib/api/org-service-proxy.d.ts +7 -0
- package/dist/main-portal/lib/api/org-service-proxy.js +55 -0
- package/dist/main-portal/lib/api/services/ai.d.ts +139 -0
- package/dist/main-portal/lib/api/services/ai.js +214 -0
- package/dist/main-portal/lib/api/services/finance.d.ts +37 -0
- package/dist/main-portal/lib/api/services/finance.js +144 -0
- package/dist/main-portal/lib/api/services/index.d.ts +5 -0
- package/dist/main-portal/lib/api/services/index.js +21 -0
- package/dist/main-portal/lib/api/services/mining.d.ts +68 -0
- package/dist/main-portal/lib/api/services/mining.js +76 -0
- package/dist/main-portal/lib/api/services/organization.d.ts +161 -0
- package/dist/main-portal/lib/api/services/organization.js +139 -0
- package/dist/main-portal/lib/api/services/user.d.ts +90 -0
- package/dist/main-portal/lib/api/services/user.js +78 -0
- package/dist/main-portal/lib/api/services.d.ts +1 -0
- package/dist/main-portal/lib/api/services.js +17 -0
- package/dist/main-portal/lib/api/strategies.d.ts +101 -0
- package/dist/main-portal/lib/api/strategies.js +87 -0
- package/dist/main-portal/lib/api-service.d.ts +1 -0
- package/dist/main-portal/lib/api-service.js +18 -0
- package/dist/main-portal/lib/auth-service.d.ts +65 -0
- package/dist/main-portal/lib/auth-service.js +382 -0
- package/dist/main-portal/lib/config/mainstream-tokens.d.ts +13 -0
- package/dist/main-portal/lib/config/mainstream-tokens.js +88 -0
- package/dist/main-portal/lib/docs-data.d.ts +36 -0
- package/dist/main-portal/lib/docs-data.js +108 -0
- package/dist/main-portal/lib/exchanges/config.d.ts +34 -0
- package/dist/main-portal/lib/exchanges/config.js +185 -0
- package/dist/main-portal/lib/exchanges/hooks/index.d.ts +5 -0
- package/dist/main-portal/lib/exchanges/hooks/index.js +10 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.d.ts +15 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.js +216 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.d.ts +32 -0
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.js +395 -0
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.d.ts +15 -0
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.js +51 -0
- package/dist/main-portal/lib/exchanges/index.d.ts +4 -0
- package/dist/main-portal/lib/exchanges/index.js +21 -0
- package/dist/main-portal/lib/exchanges/types.d.ts +102 -0
- package/dist/main-portal/lib/exchanges/types.js +2 -0
- package/dist/main-portal/lib/exchanges/utils.d.ts +1 -0
- package/dist/main-portal/lib/exchanges/utils.js +10 -0
- package/dist/main-portal/lib/gcp-secrets.d.ts +7 -0
- package/dist/main-portal/lib/gcp-secrets.js +45 -0
- package/dist/main-portal/lib/mockWallet.d.ts +130 -0
- package/dist/main-portal/lib/mockWallet.js +284 -0
- package/dist/main-portal/lib/oauth-config.d.ts +12 -0
- package/dist/main-portal/lib/oauth-config.js +48 -0
- package/dist/main-portal/lib/order-id-generator.d.ts +19 -0
- package/dist/main-portal/lib/order-id-generator.js +97 -0
- package/dist/main-portal/lib/solana/reincarnation-client.d.ts +28 -0
- package/dist/main-portal/lib/solana/reincarnation-client.js +39 -0
- package/dist/main-portal/lib/solana/solana-pay.d.ts +31 -0
- package/dist/main-portal/lib/solana/solana-pay.js +85 -0
- package/dist/main-portal/lib/strategy/defaults.d.ts +2 -0
- package/dist/main-portal/lib/strategy/defaults.js +58 -0
- package/dist/main-portal/lib/strategy/index.d.ts +3 -0
- package/dist/main-portal/lib/strategy/index.js +20 -0
- package/dist/main-portal/lib/strategy/tooltips.d.ts +1 -0
- package/dist/main-portal/lib/strategy/tooltips.js +50 -0
- package/dist/main-portal/lib/strategy/types.d.ts +74 -0
- package/dist/main-portal/lib/strategy/types.js +2 -0
- package/dist/main-portal/lib/types/ai.types.d.ts +111 -0
- package/dist/main-portal/lib/types/ai.types.js +2 -0
- package/dist/main-portal/lib/types/api.d.ts +5 -0
- package/dist/main-portal/lib/types/api.js +21 -0
- package/dist/main-portal/lib/types/common.types.d.ts +168 -0
- package/dist/main-portal/lib/types/common.types.js +24 -0
- package/dist/main-portal/lib/types/finance.types.d.ts +267 -0
- package/dist/main-portal/lib/types/finance.types.js +2 -0
- package/dist/main-portal/lib/types/protocol.types.d.ts +216 -0
- package/dist/main-portal/lib/types/protocol.types.js +2 -0
- package/dist/main-portal/lib/types/user.types.d.ts +243 -0
- package/dist/main-portal/lib/types/user.types.js +12 -0
- package/dist/main-portal/lib/utils/territoryId.d.ts +75 -0
- package/dist/main-portal/lib/utils/territoryId.js +241 -0
- package/dist/main-portal/lib/utils.d.ts +4 -0
- package/dist/main-portal/lib/utils.js +24 -0
- package/dist/main-portal/lib/wallet-auth/api.d.ts +13 -0
- package/dist/main-portal/lib/wallet-auth/api.js +132 -0
- package/dist/main-portal/lib/wallet-auth/types.d.ts +87 -0
- package/dist/main-portal/lib/wallet-auth/types.js +58 -0
- package/package.json +55 -5
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
export interface TokenBalance {
|
|
2
|
+
symbol: string;
|
|
3
|
+
mint: string;
|
|
4
|
+
balance: number;
|
|
5
|
+
raw_balance: number;
|
|
6
|
+
decimals: number;
|
|
7
|
+
usd_value: number;
|
|
8
|
+
}
|
|
9
|
+
export interface WalletBalance {
|
|
10
|
+
wallet: string;
|
|
11
|
+
sol: TokenBalance;
|
|
12
|
+
tokens: TokenBalance[];
|
|
13
|
+
total_usd_value: number;
|
|
14
|
+
cached_at: string;
|
|
15
|
+
from_cache: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PoolStatus {
|
|
18
|
+
pool_address: string;
|
|
19
|
+
usdc_vault: string;
|
|
20
|
+
usdc_balance: number;
|
|
21
|
+
usdt_vault: string;
|
|
22
|
+
usdt_balance: number;
|
|
23
|
+
total_mcc_bought: number;
|
|
24
|
+
total_market_made: number;
|
|
25
|
+
status: 'active' | 'empty' | 'paused';
|
|
26
|
+
updated_at: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function getMccPrice(): Promise<number | null>;
|
|
29
|
+
export declare function getWalletBalance(walletAddress: string, forceRefresh?: boolean): Promise<WalletBalance | null>;
|
|
30
|
+
export declare function getMCCBalance(walletAddress: string, forceRefresh?: boolean): Promise<TokenBalance | null>;
|
|
31
|
+
export declare function refreshWalletBalance(walletAddress: string): Promise<WalletBalance | null>;
|
|
32
|
+
export declare function invalidateWalletCache(walletAddress: string, txType?: string): Promise<boolean>;
|
|
33
|
+
export declare function getPoolStatus(forceRefresh?: boolean): Promise<PoolStatus | null>;
|
|
34
|
+
export declare function getTokenFromBalance(balance: WalletBalance | null, symbol: string): TokenBalance | null;
|
|
35
|
+
export declare function formatTokenBalance(balance: number, decimals?: number): string;
|
|
36
|
+
export interface McdAccountStatus {
|
|
37
|
+
uid: string;
|
|
38
|
+
has_account: boolean;
|
|
39
|
+
is_miner: boolean;
|
|
40
|
+
territory_id: string | null;
|
|
41
|
+
can_receive_mcd: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface McdAccountResult {
|
|
44
|
+
uid: string;
|
|
45
|
+
territory_id: string;
|
|
46
|
+
status: 'created' | 'exists';
|
|
47
|
+
tx_signature?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare function getMcdAccountStatus(uid: string): Promise<McdAccountStatus | null>;
|
|
50
|
+
export declare function ensureUserMcdAccount(uid: string): Promise<McdAccountResult>;
|
|
51
|
+
export declare function batchGetMcdAccountStatus(uids: string[]): Promise<Record<string, McdAccountStatus>>;
|
|
52
|
+
export interface ZombieAccount {
|
|
53
|
+
uid: string;
|
|
54
|
+
email: string;
|
|
55
|
+
display_name: string | null;
|
|
56
|
+
wallet_address: string | null;
|
|
57
|
+
mcd_balance: number;
|
|
58
|
+
inactive_days: number;
|
|
59
|
+
last_login_at: string | null;
|
|
60
|
+
account_created_at: string | null;
|
|
61
|
+
}
|
|
62
|
+
export interface ZombieAccountsResult {
|
|
63
|
+
accounts: ZombieAccount[];
|
|
64
|
+
total: number;
|
|
65
|
+
summary: {
|
|
66
|
+
total_zombie_accounts: number;
|
|
67
|
+
estimated_rent_recovery: number;
|
|
68
|
+
min_inactive_days: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface ClosureResult {
|
|
72
|
+
uid: string;
|
|
73
|
+
rent_recovered: number;
|
|
74
|
+
tx_signature: string | null;
|
|
75
|
+
closure_id: number;
|
|
76
|
+
}
|
|
77
|
+
export interface BatchClosureResult {
|
|
78
|
+
closed_count: number;
|
|
79
|
+
failed_count: number;
|
|
80
|
+
total_rent_recovered: number;
|
|
81
|
+
results: Array<{
|
|
82
|
+
uid: string;
|
|
83
|
+
success: boolean;
|
|
84
|
+
error?: string;
|
|
85
|
+
rent_recovered: number;
|
|
86
|
+
}>;
|
|
87
|
+
}
|
|
88
|
+
export interface RentStatistics {
|
|
89
|
+
summary: {
|
|
90
|
+
total_accounts: number;
|
|
91
|
+
zombie_accounts: number;
|
|
92
|
+
cumulative_closures: number;
|
|
93
|
+
cumulative_rent_recovered: number;
|
|
94
|
+
};
|
|
95
|
+
daily_stats: Array<{
|
|
96
|
+
date: string;
|
|
97
|
+
closed_count: number;
|
|
98
|
+
rent_recovered: number;
|
|
99
|
+
}>;
|
|
100
|
+
}
|
|
101
|
+
export interface ClosureHistory {
|
|
102
|
+
closures: Array<{
|
|
103
|
+
id: number;
|
|
104
|
+
uid: string;
|
|
105
|
+
user_mcd_pda: string;
|
|
106
|
+
rent_recovered: number;
|
|
107
|
+
tx_signature: string | null;
|
|
108
|
+
closed_by: string;
|
|
109
|
+
reason: string;
|
|
110
|
+
user_email: string | null;
|
|
111
|
+
last_active_at: string | null;
|
|
112
|
+
closed_at: string;
|
|
113
|
+
}>;
|
|
114
|
+
total: number;
|
|
115
|
+
}
|
|
116
|
+
export declare function getZombieAccounts(options?: {
|
|
117
|
+
limit?: number;
|
|
118
|
+
offset?: number;
|
|
119
|
+
min_inactive_days?: number;
|
|
120
|
+
}): Promise<ZombieAccountsResult>;
|
|
121
|
+
export declare function closeMcdAccount(uid: string, reason?: 'zombie' | 'user_request' | 'admin'): Promise<ClosureResult>;
|
|
122
|
+
export declare function batchCloseMcdAccounts(uids: string[], reason?: 'zombie' | 'admin'): Promise<BatchClosureResult>;
|
|
123
|
+
export declare function getRentStatistics(startDate?: string, endDate?: string): Promise<RentStatistics>;
|
|
124
|
+
export declare function getClosureHistory(options?: {
|
|
125
|
+
limit?: number;
|
|
126
|
+
offset?: number;
|
|
127
|
+
reason?: string;
|
|
128
|
+
}): Promise<ClosureHistory>;
|
|
129
|
+
export interface SystemAddress {
|
|
130
|
+
id: number;
|
|
131
|
+
category: string;
|
|
132
|
+
subcategory?: string;
|
|
133
|
+
name: string;
|
|
134
|
+
address: string;
|
|
135
|
+
description?: string;
|
|
136
|
+
status: string;
|
|
137
|
+
address_type?: string;
|
|
138
|
+
parent_address?: string;
|
|
139
|
+
metadata?: Record<string, unknown>;
|
|
140
|
+
created_at: string;
|
|
141
|
+
updated_at: string;
|
|
142
|
+
archived_at?: string;
|
|
143
|
+
archived_reason?: string;
|
|
144
|
+
}
|
|
145
|
+
export interface SystemAddressStats {
|
|
146
|
+
total: number;
|
|
147
|
+
categories: number;
|
|
148
|
+
by_category: Record<string, number>;
|
|
149
|
+
by_status: Record<string, number>;
|
|
150
|
+
}
|
|
151
|
+
export declare function getSystemAddresses(options?: {
|
|
152
|
+
category?: string;
|
|
153
|
+
status?: string;
|
|
154
|
+
search?: string;
|
|
155
|
+
limit?: number;
|
|
156
|
+
offset?: number;
|
|
157
|
+
}): Promise<{
|
|
158
|
+
addresses: SystemAddress[];
|
|
159
|
+
total: number;
|
|
160
|
+
}>;
|
|
161
|
+
export declare function getSystemAddressStats(): Promise<SystemAddressStats>;
|
|
162
|
+
export declare function updateSystemAddress(id: number, data: {
|
|
163
|
+
description?: string;
|
|
164
|
+
status?: string;
|
|
165
|
+
archived_reason?: string;
|
|
166
|
+
}): Promise<{
|
|
167
|
+
success: boolean;
|
|
168
|
+
id?: number;
|
|
169
|
+
name?: string;
|
|
170
|
+
status?: string;
|
|
171
|
+
error?: string;
|
|
172
|
+
}>;
|
|
173
|
+
export declare function seedSystemAddresses(): Promise<{
|
|
174
|
+
success: boolean;
|
|
175
|
+
inserted: number;
|
|
176
|
+
updated: number;
|
|
177
|
+
total: number;
|
|
178
|
+
}>;
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMccPrice = getMccPrice;
|
|
4
|
+
exports.getWalletBalance = getWalletBalance;
|
|
5
|
+
exports.getMCCBalance = getMCCBalance;
|
|
6
|
+
exports.refreshWalletBalance = refreshWalletBalance;
|
|
7
|
+
exports.invalidateWalletCache = invalidateWalletCache;
|
|
8
|
+
exports.getPoolStatus = getPoolStatus;
|
|
9
|
+
exports.getTokenFromBalance = getTokenFromBalance;
|
|
10
|
+
exports.formatTokenBalance = formatTokenBalance;
|
|
11
|
+
exports.getMcdAccountStatus = getMcdAccountStatus;
|
|
12
|
+
exports.ensureUserMcdAccount = ensureUserMcdAccount;
|
|
13
|
+
exports.batchGetMcdAccountStatus = batchGetMcdAccountStatus;
|
|
14
|
+
exports.getZombieAccounts = getZombieAccounts;
|
|
15
|
+
exports.closeMcdAccount = closeMcdAccount;
|
|
16
|
+
exports.batchCloseMcdAccounts = batchCloseMcdAccounts;
|
|
17
|
+
exports.getRentStatistics = getRentStatistics;
|
|
18
|
+
exports.getClosureHistory = getClosureHistory;
|
|
19
|
+
exports.getSystemAddresses = getSystemAddresses;
|
|
20
|
+
exports.getSystemAddressStats = getSystemAddressStats;
|
|
21
|
+
exports.updateSystemAddress = updateSystemAddress;
|
|
22
|
+
exports.seedSystemAddresses = seedSystemAddresses;
|
|
23
|
+
// AI-generated · AI-managed · AI-maintained
|
|
24
|
+
const core_1 = require("./core");
|
|
25
|
+
async function getMccPrice() {
|
|
26
|
+
try {
|
|
27
|
+
const response = await fetch('/api/blockchain-service/mining/ratio');
|
|
28
|
+
const data = await response.json();
|
|
29
|
+
if (data.success && data.data?.usdc_per_mcc) {
|
|
30
|
+
return data.data.usdc_per_mcc;
|
|
31
|
+
}
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
async function getWalletBalance(walletAddress, forceRefresh = false) {
|
|
39
|
+
try {
|
|
40
|
+
const queryParams = forceRefresh ? '?force=true' : '';
|
|
41
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/balance/wallet/${walletAddress}${queryParams}`, { method: 'GET' }, true);
|
|
42
|
+
if (response.success && response.data) {
|
|
43
|
+
return response.data;
|
|
44
|
+
}
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.error('[Blockchain API] 获取钱包余额失败:', error);
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async function getMCCBalance(walletAddress, forceRefresh = false) {
|
|
53
|
+
try {
|
|
54
|
+
const queryParams = forceRefresh ? '?force=true' : '';
|
|
55
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/balance/wallet/${walletAddress}/mcc${queryParams}`, { method: 'GET' }, true);
|
|
56
|
+
if (response.success && response.data) {
|
|
57
|
+
return response.data;
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
console.error('[Blockchain API] 获取 MCC 余额失败:', error);
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
async function refreshWalletBalance(walletAddress) {
|
|
67
|
+
try {
|
|
68
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/balance/wallet/${walletAddress}/refresh`, { method: 'POST' });
|
|
69
|
+
if (response.success && response.data) {
|
|
70
|
+
return response.data;
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
console.error('[Blockchain API] 刷新钱包余额失败:', error);
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async function invalidateWalletCache(walletAddress, txType) {
|
|
80
|
+
try {
|
|
81
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/balance/invalidate/${walletAddress}`, {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
body: JSON.stringify({ tx_type: txType })
|
|
84
|
+
});
|
|
85
|
+
return response.success === true;
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.error('[Blockchain API] 失效缓存失败:', error);
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
async function getPoolStatus(forceRefresh = false) {
|
|
93
|
+
try {
|
|
94
|
+
const queryParams = forceRefresh ? '?force=true' : '';
|
|
95
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/balance/pool/reincarnation${queryParams}`, { method: 'GET' }, true);
|
|
96
|
+
if (response.success && response.data) {
|
|
97
|
+
return response.data;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
catch (error) {
|
|
102
|
+
console.error('[Blockchain API] 获取轮回池状态失败:', error);
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function getTokenFromBalance(balance, symbol) {
|
|
107
|
+
if (!balance)
|
|
108
|
+
return null;
|
|
109
|
+
if (symbol.toUpperCase() === 'SOL') {
|
|
110
|
+
return balance.sol;
|
|
111
|
+
}
|
|
112
|
+
return balance.tokens.find(t => t.symbol.toUpperCase() === symbol.toUpperCase()) || null;
|
|
113
|
+
}
|
|
114
|
+
function formatTokenBalance(balance, decimals = 2) {
|
|
115
|
+
return balance.toLocaleString('en-US', {
|
|
116
|
+
minimumFractionDigits: decimals,
|
|
117
|
+
maximumFractionDigits: decimals
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async function getMcdAccountStatus(uid) {
|
|
121
|
+
try {
|
|
122
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/mcd/admin/account-status/${uid}`, { method: 'GET' });
|
|
123
|
+
if (response.success && response.data) {
|
|
124
|
+
return response.data;
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
console.error('[Blockchain API] 获取 MCD 账户状态失败:', error);
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
async function ensureUserMcdAccount(uid) {
|
|
134
|
+
try {
|
|
135
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/mcd/admin/account/ensure/${uid}`, { method: 'POST' });
|
|
136
|
+
if (response.success && response.data) {
|
|
137
|
+
return response.data;
|
|
138
|
+
}
|
|
139
|
+
throw new Error(response.error || '创建 MCD 账户失败');
|
|
140
|
+
}
|
|
141
|
+
catch (error) {
|
|
142
|
+
console.error('[Blockchain API] 创建 MCD 账户失败:', error);
|
|
143
|
+
throw error;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
async function batchGetMcdAccountStatus(uids) {
|
|
147
|
+
try {
|
|
148
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/mcd/admin/batch-status`, {
|
|
149
|
+
method: 'POST',
|
|
150
|
+
body: JSON.stringify({ uids })
|
|
151
|
+
});
|
|
152
|
+
if (response.success && response.data) {
|
|
153
|
+
return response.data;
|
|
154
|
+
}
|
|
155
|
+
return {};
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
console.error('[Blockchain API] 批量获取 MCD 账户状态失败:', error);
|
|
159
|
+
return {};
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
async function getZombieAccounts(options = {}) {
|
|
163
|
+
const { limit = 50, offset = 0, min_inactive_days = 180 } = options;
|
|
164
|
+
try {
|
|
165
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/mcd/admin/zombie-accounts?limit=${limit}&offset=${offset}&inactive_days=${min_inactive_days}`, { method: 'GET' });
|
|
166
|
+
if (response.success && response.data) {
|
|
167
|
+
return response.data;
|
|
168
|
+
}
|
|
169
|
+
throw new Error(response.error || '获取僵尸账户失败');
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
console.error('[Blockchain API] 获取僵尸账户失败:', error);
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async function closeMcdAccount(uid, reason = 'zombie') {
|
|
177
|
+
try {
|
|
178
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/mcd/admin/close-account/${uid}`, {
|
|
179
|
+
method: 'POST',
|
|
180
|
+
body: JSON.stringify({ reason })
|
|
181
|
+
});
|
|
182
|
+
if (response.success && response.data) {
|
|
183
|
+
return response.data;
|
|
184
|
+
}
|
|
185
|
+
throw new Error(response.error || '关闭账户失败');
|
|
186
|
+
}
|
|
187
|
+
catch (error) {
|
|
188
|
+
console.error('[Blockchain API] 关闭 MCD 账户失败:', error);
|
|
189
|
+
throw error;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
async function batchCloseMcdAccounts(uids, reason = 'zombie') {
|
|
193
|
+
try {
|
|
194
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/mcd/admin/batch-close-accounts`, {
|
|
195
|
+
method: 'POST',
|
|
196
|
+
body: JSON.stringify({ uids, reason })
|
|
197
|
+
});
|
|
198
|
+
if (response.success && response.data) {
|
|
199
|
+
return response.data;
|
|
200
|
+
}
|
|
201
|
+
throw new Error(response.error || '批量关闭账户失败');
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
console.error('[Blockchain API] 批量关闭 MCD 账户失败:', error);
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
async function getRentStatistics(startDate, endDate) {
|
|
209
|
+
try {
|
|
210
|
+
const params = new URLSearchParams();
|
|
211
|
+
if (startDate)
|
|
212
|
+
params.append('start_date', startDate);
|
|
213
|
+
if (endDate)
|
|
214
|
+
params.append('end_date', endDate);
|
|
215
|
+
const url = `/blockchain/mcd/admin/rent-statistics${params.toString() ? `?${params.toString()}` : ''}`;
|
|
216
|
+
const response = await (0, core_1.fetchApi)(url, { method: 'GET' });
|
|
217
|
+
if (response.success && response.data) {
|
|
218
|
+
return response.data;
|
|
219
|
+
}
|
|
220
|
+
throw new Error(response.error || '获取租金统计失败');
|
|
221
|
+
}
|
|
222
|
+
catch (error) {
|
|
223
|
+
console.error('[Blockchain API] 获取租金统计失败:', error);
|
|
224
|
+
throw error;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
async function getClosureHistory(options = {}) {
|
|
228
|
+
const { limit = 50, offset = 0, reason } = options;
|
|
229
|
+
try {
|
|
230
|
+
let url = `/blockchain/mcd/admin/closure-history?limit=${limit}&offset=${offset}`;
|
|
231
|
+
if (reason)
|
|
232
|
+
url += `&reason=${reason}`;
|
|
233
|
+
const response = await (0, core_1.fetchApi)(url, { method: 'GET' });
|
|
234
|
+
if (response.success && response.data) {
|
|
235
|
+
return response.data;
|
|
236
|
+
}
|
|
237
|
+
throw new Error(response.error || '获取关闭历史失败');
|
|
238
|
+
}
|
|
239
|
+
catch (error) {
|
|
240
|
+
console.error('[Blockchain API] 获取关闭历史失败:', error);
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
async function getSystemAddresses(options = {}) {
|
|
245
|
+
const { category, status, search, limit = 200, offset = 0 } = options;
|
|
246
|
+
try {
|
|
247
|
+
const params = new URLSearchParams();
|
|
248
|
+
params.set('limit', String(limit));
|
|
249
|
+
params.set('offset', String(offset));
|
|
250
|
+
if (category)
|
|
251
|
+
params.set('category', category);
|
|
252
|
+
if (status)
|
|
253
|
+
params.set('status', status);
|
|
254
|
+
if (search)
|
|
255
|
+
params.set('search', search);
|
|
256
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/system-addresses/admin/list?${params.toString()}`, { method: 'GET' });
|
|
257
|
+
if (response.success && response.data) {
|
|
258
|
+
return response.data;
|
|
259
|
+
}
|
|
260
|
+
throw new Error(response.error || 'Failed to load system addresses');
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
console.error('[Blockchain API] getSystemAddresses failed:', error);
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
async function getSystemAddressStats() {
|
|
268
|
+
try {
|
|
269
|
+
const response = await (0, core_1.fetchApi)('/blockchain/system-addresses/admin/stats', { method: 'GET' });
|
|
270
|
+
if (response.success && response.data) {
|
|
271
|
+
return response.data;
|
|
272
|
+
}
|
|
273
|
+
throw new Error(response.error || 'Failed to load stats');
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
console.error('[Blockchain API] getSystemAddressStats failed:', error);
|
|
277
|
+
throw error;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
async function updateSystemAddress(id, data) {
|
|
281
|
+
try {
|
|
282
|
+
const response = await (0, core_1.fetchApi)(`/blockchain/system-addresses/admin/${id}`, {
|
|
283
|
+
method: 'PUT',
|
|
284
|
+
body: JSON.stringify(data)
|
|
285
|
+
});
|
|
286
|
+
return response;
|
|
287
|
+
}
|
|
288
|
+
catch (error) {
|
|
289
|
+
console.error('[Blockchain API] updateSystemAddress failed:', error);
|
|
290
|
+
throw error;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async function seedSystemAddresses() {
|
|
294
|
+
try {
|
|
295
|
+
const response = await (0, core_1.fetchApi)('/blockchain/system-addresses/admin/seed', { method: 'POST' });
|
|
296
|
+
return response;
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
console.error('[Blockchain API] seedSystemAddresses failed:', error);
|
|
300
|
+
throw error;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCurrentUserToken = exports.fetchApi = void 0;
|
|
4
|
+
// AI-generated · AI-managed · AI-maintained
|
|
5
|
+
const auth_service_1 = require("../auth-service");
|
|
6
|
+
Object.defineProperty(exports, "getCurrentUserToken", { enumerable: true, get: function () { return auth_service_1.getCurrentUserToken; } });
|
|
7
|
+
const BASE_URL = '/api';
|
|
8
|
+
const fetchApi = async (endpoint, options = {}, isPublic = false) => {
|
|
9
|
+
const headers = {
|
|
10
|
+
'Content-Type': 'application/json',
|
|
11
|
+
};
|
|
12
|
+
if (options.headers) {
|
|
13
|
+
const originalHeaders = options.headers;
|
|
14
|
+
Object.assign(headers, originalHeaders);
|
|
15
|
+
}
|
|
16
|
+
if (!isPublic) {
|
|
17
|
+
const authToken = await (0, auth_service_1.getCurrentUserToken)();
|
|
18
|
+
if (!authToken) {
|
|
19
|
+
throw new Error('用户未登录,无法发起请求。');
|
|
20
|
+
}
|
|
21
|
+
headers['Authorization'] = `Bearer ${authToken}`;
|
|
22
|
+
}
|
|
23
|
+
const config = {
|
|
24
|
+
...options,
|
|
25
|
+
headers
|
|
26
|
+
};
|
|
27
|
+
const response = await fetch(`${BASE_URL}${endpoint}`, config);
|
|
28
|
+
const safeJson = async (res) => {
|
|
29
|
+
const contentType = res.headers.get('content-type');
|
|
30
|
+
if (contentType && contentType.includes('application/json')) {
|
|
31
|
+
return res.json();
|
|
32
|
+
}
|
|
33
|
+
const text = await res.text();
|
|
34
|
+
return { error: text || `服务器返回了非 JSON 错误 (状态: ${res.status})` };
|
|
35
|
+
};
|
|
36
|
+
if (!response.ok) {
|
|
37
|
+
// 401/403: 认证失效,强制登出(不再继续处理业务错误)
|
|
38
|
+
if (response.status === 401 || response.status === 403) {
|
|
39
|
+
(0, auth_service_1.handleAuthFailure)(response.status);
|
|
40
|
+
throw new Error('认证已失效,正在跳转登录页...');
|
|
41
|
+
}
|
|
42
|
+
const errorData = await safeJson(response);
|
|
43
|
+
throw new Error(errorData.error || `服务器返回了一个错误 (状态: ${response.status})`);
|
|
44
|
+
}
|
|
45
|
+
return safeJson(response);
|
|
46
|
+
};
|
|
47
|
+
exports.fetchApi = fetchApi;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
export interface HourlyVolume {
|
|
2
|
+
hour: string;
|
|
3
|
+
buyVolume: number;
|
|
4
|
+
sellVolume: number;
|
|
5
|
+
totalVolume: number;
|
|
6
|
+
tradeCount: number;
|
|
7
|
+
}
|
|
8
|
+
export interface HeatmapCell {
|
|
9
|
+
dow: number;
|
|
10
|
+
hour: number;
|
|
11
|
+
volume: number;
|
|
12
|
+
tradeCount: number;
|
|
13
|
+
}
|
|
14
|
+
export interface MCCMarketData {
|
|
15
|
+
price: number;
|
|
16
|
+
priceChange: {
|
|
17
|
+
h1: number;
|
|
18
|
+
h24: number;
|
|
19
|
+
};
|
|
20
|
+
volume: {
|
|
21
|
+
h1: number;
|
|
22
|
+
h24: number;
|
|
23
|
+
};
|
|
24
|
+
txns: {
|
|
25
|
+
h1: {
|
|
26
|
+
buys: number;
|
|
27
|
+
sells: number;
|
|
28
|
+
};
|
|
29
|
+
h24: {
|
|
30
|
+
buys: number;
|
|
31
|
+
sells: number;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
liquidityUsd: number;
|
|
35
|
+
fdvUsd: number;
|
|
36
|
+
marketCapUsd: number;
|
|
37
|
+
dailyStats: {
|
|
38
|
+
tradeCount: number;
|
|
39
|
+
miningCount: number;
|
|
40
|
+
marketMakingCount: number;
|
|
41
|
+
buyVolume: number;
|
|
42
|
+
sellVolume: number;
|
|
43
|
+
};
|
|
44
|
+
hourlyVolumes: HourlyVolume[];
|
|
45
|
+
weeklyHeatmap: HeatmapCell[];
|
|
46
|
+
updatedAt: string;
|
|
47
|
+
}
|
|
48
|
+
export declare function fetchMCCMarketData(): Promise<MCCMarketData | null>;
|
|
49
|
+
export interface CustodyVaultInfo {
|
|
50
|
+
index: number;
|
|
51
|
+
vaultPda: string;
|
|
52
|
+
gasPayer: string;
|
|
53
|
+
usdcBalance: number;
|
|
54
|
+
mccBalance: number;
|
|
55
|
+
gasPayerSol: number;
|
|
56
|
+
gasConsumed: number;
|
|
57
|
+
txCount24h: number;
|
|
58
|
+
status: "active" | "idle";
|
|
59
|
+
}
|
|
60
|
+
export interface CustodyVaultSummary {
|
|
61
|
+
totalUsdc: number;
|
|
62
|
+
totalMcc: number;
|
|
63
|
+
totalGasConsumed: number;
|
|
64
|
+
totalTx24h: number;
|
|
65
|
+
totalTrades24h: number;
|
|
66
|
+
activeVaults: number;
|
|
67
|
+
avgGasPerTx: number;
|
|
68
|
+
totalProfit: number;
|
|
69
|
+
}
|
|
70
|
+
export interface CustodyAgentRoles {
|
|
71
|
+
minerActive: boolean;
|
|
72
|
+
traderActive: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface EcosystemMining {
|
|
75
|
+
total_usd: number;
|
|
76
|
+
total_mcc: number;
|
|
77
|
+
total_count: number;
|
|
78
|
+
}
|
|
79
|
+
export interface EcosystemBuyback {
|
|
80
|
+
total_usd: number;
|
|
81
|
+
total_mcc: number;
|
|
82
|
+
total_count: number;
|
|
83
|
+
pool_usd_balance: number;
|
|
84
|
+
}
|
|
85
|
+
export interface EcosystemLp {
|
|
86
|
+
mcc_allocated: number;
|
|
87
|
+
usdc_balance: number;
|
|
88
|
+
}
|
|
89
|
+
export interface EcosystemEpoch {
|
|
90
|
+
current_epoch: number;
|
|
91
|
+
epoch_minted: number;
|
|
92
|
+
epoch_yield: number;
|
|
93
|
+
mining_vault_mcc: number;
|
|
94
|
+
}
|
|
95
|
+
export interface CustodyVaultData {
|
|
96
|
+
vaults: CustodyVaultInfo[];
|
|
97
|
+
summary: CustodyVaultSummary;
|
|
98
|
+
agentRoles: CustodyAgentRoles;
|
|
99
|
+
mining: EcosystemMining;
|
|
100
|
+
buyback: EcosystemBuyback;
|
|
101
|
+
lp: EcosystemLp;
|
|
102
|
+
epoch: EcosystemEpoch;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
}
|
|
105
|
+
export declare function fetchCustodyVaultData(): Promise<CustodyVaultData | null>;
|
|
106
|
+
export declare const SOLSCAN_LINKS: {
|
|
107
|
+
mccToken: string;
|
|
108
|
+
mcdToken: string;
|
|
109
|
+
miningVault: string;
|
|
110
|
+
buybackVault: string;
|
|
111
|
+
teamVault: string;
|
|
112
|
+
poolPda: string;
|
|
113
|
+
cpmmPool: string;
|
|
114
|
+
custodyProgram: string;
|
|
115
|
+
programId: string;
|
|
116
|
+
transaction: (sig: string) => string;
|
|
117
|
+
account: (address: string) => string;
|
|
118
|
+
};
|
|
119
|
+
/** Official Market Making Custody Vault PDAs (#0-#9) */
|
|
120
|
+
export declare const CUSTODY_VAULT_ADDRESSES: readonly ["8GgSjyrnXfxzF9A2ptTVbwr5x7HbApBZAiNfLtasZymG", "GPGfHSzEMQG1w5fCGXoM4Qyq4AJKe2jEoE5Bp7FTEvvv", "Ay6nzAC1iNqNtBDqkWvjfkZRVJaw61v4tkNKs1h5QEsx", "8H4N2rT9JT3xxxVqFRiSECHY9dcbU51KjxsEfsBJSr5N", "8TzH83qkXUn2uifjVSFsfaBzpKvpf2h1FnKkP6gx33xo", "AkCWQ1Cgef3kD33YZN6RcbNdcG2uzGPqTm298DsRpEBh", "2ts8u1L21vZsJRHmB9SvGYw715bRp9wfM9gj9P8VZhah", "FtuVwEijmLiKLFriSQaQ5mQVexHpDEjGYojiCaXzNhrp", "HJiPgHoWrjmV8cguayJu6ggaBa2Kue5cbcdnt3T3eKbe", "2H1uXk3wwrhkxssKj5dKSK8cUVq5BxeLAvgfF2CweVoc"];
|
|
121
|
+
export declare const RAYDIUM_POOL_URL = "https://raydium.io/swap/?inputMint=MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb&outputMint=EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
122
|
+
export declare const JUPITER_TRADE_URL = "https://jup.ag/tokens/MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb";
|
|
123
|
+
export declare const BIRDEYE_TOKEN_URL = "https://birdeye.so/token/MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb?chain=solana";
|
|
124
|
+
export declare const GMGN_TOKEN_URL = "https://gmgn.ai/sol/token/MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb";
|
|
125
|
+
export declare const OKX_DEX_URL = "https://web3.okx.com/zh-hans/token/solana/MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb";
|
|
126
|
+
export declare const DEXSCREENER_URL = "https://dexscreener.com/solana/4AiaTd9bAWf3u8ScZWhXadJF1roc8bJKEKvaDudKacZd";
|