@microcosmmoney/portal-react 3.12.8 → 3.13.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.
- 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 +136 -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/useMultiWalletBalance.d.ts +31 -0
- package/dist/main-portal/hooks/useMultiWalletBalance.js +65 -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/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/index.d.ts +9 -0
- package/dist/main-portal/lib/api/index.js +37 -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-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/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,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
"use client";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useSpeechRecognition = useSpeechRecognition;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
function useSpeechRecognition(onTranscript) {
|
|
7
|
+
const [isRecording, setIsRecording] = (0, react_1.useState)(false);
|
|
8
|
+
const [recordingTime, setRecordingTime] = (0, react_1.useState)(0);
|
|
9
|
+
const recognitionRef = (0, react_1.useRef)(null);
|
|
10
|
+
const timerRef = (0, react_1.useRef)(null);
|
|
11
|
+
const isRecordingRef = (0, react_1.useRef)(false);
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
13
|
+
if (typeof window === "undefined")
|
|
14
|
+
return;
|
|
15
|
+
const Ctor = window.SpeechRecognition
|
|
16
|
+
|| window.webkitSpeechRecognition;
|
|
17
|
+
if (!Ctor)
|
|
18
|
+
return;
|
|
19
|
+
const instance = new Ctor();
|
|
20
|
+
instance.continuous = true;
|
|
21
|
+
instance.interimResults = true;
|
|
22
|
+
instance.lang = "zh-CN";
|
|
23
|
+
instance.onresult = (event) => {
|
|
24
|
+
let finalTranscript = "";
|
|
25
|
+
for (let i = event.resultIndex; i < event.results.length; i++) {
|
|
26
|
+
if (event.results[i].isFinal) {
|
|
27
|
+
finalTranscript += event.results[i][0].transcript;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (finalTranscript)
|
|
31
|
+
onTranscript(finalTranscript);
|
|
32
|
+
};
|
|
33
|
+
instance.onerror = () => { };
|
|
34
|
+
instance.onend = () => {
|
|
35
|
+
if (isRecordingRef.current) {
|
|
36
|
+
try {
|
|
37
|
+
instance.start();
|
|
38
|
+
}
|
|
39
|
+
catch { }
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
recognitionRef.current = instance;
|
|
43
|
+
return () => {
|
|
44
|
+
instance.stop();
|
|
45
|
+
if (timerRef.current)
|
|
46
|
+
clearInterval(timerRef.current);
|
|
47
|
+
};
|
|
48
|
+
}, [onTranscript]);
|
|
49
|
+
const startRecording = (0, react_1.useCallback)(() => {
|
|
50
|
+
if (!recognitionRef.current)
|
|
51
|
+
return;
|
|
52
|
+
try {
|
|
53
|
+
recognitionRef.current.start();
|
|
54
|
+
isRecordingRef.current = true;
|
|
55
|
+
setIsRecording(true);
|
|
56
|
+
setRecordingTime(0);
|
|
57
|
+
timerRef.current = setInterval(() => setRecordingTime((prev) => prev + 1), 1000);
|
|
58
|
+
}
|
|
59
|
+
catch { }
|
|
60
|
+
}, []);
|
|
61
|
+
const stopRecording = (0, react_1.useCallback)(() => {
|
|
62
|
+
isRecordingRef.current = false;
|
|
63
|
+
recognitionRef.current?.stop();
|
|
64
|
+
setIsRecording(false);
|
|
65
|
+
if (timerRef.current) {
|
|
66
|
+
clearInterval(timerRef.current);
|
|
67
|
+
timerRef.current = null;
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
70
|
+
const toggleRecording = (0, react_1.useCallback)(() => {
|
|
71
|
+
if (isRecording)
|
|
72
|
+
stopRecording();
|
|
73
|
+
else
|
|
74
|
+
startRecording();
|
|
75
|
+
}, [isRecording, startRecording, stopRecording]);
|
|
76
|
+
const formatTime = (seconds) => {
|
|
77
|
+
const mins = Math.floor(seconds / 60);
|
|
78
|
+
const secs = seconds % 60;
|
|
79
|
+
return `${mins}:${secs.toString().padStart(2, "0")}`;
|
|
80
|
+
};
|
|
81
|
+
return { isRecording, recordingTime, toggleRecording, formatTime };
|
|
82
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export interface OverviewStats {
|
|
2
|
+
total_users: number;
|
|
3
|
+
active_users_24h: number;
|
|
4
|
+
new_users_today: number;
|
|
5
|
+
total_territories: number;
|
|
6
|
+
mcc_circulating: number;
|
|
7
|
+
mcd_locked: number;
|
|
8
|
+
updated_at: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MCCStats {
|
|
11
|
+
total_supply: number;
|
|
12
|
+
circulating_supply: number;
|
|
13
|
+
genesis_pool_balance: number;
|
|
14
|
+
current_phase: number;
|
|
15
|
+
current_mining_rate: number;
|
|
16
|
+
next_halving_at: number;
|
|
17
|
+
remaining_to_halving: number;
|
|
18
|
+
total_mining_count: number;
|
|
19
|
+
total_mining_usdc: number;
|
|
20
|
+
holders_count: number;
|
|
21
|
+
}
|
|
22
|
+
export interface MCDStats {
|
|
23
|
+
total_supply: number;
|
|
24
|
+
circulating_supply: number;
|
|
25
|
+
genesis_pool_balance: number;
|
|
26
|
+
total_vault_balance: number;
|
|
27
|
+
total_spent: number;
|
|
28
|
+
user_balance: number;
|
|
29
|
+
daily_distribution: number;
|
|
30
|
+
active_vaults: number;
|
|
31
|
+
holders_count: number;
|
|
32
|
+
daily_distribution_rate: number;
|
|
33
|
+
}
|
|
34
|
+
export interface TerritoryItem {
|
|
35
|
+
type: string;
|
|
36
|
+
name: string;
|
|
37
|
+
total: number;
|
|
38
|
+
active: number;
|
|
39
|
+
capacity: number;
|
|
40
|
+
population: number;
|
|
41
|
+
}
|
|
42
|
+
export interface TerritoryStats {
|
|
43
|
+
territories: TerritoryItem[];
|
|
44
|
+
total_capacity: number;
|
|
45
|
+
total_users_in_territories: number;
|
|
46
|
+
}
|
|
47
|
+
export interface UserLevelItem {
|
|
48
|
+
level: number;
|
|
49
|
+
name: string;
|
|
50
|
+
chinese: string;
|
|
51
|
+
count: number;
|
|
52
|
+
percentage: number;
|
|
53
|
+
}
|
|
54
|
+
export interface UserLevelStats {
|
|
55
|
+
levels: UserLevelItem[];
|
|
56
|
+
total_users: number;
|
|
57
|
+
miners_and_above: number;
|
|
58
|
+
new_users_today: number;
|
|
59
|
+
monthly_active_rate: number;
|
|
60
|
+
}
|
|
61
|
+
export interface TeamWalletItem {
|
|
62
|
+
key: string;
|
|
63
|
+
label: string;
|
|
64
|
+
address: string;
|
|
65
|
+
ata: string;
|
|
66
|
+
mcc_balance: number;
|
|
67
|
+
percentage: number;
|
|
68
|
+
}
|
|
69
|
+
export interface TeamWalletStats {
|
|
70
|
+
wallets: TeamWalletItem[];
|
|
71
|
+
total_mcc: number;
|
|
72
|
+
updated_at: string;
|
|
73
|
+
}
|
|
74
|
+
export interface MiningHistoryItem {
|
|
75
|
+
date: string;
|
|
76
|
+
usdc_amount: number;
|
|
77
|
+
usdt_amount: number;
|
|
78
|
+
total_mcc: number;
|
|
79
|
+
total_mcd: number;
|
|
80
|
+
tx_count: number;
|
|
81
|
+
}
|
|
82
|
+
export interface MiningHistoryStats {
|
|
83
|
+
history: MiningHistoryItem[];
|
|
84
|
+
days: number;
|
|
85
|
+
summary: {
|
|
86
|
+
total_usdc: number;
|
|
87
|
+
total_usdt: number;
|
|
88
|
+
total_stablecoin: number;
|
|
89
|
+
total_mcc: number;
|
|
90
|
+
total_mcd: number;
|
|
91
|
+
total_tx: number;
|
|
92
|
+
avg_daily: number;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
interface UseStatsReturn<T> {
|
|
96
|
+
data: T | null;
|
|
97
|
+
loading: boolean;
|
|
98
|
+
error: string | null;
|
|
99
|
+
refresh: () => Promise<void>;
|
|
100
|
+
}
|
|
101
|
+
export declare const useOverviewStats: () => UseStatsReturn<OverviewStats>;
|
|
102
|
+
export declare const useMCCStats: () => UseStatsReturn<MCCStats>;
|
|
103
|
+
export declare const useMCDStats: () => UseStatsReturn<MCDStats>;
|
|
104
|
+
export declare const useTerritoryStats: () => UseStatsReturn<TerritoryStats>;
|
|
105
|
+
export declare const useUserLevelStats: () => UseStatsReturn<UserLevelStats>;
|
|
106
|
+
export declare const useTeamWalletStats: () => UseStatsReturn<TeamWalletStats>;
|
|
107
|
+
export interface UserGrowthPoint {
|
|
108
|
+
date: string;
|
|
109
|
+
new_users: number;
|
|
110
|
+
total_users: number;
|
|
111
|
+
}
|
|
112
|
+
export interface UserGrowthStats {
|
|
113
|
+
history: UserGrowthPoint[];
|
|
114
|
+
days: number;
|
|
115
|
+
total_users: number;
|
|
116
|
+
}
|
|
117
|
+
export declare function useUserGrowth(days?: number): UseStatsReturn<UserGrowthStats>;
|
|
118
|
+
export declare function useMiningHistory(days?: number): UseStatsReturn<MiningHistoryStats>;
|
|
119
|
+
export declare function useAllStats(): {
|
|
120
|
+
overview: OverviewStats | null;
|
|
121
|
+
mcc: MCCStats | null;
|
|
122
|
+
mcd: MCDStats | null;
|
|
123
|
+
territories: TerritoryStats | null;
|
|
124
|
+
userLevels: UserLevelStats | null;
|
|
125
|
+
teamWallets: TeamWalletStats | null;
|
|
126
|
+
miningHistory: MiningHistoryStats | null;
|
|
127
|
+
loading: boolean;
|
|
128
|
+
error: string | null;
|
|
129
|
+
refreshAll: () => Promise<void>;
|
|
130
|
+
};
|
|
131
|
+
export {};
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.useTeamWalletStats = exports.useUserLevelStats = exports.useTerritoryStats = exports.useMCDStats = exports.useMCCStats = exports.useOverviewStats = void 0;
|
|
6
|
+
exports.useUserGrowth = useUserGrowth;
|
|
7
|
+
exports.useMiningHistory = useMiningHistory;
|
|
8
|
+
exports.useAllStats = useAllStats;
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
async function fetchStats(endpoint) {
|
|
11
|
+
try {
|
|
12
|
+
const response = await fetch(`/api/stats/${endpoint}`);
|
|
13
|
+
const data = await response.json();
|
|
14
|
+
return data;
|
|
15
|
+
}
|
|
16
|
+
catch (error) {
|
|
17
|
+
console.error(`[useStats] fetch ${endpoint} error:`, error);
|
|
18
|
+
return { success: false, error: String(error) };
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function createStatsHook(endpoint, refreshInterval) {
|
|
22
|
+
return function useStatsData() {
|
|
23
|
+
const [data, setData] = (0, react_1.useState)(null);
|
|
24
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
25
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
26
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
27
|
+
try {
|
|
28
|
+
setError(null);
|
|
29
|
+
const result = await fetchStats(endpoint);
|
|
30
|
+
if (result.success && result.data) {
|
|
31
|
+
setData(result.data);
|
|
32
|
+
}
|
|
33
|
+
else if (result.error) {
|
|
34
|
+
setError(result.error);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
setError(String(err));
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
setLoading(false);
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
44
|
+
(0, react_1.useEffect)(() => {
|
|
45
|
+
refresh();
|
|
46
|
+
if (refreshInterval) {
|
|
47
|
+
const interval = setInterval(refresh, refreshInterval);
|
|
48
|
+
return () => clearInterval(interval);
|
|
49
|
+
}
|
|
50
|
+
}, [refresh]);
|
|
51
|
+
return { data, loading, error, refresh };
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
// 非即时数据: 不轮询, 页面加载读一次缓存 (后端 scheduler 每4h刷新)
|
|
55
|
+
exports.useOverviewStats = createStatsHook('overview');
|
|
56
|
+
exports.useMCCStats = createStatsHook('mcc');
|
|
57
|
+
exports.useMCDStats = createStatsHook('mcd');
|
|
58
|
+
exports.useTerritoryStats = createStatsHook('territories');
|
|
59
|
+
exports.useUserLevelStats = createStatsHook('users');
|
|
60
|
+
exports.useTeamWalletStats = createStatsHook('team-wallets');
|
|
61
|
+
function useUserGrowth(days = 30) {
|
|
62
|
+
const [data, setData] = (0, react_1.useState)(null);
|
|
63
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
64
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
65
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
66
|
+
try {
|
|
67
|
+
setError(null);
|
|
68
|
+
const response = await fetch(`/api/stats/user-growth?days=${days}`);
|
|
69
|
+
const result = await response.json();
|
|
70
|
+
if (result.success && result.data) {
|
|
71
|
+
setData(result.data);
|
|
72
|
+
}
|
|
73
|
+
else if (result.error) {
|
|
74
|
+
setError(result.error);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
catch (err) {
|
|
78
|
+
setError(String(err));
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
setLoading(false);
|
|
82
|
+
}
|
|
83
|
+
}, [days]);
|
|
84
|
+
(0, react_1.useEffect)(() => { refresh(); }, [refresh]);
|
|
85
|
+
return { data, loading, error, refresh };
|
|
86
|
+
}
|
|
87
|
+
function useMiningHistory(days = 7) {
|
|
88
|
+
const [data, setData] = (0, react_1.useState)(null);
|
|
89
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
90
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
91
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
92
|
+
try {
|
|
93
|
+
setError(null);
|
|
94
|
+
const response = await fetch(`/api/stats/mining-history?days=${days}`);
|
|
95
|
+
const result = await response.json();
|
|
96
|
+
if (result.success && result.data) {
|
|
97
|
+
setData(result.data);
|
|
98
|
+
}
|
|
99
|
+
else if (result.error) {
|
|
100
|
+
setError(result.error);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
catch (err) {
|
|
104
|
+
setError(String(err));
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
setLoading(false);
|
|
108
|
+
}
|
|
109
|
+
}, [days]);
|
|
110
|
+
(0, react_1.useEffect)(() => {
|
|
111
|
+
// 非即时数据: 页面加载读一次缓存, 不轮询
|
|
112
|
+
refresh();
|
|
113
|
+
}, [refresh]);
|
|
114
|
+
return { data, loading, error, refresh };
|
|
115
|
+
}
|
|
116
|
+
function useAllStats() {
|
|
117
|
+
const overview = (0, exports.useOverviewStats)();
|
|
118
|
+
const mcc = (0, exports.useMCCStats)();
|
|
119
|
+
const mcd = (0, exports.useMCDStats)();
|
|
120
|
+
const territories = (0, exports.useTerritoryStats)();
|
|
121
|
+
const userLevels = (0, exports.useUserLevelStats)();
|
|
122
|
+
const teamWallets = (0, exports.useTeamWalletStats)();
|
|
123
|
+
const miningHistory = useMiningHistory(7);
|
|
124
|
+
const loading = overview.loading ||
|
|
125
|
+
mcc.loading ||
|
|
126
|
+
mcd.loading ||
|
|
127
|
+
territories.loading ||
|
|
128
|
+
userLevels.loading ||
|
|
129
|
+
teamWallets.loading ||
|
|
130
|
+
miningHistory.loading;
|
|
131
|
+
const error = overview.error ||
|
|
132
|
+
mcc.error ||
|
|
133
|
+
mcd.error ||
|
|
134
|
+
territories.error ||
|
|
135
|
+
userLevels.error ||
|
|
136
|
+
teamWallets.error ||
|
|
137
|
+
miningHistory.error;
|
|
138
|
+
const refreshAll = (0, react_1.useCallback)(async () => {
|
|
139
|
+
await Promise.all([
|
|
140
|
+
overview.refresh(),
|
|
141
|
+
mcc.refresh(),
|
|
142
|
+
mcd.refresh(),
|
|
143
|
+
territories.refresh(),
|
|
144
|
+
userLevels.refresh(),
|
|
145
|
+
teamWallets.refresh(),
|
|
146
|
+
miningHistory.refresh()
|
|
147
|
+
]);
|
|
148
|
+
}, [overview, mcc, mcd, territories, userLevels, teamWallets, miningHistory]);
|
|
149
|
+
return {
|
|
150
|
+
overview: overview.data,
|
|
151
|
+
mcc: mcc.data,
|
|
152
|
+
mcd: mcd.data,
|
|
153
|
+
territories: territories.data,
|
|
154
|
+
userLevels: userLevels.data,
|
|
155
|
+
teamWallets: teamWallets.data,
|
|
156
|
+
miningHistory: miningHistory.data,
|
|
157
|
+
loading,
|
|
158
|
+
error,
|
|
159
|
+
refreshAll
|
|
160
|
+
};
|
|
161
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
interface PositionData {
|
|
2
|
+
amount?: number;
|
|
3
|
+
entryPrice?: number;
|
|
4
|
+
}
|
|
5
|
+
interface PowerStartCheck {
|
|
6
|
+
profit_check?: {
|
|
7
|
+
passed: boolean;
|
|
8
|
+
current: number;
|
|
9
|
+
threshold: number;
|
|
10
|
+
};
|
|
11
|
+
gap_check?: {
|
|
12
|
+
passed: boolean;
|
|
13
|
+
current: number;
|
|
14
|
+
threshold: number;
|
|
15
|
+
};
|
|
16
|
+
thickness_check?: {
|
|
17
|
+
passed: boolean;
|
|
18
|
+
thickness_pct: number;
|
|
19
|
+
};
|
|
20
|
+
orders_check?: {
|
|
21
|
+
passed: boolean;
|
|
22
|
+
long_count: number;
|
|
23
|
+
short_count: number;
|
|
24
|
+
max_orders: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface LiveState {
|
|
28
|
+
total_unrealized_pnl?: number;
|
|
29
|
+
energy_unrealized_pnl?: number;
|
|
30
|
+
price_gap_pct?: number;
|
|
31
|
+
price_gap_abs?: number;
|
|
32
|
+
current_drawdown_pct?: number;
|
|
33
|
+
current_price?: number;
|
|
34
|
+
wallet_balance?: number;
|
|
35
|
+
total_long_pos_amount?: number;
|
|
36
|
+
total_short_pos_amount?: number;
|
|
37
|
+
power_open_orders_long?: number;
|
|
38
|
+
power_open_orders_short?: number;
|
|
39
|
+
power_tp_orders_long?: number;
|
|
40
|
+
power_tp_orders_short?: number;
|
|
41
|
+
power_total_realized_pnl?: number;
|
|
42
|
+
power_closed_trades_long?: number;
|
|
43
|
+
power_closed_trades_short?: number;
|
|
44
|
+
energy_realized_pnl?: number;
|
|
45
|
+
user_manual_long_position?: number;
|
|
46
|
+
user_manual_short_position?: number;
|
|
47
|
+
user_manual_realized_pnl?: number;
|
|
48
|
+
power_start_mode?: string;
|
|
49
|
+
power_start_check?: PowerStartCheck;
|
|
50
|
+
positions?: {
|
|
51
|
+
energy?: {
|
|
52
|
+
LONG?: PositionData;
|
|
53
|
+
SHORT?: PositionData;
|
|
54
|
+
};
|
|
55
|
+
power?: {
|
|
56
|
+
LONG?: {
|
|
57
|
+
amount?: number;
|
|
58
|
+
open_orders?: number;
|
|
59
|
+
tp_orders?: number;
|
|
60
|
+
};
|
|
61
|
+
SHORT?: {
|
|
62
|
+
amount?: number;
|
|
63
|
+
open_orders?: number;
|
|
64
|
+
tp_orders?: number;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
total_long?: PositionData;
|
|
68
|
+
total_short?: PositionData;
|
|
69
|
+
};
|
|
70
|
+
raw_snapshot?: {
|
|
71
|
+
positions?: Array<{
|
|
72
|
+
positionSide: 'LONG' | 'SHORT';
|
|
73
|
+
unRealizedProfit: string;
|
|
74
|
+
positionAmt: string;
|
|
75
|
+
entryPrice: string;
|
|
76
|
+
markPrice: string;
|
|
77
|
+
}>;
|
|
78
|
+
};
|
|
79
|
+
start_time?: string;
|
|
80
|
+
duration?: string;
|
|
81
|
+
power_today_realized_pnl?: number;
|
|
82
|
+
energy_today_realized_pnl?: number;
|
|
83
|
+
power_win_rate?: number;
|
|
84
|
+
power_profit_factor?: number;
|
|
85
|
+
energy_win_rate?: number;
|
|
86
|
+
energy_profit_factor?: number;
|
|
87
|
+
energy_hedge_count?: number;
|
|
88
|
+
energy_sync_hedge_count?: number;
|
|
89
|
+
energy_tp_form_a_count?: number;
|
|
90
|
+
energy_tp_form_b_count?: number;
|
|
91
|
+
power_stale_converted_count?: number;
|
|
92
|
+
power_avg_holding_duration?: number;
|
|
93
|
+
power_longest_stale_duration?: number;
|
|
94
|
+
power_avg_stale_duration?: number;
|
|
95
|
+
power_stale_cleanup_count?: number;
|
|
96
|
+
power_protection_trigger_count?: number;
|
|
97
|
+
power_total_fees?: number;
|
|
98
|
+
energy_total_fees?: number;
|
|
99
|
+
power_today_fees?: number;
|
|
100
|
+
energy_today_fees?: number;
|
|
101
|
+
power_month_fees?: number;
|
|
102
|
+
energy_month_fees?: number;
|
|
103
|
+
manual_open_count?: number;
|
|
104
|
+
manual_close_count?: number;
|
|
105
|
+
manual_chase_count?: number;
|
|
106
|
+
manual_cancel_count?: number;
|
|
107
|
+
}
|
|
108
|
+
export interface PowerParams {
|
|
109
|
+
start_price_gap_pct?: number;
|
|
110
|
+
open_pos_quantity?: number;
|
|
111
|
+
start_pos_thickness_pct?: number;
|
|
112
|
+
max_open_orders?: number;
|
|
113
|
+
start_energy_profit_pct?: number;
|
|
114
|
+
}
|
|
115
|
+
export interface Strategy {
|
|
116
|
+
id: string;
|
|
117
|
+
name?: string;
|
|
118
|
+
strategy_name?: string;
|
|
119
|
+
symbol?: string;
|
|
120
|
+
is_active: boolean;
|
|
121
|
+
base?: {
|
|
122
|
+
symbol?: string;
|
|
123
|
+
};
|
|
124
|
+
power?: PowerParams;
|
|
125
|
+
params?: {
|
|
126
|
+
power?: PowerParams;
|
|
127
|
+
};
|
|
128
|
+
live_state?: LiveState;
|
|
129
|
+
created_at?: string;
|
|
130
|
+
updated_at?: string;
|
|
131
|
+
}
|
|
132
|
+
export declare function useStrategies(refreshInterval?: number): import("swr").SWRResponse<Strategy[], any, import("swr").SWRConfiguration<Strategy[], any, import("swr").BareFetcher<Strategy[]>> | undefined>;
|
|
133
|
+
export declare function useStrategyDetails(strategyId: string | null, refreshInterval?: number): import("swr").SWRResponse<Strategy, any, import("swr").SWRConfiguration<Strategy, any, import("swr").BareFetcher<Strategy>> | undefined>;
|
|
134
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
'use client';
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.useStrategies = useStrategies;
|
|
9
|
+
exports.useStrategyDetails = useStrategyDetails;
|
|
10
|
+
const swr_1 = __importDefault(require("swr"));
|
|
11
|
+
const api_service_1 = require("../lib/api-service");
|
|
12
|
+
const fetcher = async (url) => (0, api_service_1.fetchApi)(url);
|
|
13
|
+
function useStrategies(refreshInterval = 15000) {
|
|
14
|
+
return (0, swr_1.default)('/strategies', fetcher, {
|
|
15
|
+
refreshInterval,
|
|
16
|
+
revalidateOnFocus: true,
|
|
17
|
+
dedupingInterval: 5000,
|
|
18
|
+
errorRetryCount: 3,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
function useStrategyDetails(strategyId, refreshInterval = 15000) {
|
|
22
|
+
return (0, swr_1.default)(strategyId ? `/strategies/${strategyId}` : null, fetcher, {
|
|
23
|
+
refreshInterval,
|
|
24
|
+
revalidateOnFocus: true,
|
|
25
|
+
dedupingInterval: 5000,
|
|
26
|
+
errorRetryCount: 3,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { UserRank, NextLevelRequirement, TerritoryHoldings, MiningWeight } from '../lib/types/api';
|
|
2
|
+
interface UseUserRankReturn {
|
|
3
|
+
rank: UserRank | null;
|
|
4
|
+
currentLevel: number | null;
|
|
5
|
+
nextRank: UserRank | null;
|
|
6
|
+
nextLevel: number | null;
|
|
7
|
+
progressPercent: number;
|
|
8
|
+
holdings: TerritoryHoldings;
|
|
9
|
+
nextLevelRequirement: NextLevelRequirement | null;
|
|
10
|
+
miningWeight: MiningWeight | null;
|
|
11
|
+
loading: boolean;
|
|
12
|
+
error: string | null;
|
|
13
|
+
refresh: () => Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export declare function useUserRank(userId: string | undefined): UseUserRankReturn;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useUserRank = useUserRank;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const api_service_1 = require("../lib/api-service");
|
|
7
|
+
const EMPTY_HOLDINGS = { station: 0, matrix: 0, sector: 0, system: 0 };
|
|
8
|
+
function useUserRank(userId) {
|
|
9
|
+
const [rank, setRank] = (0, react_1.useState)(null);
|
|
10
|
+
const [progress, setProgress] = (0, react_1.useState)(null);
|
|
11
|
+
const [miningWeight, setMiningWeight] = (0, react_1.useState)(null);
|
|
12
|
+
const [loading, setLoading] = (0, react_1.useState)(true);
|
|
13
|
+
const [error, setError] = (0, react_1.useState)(null);
|
|
14
|
+
const refresh = (0, react_1.useCallback)(async () => {
|
|
15
|
+
if (!userId) {
|
|
16
|
+
setLoading(false);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
try {
|
|
20
|
+
setLoading(true);
|
|
21
|
+
setError(null);
|
|
22
|
+
const [rankRes, progressRes, weightRes] = await Promise.all([
|
|
23
|
+
(0, api_service_1.getUserRank)(userId),
|
|
24
|
+
(0, api_service_1.getUserLevelProgress)(userId),
|
|
25
|
+
(0, api_service_1.getMiningWeight)(userId),
|
|
26
|
+
]);
|
|
27
|
+
if (rankRes.success && rankRes.data) {
|
|
28
|
+
setRank(rankRes.data.rank);
|
|
29
|
+
}
|
|
30
|
+
if (progressRes.success && progressRes.data) {
|
|
31
|
+
setProgress(progressRes.data);
|
|
32
|
+
}
|
|
33
|
+
if (weightRes.success && weightRes.data) {
|
|
34
|
+
setMiningWeight(weightRes.data);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
39
|
+
setError(message);
|
|
40
|
+
}
|
|
41
|
+
finally {
|
|
42
|
+
setLoading(false);
|
|
43
|
+
}
|
|
44
|
+
}, [userId]);
|
|
45
|
+
(0, react_1.useEffect)(() => {
|
|
46
|
+
refresh();
|
|
47
|
+
}, [refresh]);
|
|
48
|
+
return {
|
|
49
|
+
rank,
|
|
50
|
+
currentLevel: progress?.current_level ?? null,
|
|
51
|
+
nextRank: progress?.next_rank ?? null,
|
|
52
|
+
nextLevel: progress?.next_level ?? null,
|
|
53
|
+
progressPercent: progress?.progress_percent ?? 0,
|
|
54
|
+
holdings: progress?.holdings ?? EMPTY_HOLDINGS,
|
|
55
|
+
nextLevelRequirement: progress?.next_level_requirement ?? null,
|
|
56
|
+
miningWeight,
|
|
57
|
+
loading,
|
|
58
|
+
error,
|
|
59
|
+
refresh,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type MainstreamToken } from '../lib/config/mainstream-tokens';
|
|
2
|
+
export interface TokenHolding {
|
|
3
|
+
token: MainstreamToken;
|
|
4
|
+
balance: number;
|
|
5
|
+
price: number;
|
|
6
|
+
usdValue: number;
|
|
7
|
+
wallet?: string;
|
|
8
|
+
walletShort?: string;
|
|
9
|
+
isPrimary?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface WalletTokenData {
|
|
12
|
+
wallet_address: string;
|
|
13
|
+
is_primary: boolean;
|
|
14
|
+
holdings: TokenHolding[];
|
|
15
|
+
totalUsdValue: number;
|
|
16
|
+
}
|
|
17
|
+
export interface WalletTokenBalancesResult {
|
|
18
|
+
wallets: WalletTokenData[];
|
|
19
|
+
aggregated: TokenHolding[];
|
|
20
|
+
flat: TokenHolding[];
|
|
21
|
+
totalUsdValue: number;
|
|
22
|
+
loading: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
refresh: () => Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
export declare function useWalletTokenBalances(walletInfos: {
|
|
27
|
+
wallet_address: string;
|
|
28
|
+
is_primary?: boolean;
|
|
29
|
+
}[]): WalletTokenBalancesResult;
|