@n1xyz/wallet-widget 0.0.34 → 0.0.35-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/dist/bridge-assist/cctp-solana.d.ts +33 -0
- package/dist/bridge-assist/cctp-solana.js +392 -0
- package/dist/bridge-assist/cctp-solana.js.map +1 -0
- package/dist/main.css +1 -2
- package/dist/src/adapters/evm.d.ts +39 -0
- package/dist/src/adapters/evm.js +338 -0
- package/dist/src/adapters/evm.js.map +1 -0
- package/dist/src/adapters/factory.d.ts +37 -0
- package/dist/src/adapters/factory.js +82 -0
- package/dist/src/adapters/factory.js.map +1 -0
- package/dist/src/adapters/index.d.ts +33 -0
- package/dist/src/adapters/index.js +36 -0
- package/dist/src/adapters/index.js.map +1 -0
- package/dist/src/adapters/solana.d.ts +37 -0
- package/dist/src/adapters/solana.js +359 -0
- package/dist/src/adapters/solana.js.map +1 -0
- package/dist/src/adapters/types.d.ts +160 -0
- package/dist/src/adapters/types.js +20 -0
- package/dist/src/adapters/types.js.map +1 -0
- package/dist/src/animations/N1Loader.js.map +1 -0
- package/dist/src/animations/N1Loader.json +1 -0
- package/dist/src/animations/Processing.js.map +1 -0
- package/dist/src/animations/Processing.json +1 -0
- package/dist/{components → src/components}/LoadingFallback.d.ts +3 -0
- package/dist/{components → src/components}/LoadingFallback.js +3 -0
- package/dist/src/components/LoadingFallback.js.map +1 -0
- package/dist/{components → src/components}/Logo.d.ts +4 -0
- package/dist/{components → src/components}/Logo.js +4 -0
- package/dist/src/components/Logo.js.map +1 -0
- package/dist/src/components/N1ConnectButton.d.ts +13 -0
- package/dist/src/components/N1ConnectButton.js +66 -0
- package/dist/src/components/N1ConnectButton.js.map +1 -0
- package/dist/src/components/logos/ArbitrumLogo.js.map +1 -0
- package/dist/src/components/logos/BaseLogo.js +6 -0
- package/dist/src/components/logos/BaseLogo.js.map +1 -0
- package/dist/src/components/logos/BeraLogo.js.map +1 -0
- package/dist/src/components/logos/BitcoinLogo.js.map +1 -0
- package/dist/src/components/logos/EthereumLogo.js.map +1 -0
- package/dist/{components → src/components}/logos/HyperliquidLogo.js +1 -1
- package/dist/src/components/logos/HyperliquidLogo.js.map +1 -0
- package/dist/src/components/logos/OptimismLogo.js.map +1 -0
- package/dist/src/components/logos/SolanaLogo.js.map +1 -0
- package/dist/src/components/logos/ZeroOneLogo.js.map +1 -0
- package/dist/src/components/logos/index.js.map +1 -0
- package/dist/src/config/chains.d.ts +18 -0
- package/dist/src/config/chains.js +58 -0
- package/dist/src/config/chains.js.map +1 -0
- package/dist/src/config/dynamic.js +18 -0
- package/dist/src/config/dynamic.js.map +1 -0
- package/dist/src/config/solana.js.map +1 -0
- package/dist/src/config/turnkey.d.ts +2 -0
- package/dist/{config → src/config}/turnkey.js +9 -12
- package/dist/src/config/turnkey.js.map +1 -0
- package/dist/src/context/n1-wallet-context.js.map +1 -0
- package/dist/src/errors/types.d.ts +72 -0
- package/dist/src/errors/types.js +140 -0
- package/dist/src/errors/types.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/N1WalletModal.js +44 -29
- package/dist/src/features/onboarding-flow/N1WalletModal.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/OnboardingFlow.d.ts +2 -1
- package/dist/{features → src/features}/onboarding-flow/OnboardingFlow.js +54 -8
- package/dist/src/features/onboarding-flow/OnboardingFlow.js.map +1 -0
- package/dist/src/features/onboarding-flow/bridge-assist/client.d.ts +42 -0
- package/dist/src/features/onboarding-flow/bridge-assist/client.js +268 -0
- package/dist/src/features/onboarding-flow/bridge-assist/client.js.map +1 -0
- package/dist/src/features/onboarding-flow/bridge-assist/config.d.ts +4 -0
- package/dist/src/features/onboarding-flow/bridge-assist/config.js +11 -0
- package/dist/src/features/onboarding-flow/bridge-assist/config.js.map +1 -0
- package/dist/src/features/onboarding-flow/bridge-assist/index.d.ts +1 -0
- package/dist/src/features/onboarding-flow/bridge-assist/index.js +2 -0
- package/dist/src/features/onboarding-flow/bridge-assist/index.js.map +1 -0
- package/dist/src/features/onboarding-flow/bridge-assist/types.d.ts +5 -0
- package/dist/src/features/onboarding-flow/bridge-assist/types.js +28 -0
- package/dist/src/features/onboarding-flow/bridge-assist/types.js.map +1 -0
- package/dist/src/features/onboarding-flow/cctp/bridgeKitClient.d.ts +35 -0
- package/dist/src/features/onboarding-flow/cctp/bridgeKitClient.js +391 -0
- package/dist/src/features/onboarding-flow/cctp/bridgeKitClient.js.map +1 -0
- package/dist/src/features/onboarding-flow/cctp/clientFactory.d.ts +6 -0
- package/dist/src/features/onboarding-flow/cctp/clientFactory.js +9 -0
- package/dist/src/features/onboarding-flow/cctp/clientFactory.js.map +1 -0
- package/dist/src/features/onboarding-flow/cctp/config.d.ts +16 -0
- package/dist/src/features/onboarding-flow/cctp/config.js +55 -0
- package/dist/src/features/onboarding-flow/cctp/config.js.map +1 -0
- package/dist/src/features/onboarding-flow/cctp/mockCctpClient.d.ts +11 -0
- package/dist/src/features/onboarding-flow/cctp/mockCctpClient.js +85 -0
- package/dist/src/features/onboarding-flow/cctp/mockCctpClient.js.map +1 -0
- package/dist/src/features/onboarding-flow/cctp/solanaClaim.d.ts +1 -0
- package/dist/src/features/onboarding-flow/cctp/solanaClaim.js +2 -0
- package/dist/src/features/onboarding-flow/cctp/solanaClaim.js.map +1 -0
- package/dist/src/features/onboarding-flow/cctp/types.d.ts +50 -0
- package/dist/src/features/onboarding-flow/cctp/types.js +2 -0
- package/dist/src/features/onboarding-flow/cctp/types.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/components/ChainButton.d.ts +5 -2
- package/dist/src/features/onboarding-flow/components/ChainButton.js +14 -0
- package/dist/src/features/onboarding-flow/components/ChainButton.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/components/Header.d.ts +2 -2
- package/dist/src/features/onboarding-flow/components/Header.js +69 -0
- package/dist/src/features/onboarding-flow/components/Header.js.map +1 -0
- package/dist/src/features/onboarding-flow/components/ImageWithFallback.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/components/TransactionTable.d.ts +5 -0
- package/dist/{features → src/features}/onboarding-flow/components/TransactionTable.js +8 -3
- package/dist/src/features/onboarding-flow/components/TransactionTable.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/components/WaitingMessage.d.ts +4 -0
- package/dist/src/features/onboarding-flow/components/WaitingMessage.js.map +1 -0
- package/dist/src/features/onboarding-flow/components/index.js.map +1 -0
- package/dist/src/features/onboarding-flow/errors/depositError.d.ts +36 -0
- package/dist/src/features/onboarding-flow/errors/depositError.js +134 -0
- package/dist/src/features/onboarding-flow/errors/depositError.js.map +1 -0
- package/dist/src/features/onboarding-flow/hooks/useBridgeDeposit.d.ts +35 -0
- package/dist/src/features/onboarding-flow/hooks/useBridgeDeposit.js +585 -0
- package/dist/src/features/onboarding-flow/hooks/useBridgeDeposit.js.map +1 -0
- package/dist/src/features/onboarding-flow/hooks/useDepositAuth.d.ts +6 -0
- package/dist/src/features/onboarding-flow/hooks/useDepositAuth.js +141 -0
- package/dist/src/features/onboarding-flow/hooks/useDepositAuth.js.map +1 -0
- package/dist/src/features/onboarding-flow/hooks/useDepositHydration.d.ts +15 -0
- package/dist/src/features/onboarding-flow/hooks/useDepositHydration.js +83 -0
- package/dist/src/features/onboarding-flow/hooks/useDepositHydration.js.map +1 -0
- package/dist/src/features/onboarding-flow/hooks/usePendingDepositState.d.ts +6 -0
- package/dist/src/features/onboarding-flow/hooks/usePendingDepositState.js +45 -0
- package/dist/src/features/onboarding-flow/hooks/usePendingDepositState.js.map +1 -0
- package/dist/src/features/onboarding-flow/hooks/useSolanaDeposit.d.ts +13 -0
- package/dist/src/features/onboarding-flow/hooks/useSolanaDeposit.js +161 -0
- package/dist/src/features/onboarding-flow/hooks/useSolanaDeposit.js.map +1 -0
- package/dist/src/features/onboarding-flow/index.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/providers/DepositFlowProvider.d.ts +10 -3
- package/dist/src/features/onboarding-flow/providers/DepositFlowProvider.js +762 -0
- package/dist/src/features/onboarding-flow/providers/DepositFlowProvider.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/providers/OnboardingStateProvider.d.ts +5 -0
- package/dist/src/features/onboarding-flow/providers/OnboardingStateProvider.js +399 -0
- package/dist/src/features/onboarding-flow/providers/OnboardingStateProvider.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/providers/StateProvider.d.ts +2 -2
- package/dist/{features → src/features}/onboarding-flow/providers/StateProvider.js +2 -2
- package/dist/src/features/onboarding-flow/providers/StateProvider.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/providers/WalletConnectionProvider.d.ts +8 -0
- package/dist/src/features/onboarding-flow/providers/WalletConnectionProvider.js +938 -0
- package/dist/src/features/onboarding-flow/providers/WalletConnectionProvider.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/providers/debug.js +5 -1
- package/dist/src/features/onboarding-flow/providers/debug.js.map +1 -0
- package/dist/src/features/onboarding-flow/providers/index.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/providers/onboardingStateMachine.d.ts +28 -1
- package/dist/{features → src/features}/onboarding-flow/providers/onboardingStateMachine.js +38 -4
- package/dist/src/features/onboarding-flow/providers/onboardingStateMachine.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/00-EntrySelectionScreen.d.ts +4 -0
- package/dist/src/features/onboarding-flow/screens/00-EntrySelectionScreen.js +32 -0
- package/dist/src/features/onboarding-flow/screens/00-EntrySelectionScreen.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/01-ConnectWalletScreen.d.ts +5 -0
- package/dist/{features → src/features}/onboarding-flow/screens/01-ConnectWalletScreen.js +5 -0
- package/dist/src/features/onboarding-flow/screens/01-ConnectWalletScreen.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/screens/02-TurnkeyAuthScreen.js +8 -1
- package/dist/src/features/onboarding-flow/screens/02-TurnkeyAuthScreen.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/screens/03-TurnkeyPreparingScreen.js +8 -1
- package/dist/src/features/onboarding-flow/screens/03-TurnkeyPreparingScreen.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/screens/04-ChainSelectionScreen.d.ts +11 -11
- package/dist/{features → src/features}/onboarding-flow/screens/04-ChainSelectionScreen.js +59 -29
- package/dist/src/features/onboarding-flow/screens/04-ChainSelectionScreen.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/05-AmountInputScreen.d.ts +11 -0
- package/dist/src/features/onboarding-flow/screens/05-AmountInputScreen.js +585 -0
- package/dist/src/features/onboarding-flow/screens/05-AmountInputScreen.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/screens/06-DepositProgressScreen.d.ts +5 -0
- package/dist/src/features/onboarding-flow/screens/06-DepositProgressScreen.js +367 -0
- package/dist/src/features/onboarding-flow/screens/06-DepositProgressScreen.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/07-DepositSuccessScreen.d.ts +6 -0
- package/dist/{features → src/features}/onboarding-flow/screens/07-DepositSuccessScreen.js +11 -5
- package/dist/src/features/onboarding-flow/screens/07-DepositSuccessScreen.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/08-AuthLoadingScreen.d.ts +5 -0
- package/dist/{features → src/features}/onboarding-flow/screens/08-AuthLoadingScreen.js +5 -1
- package/dist/src/features/onboarding-flow/screens/08-AuthLoadingScreen.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/09-ErrorScreen.d.ts +5 -0
- package/dist/src/features/onboarding-flow/screens/09-ErrorScreen.js +43 -0
- package/dist/src/features/onboarding-flow/screens/09-ErrorScreen.js.map +1 -0
- package/dist/src/features/onboarding-flow/screens/index.d.ts +10 -0
- package/dist/src/features/onboarding-flow/screens/index.js +11 -0
- package/dist/src/features/onboarding-flow/screens/index.js.map +1 -0
- package/dist/src/features/onboarding-flow/turnkey/turnkeySessionMachine.d.ts +1 -0
- package/dist/src/features/onboarding-flow/turnkey/turnkeySessionMachine.js +2 -0
- package/dist/src/features/onboarding-flow/turnkey/turnkeySessionMachine.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/types.d.ts +38 -11
- package/dist/{features → src/features}/onboarding-flow/types.js +5 -0
- package/dist/src/features/onboarding-flow/types.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/bridgeUtils.d.ts +6 -0
- package/dist/src/features/onboarding-flow/utils/bridgeUtils.js +34 -0
- package/dist/src/features/onboarding-flow/utils/bridgeUtils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/attestationUtils.d.ts +29 -0
- package/dist/src/features/onboarding-flow/utils/deposit/attestationUtils.js +82 -0
- package/dist/src/features/onboarding-flow/utils/deposit/attestationUtils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/bridgeUtils.d.ts +5 -0
- package/dist/src/features/onboarding-flow/utils/deposit/bridgeUtils.js +10 -0
- package/dist/src/features/onboarding-flow/utils/deposit/bridgeUtils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/claimConfirmation.d.ts +14 -0
- package/dist/src/features/onboarding-flow/utils/deposit/claimConfirmation.js +94 -0
- package/dist/src/features/onboarding-flow/utils/deposit/claimConfirmation.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/claimSubmission.d.ts +25 -0
- package/dist/src/features/onboarding-flow/utils/deposit/claimSubmission.js +212 -0
- package/dist/src/features/onboarding-flow/utils/deposit/claimSubmission.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/depositPolling.d.ts +37 -0
- package/dist/src/features/onboarding-flow/utils/deposit/depositPolling.js +199 -0
- package/dist/src/features/onboarding-flow/utils/deposit/depositPolling.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/evmTxInterceptor.d.ts +27 -0
- package/dist/src/features/onboarding-flow/utils/deposit/evmTxInterceptor.js +149 -0
- package/dist/src/features/onboarding-flow/utils/deposit/evmTxInterceptor.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/nonceUtils.d.ts +5 -0
- package/dist/src/features/onboarding-flow/utils/deposit/nonceUtils.js +121 -0
- package/dist/src/features/onboarding-flow/utils/deposit/nonceUtils.js.map +1 -0
- package/dist/{features/onboarding-flow/utils/transaction.d.ts → src/features/onboarding-flow/utils/deposit/solanaDepositTransaction.d.ts} +3 -3
- package/dist/src/features/onboarding-flow/utils/deposit/solanaDepositTransaction.js +8 -0
- package/dist/src/features/onboarding-flow/utils/deposit/solanaDepositTransaction.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/solanaUtils.d.ts +12 -0
- package/dist/src/features/onboarding-flow/utils/deposit/solanaUtils.js +150 -0
- package/dist/src/features/onboarding-flow/utils/deposit/solanaUtils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/storage.d.ts +52 -0
- package/dist/src/features/onboarding-flow/utils/deposit/storage.js +243 -0
- package/dist/src/features/onboarding-flow/utils/deposit/storage.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/deposit/walletUtils.d.ts +36 -0
- package/dist/src/features/onboarding-flow/utils/deposit/walletUtils.js +304 -0
- package/dist/src/features/onboarding-flow/utils/deposit/walletUtils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/depositPolling.d.ts +1 -0
- package/dist/src/features/onboarding-flow/utils/depositPolling.js +3 -0
- package/dist/src/features/onboarding-flow/utils/depositPolling.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/explorerUrl.d.ts +14 -0
- package/dist/src/features/onboarding-flow/utils/explorerUrl.js +44 -0
- package/dist/src/features/onboarding-flow/utils/explorerUrl.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/nordUtils.d.ts +8 -0
- package/dist/{features/onboarding-flow/utils/nordUser.js → src/features/onboarding-flow/utils/nordUtils.js} +14 -1
- package/dist/src/features/onboarding-flow/utils/nordUtils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/pendingDepositCookie.d.ts +13 -0
- package/dist/src/features/onboarding-flow/utils/pendingDepositCookie.js +15 -0
- package/dist/src/features/onboarding-flow/utils/pendingDepositCookie.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/pendingDepositStorage.d.ts +15 -0
- package/dist/src/features/onboarding-flow/utils/pendingDepositStorage.js +94 -0
- package/dist/src/features/onboarding-flow/utils/pendingDepositStorage.js.map +1 -0
- package/dist/{features → src/features}/onboarding-flow/utils/utils.d.ts +9 -2
- package/dist/{features → src/features}/onboarding-flow/utils/utils.js +9 -4
- package/dist/src/features/onboarding-flow/utils/utils.js.map +1 -0
- package/dist/src/features/onboarding-flow/utils/withImageFallback.d.ts +6 -0
- package/dist/{features → src/features}/onboarding-flow/utils/withImageFallback.js +2 -3
- package/dist/src/features/onboarding-flow/utils/withImageFallback.js.map +1 -0
- package/dist/src/hooks/index.js.map +1 -0
- package/dist/src/hooks/useN1Wallet.d.ts +12 -0
- package/dist/{hooks → src/hooks}/useN1Wallet.js +10 -0
- package/dist/src/hooks/useN1Wallet.js.map +1 -0
- package/dist/src/hooks/useNordUserInitialization.d.ts +12 -0
- package/dist/{hooks → src/hooks}/useNordUserInitialization.js +74 -33
- package/dist/src/hooks/useNordUserInitialization.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.js +16 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/providers/LazyWalletProvider.d.ts +4 -0
- package/dist/src/providers/LazyWalletProvider.js +404 -0
- package/dist/src/providers/LazyWalletProvider.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/ContextBridge.d.ts +28 -0
- package/dist/src/providers/N1WalletProvider/ContextBridge.js +273 -0
- package/dist/src/providers/N1WalletProvider/ContextBridge.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/ModalProvider.d.ts +113 -0
- package/dist/src/providers/N1WalletProvider/ModalProvider.js +319 -0
- package/dist/src/providers/N1WalletProvider/ModalProvider.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/NetworkProvider.d.ts +88 -0
- package/dist/src/providers/N1WalletProvider/NetworkProvider.js +252 -0
- package/dist/src/providers/N1WalletProvider/NetworkProvider.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/SessionProvider.d.ts +71 -0
- package/dist/src/providers/N1WalletProvider/SessionProvider.js +187 -0
- package/dist/src/providers/N1WalletProvider/SessionProvider.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/SigningProvider.d.ts +58 -0
- package/dist/src/providers/N1WalletProvider/SigningProvider.js +134 -0
- package/dist/src/providers/N1WalletProvider/SigningProvider.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/ThemingProvider.d.ts +50 -0
- package/dist/src/providers/N1WalletProvider/ThemingProvider.js +102 -0
- package/dist/src/providers/N1WalletProvider/ThemingProvider.js.map +1 -0
- package/dist/src/providers/N1WalletProvider/index.d.ts +21 -0
- package/dist/src/providers/N1WalletProvider/index.js +27 -0
- package/dist/src/providers/N1WalletProvider/index.js.map +1 -0
- package/dist/src/providers/N1WalletProvider.d.ts +17 -0
- package/dist/src/providers/N1WalletProvider.js +102 -0
- package/dist/src/providers/N1WalletProvider.js.map +1 -0
- package/dist/{providers → src/providers}/ShadowRootWrapper.d.ts +4 -0
- package/dist/{providers → src/providers}/ShadowRootWrapper.js +4 -0
- package/dist/src/providers/ShadowRootWrapper.js.map +1 -0
- package/dist/{providers → src/providers}/WalletErrorBoundary.d.ts +7 -2
- package/dist/{providers → src/providers}/WalletErrorBoundary.js +5 -1
- package/dist/src/providers/WalletErrorBoundary.js.map +1 -0
- package/dist/src/services/bootstrap/DepositRecoveryService.d.ts +64 -0
- package/dist/src/services/bootstrap/DepositRecoveryService.js +245 -0
- package/dist/src/services/bootstrap/DepositRecoveryService.js.map +1 -0
- package/dist/src/services/bootstrap/DynamicSdkService.d.ts +62 -0
- package/dist/src/services/bootstrap/DynamicSdkService.js +335 -0
- package/dist/src/services/bootstrap/DynamicSdkService.js.map +1 -0
- package/dist/src/services/bootstrap/SessionBootstrapService.d.ts +78 -0
- package/dist/src/services/bootstrap/SessionBootstrapService.js +280 -0
- package/dist/src/services/bootstrap/SessionBootstrapService.js.map +1 -0
- package/dist/src/services/bootstrap/TurnkeyBootstrapService.d.ts +92 -0
- package/dist/src/services/bootstrap/TurnkeyBootstrapService.js +253 -0
- package/dist/src/services/bootstrap/TurnkeyBootstrapService.js.map +1 -0
- package/dist/src/services/bootstrap/index.d.ts +13 -0
- package/dist/src/services/bootstrap/index.js +16 -0
- package/dist/src/services/bootstrap/index.js.map +1 -0
- package/dist/src/services/bootstrap/types.d.ts +92 -0
- package/dist/src/services/bootstrap/types.js +7 -0
- package/dist/src/services/bootstrap/types.js.map +1 -0
- package/dist/src/services/storage/StorageService.d.ts +98 -0
- package/dist/src/services/storage/StorageService.js +360 -0
- package/dist/src/services/storage/StorageService.js.map +1 -0
- package/dist/src/services/storage/index.d.ts +9 -0
- package/dist/src/services/storage/index.js +10 -0
- package/dist/src/services/storage/index.js.map +1 -0
- package/dist/src/services/storage/keys.d.ts +28 -0
- package/dist/src/services/storage/keys.js +45 -0
- package/dist/src/services/storage/keys.js.map +1 -0
- package/dist/src/services/storage/types.d.ts +73 -0
- package/dist/src/services/storage/types.js +23 -0
- package/dist/src/services/storage/types.js.map +1 -0
- package/dist/src/store/index.d.ts +8 -0
- package/dist/src/store/index.js +24 -0
- package/dist/src/store/index.js.map +1 -0
- package/dist/src/store/selectors.d.ts +105 -0
- package/dist/src/store/selectors.js +183 -0
- package/dist/src/store/selectors.js.map +1 -0
- package/dist/src/store/slices/bootstrapSlice.d.ts +64 -0
- package/dist/src/store/slices/bootstrapSlice.js +78 -0
- package/dist/src/store/slices/bootstrapSlice.js.map +1 -0
- package/dist/src/store/slices/configSlice.d.ts +7 -0
- package/dist/src/store/slices/configSlice.js +14 -0
- package/dist/src/store/slices/configSlice.js.map +1 -0
- package/dist/src/store/slices/index.d.ts +10 -0
- package/dist/src/store/slices/index.js +10 -0
- package/dist/src/store/slices/index.js.map +1 -0
- package/dist/src/store/slices/sessionSlice.d.ts +7 -0
- package/dist/src/store/slices/sessionSlice.js +17 -0
- package/dist/src/store/slices/sessionSlice.js.map +1 -0
- package/dist/src/store/slices/signingSlice.d.ts +7 -0
- package/dist/src/store/slices/signingSlice.js +14 -0
- package/dist/src/store/slices/signingSlice.js.map +1 -0
- package/dist/src/store/slices/uiSlice.d.ts +9 -0
- package/dist/src/store/slices/uiSlice.js +25 -0
- package/dist/src/store/slices/uiSlice.js.map +1 -0
- package/dist/src/store/slices/walletSlice.d.ts +7 -0
- package/dist/src/store/slices/walletSlice.js +21 -0
- package/dist/src/store/slices/walletSlice.js.map +1 -0
- package/dist/src/store/store.d.ts +50 -0
- package/dist/src/store/store.js +259 -0
- package/dist/src/store/store.js.map +1 -0
- package/dist/src/store/subscriptions/depositPersistence.d.ts +32 -0
- package/dist/src/store/subscriptions/depositPersistence.js +106 -0
- package/dist/src/store/subscriptions/depositPersistence.js.map +1 -0
- package/dist/src/store/subscriptions/index.d.ts +34 -0
- package/dist/src/store/subscriptions/index.js +73 -0
- package/dist/src/store/subscriptions/index.js.map +1 -0
- package/dist/src/store/subscriptions/turnkeyPersistence.d.ts +42 -0
- package/dist/src/store/subscriptions/turnkeyPersistence.js +127 -0
- package/dist/src/store/subscriptions/turnkeyPersistence.js.map +1 -0
- package/dist/src/store/types.d.ts +166 -0
- package/dist/src/store/types.js +7 -0
- package/dist/src/store/types.js.map +1 -0
- package/dist/src/styles/cdn-fonts.d.ts +12 -0
- package/dist/src/styles/cdn-fonts.js +63 -0
- package/dist/src/styles/cdn-fonts.js.map +1 -0
- package/dist/src/styles/embedded-main-css.d.ts +2 -0
- package/dist/src/styles/embedded-main-css.js +3 -0
- package/dist/src/styles/embedded-main-css.js.map +1 -0
- package/dist/src/turnkey/TurnkeyProvider.d.ts +21 -0
- package/dist/src/turnkey/TurnkeyProvider.js +695 -0
- package/dist/src/turnkey/TurnkeyProvider.js.map +1 -0
- package/dist/src/turnkey/createTurnkeyWallet.d.ts +39 -0
- package/dist/src/turnkey/createTurnkeyWallet.js +319 -0
- package/dist/src/turnkey/createTurnkeyWallet.js.map +1 -0
- package/dist/src/turnkey/createWalletProvider.d.ts +8 -0
- package/dist/src/turnkey/createWalletProvider.js +286 -0
- package/dist/src/turnkey/createWalletProvider.js.map +1 -0
- package/dist/src/turnkey/index.d.ts +3 -0
- package/dist/src/turnkey/index.js +3 -0
- package/dist/src/turnkey/index.js.map +1 -0
- package/dist/src/turnkey/turnkeySessionMachine.d.ts +39 -0
- package/dist/src/turnkey/turnkeySessionMachine.js +77 -0
- package/dist/src/turnkey/turnkeySessionMachine.js.map +1 -0
- package/dist/src/turnkey/turnkeySessionStorage.d.ts +48 -0
- package/dist/src/turnkey/turnkeySessionStorage.js +183 -0
- package/dist/src/turnkey/turnkeySessionStorage.js.map +1 -0
- package/dist/{turnkey → src/turnkey}/types.d.ts +21 -8
- package/dist/src/turnkey/types.js +12 -0
- package/dist/src/turnkey/types.js.map +1 -0
- package/dist/{types → src/types}/wallet.d.ts +39 -13
- package/dist/src/types/wallet.js.map +1 -0
- package/dist/src/utils/address.d.ts +130 -0
- package/dist/src/utils/address.js +274 -0
- package/dist/src/utils/address.js.map +1 -0
- package/dist/src/utils/chain.d.ts +89 -0
- package/dist/src/utils/chain.js +282 -0
- package/dist/src/utils/chain.js.map +1 -0
- package/dist/{utils → src/utils}/ed25519.d.ts +0 -2
- package/dist/{utils → src/utils}/ed25519.js +4 -19
- package/dist/src/utils/ed25519.js.map +1 -0
- package/dist/src/utils/errors.d.ts +68 -0
- package/dist/src/utils/errors.js +190 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/events.d.ts +124 -0
- package/dist/src/utils/events.js +155 -0
- package/dist/src/utils/events.js.map +1 -0
- package/dist/src/utils/formatAmount.d.ts +4 -0
- package/dist/src/utils/formatAmount.js +9 -0
- package/dist/src/utils/formatAmount.js.map +1 -0
- package/dist/src/utils/logger.d.ts +45 -0
- package/dist/{utils → src/utils}/logger.js +68 -2
- package/dist/src/utils/logger.js.map +1 -0
- package/dist/src/utils/shortenString.d.ts +5 -0
- package/dist/src/utils/shortenString.js +16 -0
- package/dist/src/utils/shortenString.js.map +1 -0
- package/package.json +37 -15
- package/dist/animations/N1Loader.js.map +0 -1
- package/dist/animations/Processing.js.map +0 -1
- package/dist/components/LoadingFallback.js.map +0 -1
- package/dist/components/Logo.js.map +0 -1
- package/dist/components/N1ConnectButton.d.ts +0 -5
- package/dist/components/N1ConnectButton.js +0 -49
- package/dist/components/N1ConnectButton.js.map +0 -1
- package/dist/components/logos/ArbitrumLogo.js.map +0 -1
- package/dist/components/logos/BaseLogo.js +0 -6
- package/dist/components/logos/BaseLogo.js.map +0 -1
- package/dist/components/logos/BeraLogo.js.map +0 -1
- package/dist/components/logos/BitcoinLogo.js.map +0 -1
- package/dist/components/logos/EthereumLogo.js.map +0 -1
- package/dist/components/logos/HyperliquidLogo.js.map +0 -1
- package/dist/components/logos/OptimismLogo.js.map +0 -1
- package/dist/components/logos/SolanaLogo.js.map +0 -1
- package/dist/components/logos/ZeroOneLogo.js.map +0 -1
- package/dist/components/logos/index.js.map +0 -1
- package/dist/config/chains.d.ts +0 -0
- package/dist/config/chains.js +0 -2
- package/dist/config/chains.js.map +0 -1
- package/dist/config/dynamic.js +0 -13
- package/dist/config/dynamic.js.map +0 -1
- package/dist/config/solana.js.map +0 -1
- package/dist/config/turnkey.d.ts +0 -2
- package/dist/config/turnkey.js.map +0 -1
- package/dist/config.d.ts +0 -2
- package/dist/config.js +0 -3
- package/dist/config.js.map +0 -1
- package/dist/context/n1-wallet-context.js.map +0 -1
- package/dist/errors/types.d.ts +0 -25
- package/dist/errors/types.js +0 -77
- package/dist/errors/types.js.map +0 -1
- package/dist/features/onboarding-flow/N1WalletModal.js.map +0 -1
- package/dist/features/onboarding-flow/OnboardingFlow.js.map +0 -1
- package/dist/features/onboarding-flow/components/ChainButton.js +0 -21
- package/dist/features/onboarding-flow/components/ChainButton.js.map +0 -1
- package/dist/features/onboarding-flow/components/Header.js +0 -45
- package/dist/features/onboarding-flow/components/Header.js.map +0 -1
- package/dist/features/onboarding-flow/components/ImageWithFallback.js.map +0 -1
- package/dist/features/onboarding-flow/components/TransactionTable.js.map +0 -1
- package/dist/features/onboarding-flow/components/WaitingMessage.js.map +0 -1
- package/dist/features/onboarding-flow/components/index.js.map +0 -1
- package/dist/features/onboarding-flow/index.js.map +0 -1
- package/dist/features/onboarding-flow/providers/DepositFlowProvider.js +0 -525
- package/dist/features/onboarding-flow/providers/DepositFlowProvider.js.map +0 -1
- package/dist/features/onboarding-flow/providers/OnboardingStateProvider.js +0 -185
- package/dist/features/onboarding-flow/providers/OnboardingStateProvider.js.map +0 -1
- package/dist/features/onboarding-flow/providers/StateProvider.js.map +0 -1
- package/dist/features/onboarding-flow/providers/WalletConnectionProvider.js +0 -394
- package/dist/features/onboarding-flow/providers/WalletConnectionProvider.js.map +0 -1
- package/dist/features/onboarding-flow/providers/debug.js.map +0 -1
- package/dist/features/onboarding-flow/providers/index.js.map +0 -1
- package/dist/features/onboarding-flow/providers/onboardingStateMachine.js.map +0 -1
- package/dist/features/onboarding-flow/screens/01-ConnectWalletScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/01-ConnectWalletScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/02-ChainSelectionScreen.d.ts +0 -31
- package/dist/features/onboarding-flow/screens/02-ChainSelectionScreen.js +0 -100
- package/dist/features/onboarding-flow/screens/02-ChainSelectionScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/02-TurnkeyAuthScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/03-AmountInputScreen.d.ts +0 -6
- package/dist/features/onboarding-flow/screens/03-AmountInputScreen.js +0 -360
- package/dist/features/onboarding-flow/screens/03-AmountInputScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/03-TurnkeyPreparingScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/04-ChainSelectionScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/04-DepositProgressScreen.d.ts +0 -3
- package/dist/features/onboarding-flow/screens/04-DepositProgressScreen.js +0 -31
- package/dist/features/onboarding-flow/screens/04-DepositProgressScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/05-AmountInputScreen.d.ts +0 -6
- package/dist/features/onboarding-flow/screens/05-AmountInputScreen.js +0 -360
- package/dist/features/onboarding-flow/screens/05-AmountInputScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/05-DepositSuccessScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/05-DepositSuccessScreen.js +0 -136
- package/dist/features/onboarding-flow/screens/05-DepositSuccessScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/06-AuthLoadingScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/06-AuthLoadingScreen.js +0 -31
- package/dist/features/onboarding-flow/screens/06-AuthLoadingScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/06-DepositProgressScreen.js +0 -31
- package/dist/features/onboarding-flow/screens/06-DepositProgressScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/07-DepositSuccessScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/07-DepositSuccessScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/07-ErrorScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/07-ErrorScreen.js +0 -14
- package/dist/features/onboarding-flow/screens/07-ErrorScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/08-AuthLoadingScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/08-AuthLoadingScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/08-TurnkeyAuthScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/08-TurnkeyAuthScreen.js +0 -18
- package/dist/features/onboarding-flow/screens/08-TurnkeyAuthScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/09-ErrorScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/09-ErrorScreen.js +0 -14
- package/dist/features/onboarding-flow/screens/09-ErrorScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/09-TurnkeyPreparingScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/09-TurnkeyPreparingScreen.js +0 -18
- package/dist/features/onboarding-flow/screens/09-TurnkeyPreparingScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/TurnkeyAuthScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/TurnkeyAuthScreen.js +0 -18
- package/dist/features/onboarding-flow/screens/TurnkeyAuthScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/TurnkeyPreparingScreen.d.ts +0 -1
- package/dist/features/onboarding-flow/screens/TurnkeyPreparingScreen.js +0 -18
- package/dist/features/onboarding-flow/screens/TurnkeyPreparingScreen.js.map +0 -1
- package/dist/features/onboarding-flow/screens/index.d.ts +0 -7
- package/dist/features/onboarding-flow/screens/index.js +0 -8
- package/dist/features/onboarding-flow/screens/index.js.map +0 -1
- package/dist/features/onboarding-flow/types.js.map +0 -1
- package/dist/features/onboarding-flow/utils/depositStorage.d.ts +0 -4
- package/dist/features/onboarding-flow/utils/depositStorage.js +0 -48
- package/dist/features/onboarding-flow/utils/depositStorage.js.map +0 -1
- package/dist/features/onboarding-flow/utils/imageUtils.d.ts +0 -21
- package/dist/features/onboarding-flow/utils/imageUtils.js +0 -110
- package/dist/features/onboarding-flow/utils/imageUtils.js.map +0 -1
- package/dist/features/onboarding-flow/utils/nordUser.d.ts +0 -1
- package/dist/features/onboarding-flow/utils/nordUser.js.map +0 -1
- package/dist/features/onboarding-flow/utils/nordUtils.d.ts +0 -40
- package/dist/features/onboarding-flow/utils/nordUtils.js +0 -64
- package/dist/features/onboarding-flow/utils/nordUtils.js.map +0 -1
- package/dist/features/onboarding-flow/utils/session.d.ts +0 -17
- package/dist/features/onboarding-flow/utils/session.js +0 -69
- package/dist/features/onboarding-flow/utils/session.js.map +0 -1
- package/dist/features/onboarding-flow/utils/transaction.js +0 -8
- package/dist/features/onboarding-flow/utils/transaction.js.map +0 -1
- package/dist/features/onboarding-flow/utils/utils.js.map +0 -1
- package/dist/features/onboarding-flow/utils/withImageFallback.d.ts +0 -7
- package/dist/features/onboarding-flow/utils/withImageFallback.js.map +0 -1
- package/dist/features/turnkey/createTurnkeyWallet.d.ts +0 -25
- package/dist/features/turnkey/createTurnkeyWallet.js +0 -119
- package/dist/features/turnkey/createTurnkeyWallet.js.map +0 -1
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useN1Wallet.d.ts +0 -2
- package/dist/hooks/useN1Wallet.js.map +0 -1
- package/dist/hooks/useNordUserInitialization.d.ts +0 -1
- package/dist/hooks/useNordUserInitialization.js.map +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/index.js +0 -8
- package/dist/index.js.map +0 -1
- package/dist/polyfills/windowEthereumGuard.d.ts +0 -6
- package/dist/polyfills/windowEthereumGuard.js +0 -28
- package/dist/polyfills/windowEthereumGuard.js.map +0 -1
- package/dist/providers/LazyWalletProvider.d.ts +0 -1
- package/dist/providers/LazyWalletProvider.js +0 -230
- package/dist/providers/LazyWalletProvider.js.map +0 -1
- package/dist/providers/N1WalletProvider.d.ts +0 -3
- package/dist/providers/N1WalletProvider.js +0 -267
- package/dist/providers/N1WalletProvider.js.map +0 -1
- package/dist/providers/ShadowRootWrapper.js.map +0 -1
- package/dist/providers/TurnkeyProviderBridge.d.ts +0 -7
- package/dist/providers/TurnkeyProviderBridge.js +0 -20
- package/dist/providers/TurnkeyProviderBridge.js.map +0 -1
- package/dist/providers/WalletErrorBoundary.js.map +0 -1
- package/dist/styles/embedded-main-css.d.ts +0 -2
- package/dist/styles/embedded-main-css.js +0 -3
- package/dist/styles/embedded-main-css.js.map +0 -1
- package/dist/turnkey/TurnkeyProvider.d.ts +0 -9
- package/dist/turnkey/TurnkeyProvider.js +0 -378
- package/dist/turnkey/TurnkeyProvider.js.map +0 -1
- package/dist/turnkey/createWalletProvider.d.ts +0 -3
- package/dist/turnkey/createWalletProvider.js +0 -180
- package/dist/turnkey/createWalletProvider.js.map +0 -1
- package/dist/turnkey/index.d.ts +0 -3
- package/dist/turnkey/index.js +0 -3
- package/dist/turnkey/index.js.map +0 -1
- package/dist/turnkey/types.js +0 -8
- package/dist/turnkey/types.js.map +0 -1
- package/dist/types/wallet.js.map +0 -1
- package/dist/utils/ed25519.js.map +0 -1
- package/dist/utils/getPseudoName.d.ts +0 -1
- package/dist/utils/getPseudoName.js +0 -5826
- package/dist/utils/getPseudoName.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -21
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/shortenString.d.ts +0 -2
- package/dist/utils/shortenString.js +0 -9
- package/dist/utils/shortenString.js.map +0 -1
- package/dist/utils/turnkeySessionStorage.d.ts +0 -3
- package/dist/utils/turnkeySessionStorage.js +0 -33
- package/dist/utils/turnkeySessionStorage.js.map +0 -1
- package/dist/utils/words.d.ts +0 -9
- package/dist/utils/words.js +0 -93572
- package/dist/utils/words.js.map +0 -1
- /package/dist/{animations → src/animations}/N1Loader.d.ts +0 -0
- /package/dist/{animations → src/animations}/N1Loader.js +0 -0
- /package/dist/{animations → src/animations}/Processing.d.ts +0 -0
- /package/dist/{animations → src/animations}/Processing.js +0 -0
- /package/dist/{components → src/components}/logos/ArbitrumLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/ArbitrumLogo.js +0 -0
- /package/dist/{components → src/components}/logos/BaseLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/BeraLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/BeraLogo.js +0 -0
- /package/dist/{components → src/components}/logos/BitcoinLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/BitcoinLogo.js +0 -0
- /package/dist/{components → src/components}/logos/EthereumLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/EthereumLogo.js +0 -0
- /package/dist/{components → src/components}/logos/HyperliquidLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/OptimismLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/OptimismLogo.js +0 -0
- /package/dist/{components → src/components}/logos/SolanaLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/SolanaLogo.js +0 -0
- /package/dist/{components → src/components}/logos/ZeroOneLogo.d.ts +0 -0
- /package/dist/{components → src/components}/logos/ZeroOneLogo.js +0 -0
- /package/dist/{components → src/components}/logos/index.d.ts +0 -0
- /package/dist/{components → src/components}/logos/index.js +0 -0
- /package/dist/{config → src/config}/dynamic.d.ts +0 -0
- /package/dist/{config → src/config}/solana.d.ts +0 -0
- /package/dist/{config → src/config}/solana.js +0 -0
- /package/dist/{context → src/context}/n1-wallet-context.d.ts +0 -0
- /package/dist/{context → src/context}/n1-wallet-context.js +0 -0
- /package/dist/{features → src/features}/onboarding-flow/N1WalletModal.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/components/ImageWithFallback.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/components/ImageWithFallback.js +0 -0
- /package/dist/{features → src/features}/onboarding-flow/components/WaitingMessage.js +0 -0
- /package/dist/{features → src/features}/onboarding-flow/components/index.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/components/index.js +0 -0
- /package/dist/{features → src/features}/onboarding-flow/index.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/index.js +0 -0
- /package/dist/{features → src/features}/onboarding-flow/providers/debug.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/providers/index.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/providers/index.js +0 -0
- /package/dist/{features → src/features}/onboarding-flow/screens/02-TurnkeyAuthScreen.d.ts +0 -0
- /package/dist/{features → src/features}/onboarding-flow/screens/03-TurnkeyPreparingScreen.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/index.d.ts +0 -0
- /package/dist/{hooks → src/hooks}/index.js +0 -0
- /package/dist/{types → src/types}/wallet.js +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
12
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var delay = function (ms) { return new Promise(function (r) { return setTimeout(r, ms); }); };
|
|
38
|
+
var MockCctpClient = /** @class */ (function () {
|
|
39
|
+
function MockCctpClient(opts) {
|
|
40
|
+
if (opts === void 0) { opts = {}; }
|
|
41
|
+
this.opts = opts;
|
|
42
|
+
}
|
|
43
|
+
MockCctpClient.prototype.submitBridge = function (params) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
45
|
+
var bridgeTxId;
|
|
46
|
+
var _a;
|
|
47
|
+
return __generator(this, function (_b) {
|
|
48
|
+
switch (_b.label) {
|
|
49
|
+
case 0: return [4 /*yield*/, delay((_a = this.opts.submitDelayMs) !== null && _a !== void 0 ? _a : 0)];
|
|
50
|
+
case 1:
|
|
51
|
+
_b.sent();
|
|
52
|
+
bridgeTxId = "bridge-".concat(Date.now());
|
|
53
|
+
return [2 /*return*/, {
|
|
54
|
+
bridgeTxId: bridgeTxId,
|
|
55
|
+
depositId: "".concat(params.fromChain, "-").concat(bridgeTxId),
|
|
56
|
+
attestationId: "att-".concat(bridgeTxId),
|
|
57
|
+
}];
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
MockCctpClient.prototype.waitForConfirmation = function (bridgeTxId, _attestationId) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
var _a;
|
|
65
|
+
return __generator(this, function (_b) {
|
|
66
|
+
switch (_b.label) {
|
|
67
|
+
case 0: return [4 /*yield*/, delay((_a = this.opts.confirmDelayMs) !== null && _a !== void 0 ? _a : 0)];
|
|
68
|
+
case 1:
|
|
69
|
+
_b.sent();
|
|
70
|
+
return [2 /*return*/, { mintTxId: "mint-".concat(bridgeTxId) }];
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
};
|
|
75
|
+
MockCctpClient.prototype.getAttestation = function (_txHash, _fromChain) {
|
|
76
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
+
return __generator(this, function (_a) {
|
|
78
|
+
return [2 /*return*/, null];
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
return MockCctpClient;
|
|
83
|
+
}());
|
|
84
|
+
export { MockCctpClient };
|
|
85
|
+
//# sourceMappingURL=mockCctpClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mockCctpClient.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/cctp/mockCctpClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,IAAM,KAAK,GAAG,UAAC,EAAU,IAAK,OAAA,IAAI,OAAO,CAAC,UAAC,CAAC,IAAK,OAAA,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,EAAjB,CAAiB,CAAC,EAArC,CAAqC,CAAC;AAEpE;IACE,wBACmB,IAGX;QAHW,qBAAA,EAAA,SAGX;QAHW,SAAI,GAAJ,IAAI,CAGf;IACL,CAAC;IAEE,qCAAY,GAAlB,UAAmB,MAAwB;;;;;;4BACzC,qBAAM,KAAK,CAAC,MAAA,IAAI,CAAC,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,EAAA;;wBAAzC,SAAyC,CAAC;wBACpC,UAAU,GAAG,iBAAU,IAAI,CAAC,GAAG,EAAE,CAAE,CAAC;wBAC1C,sBAAO;gCACL,UAAU,YAAA;gCACV,SAAS,EAAE,UAAG,MAAM,CAAC,SAAS,cAAI,UAAU,CAAE;gCAC9C,aAAa,EAAE,cAAO,UAAU,CAAE;6BACnC,EAAC;;;;KACH;IAEK,4CAAmB,GAAzB,UACE,UAAkB,EAClB,cAA8B;;;;;4BAE9B,qBAAM,KAAK,CAAC,MAAA,IAAI,CAAC,IAAI,CAAC,cAAc,mCAAI,CAAC,CAAC,EAAA;;wBAA1C,SAA0C,CAAC;wBAC3C,sBAAO,EAAE,QAAQ,EAAE,eAAQ,UAAU,CAAE,EAAE,EAAC;;;;KAC3C;IAEK,uCAAc,GAApB,UAAqB,OAAe,EAAE,UAAkB;;;gBACtD,sBAAO,IAAI,EAAC;;;KACb;IACH,qBAAC;AAAD,CAAC,AA7BD,IA6BC","sourcesContent":["import type { CctpBridgeParams, CctpBridgeResult, CctpClient, CctpConfirmationResult } from './types';\n\nconst delay = (ms: number) => new Promise((r) => setTimeout(r, ms));\n\nexport class MockCctpClient implements CctpClient {\n constructor(\n private readonly opts: {\n submitDelayMs?: number;\n confirmDelayMs?: number;\n } = {}\n ) {}\n\n async submitBridge(params: CctpBridgeParams): Promise<CctpBridgeResult> {\n await delay(this.opts.submitDelayMs ?? 0);\n const bridgeTxId = `bridge-${Date.now()}`;\n return {\n bridgeTxId,\n depositId: `${params.fromChain}-${bridgeTxId}`,\n attestationId: `att-${bridgeTxId}`,\n };\n }\n\n async waitForConfirmation(\n bridgeTxId: string,\n _attestationId?: string | null\n ): Promise<CctpConfirmationResult> {\n await delay(this.opts.confirmDelayMs ?? 0);\n return { mintTxId: `mint-${bridgeTxId}` };\n }\n\n async getAttestation(_txHash: string, _fromChain: string) {\n return null;\n }\n}\n\n\n\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { constructCctpClaimTx, hashVersionedTransaction } from '../../../../bridge-assist/cctp-solana';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solanaClaim.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/cctp/solanaClaim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC","sourcesContent":["export { constructCctpClaimTx, hashVersionedTransaction } from '../../../../bridge-assist/cctp-solana';\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for CCTP (Circle Cross-Chain Transfer Protocol) bridge operations.
|
|
3
|
+
*/
|
|
4
|
+
export interface CctpBridgeParams {
|
|
5
|
+
amount: string;
|
|
6
|
+
fromChain: string;
|
|
7
|
+
toChain: string;
|
|
8
|
+
destinationAddress: string;
|
|
9
|
+
minAmount?: number;
|
|
10
|
+
maxAmount?: number;
|
|
11
|
+
wallet?: any;
|
|
12
|
+
}
|
|
13
|
+
export interface CctpBridgeResult {
|
|
14
|
+
bridgeTxId: string;
|
|
15
|
+
depositId: string;
|
|
16
|
+
attestationId?: string | null;
|
|
17
|
+
explorerUrl?: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface CctpConfirmationResult {
|
|
20
|
+
mintTxId: string;
|
|
21
|
+
explorerUrl?: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface CctpAttestationResult {
|
|
24
|
+
attestation: string;
|
|
25
|
+
message: string;
|
|
26
|
+
decodedMessage?: {
|
|
27
|
+
sourceDomain: string;
|
|
28
|
+
destinationDomain: string;
|
|
29
|
+
nonce: string;
|
|
30
|
+
sender: string;
|
|
31
|
+
recipient: string;
|
|
32
|
+
decodedMessageBody?: {
|
|
33
|
+
mintRecipient?: string;
|
|
34
|
+
amount?: string;
|
|
35
|
+
burnToken?: string;
|
|
36
|
+
messageSender?: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface CctpClient {
|
|
41
|
+
submitBridge: (params: CctpBridgeParams) => Promise<CctpBridgeResult>;
|
|
42
|
+
waitForConfirmation: (bridgeTxId: string, attestationId?: string | null) => Promise<CctpConfirmationResult>;
|
|
43
|
+
getAttestation: (txHash: string, fromChain: string) => Promise<CctpAttestationResult | null>;
|
|
44
|
+
}
|
|
45
|
+
export interface CctpConfig {
|
|
46
|
+
enabled?: boolean;
|
|
47
|
+
useMock?: boolean;
|
|
48
|
+
fromChain?: string;
|
|
49
|
+
toChain?: string;
|
|
50
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/cctp/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Type definitions for CCTP (Circle Cross-Chain Transfer Protocol) bridge operations.\n */\nexport interface CctpBridgeParams {\n amount: string;\n fromChain: string;\n toChain: string;\n destinationAddress: string;\n minAmount?: number;\n maxAmount?: number;\n wallet?: any;\n}\n\nexport interface CctpBridgeResult {\n bridgeTxId: string;\n depositId: string;\n attestationId?: string | null;\n explorerUrl?: string | null;\n}\n\nexport interface CctpConfirmationResult {\n mintTxId: string;\n explorerUrl?: string | null;\n}\n\nexport interface CctpAttestationResult {\n attestation: string;\n message: string;\n decodedMessage?: {\n sourceDomain: string;\n destinationDomain: string;\n nonce: string;\n sender: string;\n recipient: string;\n decodedMessageBody?: {\n mintRecipient?: string;\n amount?: string;\n burnToken?: string;\n messageSender?: string;\n };\n };\n}\n\nexport interface CctpClient {\n submitBridge: (params: CctpBridgeParams) => Promise<CctpBridgeResult>;\n waitForConfirmation: (\n bridgeTxId: string,\n attestationId?: string | null\n ) => Promise<CctpConfirmationResult>;\n getAttestation: (txHash: string, fromChain: string) => Promise<CctpAttestationResult | null>;\n}\n\nexport interface CctpConfig {\n enabled?: boolean;\n useMock?: boolean;\n fromChain?: string;\n toChain?: string;\n}\n"]}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable button component for selecting a blockchain chain.
|
|
3
|
+
* Displays chain logo, name, optional subtitle, and selection indicator.
|
|
4
|
+
*/
|
|
1
5
|
import { Chain } from "../types";
|
|
2
6
|
interface ChainButtonProps {
|
|
3
7
|
chain: Chain;
|
|
4
8
|
onClick: (chainId: string) => void;
|
|
5
9
|
selected?: boolean;
|
|
6
|
-
soon?: boolean;
|
|
7
10
|
subtitle?: string;
|
|
8
11
|
}
|
|
9
|
-
export declare function ChainButton({ chain, onClick, selected,
|
|
12
|
+
export declare function ChainButton({ chain, onClick, selected, subtitle, }: ChainButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ImageWithFallback } from "./ImageWithFallback";
|
|
3
|
+
export function ChainButton(_a) {
|
|
4
|
+
var chain = _a.chain, onClick = _a.onClick, _b = _a.selected, selected = _b === void 0 ? false : _b, subtitle = _a.subtitle;
|
|
5
|
+
var handleClick = function () {
|
|
6
|
+
onClick(chain.id);
|
|
7
|
+
};
|
|
8
|
+
var imageClasses = "opacity-90 grayscale brightness-150 transition-all duration-200";
|
|
9
|
+
// Base button classes
|
|
10
|
+
var baseButtonClasses = "group rounded-lg flex items-center justify-between border p-4 bg-n1-ww-gray-900 transition-all duration-200";
|
|
11
|
+
var buttonClasses = "".concat(baseButtonClasses, " border-n1-ww-border hover:border-n1-ww-main-400/50 hover:bg-n1-ww-gray-800 cursor-pointer");
|
|
12
|
+
return (_jsxs("button", { onClick: handleClick, className: buttonClasses, children: [_jsxs("div", { className: "flex items-center justify-start", children: [_jsx("div", { className: "flex items-center justify-center rounded-full bg-n1-ww-gray-650 mr-2 h-8 w-8", children: typeof chain.logo === "string" ? (_jsx(ImageWithFallback, { src: chain.logo, width: 48, height: 48, alt: chain.name, className: imageClasses, fallbackClassName: "w-12 h-12 rounded-full text-lg font-bold opacity-90 group-hover:scale-105 transition-all duration-200 brightness-150", fallbackBgColor: "bg-n1-ww-main/20", fallbackTextColor: "text-n1-ww-main" })) : (_jsx("div", { className: "grayscale brightness-150", children: chain.logo })) }), _jsxs("div", { className: "flex flex-col items-start justify-center text-left", children: [_jsx("span", { className: "text-white font-medium text-sm", children: chain.name }), subtitle ? (_jsx("span", { className: "text-n1-ww-gray-100 font-light text-xs", children: subtitle })) : (_jsx("span", { className: "text-white font-light text-xs", children: chain.name }))] })] }), _jsx("div", { className: "flex items-center justify-center", children: selected ? (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("rect", { x: "0.5", y: "0.5", width: "15", height: "15", rx: "7.5", stroke: "#FF441A" }), _jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12.3333 5.52227L7.48168 11.4007L7.1762 11.7708L6.83012 11.4354L4 8.69212L4.61955 8.10046L7.10358 10.5083L11.6497 5L12.3333 5.52227Z", fill: "#FF441A", stroke: "#FF441A", strokeWidth: "0.5" })] })) : (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: "transition-opacity duration-200 group-hover:opacity-80", children: [_jsx("circle", { cx: "8", cy: "8", r: "8", fill: "black" }), _jsx("circle", { cx: "8", cy: "8", r: "7.5", stroke: "white", strokeOpacity: "0.2" })] })) })] }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=ChainButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChainButton.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/components/ChainButton.tsx"],"names":[],"mappings":";AAKA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AASxD,MAAM,UAAU,WAAW,CAAC,EAKT;QAJjB,KAAK,WAAA,EACL,OAAO,aAAA,EACP,gBAAgB,EAAhB,QAAQ,mBAAG,KAAK,KAAA,EAChB,QAAQ,cAAA;IAER,IAAM,WAAW,GAAG;QAClB,OAAO,CAAC,KAAK,CAAC,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AC,CAAC,EAAC,KAAK,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,EAAE,EAAC,KAAK,EAAC,MAAM,EAAC,SAAS,GAAE,EACxE,eAAM,QAAQ,EAAC,SAAS,EAAC,QAAQ,EAAC,SAAS,EAAC,CAAC,EAAC,sIAAsI,EAAC,IAAI,EAAC,SAAS,EAAC,MAAM,EAAC,SAAS,EAAC,WAAW,EAAC,KAAK,GAAE,IACpO,CACP,CAAC,CAAC,CAAC,CACF,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAC,4BAA4B,EAAC,SAAS,EAAC,wDAAwD,aAC/J,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,GAAG,EAAC,IAAI,EAAC,OAAO,GAAE,EAC1C,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,KAAK,EAAC,MAAM,EAAC,OAAO,EAAC,aAAa,EAAC,KAAK,GAAE,IAC9D,CACP,GACG,IACC,CACV,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Reusable button component for selecting a blockchain chain.\n * Displays chain logo, name, optional subtitle, and selection indicator.\n */\nimport { Chain } from \"../types\";\nimport { ImageWithFallback } from \"./ImageWithFallback\";\n\ninterface ChainButtonProps {\n chain: Chain;\n onClick: (chainId: string) => void;\n selected?: boolean;\n subtitle?: string;\n}\n\nexport function ChainButton({\n chain,\n onClick,\n selected = false,\n subtitle,\n}: ChainButtonProps) {\n const handleClick = () => {\n onClick(chain.id);\n };\n\n const imageClasses = \"opacity-90 grayscale brightness-150 transition-all duration-200\";\n\n // Base button classes\n const baseButtonClasses = \"group rounded-lg flex items-center justify-between border p-4 bg-n1-ww-gray-900 transition-all duration-200\";\n \n const buttonClasses = `${baseButtonClasses} border-n1-ww-border hover:border-n1-ww-main-400/50 hover:bg-n1-ww-gray-800 cursor-pointer`;\n\n return (\n <button\n onClick={handleClick}\n className={buttonClasses}\n >\n <div className=\"flex items-center justify-start\">\n <div className=\"flex items-center justify-center rounded-full bg-n1-ww-gray-650 mr-2 h-8 w-8\">\n {typeof chain.logo === \"string\" ? (\n <ImageWithFallback\n src={chain.logo}\n width={48}\n height={48}\n alt={chain.name}\n className={imageClasses}\n fallbackClassName=\"w-12 h-12 rounded-full text-lg font-bold opacity-90 group-hover:scale-105 transition-all duration-200 brightness-150\"\n fallbackBgColor=\"bg-n1-ww-main/20\"\n fallbackTextColor=\"text-n1-ww-main\"\n />\n ) : (\n <div className=\"grayscale brightness-150\">{chain.logo}</div>\n )}\n </div>\n <div className=\"flex flex-col items-start justify-center text-left\">\n <span className=\"text-white font-medium text-sm\">{chain.name}</span>\n {subtitle ? (\n <span className=\"text-n1-ww-gray-100 font-light text-xs\">{subtitle}</span>\n ) : (\n <span className=\"text-white font-light text-xs\">{chain.name}</span>\n )}\n </div>\n </div>\n <div className=\"flex items-center justify-center\">\n {selected ? (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <rect x=\"0.5\" y=\"0.5\" width=\"15\" height=\"15\" rx=\"7.5\" stroke=\"#FF441A\"/>\n <path fillRule=\"evenodd\" clipRule=\"evenodd\" d=\"M12.3333 5.52227L7.48168 11.4007L7.1762 11.7708L6.83012 11.4354L4 8.69212L4.61955 8.10046L7.10358 10.5083L11.6497 5L12.3333 5.52227Z\" fill=\"#FF441A\" stroke=\"#FF441A\" strokeWidth=\"0.5\"/>\n </svg>\n ) : (\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" className=\"transition-opacity duration-200 group-hover:opacity-80\">\n <circle cx=\"8\" cy=\"8\" r=\"8\" fill=\"black\"/>\n <circle cx=\"8\" cy=\"8\" r=\"7.5\" stroke=\"white\" strokeOpacity=\"0.2\"/>\n </svg>\n )}\n </div>\n </button>\n );\n}\n"]}
|
|
@@ -5,8 +5,8 @@ interface HeaderProps {
|
|
|
5
5
|
onBack?: () => void;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Header component
|
|
9
|
-
*
|
|
8
|
+
* Header component displaying title, back button (when applicable), wallet connection badge,
|
|
9
|
+
* and close button. Configures navigation based on current onboarding step.
|
|
10
10
|
*/
|
|
11
11
|
export declare const Header: React.FC<HeaderProps>;
|
|
12
12
|
export {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { useNetwork } from '../../../providers/N1WalletProvider/NetworkProvider';
|
|
4
|
+
import { useWalletConnection } from '../providers';
|
|
5
|
+
import { shortenAddress } from '../../../utils/shortenString';
|
|
6
|
+
var WalletConnectionBadge = function () {
|
|
7
|
+
// Use NetworkProvider instead of legacy N1WalletContext
|
|
8
|
+
var _a = useNetwork(), solanaAddress = _a.solanaAddress, evmAddress = _a.evmAddress;
|
|
9
|
+
var _b = useWalletConnection(), turnkeyEnabled = _b.turnkeyEnabled, turnkeyStatus = _b.turnkeyStatus, turnkeyAddress = _b.turnkeyAddress;
|
|
10
|
+
var handleShareClick = useCallback(function () {
|
|
11
|
+
var _a;
|
|
12
|
+
if (typeof navigator === 'undefined')
|
|
13
|
+
return;
|
|
14
|
+
var addresses = [];
|
|
15
|
+
if (evmAddress)
|
|
16
|
+
addresses.push(evmAddress);
|
|
17
|
+
var displayTurnkeyAddress = solanaAddress || turnkeyAddress;
|
|
18
|
+
if (displayTurnkeyAddress)
|
|
19
|
+
addresses.push(displayTurnkeyAddress);
|
|
20
|
+
var addressesText = addresses.join(' / ');
|
|
21
|
+
var nav = navigator;
|
|
22
|
+
if (typeof nav.share === 'function') {
|
|
23
|
+
nav.share({ title: 'Wallet addresses', text: addressesText }).catch(function () { });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if ((_a = nav.clipboard) === null || _a === void 0 ? void 0 : _a.writeText) {
|
|
27
|
+
nav.clipboard.writeText(addressesText).catch(function () { });
|
|
28
|
+
}
|
|
29
|
+
}, [evmAddress, solanaAddress, turnkeyAddress]);
|
|
30
|
+
var displayTurnkeyAddress = solanaAddress || turnkeyAddress;
|
|
31
|
+
var walletBadgeLabel = 'Wallet';
|
|
32
|
+
var hasEvmAddress = Boolean(evmAddress);
|
|
33
|
+
var hasTurnkeyAddress = Boolean(displayTurnkeyAddress);
|
|
34
|
+
var isPreparing = turnkeyEnabled && (turnkeyStatus === 'authenticating' || turnkeyStatus === 'creating');
|
|
35
|
+
if (!hasEvmAddress && !hasTurnkeyAddress && !isPreparing) {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
var addresses = [];
|
|
39
|
+
if (hasEvmAddress) {
|
|
40
|
+
addresses.push(shortenAddress(evmAddress));
|
|
41
|
+
}
|
|
42
|
+
if (hasTurnkeyAddress) {
|
|
43
|
+
addresses.push(shortenAddress(displayTurnkeyAddress));
|
|
44
|
+
}
|
|
45
|
+
else if (isPreparing) {
|
|
46
|
+
addresses.push('Preparing…');
|
|
47
|
+
}
|
|
48
|
+
var canShare = hasEvmAddress || hasTurnkeyAddress;
|
|
49
|
+
return (_jsxs("div", { className: "flex items-center gap-2 text-[11px] leading-tight text-n1-ww-icon", children: [_jsx("span", { className: "text-[10px] uppercase tracking-wide text-n1-ww-icon/70", children: walletBadgeLabel }), _jsxs("div", { className: "flex items-center gap-1 rounded px-2 py-1 text-white", children: [addresses.map(function (addr, index) { return (_jsxs(React.Fragment, { children: [_jsx("span", { className: "tracking-tight", children: addr }), index < addresses.length - 1 && (_jsx("span", { className: "text-n1-ww-icon/70", children: "/" }))] }, index)); }), canShare && (_jsx("button", { type: "button", onClick: handleShareClick, className: "flex h-4 w-4 items-center justify-center text-n1-ww-main hover:text-white transition-colors", "aria-label": "Share wallet addresses", children: _jsxs("svg", { className: "h-full w-full", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M5.93066 8.06944L12.3473 1.65277", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" }), _jsx("path", { d: "M8.06958 1.65277H12.3474V5.93055", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" }), _jsx("path", { d: "M10.7431 7.80207V12.3472H1.65283V3.25693H6.19797", stroke: "currentColor", strokeWidth: "1.2", strokeLinecap: "round" })] }) }))] })] }));
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Header component displaying title, back button (when applicable), wallet connection badge,
|
|
53
|
+
* and close button. Configures navigation based on current onboarding step.
|
|
54
|
+
*/
|
|
55
|
+
export var Header = function (_a) {
|
|
56
|
+
var onClose = _a.onClose, onBack = _a.onBack, _b = _a.title, title = _b === void 0 ? 'Bridge' : _b;
|
|
57
|
+
return (_jsxs("div", { className: "w-full px-4 pt-4", children: [_jsxs("div", { className: "flex items-center h-4 gap-2", children: [_jsxs("div", { className: "flex flex-1 items-center min-w-0", children: [onBack && (_jsx("button", { type: "button", onClick: onBack, className: "flex h-full items-center justify-center cursor-pointer text-n1-ww-icon hover:text-white pr-4", "aria-label": "Go back", children: _jsx("svg", { className: "h-[10px] w-[6px]", width: "6", height: "10", viewBox: "0 0 6 10", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M5.26316 10L0 5L5.26316 0L6 0.7125L1.48684 5L6 9.2875L5.26316 10Z" }) }) })), _jsx("div", { className: " text-[12px] text-n1-ww-icon opacity-90 tracking-[-0.24px] leading-none", children: title })] }), _jsx("div", { className: "flex flex-1 items-center justify-center px-2", children: _jsx(WalletConnectionBadge, {}) }), _jsx("div", { className: "flex flex-1 justify-end", children: _jsx("button", { type: "button", onClick: function (event) {
|
|
58
|
+
var _a;
|
|
59
|
+
event.preventDefault();
|
|
60
|
+
event.stopPropagation();
|
|
61
|
+
if ((_a = event.nativeEvent) === null || _a === void 0 ? void 0 : _a.stopImmediatePropagation) {
|
|
62
|
+
event.nativeEvent.stopImmediatePropagation();
|
|
63
|
+
}
|
|
64
|
+
if (onClose) {
|
|
65
|
+
onClose();
|
|
66
|
+
}
|
|
67
|
+
}, className: "flex h-10 w-10 items-center justify-center cursor-pointer text-n1-ww-icon hover:text-white", children: _jsx("svg", { className: "h-[10px] w-[10px]", viewBox: "0 0 10 10", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", children: _jsx("path", { d: "M5.88381 5L10 0.883812L9.11619 0L5 4.11619L0.883937 0L0 0.883812L4.11619 5L0 9.11619L0.883937 10L5 5.88381L9.11619 10L10 9.11619L5.88381 5Z" }) }) }) })] }), _jsx("div", { className: "h-4 relative mt-0 w-full", children: _jsx("div", { className: "absolute bottom-0 left-0 right-0 top-[-1px] border-b border-n1-ww-border" }) })] }));
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=Header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/components/Header.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,qDAAqD,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,IAAM,qBAAqB,GAAa;IACtC,wDAAwD;IAClD,IAAA,KAAgC,UAAU,EAAE,EAA1C,aAAa,mBAAA,EAAE,UAAU,gBAAiB,CAAC;IAC7C,IAAA,KAAoD,mBAAmB,EAAE,EAAvE,cAAc,oBAAA,EAAE,aAAa,mBAAA,EAAE,cAAc,oBAA0B,CAAC;IAEhF,IAAM,gBAAgB,GAAG,WAAW,CAAC;;QACnC,IAAI,OAA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,OAAO,EAAE,CAAC;gCACZ,CAAC;4BACH,CAAC,EACD,SAAS,EAAC,4FAA4F,YAEtG,cACE,SAAS,EAAC,mBAAmB,EAC7B,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,cAAc,EACnB,KAAK,EAAC,4BAA4B,YAElC,eAAM,CAAC,EAAC,6IAA6I,GAAG,GACpJ,GACC,GACL,IACF,EACN,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,0EAA0E,GAAO,GAC5F,IACF,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useCallback } from 'react';\nimport { useNetwork } from '../../../providers/N1WalletProvider/NetworkProvider';\nimport { useWalletConnection } from '../providers';\nimport { shortenAddress } from '../../../utils/shortenString';\n\nconst WalletConnectionBadge: React.FC = () => {\n // Use NetworkProvider instead of legacy N1WalletContext\n const { solanaAddress, evmAddress } = useNetwork();\n const { turnkeyEnabled, turnkeyStatus, turnkeyAddress } = useWalletConnection();\n\n const handleShareClick = useCallback(() => {\n if (typeof navigator === 'undefined') return;\n\n const addresses: string[] = [];\n if (evmAddress) addresses.push(evmAddress);\n const displayTurnkeyAddress = solanaAddress || turnkeyAddress;\n if (displayTurnkeyAddress) addresses.push(displayTurnkeyAddress);\n\n const addressesText = addresses.join(' / ');\n\n const nav = navigator as Navigator & {\n share?: (data: ShareData) => Promise<void>;\n };\n\n if (typeof nav.share === 'function') {\n nav.share({ title: 'Wallet addresses', text: addressesText }).catch(() => {});\n return;\n }\n\n if (nav.clipboard?.writeText) {\n nav.clipboard.writeText(addressesText).catch(() => {});\n }\n }, [evmAddress, solanaAddress, turnkeyAddress]);\n\n const displayTurnkeyAddress = solanaAddress || turnkeyAddress;\n const walletBadgeLabel = 'Wallet';\n\n const hasEvmAddress = Boolean(evmAddress);\n const hasTurnkeyAddress = Boolean(displayTurnkeyAddress);\n const isPreparing = turnkeyEnabled && (turnkeyStatus === 'authenticating' || turnkeyStatus === 'creating');\n\n if (!hasEvmAddress && !hasTurnkeyAddress && !isPreparing) {\n return null;\n }\n\n const addresses: string[] = [];\n if (hasEvmAddress) {\n addresses.push(shortenAddress(evmAddress!));\n }\n if (hasTurnkeyAddress) {\n addresses.push(shortenAddress(displayTurnkeyAddress!));\n } else if (isPreparing) {\n addresses.push('Preparing…');\n }\n\n const canShare = hasEvmAddress || hasTurnkeyAddress;\n\n return (\n <div className=\"flex items-center gap-2 text-[11px] leading-tight text-n1-ww-icon\">\n <span className=\"text-[10px] uppercase tracking-wide text-n1-ww-icon/70\">\n {walletBadgeLabel}\n </span>\n <div className=\"flex items-center gap-1 rounded px-2 py-1 text-white\">\n {addresses.map((addr, index) => (\n <React.Fragment key={index}>\n <span className=\"tracking-tight\">{addr}</span>\n {index < addresses.length - 1 && (\n <span className=\"text-n1-ww-icon/70\">/</span>\n )}\n </React.Fragment>\n ))}\n {canShare && (\n <button\n type=\"button\"\n onClick={handleShareClick}\n className=\"flex h-4 w-4 items-center justify-center text-n1-ww-main hover:text-white transition-colors\"\n aria-label=\"Share wallet addresses\"\n >\n <svg\n className=\"h-full w-full\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n d=\"M5.93066 8.06944L12.3473 1.65277\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M8.06958 1.65277H12.3474V5.93055\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n />\n <path\n d=\"M10.7431 7.80207V12.3472H1.65283V3.25693H6.19797\"\n stroke=\"currentColor\"\n strokeWidth=\"1.2\"\n strokeLinecap=\"round\"\n />\n </svg>\n </button>\n )}\n </div>\n </div>\n );\n};\n\ninterface HeaderProps {\n title?: string;\n onClose?: () => void;\n onBack?: () => void;\n}\n\n/**\n * Header component displaying title, back button (when applicable), wallet connection badge,\n * and close button. Configures navigation based on current onboarding step.\n */\nexport const Header: React.FC<HeaderProps> = ({\n onClose,\n onBack,\n title = 'Bridge',\n}) => {\n return (\n <div className=\"w-full px-4 pt-4\">\n <div className=\"flex items-center h-4 gap-2\">\n <div className=\"flex flex-1 items-center min-w-0\">\n {onBack && (\n <button\n type=\"button\"\n onClick={onBack}\n className=\"flex h-full items-center justify-center cursor-pointer text-n1-ww-icon hover:text-white pr-4\" \n aria-label=\"Go back\"\n >\n <svg\n className=\"h-[10px] w-[6px]\"\n width=\"6\"\n height=\"10\"\n viewBox=\"0 0 6 10\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M5.26316 10L0 5L5.26316 0L6 0.7125L1.48684 5L6 9.2875L5.26316 10Z\" />\n </svg>\n </button>\n )}\n <div className={\" text-[12px] text-n1-ww-icon opacity-90 tracking-[-0.24px] leading-none\"}>\n {title}\n </div>\n </div>\n <div className=\"flex flex-1 items-center justify-center px-2\">\n <WalletConnectionBadge />\n </div>\n <div className=\"flex flex-1 justify-end\">\n <button\n type=\"button\"\n onClick={(event) => {\n event.preventDefault();\n event.stopPropagation();\n if (event.nativeEvent?.stopImmediatePropagation) {\n event.nativeEvent.stopImmediatePropagation();\n }\n if (onClose) {\n onClose();\n }\n }}\n className=\"flex h-10 w-10 items-center justify-center cursor-pointer text-n1-ww-icon hover:text-white\"\n >\n <svg\n className=\"h-[10px] w-[10px]\"\n viewBox=\"0 0 10 10\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path d=\"M5.88381 5L10 0.883812L9.11619 0L5 4.11619L0.883937 0L0 0.883812L4.11619 5L0 9.11619L0.883937 10L5 5.88381L9.11619 10L10 9.11619L5.88381 5Z\" />\n </svg>\n </button>\n </div>\n </div>\n <div className=\"h-4 relative mt-0 w-full\">\n <div className=\"absolute bottom-0 left-0 right-0 top-[-1px] border-b border-n1-ww-border\"></div>\n </div>\n </div>\n );\n}; \n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImageWithFallback.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/components/ImageWithFallback.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAcxC;;GAEG;AACH,MAAM,CAAC,IAAM,iBAAiB,GAAqC,UAAC,EAUnE;QATC,GAAG,SAAA,EACH,GAAG,SAAA,EACH,aAAc,EAAd,KAAK,mBAAG,MAAM,KAAA,EACd,cAAe,EAAf,MAAM,mBAAG,MAAM,KAAA,EACf,iBAAc,EAAd,SAAS,mBAAG,EAAE,KAAA,EACd,yBAAsB,EAAtB,iBAAiB,mBAAG,EAAE,KAAA,EACtB,YAAY,kBAAA,EACZ,uBAAqC,EAArC,eAAe,mBAAG,mBAAmB,KAAA,EACrC,yBAAyC,EAAzC,iBAAiB,mBAAG,qBAAqB,KAAA;IAEnC,IAAA,KAA8B,QAAQ,CAAC,KAAK,CAAC,EAA5C,UAAU,QAAA,EAAE,aAAa,QAAmB,CAAC;IAEpD,0CAA0C;IAC1C,IAAM,WAAW,GAAG,UAAC,IAAY;QAC/B,IAAI,CAAC,IAAI;YAAE,OAAO,EAAE,CAAC;QACrB,OAAO,IAAI;aACR,KAAK,CAAC,GAAG,CAAC;aACV,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,CAAC,CAAC,CAAC,EAAP,CAAO,CAAC;aACtB,IAAI,CAAC,EAAE,CAAC;aACR,WAAW,EAAE;aACb,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACrB,CAAC,CAAC;IAEF,IAAM,WAAW,GAAG;QAClB,aAAa,CAAC,IAAI,CAAC,CAAC;IACtB,CAAC,CAAC;IAEF,IAAI,UAAU,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,sBAAsB;QACtB,OAAO,CACL,cACE,SAAS,EAAE,2CAAoC,eAAe,cAAI,iBAAiB,cAAI,iBAAiB,CAAE,EAC1G,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAG,KAAK,OAAI,CAAC,CAAC,CAAC,KAAK;gBACvD,MAAM,EAAE,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,UAAG,MAAM,OAAI,CAAC,CAAC,CAAC,MAAM;aAC5D,gBACW,GAAG,YAEd,YAAY,IAAI,WAAW,CAAC,GAAG,CAAC,GAC7B,CACP,CAAC;IACJ,CAAC;IAED,eAAe;IACf,OAAO,CACL,cACE,GAAG,EAAE,GAAG,EACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,WAAW,GACpB,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useState } from 'react';\n\ninterface ImageWithFallbackProps {\n src: string;\n alt: string;\n width?: number | string;\n height?: number | string;\n className?: string;\n fallbackClassName?: string;\n fallbackText?: string;\n fallbackBgColor?: string;\n fallbackTextColor?: string;\n}\n\n/**\n * A component that renders an image with a fallback div when the image is not available\n */\nexport const ImageWithFallback: React.FC<ImageWithFallbackProps> = ({\n src,\n alt,\n width = 'auto',\n height = 'auto',\n className = '',\n fallbackClassName = '',\n fallbackText,\n fallbackBgColor = 'bg-n1-ww-gray-800',\n fallbackTextColor = 'text-n1-ww-gray-400',\n}) => {\n const [imageError, setImageError] = useState(false);\n\n // Get initials from alt text for fallback\n const getInitials = (text: string) => {\n if (!text) return '';\n return text\n .split(' ')\n .map((word) => word[0])\n .join('')\n .toUpperCase()\n .substring(0, 2);\n };\n\n const handleError = () => {\n setImageError(true);\n };\n\n if (imageError || !src) {\n // Render fallback div\n return (\n <div\n className={`flex items-center justify-center ${fallbackBgColor} ${fallbackTextColor} ${fallbackClassName}`}\n style={{\n width: typeof width === 'number' ? `${width}px` : width,\n height: typeof height === 'number' ? `${height}px` : height,\n }}\n aria-label={alt}\n >\n {fallbackText || getInitials(alt)}\n </div>\n );\n }\n\n // Render image\n return (\n <img\n src={src}\n alt={alt}\n width={width}\n height={height}\n className={className}\n onError={handleError}\n />\n );\n};\n"]}
|
|
@@ -9,5 +9,10 @@ interface TransactionTableProps {
|
|
|
9
9
|
};
|
|
10
10
|
onClose?: () => void;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Displays transaction details in a formatted table.
|
|
14
|
+
* Shows amount, status, network, addresses, and transaction IDs with explorer links.
|
|
15
|
+
* Formats addresses with ellipsis and applies color coding based on status.
|
|
16
|
+
*/
|
|
12
17
|
export declare function TransactionTable({ tableValues, onClose, }: TransactionTableProps): import("react/jsx-runtime").JSX.Element;
|
|
13
18
|
export {};
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { shortenAddress } from '
|
|
3
|
-
import {
|
|
2
|
+
import { shortenAddress } from '../../../utils/shortenString';
|
|
3
|
+
import { getSolanaExplorerUrl } from '../utils/deposit/solanaDepositTransaction';
|
|
4
|
+
/**
|
|
5
|
+
* Displays transaction details in a formatted table.
|
|
6
|
+
* Shows amount, status, network, addresses, and transaction IDs with explorer links.
|
|
7
|
+
* Formats addresses with ellipsis and applies color coding based on status.
|
|
8
|
+
*/
|
|
4
9
|
export function TransactionTable(_a) {
|
|
5
10
|
var tableValues = _a.tableValues, onClose = _a.onClose;
|
|
6
11
|
// Friendly labels for the keys
|
|
@@ -57,7 +62,7 @@ export function TransactionTable(_a) {
|
|
|
57
62
|
// Get explorer URL for transaction ID or address
|
|
58
63
|
var getExplorerLink = function (key, value) {
|
|
59
64
|
if (key === 'tx') {
|
|
60
|
-
return
|
|
65
|
+
return getSolanaExplorerUrl(value);
|
|
61
66
|
}
|
|
62
67
|
if (key === 'from') {
|
|
63
68
|
return "https://explorer.solana.com/address/".concat(value, "?cluster=devnet");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TransactionTable.js","sourceRoot":"","sources":["../../../../../src/features/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e,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,EACtC,MAAM,EAAC,QAAQ,EACf,GAAG,EAAC,qBAAqB,EACzB,SAAS,EAAE,UAAG,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,kCAA+B,EAC5E,KAAK,EAAE,KAAK,CAAC,IAAI,aAEjB,eAAM,SAAS,EAAC,2BAA2B,YACxC,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,GAC5B,EACP,cACE,KAAK,EAAC,4BAA4B,EAClC,SAAS,EAAC,8FAA8F,EACxG,IAAI,EAAC,MAAM,EACX,OAAO,EAAC,WAAW,EACnB,MAAM,EAAC,cAAc,YAErB,eACE,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,EACtB,WAAW,EAAE,CAAC,EACd,CAAC,EAAC,8EAA8E,GAChF,GACE,IACJ,CACL,CAAC,CAAC,CAAC,CACF,eACE,SAAS,EAAE,UAAG,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,4BAAyB,EACtE,KAAK,EAAE,KAAK,CAAC,IAAI,YAEhB,KAAK,CAAC,IAAI,GACN,CACR,EACA,KAAK,CAAC,MAAM,IAAI,CACf,eAAM,SAAS,EAAC,0EAA0E,GAAQ,CACnG,IACG,KA7CE,GAAG,CA8CP,CACP;gBAhDoC,CAgDpC,CAAC,GACE,IACF,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { TableValues } from '../types';\nimport { shortenAddress } from '../../../utils/shortenString';\nimport { getSolanaExplorerUrl } from '../utils/deposit/solanaDepositTransaction';\n\ninterface TransactionTableProps {\n tableValues: TableValues & {\n amount?: { text: string; visible: boolean; typing: boolean };\n };\n onClose?: () => void;\n}\n\n/**\n * Displays transaction details in a formatted table.\n * Shows amount, status, network, addresses, and transaction IDs with explorer links.\n * Formats addresses with ellipsis and applies color coding based on status.\n */\nexport function TransactionTable({\n tableValues,\n onClose,\n}: TransactionTableProps) {\n // Friendly labels for the keys\n const getLabel = (key: string) => {\n const labels: Record<string, string> = {\n amount: 'Amount',\n tx: 'Transaction ID',\n from: 'From',\n to: 'To',\n network: 'Network',\n status: 'Status',\n };\n\n return labels[key] || key;\n };\n\n // Get appropriate color for values based on key\n const getValueStyles = (key: string, value: string) => {\n if (key === 'status') {\n if (\n value.toLowerCase().includes('success') ||\n value.toLowerCase().includes('confirmed')\n ) {\n return 'text-emerald-500 font-medium';\n }\n if (value.toLowerCase().includes('pending')) {\n return 'text-amber-400 font-medium';\n }\n if (\n value.toLowerCase().includes('fail') ||\n value.toLowerCase().includes('error')\n ) {\n return 'text-red-400 font-medium';\n }\n }\n\n if (key === 'tx') {\n return 'text-n1-ww-gray-200 text-xs font-medium hover:text-n1-ww-main-400 transition-colors duration-200';\n }\n\n if (key === 'network') {\n return 'text-purple-400 font-medium';\n }\n\n if (key === 'from' || key === 'to') {\n return 'text-n1-ww-gray-200 text-xs font-medium hover:text-n1-ww-main-400 transition-colors duration-200';\n }\n\n if (key === 'amount') {\n return 'text-emerald-500 font-semibold';\n }\n\n return 'text-n1-ww-gray-50 font-medium';\n };\n\n // Format display value with ellipsis for long text\n const getDisplayValue = (key: string, value: string) => {\n if (key === 'tx') {\n return shortenAddress(value, 5, 4);\n }\n\n if (key === 'from' || key === 'to') {\n return shortenAddress(value, 5, 4);\n }\n\n return value;\n };\n\n // Get explorer URL for transaction ID or address\n const getExplorerLink = (key: string, value: string) => {\n\n if (key === 'tx') {\n return getSolanaExplorerUrl(value);\n }\n\n if (key === 'from') {\n return `https://explorer.solana.com/address/${value}?cluster=devnet`;\n }\n\n return '';\n };\n\n // Order of fields to display\n const fieldOrder = ['amount', 'status', 'network', 'from', 'to', 'tx'];\n\n // Sort entries based on fieldOrder\n const sortedEntries = Object.entries(tableValues).sort(([keyA], [keyB]) => {\n const indexA = fieldOrder.indexOf(keyA);\n const indexB = fieldOrder.indexOf(keyB);\n return (indexA === -1 ? 999 : indexA) - (indexB === -1 ? 999 : indexB);\n });\n\n return (\n <div className=\"relative w-full h-full bg-n1-ww-gray-950 border border-n1-ww-border p-5 rounded-sm flex flex-col justify-center\">\n {onClose && (\n <button\n onClick={onClose}\n className=\"absolute top-3 right-2 text-n1-ww-gray-600 hover:text-n1-ww-gray-300 transition-colors duration-200 focus:outline-none\"\n aria-label=\"Close details\"\n >\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-5 w-5\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M6 18L18 6M6 6l12 12\"\n />\n </svg>\n </button>\n )}\n <div className=\"space-y-3 text-sm pt-5\">\n {sortedEntries.map(([key, value]) => (\n <div key={key} className=\"flex items-center justify-between py-2 \">\n <span className=\"text-n1-ww-gray-400 font-medium min-w-[120px]\">\n {getLabel(key)}\n </span>\n <div\n className={`relative transition-all duration-300 ${value.visible ? 'opacity-100' : 'opacity-0'} max-w-[65%] text-right flex-1`}\n >\n {(key === 'tx' || key === 'from') &&\n getExplorerLink(key, value.text) ? (\n <a\n href={getExplorerLink(key, value.text)}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={`${getValueStyles(key, value.text)} break-all inline-block group`}\n title={value.text}\n >\n <span className=\"underline hover:font-bold\">\n {getDisplayValue(key, value.text)}\n </span>\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className=\"h-3 w-3 ml-1 inline-block opacity-50 group-hover:opacity-100 transition-opacity duration-200\"\n fill=\"none\"\n viewBox=\"0 0 24 24\"\n stroke=\"currentColor\"\n >\n <path\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n d=\"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14\"\n />\n </svg>\n </a>\n ) : (\n <span\n className={`${getValueStyles(key, value.text)} break-all inline-block`}\n title={value.text}\n >\n {value.text}\n </span>\n )}\n {value.typing && (\n <span className=\"inline-block ml-1 w-[2px] h-[14px] bg-n1-ww-main-400 n1-ww-animate-pulse\"></span>\n )}\n </div>\n </div>\n ))}\n </div>\n </div>\n );\n}\n"]}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { WaitingMessageState } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Component that displays a loading message with animated loader or transfer animation.
|
|
4
|
+
* Used across multiple screens to show progress states.
|
|
5
|
+
*/
|
|
2
6
|
interface WaitingMessageProps {
|
|
3
7
|
message: WaitingMessageState;
|
|
4
8
|
loaderSize?: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WaitingMessage.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/components/WaitingMessage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,IAAI,MAAM,0BAA0B,CAAC;AAY5C,MAAM,UAAU,cAAc,CAAC,EAIT;QAHpB,OAAO,aAAA,EACP,kBAAe,EAAf,UAAU,mBAAG,EAAE,KAAA,EACf,iBAAoB,EAApB,SAAS,mBAAG,QAAQ,KAAA;IAEpB,OAAO,CACL,eAAK,SAAS,EAAC,2CAA2C,aACvD,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,CACxB,KAAC,iBAAiB,IAAC,IAAI,EAAE,UAAU,GAAI,CACxC,CAAC,CAAC,CAAC,CACF,KAAC,qBAAqB,KAAG,CAC1B,EACD,eAAK,SAAS,EAAC,4BAA4B,aACzC,aAAI,SAAS,EAAC,mGAAmG,YAC/G,cAAK,SAAS,EAAC,UAAU,YACtB,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,GAC7B,GACH,EACL,cAAK,SAAS,EAAC,mEAAmE,YAChF,cAAK,SAAS,EAAC,UAAU,YACtB,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,EAAE,GAAI,GAClC,GACF,IACF,GACF,CACP,EAzBmC,CAyBnC,CAAC","sourcesContent":["import { WaitingMessageState } from '../types';\nimport { N1LoaderAnimation } from '../../../animations/N1Loader';\nimport { SolanaLogo, ZeroOneLogo } from '../../../components/logos';\nimport Logo from '../../../components/Logo';\n\n/**\n * Component that displays a loading message with animated loader or transfer animation.\n * Used across multiple screens to show progress states.\n */\ninterface WaitingMessageProps {\n message: WaitingMessageState;\n loaderSize?: number;\n animation?: 'loader' | 'transfer';\n}\n\nexport function WaitingMessage({\n message,\n loaderSize = 48,\n animation = 'loader',\n}: WaitingMessageProps) {\n return (\n <div className=\"flex flex-col items-center justify-center\">\n {animation === 'loader' ? (\n <N1LoaderAnimation size={loaderSize} />\n ) : (\n <TransferWaveAnimation />\n )}\n <div className=\"text-center w-[300px] my-4\">\n <h3 className=\"text-sm text-white transition-all duration-300 h-[32px] flex items-center justify-center relative\"> \n <div className=\"absolute\">\n {message.visible && message.title}\n </div>\n </h3>\n <div className=\"text-xs flex items-center justify-center relative mt-2 font-light\">\n <div className=\"absolute\">\n {message.visible && message.subtitle}\n </div>\n </div>\n </div>\n </div>\n );\n}\n\nconst DOT_INDICES = Array.from({ length: 7 }, (_, index) => index);\n\nconst TransferDots = () => (\n <div className=\"flex items-center gap-[3px]\">\n {DOT_INDICES.map((index) => (\n <span\n key={`wave-dot-${index}`}\n className=\"n1-ww-animate-transfer-dot n1-ww-force-motion rounded-full bg-n1-ww-main/90\"\n style={{\n width: '2.5px',\n height: '2.5px',\n animationDelay: `${index * 0.12}s`,\n animationDuration: '1.6s',\n }}\n aria-hidden=\"true\"\n />\n ))}\n </div>\n);\n\nconst TransferWaveAnimation = () => (\n <div\n className=\"flex w-full items-center justify-center\"\n aria-label=\"Solana deposit moving into N1 and 01\"\n >\n <div className=\"flex items-center gap-2\">\n <div className=\"relative h-7 w-7 rounded-full bg-gradient-to-br from-black via-neutral-900 to-neutral-800 p-px shadow-[0_12px_30px_rgba(0,0,0,0.6)]\">\n <div className=\"flex h-full w-full items-center justify-center rounded-full bg-black text-white\">\n <SolanaLogo width={14} height={14} />\n </div>\n </div>\n <TransferDots />\n <div className=\"relative h-7 w-7 rounded-full bg-n1-ww-gray-800/70 p-px shadow-[0_12px_30px_rgba(0,0,0,0.6)]\">\n <div className=\"flex h-full w-full items-center justify-center rounded-full bg-[#1b1b1b]\">\n <Logo size={12} className=\"text-n1-ww-main/90\" />\n </div>\n </div>\n <TransferDots />\n <div className=\"relative h-7 w-7 rounded-full bg-n1-ww-gray-800/70 p-px shadow-[0_12px_30px_rgba(0,0,0,0.6)]\">\n <div className=\"flex h-full w-full items-center justify-center rounded-full bg-[#1b1b1b]\">\n <ZeroOneLogo width={14} height={11} />\n </div>\n </div>\n </div>\n </div>\n);\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/features/onboarding-flow/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,UAAU,CAAC","sourcesContent":["export * from './ImageWithFallback';\nexport * from './ChainButton';\nexport * from './TransactionTable';\nexport * from './WaitingMessage';\nexport * from './Header';\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export declare enum DepositErrorCode {
|
|
2
|
+
USER_REJECTED = "USER_REJECTED",
|
|
3
|
+
WALLET_NOT_READY = "WALLET_NOT_READY",
|
|
4
|
+
WALLET_NOT_CONNECTED = "WALLET_NOT_CONNECTED",
|
|
5
|
+
WRONG_WALLET_CHAIN = "WRONG_WALLET_CHAIN",
|
|
6
|
+
INVALID_AMOUNT = "INVALID_AMOUNT",
|
|
7
|
+
BELOW_MINIMUM_DEPOSIT = "BELOW_MINIMUM_DEPOSIT",
|
|
8
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
9
|
+
INSUFFICIENT_FEES = "INSUFFICIENT_FEES",
|
|
10
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
11
|
+
ATTESTATION_NOT_READY = "ATTESTATION_NOT_READY",
|
|
12
|
+
ATTESTATION_TIMEOUT = "ATTESTATION_TIMEOUT",
|
|
13
|
+
BRIDGE_ASSIST_NOT_FOUND = "BRIDGE_ASSIST_NOT_FOUND",
|
|
14
|
+
BRIDGE_ASSIST_CONFLICT = "BRIDGE_ASSIST_CONFLICT",
|
|
15
|
+
BRIDGE_ASSIST_RATE_LIMITED = "BRIDGE_ASSIST_RATE_LIMITED",
|
|
16
|
+
BRIDGE_ASSIST_UNAUTHORIZED = "BRIDGE_ASSIST_UNAUTHORIZED",
|
|
17
|
+
CLAIM_SUBMISSION_FAILED = "CLAIM_SUBMISSION_FAILED",
|
|
18
|
+
BRIDGE_SUBMISSION_FAILED = "BRIDGE_SUBMISSION_FAILED",
|
|
19
|
+
NORD_DEPOSIT_FAILED = "NORD_DEPOSIT_FAILED",
|
|
20
|
+
UNKNOWN = "UNKNOWN"
|
|
21
|
+
}
|
|
22
|
+
export type DepositErrorDetails = Record<string, unknown>;
|
|
23
|
+
export declare class DepositError extends Error {
|
|
24
|
+
readonly code: DepositErrorCode;
|
|
25
|
+
readonly retryable: boolean;
|
|
26
|
+
readonly userMessage: string;
|
|
27
|
+
readonly details?: DepositErrorDetails | undefined;
|
|
28
|
+
readonly cause?: unknown | undefined;
|
|
29
|
+
readonly name = "DepositError";
|
|
30
|
+
constructor(code: DepositErrorCode, message: string, retryable: boolean, userMessage: string, details?: DepositErrorDetails | undefined, cause?: unknown | undefined);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Normalizes unknown errors into a stable taxonomy.
|
|
34
|
+
* This is the single source of truth for: retryability, user-safe copy, and structured metadata.
|
|
35
|
+
*/
|
|
36
|
+
export declare const toDepositError: (error: unknown, context?: DepositErrorDetails) => DepositError;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
16
|
+
var __assign = (this && this.__assign) || function () {
|
|
17
|
+
__assign = Object.assign || function(t) {
|
|
18
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
19
|
+
s = arguments[i];
|
|
20
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
21
|
+
t[p] = s[p];
|
|
22
|
+
}
|
|
23
|
+
return t;
|
|
24
|
+
};
|
|
25
|
+
return __assign.apply(this, arguments);
|
|
26
|
+
};
|
|
27
|
+
import { BridgeAssistError } from '../bridge-assist/types';
|
|
28
|
+
export var DepositErrorCode;
|
|
29
|
+
(function (DepositErrorCode) {
|
|
30
|
+
DepositErrorCode["USER_REJECTED"] = "USER_REJECTED";
|
|
31
|
+
DepositErrorCode["WALLET_NOT_READY"] = "WALLET_NOT_READY";
|
|
32
|
+
DepositErrorCode["WALLET_NOT_CONNECTED"] = "WALLET_NOT_CONNECTED";
|
|
33
|
+
DepositErrorCode["WRONG_WALLET_CHAIN"] = "WRONG_WALLET_CHAIN";
|
|
34
|
+
DepositErrorCode["INVALID_AMOUNT"] = "INVALID_AMOUNT";
|
|
35
|
+
DepositErrorCode["BELOW_MINIMUM_DEPOSIT"] = "BELOW_MINIMUM_DEPOSIT";
|
|
36
|
+
DepositErrorCode["INSUFFICIENT_BALANCE"] = "INSUFFICIENT_BALANCE";
|
|
37
|
+
DepositErrorCode["INSUFFICIENT_FEES"] = "INSUFFICIENT_FEES";
|
|
38
|
+
DepositErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
39
|
+
DepositErrorCode["ATTESTATION_NOT_READY"] = "ATTESTATION_NOT_READY";
|
|
40
|
+
DepositErrorCode["ATTESTATION_TIMEOUT"] = "ATTESTATION_TIMEOUT";
|
|
41
|
+
DepositErrorCode["BRIDGE_ASSIST_NOT_FOUND"] = "BRIDGE_ASSIST_NOT_FOUND";
|
|
42
|
+
DepositErrorCode["BRIDGE_ASSIST_CONFLICT"] = "BRIDGE_ASSIST_CONFLICT";
|
|
43
|
+
DepositErrorCode["BRIDGE_ASSIST_RATE_LIMITED"] = "BRIDGE_ASSIST_RATE_LIMITED";
|
|
44
|
+
DepositErrorCode["BRIDGE_ASSIST_UNAUTHORIZED"] = "BRIDGE_ASSIST_UNAUTHORIZED";
|
|
45
|
+
DepositErrorCode["CLAIM_SUBMISSION_FAILED"] = "CLAIM_SUBMISSION_FAILED";
|
|
46
|
+
DepositErrorCode["BRIDGE_SUBMISSION_FAILED"] = "BRIDGE_SUBMISSION_FAILED";
|
|
47
|
+
DepositErrorCode["NORD_DEPOSIT_FAILED"] = "NORD_DEPOSIT_FAILED";
|
|
48
|
+
DepositErrorCode["UNKNOWN"] = "UNKNOWN";
|
|
49
|
+
})(DepositErrorCode || (DepositErrorCode = {}));
|
|
50
|
+
var DepositError = /** @class */ (function (_super) {
|
|
51
|
+
__extends(DepositError, _super);
|
|
52
|
+
function DepositError(code, message, retryable, userMessage, details, cause) {
|
|
53
|
+
var _this = _super.call(this, message) || this;
|
|
54
|
+
_this.code = code;
|
|
55
|
+
_this.retryable = retryable;
|
|
56
|
+
_this.userMessage = userMessage;
|
|
57
|
+
_this.details = details;
|
|
58
|
+
_this.cause = cause;
|
|
59
|
+
_this.name = 'DepositError';
|
|
60
|
+
return _this;
|
|
61
|
+
}
|
|
62
|
+
return DepositError;
|
|
63
|
+
}(Error));
|
|
64
|
+
export { DepositError };
|
|
65
|
+
var msg = function (e) {
|
|
66
|
+
return e instanceof Error ? e.message : e == null ? '' : String(e);
|
|
67
|
+
};
|
|
68
|
+
var includesAny = function (haystack, needles) {
|
|
69
|
+
return needles.some(function (n) { return haystack.includes(n); });
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Normalizes unknown errors into a stable taxonomy.
|
|
73
|
+
* This is the single source of truth for: retryability, user-safe copy, and structured metadata.
|
|
74
|
+
*/
|
|
75
|
+
export var toDepositError = function (error, context) {
|
|
76
|
+
if (error instanceof DepositError)
|
|
77
|
+
return error;
|
|
78
|
+
var rawMessage = msg(error);
|
|
79
|
+
var lower = rawMessage.toLowerCase();
|
|
80
|
+
// Bridge Assist HTTP-ish errors
|
|
81
|
+
if (error instanceof BridgeAssistError) {
|
|
82
|
+
var status_1 = error.status;
|
|
83
|
+
if (status_1 === 404) {
|
|
84
|
+
return new DepositError(DepositErrorCode.BRIDGE_ASSIST_NOT_FOUND, rawMessage, true, 'Deposit record was not found yet. Retrying…', __assign(__assign({}, context), { status: status_1 }), error);
|
|
85
|
+
}
|
|
86
|
+
if (status_1 === 409) {
|
|
87
|
+
return new DepositError(DepositErrorCode.BRIDGE_ASSIST_CONFLICT, rawMessage, false, 'This deposit conflicted with an existing request. Please start a new deposit.', __assign(__assign({}, context), { status: status_1 }), error);
|
|
88
|
+
}
|
|
89
|
+
if (status_1 === 429) {
|
|
90
|
+
return new DepositError(DepositErrorCode.BRIDGE_ASSIST_RATE_LIMITED, rawMessage, true, 'Service is busy. Please retry in a moment.', __assign(__assign({}, context), { status: status_1, retryAfter: error.retryAfter }), error);
|
|
91
|
+
}
|
|
92
|
+
if (status_1 === 401 || status_1 === 403) {
|
|
93
|
+
return new DepositError(DepositErrorCode.BRIDGE_ASSIST_UNAUTHORIZED, rawMessage, false, 'Request was rejected. Please reconnect your wallet and try again.', __assign(__assign({}, context), { status: status_1 }), error);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// Wallet / user intent
|
|
97
|
+
if (includesAny(lower, ['user rejected', 'user denied', 'rejected the request', 'denied transaction'])) {
|
|
98
|
+
return new DepositError(DepositErrorCode.USER_REJECTED, rawMessage, false, 'You rejected the transaction. Please approve to continue.', context, error);
|
|
99
|
+
}
|
|
100
|
+
// Minimum / amount validation (e.g. Nord min deposit)
|
|
101
|
+
if (includesAny(lower, ['less than the minimum deposit', 'minimum deposit'])) {
|
|
102
|
+
return new DepositError(DepositErrorCode.BELOW_MINIMUM_DEPOSIT, rawMessage, false, rawMessage, // already user-friendly in most cases
|
|
103
|
+
context, error);
|
|
104
|
+
}
|
|
105
|
+
if (includesAny(lower, ['invalid amount', 'amount must be', 'amount is required'])) {
|
|
106
|
+
return new DepositError(DepositErrorCode.INVALID_AMOUNT, rawMessage, false, 'Enter a valid amount to continue.', context, error);
|
|
107
|
+
}
|
|
108
|
+
// Retryable on-chain / network-ish failures
|
|
109
|
+
if (includesAny(lower, ['blockhash expired', 'blockhash not found'])) {
|
|
110
|
+
return new DepositError(DepositErrorCode.CLAIM_SUBMISSION_FAILED, rawMessage, true, 'Transaction expired. Retrying…', context, error);
|
|
111
|
+
}
|
|
112
|
+
if (includesAny(lower, ['fee payer not available', 'server fee payer not available', 'fee payer'])) {
|
|
113
|
+
return new DepositError(DepositErrorCode.NETWORK_ERROR, rawMessage, true, 'Claim server is not available. Retrying…', context, error);
|
|
114
|
+
}
|
|
115
|
+
if (includesAny(lower, ['bridge assist server is not available', 'server is not available', 'failed to fetch'])) {
|
|
116
|
+
return new DepositError(DepositErrorCode.NETWORK_ERROR, rawMessage, true, 'Claim server is not available. Retrying…', context, error);
|
|
117
|
+
}
|
|
118
|
+
if (includesAny(lower, ['timed out', 'timeout', 'transaction was not confirmed'])) {
|
|
119
|
+
return new DepositError(DepositErrorCode.NETWORK_ERROR, rawMessage, true, 'Network is taking too long to respond. Retrying…', context, error);
|
|
120
|
+
}
|
|
121
|
+
// Balance / allowance
|
|
122
|
+
if (lower.includes('insufficient')) {
|
|
123
|
+
return new DepositError(DepositErrorCode.INSUFFICIENT_BALANCE, rawMessage, false, 'Insufficient balance or allowance to complete the deposit.', context, error);
|
|
124
|
+
}
|
|
125
|
+
// Attestation signals
|
|
126
|
+
if (includesAny(lower, ['attestation not ready'])) {
|
|
127
|
+
return new DepositError(DepositErrorCode.ATTESTATION_NOT_READY, rawMessage, true, 'Attestation not ready yet. Please wait a moment and try again.', context, error);
|
|
128
|
+
}
|
|
129
|
+
if (includesAny(lower, ['attestation timeout'])) {
|
|
130
|
+
return new DepositError(DepositErrorCode.ATTESTATION_TIMEOUT, rawMessage, true, 'Bridge confirmation is taking too long. Please retry.', context, error);
|
|
131
|
+
}
|
|
132
|
+
return new DepositError(DepositErrorCode.UNKNOWN, rawMessage || 'Unknown error', false, rawMessage || 'Something went wrong. Please try again.', context, error);
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=depositError.js.map
|