@microcosmmoney/portal-react 3.12.7 → 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/components/mcd/mcd-page.js +3 -5
- package/dist/components/wallet/wallet-page.js +1 -1
- 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,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSystemAddresses = exports.searchAddress = exports.refreshPoolTraders = exports.getPoolTraders = exports.syncMCCHolders = exports.labelMCCHolder = exports.getMCCHolderTransactions = exports.getMCCHolderStats = exports.getMCCHolders = void 0;
|
|
4
|
+
// AI-generated · AI-managed · AI-maintained
|
|
5
|
+
const core_1 = require("./core");
|
|
6
|
+
// === API 调用 ===
|
|
7
|
+
const getMCCHolders = (params) => {
|
|
8
|
+
const query = new URLSearchParams();
|
|
9
|
+
if (params?.page)
|
|
10
|
+
query.append('page', params.page.toString());
|
|
11
|
+
if (params?.page_size)
|
|
12
|
+
query.append('page_size', params.page_size.toString());
|
|
13
|
+
if (params?.sort_by)
|
|
14
|
+
query.append('sort_by', params.sort_by);
|
|
15
|
+
if (params?.sort_order)
|
|
16
|
+
query.append('sort_order', params.sort_order);
|
|
17
|
+
if (params?.holder_type)
|
|
18
|
+
query.append('holder_type', params.holder_type);
|
|
19
|
+
if (params?.min_balance !== undefined)
|
|
20
|
+
query.append('min_balance', params.min_balance.toString());
|
|
21
|
+
const qs = query.toString();
|
|
22
|
+
return (0, core_1.fetchApi)(`/blockchain/mcc/holders${qs ? '?' + qs : ''}`);
|
|
23
|
+
};
|
|
24
|
+
exports.getMCCHolders = getMCCHolders;
|
|
25
|
+
const getMCCHolderStats = () => (0, core_1.fetchApi)('/blockchain/mcc/holders/stats');
|
|
26
|
+
exports.getMCCHolderStats = getMCCHolderStats;
|
|
27
|
+
const getMCCHolderTransactions = (wallet, limit = 50) => (0, core_1.fetchApi)(`/blockchain/mcc/holders/${wallet}/transactions?limit=${limit}`);
|
|
28
|
+
exports.getMCCHolderTransactions = getMCCHolderTransactions;
|
|
29
|
+
const labelMCCHolder = (wallet, data) => (0, core_1.fetchApi)(`/blockchain/mcc/holders/${wallet}/label`, {
|
|
30
|
+
method: 'POST',
|
|
31
|
+
body: JSON.stringify(data)
|
|
32
|
+
});
|
|
33
|
+
exports.labelMCCHolder = labelMCCHolder;
|
|
34
|
+
const syncMCCHolders = () => (0, core_1.fetchApi)('/blockchain/mcc/holders/sync', { method: 'POST' });
|
|
35
|
+
exports.syncMCCHolders = syncMCCHolders;
|
|
36
|
+
// === 新增 API ===
|
|
37
|
+
const getPoolTraders = (period = '7d') => (0, core_1.fetchApi)(`/blockchain/mcc/holders/traders?period=${period}`);
|
|
38
|
+
exports.getPoolTraders = getPoolTraders;
|
|
39
|
+
const refreshPoolTraders = (period = '7d') => (0, core_1.fetchApi)(`/blockchain/mcc/holders/traders/refresh?period=${period}`, { method: 'POST' });
|
|
40
|
+
exports.refreshPoolTraders = refreshPoolTraders;
|
|
41
|
+
const searchAddress = (address, period = '24h') => (0, core_1.fetchApi)(`/blockchain/mcc/holders/search?address=${encodeURIComponent(address)}&period=${period}`);
|
|
42
|
+
exports.searchAddress = searchAddress;
|
|
43
|
+
const getSystemAddresses = (category) => {
|
|
44
|
+
const params = category ? `?category=${category}` : '';
|
|
45
|
+
return (0, core_1.fetchApi)(`/blockchain/mcc/holders/system-addresses${params}`);
|
|
46
|
+
};
|
|
47
|
+
exports.getSystemAddresses = getSystemAddresses;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.proxyToOrgService = proxyToOrgService;
|
|
4
|
+
// AI-generated · AI-managed · AI-maintained
|
|
5
|
+
async function proxyToOrgService(endpoint, options = {}) {
|
|
6
|
+
const baseUrl = process.env.ORGANIZATION_SERVICE_URL || 'http://organization-service.microcosm.svc.cluster.local';
|
|
7
|
+
const internalSecret = process.env.MICROCOSM_INTERNAL_SECRET || '';
|
|
8
|
+
let uid = options.xUserUid || null;
|
|
9
|
+
if (!uid && options.authHeader) {
|
|
10
|
+
try {
|
|
11
|
+
const token = options.authHeader.replace('Bearer ', '');
|
|
12
|
+
const response = await fetch(`${baseUrl}/auth/verify-firebase-token`, {
|
|
13
|
+
method: 'POST',
|
|
14
|
+
headers: {
|
|
15
|
+
'Content-Type': 'application/json',
|
|
16
|
+
'X-Microcosm-Internal-Secret': internalSecret,
|
|
17
|
+
},
|
|
18
|
+
body: JSON.stringify({ token })
|
|
19
|
+
});
|
|
20
|
+
if (response.ok) {
|
|
21
|
+
const data = await response.json();
|
|
22
|
+
uid = data.uid;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
catch (error) {
|
|
26
|
+
console.error('Firebase token verification failed:', error);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (!uid) {
|
|
30
|
+
throw new Error('无法获取用户标识');
|
|
31
|
+
}
|
|
32
|
+
let url = `${baseUrl}${endpoint}`;
|
|
33
|
+
if (options.query) {
|
|
34
|
+
const params = new URLSearchParams(options.query);
|
|
35
|
+
url += `?${params.toString()}`;
|
|
36
|
+
}
|
|
37
|
+
const fetchOptions = {
|
|
38
|
+
method: options.method || 'GET',
|
|
39
|
+
headers: {
|
|
40
|
+
'Content-Type': 'application/json',
|
|
41
|
+
'X-User-UID': uid,
|
|
42
|
+
'X-Microcosm-Internal-Secret': internalSecret,
|
|
43
|
+
},
|
|
44
|
+
cache: 'no-store',
|
|
45
|
+
};
|
|
46
|
+
if (options.body && (options.method === 'POST' || options.method === 'PUT')) {
|
|
47
|
+
fetchOptions.body = JSON.stringify(options.body);
|
|
48
|
+
}
|
|
49
|
+
const response = await fetch(url, fetchOptions);
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
const errorText = await response.text();
|
|
52
|
+
throw new Error(`Organization service returned ${response.status}: ${errorText}`);
|
|
53
|
+
}
|
|
54
|
+
return response.json();
|
|
55
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { APIResponse, AIProductsResponse, AIProductDetailResponse, AIRequestsResponse, AIRequestDetailResponse, SubmitAIRequestResponse, AIChatResponse, StrategyConfig, BinanceOrderResponse, BinanceCancelResponse } from '../../types/api';
|
|
2
|
+
export declare function getAIProducts(params?: {
|
|
3
|
+
status?: 'active' | 'all';
|
|
4
|
+
risk_level?: 'low' | 'medium' | 'high' | 'all';
|
|
5
|
+
sort?: 'risk' | 'return' | 'popularity';
|
|
6
|
+
}): Promise<AIProductsResponse>;
|
|
7
|
+
export declare function getAIProductDetail(productId: string): Promise<AIProductDetailResponse>;
|
|
8
|
+
export declare function submitAIRequest(data: {
|
|
9
|
+
ai_product_id: string;
|
|
10
|
+
exchange: string;
|
|
11
|
+
amount: number;
|
|
12
|
+
}): Promise<SubmitAIRequestResponse>;
|
|
13
|
+
export declare function getUserAIRequests(status?: string): Promise<AIRequestsResponse>;
|
|
14
|
+
export declare function getAIRequestDetail(requestId: string): Promise<AIRequestDetailResponse>;
|
|
15
|
+
export declare function cancelAIRequest(requestId: string): Promise<APIResponse<void>>;
|
|
16
|
+
export declare function stopAIStrategy(requestId: string, reason?: string): Promise<APIResponse<void>>;
|
|
17
|
+
export declare function getPendingAIRequests(): Promise<AIRequestsResponse>;
|
|
18
|
+
export declare function acceptAIRequest(requestId: string): Promise<APIResponse<void>>;
|
|
19
|
+
export declare function configureAIStrategy(requestId: string, config: StrategyConfig): Promise<APIResponse<void>>;
|
|
20
|
+
export declare function startAIStrategy(requestId: string): Promise<APIResponse<void>>;
|
|
21
|
+
export declare function rejectAIRequest(requestId: string, reason: string): Promise<APIResponse<void>>;
|
|
22
|
+
export declare function chatWithAIProduct(data: {
|
|
23
|
+
product_id: string;
|
|
24
|
+
product_info: Record<string, unknown>;
|
|
25
|
+
message: string;
|
|
26
|
+
history?: Array<{
|
|
27
|
+
role: string;
|
|
28
|
+
content: string;
|
|
29
|
+
}>;
|
|
30
|
+
}): Promise<AIChatResponse>;
|
|
31
|
+
export declare function getMyAIRequests(status?: string): Promise<AIRequestsResponse>;
|
|
32
|
+
export interface AISuggestion {
|
|
33
|
+
suggestion_id: string;
|
|
34
|
+
strategy_id: string;
|
|
35
|
+
symbol: string;
|
|
36
|
+
uid: string;
|
|
37
|
+
status: 'pending' | 'approved' | 'rejected' | 'modified' | 'executed' | 'expired';
|
|
38
|
+
suggestions: Array<{
|
|
39
|
+
param_name: string;
|
|
40
|
+
current_value: number;
|
|
41
|
+
suggested_value: number;
|
|
42
|
+
change_pct: number;
|
|
43
|
+
reason: string;
|
|
44
|
+
}>;
|
|
45
|
+
market_analysis: {
|
|
46
|
+
market_state: string;
|
|
47
|
+
trend_direction: string;
|
|
48
|
+
atr_pct: number;
|
|
49
|
+
adx: number;
|
|
50
|
+
plus_di: number;
|
|
51
|
+
minus_di: number;
|
|
52
|
+
volatility: number;
|
|
53
|
+
snapshot_time: string;
|
|
54
|
+
analysis_reason: string;
|
|
55
|
+
};
|
|
56
|
+
expected_outcomes: {
|
|
57
|
+
risk_change: string;
|
|
58
|
+
profit_impact?: string;
|
|
59
|
+
confidence: number;
|
|
60
|
+
};
|
|
61
|
+
trader_feedback?: string;
|
|
62
|
+
trader_modified_values?: Record<string, number>;
|
|
63
|
+
created_at: string;
|
|
64
|
+
reviewed_at?: string;
|
|
65
|
+
executed_at?: string;
|
|
66
|
+
expires_at: string;
|
|
67
|
+
reviewed_by?: string;
|
|
68
|
+
strategy_name?: string;
|
|
69
|
+
current_params?: Record<string, unknown>;
|
|
70
|
+
}
|
|
71
|
+
export interface AISuggestionsResponse {
|
|
72
|
+
success: boolean;
|
|
73
|
+
count: number;
|
|
74
|
+
suggestions: AISuggestion[];
|
|
75
|
+
error?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface AISuggestionDetailResponse {
|
|
78
|
+
success: boolean;
|
|
79
|
+
suggestion: AISuggestion;
|
|
80
|
+
error?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface AISuggestionStatsResponse {
|
|
83
|
+
success: boolean;
|
|
84
|
+
period: string;
|
|
85
|
+
stats: Record<string, {
|
|
86
|
+
count: number;
|
|
87
|
+
strategies: number;
|
|
88
|
+
symbols: number;
|
|
89
|
+
}>;
|
|
90
|
+
error?: string;
|
|
91
|
+
}
|
|
92
|
+
export declare function getAISuggestions(params?: {
|
|
93
|
+
trader_uid?: string;
|
|
94
|
+
status?: string;
|
|
95
|
+
limit?: number;
|
|
96
|
+
}): Promise<AISuggestionsResponse>;
|
|
97
|
+
export declare function getAISuggestionDetail(suggestionId: string): Promise<AISuggestionDetailResponse>;
|
|
98
|
+
export declare function approveAISuggestion(suggestionId: string, reviewer: string, modifiedValues?: Record<string, number>): Promise<APIResponse<void>>;
|
|
99
|
+
export declare function rejectAISuggestion(suggestionId: string, reviewer: string, feedback: string): Promise<APIResponse<void>>;
|
|
100
|
+
export declare function generateAISuggestions(timeframe?: string): Promise<APIResponse<{
|
|
101
|
+
total: number;
|
|
102
|
+
generated: number;
|
|
103
|
+
skipped: number;
|
|
104
|
+
errors: number;
|
|
105
|
+
}>>;
|
|
106
|
+
export declare function getAISuggestionStats(trader_uid?: string): Promise<AISuggestionStatsResponse>;
|
|
107
|
+
export declare function getMarketState(symbol: string, timeframe?: string, refresh?: boolean): Promise<APIResponse<{
|
|
108
|
+
symbol: string;
|
|
109
|
+
timeframe: string;
|
|
110
|
+
market_state: string;
|
|
111
|
+
trend_direction: string;
|
|
112
|
+
indicators: {
|
|
113
|
+
atr: number;
|
|
114
|
+
atr_pct: number;
|
|
115
|
+
adx: number;
|
|
116
|
+
plus_di: number;
|
|
117
|
+
minus_di: number;
|
|
118
|
+
volatility: number;
|
|
119
|
+
};
|
|
120
|
+
suggestion: {
|
|
121
|
+
risk_level: string;
|
|
122
|
+
adjustments: Record<string, {
|
|
123
|
+
direction: string;
|
|
124
|
+
range: string;
|
|
125
|
+
}>;
|
|
126
|
+
reason: string;
|
|
127
|
+
};
|
|
128
|
+
}>>;
|
|
129
|
+
export declare function cancelBinanceOrder(symbol: string, clientOrderId: string): Promise<BinanceCancelResponse>;
|
|
130
|
+
export declare function placeBinanceOrder(data: {
|
|
131
|
+
symbol: string;
|
|
132
|
+
side: string;
|
|
133
|
+
positionSide: string;
|
|
134
|
+
quantity: number;
|
|
135
|
+
orderType?: string;
|
|
136
|
+
price?: number;
|
|
137
|
+
clientOrderId?: string;
|
|
138
|
+
}): Promise<BinanceOrderResponse>;
|
|
139
|
+
export declare function modifyBinanceOrder(symbol: string, clientOrderId: string, newPrice: number): Promise<BinanceOrderResponse>;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAIProducts = getAIProducts;
|
|
4
|
+
exports.getAIProductDetail = getAIProductDetail;
|
|
5
|
+
exports.submitAIRequest = submitAIRequest;
|
|
6
|
+
exports.getUserAIRequests = getUserAIRequests;
|
|
7
|
+
exports.getAIRequestDetail = getAIRequestDetail;
|
|
8
|
+
exports.cancelAIRequest = cancelAIRequest;
|
|
9
|
+
exports.stopAIStrategy = stopAIStrategy;
|
|
10
|
+
exports.getPendingAIRequests = getPendingAIRequests;
|
|
11
|
+
exports.acceptAIRequest = acceptAIRequest;
|
|
12
|
+
exports.configureAIStrategy = configureAIStrategy;
|
|
13
|
+
exports.startAIStrategy = startAIStrategy;
|
|
14
|
+
exports.rejectAIRequest = rejectAIRequest;
|
|
15
|
+
exports.chatWithAIProduct = chatWithAIProduct;
|
|
16
|
+
exports.getMyAIRequests = getMyAIRequests;
|
|
17
|
+
exports.getAISuggestions = getAISuggestions;
|
|
18
|
+
exports.getAISuggestionDetail = getAISuggestionDetail;
|
|
19
|
+
exports.approveAISuggestion = approveAISuggestion;
|
|
20
|
+
exports.rejectAISuggestion = rejectAISuggestion;
|
|
21
|
+
exports.generateAISuggestions = generateAISuggestions;
|
|
22
|
+
exports.getAISuggestionStats = getAISuggestionStats;
|
|
23
|
+
exports.getMarketState = getMarketState;
|
|
24
|
+
exports.cancelBinanceOrder = cancelBinanceOrder;
|
|
25
|
+
exports.placeBinanceOrder = placeBinanceOrder;
|
|
26
|
+
exports.modifyBinanceOrder = modifyBinanceOrder;
|
|
27
|
+
const core_1 = require("../core");
|
|
28
|
+
const auth_service_1 = require("../../auth-service");
|
|
29
|
+
async function getAIProducts(params) {
|
|
30
|
+
const queryParams = new URLSearchParams();
|
|
31
|
+
if (params?.status)
|
|
32
|
+
queryParams.append('status', params.status);
|
|
33
|
+
if (params?.risk_level)
|
|
34
|
+
queryParams.append('risk_level', params.risk_level);
|
|
35
|
+
if (params?.sort)
|
|
36
|
+
queryParams.append('sort', params.sort);
|
|
37
|
+
const queryString = queryParams.toString();
|
|
38
|
+
const url = `/api/ai-products${queryString ? `?${queryString}` : ''}`;
|
|
39
|
+
const response = await fetch(url);
|
|
40
|
+
return response.json();
|
|
41
|
+
}
|
|
42
|
+
async function getAIProductDetail(productId) {
|
|
43
|
+
const response = await fetch(`/api/ai-products/${productId}`);
|
|
44
|
+
return response.json();
|
|
45
|
+
}
|
|
46
|
+
async function submitAIRequest(data) {
|
|
47
|
+
return (0, core_1.fetchApi)('/user/ai-requests', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
body: JSON.stringify(data)
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
async function getUserAIRequests(status) {
|
|
53
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
54
|
+
const url = status
|
|
55
|
+
? `/api/user/ai-requests?status=${status}`
|
|
56
|
+
: '/api/user/ai-requests';
|
|
57
|
+
const response = await fetch(url, {
|
|
58
|
+
headers: { 'Authorization': `Bearer ${token}` }
|
|
59
|
+
});
|
|
60
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
61
|
+
return response.json();
|
|
62
|
+
}
|
|
63
|
+
async function getAIRequestDetail(requestId) {
|
|
64
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
65
|
+
const response = await fetch(`/api/user/ai-requests/${requestId}`, {
|
|
66
|
+
headers: { 'Authorization': `Bearer ${token}` }
|
|
67
|
+
});
|
|
68
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
69
|
+
return response.json();
|
|
70
|
+
}
|
|
71
|
+
async function cancelAIRequest(requestId) {
|
|
72
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
73
|
+
const response = await fetch(`/api/user/ai-requests/${requestId}`, {
|
|
74
|
+
method: 'DELETE',
|
|
75
|
+
headers: { 'Authorization': `Bearer ${token}` }
|
|
76
|
+
});
|
|
77
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
78
|
+
return response.json();
|
|
79
|
+
}
|
|
80
|
+
async function stopAIStrategy(requestId, reason) {
|
|
81
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
82
|
+
const response = await fetch(`/api/user/ai-requests/${requestId}/stop`, {
|
|
83
|
+
method: 'POST',
|
|
84
|
+
headers: {
|
|
85
|
+
'Content-Type': 'application/json',
|
|
86
|
+
'Authorization': `Bearer ${token}`
|
|
87
|
+
},
|
|
88
|
+
body: JSON.stringify({ reason })
|
|
89
|
+
});
|
|
90
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
91
|
+
return response.json();
|
|
92
|
+
}
|
|
93
|
+
async function getPendingAIRequests() {
|
|
94
|
+
return (0, core_1.fetchApi)('/trader/ai-requests/pending');
|
|
95
|
+
}
|
|
96
|
+
async function acceptAIRequest(requestId) {
|
|
97
|
+
return (0, core_1.fetchApi)(`/trader/ai-requests/${requestId}/accept`, { method: 'POST' });
|
|
98
|
+
}
|
|
99
|
+
async function configureAIStrategy(requestId, config) {
|
|
100
|
+
return (0, core_1.fetchApi)(`/trader/ai-requests/${requestId}/configure`, {
|
|
101
|
+
method: 'POST',
|
|
102
|
+
body: JSON.stringify(config)
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async function startAIStrategy(requestId) {
|
|
106
|
+
return (0, core_1.fetchApi)(`/trader/ai-requests/${requestId}/start`, { method: 'POST' });
|
|
107
|
+
}
|
|
108
|
+
async function rejectAIRequest(requestId, reason) {
|
|
109
|
+
return (0, core_1.fetchApi)(`/trader/ai-requests/${requestId}/reject`, {
|
|
110
|
+
method: 'POST',
|
|
111
|
+
body: JSON.stringify({ reason })
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
async function chatWithAIProduct(data) {
|
|
115
|
+
const response = await fetch('/api/ai-product-chat', {
|
|
116
|
+
method: 'POST',
|
|
117
|
+
headers: { 'Content-Type': 'application/json' },
|
|
118
|
+
body: JSON.stringify(data)
|
|
119
|
+
});
|
|
120
|
+
return response.json();
|
|
121
|
+
}
|
|
122
|
+
async function getMyAIRequests(status) {
|
|
123
|
+
const url = status
|
|
124
|
+
? `/trader/ai-requests/my-requests?status=${status}`
|
|
125
|
+
: '/trader/ai-requests/my-requests';
|
|
126
|
+
return (0, core_1.fetchApi)(url);
|
|
127
|
+
}
|
|
128
|
+
async function getAISuggestions(params) {
|
|
129
|
+
const queryParams = new URLSearchParams();
|
|
130
|
+
if (params?.trader_uid)
|
|
131
|
+
queryParams.append('trader_uid', params.trader_uid);
|
|
132
|
+
if (params?.status)
|
|
133
|
+
queryParams.append('status', params.status);
|
|
134
|
+
if (params?.limit)
|
|
135
|
+
queryParams.append('limit', params.limit.toString());
|
|
136
|
+
const queryString = queryParams.toString();
|
|
137
|
+
return (0, core_1.fetchApi)(`/data-service/indicators/suggestions${queryString ? `?${queryString}` : ''}`);
|
|
138
|
+
}
|
|
139
|
+
async function getAISuggestionDetail(suggestionId) {
|
|
140
|
+
return (0, core_1.fetchApi)(`/data-service/indicators/suggestions/${suggestionId}`);
|
|
141
|
+
}
|
|
142
|
+
async function approveAISuggestion(suggestionId, reviewer, modifiedValues) {
|
|
143
|
+
return (0, core_1.fetchApi)(`/data-service/indicators/suggestions/${suggestionId}/approve`, {
|
|
144
|
+
method: 'POST',
|
|
145
|
+
body: JSON.stringify({ reviewer, modified_values: modifiedValues })
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
async function rejectAISuggestion(suggestionId, reviewer, feedback) {
|
|
149
|
+
return (0, core_1.fetchApi)(`/data-service/indicators/suggestions/${suggestionId}/reject`, {
|
|
150
|
+
method: 'POST',
|
|
151
|
+
body: JSON.stringify({ reviewer, feedback })
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
async function generateAISuggestions(timeframe) {
|
|
155
|
+
return (0, core_1.fetchApi)('/data-service/indicators/suggestions/generate', {
|
|
156
|
+
method: 'POST',
|
|
157
|
+
body: JSON.stringify({ timeframe: timeframe || '4h' })
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
async function getAISuggestionStats(trader_uid) {
|
|
161
|
+
const params = new URLSearchParams();
|
|
162
|
+
if (trader_uid)
|
|
163
|
+
params.append('trader_uid', trader_uid);
|
|
164
|
+
const queryString = params.toString();
|
|
165
|
+
return (0, core_1.fetchApi)(`/data-service/indicators/suggestions/stats${queryString ? `?${queryString}` : ''}`);
|
|
166
|
+
}
|
|
167
|
+
async function getMarketState(symbol, timeframe, refresh) {
|
|
168
|
+
const params = new URLSearchParams();
|
|
169
|
+
if (timeframe)
|
|
170
|
+
params.append('timeframe', timeframe);
|
|
171
|
+
if (refresh)
|
|
172
|
+
params.append('refresh', 'true');
|
|
173
|
+
const queryString = params.toString();
|
|
174
|
+
return (0, core_1.fetchApi)(`/data-service/indicators/market-state/${symbol}${queryString ? `?${queryString}` : ''}`);
|
|
175
|
+
}
|
|
176
|
+
async function cancelBinanceOrder(symbol, clientOrderId) {
|
|
177
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
178
|
+
const response = await fetch('/api/trading/binance/cancel-order', {
|
|
179
|
+
method: 'POST',
|
|
180
|
+
headers: {
|
|
181
|
+
'Content-Type': 'application/json',
|
|
182
|
+
'Authorization': `Bearer ${token}`
|
|
183
|
+
},
|
|
184
|
+
body: JSON.stringify({ symbol, clientOrderId })
|
|
185
|
+
});
|
|
186
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
187
|
+
return response.json();
|
|
188
|
+
}
|
|
189
|
+
async function placeBinanceOrder(data) {
|
|
190
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
191
|
+
const response = await fetch('/api/trading/binance/place-order', {
|
|
192
|
+
method: 'POST',
|
|
193
|
+
headers: {
|
|
194
|
+
'Content-Type': 'application/json',
|
|
195
|
+
'Authorization': `Bearer ${token}`
|
|
196
|
+
},
|
|
197
|
+
body: JSON.stringify(data)
|
|
198
|
+
});
|
|
199
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
200
|
+
return response.json();
|
|
201
|
+
}
|
|
202
|
+
async function modifyBinanceOrder(symbol, clientOrderId, newPrice) {
|
|
203
|
+
const token = await (0, core_1.getCurrentUserToken)();
|
|
204
|
+
const response = await fetch('/api/trading/binance/modify-order', {
|
|
205
|
+
method: 'POST',
|
|
206
|
+
headers: {
|
|
207
|
+
'Content-Type': 'application/json',
|
|
208
|
+
'Authorization': `Bearer ${token}`
|
|
209
|
+
},
|
|
210
|
+
body: JSON.stringify({ symbol, clientOrderId, newPrice })
|
|
211
|
+
});
|
|
212
|
+
(0, auth_service_1.guardAuthResponse)(response);
|
|
213
|
+
return response.json();
|
|
214
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { APIResponse, MCCBalance, MCCLockPeriod, MCCMinting, MCCMintingStats, MCCWithdrawalRequest, MCCWithdrawal, MCCHistoryRecord, PDAWithdrawResponse, PDABalance, RechargeRecord, VaultRecord, DistributionPlan, MCDBalance, MCDTransaction, MCDUserDailyReward, MCDSpendRequest, MCDSpendResponse, MCDHistoryParams } from '../../types/api';
|
|
2
|
+
export declare const getMCCBalance: (userId: string) => Promise<APIResponse<MCCBalance>>;
|
|
3
|
+
export declare const getMCCLockPeriods: (userId: string) => Promise<APIResponse<MCCLockPeriod[]>>;
|
|
4
|
+
export declare const getMCCMintingHistory: (userId: string, limit?: number) => Promise<APIResponse<MCCMinting[]>>;
|
|
5
|
+
export declare const getMCCMintingStats: () => Promise<APIResponse<MCCMintingStats>>;
|
|
6
|
+
export declare const withdrawMCC: (data: MCCWithdrawalRequest) => Promise<APIResponse<MCCWithdrawal>>;
|
|
7
|
+
export declare const getMCCWithdrawalHistory: (userId: string, limit?: number) => Promise<APIResponse<MCCWithdrawal[]>>;
|
|
8
|
+
export declare const getMCCHistory: (userId: string, params?: {
|
|
9
|
+
limit?: number;
|
|
10
|
+
type?: string;
|
|
11
|
+
}) => Promise<APIResponse<MCCHistoryRecord[]>>;
|
|
12
|
+
export declare const withdrawFromPDA: (data: {
|
|
13
|
+
uid?: string;
|
|
14
|
+
user_id?: number;
|
|
15
|
+
amount: number;
|
|
16
|
+
destination: string;
|
|
17
|
+
}) => Promise<APIResponse<PDAWithdrawResponse>>;
|
|
18
|
+
export declare const getPDABalance: (uid: string) => Promise<APIResponse<PDABalance>>;
|
|
19
|
+
export declare const getPDAAddress: (uid: string) => Promise<APIResponse<{
|
|
20
|
+
uid: string;
|
|
21
|
+
pda_address: string;
|
|
22
|
+
token_account: string;
|
|
23
|
+
bump: number;
|
|
24
|
+
}>>;
|
|
25
|
+
export declare const getRechargeHistory: (userId: string, limit?: number) => Promise<APIResponse<RechargeRecord[]>>;
|
|
26
|
+
export declare const getDistributionPlans: () => Promise<APIResponse<DistributionPlan[]>>;
|
|
27
|
+
export declare const setUnitDistributionPlan: (_unitId: string, _planId: number) => Promise<APIResponse<void>>;
|
|
28
|
+
export declare const getVaultBalance: (unitId: string) => Promise<APIResponse<{
|
|
29
|
+
balance: number;
|
|
30
|
+
}>>;
|
|
31
|
+
export declare const getVaultRecords: (unitId: string, limit?: number) => Promise<APIResponse<VaultRecord[]>>;
|
|
32
|
+
export declare const executeVaultDistribution: (unitId: string, amount: number) => Promise<APIResponse<VaultRecord>>;
|
|
33
|
+
export declare const depositToVault: (unitId: string, amount: number) => Promise<APIResponse<VaultRecord>>;
|
|
34
|
+
export declare function getMCDBalance(_uid?: string): Promise<APIResponse<MCDBalance>>;
|
|
35
|
+
export declare function getMCDTransactions(_uid?: string, params?: MCDHistoryParams): Promise<APIResponse<MCDTransaction[]>>;
|
|
36
|
+
export declare function getMCDDailyRewards(_uid?: string, params?: MCDHistoryParams): Promise<APIResponse<MCDUserDailyReward[]>>;
|
|
37
|
+
export declare function spendMCD(data: MCDSpendRequest): Promise<MCDSpendResponse>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.depositToVault = exports.executeVaultDistribution = exports.getVaultRecords = exports.getVaultBalance = exports.setUnitDistributionPlan = exports.getDistributionPlans = exports.getRechargeHistory = exports.getPDAAddress = exports.getPDABalance = exports.withdrawFromPDA = exports.getMCCHistory = exports.getMCCWithdrawalHistory = exports.withdrawMCC = exports.getMCCMintingStats = exports.getMCCMintingHistory = exports.getMCCLockPeriods = exports.getMCCBalance = void 0;
|
|
4
|
+
exports.getMCDBalance = getMCDBalance;
|
|
5
|
+
exports.getMCDTransactions = getMCDTransactions;
|
|
6
|
+
exports.getMCDDailyRewards = getMCDDailyRewards;
|
|
7
|
+
exports.spendMCD = spendMCD;
|
|
8
|
+
const core_1 = require("../core");
|
|
9
|
+
const getMCCBalance = (userId) => {
|
|
10
|
+
return (0, core_1.fetchApi)(`/user-service/mcc/balance/${userId}`);
|
|
11
|
+
};
|
|
12
|
+
exports.getMCCBalance = getMCCBalance;
|
|
13
|
+
const getMCCLockPeriods = (userId) => {
|
|
14
|
+
return (0, core_1.fetchApi)(`/user-service/mcc/lock-periods/${userId}`);
|
|
15
|
+
};
|
|
16
|
+
exports.getMCCLockPeriods = getMCCLockPeriods;
|
|
17
|
+
const getMCCMintingHistory = (userId, limit = 50) => {
|
|
18
|
+
return (0, core_1.fetchApi)(`/user-service/mcc/minting-history/${userId}?limit=${limit}`);
|
|
19
|
+
};
|
|
20
|
+
exports.getMCCMintingHistory = getMCCMintingHistory;
|
|
21
|
+
const getMCCMintingStats = () => {
|
|
22
|
+
return (0, core_1.fetchApi)('/user-service/mcc/minting-stats');
|
|
23
|
+
};
|
|
24
|
+
exports.getMCCMintingStats = getMCCMintingStats;
|
|
25
|
+
const withdrawMCC = (data) => {
|
|
26
|
+
return (0, core_1.fetchApi)('/user-service/mcc/withdraw', {
|
|
27
|
+
method: 'POST',
|
|
28
|
+
body: JSON.stringify(data)
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.withdrawMCC = withdrawMCC;
|
|
32
|
+
const getMCCWithdrawalHistory = (userId, limit = 50) => {
|
|
33
|
+
return (0, core_1.fetchApi)(`/user-service/mcc/withdrawals/${userId}?limit=${limit}`);
|
|
34
|
+
};
|
|
35
|
+
exports.getMCCWithdrawalHistory = getMCCWithdrawalHistory;
|
|
36
|
+
const getMCCHistory = (userId, params) => {
|
|
37
|
+
const queryParams = new URLSearchParams();
|
|
38
|
+
if (params?.limit)
|
|
39
|
+
queryParams.append('limit', params.limit.toString());
|
|
40
|
+
if (params?.type)
|
|
41
|
+
queryParams.append('type', params.type);
|
|
42
|
+
const queryString = queryParams.toString();
|
|
43
|
+
return (0, core_1.fetchApi)(`/user-service/mcc/history/${userId}${queryString ? `?${queryString}` : ''}`);
|
|
44
|
+
};
|
|
45
|
+
exports.getMCCHistory = getMCCHistory;
|
|
46
|
+
const withdrawFromPDA = (data) => {
|
|
47
|
+
return (0, core_1.fetchApi)('/blockchain-service/blockchain/mcc/pda-withdraw', {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
body: JSON.stringify(data)
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
exports.withdrawFromPDA = withdrawFromPDA;
|
|
53
|
+
const getPDABalance = (uid) => {
|
|
54
|
+
return (0, core_1.fetchApi)(`/blockchain-service/blockchain/mcc/pda-balance/${uid}`);
|
|
55
|
+
};
|
|
56
|
+
exports.getPDABalance = getPDABalance;
|
|
57
|
+
const getPDAAddress = (uid) => {
|
|
58
|
+
return (0, core_1.fetchApi)(`/blockchain-service/blockchain/mcc/pda-address/${uid}`);
|
|
59
|
+
};
|
|
60
|
+
exports.getPDAAddress = getPDAAddress;
|
|
61
|
+
const getRechargeHistory = (userId, limit = 50) => {
|
|
62
|
+
return (0, core_1.fetchApi)(`/user-service/mcc/recharges/${userId}?limit=${limit}`);
|
|
63
|
+
};
|
|
64
|
+
exports.getRechargeHistory = getRechargeHistory;
|
|
65
|
+
const getDistributionPlans = () => {
|
|
66
|
+
return Promise.resolve({
|
|
67
|
+
success: true,
|
|
68
|
+
data: [{
|
|
69
|
+
plan_id: 0,
|
|
70
|
+
plan_type: 'plan_1',
|
|
71
|
+
name: '按劳分配(自动)- 已废弃',
|
|
72
|
+
manager_share: 0,
|
|
73
|
+
vault_share: 0,
|
|
74
|
+
member_share: 100,
|
|
75
|
+
system_reserve: 0,
|
|
76
|
+
charity_share: 0
|
|
77
|
+
}]
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
exports.getDistributionPlans = getDistributionPlans;
|
|
81
|
+
const setUnitDistributionPlan = (_unitId, _planId) => {
|
|
82
|
+
return Promise.resolve({
|
|
83
|
+
success: false,
|
|
84
|
+
error: '分配方案设置功能已废弃。新业务逻辑下,金库 MCD 每日自动按劳分配 1%,无需手动设置方案。'
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
exports.setUnitDistributionPlan = setUnitDistributionPlan;
|
|
88
|
+
const getVaultBalance = (unitId) => {
|
|
89
|
+
return (0, core_1.fetchApi)(`/organization-service/units/${unitId}/vault/balance`);
|
|
90
|
+
};
|
|
91
|
+
exports.getVaultBalance = getVaultBalance;
|
|
92
|
+
const getVaultRecords = (unitId, limit = 50) => {
|
|
93
|
+
return (0, core_1.fetchApi)(`/organization-service/units/${unitId}/vault/records?limit=${limit}`);
|
|
94
|
+
};
|
|
95
|
+
exports.getVaultRecords = getVaultRecords;
|
|
96
|
+
const executeVaultDistribution = (unitId, amount) => {
|
|
97
|
+
return (0, core_1.fetchApi)(`/organization-service/units/${unitId}/vault/distribute`, {
|
|
98
|
+
method: 'POST',
|
|
99
|
+
body: JSON.stringify({ amount })
|
|
100
|
+
});
|
|
101
|
+
};
|
|
102
|
+
exports.executeVaultDistribution = executeVaultDistribution;
|
|
103
|
+
const depositToVault = (unitId, amount) => {
|
|
104
|
+
return (0, core_1.fetchApi)(`/organization-service/units/${unitId}/vault/deposit`, {
|
|
105
|
+
method: 'POST',
|
|
106
|
+
body: JSON.stringify({ amount })
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
exports.depositToVault = depositToVault;
|
|
110
|
+
async function getMCDBalance(_uid) {
|
|
111
|
+
return (0, core_1.fetchApi)('/mcd/balance');
|
|
112
|
+
}
|
|
113
|
+
async function getMCDTransactions(_uid, params) {
|
|
114
|
+
const queryParams = new URLSearchParams();
|
|
115
|
+
if (params?.limit)
|
|
116
|
+
queryParams.append('limit', params.limit.toString());
|
|
117
|
+
if (params?.offset)
|
|
118
|
+
queryParams.append('offset', params.offset.toString());
|
|
119
|
+
if (params?.start_date)
|
|
120
|
+
queryParams.append('start_date', params.start_date);
|
|
121
|
+
if (params?.end_date)
|
|
122
|
+
queryParams.append('end_date', params.end_date);
|
|
123
|
+
const queryString = queryParams.toString();
|
|
124
|
+
return (0, core_1.fetchApi)(`/mcd/transactions${queryString ? `?${queryString}` : ''}`);
|
|
125
|
+
}
|
|
126
|
+
async function getMCDDailyRewards(_uid, params) {
|
|
127
|
+
const queryParams = new URLSearchParams();
|
|
128
|
+
if (params?.limit)
|
|
129
|
+
queryParams.append('limit', params.limit.toString());
|
|
130
|
+
if (params?.offset)
|
|
131
|
+
queryParams.append('offset', params.offset.toString());
|
|
132
|
+
if (params?.start_date)
|
|
133
|
+
queryParams.append('start_date', params.start_date);
|
|
134
|
+
if (params?.end_date)
|
|
135
|
+
queryParams.append('end_date', params.end_date);
|
|
136
|
+
const queryString = queryParams.toString();
|
|
137
|
+
return (0, core_1.fetchApi)(`/mcd/rewards${queryString ? `?${queryString}` : ''}`);
|
|
138
|
+
}
|
|
139
|
+
async function spendMCD(data) {
|
|
140
|
+
return (0, core_1.fetchApi)('/mcd/consume', {
|
|
141
|
+
method: 'POST',
|
|
142
|
+
body: JSON.stringify(data)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ai"), exports);
|
|
18
|
+
__exportStar(require("./mining"), exports);
|
|
19
|
+
__exportStar(require("./finance"), exports);
|
|
20
|
+
__exportStar(require("./organization"), exports);
|
|
21
|
+
__exportStar(require("./user"), exports);
|