@varity-labs/ui-kit 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +31 -0
- package/README.md +248 -0
- package/dist/components/AI/ChatbotWidget.d.ts +53 -0
- package/dist/components/AI/ChatbotWidget.d.ts.map +1 -0
- package/dist/components/AI/ChatbotWidget.js +126 -0
- package/dist/components/AI/ChatbotWidget.js.map +1 -0
- package/dist/components/AI/InputBar.d.ts +25 -0
- package/dist/components/AI/InputBar.d.ts.map +1 -0
- package/dist/components/AI/InputBar.js +126 -0
- package/dist/components/AI/InputBar.js.map +1 -0
- package/dist/components/AI/MessageBubble.d.ts +37 -0
- package/dist/components/AI/MessageBubble.d.ts.map +1 -0
- package/dist/components/AI/MessageBubble.js +124 -0
- package/dist/components/AI/MessageBubble.js.map +1 -0
- package/dist/components/AI/index.d.ts +12 -0
- package/dist/components/AI/index.d.ts.map +1 -0
- package/dist/components/AI/index.js +9 -0
- package/dist/components/AI/index.js.map +1 -0
- package/dist/components/Analytics/AnalyticsCard.d.ts +48 -0
- package/dist/components/Analytics/AnalyticsCard.d.ts.map +1 -0
- package/dist/components/Analytics/AnalyticsCard.js +156 -0
- package/dist/components/Analytics/AnalyticsCard.js.map +1 -0
- package/dist/components/Analytics/ChartContainer.d.ts +53 -0
- package/dist/components/Analytics/ChartContainer.d.ts.map +1 -0
- package/dist/components/Analytics/ChartContainer.js +128 -0
- package/dist/components/Analytics/ChartContainer.js.map +1 -0
- package/dist/components/Analytics/DataTable.d.ts +62 -0
- package/dist/components/Analytics/DataTable.d.ts.map +1 -0
- package/dist/components/Analytics/DataTable.js +165 -0
- package/dist/components/Analytics/DataTable.js.map +1 -0
- package/dist/components/Analytics/MetricDisplay.d.ts +42 -0
- package/dist/components/Analytics/MetricDisplay.d.ts.map +1 -0
- package/dist/components/Analytics/MetricDisplay.js +110 -0
- package/dist/components/Analytics/MetricDisplay.js.map +1 -0
- package/dist/components/Analytics/index.d.ts +14 -0
- package/dist/components/Analytics/index.d.ts.map +1 -0
- package/dist/components/Analytics/index.js +10 -0
- package/dist/components/Analytics/index.js.map +1 -0
- package/dist/components/Branding/Attribution.d.ts +39 -0
- package/dist/components/Branding/Attribution.d.ts.map +1 -0
- package/dist/components/Branding/Attribution.js +124 -0
- package/dist/components/Branding/Attribution.js.map +1 -0
- package/dist/components/Branding/Logo.d.ts +39 -0
- package/dist/components/Branding/Logo.d.ts.map +1 -0
- package/dist/components/Branding/Logo.js +67 -0
- package/dist/components/Branding/Logo.js.map +1 -0
- package/dist/components/Branding/ThemeProvider.d.ts +85 -0
- package/dist/components/Branding/ThemeProvider.d.ts.map +1 -0
- package/dist/components/Branding/ThemeProvider.js +186 -0
- package/dist/components/Branding/ThemeProvider.js.map +1 -0
- package/dist/components/Branding/index.d.ts +12 -0
- package/dist/components/Branding/index.d.ts.map +1 -0
- package/dist/components/Branding/index.js +9 -0
- package/dist/components/Branding/index.js.map +1 -0
- package/dist/components/Dashboard/DashboardFooter.d.ts +30 -0
- package/dist/components/Dashboard/DashboardFooter.d.ts.map +1 -0
- package/dist/components/Dashboard/DashboardFooter.js +68 -0
- package/dist/components/Dashboard/DashboardFooter.js.map +1 -0
- package/dist/components/Dashboard/DashboardHeader.d.ts +24 -0
- package/dist/components/Dashboard/DashboardHeader.d.ts.map +1 -0
- package/dist/components/Dashboard/DashboardHeader.js +87 -0
- package/dist/components/Dashboard/DashboardHeader.js.map +1 -0
- package/dist/components/Dashboard/DashboardLayout.d.ts +71 -0
- package/dist/components/Dashboard/DashboardLayout.d.ts.map +1 -0
- package/dist/components/Dashboard/DashboardLayout.js +52 -0
- package/dist/components/Dashboard/DashboardLayout.js.map +1 -0
- package/dist/components/Dashboard/DashboardSidebar.d.ts +26 -0
- package/dist/components/Dashboard/DashboardSidebar.d.ts.map +1 -0
- package/dist/components/Dashboard/DashboardSidebar.js +146 -0
- package/dist/components/Dashboard/DashboardSidebar.js.map +1 -0
- package/dist/components/Dashboard/EmptyState.d.ts +84 -0
- package/dist/components/Dashboard/EmptyState.d.ts.map +1 -0
- package/dist/components/Dashboard/EmptyState.js +99 -0
- package/dist/components/Dashboard/EmptyState.js.map +1 -0
- package/dist/components/Dashboard/KPICard.d.ts +58 -0
- package/dist/components/Dashboard/KPICard.d.ts.map +1 -0
- package/dist/components/Dashboard/KPICard.js +82 -0
- package/dist/components/Dashboard/KPICard.js.map +1 -0
- package/dist/components/Dashboard/LoadingSkeleton.d.ts +58 -0
- package/dist/components/Dashboard/LoadingSkeleton.d.ts.map +1 -0
- package/dist/components/Dashboard/LoadingSkeleton.js +105 -0
- package/dist/components/Dashboard/LoadingSkeleton.js.map +1 -0
- package/dist/components/Dashboard/StatusBadge.d.ts +57 -0
- package/dist/components/Dashboard/StatusBadge.d.ts.map +1 -0
- package/dist/components/Dashboard/StatusBadge.js +149 -0
- package/dist/components/Dashboard/StatusBadge.js.map +1 -0
- package/dist/components/Dashboard/index.d.ts +19 -0
- package/dist/components/Dashboard/index.d.ts.map +1 -0
- package/dist/components/Dashboard/index.js +18 -0
- package/dist/components/Dashboard/index.js.map +1 -0
- package/dist/components/InAppWallet/EmailLoginButton.d.ts +27 -0
- package/dist/components/InAppWallet/EmailLoginButton.d.ts.map +1 -0
- package/dist/components/InAppWallet/EmailLoginButton.js +84 -0
- package/dist/components/InAppWallet/EmailLoginButton.js.map +1 -0
- package/dist/components/InAppWallet/InAppWalletProvider.d.ts +54 -0
- package/dist/components/InAppWallet/InAppWalletProvider.d.ts.map +1 -0
- package/dist/components/InAppWallet/InAppWalletProvider.js +238 -0
- package/dist/components/InAppWallet/InAppWalletProvider.js.map +1 -0
- package/dist/components/InAppWallet/OnboardingFlow.d.ts +25 -0
- package/dist/components/InAppWallet/OnboardingFlow.d.ts.map +1 -0
- package/dist/components/InAppWallet/OnboardingFlow.js +159 -0
- package/dist/components/InAppWallet/OnboardingFlow.js.map +1 -0
- package/dist/components/InAppWallet/SocialLoginButtons.d.ts +28 -0
- package/dist/components/InAppWallet/SocialLoginButtons.d.ts.map +1 -0
- package/dist/components/InAppWallet/SocialLoginButtons.js +128 -0
- package/dist/components/InAppWallet/SocialLoginButtons.js.map +1 -0
- package/dist/components/InAppWallet/index.d.ts +15 -0
- package/dist/components/InAppWallet/index.d.ts.map +1 -0
- package/dist/components/InAppWallet/index.js +14 -0
- package/dist/components/InAppWallet/index.js.map +1 -0
- package/dist/components/Onramp/BuyUSDCButton.d.ts +27 -0
- package/dist/components/Onramp/BuyUSDCButton.d.ts.map +1 -0
- package/dist/components/Onramp/BuyUSDCButton.js +70 -0
- package/dist/components/Onramp/BuyUSDCButton.js.map +1 -0
- package/dist/components/Onramp/OnrampWidget.d.ts +38 -0
- package/dist/components/Onramp/OnrampWidget.d.ts.map +1 -0
- package/dist/components/Onramp/OnrampWidget.js +105 -0
- package/dist/components/Onramp/OnrampWidget.js.map +1 -0
- package/dist/components/Onramp/index.d.ts +14 -0
- package/dist/components/Onramp/index.d.ts.map +1 -0
- package/dist/components/Onramp/index.js +12 -0
- package/dist/components/Onramp/index.js.map +1 -0
- package/dist/components/Payments/CheckoutModal.d.ts +19 -0
- package/dist/components/Payments/CheckoutModal.d.ts.map +1 -0
- package/dist/components/Payments/CheckoutModal.js +183 -0
- package/dist/components/Payments/CheckoutModal.js.map +1 -0
- package/dist/components/Payments/SubscriptionWidget.d.ts +17 -0
- package/dist/components/Payments/SubscriptionWidget.d.ts.map +1 -0
- package/dist/components/Payments/SubscriptionWidget.js +89 -0
- package/dist/components/Payments/SubscriptionWidget.js.map +1 -0
- package/dist/components/Payments/constants.d.ts +59 -0
- package/dist/components/Payments/constants.d.ts.map +1 -0
- package/dist/components/Payments/constants.js +145 -0
- package/dist/components/Payments/constants.js.map +1 -0
- package/dist/components/Payments/index.d.ts +10 -0
- package/dist/components/Payments/index.d.ts.map +1 -0
- package/dist/components/Payments/index.js +12 -0
- package/dist/components/Payments/index.js.map +1 -0
- package/dist/components/Payments/types.d.ts +119 -0
- package/dist/components/Payments/types.d.ts.map +1 -0
- package/dist/components/Payments/types.js +27 -0
- package/dist/components/Payments/types.js.map +1 -0
- package/dist/components/Payments/usePayments.d.ts +33 -0
- package/dist/components/Payments/usePayments.d.ts.map +1 -0
- package/dist/components/Payments/usePayments.js +249 -0
- package/dist/components/Payments/usePayments.js.map +1 -0
- package/dist/components/Privy/InitTimeoutScreen.d.ts +62 -0
- package/dist/components/Privy/InitTimeoutScreen.d.ts.map +1 -0
- package/dist/components/Privy/InitTimeoutScreen.js +64 -0
- package/dist/components/Privy/InitTimeoutScreen.js.map +1 -0
- package/dist/components/Privy/InitializingScreen.d.ts +56 -0
- package/dist/components/Privy/InitializingScreen.d.ts.map +1 -0
- package/dist/components/Privy/InitializingScreen.js +60 -0
- package/dist/components/Privy/InitializingScreen.js.map +1 -0
- package/dist/components/Privy/PrivyLoginButton.d.ts +27 -0
- package/dist/components/Privy/PrivyLoginButton.d.ts.map +1 -0
- package/dist/components/Privy/PrivyLoginButton.js +48 -0
- package/dist/components/Privy/PrivyLoginButton.js.map +1 -0
- package/dist/components/Privy/PrivyProtectedRoute.d.ts +22 -0
- package/dist/components/Privy/PrivyProtectedRoute.d.ts.map +1 -0
- package/dist/components/Privy/PrivyProtectedRoute.js +46 -0
- package/dist/components/Privy/PrivyProtectedRoute.js.map +1 -0
- package/dist/components/Privy/PrivyReadyGate.d.ts +69 -0
- package/dist/components/Privy/PrivyReadyGate.d.ts.map +1 -0
- package/dist/components/Privy/PrivyReadyGate.js +83 -0
- package/dist/components/Privy/PrivyReadyGate.js.map +1 -0
- package/dist/components/Privy/PrivyUserProfile.d.ts +25 -0
- package/dist/components/Privy/PrivyUserProfile.d.ts.map +1 -0
- package/dist/components/Privy/PrivyUserProfile.js +98 -0
- package/dist/components/Privy/PrivyUserProfile.js.map +1 -0
- package/dist/components/Privy/index.d.ts +21 -0
- package/dist/components/Privy/index.d.ts.map +1 -0
- package/dist/components/Privy/index.js +16 -0
- package/dist/components/Privy/index.js.map +1 -0
- package/dist/components/SIWE/AuthStatus.d.ts +15 -0
- package/dist/components/SIWE/AuthStatus.d.ts.map +1 -0
- package/dist/components/SIWE/AuthStatus.js +47 -0
- package/dist/components/SIWE/AuthStatus.js.map +1 -0
- package/dist/components/SIWE/ProtectedRoute.d.ts +17 -0
- package/dist/components/SIWE/ProtectedRoute.d.ts.map +1 -0
- package/dist/components/SIWE/ProtectedRoute.js +52 -0
- package/dist/components/SIWE/ProtectedRoute.js.map +1 -0
- package/dist/components/SIWE/SIWEButton.d.ts +22 -0
- package/dist/components/SIWE/SIWEButton.d.ts.map +1 -0
- package/dist/components/SIWE/SIWEButton.js +106 -0
- package/dist/components/SIWE/SIWEButton.js.map +1 -0
- package/dist/components/SIWE/SIWEModal.d.ts +19 -0
- package/dist/components/SIWE/SIWEModal.d.ts.map +1 -0
- package/dist/components/SIWE/SIWEModal.js +75 -0
- package/dist/components/SIWE/SIWEModal.js.map +1 -0
- package/dist/components/SIWE/SIWEProvider.d.ts +38 -0
- package/dist/components/SIWE/SIWEProvider.d.ts.map +1 -0
- package/dist/components/SIWE/SIWEProvider.js +227 -0
- package/dist/components/SIWE/SIWEProvider.js.map +1 -0
- package/dist/components/SIWE/index.d.ts +15 -0
- package/dist/components/SIWE/index.d.ts.map +1 -0
- package/dist/components/SIWE/index.js +10 -0
- package/dist/components/SIWE/index.js.map +1 -0
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +16 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/templates/Finance/FinanceDashboard.d.ts +15 -0
- package/dist/components/templates/Finance/FinanceDashboard.d.ts.map +1 -0
- package/dist/components/templates/Finance/FinanceDashboard.js +112 -0
- package/dist/components/templates/Finance/FinanceDashboard.js.map +1 -0
- package/dist/components/templates/Healthcare/HealthcareDashboard.d.ts +15 -0
- package/dist/components/templates/Healthcare/HealthcareDashboard.d.ts.map +1 -0
- package/dist/components/templates/Healthcare/HealthcareDashboard.js +121 -0
- package/dist/components/templates/Healthcare/HealthcareDashboard.js.map +1 -0
- package/dist/components/templates/ISO/ISODashboard.d.ts +15 -0
- package/dist/components/templates/ISO/ISODashboard.d.ts.map +1 -0
- package/dist/components/templates/ISO/ISODashboard.js +184 -0
- package/dist/components/templates/ISO/ISODashboard.js.map +1 -0
- package/dist/components/templates/Retail/RetailDashboard.d.ts +15 -0
- package/dist/components/templates/Retail/RetailDashboard.d.ts.map +1 -0
- package/dist/components/templates/Retail/RetailDashboard.js +151 -0
- package/dist/components/templates/Retail/RetailDashboard.js.map +1 -0
- package/dist/components/templates/index.d.ts +14 -0
- package/dist/components/templates/index.d.ts.map +1 -0
- package/dist/components/templates/index.js +14 -0
- package/dist/components/templates/index.js.map +1 -0
- package/dist/config/chains.d.ts +23 -0
- package/dist/config/chains.d.ts.map +1 -0
- package/dist/config/chains.js +55 -0
- package/dist/config/chains.js.map +1 -0
- package/dist/core/VarityClient.d.ts +76 -0
- package/dist/core/VarityClient.d.ts.map +1 -0
- package/dist/core/VarityClient.js +99 -0
- package/dist/core/VarityClient.js.map +1 -0
- package/dist/core/config.d.ts +136 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +156 -0
- package/dist/core/config.js.map +1 -0
- package/dist/hooks/index.d.ts +17 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +18 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useAnalytics.d.ts +94 -0
- package/dist/hooks/useAnalytics.d.ts.map +1 -0
- package/dist/hooks/useAnalytics.js +116 -0
- package/dist/hooks/useAnalytics.js.map +1 -0
- package/dist/hooks/useAuth.d.ts +71 -0
- package/dist/hooks/useAuth.d.ts.map +1 -0
- package/dist/hooks/useAuth.js +198 -0
- package/dist/hooks/useAuth.js.map +1 -0
- package/dist/hooks/useDashboard.d.ts +110 -0
- package/dist/hooks/useDashboard.d.ts.map +1 -0
- package/dist/hooks/useDashboard.js +201 -0
- package/dist/hooks/useDashboard.js.map +1 -0
- package/dist/hooks/useVarityAPI.d.ts +88 -0
- package/dist/hooks/useVarityAPI.d.ts.map +1 -0
- package/dist/hooks/useVarityAPI.js +138 -0
- package/dist/hooks/useVarityAPI.js.map +1 -0
- package/dist/hooks/useWalletAuth.d.ts +108 -0
- package/dist/hooks/useWalletAuth.d.ts.map +1 -0
- package/dist/hooks/useWalletAuth.js +415 -0
- package/dist/hooks/useWalletAuth.js.map +1 -0
- package/dist/hooks/web3/index.d.ts +5 -0
- package/dist/hooks/web3/index.d.ts.map +1 -0
- package/dist/hooks/web3/index.js +6 -0
- package/dist/hooks/web3/index.js.map +1 -0
- package/dist/hooks/web3/useAddressValidation.d.ts +37 -0
- package/dist/hooks/web3/useAddressValidation.d.ts.map +1 -0
- package/dist/hooks/web3/useAddressValidation.js +59 -0
- package/dist/hooks/web3/useAddressValidation.js.map +1 -0
- package/dist/hooks/web3/useBlockExplorer.d.ts +37 -0
- package/dist/hooks/web3/useBlockExplorer.d.ts.map +1 -0
- package/dist/hooks/web3/useBlockExplorer.js +59 -0
- package/dist/hooks/web3/useBlockExplorer.js.map +1 -0
- package/dist/hooks/web3/useUSDCFormat.d.ts +34 -0
- package/dist/hooks/web3/useUSDCFormat.d.ts.map +1 -0
- package/dist/hooks/web3/useUSDCFormat.js +43 -0
- package/dist/hooks/web3/useUSDCFormat.js.map +1 -0
- package/dist/hooks/web3/useVarityWallet.d.ts +48 -0
- package/dist/hooks/web3/useVarityWallet.d.ts.map +1 -0
- package/dist/hooks/web3/useVarityWallet.js +70 -0
- package/dist/hooks/web3/useVarityWallet.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +68 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/analytics/AnalyticsClient.d.ts +72 -0
- package/dist/modules/analytics/AnalyticsClient.d.ts.map +1 -0
- package/dist/modules/analytics/AnalyticsClient.js +56 -0
- package/dist/modules/analytics/AnalyticsClient.js.map +1 -0
- package/dist/modules/analytics/index.d.ts +2 -0
- package/dist/modules/analytics/index.d.ts.map +1 -0
- package/dist/modules/analytics/index.js +2 -0
- package/dist/modules/analytics/index.js.map +1 -0
- package/dist/modules/auth/AuthClient.d.ts +41 -0
- package/dist/modules/auth/AuthClient.d.ts.map +1 -0
- package/dist/modules/auth/AuthClient.js +36 -0
- package/dist/modules/auth/AuthClient.js.map +1 -0
- package/dist/modules/auth/index.d.ts +2 -0
- package/dist/modules/auth/index.d.ts.map +1 -0
- package/dist/modules/auth/index.js +2 -0
- package/dist/modules/auth/index.js.map +1 -0
- package/dist/modules/cache/CacheClient.d.ts +48 -0
- package/dist/modules/cache/CacheClient.d.ts.map +1 -0
- package/dist/modules/cache/CacheClient.js +59 -0
- package/dist/modules/cache/CacheClient.js.map +1 -0
- package/dist/modules/cache/index.d.ts +2 -0
- package/dist/modules/cache/index.d.ts.map +1 -0
- package/dist/modules/cache/index.js +2 -0
- package/dist/modules/cache/index.js.map +1 -0
- package/dist/modules/compute/ComputeClient.d.ts +54 -0
- package/dist/modules/compute/ComputeClient.d.ts.map +1 -0
- package/dist/modules/compute/ComputeClient.js +39 -0
- package/dist/modules/compute/ComputeClient.js.map +1 -0
- package/dist/modules/compute/index.d.ts +2 -0
- package/dist/modules/compute/index.d.ts.map +1 -0
- package/dist/modules/compute/index.js +2 -0
- package/dist/modules/compute/index.js.map +1 -0
- package/dist/modules/export/ExportClient.d.ts +56 -0
- package/dist/modules/export/ExportClient.d.ts.map +1 -0
- package/dist/modules/export/ExportClient.js +42 -0
- package/dist/modules/export/ExportClient.js.map +1 -0
- package/dist/modules/export/index.d.ts +2 -0
- package/dist/modules/export/index.d.ts.map +1 -0
- package/dist/modules/export/index.js +2 -0
- package/dist/modules/export/index.js.map +1 -0
- package/dist/modules/forecasting/ForecastingClient.d.ts +112 -0
- package/dist/modules/forecasting/ForecastingClient.d.ts.map +1 -0
- package/dist/modules/forecasting/ForecastingClient.js +48 -0
- package/dist/modules/forecasting/ForecastingClient.js.map +1 -0
- package/dist/modules/forecasting/index.d.ts +2 -0
- package/dist/modules/forecasting/index.d.ts.map +1 -0
- package/dist/modules/forecasting/index.js +2 -0
- package/dist/modules/forecasting/index.js.map +1 -0
- package/dist/modules/monitoring/MonitoringClient.d.ts +67 -0
- package/dist/modules/monitoring/MonitoringClient.d.ts.map +1 -0
- package/dist/modules/monitoring/MonitoringClient.js +48 -0
- package/dist/modules/monitoring/MonitoringClient.js.map +1 -0
- package/dist/modules/monitoring/index.d.ts +2 -0
- package/dist/modules/monitoring/index.d.ts.map +1 -0
- package/dist/modules/monitoring/index.js +2 -0
- package/dist/modules/monitoring/index.js.map +1 -0
- package/dist/modules/notifications/NotificationsClient.d.ts +68 -0
- package/dist/modules/notifications/NotificationsClient.d.ts.map +1 -0
- package/dist/modules/notifications/NotificationsClient.js +50 -0
- package/dist/modules/notifications/NotificationsClient.js.map +1 -0
- package/dist/modules/notifications/index.d.ts +2 -0
- package/dist/modules/notifications/index.d.ts.map +1 -0
- package/dist/modules/notifications/index.js +2 -0
- package/dist/modules/notifications/index.js.map +1 -0
- package/dist/modules/oracle/OracleClient.d.ts +48 -0
- package/dist/modules/oracle/OracleClient.d.ts.map +1 -0
- package/dist/modules/oracle/OracleClient.js +34 -0
- package/dist/modules/oracle/OracleClient.js.map +1 -0
- package/dist/modules/oracle/index.d.ts +2 -0
- package/dist/modules/oracle/index.d.ts.map +1 -0
- package/dist/modules/oracle/index.js +2 -0
- package/dist/modules/oracle/index.js.map +1 -0
- package/dist/modules/storage/StorageClient.d.ts +44 -0
- package/dist/modules/storage/StorageClient.d.ts.map +1 -0
- package/dist/modules/storage/StorageClient.js +43 -0
- package/dist/modules/storage/StorageClient.js.map +1 -0
- package/dist/modules/storage/index.d.ts +2 -0
- package/dist/modules/storage/index.d.ts.map +1 -0
- package/dist/modules/storage/index.js +2 -0
- package/dist/modules/storage/index.js.map +1 -0
- package/dist/modules/templates/TemplateDeploymentClient.d.ts +208 -0
- package/dist/modules/templates/TemplateDeploymentClient.d.ts.map +1 -0
- package/dist/modules/templates/TemplateDeploymentClient.js +101 -0
- package/dist/modules/templates/TemplateDeploymentClient.js.map +1 -0
- package/dist/modules/templates/index.d.ts +8 -0
- package/dist/modules/templates/index.d.ts.map +1 -0
- package/dist/modules/templates/index.js +7 -0
- package/dist/modules/templates/index.js.map +1 -0
- package/dist/modules/webhooks/WebhooksClient.d.ts +85 -0
- package/dist/modules/webhooks/WebhooksClient.d.ts.map +1 -0
- package/dist/modules/webhooks/WebhooksClient.js +68 -0
- package/dist/modules/webhooks/WebhooksClient.js.map +1 -0
- package/dist/modules/webhooks/index.d.ts +2 -0
- package/dist/modules/webhooks/index.d.ts.map +1 -0
- package/dist/modules/webhooks/index.js +2 -0
- package/dist/modules/webhooks/index.js.map +1 -0
- package/dist/modules/zk/ZKClient.d.ts +67 -0
- package/dist/modules/zk/ZKClient.d.ts.map +1 -0
- package/dist/modules/zk/ZKClient.js +36 -0
- package/dist/modules/zk/ZKClient.js.map +1 -0
- package/dist/modules/zk/index.d.ts +2 -0
- package/dist/modules/zk/index.d.ts.map +1 -0
- package/dist/modules/zk/index.js +2 -0
- package/dist/modules/zk/index.js.map +1 -0
- package/dist/providers/ChainContext.d.ts +65 -0
- package/dist/providers/ChainContext.d.ts.map +1 -0
- package/dist/providers/ChainContext.js +92 -0
- package/dist/providers/ChainContext.js.map +1 -0
- package/dist/providers/PrivyProvider.d.ts +42 -0
- package/dist/providers/PrivyProvider.d.ts.map +1 -0
- package/dist/providers/PrivyProvider.js +131 -0
- package/dist/providers/PrivyProvider.js.map +1 -0
- package/dist/providers/PrivyStack.d.ts +165 -0
- package/dist/providers/PrivyStack.d.ts.map +1 -0
- package/dist/providers/PrivyStack.js +295 -0
- package/dist/providers/PrivyStack.js.map +1 -0
- package/dist/providers/VarityDashboardProvider.d.ts +90 -0
- package/dist/providers/VarityDashboardProvider.d.ts.map +1 -0
- package/dist/providers/VarityDashboardProvider.js +242 -0
- package/dist/providers/VarityDashboardProvider.js.map +1 -0
- package/dist/providers/VarityProvider.d.ts +32 -0
- package/dist/providers/VarityProvider.d.ts.map +1 -0
- package/dist/providers/VarityProvider.js +56 -0
- package/dist/providers/VarityProvider.js.map +1 -0
- package/dist/providers/WalletContext.d.ts +68 -0
- package/dist/providers/WalletContext.d.ts.map +1 -0
- package/dist/providers/WalletContext.js +98 -0
- package/dist/providers/WalletContext.js.map +1 -0
- package/dist/providers/WalletSyncProvider.d.ts +84 -0
- package/dist/providers/WalletSyncProvider.d.ts.map +1 -0
- package/dist/providers/WalletSyncProvider.js +132 -0
- package/dist/providers/WalletSyncProvider.js.map +1 -0
- package/dist/providers/index.d.ts +47 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +51 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/tests/mocks/httpClient.mock.d.ts +62 -0
- package/dist/tests/mocks/httpClient.mock.d.ts.map +1 -0
- package/dist/tests/mocks/httpClient.mock.js +108 -0
- package/dist/tests/mocks/httpClient.mock.js.map +1 -0
- package/dist/tests/setup.d.ts +6 -0
- package/dist/tests/setup.d.ts.map +1 -0
- package/dist/tests/setup.js +51 -0
- package/dist/tests/setup.js.map +1 -0
- package/dist/types/api-extensions.d.ts +92 -0
- package/dist/types/api-extensions.d.ts.map +1 -0
- package/dist/types/api-extensions.js +7 -0
- package/dist/types/api-extensions.js.map +1 -0
- package/dist/utils/http.d.ts +51 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/http.js +104 -0
- package/dist/utils/http.js.map +1 -0
- package/dist/wallets/SimpleSmartWallet.d.ts +68 -0
- package/dist/wallets/SimpleSmartWallet.d.ts.map +1 -0
- package/dist/wallets/SimpleSmartWallet.js +74 -0
- package/dist/wallets/SimpleSmartWallet.js.map +1 -0
- package/dist/wallets/SmartWalletProvider.d.ts +217 -0
- package/dist/wallets/SmartWalletProvider.d.ts.map +1 -0
- package/dist/wallets/SmartWalletProvider.js +366 -0
- package/dist/wallets/SmartWalletProvider.js.map +1 -0
- package/dist/wallets/config.d.ts +199 -0
- package/dist/wallets/config.d.ts.map +1 -0
- package/dist/wallets/config.js +183 -0
- package/dist/wallets/config.js.map +1 -0
- package/dist/wallets/index.d.ts +9 -0
- package/dist/wallets/index.d.ts.map +1 -0
- package/dist/wallets/index.js +9 -0
- package/dist/wallets/index.js.map +1 -0
- package/dist/web3/AddressDisplay/AddressDisplay.d.ts +33 -0
- package/dist/web3/AddressDisplay/AddressDisplay.d.ts.map +1 -0
- package/dist/web3/AddressDisplay/AddressDisplay.js +42 -0
- package/dist/web3/AddressDisplay/AddressDisplay.js.map +1 -0
- package/dist/web3/AddressInput/AddressInput.d.ts +36 -0
- package/dist/web3/AddressInput/AddressInput.d.ts.map +1 -0
- package/dist/web3/AddressInput/AddressInput.js +54 -0
- package/dist/web3/AddressInput/AddressInput.js.map +1 -0
- package/dist/web3/AmountInput/AmountInput.d.ts +41 -0
- package/dist/web3/AmountInput/AmountInput.d.ts.map +1 -0
- package/dist/web3/AmountInput/AmountInput.js +74 -0
- package/dist/web3/AmountInput/AmountInput.js.map +1 -0
- package/dist/web3/BalanceDisplay/BalanceDisplay.d.ts +30 -0
- package/dist/web3/BalanceDisplay/BalanceDisplay.d.ts.map +1 -0
- package/dist/web3/BalanceDisplay/BalanceDisplay.js +35 -0
- package/dist/web3/BalanceDisplay/BalanceDisplay.js.map +1 -0
- package/dist/web3/BlockExplorerLink/BlockExplorerLink.d.ts +41 -0
- package/dist/web3/BlockExplorerLink/BlockExplorerLink.d.ts.map +1 -0
- package/dist/web3/BlockExplorerLink/BlockExplorerLink.js +46 -0
- package/dist/web3/BlockExplorerLink/BlockExplorerLink.js.map +1 -0
- package/dist/web3/ConnectWallet/ConnectWallet.d.ts +35 -0
- package/dist/web3/ConnectWallet/ConnectWallet.d.ts.map +1 -0
- package/dist/web3/ConnectWallet/ConnectWallet.js +58 -0
- package/dist/web3/ConnectWallet/ConnectWallet.js.map +1 -0
- package/dist/web3/DisconnectButton/DisconnectButton.d.ts +30 -0
- package/dist/web3/DisconnectButton/DisconnectButton.d.ts.map +1 -0
- package/dist/web3/DisconnectButton/DisconnectButton.js +48 -0
- package/dist/web3/DisconnectButton/DisconnectButton.js.map +1 -0
- package/dist/web3/WalletBalance/WalletBalance.d.ts +27 -0
- package/dist/web3/WalletBalance/WalletBalance.d.ts.map +1 -0
- package/dist/web3/WalletBalance/WalletBalance.js +49 -0
- package/dist/web3/WalletBalance/WalletBalance.js.map +1 -0
- package/dist/web3/WalletDropdown/WalletDropdown.d.ts +29 -0
- package/dist/web3/WalletDropdown/WalletDropdown.d.ts.map +1 -0
- package/dist/web3/WalletDropdown/WalletDropdown.js +93 -0
- package/dist/web3/WalletDropdown/WalletDropdown.js.map +1 -0
- package/dist/web3/WalletInfo/WalletInfo.d.ts +31 -0
- package/dist/web3/WalletInfo/WalletInfo.d.ts.map +1 -0
- package/dist/web3/WalletInfo/WalletInfo.js +41 -0
- package/dist/web3/WalletInfo/WalletInfo.js.map +1 -0
- package/dist/web3/index.d.ts +11 -0
- package/dist/web3/index.d.ts.map +1 -0
- package/dist/web3/index.js +14 -0
- package/dist/web3/index.js.map +1 -0
- package/package.json +105 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { parseUSDC, formatUSDC } from '../../config/chains';
|
|
3
|
+
/**
|
|
4
|
+
* Amount Input Component
|
|
5
|
+
*
|
|
6
|
+
* Input field for USDC amounts with proper 6-decimal handling:
|
|
7
|
+
* - Validates numeric input
|
|
8
|
+
* - Formats to 6 decimals
|
|
9
|
+
* - Max button for full balance
|
|
10
|
+
* - Error states
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { AmountInput } from '@varity-labs/ui-kit';
|
|
15
|
+
*
|
|
16
|
+
* function SendForm() {
|
|
17
|
+
* const [amount, setAmount] = useState('');
|
|
18
|
+
*
|
|
19
|
+
* return (
|
|
20
|
+
* <AmountInput
|
|
21
|
+
* value={amount}
|
|
22
|
+
* onChange={(value, valueBigInt) => setAmount(value)}
|
|
23
|
+
* max={BigInt(1000000000)} // 1000 USDC
|
|
24
|
+
* showMax
|
|
25
|
+
* label="Amount to send"
|
|
26
|
+
* placeholder="0.00"
|
|
27
|
+
* />
|
|
28
|
+
* );
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function AmountInput({ value, onChange, max, showMax = true, label, placeholder = '0.00', error, className = '', }) {
|
|
33
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
34
|
+
const handleChange = (e) => {
|
|
35
|
+
const inputValue = e.target.value;
|
|
36
|
+
// Allow empty string
|
|
37
|
+
if (inputValue === '') {
|
|
38
|
+
onChange('', BigInt(0));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
// Validate numeric input with up to 6 decimals
|
|
42
|
+
const regex = /^\d*\.?\d{0,6}$/;
|
|
43
|
+
if (!regex.test(inputValue)) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const valueBigInt = parseUSDC(inputValue);
|
|
48
|
+
onChange(inputValue, valueBigInt);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
// Invalid input, don't update
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleMax = () => {
|
|
55
|
+
if (max) {
|
|
56
|
+
const maxValue = formatUSDC(max, 6);
|
|
57
|
+
onChange(maxValue, max);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const isOverMax = max && value ? parseUSDC(value) > max : false;
|
|
61
|
+
return (React.createElement("div", { className: `space-y-2 ${className}` },
|
|
62
|
+
label && (React.createElement("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300" }, label)),
|
|
63
|
+
React.createElement("div", { className: "relative" },
|
|
64
|
+
React.createElement("input", { type: "text", value: value, onChange: handleChange, onFocus: () => setIsFocused(true), onBlur: () => setIsFocused(false), placeholder: placeholder, className: `input pr-20 ${error || isOverMax ? 'border-red-500 focus:ring-red-500' : ''}` }),
|
|
65
|
+
React.createElement("div", { className: "absolute right-2 top-1/2 -translate-y-1/2 flex items-center gap-2" },
|
|
66
|
+
Boolean(showMax && max) && (React.createElement("button", { type: "button", onClick: handleMax, className: "text-xs text-varity-primary hover:text-varity-primary/80 font-medium" }, "MAX")),
|
|
67
|
+
React.createElement("span", { className: "text-sm text-gray-500" }, "USDC"))),
|
|
68
|
+
(error || isOverMax) && (React.createElement("p", { className: "text-sm text-red-500" }, error || 'Amount exceeds maximum')),
|
|
69
|
+
Boolean(max && value && !error && !isOverMax) && (React.createElement("p", { className: "text-xs text-gray-500" },
|
|
70
|
+
"Maximum: ",
|
|
71
|
+
max ? formatUSDC(max, 2).toString() : '',
|
|
72
|
+
" USDC"))));
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=AmountInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AmountInput.js","sourceRoot":"","sources":["../../../src/web3/AmountInput/AmountInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAa5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,GAAG,EACH,OAAO,GAAG,IAAI,EACd,KAAK,EACL,WAAW,GAAG,MAAM,EACpB,KAAK,EACL,SAAS,GAAG,EAAE,GACG;IACjB,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAElD,MAAM,YAAY,GAAG,CAAC,CAAsC,EAAE,EAAE;QAC9D,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;QAElC,qBAAqB;QACrB,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;YACxB,OAAO;QACT,CAAC;QAED,+CAA+C;QAC/C,MAAM,KAAK,GAAG,iBAAiB,CAAC;QAChC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;YAC5B,OAAO;QACT,CAAC;QAED,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC;YAC1C,QAAQ,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QACpC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,8BAA8B;QAChC,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,GAAG,EAAE;QACrB,IAAI,GAAG,EAAE,CAAC;YACR,MAAM,QAAQ,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;YACpC,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC,CAAC;IAEF,MAAM,SAAS,GAAG,GAAG,IAAI,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IAEhE,OAAO,CACL,6BAAK,SAAS,EAAE,aAAa,SAAS,EAAE;QACrC,KAAK,IAAI,CACR,+BAAO,SAAS,EAAC,4DAA4D,IAC1E,KAAK,CACA,CACT;QAED,6BAAK,SAAS,EAAC,UAAU;YACvB,+BACE,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,YAAY,EACtB,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EACjC,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC,EACjC,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,eAAe,KAAK,IAAI,SAAS,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,EAAE,EAAE,GACzF;YAEF,6BAAK,SAAS,EAAC,mEAAmE;gBAC/E,OAAO,CAAC,OAAO,IAAI,GAAG,CAAC,IAAI,CAC1B,gCACE,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,SAAS,EAClB,SAAS,EAAC,sEAAsE,UAGzE,CACV;gBACD,8BAAM,SAAS,EAAC,uBAAuB,WAAY,CAC/C,CACF;QAEL,CAAC,KAAK,IAAI,SAAS,CAAC,IAAI,CACvB,2BAAG,SAAS,EAAC,sBAAsB,IAChC,KAAK,IAAI,wBAAwB,CAChC,CACL;QAEA,OAAO,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAChD,2BAAG,SAAS,EAAC,uBAAuB;;YACxB,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE;oBAChD,CACL,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface BalanceDisplayProps {
|
|
2
|
+
balance: bigint | string | number;
|
|
3
|
+
showSymbol?: boolean;
|
|
4
|
+
decimals?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Balance Display Component
|
|
10
|
+
*
|
|
11
|
+
* Formats and displays USDC balance with proper 6-decimal formatting
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { BalanceDisplay } from '@varity-labs/ui-kit';
|
|
16
|
+
*
|
|
17
|
+
* function Portfolio() {
|
|
18
|
+
* return (
|
|
19
|
+
* <BalanceDisplay
|
|
20
|
+
* balance={BigInt(1500000000)} // 1,500 USDC
|
|
21
|
+
* showSymbol
|
|
22
|
+
* decimals={2}
|
|
23
|
+
* size="lg"
|
|
24
|
+
* />
|
|
25
|
+
* );
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function BalanceDisplay({ balance, showSymbol, decimals, className, size, }: BalanceDisplayProps): JSX.Element;
|
|
30
|
+
//# sourceMappingURL=BalanceDisplay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BalanceDisplay.d.ts","sourceRoot":"","sources":["../../../src/web3/BalanceDisplay/BalanceDisplay.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,UAAiB,EACjB,QAAY,EACZ,SAAc,EACd,IAAW,GACZ,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,CAmBnC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { formatUSDC } from '../../config/chains';
|
|
3
|
+
/**
|
|
4
|
+
* Balance Display Component
|
|
5
|
+
*
|
|
6
|
+
* Formats and displays USDC balance with proper 6-decimal formatting
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { BalanceDisplay } from '@varity-labs/ui-kit';
|
|
11
|
+
*
|
|
12
|
+
* function Portfolio() {
|
|
13
|
+
* return (
|
|
14
|
+
* <BalanceDisplay
|
|
15
|
+
* balance={BigInt(1500000000)} // 1,500 USDC
|
|
16
|
+
* showSymbol
|
|
17
|
+
* decimals={2}
|
|
18
|
+
* size="lg"
|
|
19
|
+
* />
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function BalanceDisplay({ balance, showSymbol = true, decimals = 2, className = '', size = 'md', }) {
|
|
25
|
+
const formattedBalance = formatUSDC(balance, decimals);
|
|
26
|
+
const sizeClasses = {
|
|
27
|
+
sm: 'text-sm',
|
|
28
|
+
md: 'text-base',
|
|
29
|
+
lg: 'text-2xl',
|
|
30
|
+
};
|
|
31
|
+
return (React.createElement("div", { className: `flex items-baseline gap-1 ${className}` },
|
|
32
|
+
React.createElement("span", { className: `font-semibold ${sizeClasses[size]}` }, formattedBalance),
|
|
33
|
+
showSymbol && (React.createElement("span", { className: "text-sm text-gray-600 dark:text-gray-400" }, "USDC"))));
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=BalanceDisplay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BalanceDisplay.js","sourceRoot":"","sources":["../../../src/web3/BalanceDisplay/BalanceDisplay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAUjD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,cAAc,CAAC,EAC7B,OAAO,EACP,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,CAAC,EACZ,SAAS,GAAG,EAAE,EACd,IAAI,GAAG,IAAI,GACS;IACpB,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAEvD,MAAM,WAAW,GAAG;QAClB,EAAE,EAAE,SAAS;QACb,EAAE,EAAE,WAAW;QACf,EAAE,EAAE,UAAU;KACf,CAAC;IAEF,OAAO,CACL,6BAAK,SAAS,EAAE,6BAA6B,SAAS,EAAE;QACtD,8BAAM,SAAS,EAAE,iBAAiB,WAAW,CAAC,IAAI,CAAC,EAAE,IAClD,gBAAgB,CACZ;QACN,UAAU,IAAI,CACb,8BAAM,SAAS,EAAC,0CAA0C,WAAY,CACvE,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface BlockExplorerLinkProps {
|
|
3
|
+
type: 'tx' | 'address' | 'block';
|
|
4
|
+
hash: string;
|
|
5
|
+
chainId?: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Block Explorer Link Component
|
|
12
|
+
*
|
|
13
|
+
* Creates links to Arbiscan block explorer for transactions, addresses, or blocks
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { BlockExplorerLink } from '@varity-labs/ui-kit';
|
|
18
|
+
*
|
|
19
|
+
* function Transaction() {
|
|
20
|
+
* return (
|
|
21
|
+
* <>
|
|
22
|
+
* <BlockExplorerLink
|
|
23
|
+
* type="tx"
|
|
24
|
+
* hash="0xabc..."
|
|
25
|
+
* label="View Transaction"
|
|
26
|
+
* />
|
|
27
|
+
*
|
|
28
|
+
* <BlockExplorerLink
|
|
29
|
+
* type="address"
|
|
30
|
+
* hash="0x123..."
|
|
31
|
+
* >
|
|
32
|
+
* View on Explorer
|
|
33
|
+
* </BlockExplorerLink>
|
|
34
|
+
* </>
|
|
35
|
+
* );
|
|
36
|
+
* }
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function BlockExplorerLink({ type, hash, chainId, // Default to Arbitrum Sepolia
|
|
40
|
+
label, children, className, }: BlockExplorerLinkProps): JSX.Element;
|
|
41
|
+
//# sourceMappingURL=BlockExplorerLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockExplorerLink.d.ts","sourceRoot":"","sources":["../../../src/web3/BlockExplorerLink/BlockExplorerLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,EACJ,IAAI,EACJ,OAAgB,EAAE,8BAA8B;AAChD,KAAK,EACL,QAAQ,EACR,SAAc,GACf,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAwBtC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getBlockExplorerUrl } from '../../config/chains';
|
|
3
|
+
/**
|
|
4
|
+
* Block Explorer Link Component
|
|
5
|
+
*
|
|
6
|
+
* Creates links to Arbiscan block explorer for transactions, addresses, or blocks
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { BlockExplorerLink } from '@varity-labs/ui-kit';
|
|
11
|
+
*
|
|
12
|
+
* function Transaction() {
|
|
13
|
+
* return (
|
|
14
|
+
* <>
|
|
15
|
+
* <BlockExplorerLink
|
|
16
|
+
* type="tx"
|
|
17
|
+
* hash="0xabc..."
|
|
18
|
+
* label="View Transaction"
|
|
19
|
+
* />
|
|
20
|
+
*
|
|
21
|
+
* <BlockExplorerLink
|
|
22
|
+
* type="address"
|
|
23
|
+
* hash="0x123..."
|
|
24
|
+
* >
|
|
25
|
+
* View on Explorer
|
|
26
|
+
* </BlockExplorerLink>
|
|
27
|
+
* </>
|
|
28
|
+
* );
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export function BlockExplorerLink({ type, hash, chainId = 421614, // Default to Arbitrum Sepolia
|
|
33
|
+
label, children, className = '', }) {
|
|
34
|
+
const url = getBlockExplorerUrl(chainId, type, hash);
|
|
35
|
+
const defaultLabels = {
|
|
36
|
+
tx: 'View Transaction',
|
|
37
|
+
address: 'View Address',
|
|
38
|
+
block: 'View Block',
|
|
39
|
+
};
|
|
40
|
+
const displayText = children || label || defaultLabels[type];
|
|
41
|
+
return (React.createElement("a", { href: url, target: "_blank", rel: "noopener noreferrer", className: `inline-flex items-center gap-1 text-varity-primary hover:text-varity-primary/80 underline ${className}` },
|
|
42
|
+
displayText,
|
|
43
|
+
React.createElement("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24" },
|
|
44
|
+
React.createElement("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" }))));
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=BlockExplorerLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockExplorerLink.js","sourceRoot":"","sources":["../../../src/web3/BlockExplorerLink/BlockExplorerLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAW1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,iBAAiB,CAAC,EAChC,IAAI,EACJ,IAAI,EACJ,OAAO,GAAG,MAAM,EAAE,8BAA8B;AAChD,KAAK,EACL,QAAQ,EACR,SAAS,GAAG,EAAE,GACS;IACvB,MAAM,GAAG,GAAG,mBAAmB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAErD,MAAM,aAAa,GAAG;QACpB,EAAE,EAAE,kBAAkB;QACtB,OAAO,EAAE,cAAc;QACvB,KAAK,EAAE,YAAY;KACpB,CAAC;IAEF,MAAM,WAAW,GAAG,QAAQ,IAAI,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IAE7D,OAAO,CACL,2BACE,IAAI,EAAE,GAAG,EACT,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAE,6FAA6F,SAAS,EAAE;QAElH,WAAW;QACZ,6BAAK,SAAS,EAAC,SAAS,EAAC,IAAI,EAAC,MAAM,EAAC,MAAM,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW;YAC5E,8BAAM,aAAa,EAAC,OAAO,EAAC,cAAc,EAAC,OAAO,EAAC,WAAW,EAAE,CAAC,EAAE,CAAC,EAAC,8EAA8E,GAAG,CAClJ,CACJ,CACL,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface ConnectWalletProps {
|
|
2
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
onConnect?: (address: string) => void;
|
|
5
|
+
onError?: (error: Error) => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Connect Wallet Button Component
|
|
11
|
+
*
|
|
12
|
+
* Displays a button that opens wallet connection modal with support for:
|
|
13
|
+
* - MetaMask
|
|
14
|
+
* - WalletConnect
|
|
15
|
+
* - Coinbase Wallet
|
|
16
|
+
* - Email/Social logins
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* import { ConnectWallet } from '@varity-labs/ui-kit';
|
|
21
|
+
*
|
|
22
|
+
* function Header() {
|
|
23
|
+
* return (
|
|
24
|
+
* <ConnectWallet
|
|
25
|
+
* variant="primary"
|
|
26
|
+
* size="md"
|
|
27
|
+
* onConnect={(address) => console.log('Connected:', address)}
|
|
28
|
+
* onError={(error) => console.error('Connection failed:', error)}
|
|
29
|
+
* />
|
|
30
|
+
* );
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function ConnectWallet({ variant, size, onConnect, onError, className, label, }: ConnectWalletProps): JSX.Element;
|
|
35
|
+
//# sourceMappingURL=ConnectWallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectWallet.d.ts","sourceRoot":"","sources":["../../../src/web3/ConnectWallet/ConnectWallet.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,OAAmB,EACnB,IAAW,EACX,SAAS,EACT,OAAO,EACP,SAAc,EACd,KAAwB,GACzB,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CA0ClC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ConnectButton } from 'thirdweb/react';
|
|
3
|
+
import { createWallet } from 'thirdweb/wallets';
|
|
4
|
+
import { createThirdwebClient } from 'thirdweb';
|
|
5
|
+
import { THIRDWEB_CLIENT_ID, DEFAULT_CHAIN } from '../../config/chains';
|
|
6
|
+
/**
|
|
7
|
+
* Connect Wallet Button Component
|
|
8
|
+
*
|
|
9
|
+
* Displays a button that opens wallet connection modal with support for:
|
|
10
|
+
* - MetaMask
|
|
11
|
+
* - WalletConnect
|
|
12
|
+
* - Coinbase Wallet
|
|
13
|
+
* - Email/Social logins
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { ConnectWallet } from '@varity-labs/ui-kit';
|
|
18
|
+
*
|
|
19
|
+
* function Header() {
|
|
20
|
+
* return (
|
|
21
|
+
* <ConnectWallet
|
|
22
|
+
* variant="primary"
|
|
23
|
+
* size="md"
|
|
24
|
+
* onConnect={(address) => console.log('Connected:', address)}
|
|
25
|
+
* onError={(error) => console.error('Connection failed:', error)}
|
|
26
|
+
* />
|
|
27
|
+
* );
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export function ConnectWallet({ variant = 'primary', size = 'md', onConnect, onError, className = '', label = 'Connect Wallet', }) {
|
|
32
|
+
const client = React.useMemo(() => createThirdwebClient({ clientId: THIRDWEB_CLIENT_ID }), []);
|
|
33
|
+
const wallets = React.useMemo(() => [
|
|
34
|
+
createWallet('io.metamask'),
|
|
35
|
+
createWallet('com.coinbase.wallet'),
|
|
36
|
+
createWallet('walletConnect'),
|
|
37
|
+
], []);
|
|
38
|
+
const variantClasses = {
|
|
39
|
+
primary: 'btn btn-primary',
|
|
40
|
+
secondary: 'btn btn-secondary',
|
|
41
|
+
outline: 'btn btn-outline',
|
|
42
|
+
};
|
|
43
|
+
const sizeClasses = {
|
|
44
|
+
sm: 'btn-sm',
|
|
45
|
+
md: 'btn-md',
|
|
46
|
+
lg: 'btn-lg',
|
|
47
|
+
};
|
|
48
|
+
const buttonClasses = `${variantClasses[variant]} ${sizeClasses[size]} ${className}`;
|
|
49
|
+
return (React.createElement(ConnectButton, { client: client, wallets: wallets, chain: DEFAULT_CHAIN, connectButton: {
|
|
50
|
+
label: label,
|
|
51
|
+
className: buttonClasses,
|
|
52
|
+
}, onConnect: (wallet) => {
|
|
53
|
+
if (onConnect && wallet.getAccount()?.address) {
|
|
54
|
+
onConnect(wallet.getAccount().address);
|
|
55
|
+
}
|
|
56
|
+
} }));
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=ConnectWallet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectWallet.js","sourceRoot":"","sources":["../../../src/web3/ConnectWallet/ConnectWallet.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAWxE;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,IAAI,EACX,SAAS,EACT,OAAO,EACP,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,gBAAgB,GACL;IACnB,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC,EAC5D,EAAE,CACH,CAAC;IAEF,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC;QAClC,YAAY,CAAC,aAAa,CAAC;QAC3B,YAAY,CAAC,qBAAqB,CAAC;QACnC,YAAY,CAAC,eAAe,CAAC;KAC9B,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,cAAc,GAAG;QACrB,OAAO,EAAE,iBAAiB;QAC1B,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,iBAAiB;KAC3B,CAAC;IAEF,MAAM,WAAW,GAAG;QAClB,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;KACb,CAAC;IAEF,MAAM,aAAa,GAAG,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,CAAC;IAErF,OAAO,CACL,oBAAC,aAAa,IACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,aAAa,EACpB,aAAa,EAAE;YACb,KAAK,EAAE,KAAK;YACZ,SAAS,EAAE,aAAa;SACzB,EACD,SAAS,EAAE,CAAC,MAAM,EAAE,EAAE;YACpB,IAAI,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,CAAC;gBAC9C,SAAS,CAAC,MAAM,CAAC,UAAU,EAAG,CAAC,OAAO,CAAC,CAAC;YAC1C,CAAC;QACH,CAAC,GACD,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface DisconnectButtonProps {
|
|
2
|
+
variant?: 'primary' | 'secondary' | 'outline';
|
|
3
|
+
size?: 'sm' | 'md' | 'lg';
|
|
4
|
+
onDisconnect?: () => void;
|
|
5
|
+
className?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Disconnect Wallet Button Component
|
|
10
|
+
*
|
|
11
|
+
* Displays a button to disconnect the currently connected wallet
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* import { DisconnectButton } from '@varity-labs/ui-kit';
|
|
16
|
+
*
|
|
17
|
+
* function Settings() {
|
|
18
|
+
* return (
|
|
19
|
+
* <DisconnectButton
|
|
20
|
+
* variant="secondary"
|
|
21
|
+
* size="md"
|
|
22
|
+
* onDisconnect={() => console.log('Disconnected')}
|
|
23
|
+
* label="Disconnect Wallet"
|
|
24
|
+
* />
|
|
25
|
+
* );
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function DisconnectButton({ variant, size, onDisconnect, className, label, }: DisconnectButtonProps): JSX.Element | null;
|
|
30
|
+
//# sourceMappingURL=DisconnectButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisconnectButton.d.ts","sourceRoot":"","sources":["../../../src/web3/DisconnectButton/DisconnectButton.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC9C,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,OAAqB,EACrB,IAAW,EACX,YAAY,EACZ,SAAc,EACd,KAAoB,GACrB,EAAE,qBAAqB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAmC5C"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useDisconnect, useActiveWallet } from 'thirdweb/react';
|
|
3
|
+
/**
|
|
4
|
+
* Disconnect Wallet Button Component
|
|
5
|
+
*
|
|
6
|
+
* Displays a button to disconnect the currently connected wallet
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { DisconnectButton } from '@varity-labs/ui-kit';
|
|
11
|
+
*
|
|
12
|
+
* function Settings() {
|
|
13
|
+
* return (
|
|
14
|
+
* <DisconnectButton
|
|
15
|
+
* variant="secondary"
|
|
16
|
+
* size="md"
|
|
17
|
+
* onDisconnect={() => console.log('Disconnected')}
|
|
18
|
+
* label="Disconnect Wallet"
|
|
19
|
+
* />
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function DisconnectButton({ variant = 'secondary', size = 'md', onDisconnect, className = '', label = 'Disconnect', }) {
|
|
25
|
+
const wallet = useActiveWallet();
|
|
26
|
+
const { disconnect } = useDisconnect();
|
|
27
|
+
if (!wallet) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
const variantClasses = {
|
|
31
|
+
primary: 'btn btn-primary',
|
|
32
|
+
secondary: 'btn btn-secondary',
|
|
33
|
+
outline: 'btn btn-outline',
|
|
34
|
+
};
|
|
35
|
+
const sizeClasses = {
|
|
36
|
+
sm: 'btn-sm',
|
|
37
|
+
md: 'btn-md',
|
|
38
|
+
lg: 'btn-lg',
|
|
39
|
+
};
|
|
40
|
+
const handleDisconnect = async () => {
|
|
41
|
+
await disconnect(wallet);
|
|
42
|
+
if (onDisconnect) {
|
|
43
|
+
onDisconnect();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return (React.createElement("button", { onClick: handleDisconnect, className: `${variantClasses[variant]} ${sizeClasses[size]} ${className}` }, label));
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=DisconnectButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DisconnectButton.js","sourceRoot":"","sources":["../../../src/web3/DisconnectButton/DisconnectButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAUhE;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAC/B,OAAO,GAAG,WAAW,EACrB,IAAI,GAAG,IAAI,EACX,YAAY,EACZ,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,YAAY,GACE;IACtB,MAAM,MAAM,GAAG,eAAe,EAAE,CAAC;IACjC,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,CAAC;IAEvC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,cAAc,GAAG;QACrB,OAAO,EAAE,iBAAiB;QAC1B,SAAS,EAAE,mBAAmB;QAC9B,OAAO,EAAE,iBAAiB;KAC3B,CAAC;IAEF,MAAM,WAAW,GAAG;QAClB,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;QACZ,EAAE,EAAE,QAAQ;KACb,CAAC;IAEF,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;QAClC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC;QACzB,IAAI,YAAY,EAAE,CAAC;YACjB,YAAY,EAAE,CAAC;QACjB,CAAC;IACH,CAAC,CAAC;IAEF,OAAO,CACL,gCACE,OAAO,EAAE,gBAAgB,EACzB,SAAS,EAAE,GAAG,cAAc,CAAC,OAAO,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,EAAE,IAExE,KAAK,CACC,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface WalletBalanceProps {
|
|
2
|
+
showSymbol?: boolean;
|
|
3
|
+
decimals?: number;
|
|
4
|
+
className?: string;
|
|
5
|
+
loadingText?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Wallet Balance Display Component
|
|
9
|
+
*
|
|
10
|
+
* Displays wallet USDC balance with automatic formatting (6 decimals)
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* import { WalletBalance } from '@varity-labs/ui-kit';
|
|
15
|
+
*
|
|
16
|
+
* function Balance() {
|
|
17
|
+
* return (
|
|
18
|
+
* <WalletBalance
|
|
19
|
+
* showSymbol
|
|
20
|
+
* decimals={2}
|
|
21
|
+
* />
|
|
22
|
+
* );
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare function WalletBalance({ showSymbol, decimals, className, loadingText, }: WalletBalanceProps): JSX.Element | null;
|
|
27
|
+
//# sourceMappingURL=WalletBalance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletBalance.d.ts","sourceRoot":"","sources":["../../../src/web3/WalletBalance/WalletBalance.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,kBAAkB;IACjC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,aAAa,CAAC,EAC5B,UAAiB,EACjB,QAAY,EACZ,SAAc,EACd,WAA0B,GAC3B,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA6CzC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useActiveAccount, useWalletBalance } from 'thirdweb/react';
|
|
3
|
+
import { createThirdwebClient } from 'thirdweb';
|
|
4
|
+
import { THIRDWEB_CLIENT_ID, DEFAULT_CHAIN, formatUSDC } from '../../config/chains';
|
|
5
|
+
/**
|
|
6
|
+
* Wallet Balance Display Component
|
|
7
|
+
*
|
|
8
|
+
* Displays wallet USDC balance with automatic formatting (6 decimals)
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { WalletBalance } from '@varity-labs/ui-kit';
|
|
13
|
+
*
|
|
14
|
+
* function Balance() {
|
|
15
|
+
* return (
|
|
16
|
+
* <WalletBalance
|
|
17
|
+
* showSymbol
|
|
18
|
+
* decimals={2}
|
|
19
|
+
* />
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export function WalletBalance({ showSymbol = true, decimals = 2, className = '', loadingText = 'Loading...', }) {
|
|
25
|
+
const account = useActiveAccount();
|
|
26
|
+
const client = React.useMemo(() => createThirdwebClient({ clientId: THIRDWEB_CLIENT_ID }), []);
|
|
27
|
+
const { data: balance, isLoading, error } = useWalletBalance({
|
|
28
|
+
client,
|
|
29
|
+
chain: DEFAULT_CHAIN,
|
|
30
|
+
address: account?.address,
|
|
31
|
+
});
|
|
32
|
+
if (!account) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
if (isLoading) {
|
|
36
|
+
return (React.createElement("div", { className: `flex items-center gap-2 ${className}` },
|
|
37
|
+
React.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-varity-primary" }),
|
|
38
|
+
React.createElement("span", { className: "text-sm text-gray-500" }, loadingText)));
|
|
39
|
+
}
|
|
40
|
+
if (error) {
|
|
41
|
+
return (React.createElement("div", { className: `text-sm text-red-500 ${className}` }, "Error loading balance"));
|
|
42
|
+
}
|
|
43
|
+
const balanceValue = balance?.value || BigInt(0);
|
|
44
|
+
const formattedBalance = formatUSDC(balanceValue, decimals);
|
|
45
|
+
return (React.createElement("div", { className: `flex items-center gap-1 ${className}` },
|
|
46
|
+
React.createElement("span", { className: "text-lg font-semibold" }, formattedBalance),
|
|
47
|
+
showSymbol && (React.createElement("span", { className: "text-sm text-gray-600 dark:text-gray-400" }, "USDC"))));
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=WalletBalance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletBalance.js","sourceRoot":"","sources":["../../../src/web3/WalletBalance/WalletBalance.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AASpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,aAAa,CAAC,EAC5B,UAAU,GAAG,IAAI,EACjB,QAAQ,GAAG,CAAC,EACZ,SAAS,GAAG,EAAE,EACd,WAAW,GAAG,YAAY,GACP;IACnB,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC1B,GAAG,EAAE,CAAC,oBAAoB,CAAC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,CAAC,EAC5D,EAAE,CACH,CAAC;IAEF,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,gBAAgB,CAAC;QAC3D,MAAM;QACN,KAAK,EAAE,aAAa;QACpB,OAAO,EAAE,OAAO,EAAE,OAAO;KAC1B,CAAC,CAAC;IAEH,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,6BAAK,SAAS,EAAE,2BAA2B,SAAS,EAAE;YACpD,6BAAK,SAAS,EAAC,oEAAoE,GAAG;YACtF,8BAAM,SAAS,EAAC,uBAAuB,IAAE,WAAW,CAAQ,CACxD,CACP,CAAC;IACJ,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,6BAAK,SAAS,EAAE,wBAAwB,SAAS,EAAE,4BAE7C,CACP,CAAC;IACJ,CAAC;IAED,MAAM,YAAY,GAAG,OAAO,EAAE,KAAK,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC;IACjD,MAAM,gBAAgB,GAAG,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAE5D,OAAO,CACL,6BAAK,SAAS,EAAE,2BAA2B,SAAS,EAAE;QACpD,8BAAM,SAAS,EAAC,uBAAuB,IAAE,gBAAgB,CAAQ;QAChE,UAAU,IAAI,CACb,8BAAM,SAAS,EAAC,0CAA0C,WAAY,CACvE,CACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface WalletDropdownProps {
|
|
2
|
+
onDisconnect?: () => void;
|
|
3
|
+
className?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Wallet Dropdown Menu Component
|
|
7
|
+
*
|
|
8
|
+
* Displays a dropdown menu with wallet information and actions:
|
|
9
|
+
* - Address
|
|
10
|
+
* - Balance
|
|
11
|
+
* - Copy address
|
|
12
|
+
* - View on explorer
|
|
13
|
+
* - Disconnect
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import { WalletDropdown } from '@varity-labs/ui-kit';
|
|
18
|
+
*
|
|
19
|
+
* function Header() {
|
|
20
|
+
* return (
|
|
21
|
+
* <WalletDropdown
|
|
22
|
+
* onDisconnect={() => console.log('Disconnected')}
|
|
23
|
+
* />
|
|
24
|
+
* );
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function WalletDropdown({ onDisconnect, className, }: WalletDropdownProps): JSX.Element | null;
|
|
29
|
+
//# sourceMappingURL=WalletDropdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletDropdown.d.ts","sourceRoot":"","sources":["../../../src/web3/WalletDropdown/WalletDropdown.tsx"],"names":[],"mappings":"AAKA,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,SAAc,GACf,EAAE,mBAAmB,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAgH1C"}
|