@n1xyz/wallet-widget 0.0.1 → 0.0.5
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 +44 -0
- package/README.md +210 -0
- package/dist/Logic/sessionManager.d.ts +53 -0
- package/dist/Logic/sessionManager.js +178 -0
- package/dist/Logic/transactionManager.d.ts +41 -0
- package/dist/Logic/transactionManager.js +192 -0
- package/dist/Logic/utils.d.ts +1 -0
- package/dist/Logic/utils.js +47 -9
- package/dist/Modal/BackButton.js +14 -1
- package/dist/Modal/ConnectView.js +20 -23
- package/dist/Modal/CreateSessionView.js +23 -11
- package/dist/Modal/CreateUserView.js +1 -1
- package/dist/Modal/LoadingFallback.d.ts +2 -0
- package/dist/Modal/LoadingFallback.js +2 -0
- package/dist/Modal/ModalHeader.js +14 -3
- package/dist/Modal/N1WalletModal.js +91 -79
- package/dist/Modal/NTSFlow/LoadingFallback.d.ts +2 -0
- package/dist/Modal/NTSFlow/LoadingFallback.js +2 -0
- package/dist/Modal/NTSFlow/NTSFlow.d.ts +4 -0
- package/dist/Modal/NTSFlow/NTSFlow.js +30 -0
- package/dist/Modal/NTSFlow/NordFlow/WalletConnectionFlow.d.ts +9 -0
- package/dist/Modal/NTSFlow/NordFlow/WalletConnectionFlow.js +145 -0
- package/dist/Modal/NTSFlow/NordFlow/components/AnimatedButton.d.ts +14 -0
- package/dist/Modal/NTSFlow/NordFlow/components/AnimatedButton.js +75 -0
- package/dist/Modal/NTSFlow/NordFlow/components/ChainButton.d.ts +7 -0
- package/dist/Modal/NTSFlow/NordFlow/components/ChainButton.js +5 -0
- package/dist/Modal/NTSFlow/NordFlow/components/LoadingSquares.d.ts +1 -0
- package/dist/Modal/NTSFlow/NordFlow/components/LoadingSquares.js +5 -0
- package/dist/Modal/NTSFlow/NordFlow/components/TransactionTable.d.ts +13 -0
- package/dist/Modal/NTSFlow/NordFlow/components/TransactionTable.js +58 -0
- package/dist/Modal/NTSFlow/NordFlow/components/WaitingMessage.d.ts +6 -0
- package/dist/Modal/NTSFlow/NordFlow/components/WaitingMessage.js +6 -0
- package/dist/Modal/NTSFlow/NordFlow/components/index.d.ts +5 -0
- package/dist/Modal/NTSFlow/NordFlow/components/index.js +5 -0
- package/dist/Modal/NTSFlow/NordFlow/constants.d.ts +37 -0
- package/dist/Modal/NTSFlow/NordFlow/constants.js +223 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/index.d.ts +8 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/index.js +8 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useButtonTyping.d.ts +7 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useButtonTyping.js +43 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useDepositFlow.d.ts +38 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useDepositFlow.js +166 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useFlowState.d.ts +32 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useFlowState.js +163 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useInterruptHandler.d.ts +27 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useInterruptHandler.js +101 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useNordSession.d.ts +32 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useNordSession.js +193 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useTableValues.d.ts +2 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useTableValues.js +69 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useWaitingMessage.d.ts +6 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useWaitingMessage.js +89 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useWalletConnect.d.ts +30 -0
- package/dist/Modal/NTSFlow/NordFlow/hooks/useWalletConnect.js +132 -0
- package/dist/Modal/NTSFlow/NordFlow/index.d.ts +3 -0
- package/dist/Modal/NTSFlow/NordFlow/index.js +3 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/01-ConnectWalletScreen.d.ts +6 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/01-ConnectWalletScreen.js +17 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/02-EvmWalletAuthScreen.d.ts +6 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/02-EvmWalletAuthScreen.js +47 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/03-ChainSelectionScreen.d.ts +7 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/03-ChainSelectionScreen.js +7 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/04-AmountInputScreen.d.ts +8 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/04-AmountInputScreen.js +20 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/05-DepositProgressScreen.d.ts +7 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/05-DepositProgressScreen.js +6 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/06-DepositSuccessScreen.d.ts +8 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/06-DepositSuccessScreen.js +99 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/07-NordAuthScreen.d.ts +7 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/07-NordAuthScreen.js +14 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/08-AuthLoadingScreen.d.ts +6 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/08-AuthLoadingScreen.js +20 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/09-FinalSuccessScreen.d.ts +5 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/09-FinalSuccessScreen.js +18 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/10-ErrorScreen.d.ts +7 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/10-ErrorScreen.js +13 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/index.d.ts +10 -0
- package/dist/Modal/NTSFlow/NordFlow/screens/index.js +10 -0
- package/dist/Modal/NTSFlow/NordFlow/types.d.ts +105 -0
- package/dist/Modal/NTSFlow/NordFlow/types.js +34 -0
- package/dist/Modal/NTSFlow/NordFlow/utils/persistence.d.ts +24 -0
- package/dist/Modal/NTSFlow/NordFlow/utils/persistence.js +83 -0
- package/dist/Modal/NTSFlow/components/BackButton.d.ts +3 -0
- package/dist/Modal/NTSFlow/components/BackButton.js +26 -0
- package/dist/Modal/NTSFlow/components/ModalHeader.d.ts +1 -0
- package/dist/Modal/NTSFlow/components/ModalHeader.js +20 -0
- package/dist/Modal/NTSFlow/index.d.ts +1 -0
- package/dist/Modal/NTSFlow/index.js +1 -0
- package/dist/Modal/NTSFlow/views/ConnectView.d.ts +1 -0
- package/dist/Modal/NTSFlow/views/ConnectView.js +68 -0
- package/dist/Modal/NTSFlow/views/CreateSessionView.d.ts +1 -0
- package/dist/Modal/NTSFlow/views/CreateSessionView.js +245 -0
- package/dist/Modal/NTSFlow/views/CreateUserView.d.ts +1 -0
- package/dist/Modal/NTSFlow/views/CreateUserView.js +105 -0
- package/dist/Modal/NTSFlow/views/NoWhitelistView.d.ts +1 -0
- package/dist/Modal/NTSFlow/views/NoWhitelistView.js +42 -0
- package/dist/Modal/NTSFlow/views/SigningView.d.ts +1 -0
- package/dist/Modal/NTSFlow/views/SigningView.js +5 -0
- package/dist/Modal/NTSFlow/views/SuccessView.d.ts +1 -0
- package/dist/Modal/NTSFlow/views/SuccessView.js +10 -0
- package/dist/Modal/NoWhitelistView.js +14 -1
- package/dist/Modal/NordFlow/NordFlow.d.ts +9 -0
- package/dist/Modal/NordFlow/NordFlow.js +262 -0
- package/dist/Modal/NordFlow/NordFlowWrapper.d.ts +11 -0
- package/dist/Modal/NordFlow/NordFlowWrapper.js +11 -0
- package/dist/Modal/NordFlow/WalletConnectionFlow.d.ts +9 -0
- package/dist/Modal/NordFlow/WalletConnectionFlow.js +145 -0
- package/dist/Modal/NordFlow/components/AnimatedButton.d.ts +14 -0
- package/dist/Modal/NordFlow/components/AnimatedButton.js +75 -0
- package/dist/Modal/NordFlow/components/ChainButton.d.ts +8 -0
- package/dist/Modal/NordFlow/components/ChainButton.js +21 -0
- package/dist/Modal/NordFlow/components/ImageWithFallback.d.ts +17 -0
- package/dist/Modal/NordFlow/components/ImageWithFallback.js +32 -0
- package/dist/Modal/NordFlow/components/LoadingSquares.d.ts +1 -0
- package/dist/Modal/NordFlow/components/LoadingSquares.js +5 -0
- package/dist/Modal/NordFlow/components/TransactionTable.d.ts +13 -0
- package/dist/Modal/NordFlow/components/TransactionTable.js +83 -0
- package/dist/Modal/NordFlow/components/WaitingMessage.d.ts +6 -0
- package/dist/Modal/NordFlow/components/WaitingMessage.js +6 -0
- package/dist/Modal/NordFlow/components/index.d.ts +5 -0
- package/dist/Modal/NordFlow/components/index.js +5 -0
- package/dist/Modal/NordFlow/constants.d.ts +37 -0
- package/dist/Modal/NordFlow/constants.js +192 -0
- package/dist/Modal/NordFlow/hoc/index.d.ts +1 -0
- package/dist/Modal/NordFlow/hoc/index.js +1 -0
- package/dist/Modal/NordFlow/hoc/withImageFallback.d.ts +7 -0
- package/dist/Modal/NordFlow/hoc/withImageFallback.js +60 -0
- package/dist/Modal/NordFlow/hooks/index.d.ts +5 -0
- package/dist/Modal/NordFlow/hooks/index.js +5 -0
- package/dist/Modal/NordFlow/hooks/useButtonTyping.d.ts +7 -0
- package/dist/Modal/NordFlow/hooks/useButtonTyping.js +43 -0
- package/dist/Modal/NordFlow/hooks/useDepositFlow.d.ts +52 -0
- package/dist/Modal/NordFlow/hooks/useDepositFlow.js +365 -0
- package/dist/Modal/NordFlow/hooks/useFlowState.d.ts +32 -0
- package/dist/Modal/NordFlow/hooks/useFlowState.js +166 -0
- package/dist/Modal/NordFlow/hooks/useInterruptHandler.d.ts +24 -0
- package/dist/Modal/NordFlow/hooks/useInterruptHandler.js +56 -0
- package/dist/Modal/NordFlow/hooks/useNordInstance.d.ts +10 -0
- package/dist/Modal/NordFlow/hooks/useNordInstance.js +310 -0
- package/dist/Modal/NordFlow/hooks/useNordSession.d.ts +32 -0
- package/dist/Modal/NordFlow/hooks/useNordSession.js +391 -0
- package/dist/Modal/NordFlow/hooks/useNordWalletConnect.d.ts +14 -0
- package/dist/Modal/NordFlow/hooks/useNordWalletConnect.js +231 -0
- package/dist/Modal/NordFlow/hooks/useTableValues.d.ts +2 -0
- package/dist/Modal/NordFlow/hooks/useTableValues.js +69 -0
- package/dist/Modal/NordFlow/hooks/useWaitingMessage.d.ts +6 -0
- package/dist/Modal/NordFlow/hooks/useWaitingMessage.js +89 -0
- package/dist/Modal/NordFlow/hooks/useWalletConnect.d.ts +14 -0
- package/dist/Modal/NordFlow/hooks/useWalletConnect.js +221 -0
- package/dist/Modal/NordFlow/index copy.d.ts +1 -0
- package/dist/Modal/NordFlow/index copy.js +1 -0
- package/dist/Modal/NordFlow/index.d.ts +1 -0
- package/dist/Modal/NordFlow/index.js +1 -0
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.d.ts +6 -0
- package/dist/Modal/NordFlow/screens/01-ConnectWalletScreen.js +17 -0
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.d.ts +6 -0
- package/dist/Modal/NordFlow/screens/02-EvmWalletAuthScreen.js +47 -0
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.d.ts +7 -0
- package/dist/Modal/NordFlow/screens/03-ChainSelectionScreen.js +47 -0
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.d.ts +10 -0
- package/dist/Modal/NordFlow/screens/04-AmountInputScreen.js +165 -0
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.d.ts +6 -0
- package/dist/Modal/NordFlow/screens/05-DepositProgressScreen.js +44 -0
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.d.ts +8 -0
- package/dist/Modal/NordFlow/screens/06-DepositSuccessScreen.js +119 -0
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.d.ts +6 -0
- package/dist/Modal/NordFlow/screens/07-AuthLoadingScreen.js +126 -0
- package/dist/Modal/NordFlow/screens/07-NordAuthScreen.d.ts +5 -0
- package/dist/Modal/NordFlow/screens/07-NordAuthScreen.js +17 -0
- package/dist/Modal/NordFlow/screens/08-AuthLoadingScreen.d.ts +6 -0
- package/dist/Modal/NordFlow/screens/08-AuthLoadingScreen.js +153 -0
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.d.ts +5 -0
- package/dist/Modal/NordFlow/screens/08-FinalSuccessScreen.js +36 -0
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.d.ts +7 -0
- package/dist/Modal/NordFlow/screens/09-ErrorScreen.js +62 -0
- package/dist/Modal/NordFlow/screens/09-FinalSuccessScreen.d.ts +5 -0
- package/dist/Modal/NordFlow/screens/09-FinalSuccessScreen.js +47 -0
- package/dist/Modal/NordFlow/screens/10-ErrorScreen.d.ts +7 -0
- package/dist/Modal/NordFlow/screens/10-ErrorScreen.js +62 -0
- package/dist/Modal/NordFlow/screens/index.d.ts +9 -0
- package/dist/Modal/NordFlow/screens/index.js +9 -0
- package/dist/Modal/NordFlow/types.d.ts +108 -0
- package/dist/Modal/NordFlow/types.js +32 -0
- package/dist/Modal/NordFlow/utils/imageUtils.d.ts +21 -0
- package/dist/Modal/NordFlow/utils/imageUtils.js +109 -0
- package/dist/Modal/NordFlow/utils/index.d.ts +3 -0
- package/dist/Modal/NordFlow/utils/index.js +3 -0
- package/dist/Modal/NordFlow/utils/nordUtils.d.ts +40 -0
- package/dist/Modal/NordFlow/utils/nordUtils.js +61 -0
- package/dist/Modal/NordFlow/utils/persistence.d.ts +24 -0
- package/dist/Modal/NordFlow/utils/persistence.js +83 -0
- package/dist/Modal/Sidebar/N1Sidebar.js +167 -14
- package/dist/Modal/Sidebar/NordTradingView/AccountSummary/AccountSummary.d.ts +1 -0
- package/dist/Modal/Sidebar/NordTradingView/AccountSummary/AccountSummary.js +116 -0
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketOverview.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketOverview.js +86 -0
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketSelector.d.ts +6 -0
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketSelector.js +38 -0
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketStats.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/MarketOverview/MarketStats.js +15 -0
- package/dist/Modal/Sidebar/NordTradingView/NordTradingView.d.ts +1 -0
- package/dist/Modal/Sidebar/NordTradingView/NordTradingView.js +54 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBook.d.ts +5 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBook.js +197 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookDepthVisualizer.d.ts +10 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookDepthVisualizer.js +61 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookHeader.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookHeader.js +28 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookTable.d.ts +11 -0
- package/dist/Modal/Sidebar/NordTradingView/OrderBook/OrderBookTable.js +22 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/AmountInput.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/AmountInput.js +19 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/BuySellTabs.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/BuySellTabs.js +23 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/FillModeSelector.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/FillModeSelector.js +76 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/OrderTypeSelector.d.ts +9 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/OrderTypeSelector.js +103 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/PriceInput.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/PriceInput.js +29 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/SubmitButton.d.ts +9 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/SubmitButton.js +39 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TotalCalculator.d.ts +7 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TotalCalculator.js +7 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TradeForm.d.ts +8 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeForm/TradeForm.js +249 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeHistory/TradeHistory.d.ts +5 -0
- package/dist/Modal/Sidebar/NordTradingView/TradeHistory/TradeHistory.js +138 -0
- package/dist/Modal/Sidebar/NordTradingView/UserBalances/UserBalances.d.ts +1 -0
- package/dist/Modal/Sidebar/NordTradingView/UserBalances/UserBalances.js +108 -0
- package/dist/Modal/Sidebar/NordTradingView/UserOrders/UserOrders.d.ts +1 -0
- package/dist/Modal/Sidebar/NordTradingView/UserOrders/UserOrders.js +177 -0
- package/dist/Modal/Sidebar/NordTradingView/UserPositions/UserPositions.d.ts +1 -0
- package/dist/Modal/Sidebar/NordTradingView/UserPositions/UserPositions.js +188 -0
- package/dist/Modal/SigningView.js +1 -1
- package/dist/NordFlow/WalletConnectionFlow.d.ts +9 -0
- package/dist/NordFlow/WalletConnectionFlow.js +145 -0
- package/dist/NordFlow/components/AnimatedButton.d.ts +14 -0
- package/dist/NordFlow/components/AnimatedButton.js +75 -0
- package/dist/NordFlow/components/ChainButton.d.ts +7 -0
- package/dist/NordFlow/components/ChainButton.js +5 -0
- package/dist/NordFlow/components/LoadingSquares.d.ts +1 -0
- package/dist/NordFlow/components/LoadingSquares.js +5 -0
- package/dist/NordFlow/components/TransactionTable.d.ts +13 -0
- package/dist/NordFlow/components/TransactionTable.js +58 -0
- package/dist/NordFlow/components/WaitingMessage.d.ts +6 -0
- package/dist/NordFlow/components/WaitingMessage.js +6 -0
- package/dist/NordFlow/components/index.d.ts +5 -0
- package/dist/NordFlow/components/index.js +5 -0
- package/dist/NordFlow/constants.d.ts +37 -0
- package/dist/NordFlow/constants.js +223 -0
- package/dist/NordFlow/hooks/index.d.ts +8 -0
- package/dist/NordFlow/hooks/index.js +8 -0
- package/dist/NordFlow/hooks/useButtonTyping.d.ts +7 -0
- package/dist/NordFlow/hooks/useButtonTyping.js +43 -0
- package/dist/NordFlow/hooks/useDepositFlow.d.ts +38 -0
- package/dist/NordFlow/hooks/useDepositFlow.js +166 -0
- package/dist/NordFlow/hooks/useFlowState.d.ts +32 -0
- package/dist/NordFlow/hooks/useFlowState.js +163 -0
- package/dist/NordFlow/hooks/useInterruptHandler.d.ts +27 -0
- package/dist/NordFlow/hooks/useInterruptHandler.js +101 -0
- package/dist/NordFlow/hooks/useNordSession.d.ts +32 -0
- package/dist/NordFlow/hooks/useNordSession.js +193 -0
- package/dist/NordFlow/hooks/useTableValues.d.ts +2 -0
- package/dist/NordFlow/hooks/useTableValues.js +69 -0
- package/dist/NordFlow/hooks/useWaitingMessage.d.ts +6 -0
- package/dist/NordFlow/hooks/useWaitingMessage.js +89 -0
- package/dist/NordFlow/hooks/useWalletConnect.d.ts +30 -0
- package/dist/NordFlow/hooks/useWalletConnect.js +132 -0
- package/dist/NordFlow/index.d.ts +3 -0
- package/dist/NordFlow/index.js +3 -0
- package/dist/NordFlow/screens/01-ConnectWalletScreen.d.ts +6 -0
- package/dist/NordFlow/screens/01-ConnectWalletScreen.js +17 -0
- package/dist/NordFlow/screens/02-EvmWalletAuthScreen.d.ts +6 -0
- package/dist/NordFlow/screens/02-EvmWalletAuthScreen.js +47 -0
- package/dist/NordFlow/screens/03-ChainSelectionScreen.d.ts +7 -0
- package/dist/NordFlow/screens/03-ChainSelectionScreen.js +7 -0
- package/dist/NordFlow/screens/04-AmountInputScreen.d.ts +8 -0
- package/dist/NordFlow/screens/04-AmountInputScreen.js +20 -0
- package/dist/NordFlow/screens/05-DepositProgressScreen.d.ts +7 -0
- package/dist/NordFlow/screens/05-DepositProgressScreen.js +6 -0
- package/dist/NordFlow/screens/06-DepositSuccessScreen.d.ts +8 -0
- package/dist/NordFlow/screens/06-DepositSuccessScreen.js +99 -0
- package/dist/NordFlow/screens/07-NordAuthScreen.d.ts +7 -0
- package/dist/NordFlow/screens/07-NordAuthScreen.js +14 -0
- package/dist/NordFlow/screens/08-AuthLoadingScreen.d.ts +6 -0
- package/dist/NordFlow/screens/08-AuthLoadingScreen.js +20 -0
- package/dist/NordFlow/screens/09-FinalSuccessScreen.d.ts +5 -0
- package/dist/NordFlow/screens/09-FinalSuccessScreen.js +18 -0
- package/dist/NordFlow/screens/10-ErrorScreen.d.ts +7 -0
- package/dist/NordFlow/screens/10-ErrorScreen.js +13 -0
- package/dist/NordFlow/screens/index.d.ts +10 -0
- package/dist/NordFlow/screens/index.js +10 -0
- package/dist/NordFlow/types.d.ts +105 -0
- package/dist/NordFlow/types.js +34 -0
- package/dist/NordFlow/utils/persistence.d.ts +24 -0
- package/dist/NordFlow/utils/persistence.js +83 -0
- package/dist/Provider/LazyWalletProvider.js +75 -38
- package/dist/Provider/N1WalletProvider.d.ts +1 -1
- package/dist/Provider/N1WalletProvider.js +63 -42
- package/dist/Provider/types.d.ts +69 -0
- package/dist/WalletConnectionFlow/WalletConnectionFlow.d.ts +9 -0
- package/dist/WalletConnectionFlow/WalletConnectionFlow.js +145 -0
- package/dist/WalletConnectionFlow/components/AnimatedButton.d.ts +14 -0
- package/dist/WalletConnectionFlow/components/AnimatedButton.js +75 -0
- package/dist/WalletConnectionFlow/components/ChainButton.d.ts +7 -0
- package/dist/WalletConnectionFlow/components/ChainButton.js +5 -0
- package/dist/WalletConnectionFlow/components/LoadingSquares.d.ts +1 -0
- package/dist/WalletConnectionFlow/components/LoadingSquares.js +5 -0
- package/dist/WalletConnectionFlow/components/TransactionTable.d.ts +13 -0
- package/dist/WalletConnectionFlow/components/TransactionTable.js +58 -0
- package/dist/WalletConnectionFlow/components/WaitingMessage.d.ts +6 -0
- package/dist/WalletConnectionFlow/components/WaitingMessage.js +6 -0
- package/dist/WalletConnectionFlow/components/index.d.ts +5 -0
- package/dist/WalletConnectionFlow/components/index.js +5 -0
- package/dist/WalletConnectionFlow/constants.d.ts +37 -0
- package/dist/WalletConnectionFlow/constants.js +223 -0
- package/dist/WalletConnectionFlow/hooks/index.d.ts +8 -0
- package/dist/WalletConnectionFlow/hooks/index.js +8 -0
- package/dist/WalletConnectionFlow/hooks/useButtonTyping.d.ts +7 -0
- package/dist/WalletConnectionFlow/hooks/useButtonTyping.js +43 -0
- package/dist/WalletConnectionFlow/hooks/useDepositFlow.d.ts +38 -0
- package/dist/WalletConnectionFlow/hooks/useDepositFlow.js +166 -0
- package/dist/WalletConnectionFlow/hooks/useFlowState.d.ts +32 -0
- package/dist/WalletConnectionFlow/hooks/useFlowState.js +163 -0
- package/dist/WalletConnectionFlow/hooks/useInterruptHandler.d.ts +27 -0
- package/dist/WalletConnectionFlow/hooks/useInterruptHandler.js +101 -0
- package/dist/WalletConnectionFlow/hooks/useNordSession.d.ts +32 -0
- package/dist/WalletConnectionFlow/hooks/useNordSession.js +193 -0
- package/dist/WalletConnectionFlow/hooks/useTableValues.d.ts +2 -0
- package/dist/WalletConnectionFlow/hooks/useTableValues.js +69 -0
- package/dist/WalletConnectionFlow/hooks/useWaitingMessage.d.ts +6 -0
- package/dist/WalletConnectionFlow/hooks/useWaitingMessage.js +89 -0
- package/dist/WalletConnectionFlow/hooks/useWalletConnect.d.ts +30 -0
- package/dist/WalletConnectionFlow/hooks/useWalletConnect.js +132 -0
- package/dist/WalletConnectionFlow/index.d.ts +3 -0
- package/dist/WalletConnectionFlow/index.js +3 -0
- package/dist/WalletConnectionFlow/screens/01-ConnectWalletScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/01-ConnectWalletScreen.js +17 -0
- package/dist/WalletConnectionFlow/screens/02-EvmWalletAuthScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/02-EvmWalletAuthScreen.js +47 -0
- package/dist/WalletConnectionFlow/screens/03-ChainSelectionScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/03-ChainSelectionScreen.js +7 -0
- package/dist/WalletConnectionFlow/screens/04-AmountInputScreen.d.ts +8 -0
- package/dist/WalletConnectionFlow/screens/04-AmountInputScreen.js +20 -0
- package/dist/WalletConnectionFlow/screens/05-DepositProgressScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/05-DepositProgressScreen.js +6 -0
- package/dist/WalletConnectionFlow/screens/06-DepositSuccessScreen.d.ts +8 -0
- package/dist/WalletConnectionFlow/screens/06-DepositSuccessScreen.js +99 -0
- package/dist/WalletConnectionFlow/screens/07-NordAuthScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/07-NordAuthScreen.js +14 -0
- package/dist/WalletConnectionFlow/screens/08-AuthLoadingScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/08-AuthLoadingScreen.js +20 -0
- package/dist/WalletConnectionFlow/screens/09-FinalSuccessScreen.d.ts +5 -0
- package/dist/WalletConnectionFlow/screens/09-FinalSuccessScreen.js +18 -0
- package/dist/WalletConnectionFlow/screens/10-ErrorScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/10-ErrorScreen.js +13 -0
- package/dist/WalletConnectionFlow/screens/AmountInputScreen.d.ts +8 -0
- package/dist/WalletConnectionFlow/screens/AmountInputScreen.js +20 -0
- package/dist/WalletConnectionFlow/screens/AppsTableScreen.d.ts +8 -0
- package/dist/WalletConnectionFlow/screens/AppsTableScreen.js +28 -0
- package/dist/WalletConnectionFlow/screens/AuthLoadingScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/AuthLoadingScreen.js +20 -0
- package/dist/WalletConnectionFlow/screens/ChainSelectionScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/ChainSelectionScreen.js +7 -0
- package/dist/WalletConnectionFlow/screens/ConnectWalletScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/ConnectWalletScreen.js +17 -0
- package/dist/WalletConnectionFlow/screens/DepositProgressScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/DepositProgressScreen.js +6 -0
- package/dist/WalletConnectionFlow/screens/DepositSuccessScreen.d.ts +8 -0
- package/dist/WalletConnectionFlow/screens/DepositSuccessScreen.js +99 -0
- package/dist/WalletConnectionFlow/screens/ErrorScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/ErrorScreen.js +13 -0
- package/dist/WalletConnectionFlow/screens/EthToSolAuthScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/EthToSolAuthScreen.js +47 -0
- package/dist/WalletConnectionFlow/screens/EvmWalletAuthScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/EvmWalletAuthScreen.js +47 -0
- package/dist/WalletConnectionFlow/screens/FinalSuccessScreen.d.ts +5 -0
- package/dist/WalletConnectionFlow/screens/FinalSuccessScreen.js +18 -0
- package/dist/WalletConnectionFlow/screens/NordAuthScreen.d.ts +7 -0
- package/dist/WalletConnectionFlow/screens/NordAuthScreen.js +14 -0
- package/dist/WalletConnectionFlow/screens/SigningScreen.d.ts +6 -0
- package/dist/WalletConnectionFlow/screens/SigningScreen.js +6 -0
- package/dist/WalletConnectionFlow/screens/index.d.ts +10 -0
- package/dist/WalletConnectionFlow/screens/index.js +10 -0
- package/dist/WalletConnectionFlow/types.d.ts +105 -0
- package/dist/WalletConnectionFlow/types.js +34 -0
- package/dist/WalletConnectionFlow/utils/persistence.d.ts +24 -0
- package/dist/WalletConnectionFlow/utils/persistence.js +83 -0
- package/dist/components/Logo.d.ts +7 -0
- package/dist/components/Logo.js +118 -0
- package/dist/components/QRCodeLoader.d.ts +4 -0
- package/dist/components/QRCodeLoader.js +8 -0
- package/dist/components/WalletDeposit/AnimatedButton.d.ts +17 -0
- package/dist/components/WalletDeposit/AnimatedButton.js +29 -0
- package/dist/components/WalletDeposit/components/ChainButton.d.ts +7 -0
- package/dist/components/WalletDeposit/components/ChainButton.js +5 -0
- package/dist/components/WalletDeposit/components/LoadingSquares.d.ts +1 -0
- package/dist/components/WalletDeposit/components/LoadingSquares.js +5 -0
- package/dist/components/WalletDeposit/components/TransactionTable.d.ts +13 -0
- package/dist/components/WalletDeposit/components/TransactionTable.js +58 -0
- package/dist/components/WalletDeposit/components/WaitingMessage.d.ts +6 -0
- package/dist/components/WalletDeposit/components/WaitingMessage.js +6 -0
- package/dist/components/WalletDeposit/constants.d.ts +15 -0
- package/dist/components/WalletDeposit/constants.js +32 -0
- package/dist/components/WalletDeposit/hooks.d.ts +9 -0
- package/dist/components/WalletDeposit/hooks.js +185 -0
- package/dist/components/WalletDeposit/index.d.ts +1 -0
- package/dist/components/WalletDeposit/index.js +136 -0
- package/dist/components/WalletDeposit/screens/AmountInputScreen.d.ts +12 -0
- package/dist/components/WalletDeposit/screens/AmountInputScreen.js +18 -0
- package/dist/components/WalletDeposit/screens/AppsTableScreen.d.ts +8 -0
- package/dist/components/WalletDeposit/screens/AppsTableScreen.js +28 -0
- package/dist/components/WalletDeposit/screens/ChainSelectionScreen.d.ts +5 -0
- package/dist/components/WalletDeposit/screens/ChainSelectionScreen.js +8 -0
- package/dist/components/WalletDeposit/screens/InitialScreen.d.ts +9 -0
- package/dist/components/WalletDeposit/screens/InitialScreen.js +18 -0
- package/dist/components/WalletDeposit/screens/SigningScreen.d.ts +6 -0
- package/dist/components/WalletDeposit/screens/SigningScreen.js +6 -0
- package/dist/components/WalletDeposit/screens/SuccessScreen.d.ts +12 -0
- package/dist/components/WalletDeposit/screens/SuccessScreen.js +7 -0
- package/dist/components/WalletDeposit/types.d.ts +48 -0
- package/dist/config/dynamic.d.ts +20 -0
- package/dist/config/dynamic.js +47 -0
- package/dist/config/solana.d.ts +25 -0
- package/dist/config/solana.js +41 -0
- package/dist/errors/types.d.ts +5 -1
- package/dist/errors/types.js +12 -0
- package/dist/hooks/useSolanaSession.d.ts +17 -0
- package/dist/hooks/useSolanaSession.js +180 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/main.css +1 -1
- package/dist/utils/dynamicImports.d.ts +24 -0
- package/dist/utils/dynamicImports.js +41 -0
- package/dist/utils/shortenString.d.ts +2 -0
- package/dist/utils/shortenString.js +8 -0
- package/dist/utils/solana-session.d.ts +84 -0
- package/dist/utils/solana-session.js +230 -0
- package/package.json +24 -17
- package/.eslintrc.js +0 -29
- package/dist/Common/NIcon.js +0 -7
- package/dist/components/AnimatedButton.d.ts +0 -9
- package/dist/components/AnimatedButton.js +0 -5
- package/postcss.config.js +0 -6
- package/src/Logic/getPseudoName.ts +0 -5832
- package/src/Logic/utils.ts +0 -162
- package/src/Logic/words.ts +0 -93571
- package/src/Modal/BackButton.tsx +0 -23
- package/src/Modal/ConnectView.tsx +0 -88
- package/src/Modal/CreateSessionView.tsx +0 -242
- package/src/Modal/CreateUserView.tsx +0 -195
- package/src/Modal/ModalHeader.tsx +0 -64
- package/src/Modal/N1WalletModal.tsx +0 -275
- package/src/Modal/NoWhitelistView.tsx +0 -61
- package/src/Modal/Sidebar/N1Sidebar.tsx +0 -172
- package/src/Modal/SigningView.tsx +0 -18
- package/src/Modal/SuccessView.tsx +0 -36
- package/src/Provider/LazyWalletProvider.tsx +0 -136
- package/src/Provider/N1WalletProvider.tsx +0 -208
- package/src/Provider/context.ts +0 -11
- package/src/Provider/hooks.ts +0 -22
- package/src/Provider/icons/CoinbaseWalletIcon.tsx +0 -27
- package/src/Provider/icons/ConnectionDotsSVG.tsx +0 -19
- package/src/Provider/icons/MetamaskIcon.tsx +0 -58
- package/src/Provider/icons/PhantomIcon.tsx +0 -26
- package/src/Provider/icons/UserIcon.tsx +0 -15
- package/src/Provider/icons/WalletConnectIcon.tsx +0 -15
- package/src/Provider/index.ts +0 -3
- package/src/Provider/types.ts +0 -77
- package/src/WidgetButton/N1ConnectButton.tsx +0 -72
- package/src/components/LazyLoadWrapper.tsx +0 -19
- package/src/config.ts +0 -2
- package/src/errors/types.ts +0 -49
- package/src/index.ts +0 -5
- package/src/main.css +0 -3
- package/src/styles/main.css +0 -3
- package/src/utils/lazyLoad.ts +0 -12
- package/src/utils/logger.ts +0 -98
- package/src/utils/react-shim.js +0 -8
- package/tailwind.config.js +0 -44
- package/tsconfig.json +0 -21
- /package/dist/{Common/NIcon.d.ts → components/WalletDeposit/types.js} +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { ANIMATION_EASE } from './constants';
|
|
4
|
+
var formatButtonText = function (text) {
|
|
5
|
+
return text.split('').join(' ');
|
|
6
|
+
};
|
|
7
|
+
export var AnimatedButton = function (_a) {
|
|
8
|
+
var onClick = _a.onClick, text = _a.text, isTyping = _a.isTyping, _b = _a.disabled, disabled = _b === void 0 ? false : _b, onMouseEnter = _a.onMouseEnter, onMouseLeave = _a.onMouseLeave;
|
|
9
|
+
var _c = useState(false), isHovered = _c[0], setIsHovered = _c[1];
|
|
10
|
+
var _d = useState(false), isPressed = _d[0], setIsPressed = _d[1];
|
|
11
|
+
var handleMouseEnter = function () {
|
|
12
|
+
setIsHovered(true);
|
|
13
|
+
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter();
|
|
14
|
+
};
|
|
15
|
+
var handleMouseLeave = function () {
|
|
16
|
+
setIsHovered(false);
|
|
17
|
+
setIsPressed(false);
|
|
18
|
+
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave();
|
|
19
|
+
};
|
|
20
|
+
return (_jsxs("button", { onClick: disabled ? undefined : onClick, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, onMouseDown: function () { return setIsPressed(true); }, onMouseUp: function () { return setIsPressed(false); }, disabled: disabled, className: "\n group relative w-full overflow-hidden rounded-md border-2 bg-gray-100 dark:bg-neutral-950 py-4 text-center \n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(disabled
|
|
21
|
+
? 'cursor-not-allowed border-gray-200 dark:border-neutral-800 opacity-50'
|
|
22
|
+
: 'cursor-pointer border-gray-200 dark:border-neutral-800 hover:border-gray-400 dark:hover:border-white/60', "\n "), style: {
|
|
23
|
+
transform: isPressed
|
|
24
|
+
? 'scale(0.98)'
|
|
25
|
+
: isHovered
|
|
26
|
+
? 'scale(0.99)'
|
|
27
|
+
: 'scale(1)',
|
|
28
|
+
}, children: [_jsx("div", { className: "relative z-[200] pl-4 isolate", children: _jsx("div", { className: "flex items-center", children: _jsx("span", { className: "\n text-base font-medium tracking-wide transition-colors duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isTyping ? 'text-gray-900 dark:text-white' : 'text-gray-500 dark:text-neutral-400', "\n ").concat(isHovered ? '!text-gray-900 dark:!text-white' : '', "\n "), children: formatButtonText(text) }) }) }), _jsx("div", { className: "\n absolute inset-0 z-10 bg-gradient-to-r from-gray-400/0 via-gray-400/10 dark:from-white/0 dark:via-white/10 to-gray-400/0 dark:to-white/0\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-100 translate-x-full' : 'opacity-0 -translate-x-full', "\n ") }), _jsx("div", { className: "\n absolute inset-0 z-20 \n bg-[url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzIiBoZWlnaHQ9IjMiPgo8cmVjdCB3aWR0aD0iMC41IiBoZWlnaHQ9IjAuNSIgZmlsbD0iI2ZmZmZmZiI+PC9yZWN0Pgo8L3N2Zz4=')]\n [background-size:3px_3px]\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-10 scale-125' : 'opacity-0 scale-100', "\n ").concat(isHovered ? '' : 'animate-grain', "\n pointer-events-none\n ") }), _jsx("div", { className: "\n absolute inset-0 z-10 \n bg-gradient-to-br from-gray-400/15 via-gray-400/5 to-gray-400/10 dark:from-white/15 dark:via-white/5 dark:to-white/10\n transition-all duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-100' : 'opacity-0', "\n pointer-events-none\n ") }), _jsx("div", { className: "\n absolute inset-0 z-30\n bg-gray-400/3 dark:bg-white/3\n transition-opacity duration-300 ".concat(ANIMATION_EASE, "\n ").concat(isHovered ? 'opacity-100' : 'opacity-0', "\n pointer-events-none\n ") })] }));
|
|
29
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function ChainButton(_a) {
|
|
3
|
+
var chain = _a.chain, onClick = _a.onClick;
|
|
4
|
+
return (_jsxs("button", { onClick: function () { return onClick(chain.id); }, className: "flex flex-col items-center justify-center p-6 bg-gray-50 dark:bg-gray-950 border-2 border-gray-100 dark:border-gray-800 hover:border-red-500 dark:hover:border-red-500 hover:bg-red-50/50 dark:hover:bg-gray-900 transition-all duration-200 group rounded-lg", children: [_jsx("img", { src: chain.logo, width: 48, height: 48, alt: chain.name, className: "opacity-90 grayscale group-hover:grayscale-0 group-hover:scale-105 transition-all duration-200" }), _jsx("span", { className: "mt-4 font-medium text-gray-600 dark:text-gray-400 group-hover:text-red-500 dark:group-hover:text-gray-50 transition-colors duration-200", children: chain.name })] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LoadingSquares(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
export function LoadingSquares() {
|
|
4
|
+
return (_jsx("div", { className: "relative w-32 h-32 animate-fade-up", style: { animationDelay: '0.2s' }, children: _jsxs("div", { className: "absolute inset-0 grid grid-cols-2 gap-2", children: [_jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader" }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader", style: { animationDelay: '0.2s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader", style: { animationDelay: '0.4s' } }) }), _jsx("div", { className: "relative bg-white dark:bg-neutral-900 border-2 border-gray-100 dark:border-neutral-800 overflow-hidden", children: _jsx("div", { className: "absolute inset-x-0 bottom-0 h-full bg-main/40 dark:bg-main/20 animate-square-loader", style: { animationDelay: '0.6s' } }) })] }) }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableValues } from '../types';
|
|
2
|
+
interface TransactionTableProps {
|
|
3
|
+
tableValues: TableValues & {
|
|
4
|
+
amount?: {
|
|
5
|
+
text: string;
|
|
6
|
+
visible: boolean;
|
|
7
|
+
typing: boolean;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function TransactionTable({ tableValues, onClose }: TransactionTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function TransactionTable(_a) {
|
|
3
|
+
var tableValues = _a.tableValues, onClose = _a.onClose;
|
|
4
|
+
// Friendly labels for the keys
|
|
5
|
+
var getLabel = function (key) {
|
|
6
|
+
var labels = {
|
|
7
|
+
amount: 'Amount',
|
|
8
|
+
tx: 'Transaction ID',
|
|
9
|
+
from: 'From',
|
|
10
|
+
to: 'To',
|
|
11
|
+
network: 'Network',
|
|
12
|
+
status: 'Status'
|
|
13
|
+
};
|
|
14
|
+
return labels[key] || key;
|
|
15
|
+
};
|
|
16
|
+
// Get appropriate color for values based on key
|
|
17
|
+
var getValueStyles = function (key, value) {
|
|
18
|
+
if (key === 'status') {
|
|
19
|
+
if (value.toLowerCase().includes('success') || value.toLowerCase().includes('confirmed')) {
|
|
20
|
+
return 'text-green-500 dark:text-emerald-500 font-medium';
|
|
21
|
+
}
|
|
22
|
+
if (value.toLowerCase().includes('pending')) {
|
|
23
|
+
return 'text-amber-500 dark:text-amber-400 font-medium';
|
|
24
|
+
}
|
|
25
|
+
if (value.toLowerCase().includes('fail') || value.toLowerCase().includes('error')) {
|
|
26
|
+
return 'text-red-500 dark:text-red-400 font-medium';
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (key === 'tx') {
|
|
30
|
+
return 'text-primary-600 dark:text-primary-400 text-xs ';
|
|
31
|
+
}
|
|
32
|
+
if (key === 'network') {
|
|
33
|
+
return 'text-purple-600 dark:text-purple-400 font-medium';
|
|
34
|
+
}
|
|
35
|
+
if (key === 'from' || key === 'to') {
|
|
36
|
+
return 'text-gray-800 dark:text-gray-200 text-xs ';
|
|
37
|
+
}
|
|
38
|
+
if (key === 'amount') {
|
|
39
|
+
return 'text-green-600 dark:text-emerald-500 font-semibold';
|
|
40
|
+
}
|
|
41
|
+
return 'text-gray-900 dark:text-gray-50 font-medium';
|
|
42
|
+
};
|
|
43
|
+
// Order of fields to display
|
|
44
|
+
var fieldOrder = ['amount', 'status', 'network', 'from', 'to', 'tx'];
|
|
45
|
+
// Sort entries based on fieldOrder
|
|
46
|
+
var sortedEntries = Object.entries(tableValues)
|
|
47
|
+
.sort(function (_a, _b) {
|
|
48
|
+
var keyA = _a[0];
|
|
49
|
+
var keyB = _b[0];
|
|
50
|
+
var indexA = fieldOrder.indexOf(keyA);
|
|
51
|
+
var indexB = fieldOrder.indexOf(keyB);
|
|
52
|
+
return (indexA === -1 ? 999 : indexA) - (indexB === -1 ? 999 : indexB);
|
|
53
|
+
});
|
|
54
|
+
return (_jsxs("div", { className: "relative w-full h-full bg-gray-100 dark:bg-gray-950 border border-gray-200 dark:border-gray-800 p-5 rounded-sm flex flex-col justify-center", children: [onClose && (_jsx("button", { onClick: onClose, className: "absolute top-3 right-2 text-gray-500 dark:text-gray-600 hover:text-gray-500 dark:hover:text-gray-300 transition-colors duration-200 focus:outline-none", "aria-label": "Close details", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })), _jsx("div", { className: "space-y-3 text-sm pt-5", children: sortedEntries.map(function (_a) {
|
|
55
|
+
var key = _a[0], value = _a[1];
|
|
56
|
+
return (_jsxs("div", { className: "flex items-center justify-between py-2 ", children: [_jsx("span", { className: "text-gray-500 dark:text-gray-400 font-medium min-w-[120px]", children: getLabel(key) }), _jsxs("div", { className: "relative transition-all duration-300 ".concat(value.visible ? 'opacity-100' : 'opacity-0', " max-w-[65%] text-right flex-1"), children: [_jsx("span", { className: "".concat(getValueStyles(key, value.text), " break-all inline-block"), children: value.text }), value.typing && (_jsx("span", { className: "inline-block ml-1 w-[2px] h-[14px] bg-primary-500 dark:bg-primary-400 animate-pulse" }))] })] }, key));
|
|
57
|
+
}) })] }));
|
|
58
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { LoadingSquares } from './LoadingSquares';
|
|
3
|
+
export function WaitingMessage(_a) {
|
|
4
|
+
var message = _a.message;
|
|
5
|
+
return (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 space-y-6", children: [_jsx(LoadingSquares, {}), _jsxs("div", { className: "space-y-2 text-center w-[300px]", children: [_jsxs("h3", { className: "text-xl text-gray-800 dark:text-white transition-all duration-300 h-[32px] flex items-center justify-center relative font-semibold", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Waiting for transaction" }), _jsx("div", { className: "absolute min-w-[280px]", children: message.visible && message.title })] }), _jsxs("p", { className: "text-sm text-gray-600 dark:text-neutral-400 h-[20px] flex items-center justify-center relative", children: [_jsx("span", { className: "opacity-0 absolute select-none", "aria-hidden": "true", children: "Please sign the transaction in your wallet" }), _jsx("div", { className: "absolute min-w-[280px]", children: message.visible && message.subtitle })] })] })] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ANIMATION_EASE = "cubic-bezier(0.16, 1, 0.3, 1)";
|
|
2
|
+
export declare const TYPING_INTERVAL = 50;
|
|
3
|
+
export declare const ANIMATION_DURATION = 3000;
|
|
4
|
+
export declare const MIN_DEPOSIT = 1;
|
|
5
|
+
export declare const MAX_DEPOSIT = 10000;
|
|
6
|
+
export declare const INITIAL_APPS: {
|
|
7
|
+
name: string;
|
|
8
|
+
color: string;
|
|
9
|
+
progress: number;
|
|
10
|
+
}[];
|
|
11
|
+
export declare const CHAINS: {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
logo: string;
|
|
15
|
+
}[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var ANIMATION_EASE = 'cubic-bezier(0.16, 1, 0.3, 1)';
|
|
2
|
+
export var TYPING_INTERVAL = 50;
|
|
3
|
+
export var ANIMATION_DURATION = 3000;
|
|
4
|
+
export var MIN_DEPOSIT = 1;
|
|
5
|
+
export var MAX_DEPOSIT = 10000;
|
|
6
|
+
export var INITIAL_APPS = Array.from({ length: 20 }, function (_, i) { return ({
|
|
7
|
+
name: "App".concat(i + 1),
|
|
8
|
+
color: '#ff2b1f',
|
|
9
|
+
progress: 0,
|
|
10
|
+
}); });
|
|
11
|
+
export var CHAINS = [
|
|
12
|
+
{
|
|
13
|
+
id: 'ethereum',
|
|
14
|
+
name: 'Ethereum',
|
|
15
|
+
logo: '/images/chains/ethereum.svg',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: 'polygon',
|
|
19
|
+
name: 'Polygon',
|
|
20
|
+
logo: '/images/chains/polygon.svg',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'arbitrum',
|
|
24
|
+
name: 'Arbitrum',
|
|
25
|
+
logo: '/images/chains/arbitrum.svg',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'optimism',
|
|
29
|
+
name: 'Optimism',
|
|
30
|
+
logo: '/images/chains/optimism.svg',
|
|
31
|
+
},
|
|
32
|
+
];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import { TableValues, WaitingMessageState } from './types';
|
|
3
|
+
import { ButtonStates } from './AnimatedButton';
|
|
4
|
+
export declare function useButtonTyping(buttonStates: ButtonStates, setButtonStates: Dispatch<SetStateAction<ButtonStates>>): void;
|
|
5
|
+
export declare function useWaitingMessage(isSigningView: boolean, isWaitingForTx: boolean, setIsWaitingForTx: Dispatch<SetStateAction<boolean>>, setIsSuccessView: Dispatch<SetStateAction<boolean>>, setIsSigningView: Dispatch<SetStateAction<boolean>>): {
|
|
6
|
+
waitingMessage: WaitingMessageState;
|
|
7
|
+
setHasError: Dispatch<SetStateAction<boolean>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function useTableValues(isSuccessView: boolean, selectedChain: string | null): TableValues;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { useState, useEffect } from 'react';
|
|
13
|
+
import { TYPING_INTERVAL, CHAINS } from './constants';
|
|
14
|
+
var BUTTON_CONFIGS = {
|
|
15
|
+
deposit: { text: 'Deposit' },
|
|
16
|
+
continue: { text: 'Continue' },
|
|
17
|
+
openApp: { text: 'Launch' },
|
|
18
|
+
};
|
|
19
|
+
export function useButtonTyping(buttonStates, setButtonStates) {
|
|
20
|
+
useEffect(function () {
|
|
21
|
+
Object.entries(buttonStates).forEach(function (_a) {
|
|
22
|
+
var key = _a[0], state = _a[1];
|
|
23
|
+
if (state.isTyping) {
|
|
24
|
+
var config_1 = BUTTON_CONFIGS[key];
|
|
25
|
+
var index_1 = 0;
|
|
26
|
+
var interval_1 = setInterval(function () {
|
|
27
|
+
if (index_1 <= config_1.text.length) {
|
|
28
|
+
setButtonStates(function (prev) {
|
|
29
|
+
var _a;
|
|
30
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = __assign(__assign({}, prev[key]), { text: config_1.text.slice(0, index_1) }), _a)));
|
|
31
|
+
});
|
|
32
|
+
index_1++;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
clearInterval(interval_1);
|
|
36
|
+
}
|
|
37
|
+
}, TYPING_INTERVAL);
|
|
38
|
+
return function () { return clearInterval(interval_1); };
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, [buttonStates, setButtonStates]);
|
|
42
|
+
}
|
|
43
|
+
export function useWaitingMessage(isSigningView, isWaitingForTx, setIsWaitingForTx, setIsSuccessView, setIsSigningView) {
|
|
44
|
+
var _a = useState({
|
|
45
|
+
title: '',
|
|
46
|
+
subtitle: '',
|
|
47
|
+
visible: false,
|
|
48
|
+
isTyping: false,
|
|
49
|
+
}), waitingMessage = _a[0], setWaitingMessage = _a[1];
|
|
50
|
+
var _b = useState(false), hasError = _b[0], setHasError = _b[1];
|
|
51
|
+
useEffect(function () {
|
|
52
|
+
if (isSigningView && !isWaitingForTx) {
|
|
53
|
+
var messages_1 = [
|
|
54
|
+
{
|
|
55
|
+
title: 'Waiting for signature',
|
|
56
|
+
subtitle: 'Please sign the transaction in your wallet',
|
|
57
|
+
delay: 0,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
title: 'Waiting for transaction',
|
|
61
|
+
subtitle: 'Transaction is being processed...',
|
|
62
|
+
delay: 3000,
|
|
63
|
+
},
|
|
64
|
+
];
|
|
65
|
+
var currentMessageIndex = 0;
|
|
66
|
+
var showMessage_1 = function (message) {
|
|
67
|
+
var index = 0;
|
|
68
|
+
var interval = setInterval(function () {
|
|
69
|
+
if (index <= Math.max(message.title.length, message.subtitle.length)) {
|
|
70
|
+
setWaitingMessage({
|
|
71
|
+
title: message.title.slice(0, index),
|
|
72
|
+
subtitle: message.subtitle.slice(0, index),
|
|
73
|
+
visible: true,
|
|
74
|
+
isTyping: true,
|
|
75
|
+
});
|
|
76
|
+
index++;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
clearInterval(interval);
|
|
80
|
+
setWaitingMessage({
|
|
81
|
+
title: message.title,
|
|
82
|
+
subtitle: message.subtitle,
|
|
83
|
+
visible: true,
|
|
84
|
+
isTyping: false,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
}, TYPING_INTERVAL);
|
|
88
|
+
return interval;
|
|
89
|
+
};
|
|
90
|
+
var currentInterval_1 = showMessage_1(messages_1[currentMessageIndex]);
|
|
91
|
+
var messageTimeout_1 = setTimeout(function () {
|
|
92
|
+
clearInterval(currentInterval_1);
|
|
93
|
+
currentInterval_1 = showMessage_1(messages_1[1]);
|
|
94
|
+
setTimeout(function () {
|
|
95
|
+
setIsWaitingForTx(true);
|
|
96
|
+
setTimeout(function () {
|
|
97
|
+
if (!hasError) {
|
|
98
|
+
setIsSuccessView(true);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
setWaitingMessage({
|
|
102
|
+
title: 'Transaction Failed',
|
|
103
|
+
subtitle: 'Please try again',
|
|
104
|
+
visible: true,
|
|
105
|
+
isTyping: false,
|
|
106
|
+
});
|
|
107
|
+
setTimeout(function () {
|
|
108
|
+
setIsWaitingForTx(false);
|
|
109
|
+
setIsSigningView(false);
|
|
110
|
+
}, 2000);
|
|
111
|
+
}
|
|
112
|
+
}, 4000);
|
|
113
|
+
}, 4000);
|
|
114
|
+
}, messages_1[1].delay);
|
|
115
|
+
return function () {
|
|
116
|
+
clearInterval(currentInterval_1);
|
|
117
|
+
clearTimeout(messageTimeout_1);
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
}, [
|
|
121
|
+
isSigningView,
|
|
122
|
+
isWaitingForTx,
|
|
123
|
+
setIsWaitingForTx,
|
|
124
|
+
setIsSuccessView,
|
|
125
|
+
hasError,
|
|
126
|
+
setIsSigningView,
|
|
127
|
+
]);
|
|
128
|
+
return { waitingMessage: waitingMessage, setHasError: setHasError };
|
|
129
|
+
}
|
|
130
|
+
export function useTableValues(isSuccessView, selectedChain) {
|
|
131
|
+
var _a = useState({
|
|
132
|
+
tx: { text: '', visible: false, typing: false },
|
|
133
|
+
from: { text: '', visible: false, typing: false },
|
|
134
|
+
to: { text: '', visible: false, typing: false },
|
|
135
|
+
network: { text: '', visible: false, typing: false },
|
|
136
|
+
status: { text: '', visible: false, typing: false },
|
|
137
|
+
}), tableValues = _a[0], setTableValues = _a[1];
|
|
138
|
+
useEffect(function () {
|
|
139
|
+
if (isSuccessView) {
|
|
140
|
+
var chain = CHAINS.find(function (c) { return c.id === selectedChain; });
|
|
141
|
+
var values = {
|
|
142
|
+
tx: '0x1234...5678',
|
|
143
|
+
from: '0xabcd...ef01',
|
|
144
|
+
to: '0x2345...6789',
|
|
145
|
+
network: (chain === null || chain === void 0 ? void 0 : chain.name) || 'Unknown',
|
|
146
|
+
status: 'Success',
|
|
147
|
+
};
|
|
148
|
+
Object.entries(values).forEach(function (_a, index) {
|
|
149
|
+
var key = _a[0], value = _a[1];
|
|
150
|
+
setTimeout(function () {
|
|
151
|
+
var textIndex = 0;
|
|
152
|
+
setTableValues(function (prev) {
|
|
153
|
+
var _a;
|
|
154
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = __assign(__assign({}, prev[key]), { visible: true }), _a)));
|
|
155
|
+
});
|
|
156
|
+
var interval = setInterval(function () {
|
|
157
|
+
if (textIndex <= value.length) {
|
|
158
|
+
setTableValues(function (prev) {
|
|
159
|
+
var _a;
|
|
160
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = {
|
|
161
|
+
text: value.slice(0, textIndex),
|
|
162
|
+
visible: true,
|
|
163
|
+
typing: true,
|
|
164
|
+
}, _a)));
|
|
165
|
+
});
|
|
166
|
+
textIndex++;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
clearInterval(interval);
|
|
170
|
+
setTableValues(function (prev) {
|
|
171
|
+
var _a;
|
|
172
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[key] = {
|
|
173
|
+
text: value,
|
|
174
|
+
visible: true,
|
|
175
|
+
typing: false,
|
|
176
|
+
}, _a)));
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}, TYPING_INTERVAL);
|
|
180
|
+
}, index * 500);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
}, [isSuccessView, selectedChain]);
|
|
184
|
+
return tableValues;
|
|
185
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function WalletDeposit(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
|
+
import { ArrowLeft, X } from 'lucide-react';
|
|
14
|
+
import { useState } from 'react';
|
|
15
|
+
import Logo from '../Logo';
|
|
16
|
+
import { INITIAL_APPS } from './constants';
|
|
17
|
+
import { useButtonTyping, useTableValues, useWaitingMessage } from './hooks';
|
|
18
|
+
import { AmountInputScreen } from './screens/AmountInputScreen';
|
|
19
|
+
import { AppsTableScreen } from './screens/AppsTableScreen';
|
|
20
|
+
import { ChainSelectionScreen } from './screens/ChainSelectionScreen';
|
|
21
|
+
import { InitialScreen } from './screens/InitialScreen';
|
|
22
|
+
import { SigningScreen } from './screens/SigningScreen';
|
|
23
|
+
import { SuccessScreen } from './screens/SuccessScreen';
|
|
24
|
+
export default function WalletDeposit() {
|
|
25
|
+
// View states
|
|
26
|
+
var _a = useState(null), selectedChain = _a[0], setSelectedChain = _a[1];
|
|
27
|
+
var _b = useState(''), amount = _b[0], setAmount = _b[1];
|
|
28
|
+
var _c = useState(false), isSigningView = _c[0], setIsSigningView = _c[1];
|
|
29
|
+
var _d = useState(false), isSuccessView = _d[0], setIsSuccessView = _d[1];
|
|
30
|
+
var _e = useState(false), isClosing = _e[0], setIsClosing = _e[1];
|
|
31
|
+
var _f = useState(false), showChainSelect = _f[0], setShowChainSelect = _f[1];
|
|
32
|
+
var _g = useState(true), showInitialScreen = _g[0], setShowInitialScreen = _g[1];
|
|
33
|
+
var _h = useState(false), isWaitingForTx = _h[0], setIsWaitingForTx = _h[1];
|
|
34
|
+
var _j = useState(false), showAppsTable = _j[0], setShowAppsTable = _j[1];
|
|
35
|
+
var _k = useState(INITIAL_APPS), apps = _k[0], setApps = _k[1];
|
|
36
|
+
var _l = useState(false), showModal = _l[0], setShowModal = _l[1];
|
|
37
|
+
var _m = useState(0), blurIntensity = _m[0], setBlurIntensity = _m[1];
|
|
38
|
+
// Animation states
|
|
39
|
+
var _o = useState({
|
|
40
|
+
deposit: { text: '', isTyping: false, showCursor: false },
|
|
41
|
+
continue: { text: '', isTyping: false, showCursor: false },
|
|
42
|
+
openApp: { text: '', isTyping: false, showCursor: false },
|
|
43
|
+
}), buttonStates = _o[0], setButtonStates = _o[1];
|
|
44
|
+
// Custom hooks
|
|
45
|
+
useButtonTyping(buttonStates, setButtonStates);
|
|
46
|
+
var _p = useWaitingMessage(isSigningView, isWaitingForTx, setIsWaitingForTx, setIsSuccessView, setIsSigningView), waitingMessage = _p.waitingMessage, setHasError = _p.setHasError;
|
|
47
|
+
var tableValues = useTableValues(isSuccessView, selectedChain);
|
|
48
|
+
// Event handlers
|
|
49
|
+
var handleClose = function () {
|
|
50
|
+
setIsClosing(true);
|
|
51
|
+
setTimeout(function () {
|
|
52
|
+
setShowAppsTable(true);
|
|
53
|
+
var completedApps = 0;
|
|
54
|
+
var totalApps = apps.length;
|
|
55
|
+
setTimeout(function () {
|
|
56
|
+
var blurInterval = setInterval(function () {
|
|
57
|
+
setBlurIntensity(function (prev) {
|
|
58
|
+
if (prev < 3)
|
|
59
|
+
return prev + 0.15;
|
|
60
|
+
clearInterval(blurInterval);
|
|
61
|
+
return prev;
|
|
62
|
+
});
|
|
63
|
+
}, 50);
|
|
64
|
+
}, 1400);
|
|
65
|
+
apps.forEach(function (_, index) {
|
|
66
|
+
setTimeout(function () {
|
|
67
|
+
var progress = 0;
|
|
68
|
+
var progressInterval = setInterval(function () {
|
|
69
|
+
if (progress < 100) {
|
|
70
|
+
progress += 1;
|
|
71
|
+
setApps(function (prevApps) {
|
|
72
|
+
return prevApps.map(function (app, i) {
|
|
73
|
+
return i === index ? __assign(__assign({}, app), { progress: progress }) : app;
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
clearInterval(progressInterval);
|
|
79
|
+
completedApps++;
|
|
80
|
+
if (completedApps === Math.floor(totalApps * 0.8)) {
|
|
81
|
+
setShowModal(true);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}, 5);
|
|
85
|
+
}, index * 150);
|
|
86
|
+
});
|
|
87
|
+
}, 700);
|
|
88
|
+
};
|
|
89
|
+
var handleButtonMouseEnter = function (buttonKey) {
|
|
90
|
+
setButtonStates(function (prev) {
|
|
91
|
+
var _a;
|
|
92
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[buttonKey] = { text: '', isTyping: true, showCursor: true }, _a)));
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
var handleButtonMouseLeave = function (buttonKey) {
|
|
96
|
+
setButtonStates(function (prev) {
|
|
97
|
+
var _a;
|
|
98
|
+
return (__assign(__assign({}, prev), (_a = {}, _a[buttonKey] = { text: '', isTyping: false, showCursor: false }, _a)));
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
if (showAppsTable) {
|
|
102
|
+
return (_jsx("div", { className: "fixed inset-0 bg-white dark:bg-black flex items-center justify-center z-50 font-era overflow-auto", children: _jsx(AppsTableScreen, { apps: apps, blurIntensity: blurIntensity, showModal: showModal }) }));
|
|
103
|
+
}
|
|
104
|
+
return (_jsx("div", { className: "fixed inset-0 bg-gray-50 dark:bg-gray-950 flex items-center justify-center z-50 font-era overflow-auto", children: _jsxs("div", { className: "bg-gray-50 dark:bg-gray-950 relative border border-gray-200 dark:border-gray-800 rounded-md transition-[max-width,transform,opacity] duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] w-full ".concat(!showChainSelect
|
|
105
|
+
? 'max-w-sm'
|
|
106
|
+
: isSigningView || isSuccessView
|
|
107
|
+
? 'max-w-2xl'
|
|
108
|
+
: 'max-w-lg', " ").concat(isClosing ? 'animate-fade-out' : 'animate-fade-in', " m-4 origin-center will-change-[max-width,transform,opacity]"), children: [_jsxs("div", { className: "flex justify-between items-center p-6 ".concat(showInitialScreen ? '' : 'border-b border-gray-200 dark:border-gray-800', " rounded-t-md"), children: [_jsx("div", { className: "flex items-center gap-4", children: !showChainSelect ? (_jsx("div", { className: "w-6 h-6 opacity-0" })) : (_jsxs(_Fragment, { children: [selectedChain && !isSigningView && !isSuccessView && (_jsx("button", { onClick: function () {
|
|
109
|
+
if (showChainSelect && !amount) {
|
|
110
|
+
setSelectedChain(null);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
setShowChainSelect(false);
|
|
114
|
+
setAmount('');
|
|
115
|
+
}
|
|
116
|
+
}, className: "text-gray-500 hover:text-main dark:text-gray-400 dark:hover:text-main transition-colors duration-200", children: _jsx(ArrowLeft, { size: 20 }) })), _jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "w-6 h-6 text-gray-50", children: _jsx(Logo, { size: 24 }) }), _jsxs("h2", { className: "text-xl text-gray-400 flex items-center gap-2 ml-2", children: ["Deposit", selectedChain && !isSigningView && !isSuccessView && (_jsx("span", { className: "text-gray-700 font-normal", children: "/ / Amount" })), isSigningView && !isSuccessView && (_jsx("span", { className: "text-gray-700 font-normal", children: "/ / Sign" })), isSuccessView && (_jsx("span", { className: "text-gray-700 font-normal", children: "/ / Success" }))] })] })] })) }), _jsx("button", { onClick: handleClose, className: "text-neutral-400 hover:text-main transition-colors duration-200 h-6 flex items-center", children: _jsx(X, { size: 20 }) })] }), _jsxs("div", { className: "p-6 overflow-hidden relative transition-[height] duration-[3000ms] delay-500 ease-in-out", children: [_jsx("div", { className: "transition-all duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] ".concat(!showInitialScreen
|
|
117
|
+
? 'opacity-0 -translate-y-[120%] absolute inset-x-6 pointer-events-none'
|
|
118
|
+
: 'opacity-100 translate-y-0 pointer-events-auto animate-content-appear'), children: _jsx(InitialScreen, { onStart: function () {
|
|
119
|
+
setShowInitialScreen(false);
|
|
120
|
+
setShowChainSelect(true);
|
|
121
|
+
}, buttonStates: buttonStates, onButtonMouseEnter: handleButtonMouseEnter, onButtonMouseLeave: handleButtonMouseLeave }) }), _jsx("div", { className: "transition-all duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] ".concat(!showChainSelect || selectedChain
|
|
122
|
+
? 'opacity-0 -translate-x-[120%] absolute inset-x-6 pointer-events-none'
|
|
123
|
+
: 'opacity-100 translate-x-0 pointer-events-auto animate-content-appear'), children: _jsx(ChainSelectionScreen, { onChainSelect: function (chainId) {
|
|
124
|
+
setSelectedChain(chainId);
|
|
125
|
+
setShowChainSelect(true);
|
|
126
|
+
} }) }), _jsx("div", { className: "transition-all duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] ".concat(!showChainSelect ||
|
|
127
|
+
!selectedChain ||
|
|
128
|
+
isSigningView ||
|
|
129
|
+
isSuccessView
|
|
130
|
+
? 'opacity-0 translate-x-[120%] absolute inset-x-6 pointer-events-none'
|
|
131
|
+
: 'opacity-100 translate-x-0 pointer-events-auto animate-content-appear'), children: _jsx(AmountInputScreen, { amount: amount, onAmountChange: setAmount, onContinue: function () { return setIsSigningView(true); }, balance: 100, buttonStates: buttonStates, onButtonMouseEnter: handleButtonMouseEnter, onButtonMouseLeave: handleButtonMouseLeave }) }), _jsx("div", { className: "transition-all duration-[3000ms] ease-[cubic-bezier(0.16,1,0.3,1)] ".concat(!isSigningView || isSuccessView
|
|
132
|
+
? 'opacity-0 translate-x-[120%] absolute inset-x-6 pointer-events-none'
|
|
133
|
+
: 'opacity-100 translate-x-0 pointer-events-auto'), children: _jsx(SigningScreen, { waitingMessage: waitingMessage }) }), _jsx("div", { className: "transition-all duration-[800ms] ease-[cubic-bezier(0.16,1,0.3,1)] ".concat(!isSuccessView
|
|
134
|
+
? 'opacity-0 translate-x-[120%] absolute inset-x-6 pointer-events-none'
|
|
135
|
+
: 'opacity-100 translate-x-0 pointer-events-auto'), children: _jsx(SuccessScreen, { amount: amount, tableValues: tableValues, onOpenApp: handleClose, buttonStates: buttonStates, onButtonMouseEnter: handleButtonMouseEnter, onButtonMouseLeave: handleButtonMouseLeave }) })] })] }) }));
|
|
136
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ButtonStates } from '../AnimatedButton';
|
|
2
|
+
interface AmountInputScreenProps {
|
|
3
|
+
amount: string;
|
|
4
|
+
onAmountChange: (amount: string) => void;
|
|
5
|
+
onContinue: () => void;
|
|
6
|
+
balance: number;
|
|
7
|
+
buttonStates: ButtonStates;
|
|
8
|
+
onButtonMouseEnter: (buttonKey: 'deposit' | 'continue' | 'openApp') => void;
|
|
9
|
+
onButtonMouseLeave: (buttonKey: 'deposit' | 'continue' | 'openApp') => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function AmountInputScreen({ amount, onAmountChange, onContinue, balance, buttonStates, onButtonMouseEnter, onButtonMouseLeave, }: AmountInputScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { AnimatedButton } from '../AnimatedButton';
|
|
4
|
+
import { MIN_DEPOSIT, MAX_DEPOSIT } from '../constants';
|
|
5
|
+
export function AmountInputScreen(_a) {
|
|
6
|
+
var amount = _a.amount, onAmountChange = _a.onAmountChange, onContinue = _a.onContinue, balance = _a.balance, buttonStates = _a.buttonStates, onButtonMouseEnter = _a.onButtonMouseEnter, onButtonMouseLeave = _a.onButtonMouseLeave;
|
|
7
|
+
var handleAmountChange = function (e) {
|
|
8
|
+
var value = e.target.value;
|
|
9
|
+
if (/^\d*\.?\d*$/.test(value)) {
|
|
10
|
+
onAmountChange(value);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var isValidAmount = amount !== '' &&
|
|
14
|
+
Number(amount) >= MIN_DEPOSIT &&
|
|
15
|
+
Number(amount) <= MAX_DEPOSIT &&
|
|
16
|
+
Number(amount) <= balance;
|
|
17
|
+
return (_jsxs("div", { className: "space-y-8", children: [_jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("span", { className: "text-sm text-gray-500 dark:text-neutral-400", children: "Amount" }), _jsxs("span", { className: "text-sm text-gray-500 dark:text-neutral-400", children: ["Balance: ", balance, " USDC"] })] }), _jsxs("div", { className: "relative", children: [_jsx("input", { type: "text", value: amount, onChange: handleAmountChange, placeholder: "0.00", className: "w-full bg-white dark:bg-neutral-950 border-2 border-gray-100 dark:border-neutral-800 rounded-md px-4 py-3 text-gray-900 dark:text-white placeholder-gray-400 dark:placeholder-neutral-500 focus:outline-none focus:ring-0 focus:border-main dark:focus:border-main transition-colors duration-200" }), _jsxs("div", { className: "absolute right-4 top-1/2 -translate-y-1/2 flex items-center gap-2", children: [_jsx("img", { src: "/images/tokens/usdc.svg", width: 20, height: 20, alt: "USDC" }), _jsx("span", { className: "text-gray-400 dark:text-neutral-500", children: "USDC" })] })] }), _jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("span", { className: "text-xs text-gray-400 dark:text-neutral-500", children: ["Min: ", MIN_DEPOSIT, " USDC"] }), _jsxs("span", { className: "text-xs text-gray-400 dark:text-neutral-500", children: ["Max: ", MAX_DEPOSIT, " USDC"] })] })] }), _jsx(AnimatedButton, { onClick: onContinue, text: "Continue", isTyping: buttonStates.continue.isTyping, disabled: !isValidAmount, onMouseEnter: function () { return onButtonMouseEnter('continue'); }, onMouseLeave: function () { return onButtonMouseLeave('continue'); } })] }));
|
|
18
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { App } from '../types';
|
|
2
|
+
interface AppsTableScreenProps {
|
|
3
|
+
apps: App[];
|
|
4
|
+
blurIntensity: number;
|
|
5
|
+
showModal: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function AppsTableScreen({ apps, blurIntensity, showModal, }: AppsTableScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import Logo from '../../Logo';
|
|
3
|
+
export function AppsTableScreen(_a) {
|
|
4
|
+
var apps = _a.apps, blurIntensity = _a.blurIntensity, showModal = _a.showModal;
|
|
5
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "grid grid-cols-4 gap-4 w-full min-h-full p-8 pb-32 animate-fade-in", children: apps.map(function (app, index) { return (_jsxs("div", { className: "relative h-[200px] overflow-hidden bg-white dark:bg-neutral-950/50 border border-gray-100 dark:border-neutral-800/50 rounded-lg", style: {
|
|
6
|
+
opacity: (app.progress / 100) * 0.6,
|
|
7
|
+
transform: "scale(".concat(0.8 + app.progress / 500, ")"),
|
|
8
|
+
borderColor: 'rgb(var(--main-color), 0.5)',
|
|
9
|
+
borderStyle: 'solid',
|
|
10
|
+
borderWidth: "".concat((app.progress / 100) * 1, "px"),
|
|
11
|
+
transition: 'all 800ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
12
|
+
filter: "blur(".concat(blurIntensity, "px)"),
|
|
13
|
+
}, children: [_jsx("div", { className: "absolute inset-0 opacity-0 transition-all duration-800 ease-[cubic-bezier(0.16,1,0.3,1)]", style: {
|
|
14
|
+
opacity: app.progress / 2000,
|
|
15
|
+
background: 'rgb(var(--main-color))',
|
|
16
|
+
} }), _jsxs("div", { className: "absolute inset-0 flex flex-col", style: {
|
|
17
|
+
opacity: (app.progress / 100) * 0.7,
|
|
18
|
+
transform: "scale(".concat(0.9 + app.progress / 1000, ")"),
|
|
19
|
+
transition: 'all 800ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
20
|
+
}, children: [_jsx("div", { className: "h-[1px] w-full bg-gradient-to-r from-transparent via-main/50 dark:via-main/70 to-transparent" }), _jsxs("div", { className: "flex-1 p-4 flex flex-col justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "w-1 h-1 bg-main/50 dark:bg-main/70" }), _jsx("div", { className: "h-[1px] w-12 bg-gradient-to-r from-main/50 dark:from-main/70 to-transparent" })] }), _jsx("div", { className: "flex items-center justify-center", children: _jsx("div", { className: "w-16 h-16 border-2 border-main/50 dark:border-main/70", style: {
|
|
21
|
+
transform: "rotate(".concat(app.progress * 3.6, "deg)"),
|
|
22
|
+
transition: 'transform 800ms cubic-bezier(0.16, 1, 0.3, 1)',
|
|
23
|
+
} }) }), _jsxs("div", { className: "flex items-center justify-end gap-2", children: [_jsx("div", { className: "h-[1px] w-12 bg-gradient-to-l from-main/50 dark:from-main/70 to-transparent" }), _jsx("div", { className: "w-1 h-1 bg-main/50 dark:bg-main/70" })] })] })] })] }, app.name)); }) }), showModal && (_jsx("div", { className: "fixed inset-0 pointer-events-none flex items-center justify-center z-100 brightness-125", children: _jsx("div", { className: "relative border-2 border-gray-100 dark:border-neutral-900 bg-white/90 dark:bg-neutral-950 backdrop-blur-sm rounded-lg transform transition-all duration-500 p-4 -mt-64", style: {
|
|
24
|
+
opacity: 0,
|
|
25
|
+
animation: 'fadeIn 3s cubic-bezier(0.16, 1, 0.3, 1) forwards',
|
|
26
|
+
animationDelay: '1.4s',
|
|
27
|
+
}, children: _jsxs("div", { className: "relative px-8 py-4", children: [_jsx("div", { className: "absolute -top-2 -left-2 w-2 h-2 bg-main/50 dark:bg-neutral-900" }), _jsx("div", { className: "absolute -top-2 -right-2 w-2 h-2 bg-main/50 dark:bg-neutral-900" }), _jsx("div", { className: "absolute -bottom-2 -left-2 w-2 h-2 bg-main/50 dark:bg-neutral-900" }), _jsx("div", { className: "absolute -bottom-2 -right-2 w-2 h-2 bg-main/50 dark:bg-neutral-900" }), _jsx("div", { className: "flex flex-col items-center gap-3", children: _jsxs("h2", { className: "text-xl font-medium tracking-wide text-gray-800 dark:text-neutral-200 flex justify-center items-end", children: [_jsx("span", { className: "text-main/90 dark:text-white/80 px-1", children: "\u2728" }), ' ', "Build something magical on", _jsx("div", { className: "pb-0.5 pl-1", children: _jsx(Logo, { size: 28 }) }), _jsx("span", { className: "text-main/90 dark:text-white/60 px-1", children: "\u2728" })] }) })] }) }) }))] }));
|
|
28
|
+
}
|