@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,762 @@
|
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
38
|
+
import { createContext, useCallback, useContext, useEffect, useRef, useState } from 'react';
|
|
39
|
+
import { useN1WalletContext } from '../../../hooks';
|
|
40
|
+
import { logger } from '../../../utils/logger';
|
|
41
|
+
import { EVENTS, createDepositEvent } from '../../../utils/events';
|
|
42
|
+
import { createDepositError } from '../../../utils/errors';
|
|
43
|
+
import { useBridgeDeposit } from '../hooks/useBridgeDeposit';
|
|
44
|
+
import { useDepositAuth } from '../hooks/useDepositAuth';
|
|
45
|
+
import { useDepositHydration } from '../hooks/useDepositHydration';
|
|
46
|
+
import { usePendingDepositState } from '../hooks/usePendingDepositState';
|
|
47
|
+
import { useSolanaDeposit } from '../hooks/useSolanaDeposit';
|
|
48
|
+
import { OnboardingStep } from '../types';
|
|
49
|
+
import { deriveChainLabel } from '../utils/deposit/bridgeUtils';
|
|
50
|
+
import { toDepositError } from '../errors/depositError';
|
|
51
|
+
import { getSolanaExplorerUrl, } from '../utils/deposit/solanaDepositTransaction';
|
|
52
|
+
import { advancePendingDeposit, clearLastDepositRecord, clearPendingDeposit, readPendingDeposit, saveLastDepositRecord } from '../utils/deposit/storage';
|
|
53
|
+
import { isLikelyLedgerSolanaWallet } from '../utils/deposit/walletUtils';
|
|
54
|
+
import { explorerBaseForChain, pickExplorerUrl } from '../utils/explorerUrl';
|
|
55
|
+
import { useOnboardingState } from './OnboardingStateProvider';
|
|
56
|
+
import { useWalletConnection } from './WalletConnectionProvider';
|
|
57
|
+
import { useNetwork } from '../../../providers/N1WalletProvider/NetworkProvider';
|
|
58
|
+
import { useSession } from '../../../providers/N1WalletProvider/SessionProvider';
|
|
59
|
+
// Create the context with a default value
|
|
60
|
+
var DepositFlowContext = createContext(undefined);
|
|
61
|
+
/**
|
|
62
|
+
* Provider component for the deposit flow state
|
|
63
|
+
*/
|
|
64
|
+
export var DepositFlowProvider = function (_a) {
|
|
65
|
+
var children = _a.children;
|
|
66
|
+
// Get flow state context
|
|
67
|
+
var _b = useOnboardingState(), state = _b.state, context = _b.context, flowActions = _b.actions, updateContext = _b.updateContext, isDebugOverride = _b.isDebugOverride;
|
|
68
|
+
// Get wallet context
|
|
69
|
+
var nord = useN1WalletContext().nord;
|
|
70
|
+
var _c = useNetwork(), address = _c.solanaAddress, evmAddress = _c.evmAddress, solanaWallet = _c.solanaWallet, evmWallet = _c.evmWallet, solanaAdapter = _c.solanaAdapter;
|
|
71
|
+
var _d = useSession(), nordUser = _d.nordUser, turnkeyEnabled = _d.turnkeyEnabled;
|
|
72
|
+
var _e = useWalletConnection(), turnkeyAddress = _e.turnkeyAddress, turnkeyStatus = _e.turnkeyStatus;
|
|
73
|
+
// chain
|
|
74
|
+
var _f = useState(context.selectedChain), selectedChain = _f[0], setSelectedChain = _f[1];
|
|
75
|
+
// transaction & deposit
|
|
76
|
+
var _g = useState(context.amount), amount = _g[0], setAmount = _g[1];
|
|
77
|
+
var _h = useState(false), isDepositing = _h[0], setIsDepositing = _h[1];
|
|
78
|
+
// Initialize phase - only check deposit ID, determine bridge flow from context
|
|
79
|
+
var getInitialPhase = function () {
|
|
80
|
+
var _a, _b;
|
|
81
|
+
var pending = readPendingDeposit();
|
|
82
|
+
if (!(pending === null || pending === void 0 ? void 0 : pending.depositId))
|
|
83
|
+
return 'solana';
|
|
84
|
+
// Determine if it's a bridge flow from context (not from localStorage)
|
|
85
|
+
var entryNetwork = (_a = context.entryNetwork) !== null && _a !== void 0 ? _a : 'solana';
|
|
86
|
+
var selectedChainId = (_b = context.selectedChainId) !== null && _b !== void 0 ? _b : '';
|
|
87
|
+
var isBridgeFlow = entryNetwork === 'evm' && selectedChainId.toLowerCase() !== 'solana';
|
|
88
|
+
if (isBridgeFlow) {
|
|
89
|
+
// Bridge flow with deposit ID -> claim phase (we'll determine actual state by checking attestation)
|
|
90
|
+
return 'claim';
|
|
91
|
+
}
|
|
92
|
+
// Direct Solana flow
|
|
93
|
+
return 'solana';
|
|
94
|
+
};
|
|
95
|
+
var _j = useState(getInitialPhase()), depositProgressPhase = _j[0], setDepositProgressPhase = _j[1];
|
|
96
|
+
var _k = useState(context.transactionId), transactionId = _k[0], setTransactionId = _k[1];
|
|
97
|
+
var _l = useState(null), transactionResult = _l[0], setTransactionResult = _l[1];
|
|
98
|
+
var _m = useState(null), pendingBridgeExplorerUrl = _m[0], setPendingBridgeExplorerUrl = _m[1];
|
|
99
|
+
var _o = useState(null), pendingBridgeTx = _o[0], setPendingBridgeTx = _o[1];
|
|
100
|
+
var _p = useState(null), pendingMintTx = _p[0], setPendingMintTx = _p[1];
|
|
101
|
+
var bridgeCompletionRef = useRef(false);
|
|
102
|
+
var startDepositInFlightRef = useRef(false);
|
|
103
|
+
// Use refs to track previous values
|
|
104
|
+
var prevContextRef = useRef(context);
|
|
105
|
+
/**
|
|
106
|
+
* Handle an error by transitioning to error state
|
|
107
|
+
*/
|
|
108
|
+
var handleError = useCallback(function (error) {
|
|
109
|
+
var normalized = toDepositError(error);
|
|
110
|
+
logger.logError(createDepositError('BRIDGE_FAILED', normalized.message, {
|
|
111
|
+
recoverable: normalized.retryable,
|
|
112
|
+
cause: error,
|
|
113
|
+
context: {
|
|
114
|
+
code: normalized.code,
|
|
115
|
+
userMessage: normalized.userMessage,
|
|
116
|
+
details: normalized.details,
|
|
117
|
+
},
|
|
118
|
+
}));
|
|
119
|
+
flowActions.setErrorState(normalized);
|
|
120
|
+
}, [flowActions]);
|
|
121
|
+
var _q = useDepositAuth(), authStatus = _q.authStatus, authErrorMessage = _q.authErrorMessage, authStatusMessage = _q.authStatusMessage, performAuth = _q.performAuth;
|
|
122
|
+
var _r = usePendingDepositState(), setPendingDepositId = _r.setPendingDepositId, ensurePendingDraft = _r.ensurePendingDraft;
|
|
123
|
+
var finalizeBridgeSuccess = useCallback(function (status) {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
125
|
+
logger.info('[DepositFlow] finalizeBridgeSuccess called', status);
|
|
126
|
+
if (bridgeCompletionRef.current) {
|
|
127
|
+
logger.warn('[DepositFlow] finalizeBridgeSuccess skipped - already completed');
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
var pending = readPendingDeposit();
|
|
131
|
+
var draft = pending;
|
|
132
|
+
var chainInfo = deriveChainLabel((_b = (_a = draft === null || draft === void 0 ? void 0 : draft.chain) !== null && _a !== void 0 ? _a : context.selectedChainId) !== null && _b !== void 0 ? _b : selectedChain);
|
|
133
|
+
var txId = (_h = (_g = (_f = (_e = (_d = (_c = status.tx) !== null && _c !== void 0 ? _c : status.solanaTx) !== null && _d !== void 0 ? _d : status.mintTx) !== null && _e !== void 0 ? _e : status.bridgeTx) !== null && _f !== void 0 ? _f : draft === null || draft === void 0 ? void 0 : draft.tx) !== null && _g !== void 0 ? _g : draft === null || draft === void 0 ? void 0 : draft.mintTx) !== null && _h !== void 0 ? _h : null;
|
|
134
|
+
logger.debug('[DepositFlow] Finalizing bridge success', { txId: txId, draft: draft, chainInfo: chainInfo });
|
|
135
|
+
var depositAmount = (_j = ((draft === null || draft === void 0 ? void 0 : draft.amount) && draft.amount !== '' ? draft.amount : null)) !== null && _j !== void 0 ? _j : amount;
|
|
136
|
+
var record = {
|
|
137
|
+
transactionId: txId !== null && txId !== void 0 ? txId : 'pending-bridge',
|
|
138
|
+
amount: depositAmount,
|
|
139
|
+
tokenSymbol: 'USDC',
|
|
140
|
+
chainId: chainInfo.id,
|
|
141
|
+
chainName: chainInfo.name,
|
|
142
|
+
chainNetwork: (_k = context.selectedChainNetwork) !== null && _k !== void 0 ? _k : null,
|
|
143
|
+
timestamp: Date.now(),
|
|
144
|
+
};
|
|
145
|
+
var result = {
|
|
146
|
+
success: true,
|
|
147
|
+
transactionId: record.transactionId,
|
|
148
|
+
amount: depositAmount,
|
|
149
|
+
tokenSymbol: 'USDC',
|
|
150
|
+
fromAddress: address || 'Your Wallet',
|
|
151
|
+
toAddress: 'Exchange Account',
|
|
152
|
+
networkName: chainInfo.name,
|
|
153
|
+
status: 'Completed',
|
|
154
|
+
explorerUrl: (_o = (_m = pickExplorerUrl((_l = draft === null || draft === void 0 ? void 0 : draft.explorerUrl) !== null && _l !== void 0 ? _l : null, explorerBaseForChain(chainInfo.id), record.transactionId)) !== null && _m !== void 0 ? _m : getSolanaExplorerUrl(record.transactionId)) !== null && _o !== void 0 ? _o : undefined,
|
|
155
|
+
};
|
|
156
|
+
logger.info('[DepositFlow] marking bridge completion', { record: record });
|
|
157
|
+
bridgeCompletionRef.current = true;
|
|
158
|
+
setTransactionId(txId !== null && txId !== void 0 ? txId : null);
|
|
159
|
+
setTransactionResult(result);
|
|
160
|
+
setDepositProgressPhase('nord');
|
|
161
|
+
setIsDepositing(false);
|
|
162
|
+
clearPendingDeposit();
|
|
163
|
+
saveLastDepositRecord(address, record);
|
|
164
|
+
logger.info('[DepositFlow] dispatching markDepositSuccess');
|
|
165
|
+
flowActions.markDepositSuccess({
|
|
166
|
+
transactionId: record.transactionId,
|
|
167
|
+
record: record,
|
|
168
|
+
});
|
|
169
|
+
}, [address, amount, context.selectedChainId, context.selectedChainNetwork, evmAddress, flowActions, selectedChain]);
|
|
170
|
+
var runSolanaDeposit = useSolanaDeposit({
|
|
171
|
+
setDepositProgressPhase: setDepositProgressPhase,
|
|
172
|
+
ensurePendingDraft: ensurePendingDraft,
|
|
173
|
+
}).runSolanaDeposit;
|
|
174
|
+
var _s = useBridgeDeposit({
|
|
175
|
+
setDepositProgressPhase: setDepositProgressPhase,
|
|
176
|
+
setPendingBridgeTx: setPendingBridgeTx,
|
|
177
|
+
setPendingMintTx: setPendingMintTx,
|
|
178
|
+
setPendingDepositId: setPendingDepositId,
|
|
179
|
+
setPendingBridgeExplorerUrl: setPendingBridgeExplorerUrl,
|
|
180
|
+
ensurePendingDraft: ensurePendingDraft,
|
|
181
|
+
finalizeBridgeSuccess: finalizeBridgeSuccess,
|
|
182
|
+
setIsDepositing: setIsDepositing,
|
|
183
|
+
runSolanaDeposit: runSolanaDeposit,
|
|
184
|
+
}), startCctpBridge = _s.startCctpBridge, resumeClaimProcess = _s.resumeClaimProcess, bridgeRetryable = _s.bridgeRetryable, setBridgeRetryable = _s.setBridgeRetryable, bridgeError = _s.bridgeError, setBridgeError = _s.setBridgeError, bridgeApprovalPending = _s.bridgeApprovalPending, setBridgeApprovalPending = _s.setBridgeApprovalPending, bridgeApprovalError = _s.bridgeApprovalError, setBridgeApprovalError = _s.setBridgeApprovalError;
|
|
185
|
+
useDepositHydration({
|
|
186
|
+
setPendingDepositId: setPendingDepositId,
|
|
187
|
+
setAmount: setAmount,
|
|
188
|
+
setTransactionId: setTransactionId,
|
|
189
|
+
setIsDepositing: setIsDepositing,
|
|
190
|
+
setPendingBridgeExplorerUrl: setPendingBridgeExplorerUrl,
|
|
191
|
+
setPendingBridgeTx: setPendingBridgeTx,
|
|
192
|
+
setPendingMintTx: setPendingMintTx,
|
|
193
|
+
setDepositProgressPhase: setDepositProgressPhase,
|
|
194
|
+
setBridgeError: setBridgeError,
|
|
195
|
+
setBridgeRetryable: setBridgeRetryable,
|
|
196
|
+
});
|
|
197
|
+
/**
|
|
198
|
+
* Update amount for deposit
|
|
199
|
+
*/
|
|
200
|
+
var updateAmount = useCallback(function (newAmount) {
|
|
201
|
+
setAmount(newAmount);
|
|
202
|
+
updateContext({ amount: newAmount });
|
|
203
|
+
}, [updateContext]);
|
|
204
|
+
/**
|
|
205
|
+
* Helper to handle resuming a pending deposit
|
|
206
|
+
*/
|
|
207
|
+
var handleResumePendingDeposit = useCallback(function (pending, walletMatches) { return __awaiter(void 0, void 0, void 0, function () {
|
|
208
|
+
var e_1, pendingChain, pendingStage, isSolanaNative, txId, isEvmFlow, turnkeyReady, canClaim, errorMsg, bridgeTxFromPending, explorerUrl, claimError_1, normalized;
|
|
209
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
210
|
+
return __generator(this, function (_h) {
|
|
211
|
+
switch (_h.label) {
|
|
212
|
+
case 0:
|
|
213
|
+
// If user is connected with a different wallet, do not start a new deposit.
|
|
214
|
+
// Ask them to connect the correct wallet (or clear the pending deposit) first.
|
|
215
|
+
if (!walletMatches) {
|
|
216
|
+
logger.logError(createDepositError('WALLET_MISMATCH', 'Pending deposit exists but connected wallet does not match', {
|
|
217
|
+
recoverable: false,
|
|
218
|
+
context: {
|
|
219
|
+
pendingWallet: pending.wallet,
|
|
220
|
+
depositId: pending.depositId,
|
|
221
|
+
},
|
|
222
|
+
}));
|
|
223
|
+
setBridgeError('You have a pending deposit. Please connect the same wallet that started it to continue.');
|
|
224
|
+
setBridgeRetryable(false);
|
|
225
|
+
setIsDepositing(false);
|
|
226
|
+
setDepositProgressPhase('claim');
|
|
227
|
+
setPendingDepositId(pending.depositId);
|
|
228
|
+
return [2 /*return*/];
|
|
229
|
+
}
|
|
230
|
+
if (!solanaWallet) return [3 /*break*/, 4];
|
|
231
|
+
_h.label = 1;
|
|
232
|
+
case 1:
|
|
233
|
+
_h.trys.push([1, 3, , 4]);
|
|
234
|
+
return [4 /*yield*/, isLikelyLedgerSolanaWallet(solanaWallet, solanaAdapter)];
|
|
235
|
+
case 2:
|
|
236
|
+
if (_h.sent()) {
|
|
237
|
+
logger.logError(createDepositError('LEDGER_UNSUPPORTED', 'Ledger-like wallet detected during resume', {
|
|
238
|
+
recoverable: false,
|
|
239
|
+
}));
|
|
240
|
+
setBridgeError('Ledger wallets are not supported. Please connect a standard wallet to continue.');
|
|
241
|
+
setBridgeRetryable(false);
|
|
242
|
+
setIsDepositing(false);
|
|
243
|
+
return [2 /*return*/];
|
|
244
|
+
}
|
|
245
|
+
return [3 /*break*/, 4];
|
|
246
|
+
case 3:
|
|
247
|
+
e_1 = _h.sent();
|
|
248
|
+
if ((e_1 === null || e_1 === void 0 ? void 0 : e_1.code) === 'N1_SIGNATURE_CANCELLED') {
|
|
249
|
+
setIsDepositing(false);
|
|
250
|
+
flowActions.markDepositFailed('Signature cancelled');
|
|
251
|
+
return [2 /*return*/];
|
|
252
|
+
}
|
|
253
|
+
throw e_1;
|
|
254
|
+
case 4:
|
|
255
|
+
pendingChain = ((_a = pending.chain) !== null && _a !== void 0 ? _a : '').toLowerCase();
|
|
256
|
+
pendingStage = ((_b = pending.stage) !== null && _b !== void 0 ? _b : '').toLowerCase();
|
|
257
|
+
isSolanaNative = pendingChain === 'solana' ||
|
|
258
|
+
pendingStage.includes('solana') ||
|
|
259
|
+
((!pendingChain || pendingChain === 'solana') && !pendingStage.includes('bridge'));
|
|
260
|
+
if (isSolanaNative) {
|
|
261
|
+
logger.info('[Deposit] ===== SOLANA RESUME DETECTED =====', {
|
|
262
|
+
depositId: pending.depositId,
|
|
263
|
+
chain: pending.chain,
|
|
264
|
+
stage: pending.stage
|
|
265
|
+
});
|
|
266
|
+
// If the deposit is already confirmed, transition to success immediately
|
|
267
|
+
if (pending.stage === 'solana_confirmed') {
|
|
268
|
+
logger.info('[Deposit] Solana deposit already confirmed - transitioning to success', {
|
|
269
|
+
depositId: pending.depositId,
|
|
270
|
+
tx: pending.tx,
|
|
271
|
+
mintTx: pending.mintTx,
|
|
272
|
+
});
|
|
273
|
+
txId = pending.mintTx || pending.tx || pending.depositId;
|
|
274
|
+
clearPendingDeposit();
|
|
275
|
+
flowActions.markDepositSuccess({
|
|
276
|
+
transactionId: txId,
|
|
277
|
+
record: {
|
|
278
|
+
transactionId: txId,
|
|
279
|
+
amount: (_c = pending.amount) !== null && _c !== void 0 ? _c : '0',
|
|
280
|
+
tokenSymbol: 'USDC',
|
|
281
|
+
chainId: (_d = pending.chain) !== null && _d !== void 0 ? _d : 'solana',
|
|
282
|
+
chainName: pending.chain === 'solana' ? 'Solana' : ((_e = pending.chain) !== null && _e !== void 0 ? _e : 'Solana'),
|
|
283
|
+
chainNetwork: null,
|
|
284
|
+
timestamp: Date.now(),
|
|
285
|
+
},
|
|
286
|
+
});
|
|
287
|
+
return [2 /*return*/];
|
|
288
|
+
}
|
|
289
|
+
setPendingDepositId(pending.depositId);
|
|
290
|
+
setDepositProgressPhase('solana');
|
|
291
|
+
// If we have a transaction hash, we can try to "resume" monitoring,
|
|
292
|
+
// but typically the UI just needs to be in 'solana' phase and useSolanaDeposit internals
|
|
293
|
+
// or the user interaction will handle the rest.
|
|
294
|
+
// If there's NO tx hash, it just means they started but didn't sign.
|
|
295
|
+
// In that case, we should probably allow them to just "Retry" (sign again)
|
|
296
|
+
// rather than showing a "missing bridge hash" error.
|
|
297
|
+
if (pending.tx) {
|
|
298
|
+
setTransactionId(pending.tx);
|
|
299
|
+
// We could try to auto-monitor here if we had a dedicated "resumeSolana" function,
|
|
300
|
+
// but for now, setting phase to 'solana' allows the user to see the state.
|
|
301
|
+
// If it was already confirmed, the initial hydration might have caught it?
|
|
302
|
+
// or we just let them "Retry" if it seems stuck.
|
|
303
|
+
setBridgeError('Transaction submitted. Please wait for confirmation.');
|
|
304
|
+
setBridgeRetryable(false); // Maybe true if they want to try again?
|
|
305
|
+
setIsDepositing(true);
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
// No TX hash yet - likely interrupted before signing
|
|
309
|
+
logger.info('[Deposit] Solana deposit resumed without TX - allowing retry');
|
|
310
|
+
setBridgeError(null);
|
|
311
|
+
setBridgeRetryable(true); // Allow them to click "Sign" / "Retry"
|
|
312
|
+
setIsDepositing(false);
|
|
313
|
+
}
|
|
314
|
+
return [2 /*return*/];
|
|
315
|
+
}
|
|
316
|
+
// --- EVM / CCTP FLOW BELOW ---
|
|
317
|
+
// STATE 1: Pending deposit ID exists and matches wallet address (EVM or Solana) -> CLAIM
|
|
318
|
+
logger.info('[Deposit] ===== CLAIM MODE DETECTED (CCTP) =====', {
|
|
319
|
+
depositId: pending.depositId,
|
|
320
|
+
});
|
|
321
|
+
isEvmFlow = context.entryNetwork === 'evm';
|
|
322
|
+
turnkeyReady = !turnkeyEnabled || !!solanaWallet;
|
|
323
|
+
canClaim = !isEvmFlow || turnkeyReady;
|
|
324
|
+
if (!canClaim) {
|
|
325
|
+
errorMsg = turnkeyEnabled && !solanaWallet
|
|
326
|
+
? 'Preparing Solana wallet... Please wait.'
|
|
327
|
+
: 'Wallet not ready. Please try again.';
|
|
328
|
+
setBridgeError(errorMsg);
|
|
329
|
+
setBridgeRetryable(true);
|
|
330
|
+
setIsDepositing(false);
|
|
331
|
+
return [2 /*return*/];
|
|
332
|
+
}
|
|
333
|
+
// Clear previous errors
|
|
334
|
+
setBridgeError(null);
|
|
335
|
+
setBridgeRetryable(false);
|
|
336
|
+
setBridgeApprovalError(null);
|
|
337
|
+
bridgeTxFromPending = (_f = pending.tx) !== null && _f !== void 0 ? _f : null;
|
|
338
|
+
if (bridgeTxFromPending) {
|
|
339
|
+
setPendingBridgeTx(bridgeTxFromPending);
|
|
340
|
+
explorerUrl = (_g = pending.explorerUrl) !== null && _g !== void 0 ? _g : pickExplorerUrl(null, explorerBaseForChain(pending.chain), bridgeTxFromPending);
|
|
341
|
+
if (explorerUrl) {
|
|
342
|
+
setPendingBridgeExplorerUrl(explorerUrl);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
logger.warn('[DepositFlow] Pending deposit missing bridge tx hash');
|
|
347
|
+
setPendingDepositId(pending.depositId);
|
|
348
|
+
setDepositProgressPhase('claim');
|
|
349
|
+
setBridgeError('Pending deposit found, but the bridge transaction hash is missing. Please retry from the progress screen.');
|
|
350
|
+
setBridgeRetryable(true);
|
|
351
|
+
setIsDepositing(false);
|
|
352
|
+
return [2 /*return*/];
|
|
353
|
+
}
|
|
354
|
+
// Restore mint tx
|
|
355
|
+
if (pending.mintTx) {
|
|
356
|
+
setPendingMintTx(pending.mintTx);
|
|
357
|
+
}
|
|
358
|
+
setPendingDepositId(pending.depositId);
|
|
359
|
+
setDepositProgressPhase('claim');
|
|
360
|
+
setIsDepositing(true);
|
|
361
|
+
_h.label = 5;
|
|
362
|
+
case 5:
|
|
363
|
+
_h.trys.push([5, 7, , 8]);
|
|
364
|
+
return [4 /*yield*/, resumeClaimProcess(pending)];
|
|
365
|
+
case 6:
|
|
366
|
+
_h.sent();
|
|
367
|
+
return [3 /*break*/, 8];
|
|
368
|
+
case 7:
|
|
369
|
+
claimError_1 = _h.sent();
|
|
370
|
+
normalized = toDepositError(claimError_1, { depositId: pending.depositId, stage: 'claim' });
|
|
371
|
+
setIsDepositing(false);
|
|
372
|
+
setBridgeError(normalized.userMessage);
|
|
373
|
+
setBridgeRetryable(normalized.retryable);
|
|
374
|
+
throw claimError_1;
|
|
375
|
+
case 8: return [2 /*return*/];
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
}); }, [
|
|
379
|
+
context.entryNetwork,
|
|
380
|
+
solanaWallet,
|
|
381
|
+
turnkeyEnabled,
|
|
382
|
+
setBridgeError,
|
|
383
|
+
setBridgeRetryable,
|
|
384
|
+
setIsDepositing,
|
|
385
|
+
setDepositProgressPhase,
|
|
386
|
+
setPendingDepositId,
|
|
387
|
+
setBridgeApprovalError,
|
|
388
|
+
setPendingBridgeTx,
|
|
389
|
+
setPendingBridgeExplorerUrl,
|
|
390
|
+
setPendingMintTx,
|
|
391
|
+
resumeClaimProcess,
|
|
392
|
+
setTransactionId
|
|
393
|
+
]);
|
|
394
|
+
/**
|
|
395
|
+
* Helper to validate conditions for a new deposit
|
|
396
|
+
*/
|
|
397
|
+
var validateNewDeposit = useCallback(function (amountStr, isBridgeFlow, targetChainId) {
|
|
398
|
+
if (!amountStr || parseFloat(amountStr) <= 0) {
|
|
399
|
+
throw new Error('Invalid amount');
|
|
400
|
+
}
|
|
401
|
+
if (!nord) {
|
|
402
|
+
throw new Error('Nord client is unavailable. Please check your configuration and try again.');
|
|
403
|
+
}
|
|
404
|
+
if (!nordUser) {
|
|
405
|
+
throw new Error('Your Nord session is not ready yet. Reconnect your wallet to retry.');
|
|
406
|
+
}
|
|
407
|
+
if (!address && !turnkeyAddress) {
|
|
408
|
+
throw new Error('We were unable to determine your Solana deposit address. Please reconnect your wallet and try again.');
|
|
409
|
+
}
|
|
410
|
+
if (isBridgeFlow && !evmAddress) {
|
|
411
|
+
throw new Error('No connected EVM wallet was found for bridging. Please reconnect your EVM wallet.');
|
|
412
|
+
}
|
|
413
|
+
}, [nord, nordUser, address, turnkeyAddress, evmAddress]);
|
|
414
|
+
/**
|
|
415
|
+
* Helper to handle starting a NEW deposit
|
|
416
|
+
*/
|
|
417
|
+
var handleNewDeposit = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
418
|
+
var targetChainId, normalizedTargetChainIdRaw, normalizedTargetChainId, hasEvmWallet, isEvmChain, isBridgeFlow, e_2, pendingState, txId, result, depositRecord, depositError_1, normalized, existing, isBridgeError;
|
|
419
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
420
|
+
return __generator(this, function (_h) {
|
|
421
|
+
switch (_h.label) {
|
|
422
|
+
case 0:
|
|
423
|
+
logger.debug('[DepositFlow] SUBMIT MODE: Starting new deposit');
|
|
424
|
+
// Cleanup previous state
|
|
425
|
+
bridgeCompletionRef.current = false;
|
|
426
|
+
setPendingBridgeTx(null);
|
|
427
|
+
setPendingMintTx(null);
|
|
428
|
+
setPendingBridgeExplorerUrl(null);
|
|
429
|
+
setBridgeError(null);
|
|
430
|
+
setBridgeRetryable(false);
|
|
431
|
+
setBridgeApprovalError(null);
|
|
432
|
+
targetChainId = (_b = (_a = context.selectedChainId) !== null && _a !== void 0 ? _a : (context.selectedChain ? context.selectedChain.toLowerCase() : null)) !== null && _b !== void 0 ? _b : (selectedChain ? selectedChain.toLowerCase() : null);
|
|
433
|
+
normalizedTargetChainIdRaw = ((_c = targetChainId !== null && targetChainId !== void 0 ? targetChainId : context.entryNetwork) !== null && _c !== void 0 ? _c : 'solana').toLowerCase();
|
|
434
|
+
normalizedTargetChainId = normalizedTargetChainIdRaw === 'evm'
|
|
435
|
+
? 'ethereum'
|
|
436
|
+
: normalizedTargetChainIdRaw === 'arb' || normalizedTargetChainIdRaw === 'arbitrum-one'
|
|
437
|
+
? 'arbitrum'
|
|
438
|
+
: normalizedTargetChainIdRaw;
|
|
439
|
+
hasEvmWallet = !!evmAddress;
|
|
440
|
+
isEvmChain = normalizedTargetChainId !== 'solana';
|
|
441
|
+
isBridgeFlow = hasEvmWallet && isEvmChain;
|
|
442
|
+
if (!(!isBridgeFlow && solanaWallet)) return [3 /*break*/, 4];
|
|
443
|
+
_h.label = 1;
|
|
444
|
+
case 1:
|
|
445
|
+
_h.trys.push([1, 3, , 4]);
|
|
446
|
+
return [4 /*yield*/, isLikelyLedgerSolanaWallet(solanaWallet, solanaAdapter)];
|
|
447
|
+
case 2:
|
|
448
|
+
if (_h.sent()) {
|
|
449
|
+
handleError(new Error('Ledger wallets are not supported for this action'));
|
|
450
|
+
return [2 /*return*/];
|
|
451
|
+
}
|
|
452
|
+
return [3 /*break*/, 4];
|
|
453
|
+
case 3:
|
|
454
|
+
e_2 = _h.sent();
|
|
455
|
+
if ((e_2 === null || e_2 === void 0 ? void 0 : e_2.code) === 'N1_SIGNATURE_CANCELLED') {
|
|
456
|
+
setIsDepositing(false);
|
|
457
|
+
flowActions.markDepositFailed('Signature cancelled');
|
|
458
|
+
return [2 /*return*/];
|
|
459
|
+
}
|
|
460
|
+
handleError(e_2 instanceof Error ? e_2 : new Error(String(e_2)));
|
|
461
|
+
return [2 /*return*/];
|
|
462
|
+
case 4:
|
|
463
|
+
try {
|
|
464
|
+
validateNewDeposit(amount, isBridgeFlow, targetChainId);
|
|
465
|
+
}
|
|
466
|
+
catch (validationError) {
|
|
467
|
+
handleError(validationError);
|
|
468
|
+
return [2 /*return*/];
|
|
469
|
+
}
|
|
470
|
+
logger.event(createDepositEvent(EVENTS.DEPOSIT.START, {
|
|
471
|
+
amount: amount,
|
|
472
|
+
chain: selectedChain || context.selectedChain,
|
|
473
|
+
isBridgeFlow: isBridgeFlow,
|
|
474
|
+
}));
|
|
475
|
+
setIsDepositing(true);
|
|
476
|
+
flowActions.startDeposit();
|
|
477
|
+
_h.label = 5;
|
|
478
|
+
case 5:
|
|
479
|
+
_h.trys.push([5, 9, 10, 11]);
|
|
480
|
+
if (!isBridgeFlow) return [3 /*break*/, 7];
|
|
481
|
+
return [4 /*yield*/, startCctpBridge(amount)];
|
|
482
|
+
case 6:
|
|
483
|
+
_h.sent();
|
|
484
|
+
setDepositProgressPhase('bridge');
|
|
485
|
+
return [2 /*return*/];
|
|
486
|
+
case 7:
|
|
487
|
+
pendingState = ensurePendingDraft(amount);
|
|
488
|
+
return [4 /*yield*/, runSolanaDeposit(amount, pendingState)];
|
|
489
|
+
case 8:
|
|
490
|
+
txId = (_h.sent()).txId;
|
|
491
|
+
result = {
|
|
492
|
+
success: true,
|
|
493
|
+
transactionId: txId,
|
|
494
|
+
amount: amount,
|
|
495
|
+
tokenSymbol: 'USDC',
|
|
496
|
+
fromAddress: address || 'Your Wallet',
|
|
497
|
+
toAddress: 'Exchange Account',
|
|
498
|
+
networkName: (_d = selectedChain !== null && selectedChain !== void 0 ? selectedChain : context.selectedChain) !== null && _d !== void 0 ? _d : 'Solana',
|
|
499
|
+
status: 'Completed',
|
|
500
|
+
explorerUrl: getSolanaExplorerUrl(txId),
|
|
501
|
+
};
|
|
502
|
+
depositRecord = {
|
|
503
|
+
transactionId: txId,
|
|
504
|
+
amount: amount,
|
|
505
|
+
tokenSymbol: 'USDC',
|
|
506
|
+
chainId: (_e = context.selectedChainId) !== null && _e !== void 0 ? _e : (selectedChain !== null && selectedChain !== void 0 ? selectedChain : 'solana'),
|
|
507
|
+
chainName: (_f = context.selectedChain) !== null && _f !== void 0 ? _f : (selectedChain !== null && selectedChain !== void 0 ? selectedChain : 'Solana'),
|
|
508
|
+
chainNetwork: (_g = context.selectedChainNetwork) !== null && _g !== void 0 ? _g : null,
|
|
509
|
+
timestamp: Date.now(),
|
|
510
|
+
};
|
|
511
|
+
saveLastDepositRecord(address, depositRecord);
|
|
512
|
+
clearPendingDeposit();
|
|
513
|
+
setPendingDepositId(null);
|
|
514
|
+
setBridgeRetryable(false);
|
|
515
|
+
setBridgeError(null);
|
|
516
|
+
setTransactionId(txId);
|
|
517
|
+
setTransactionResult(result);
|
|
518
|
+
logger.event(createDepositEvent(EVENTS.DEPOSIT.COMPLETE, {
|
|
519
|
+
transactionId: txId,
|
|
520
|
+
amount: amount,
|
|
521
|
+
chain: selectedChain || context.selectedChain,
|
|
522
|
+
}));
|
|
523
|
+
flowActions.markDepositSuccess({
|
|
524
|
+
transactionId: txId,
|
|
525
|
+
record: depositRecord,
|
|
526
|
+
});
|
|
527
|
+
return [3 /*break*/, 11];
|
|
528
|
+
case 9:
|
|
529
|
+
depositError_1 = _h.sent();
|
|
530
|
+
normalized = toDepositError(depositError_1, {
|
|
531
|
+
stage: depositProgressPhase,
|
|
532
|
+
isBridgeFlow: depositProgressPhase === 'bridge' || depositProgressPhase === 'claim',
|
|
533
|
+
});
|
|
534
|
+
logger.event(createDepositEvent(EVENTS.DEPOSIT.FAILED, {
|
|
535
|
+
code: normalized.code,
|
|
536
|
+
message: normalized.message,
|
|
537
|
+
retryable: normalized.retryable,
|
|
538
|
+
stage: depositProgressPhase,
|
|
539
|
+
}));
|
|
540
|
+
logger.logError(createDepositError('BRIDGE_FAILED', normalized.message || 'Deposit failed', {
|
|
541
|
+
recoverable: normalized.retryable,
|
|
542
|
+
context: { code: normalized.code, stage: depositProgressPhase },
|
|
543
|
+
cause: depositError_1 instanceof Error ? depositError_1 : undefined,
|
|
544
|
+
}));
|
|
545
|
+
// Try to persist failure state
|
|
546
|
+
try {
|
|
547
|
+
existing = readPendingDeposit();
|
|
548
|
+
if (existing) {
|
|
549
|
+
advancePendingDeposit(existing, {
|
|
550
|
+
stage: normalized.retryable ? existing.stage : 'failed',
|
|
551
|
+
reason: normalized.message || 'Deposit failed',
|
|
552
|
+
});
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
catch (e) { /* ignore */ }
|
|
556
|
+
isBridgeError = depositProgressPhase === 'bridge' || depositProgressPhase === 'claim';
|
|
557
|
+
if (isBridgeError) {
|
|
558
|
+
setBridgeError(normalized.userMessage);
|
|
559
|
+
setBridgeRetryable(normalized.retryable);
|
|
560
|
+
if (bridgeApprovalPending) {
|
|
561
|
+
setBridgeApprovalError(normalized.userMessage);
|
|
562
|
+
setBridgeApprovalPending(false);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
if (normalized.retryable) {
|
|
566
|
+
setBridgeError(normalized.userMessage);
|
|
567
|
+
setBridgeRetryable(true);
|
|
568
|
+
return [2 /*return*/];
|
|
569
|
+
}
|
|
570
|
+
flowActions.markDepositFailed(normalized.message || 'Failed to process deposit');
|
|
571
|
+
return [3 /*break*/, 11];
|
|
572
|
+
case 10:
|
|
573
|
+
setIsDepositing(false);
|
|
574
|
+
return [7 /*endfinally*/];
|
|
575
|
+
case 11: return [2 /*return*/];
|
|
576
|
+
}
|
|
577
|
+
});
|
|
578
|
+
}); }, [
|
|
579
|
+
context,
|
|
580
|
+
selectedChain,
|
|
581
|
+
evmAddress,
|
|
582
|
+
solanaWallet,
|
|
583
|
+
evmWallet,
|
|
584
|
+
amount,
|
|
585
|
+
address,
|
|
586
|
+
turnkeyAddress,
|
|
587
|
+
nord,
|
|
588
|
+
nordUser,
|
|
589
|
+
handleError,
|
|
590
|
+
setBridgeError,
|
|
591
|
+
setBridgeRetryable,
|
|
592
|
+
setBridgeApprovalError,
|
|
593
|
+
setPendingBridgeTx,
|
|
594
|
+
setPendingMintTx,
|
|
595
|
+
setPendingBridgeExplorerUrl,
|
|
596
|
+
setPendingDepositId,
|
|
597
|
+
setDepositProgressPhase,
|
|
598
|
+
startCctpBridge,
|
|
599
|
+
runSolanaDeposit,
|
|
600
|
+
ensurePendingDraft,
|
|
601
|
+
flowActions,
|
|
602
|
+
depositProgressPhase,
|
|
603
|
+
bridgeApprovalPending,
|
|
604
|
+
validateNewDeposit,
|
|
605
|
+
setTransactionId,
|
|
606
|
+
setTransactionResult,
|
|
607
|
+
bridgeApprovalPending
|
|
608
|
+
]);
|
|
609
|
+
/**
|
|
610
|
+
* Main entry point for starting a deposit
|
|
611
|
+
*/
|
|
612
|
+
var startDeposit = useCallback(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
613
|
+
var pending, pendingWalletLower, evmAddressLower, addressLower, walletMatches;
|
|
614
|
+
var _a, _b, _c, _d;
|
|
615
|
+
return __generator(this, function (_e) {
|
|
616
|
+
switch (_e.label) {
|
|
617
|
+
case 0:
|
|
618
|
+
if (startDepositInFlightRef.current) {
|
|
619
|
+
logger.debug('[DepositFlow] startDeposit ignored (already in flight)');
|
|
620
|
+
return [2 /*return*/];
|
|
621
|
+
}
|
|
622
|
+
startDepositInFlightRef.current = true;
|
|
623
|
+
_e.label = 1;
|
|
624
|
+
case 1:
|
|
625
|
+
_e.trys.push([1, , 5, 6]);
|
|
626
|
+
logger.debug('[DepositFlow] startDeposit called');
|
|
627
|
+
updateContext({ depositError: undefined });
|
|
628
|
+
pending = readPendingDeposit();
|
|
629
|
+
if (!(pending === null || pending === void 0 ? void 0 : pending.depositId)) return [3 /*break*/, 3];
|
|
630
|
+
pendingWalletLower = (_b = (_a = pending.wallet) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== null && _b !== void 0 ? _b : '';
|
|
631
|
+
evmAddressLower = (_c = evmAddress === null || evmAddress === void 0 ? void 0 : evmAddress.toLowerCase()) !== null && _c !== void 0 ? _c : '';
|
|
632
|
+
addressLower = (_d = address === null || address === void 0 ? void 0 : address.toLowerCase()) !== null && _d !== void 0 ? _d : '';
|
|
633
|
+
walletMatches = pendingWalletLower && (evmAddressLower === pendingWalletLower ||
|
|
634
|
+
addressLower === pendingWalletLower);
|
|
635
|
+
return [4 /*yield*/, handleResumePendingDeposit(pending, !!walletMatches)];
|
|
636
|
+
case 2:
|
|
637
|
+
_e.sent();
|
|
638
|
+
return [2 /*return*/];
|
|
639
|
+
case 3:
|
|
640
|
+
// Otherwise, start a new one
|
|
641
|
+
return [4 /*yield*/, handleNewDeposit()];
|
|
642
|
+
case 4:
|
|
643
|
+
// Otherwise, start a new one
|
|
644
|
+
_e.sent();
|
|
645
|
+
return [3 /*break*/, 6];
|
|
646
|
+
case 5:
|
|
647
|
+
startDepositInFlightRef.current = false;
|
|
648
|
+
return [7 /*endfinally*/];
|
|
649
|
+
case 6: return [2 /*return*/];
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
}); }, [
|
|
653
|
+
readPendingDeposit,
|
|
654
|
+
evmAddress,
|
|
655
|
+
address,
|
|
656
|
+
handleResumePendingDeposit,
|
|
657
|
+
handleNewDeposit,
|
|
658
|
+
updateContext
|
|
659
|
+
]);
|
|
660
|
+
/**
|
|
661
|
+
* Complete the deposit process and move to the next screen
|
|
662
|
+
*/
|
|
663
|
+
var completeDeposit = useCallback(function () {
|
|
664
|
+
clearLastDepositRecord(address);
|
|
665
|
+
clearPendingDeposit();
|
|
666
|
+
setPendingDepositId(null);
|
|
667
|
+
updateContext({ lastDeposit: null });
|
|
668
|
+
if (context.isDepositOnlyFlow) {
|
|
669
|
+
flowActions.completeFlow({
|
|
670
|
+
hasNordAccount: true,
|
|
671
|
+
hasActiveSession: true,
|
|
672
|
+
});
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
// Check if user has an active session to determine the next state
|
|
676
|
+
if (context.hasActiveSession) {
|
|
677
|
+
// If user has an active session, go directly to FINAL_SUCCESS
|
|
678
|
+
flowActions.completeFlow({
|
|
679
|
+
hasNordAccount: true,
|
|
680
|
+
hasActiveSession: true,
|
|
681
|
+
});
|
|
682
|
+
}
|
|
683
|
+
else {
|
|
684
|
+
// If user doesn't have an active session, go to authentication flow
|
|
685
|
+
flowActions.requireAuth({ hasNordAccount: true });
|
|
686
|
+
}
|
|
687
|
+
}, [context.hasActiveSession, context.isDepositOnlyFlow, flowActions, address, updateContext, evmAddress, setPendingDepositId]);
|
|
688
|
+
/**
|
|
689
|
+
* Update state based on context changes
|
|
690
|
+
*/
|
|
691
|
+
useEffect(function () {
|
|
692
|
+
var prevContext = prevContextRef.current;
|
|
693
|
+
// Only update state if the relevant context values have actually changed
|
|
694
|
+
if (context.selectedChain !== prevContext.selectedChain) {
|
|
695
|
+
setSelectedChain(context.selectedChain);
|
|
696
|
+
}
|
|
697
|
+
if (context.amount !== prevContext.amount) {
|
|
698
|
+
setAmount(context.amount);
|
|
699
|
+
}
|
|
700
|
+
if (context.transactionId !== prevContext.transactionId) {
|
|
701
|
+
setTransactionId(context.transactionId);
|
|
702
|
+
}
|
|
703
|
+
// Update the ref to the current context
|
|
704
|
+
prevContextRef.current = context;
|
|
705
|
+
}, [context]);
|
|
706
|
+
// Phase correction logic removed.
|
|
707
|
+
// We now rely on correct hydration in useDepositHydration.ts.
|
|
708
|
+
useEffect(function () {
|
|
709
|
+
var _a, _b;
|
|
710
|
+
if (!isDebugOverride || state !== OnboardingStep.DEPOSIT_SUCCESS || transactionResult) {
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
var mockTransactionId = (_a = context.transactionId) !== null && _a !== void 0 ? _a : 'debug-tx-12345';
|
|
714
|
+
var fallbackChain = (_b = context.selectedChain) !== null && _b !== void 0 ? _b : 'Solana';
|
|
715
|
+
setTransactionId(mockTransactionId);
|
|
716
|
+
setTransactionResult({
|
|
717
|
+
success: true,
|
|
718
|
+
transactionId: mockTransactionId,
|
|
719
|
+
amount: context.amount || '1,250',
|
|
720
|
+
tokenSymbol: 'USDC',
|
|
721
|
+
fromAddress: address || 'Debug Wallet',
|
|
722
|
+
toAddress: 'Nord Account',
|
|
723
|
+
networkName: fallbackChain,
|
|
724
|
+
status: 'Completed',
|
|
725
|
+
explorerUrl: getSolanaExplorerUrl(mockTransactionId),
|
|
726
|
+
});
|
|
727
|
+
}, [isDebugOverride, state, transactionResult, context, address]);
|
|
728
|
+
// Create the context value
|
|
729
|
+
var contextValue = {
|
|
730
|
+
amount: amount,
|
|
731
|
+
isDepositing: isDepositing,
|
|
732
|
+
depositProgressPhase: depositProgressPhase,
|
|
733
|
+
pendingBridgeExplorerUrl: pendingBridgeExplorerUrl,
|
|
734
|
+
pendingBridgeTx: pendingBridgeTx,
|
|
735
|
+
pendingMintTx: pendingMintTx,
|
|
736
|
+
bridgeRetryable: bridgeRetryable,
|
|
737
|
+
bridgeApprovalPending: bridgeApprovalPending,
|
|
738
|
+
bridgeApprovalError: bridgeApprovalError,
|
|
739
|
+
bridgeError: bridgeError,
|
|
740
|
+
transactionId: transactionId,
|
|
741
|
+
transactionResult: transactionResult,
|
|
742
|
+
authStatus: authStatus,
|
|
743
|
+
authErrorMessage: authErrorMessage,
|
|
744
|
+
authStatusMessage: authStatusMessage,
|
|
745
|
+
updateAmount: updateAmount,
|
|
746
|
+
startDeposit: startDeposit,
|
|
747
|
+
completeDeposit: completeDeposit,
|
|
748
|
+
performAuth: performAuth,
|
|
749
|
+
};
|
|
750
|
+
return (_jsx(DepositFlowContext.Provider, { value: contextValue, children: children }));
|
|
751
|
+
};
|
|
752
|
+
/**
|
|
753
|
+
* Hook to use the deposit flow context
|
|
754
|
+
*/
|
|
755
|
+
export var useDepositFlow = function () {
|
|
756
|
+
var context = useContext(DepositFlowContext);
|
|
757
|
+
if (context === undefined) {
|
|
758
|
+
throw new Error('useDepositFlow must be used within a DepositFlowProvider');
|
|
759
|
+
}
|
|
760
|
+
return context;
|
|
761
|
+
};
|
|
762
|
+
//# sourceMappingURL=DepositFlowProvider.js.map
|