@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,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.USER_LEVELS_CN = exports.USER_LEVELS = void 0;
|
|
4
|
+
exports.toBase36 = toBase36;
|
|
5
|
+
exports.fromBase36 = fromBase36;
|
|
6
|
+
exports.getUserShortId = getUserShortId;
|
|
7
|
+
exports.getSystemShortId = getSystemShortId;
|
|
8
|
+
exports.getSectorShortId = getSectorShortId;
|
|
9
|
+
exports.getMatrixShortId = getMatrixShortId;
|
|
10
|
+
exports.getStationShortId = getStationShortId;
|
|
11
|
+
exports.getUnitShortId = getUnitShortId;
|
|
12
|
+
exports.parseUnitShortId = parseUnitShortId;
|
|
13
|
+
exports.getTerritoryFullPath = getTerritoryFullPath;
|
|
14
|
+
exports.getUserLocationId = getUserLocationId;
|
|
15
|
+
exports.parseUserLocationId = parseUserLocationId;
|
|
16
|
+
exports.generateUserIds = generateUserIds;
|
|
17
|
+
exports.generateUnitIds = generateUnitIds;
|
|
18
|
+
exports.formatUserId = formatUserId;
|
|
19
|
+
exports.formatUnitId = formatUnitId;
|
|
20
|
+
// AI-generated · AI-managed · AI-maintained
|
|
21
|
+
const BASE36_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
22
|
+
exports.USER_LEVELS = {
|
|
23
|
+
1: "Miner",
|
|
24
|
+
2: "Miner",
|
|
25
|
+
3: "Miner",
|
|
26
|
+
4: "Commander",
|
|
27
|
+
5: "Pioneer",
|
|
28
|
+
6: "Warden",
|
|
29
|
+
7: "Admiral",
|
|
30
|
+
};
|
|
31
|
+
exports.USER_LEVELS_CN = {
|
|
32
|
+
1: "矿工",
|
|
33
|
+
2: "矿工",
|
|
34
|
+
3: "矿工",
|
|
35
|
+
4: "指挥官",
|
|
36
|
+
5: "先驱者",
|
|
37
|
+
6: "守护者",
|
|
38
|
+
7: "将军",
|
|
39
|
+
};
|
|
40
|
+
function toBase36(num, width = 6) {
|
|
41
|
+
if (num < 0) {
|
|
42
|
+
throw new Error("num must be non-negative");
|
|
43
|
+
}
|
|
44
|
+
if (num === 0) {
|
|
45
|
+
return "0".padStart(width, "0");
|
|
46
|
+
}
|
|
47
|
+
let result = "";
|
|
48
|
+
let n = num;
|
|
49
|
+
while (n > 0) {
|
|
50
|
+
result = BASE36_CHARS[n % 36] + result;
|
|
51
|
+
n = Math.floor(n / 36);
|
|
52
|
+
}
|
|
53
|
+
return result.padStart(width, "0");
|
|
54
|
+
}
|
|
55
|
+
function fromBase36(s) {
|
|
56
|
+
return parseInt(s.toUpperCase(), 36);
|
|
57
|
+
}
|
|
58
|
+
function getUserShortId(numericId) {
|
|
59
|
+
return `U-${toBase36(numericId, 7)}`;
|
|
60
|
+
}
|
|
61
|
+
function getSystemShortId(numericId) {
|
|
62
|
+
return `Y-${toBase36(numericId, 2)}`;
|
|
63
|
+
}
|
|
64
|
+
function getSectorShortId(numericId) {
|
|
65
|
+
return `X-${toBase36(numericId, 3)}`;
|
|
66
|
+
}
|
|
67
|
+
function getMatrixShortId(numericId) {
|
|
68
|
+
return `M-${toBase36(numericId, 4)}`;
|
|
69
|
+
}
|
|
70
|
+
function getStationShortId(numericId) {
|
|
71
|
+
return `S-${toBase36(numericId, 5)}`;
|
|
72
|
+
}
|
|
73
|
+
function getUnitShortId(unitType, numericId) {
|
|
74
|
+
switch (unitType.toLowerCase()) {
|
|
75
|
+
case "system":
|
|
76
|
+
return getSystemShortId(numericId);
|
|
77
|
+
case "sector":
|
|
78
|
+
return getSectorShortId(numericId);
|
|
79
|
+
case "matrix":
|
|
80
|
+
return getMatrixShortId(numericId);
|
|
81
|
+
default:
|
|
82
|
+
return getStationShortId(numericId);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function parseUnitShortId(shortId) {
|
|
86
|
+
if (!shortId || !shortId.includes("-")) {
|
|
87
|
+
throw new Error(`Invalid short_id format: ${shortId}`);
|
|
88
|
+
}
|
|
89
|
+
const [prefix, base36Id] = shortId.split("-");
|
|
90
|
+
const upperPrefix = prefix.toUpperCase();
|
|
91
|
+
const typeMap = {
|
|
92
|
+
Y: "system",
|
|
93
|
+
X: "sector",
|
|
94
|
+
M: "matrix",
|
|
95
|
+
S: "station",
|
|
96
|
+
U: "user",
|
|
97
|
+
};
|
|
98
|
+
if (!(upperPrefix in typeMap)) {
|
|
99
|
+
throw new Error(`Unknown prefix: ${upperPrefix}`);
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
unitType: typeMap[upperPrefix],
|
|
103
|
+
numericId: fromBase36(base36Id),
|
|
104
|
+
shortId: shortId.toUpperCase(),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function getTerritoryFullPath(systemId, sectorId, matrixId, stationId) {
|
|
108
|
+
const parts = [getSystemShortId(systemId)];
|
|
109
|
+
if (sectorId !== undefined && sectorId !== null) {
|
|
110
|
+
parts.push(getSectorShortId(sectorId));
|
|
111
|
+
}
|
|
112
|
+
if (matrixId !== undefined && matrixId !== null) {
|
|
113
|
+
parts.push(getMatrixShortId(matrixId));
|
|
114
|
+
}
|
|
115
|
+
if (stationId !== undefined && stationId !== null) {
|
|
116
|
+
parts.push(getStationShortId(stationId));
|
|
117
|
+
}
|
|
118
|
+
return parts.join(".");
|
|
119
|
+
}
|
|
120
|
+
function getUserLocationId(userNumericId, userLevel, systemId, sectorId, matrixId, stationId) {
|
|
121
|
+
const userPart = getUserShortId(userNumericId);
|
|
122
|
+
const levelPart = `L${userLevel}`;
|
|
123
|
+
let path;
|
|
124
|
+
if (systemId !== undefined && systemId !== null) {
|
|
125
|
+
path = getTerritoryFullPath(systemId, sectorId, matrixId, stationId);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
path = "-";
|
|
129
|
+
}
|
|
130
|
+
return `${userPart}:${levelPart}@${path}`;
|
|
131
|
+
}
|
|
132
|
+
function parseUserLocationId(locationId) {
|
|
133
|
+
const colonIndex = locationId.indexOf(":");
|
|
134
|
+
const atIndex = locationId.indexOf("@");
|
|
135
|
+
if (colonIndex === -1 || atIndex === -1) {
|
|
136
|
+
throw new Error(`Invalid location_id format: ${locationId}`);
|
|
137
|
+
}
|
|
138
|
+
const userPart = locationId.substring(0, colonIndex);
|
|
139
|
+
const levelPart = locationId.substring(colonIndex + 1, atIndex);
|
|
140
|
+
const path = locationId.substring(atIndex + 1);
|
|
141
|
+
const userInfo = parseUnitShortId(userPart);
|
|
142
|
+
const userLevel = parseInt(levelPart.substring(1), 10);
|
|
143
|
+
const result = {
|
|
144
|
+
userShortId: userPart.toUpperCase(),
|
|
145
|
+
userNumericId: userInfo.numericId,
|
|
146
|
+
userLevel,
|
|
147
|
+
userLevelName: exports.USER_LEVELS[userLevel] || "Unknown",
|
|
148
|
+
territoryPath: path,
|
|
149
|
+
};
|
|
150
|
+
if (path !== "-") {
|
|
151
|
+
const parts = path.split(".");
|
|
152
|
+
for (const part of parts) {
|
|
153
|
+
try {
|
|
154
|
+
const parsed = parseUnitShortId(part);
|
|
155
|
+
switch (parsed.unitType) {
|
|
156
|
+
case "system":
|
|
157
|
+
result.systemId = parsed.numericId;
|
|
158
|
+
result.systemShortId = parsed.shortId;
|
|
159
|
+
break;
|
|
160
|
+
case "sector":
|
|
161
|
+
result.sectorId = parsed.numericId;
|
|
162
|
+
result.sectorShortId = parsed.shortId;
|
|
163
|
+
break;
|
|
164
|
+
case "matrix":
|
|
165
|
+
result.matrixId = parsed.numericId;
|
|
166
|
+
result.matrixShortId = parsed.shortId;
|
|
167
|
+
break;
|
|
168
|
+
case "station":
|
|
169
|
+
result.stationId = parsed.numericId;
|
|
170
|
+
result.stationShortId = parsed.shortId;
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch {
|
|
175
|
+
continue;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
181
|
+
function generateUserIds(user) {
|
|
182
|
+
const numericId = user.numeric_id ?? user.numericId;
|
|
183
|
+
if (!numericId) {
|
|
184
|
+
return { shortId: null, locationId: null };
|
|
185
|
+
}
|
|
186
|
+
const shortId = getUserShortId(numericId);
|
|
187
|
+
const userLevel = user.user_level ?? user.userLevel ?? 1;
|
|
188
|
+
const systemId = user.system_id ?? user.systemId ?? user.parent_system_id ?? 1;
|
|
189
|
+
const sectorId = user.sector_id ?? user.sectorId ?? user.parent_sector_id;
|
|
190
|
+
const matrixId = user.matrix_id ?? user.matrixId ?? user.parent_matrix_id;
|
|
191
|
+
const territoryId = user.territory_id;
|
|
192
|
+
const stationId = territoryId
|
|
193
|
+
? parseInt(territoryId.replace(/^S-/, ''), 10)
|
|
194
|
+
: (user.station_id ?? user.stationId);
|
|
195
|
+
const locationId = getUserLocationId(numericId, userLevel, systemId, sectorId ?? undefined, matrixId ?? undefined, stationId ?? undefined);
|
|
196
|
+
return { shortId, locationId };
|
|
197
|
+
}
|
|
198
|
+
function generateUnitIds(unit) {
|
|
199
|
+
const numericId = unit.id ?? unit.unit_id ?? unit.unitId;
|
|
200
|
+
const unitType = (unit.unit_type ?? unit.unitType ?? "station").toLowerCase();
|
|
201
|
+
if (!numericId) {
|
|
202
|
+
return { shortId: null, fullPath: null };
|
|
203
|
+
}
|
|
204
|
+
const shortId = getUnitShortId(unitType, numericId);
|
|
205
|
+
const systemId = unit.parent_system_id ?? unit.system_id ?? 1;
|
|
206
|
+
const sectorId = unit.parent_sector_id ?? unit.sector_id;
|
|
207
|
+
const matrixId = unit.parent_matrix_id ?? unit.matrix_id;
|
|
208
|
+
let fullPath;
|
|
209
|
+
switch (unitType) {
|
|
210
|
+
case "system":
|
|
211
|
+
fullPath = getTerritoryFullPath(numericId);
|
|
212
|
+
break;
|
|
213
|
+
case "sector":
|
|
214
|
+
fullPath = getTerritoryFullPath(systemId, numericId);
|
|
215
|
+
break;
|
|
216
|
+
case "matrix":
|
|
217
|
+
fullPath = getTerritoryFullPath(systemId, sectorId ?? undefined, numericId);
|
|
218
|
+
break;
|
|
219
|
+
default:
|
|
220
|
+
fullPath = getTerritoryFullPath(systemId, sectorId ?? undefined, matrixId ?? undefined, numericId);
|
|
221
|
+
}
|
|
222
|
+
return { shortId, fullPath };
|
|
223
|
+
}
|
|
224
|
+
function formatUserId(shortId, numericId, uid) {
|
|
225
|
+
if (shortId)
|
|
226
|
+
return shortId;
|
|
227
|
+
if (numericId)
|
|
228
|
+
return getUserShortId(numericId);
|
|
229
|
+
if (uid)
|
|
230
|
+
return uid.substring(0, 8) + "...";
|
|
231
|
+
return "-";
|
|
232
|
+
}
|
|
233
|
+
function formatUnitId(shortId, unitType, unitId) {
|
|
234
|
+
if (shortId)
|
|
235
|
+
return shortId;
|
|
236
|
+
if (unitType && unitId)
|
|
237
|
+
return getUnitShortId(unitType, unitId);
|
|
238
|
+
if (unitId)
|
|
239
|
+
return `#${unitId}`;
|
|
240
|
+
return "-";
|
|
241
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cn = cn;
|
|
4
|
+
exports.shortenAddress = shortenAddress;
|
|
5
|
+
exports.formatNumber = formatNumber;
|
|
6
|
+
// AI-generated · AI-managed · AI-maintained
|
|
7
|
+
const clsx_1 = require("clsx");
|
|
8
|
+
const tailwind_merge_1 = require("tailwind-merge");
|
|
9
|
+
function cn(...inputs) {
|
|
10
|
+
return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
|
|
11
|
+
}
|
|
12
|
+
function shortenAddress(address, chars = 4) {
|
|
13
|
+
if (!address)
|
|
14
|
+
return "";
|
|
15
|
+
return `${address.slice(0, chars)}...${address.slice(-chars)}`;
|
|
16
|
+
}
|
|
17
|
+
function formatNumber(value, decimals = 2) {
|
|
18
|
+
if (value === undefined || value === null)
|
|
19
|
+
return "0";
|
|
20
|
+
return value.toLocaleString("en-US", {
|
|
21
|
+
minimumFractionDigits: decimals,
|
|
22
|
+
maximumFractionDigits: decimals,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { WalletType, ChainType, NonceResponse, ListWalletsResponse, AddWalletResponse, RemoveWalletResponse, SetPrimaryWalletResponse } from './types';
|
|
2
|
+
export declare function getNonce(walletAddress: string, walletType: WalletType, chain: ChainType, options?: {
|
|
3
|
+
mode?: 'login' | 'bind';
|
|
4
|
+
firebaseToken?: string;
|
|
5
|
+
}): Promise<NonceResponse>;
|
|
6
|
+
export declare function bindWallet(walletAddress: string, walletType: WalletType, chain: ChainType, signature: string, nonce: string, firebaseToken: string): Promise<{
|
|
7
|
+
success: boolean;
|
|
8
|
+
message?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function listWallets(firebaseToken: string): Promise<ListWalletsResponse>;
|
|
11
|
+
export declare function addWallet(walletAddress: string, walletType: WalletType, chain: ChainType, signature: string, nonce: string, message: string, firebaseToken: string): Promise<AddWalletResponse>;
|
|
12
|
+
export declare function removeWallet(walletAddress: string, firebaseToken: string): Promise<RemoveWalletResponse>;
|
|
13
|
+
export declare function setPrimaryWallet(walletAddress: string, firebaseToken: string): Promise<SetPrimaryWalletResponse>;
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getNonce = getNonce;
|
|
4
|
+
exports.bindWallet = bindWallet;
|
|
5
|
+
exports.listWallets = listWallets;
|
|
6
|
+
exports.addWallet = addWallet;
|
|
7
|
+
exports.removeWallet = removeWallet;
|
|
8
|
+
exports.setPrimaryWallet = setPrimaryWallet;
|
|
9
|
+
const auth_service_1 = require("../auth-service");
|
|
10
|
+
const API_BASE = '/api/auth/wallet';
|
|
11
|
+
async function getNonce(walletAddress, walletType, chain, options) {
|
|
12
|
+
const headers = {
|
|
13
|
+
'Content-Type': 'application/json',
|
|
14
|
+
};
|
|
15
|
+
if (options?.firebaseToken) {
|
|
16
|
+
headers['Authorization'] = `Bearer ${options.firebaseToken}`;
|
|
17
|
+
}
|
|
18
|
+
const response = await fetch(`${API_BASE}/nonce`, {
|
|
19
|
+
method: 'POST',
|
|
20
|
+
headers,
|
|
21
|
+
body: JSON.stringify({
|
|
22
|
+
wallet_address: walletAddress,
|
|
23
|
+
wallet_type: walletType,
|
|
24
|
+
chain,
|
|
25
|
+
mode: options?.mode,
|
|
26
|
+
}),
|
|
27
|
+
});
|
|
28
|
+
if (!response.ok) {
|
|
29
|
+
const error = await response.json().catch(() => ({}));
|
|
30
|
+
throw new Error(error.error || error.message || '获取 Nonce 失败');
|
|
31
|
+
}
|
|
32
|
+
const result = await response.json();
|
|
33
|
+
if (result.data) {
|
|
34
|
+
return result.data;
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
async function bindWallet(walletAddress, walletType, chain, signature, nonce, firebaseToken) {
|
|
39
|
+
const response = await fetch(`${API_BASE}/bind`, {
|
|
40
|
+
method: 'POST',
|
|
41
|
+
headers: {
|
|
42
|
+
'Content-Type': 'application/json',
|
|
43
|
+
Authorization: `Bearer ${firebaseToken}`,
|
|
44
|
+
},
|
|
45
|
+
body: JSON.stringify({
|
|
46
|
+
wallet_address: walletAddress,
|
|
47
|
+
wallet_type: walletType,
|
|
48
|
+
chain,
|
|
49
|
+
signature,
|
|
50
|
+
nonce,
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
54
|
+
if (!response.ok) {
|
|
55
|
+
const error = await response.json().catch(() => ({}));
|
|
56
|
+
throw new Error(error.message || '绑定钱包失败');
|
|
57
|
+
}
|
|
58
|
+
return response.json();
|
|
59
|
+
}
|
|
60
|
+
async function listWallets(firebaseToken) {
|
|
61
|
+
const response = await fetch(`${API_BASE}/list`, {
|
|
62
|
+
method: 'GET',
|
|
63
|
+
headers: {
|
|
64
|
+
Authorization: `Bearer ${firebaseToken}`,
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
const error = await response.json().catch(() => ({}));
|
|
70
|
+
throw new Error(error.error || '获取钱包列表失败');
|
|
71
|
+
}
|
|
72
|
+
return response.json();
|
|
73
|
+
}
|
|
74
|
+
async function addWallet(walletAddress, walletType, chain, signature, nonce, message, firebaseToken) {
|
|
75
|
+
const response = await fetch(`${API_BASE}/add`, {
|
|
76
|
+
method: 'POST',
|
|
77
|
+
headers: {
|
|
78
|
+
'Content-Type': 'application/json',
|
|
79
|
+
Authorization: `Bearer ${firebaseToken}`,
|
|
80
|
+
},
|
|
81
|
+
body: JSON.stringify({
|
|
82
|
+
wallet_address: walletAddress,
|
|
83
|
+
wallet_type: walletType,
|
|
84
|
+
chain,
|
|
85
|
+
signature,
|
|
86
|
+
nonce,
|
|
87
|
+
message,
|
|
88
|
+
}),
|
|
89
|
+
});
|
|
90
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
91
|
+
if (!response.ok) {
|
|
92
|
+
const error = await response.json().catch(() => ({}));
|
|
93
|
+
throw new Error(error.error || '添加钱包失败');
|
|
94
|
+
}
|
|
95
|
+
return response.json();
|
|
96
|
+
}
|
|
97
|
+
async function removeWallet(walletAddress, firebaseToken) {
|
|
98
|
+
const response = await fetch(`${API_BASE}/remove`, {
|
|
99
|
+
method: 'DELETE',
|
|
100
|
+
headers: {
|
|
101
|
+
'Content-Type': 'application/json',
|
|
102
|
+
Authorization: `Bearer ${firebaseToken}`,
|
|
103
|
+
},
|
|
104
|
+
body: JSON.stringify({
|
|
105
|
+
wallet_address: walletAddress,
|
|
106
|
+
}),
|
|
107
|
+
});
|
|
108
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
109
|
+
if (!response.ok) {
|
|
110
|
+
const error = await response.json().catch(() => ({}));
|
|
111
|
+
throw new Error(error.error || '删除钱包失败');
|
|
112
|
+
}
|
|
113
|
+
return response.json();
|
|
114
|
+
}
|
|
115
|
+
async function setPrimaryWallet(walletAddress, firebaseToken) {
|
|
116
|
+
const response = await fetch(`${API_BASE}/set-primary`, {
|
|
117
|
+
method: 'PUT',
|
|
118
|
+
headers: {
|
|
119
|
+
'Content-Type': 'application/json',
|
|
120
|
+
Authorization: `Bearer ${firebaseToken}`,
|
|
121
|
+
},
|
|
122
|
+
body: JSON.stringify({
|
|
123
|
+
wallet_address: walletAddress,
|
|
124
|
+
}),
|
|
125
|
+
});
|
|
126
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
127
|
+
if (!response.ok) {
|
|
128
|
+
const error = await response.json().catch(() => ({}));
|
|
129
|
+
throw new Error(error.error || '设置主钱包失败');
|
|
130
|
+
}
|
|
131
|
+
return response.json();
|
|
132
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
export type WalletType = 'phantom' | 'solflare' | 'metamask' | 'binance' | 'okx' | 'bybit';
|
|
2
|
+
export type ChainType = 'solana' | 'evm';
|
|
3
|
+
export interface WalletInfo {
|
|
4
|
+
type: WalletType;
|
|
5
|
+
name: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
chain: ChainType;
|
|
8
|
+
installed: boolean;
|
|
9
|
+
downloadUrl: string;
|
|
10
|
+
}
|
|
11
|
+
export interface WalletConnectionState {
|
|
12
|
+
connected: boolean;
|
|
13
|
+
connecting: boolean;
|
|
14
|
+
address: string | null;
|
|
15
|
+
walletType: WalletType | null;
|
|
16
|
+
chain: ChainType | null;
|
|
17
|
+
}
|
|
18
|
+
export interface NonceResponse {
|
|
19
|
+
nonce: string;
|
|
20
|
+
expires_at: string;
|
|
21
|
+
message: string;
|
|
22
|
+
}
|
|
23
|
+
export interface VerifySignatureRequest {
|
|
24
|
+
wallet_address: string;
|
|
25
|
+
wallet_type: WalletType;
|
|
26
|
+
chain: ChainType;
|
|
27
|
+
signature: string;
|
|
28
|
+
nonce: string;
|
|
29
|
+
}
|
|
30
|
+
export interface VerifySignatureResponse {
|
|
31
|
+
success: boolean;
|
|
32
|
+
firebase_custom_token?: string;
|
|
33
|
+
user?: {
|
|
34
|
+
uid: string;
|
|
35
|
+
wallet_address: string;
|
|
36
|
+
email?: string;
|
|
37
|
+
role: string;
|
|
38
|
+
};
|
|
39
|
+
error?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface WalletDetectionResult {
|
|
42
|
+
phantom: boolean;
|
|
43
|
+
solflare: boolean;
|
|
44
|
+
metamask: boolean;
|
|
45
|
+
metamaskSolana: boolean;
|
|
46
|
+
binance: boolean;
|
|
47
|
+
okx: boolean;
|
|
48
|
+
bybit: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const WALLET_CONFIG: Record<WalletType, Omit<WalletInfo, 'installed'>>;
|
|
51
|
+
export declare const SIGN_MESSAGE_TEMPLATE: (nonce: string, timestamp: number) => string;
|
|
52
|
+
export interface UserWallet {
|
|
53
|
+
wallet_address: string;
|
|
54
|
+
wallet_type: 'solana' | 'evm';
|
|
55
|
+
is_primary: boolean;
|
|
56
|
+
created_at: string;
|
|
57
|
+
}
|
|
58
|
+
export interface ListWalletsResponse {
|
|
59
|
+
success: boolean;
|
|
60
|
+
data?: {
|
|
61
|
+
wallets: UserWallet[];
|
|
62
|
+
primary_wallet: string | null;
|
|
63
|
+
};
|
|
64
|
+
error?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface AddWalletResponse {
|
|
67
|
+
success: boolean;
|
|
68
|
+
data?: {
|
|
69
|
+
wallet_address: string;
|
|
70
|
+
is_primary: boolean;
|
|
71
|
+
message: string;
|
|
72
|
+
};
|
|
73
|
+
error?: string;
|
|
74
|
+
}
|
|
75
|
+
export interface RemoveWalletResponse {
|
|
76
|
+
success: boolean;
|
|
77
|
+
message?: string;
|
|
78
|
+
error?: string;
|
|
79
|
+
}
|
|
80
|
+
export interface SetPrimaryWalletResponse {
|
|
81
|
+
success: boolean;
|
|
82
|
+
data?: {
|
|
83
|
+
old_primary: string | null;
|
|
84
|
+
new_primary: string;
|
|
85
|
+
};
|
|
86
|
+
error?: string;
|
|
87
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SIGN_MESSAGE_TEMPLATE = exports.WALLET_CONFIG = void 0;
|
|
4
|
+
exports.WALLET_CONFIG = {
|
|
5
|
+
phantom: {
|
|
6
|
+
type: 'phantom',
|
|
7
|
+
name: 'Phantom',
|
|
8
|
+
icon: '/wallets/phantom.svg',
|
|
9
|
+
chain: 'solana',
|
|
10
|
+
downloadUrl: 'https://phantom.app/download',
|
|
11
|
+
},
|
|
12
|
+
solflare: {
|
|
13
|
+
type: 'solflare',
|
|
14
|
+
name: 'Solflare',
|
|
15
|
+
icon: '/wallets/solflare.svg',
|
|
16
|
+
chain: 'solana',
|
|
17
|
+
downloadUrl: 'https://solflare.com/download',
|
|
18
|
+
},
|
|
19
|
+
metamask: {
|
|
20
|
+
type: 'metamask',
|
|
21
|
+
name: 'MetaMask',
|
|
22
|
+
icon: '/wallets/metamask.svg',
|
|
23
|
+
chain: 'evm',
|
|
24
|
+
downloadUrl: 'https://metamask.io/download/',
|
|
25
|
+
},
|
|
26
|
+
binance: {
|
|
27
|
+
type: 'binance',
|
|
28
|
+
name: 'Binance Web3',
|
|
29
|
+
icon: '/wallets/binance.svg',
|
|
30
|
+
chain: 'evm',
|
|
31
|
+
downloadUrl: 'https://www.binance.com/en/web3wallet',
|
|
32
|
+
},
|
|
33
|
+
okx: {
|
|
34
|
+
type: 'okx',
|
|
35
|
+
name: 'OKX Wallet',
|
|
36
|
+
icon: '/wallets/okx.svg',
|
|
37
|
+
chain: 'evm',
|
|
38
|
+
downloadUrl: 'https://www.okx.com/web3',
|
|
39
|
+
},
|
|
40
|
+
bybit: {
|
|
41
|
+
type: 'bybit',
|
|
42
|
+
name: 'Bybit Wallet',
|
|
43
|
+
icon: '/wallets/bybit.svg',
|
|
44
|
+
chain: 'evm',
|
|
45
|
+
downloadUrl: 'https://www.bybit.com/web3',
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
const SIGN_MESSAGE_TEMPLATE = (nonce, timestamp) => `Welcome to Microcosm!
|
|
49
|
+
|
|
50
|
+
Please sign this message to verify your wallet ownership.
|
|
51
|
+
|
|
52
|
+
Wallet: {wallet_address}
|
|
53
|
+
Nonce: ${nonce}
|
|
54
|
+
Timestamp: ${timestamp}
|
|
55
|
+
Chain: {chain}
|
|
56
|
+
|
|
57
|
+
This signature will not trigger any blockchain transaction or cost any gas fees.`;
|
|
58
|
+
exports.SIGN_MESSAGE_TEMPLATE = SIGN_MESSAGE_TEMPLATE;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microcosmmoney/portal-react",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.13.0",
|
|
4
4
|
"description": "Microcosm Portal UI components for React/Next.js",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,17 +14,67 @@
|
|
|
14
14
|
"peerDependencies": {
|
|
15
15
|
"react": ">=18.0.0",
|
|
16
16
|
"react-dom": ">=18.0.0",
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"next": ">=14.0.0",
|
|
18
|
+
"next-intl": ">=3.0.0"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@microcosmmoney/auth-core": "^2.3.3",
|
|
22
|
-
"@microcosmmoney/auth-react": "^2.6.1"
|
|
22
|
+
"@microcosmmoney/auth-react": "^2.6.1",
|
|
23
|
+
"@radix-ui/react-accordion": "^1.2.12",
|
|
24
|
+
"@radix-ui/react-alert-dialog": "^1.1.15",
|
|
25
|
+
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
|
26
|
+
"@radix-ui/react-avatar": "^1.1.10",
|
|
27
|
+
"@radix-ui/react-checkbox": "^1.3.3",
|
|
28
|
+
"@radix-ui/react-collapsible": "^1.1.12",
|
|
29
|
+
"@radix-ui/react-context-menu": "^2.2.16",
|
|
30
|
+
"@radix-ui/react-dialog": "^1.1.15",
|
|
31
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
32
|
+
"@radix-ui/react-hover-card": "^1.1.15",
|
|
33
|
+
"@radix-ui/react-label": "^2.1.7",
|
|
34
|
+
"@radix-ui/react-menubar": "^1.1.16",
|
|
35
|
+
"@radix-ui/react-navigation-menu": "^1.2.14",
|
|
36
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
37
|
+
"@radix-ui/react-progress": "^1.1.7",
|
|
38
|
+
"@radix-ui/react-radio-group": "^1.3.8",
|
|
39
|
+
"@radix-ui/react-scroll-area": "^1.2.10",
|
|
40
|
+
"@radix-ui/react-select": "^2.2.6",
|
|
41
|
+
"@radix-ui/react-separator": "^1.1.7",
|
|
42
|
+
"@radix-ui/react-slider": "^1.3.6",
|
|
43
|
+
"@radix-ui/react-slot": "^1.2.3",
|
|
44
|
+
"@radix-ui/react-switch": "^1.2.6",
|
|
45
|
+
"@radix-ui/react-tabs": "^1.1.13",
|
|
46
|
+
"@radix-ui/react-toast": "^1.2.4",
|
|
47
|
+
"@radix-ui/react-toggle": "^1.1.10",
|
|
48
|
+
"@radix-ui/react-toggle-group": "^1.1.11",
|
|
49
|
+
"@radix-ui/react-tooltip": "^1.2.8",
|
|
50
|
+
"@solana/spl-token": "^0.4.14",
|
|
51
|
+
"@solana/wallet-adapter-react": "^0.15.39",
|
|
52
|
+
"@solana/wallet-adapter-react-ui": "^0.9.39",
|
|
53
|
+
"@solana/web3.js": "^1.98.4",
|
|
54
|
+
"class-variance-authority": "^0.7.1",
|
|
55
|
+
"clsx": "^2.1.1",
|
|
56
|
+
"cmdk": "^1.1.1",
|
|
57
|
+
"date-fns": "^4.1.0",
|
|
58
|
+
"embla-carousel-react": "^8.6.0",
|
|
59
|
+
"framer-motion": "^12.23.26",
|
|
60
|
+
"input-otp": "^1.4.2",
|
|
61
|
+
"lucide-react": "^0.543.0",
|
|
62
|
+
"next-themes": "^0.4.6",
|
|
63
|
+
"qrcode.react": "^4.2.0",
|
|
64
|
+
"react-day-picker": "^9.9.0",
|
|
65
|
+
"react-hook-form": "^7.62.0",
|
|
66
|
+
"react-resizable-panels": "^3.0.5",
|
|
67
|
+
"recharts": "^2.15.4",
|
|
68
|
+
"sonner": "^2.0.7",
|
|
69
|
+
"swr": "^2.3.6",
|
|
70
|
+
"tailwind-merge": "^3.3.1",
|
|
71
|
+
"vaul": "^1.1.2"
|
|
23
72
|
},
|
|
24
73
|
"devDependencies": {
|
|
25
74
|
"@types/react": "^18.0.0",
|
|
26
75
|
"react": "^18.0.0",
|
|
27
|
-
"
|
|
76
|
+
"next": "^15.5.9",
|
|
77
|
+
"next-intl": "^4.8.3",
|
|
28
78
|
"typescript": "^5.3.0"
|
|
29
79
|
},
|
|
30
80
|
"license": "MIT",
|