@privy-io/react-auth 3.12.0 → 3.12.1-beta-20260128234636
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/cjs/AccountNotFoundScreen-DBramzeJ.js +1 -0
- package/dist/cjs/{Address-6qDWL5TN.js → Address-B3n6an_E.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-CPSpq0C6.js +6 -0
- package/dist/cjs/AllowlistRejectionScreen-BAH9dA4M.js +1 -0
- package/dist/cjs/AuthenticateWithWalletScreen-CLyXmbf9.js +1 -0
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-A6h7gwhx.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-DtWr7lXB.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-B8-PAQCp.js +103 -0
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-Cy4Sf5-r.js +2 -0
- package/dist/cjs/{BridgeNetworkSelectionView-DKA06V8u.js → BridgeNetworkSelectionView-DafNn8w7.js} +1 -1
- package/dist/cjs/CaptchaScreen-cKcm3kF3.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-C22v2nBP.js +16 -0
- package/dist/cjs/{ConnectEmailForm-DZrCSv9t.js → ConnectEmailForm-0tcp5WIo.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-v0lTZbNZ.js +9 -0
- package/dist/cjs/ConnectOnlyLandingScreen-BoUoz2T3.js +1 -0
- package/dist/cjs/ConnectOnlyStatusScreen-2I5fXBYo.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-COeokpK3.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-BWSmRonl.js → ConnectPhoneForm-5J-HI-6c.js} +1 -1
- package/dist/cjs/{ConnectWalletView-Bh1DK9t5.js → ConnectWalletView-BP7jtIOS.js} +8 -8
- package/dist/cjs/ConnectionStatusScreen-D4fGSRqf.js +7 -0
- package/dist/cjs/CrossAppAuthScreen-M_c4PWjZ.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-DP1fJrBU.js → CustomLandingScreenView-zuP1y51E.js} +1 -1
- package/dist/cjs/DelegatedActionsConsentScreen-B_K3Ii9B.js +1 -0
- package/dist/cjs/DelegatedActionsRevokeScreen-C6WEMQeE.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-BncvqX7Q.js +1 -0
- package/dist/cjs/EmbeddedWalletCreatedScreen-BvQmJMT2.js +1 -0
- package/dist/cjs/EmbeddedWalletKeyExportScreen-Cd8noSvo.js +40 -0
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-DXvtKset.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-ClEyXQFM.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-BUChPmFP.js +1 -0
- package/dist/cjs/{EnrollTotp-leOB_B4o.js → EnrollTotp-7ClajYO5.js} +1 -1
- package/dist/cjs/ErrorScreen-DeTAcSrU.js +4 -0
- package/dist/cjs/{FarcasterConnectStatusScreen-Bzmd4izn.js → FarcasterConnectStatusScreen-CTqliSQQ.js} +4 -4
- package/dist/cjs/{FarcasterSignerStatusScreen-Cxoi54pp.js → FarcasterSignerStatusScreen-BfpG-vxs.js} +1 -1
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-nk3-8Cko.js +2 -0
- package/dist/cjs/{FundWalletMethodHeader-YwNCXAU_.js → FundWalletMethodHeader-Br5yuy4Y.js} +1 -1
- package/dist/cjs/FundingEditAmountScreen-CkN7MEsP.js +1 -0
- package/dist/cjs/FundingMethodSelectionScreen-GAbtb6OX.js +1 -0
- package/dist/cjs/InAppBrowserLoginNotPossible-CT02qBTq.js +1 -0
- package/dist/cjs/InstallWalletScreen-qPlR85ky.js +1 -0
- package/dist/cjs/LandingScreen-D8L4igmQ.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BCzS7Szr.js → LinkConflictScreen-B737vUbD.js} +1 -1
- package/dist/cjs/LinkEmailScreen-MLwnc5jm.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-o4qdrAL3.js → LinkPasskeyScreen-BJ1m3id2.js} +11 -11
- package/dist/cjs/LinkPhoneScreen-yRSjv6ae.js +1 -0
- package/dist/cjs/LoginFailedScreen-I5ksysLT.js +1 -0
- package/dist/cjs/ManualTransferScreen-DcN6S-SJ.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BQHWPpCM.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-DOrloojz.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-BdLB0mFq.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-Bk0-M9__.js +1 -0
- package/dist/cjs/{ModalHeader-C5O9gNUP.js → ModalHeader-KwHCNxiU.js} +1 -1
- package/dist/cjs/MoonpayStatusScreen-DDr4Vkyi.js +16 -0
- package/dist/cjs/OAuthStatusScreen-CppJwxLf.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-ClUBjHFM.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-B2_-WfVa.js +3 -0
- package/dist/cjs/PasswordRecoveryScreen-vf83E9aP.js +20 -0
- package/dist/cjs/{QrCode-CLd3Ytk7.js → QrCode-BhmojmWg.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-BdSOccuL.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-BLaYQNKK.js +1 -0
- package/dist/cjs/{RecoverySelectionScreen-Bw9_M6y0.js → RecoverySelectionScreen-BneG3jc0.js} +2 -2
- package/dist/cjs/{Screen-BSwlHqPg.js → Screen-C1Ydlvkq.js} +3 -4
- package/dist/cjs/{ScreenLayout-BtVIYAso.js → ScreenLayout-DnkmZJSx.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-SUOUjBk4.js → SetAutomaticRecoveryScreen-v61QgGt9.js} +2 -2
- package/dist/cjs/{SetWalletPasswordForm-Gkq-DskE.js → SetWalletPasswordForm-B_Msv6ub.js} +1 -1
- package/dist/cjs/{SignRequestScreen-BNcy6yU_.js → SignRequestScreen-CEFanY2A.js} +2 -2
- package/dist/cjs/{StandardSignAndSendTransactionScreen-z_EUNaeD.js → StandardSignAndSendTransactionScreen-BITiqDxA.js} +1 -1
- package/dist/cjs/TelegramAuthScreen-BU6xiLOe.js +1 -0
- package/dist/cjs/{TransactionDetails-DYow9ihU.js → TransactionDetails-TeqmJubL.js} +1 -1
- package/dist/cjs/{TransactionErrorView-yUMJqqF2.js → TransactionErrorView-hm96eri-.js} +1 -1
- package/dist/cjs/{TransferFromWalletScreen-Duk7CEcq.js → TransferFromWalletScreen-CnhtyQ1i.js} +2 -2
- package/dist/cjs/{TransferOrBridgeLoadingScreen-DuBLyfE1.js → TransferOrBridgeLoadingScreen-BdIP7jdZ.js} +1 -1
- package/dist/cjs/UpdateEmailScreen-YRHdiXp6.js +1 -0
- package/dist/cjs/UpdatePhoneScreen-Db27LG3y.js +1 -0
- package/dist/cjs/UserLimitReachedScreen-Cd877Xx6.js +1 -0
- package/dist/cjs/{WalletInfoCard-CHEynRZS.js → WalletInfoCard-vgtM0ubJ.js} +1 -1
- package/dist/cjs/WalletInterstitialScreen-DeNyJ-3q.js +1 -0
- package/dist/cjs/{WalletLink-CZLtiI7E.js → WalletLink-9sZRsiet.js} +1 -1
- package/dist/cjs/{WalletOverflowButton-FlgoA77a.js → WalletOverflowButton-DhlNqoAO.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-BeSQM-Ma.js → context-BCMEQ5MO.js} +1 -1
- package/dist/cjs/{ethers-XrYC9HG-.js → ethers-DX1tw95u.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/get-is-unified-wallet-Dg4KqQ0p.js +1 -0
- package/dist/cjs/index-BhSLy7Nc.js +174 -0
- package/dist/cjs/{index-W2ZSukRW.js → index-CWU_iy3R.js} +1 -1
- package/dist/cjs/{index-0-2WrPDo.js → index-Dd9z1fY6.js} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{shared-BcueHfN-.js → shared-ssREsE-L.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-j6p9PEm-.js → shouldProceedtoEmbeddedWalletCreationFlow-BN3aUGgy.js} +1 -1
- package/dist/cjs/{smart-wallets-BBh3vgRq.js → smart-wallets-WntASNhF.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{styles-Csarwypj.js → styles-DTcqxfSy.js} +1 -1
- package/dist/cjs/{to-ui-error-C4aac_aM.js → to-ui-error-DtK3_1wP.js} +1 -1
- package/dist/cjs/ui.js +14 -14
- package/dist/cjs/use-export-wallet-BkHEBlvp.js +1 -0
- package/dist/cjs/use-export-wallet-C-uM5Ofr.js +1 -0
- package/dist/cjs/{useActiveWallet-vlXeDPzp.js → useActiveWallet-B6oEOEWn.js} +2 -2
- package/dist/cjs/{useGetTokenPrice-DJpJnTij.js → useGetTokenPrice-C_nmg4xT.js} +1 -1
- package/dist/cjs/{useI18n-CnsBjm9v.js → useI18n-BwZScV_7.js} +1 -1
- package/dist/cjs/usePrivy-DUCSNlpX.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-CYMWkK7E.js → useSolanaRpcClient-COvcS5LN.js} +1 -1
- package/dist/cjs/{useWallets-DMyuB5aJ.js → useWallets-CzK7D1op.js} +1 -1
- package/dist/cjs/useWallets-JxMLMc9Z.js +1 -0
- package/dist/dts/index.d.mts +54 -1
- package/dist/dts/index.d.ts +54 -1
- package/dist/esm/AccountNotFoundScreen-uRGtEJqn.mjs +1 -0
- package/dist/esm/{Address-QmAVCQtO.mjs → Address-B3pOzvIk.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-BGAa9lkE.mjs +6 -0
- package/dist/esm/AllowlistRejectionScreen-DBuQjf2C.mjs +1 -0
- package/dist/esm/AuthenticateWithWalletScreen-Dh6CCfWB.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-CG-QmnxT.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DajMWJD_.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-DsLo_XbV.mjs +103 -0
- package/dist/esm/AwaitingSolToEvmBridgingScreen-DhYOqo0N.mjs +2 -0
- package/dist/esm/{BridgeNetworkSelectionView-DQGcampg.mjs → BridgeNetworkSelectionView-BA212LUH.mjs} +1 -1
- package/dist/esm/CaptchaScreen-CpjTgBuC.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-DXQ72a0D.mjs +16 -0
- package/dist/esm/{ConnectEmailForm-Df5OtmDR.mjs → ConnectEmailForm-BOaRwgjM.mjs} +1 -1
- package/dist/esm/ConnectLedgerScreen-CjA-L5l5.mjs +9 -0
- package/dist/esm/ConnectOnlyLandingScreen-noIWe4JR.mjs +1 -0
- package/dist/esm/ConnectOnlyStatusScreen-DZMalBQr.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-u4yt-3sr.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-BMtTIItD.mjs → ConnectPhoneForm-CwVcpNfb.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-BMjEKo1_.mjs → ConnectWalletView-NvVzGHBr.mjs} +4 -4
- package/dist/esm/ConnectionStatusScreen-8jrGgJZg.mjs +7 -0
- package/dist/esm/CrossAppAuthScreen-DPWSq0Io.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-BlDfJaDr.mjs → CustomLandingScreenView-C2HMC1Df.mjs} +1 -1
- package/dist/esm/DelegatedActionsConsentScreen-DawiGwZk.mjs +1 -0
- package/dist/esm/DelegatedActionsRevokeScreen-CFOdEpk0.mjs +1 -0
- package/dist/esm/EmbeddedWalletConnectingScreen-Dssq6BgK.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-X0JMlwTi.mjs +1 -0
- package/dist/esm/EmbeddedWalletKeyExportScreen-B2dIQCOE.mjs +40 -0
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CbkTFbdd.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-Bfpjz9TR.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-DFXj-md3.mjs +1 -0
- package/dist/esm/{EnrollTotp-DVLg14UT.mjs → EnrollTotp-w6UxoJph.mjs} +1 -1
- package/dist/esm/ErrorScreen-CWTvIq8L.mjs +4 -0
- package/dist/esm/{FarcasterConnectStatusScreen-CUO9DKCJ.mjs → FarcasterConnectStatusScreen-RzptJxlJ.mjs} +8 -8
- package/dist/esm/FarcasterSignerStatusScreen-C36T4hPW.mjs +28 -0
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-BQg4VfHs.mjs +1 -0
- package/dist/esm/{FundWalletMethodHeader-PIxwFzzh.mjs → FundWalletMethodHeader-CDUUJTHP.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-CLkxWyD5.mjs +1 -0
- package/dist/esm/FundingMethodSelectionScreen-Cqxg2r2F.mjs +1 -0
- package/dist/esm/InAppBrowserLoginNotPossible-BZ5Aj9FY.mjs +1 -0
- package/dist/esm/InstallWalletScreen-Bm6tWm-p.mjs +1 -0
- package/dist/esm/LandingScreen-7pZs6v3y.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-B94e_-2N.mjs → LinkConflictScreen-Dt2FTzqs.mjs} +3 -3
- package/dist/esm/LinkEmailScreen-BIWTNxT7.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-DYfWSjKR.mjs → LinkPasskeyScreen-C0qjIYHG.mjs} +1 -1
- package/dist/esm/LinkPhoneScreen-zATN3v5S.mjs +1 -0
- package/dist/esm/LoginFailedScreen-Bep4nqVd.mjs +1 -0
- package/dist/esm/ManualTransferScreen-DHe5eNOc.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-C6L-LQJU.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-BGrmTQYF.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-Cq48wofE.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-DNhPBBJ7.mjs +1 -0
- package/dist/esm/{ModalHeader-rCMpqA2a.mjs → ModalHeader-Dt9RfCUU.mjs} +1 -1
- package/dist/esm/MoonpayStatusScreen-CS0Qs79J.mjs +16 -0
- package/dist/esm/OAuthStatusScreen-Bq0Ey0ZF.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-c4yN_RBw.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-C6WM9Zrz.mjs +3 -0
- package/dist/esm/PasswordRecoveryScreen-DHUXnySi.mjs +20 -0
- package/dist/esm/{QrCode-DjnQgnaZ.mjs → QrCode-0otXb_E9.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-DB8LKiZS.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-BdJzdrZT.mjs +1 -0
- package/dist/esm/{RecoverySelectionScreen-B2V3518x.mjs → RecoverySelectionScreen-CeFYbMt7.mjs} +2 -2
- package/dist/esm/{Screen-CV2tt2Ap.mjs → Screen-D3XHNOhT.mjs} +8 -9
- package/dist/esm/{ScreenLayout-DF3DCKOK.mjs → ScreenLayout-Dfp-g3KU.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-C6cFVbSx.mjs → SetAutomaticRecoveryScreen-D7M6fycA.mjs} +2 -2
- package/dist/esm/{SetWalletPasswordForm-ChA4tW4Y.mjs → SetWalletPasswordForm-Cqfgm_5A.mjs} +1 -1
- package/dist/esm/SignRequestScreen-C5i_Qoj2.mjs +26 -0
- package/dist/esm/{StandardSignAndSendTransactionScreen-D4OBsj5k.mjs → StandardSignAndSendTransactionScreen-B2CqPGkZ.mjs} +2 -2
- package/dist/esm/TelegramAuthScreen-BmmV0kiQ.mjs +1 -0
- package/dist/esm/{TransactionDetails-BP142O9n.mjs → TransactionDetails-BnQV3aq5.mjs} +1 -1
- package/dist/esm/{TransactionErrorView-BwwGMqSj.mjs → TransactionErrorView-CkXjlGw-.mjs} +1 -1
- package/dist/esm/{TransferFromWalletScreen-BHH0YcI4.mjs → TransferFromWalletScreen-C-WNRSeB.mjs} +2 -2
- package/dist/esm/{TransferOrBridgeLoadingScreen-VLQTcf_6.mjs → TransferOrBridgeLoadingScreen-3zmLJTU6.mjs} +1 -1
- package/dist/esm/UpdateEmailScreen-CbqW0_xT.mjs +1 -0
- package/dist/esm/UpdatePhoneScreen-0PswjFok.mjs +1 -0
- package/dist/esm/UserLimitReachedScreen-DaqBCoMH.mjs +1 -0
- package/dist/esm/{WalletInfoCard-ChBHG5L5.mjs → WalletInfoCard-D4QREH8T.mjs} +1 -1
- package/dist/esm/WalletInterstitialScreen-DP3jqPtN.mjs +1 -0
- package/dist/esm/{WalletLink-CN4enmsE.mjs → WalletLink-CeVlaFWB.mjs} +1 -1
- package/dist/esm/{WalletOverflowButton-B-nEN4GW.mjs → WalletOverflowButton-DxD32Aku.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-DJw8ICPU.mjs +1 -0
- package/dist/esm/{ethers-BQ45eiVv.mjs → ethers-CG8w3aPx.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/{get-is-unified-wallet-CNcx75Dp.mjs → get-is-unified-wallet-CtfiZMWv.mjs} +1 -1
- package/dist/esm/index-CMDYWbe4.mjs +174 -0
- package/dist/esm/{index-DoasOxbi.mjs → index-RPlvvhMv.mjs} +1 -1
- package/dist/esm/{index-2knYP69D.mjs → index-XM_HdCVn.mjs} +2 -2
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{shared-DwO5pr5t.mjs → shared-CRLmzZyl.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs → shouldProceedtoEmbeddedWalletCreationFlow-C9ZLO2KP.mjs} +1 -1
- package/dist/esm/{smart-wallets-9LKzbfWj.mjs → smart-wallets-DbUfQZQ2.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{styles-BNn7MnP1.mjs → styles-Bb6ZtmWU.mjs} +1 -1
- package/dist/esm/{to-ui-error-CCqAdorW.mjs → to-ui-error-CRLswbee.mjs} +1 -1
- package/dist/esm/ui.mjs +39 -39
- package/dist/esm/use-export-wallet-BgKZ6lTG.mjs +1 -0
- package/dist/esm/use-export-wallet-ByGs9MT4.mjs +1 -0
- package/dist/esm/{useActiveWallet-RZ4w-uGq.mjs → useActiveWallet-DaOhml0T.mjs} +2 -2
- package/dist/esm/{useGetTokenPrice-DERdsrmf.mjs → useGetTokenPrice-D-ZL2L5m.mjs} +1 -1
- package/dist/esm/{useI18n-Dk9y58cU.mjs → useI18n-OYSBAOoJ.mjs} +1 -1
- package/dist/esm/usePrivy-CJdU0Qbv.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-B7UDPdLi.mjs → useSolanaRpcClient-B1FbNl2G.mjs} +1 -1
- package/dist/esm/useWallets-CbdM0Ytx.mjs +1 -0
- package/dist/esm/{useWallets-DlGuNtGR.mjs → useWallets-Cgll-RH3.mjs} +1 -1
- package/package.json +3 -3
- package/dist/cjs/AccountNotFoundScreen-BBWWze9O.js +0 -1
- package/dist/cjs/AffirmativeConsentScreen-CCwAwjH1.js +0 -6
- package/dist/cjs/AllowlistRejectionScreen-DEMYbzGA.js +0 -1
- package/dist/cjs/AuthenticateWithWalletScreen-dBvBC7MB.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-D9NwI47L.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-D_0NulpI.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-B4HAKL4-.js +0 -103
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-CnuLLTC0.js +0 -2
- package/dist/cjs/CaptchaScreen-N-ueJQF3.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-06yaO6r4.js +0 -16
- package/dist/cjs/ConnectLedgerScreen-C7vGQocf.js +0 -9
- package/dist/cjs/ConnectOnlyLandingScreen-_9y9kOsT.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-mZHx4a7S.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Cp4uExOd.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-B27DUsGt.js +0 -7
- package/dist/cjs/CrossAppAuthScreen-BbLFbCdU.js +0 -1
- package/dist/cjs/DelegatedActionsConsentScreen-DzWruJOn.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-D-TwUXyj.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-CYav4Mjb.js +0 -1
- package/dist/cjs/EmbeddedWalletCreatedScreen-m0t_c_AA.js +0 -1
- package/dist/cjs/EmbeddedWalletKeyExportScreen-_4GMdJuo.js +0 -40
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B5-JBZRJ.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CITAy3i6.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DG5LKyjo.js +0 -1
- package/dist/cjs/ErrorScreen-xNDIVXx8.js +0 -4
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-BCyBv_xe.js +0 -2
- package/dist/cjs/FundingEditAmountScreen-CDlb4Acx.js +0 -1
- package/dist/cjs/FundingMethodSelectionScreen-DlPxjsJq.js +0 -1
- package/dist/cjs/InAppBrowserLoginNotPossible-Bdx0vKyA.js +0 -1
- package/dist/cjs/InstallWalletScreen-Cshn01eK.js +0 -1
- package/dist/cjs/LandingScreen-0FdwpJ9w.js +0 -1
- package/dist/cjs/LinkEmailScreen-B7rxdQso.js +0 -1
- package/dist/cjs/LinkPhoneScreen-DweFqlM1.js +0 -1
- package/dist/cjs/LoginFailedScreen-mHcvCBEz.js +0 -1
- package/dist/cjs/ManualTransferScreen-CfYgtyLD.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-D631h0XW.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-BZ3IyqAd.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-_tNeX5lT.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-D_7nkuBq.js +0 -1
- package/dist/cjs/MoonpayStatusScreen-DoFbZ_0d.js +0 -16
- package/dist/cjs/OAuthStatusScreen-BZY7BiP5.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-C3k_ixTz.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-BX-SOBDr.js +0 -3
- package/dist/cjs/PasswordRecoveryScreen-VZQDtt5v.js +0 -20
- package/dist/cjs/RecoveryOAuthStatusScreen-DKYx6ECd.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-DP0xOBMA.js +0 -1
- package/dist/cjs/TelegramAuthScreen-DV8KYJMX.js +0 -1
- package/dist/cjs/UpdateEmailScreen-DRJv5CZs.js +0 -1
- package/dist/cjs/UpdatePhoneScreen-C3myqOv0.js +0 -1
- package/dist/cjs/UserLimitReachedScreen-l_e6Vhr0.js +0 -1
- package/dist/cjs/WalletInterstitialScreen-BgoDwKIp.js +0 -1
- package/dist/cjs/get-is-unified-wallet-BwdzQwn_.js +0 -1
- package/dist/cjs/index-CzmnSRoa.js +0 -174
- package/dist/cjs/prepareFundingModalData-DDf6xLze.js +0 -1
- package/dist/cjs/use-export-wallet-C9HWu0Dq.js +0 -1
- package/dist/cjs/usePrivy-Bx2PKTrU.js +0 -1
- package/dist/cjs/useWallets-BwB7ALB8.js +0 -1
- package/dist/esm/AccountNotFoundScreen-C6S8_GyN.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-QfJBfI_f.mjs +0 -6
- package/dist/esm/AllowlistRejectionScreen-CX57yv4U.mjs +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-CZJ-aWhZ.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-C1CMtT4Y.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DX91STcF.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-BuExr50N.mjs +0 -103
- package/dist/esm/AwaitingSolToEvmBridgingScreen-Bm1i_2qW.mjs +0 -2
- package/dist/esm/CaptchaScreen-B-hFDb5f.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-OHm2RUBv.mjs +0 -16
- package/dist/esm/ConnectLedgerScreen-BHLYW-F3.mjs +0 -9
- package/dist/esm/ConnectOnlyLandingScreen-C6nzEwpN.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-CremlXDY.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-262UvCdD.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-mk5beBL7.mjs +0 -7
- package/dist/esm/CrossAppAuthScreen-BXjEJQv6.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-ANmQe-9G.mjs +0 -1
- package/dist/esm/DelegatedActionsRevokeScreen-D9X7mWmI.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-2g-RrIvW.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-BXTAv4_-.mjs +0 -1
- package/dist/esm/EmbeddedWalletKeyExportScreen-DYVHVHOj.mjs +0 -40
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CYyMoMFF.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-oT5ZcPQV.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BQcHDyuV.mjs +0 -1
- package/dist/esm/ErrorScreen-CLfeO5pd.mjs +0 -4
- package/dist/esm/FarcasterSignerStatusScreen-B135UOnV.mjs +0 -28
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-DO3ttgom.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-BRQb2ffL.mjs +0 -1
- package/dist/esm/FundingMethodSelectionScreen-DTt1Z5RI.mjs +0 -1
- package/dist/esm/InAppBrowserLoginNotPossible-DH96QD2c.mjs +0 -1
- package/dist/esm/InstallWalletScreen-PnK6VfrP.mjs +0 -1
- package/dist/esm/LandingScreen-D_EvjOHf.mjs +0 -1
- package/dist/esm/LinkEmailScreen-CT8gAQr3.mjs +0 -1
- package/dist/esm/LinkPhoneScreen-ccrKA6tf.mjs +0 -1
- package/dist/esm/LoginFailedScreen-BwgxhbMf.mjs +0 -1
- package/dist/esm/ManualTransferScreen-DgCG2P3B.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-CNVUTOnE.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-2nvvFipu.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-DfnIqNNU.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-BwerwBz5.mjs +0 -1
- package/dist/esm/MoonpayStatusScreen-D5fRCEb3.mjs +0 -16
- package/dist/esm/OAuthStatusScreen-DtLgYw89.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-QoPhmagh.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-DzjU3ZVT.mjs +0 -3
- package/dist/esm/PasswordRecoveryScreen-LZYGRBkP.mjs +0 -20
- package/dist/esm/RecoveryOAuthStatusScreen-DKfp8Udh.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-D4DI5Bom.mjs +0 -1
- package/dist/esm/SignRequestScreen-BslfKJ1N.mjs +0 -26
- package/dist/esm/TelegramAuthScreen-BJq5f_Rq.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-CMFBvYz5.mjs +0 -1
- package/dist/esm/UpdatePhoneScreen-DmhHcNq3.mjs +0 -1
- package/dist/esm/UserLimitReachedScreen-DNqgCf3B.mjs +0 -1
- package/dist/esm/WalletInterstitialScreen-RS89fm6t.mjs +0 -1
- package/dist/esm/context-LVpDfP2H.mjs +0 -1
- package/dist/esm/index-DNz_w3-G.mjs +0 -174
- package/dist/esm/prepareFundingModalData-DjTxAoJ1.mjs +0 -1
- package/dist/esm/use-export-wallet-DllHf-2F.mjs +0 -1
- package/dist/esm/usePrivy-Dj52a5sp.mjs +0 -1
- package/dist/esm/useWallets-cSQYA-Jk.mjs +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as c}from"./WarningBanner-c8L53pJ2.mjs";import{W as d}from"./WalletInfoCard-D4QREH8T.mjs";import{u as s}from"./context-DJw8ICPU.mjs";import{u as p}from"./internal-context-Z-fyxadS.mjs";import{u as m,a as u}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as h}from"./ScreenLayout-Dfp-g3KU.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-Dt9RfCUU.mjs";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-B3pOzvIk.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s,onBack:p})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/r(t,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:p,showBack:!!p,watermark:!0,children:/*#__PURE__*/r(g,{children:[/*#__PURE__*/e(c,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(d,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(f,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let g=a.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 1.25rem;
|
|
5
|
+
text-align: left;
|
|
6
|
+
`,f=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=a.div`
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: 12px;
|
|
9
|
+
height: 44px;
|
|
10
|
+
`,x=a.div`
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 100%;
|
|
16
|
+
font-size: 16px;
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
border-radius: var(--privy-border-radius-md);
|
|
19
|
+
background-color: var(--privy-color-background-2);
|
|
20
|
+
color: var(--privy-color-foreground-3);
|
|
21
|
+
`;function w(t){let[a,c]=o(t.dimensions.width),[d,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();c(e)}let e=getComputedStyle(document.documentElement);s({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let m="ethereum"===t.chainType&&!t.imported&&!t.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
|
|
22
|
+
/*#__PURE__*/r(I,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d}:{v:"1",entropy_id:t.entropyId,entropy_id_verifier:t.entropyIdVerifier,hd_wallet_index:t.hdWalletIndex,chain_type:t.chainType,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d},hash:{token:t.accessToken}})}),/*#__PURE__*/e(b,{children:"Loading..."}),m&&/*#__PURE__*/e(b,{children:"Loading..."})]})})}const k={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:c,clientAnalyticsId:d,client:h}=p(),g=s(),{data:f,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:k,appId:I,appClientId:b,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,chainType:T,address:W,isUnifiedWallet:B,imported:P,showBackButton:V}=f.keyExport,L=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},S=()=>{l({shouldCallAuthOnSuccess:!1}),w(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:W}})};return i((()=>{if(!n)return L("User must be authenticated before exporting their wallet");h.getAccessToken().then(t).catch(L)}),[n,a]),v.current=S,/*#__PURE__*/e(y,{address:W,accessToken:r,appConfigTheme:g.appearance.palette.colorScheme,onClose:S,isLoading:!r,onBack:V?S:void 0,exportButtonProps:r?{origin:k,appId:I,appClientId:b,clientAnalyticsId:d,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,isUnifiedWallet:B,imported:P,chainType:T}:void 0})}};let I=a.div`
|
|
23
|
+
overflow: visible;
|
|
24
|
+
position: relative;
|
|
25
|
+
overflow: none;
|
|
26
|
+
height: 44px;
|
|
27
|
+
display: flex;
|
|
28
|
+
gap: 12px;
|
|
29
|
+
`,b=a.div`
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
35
|
+
font-size: 16px;
|
|
36
|
+
font-weight: 500;
|
|
37
|
+
border-radius: var(--privy-border-radius-md);
|
|
38
|
+
background-color: var(--privy-color-background-2);
|
|
39
|
+
color: var(--privy-color-foreground-3);
|
|
40
|
+
`;export{k as EmbeddedWalletKeyExportScreen,y as EmbeddedWalletKeyExportView,k as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{generateWalletIdempotencyKey as i}from"@privy-io/js-sdk-core";import{u as a}from"./context-DJw8ICPU.mjs";import{v as s,s as l,k as n,F as m,R as c}from"./index-CMDYWbe4.mjs";import{u as d,m as p}from"./internal-context-Z-fyxadS.mjs";import{a as u,u as h}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as y}from"./ScreenLayout-Dfp-g3KU.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(y,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),v={component:()=>{let{setModalData:t,navigate:y,data:v,onUserCloseViaDialogOrKeybindRef:C}=u(),g=a(),[j,f]=r(""),{embeddedWallets:b}=a(),{authenticated:S,user:x}=h(),{closePrivyModal:W,walletProxy:O,client:A}=d(),{onSuccess:k,onFailure:I,callAuthOnSuccessOnClose:M,shouldCreateEth:P,shouldCreateSol:R}=v.createWallet,U="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[E,K]=r(null),{create:L}=s(),T=P??(!!x&&l(x,g.embeddedWallets.ethereum.createOnLogin)),F=R??(!!x&&n(x,g.embeddedWallets.solana.createOnLogin)),V=new c((async()=>{let e=await A.getAccessToken();if(x&&e&&O)try{let e,t=await i(x.id,"ethereum"),r=await i(x.id,"solana");if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:x,idempotencyKey:r});else{if(!T)return void W({shouldCallAuthOnSuccess:M});e=await L({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t})}K(e),y("EmbeddedWalletCreatedScreen")}catch(e){f(e.message)}}));return o((()=>S&&x?U?(t({...v,createWallet:{...v.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...v?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),y(m({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:b.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void V.execute():(y("LandingScreen"),void I(Error("User must be authenticated before creating a Privy wallet")))),[U,S]),C.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{E?(k(E),W({shouldCallAuthOnSuccess:M})):(I(new p("User wallet creation failed")),W({shouldCallAuthOnSuccess:!1}))}})}};export{v as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,v as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{u as i}from"./context-DJw8ICPU.mjs";import{u as n,o as d,m as c}from"./internal-context-Z-fyxadS.mjs";import{g as l}from"./useWallets-Cgll-RH3.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-Cqfgm_5A.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-Dt9RfCUU.mjs";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./shared-CRLmzZyl.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let[u,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:A,user:I}=t(),{client:M,walletProxy:j,refreshSessionAndUser:C,closePrivyModal:R,createAnalyticsEvent:b}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=x.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===D?.recoveryMethod;r((()=>{A||(P("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let T=()=>v?(N(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>_(p()),onPasswordChange:_,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&j)try{b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await C(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-Z-fyxadS.mjs";import{a}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as c}from"./ScreenLayout-Dfp-g3KU.mjs";import"ofetch";import"react";import"viem";import"./context-DJw8ICPU.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-Dt9RfCUU.mjs";import"styled-components";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const m=({onClose:i,onProceed:s})=>/*#__PURE__*/e(c,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),n={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:c}=a(),{onFailure:n}=t.setWalletPassword,l=()=>{n(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return c.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{n as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{styled as o}from"styled-components";import i from"@heroicons/react/24/outline/ChevronRightIcon";import n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import s from"@heroicons/react/24/outline/FingerPrintIcon";import a from"@heroicons/react/24/outline/MinusCircleIcon";import l from"@heroicons/react/24/outline/PhoneIcon";import C from"@heroicons/react/24/outline/ShieldCheckIcon";import{U as c,L as d}from"./useActiveWallet-
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{styled as o}from"styled-components";import i from"@heroicons/react/24/outline/ChevronRightIcon";import n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import s from"@heroicons/react/24/outline/FingerPrintIcon";import a from"@heroicons/react/24/outline/MinusCircleIcon";import l from"@heroicons/react/24/outline/PhoneIcon";import C from"@heroicons/react/24/outline/ShieldCheckIcon";import{U as c,L as d}from"./useActiveWallet-DaOhml0T.mjs";import{M as h,b as m,P as p}from"./ModalHeader-Dt9RfCUU.mjs";import{C as u}from"./Chip-D2-wZOHJ.mjs";import{I as y,T as f,S as g,E as k,M as w,d as v,e as b,f as M,g as x,R as Z,a as j,A as L,F as E,L as S,b as I,c as P,C as T,N as R}from"./PinInput-3SLvbnQa.mjs";import A from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import W from"@heroicons/react/24/outline/ClockIcon";import{useState as F,useMemo as B}from"react";import{u as U}from"./context-DJw8ICPU.mjs";import{u as z}from"./internal-context-Z-fyxadS.mjs";import{u as $}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{ErrorScreenView as N}from"./ErrorScreen-CWTvIq8L.mjs";import{DoubleIconWrapper as D}from"./LinkPasskeyScreen-C0qjIYHG.mjs";import{C as O}from"./CopyToClipboard-BGTSFnT3.mjs";import{C as _}from"./Layouts-BlFm53ED.mjs";import{C as V}from"./Column-C2X2MHYX.mjs";import{L as H}from"./LabelXs-oqZNqbm_.mjs";import{S as Q}from"./Subtitle-CV-2yKE4.mjs";import{T as Y}from"./Title-BnzYV3Is.mjs";import{B as q}from"./shared-FM0rljBt.mjs";import{f as X,g as K,h as G,i as J}from"./index-CMDYWbe4.mjs";import ee from"@heroicons/react/24/solid/ShieldCheckIcon";import{Q as re}from"./QrCode-0otXb_E9.mjs";const te=t=>/*#__PURE__*/e(oe,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...t,children:[/*#__PURE__*/r("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),/*#__PURE__*/r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let oe=o.svg`
|
|
2
2
|
height: 90px;
|
|
3
3
|
width: 90px;
|
|
4
4
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{AlertTriangle as i,Phone as a,Lock as o}from"lucide-react";import{styled as n}from"styled-components";import{u as s}from"./context-DJw8ICPU.mjs";import{a as c,P as l}from"./index-CMDYWbe4.mjs";import{c as m,b as p,a as d,e as u}from"./internal-context-Z-fyxadS.mjs";import{a as T}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{R as g}from"./reservoir-0wfhnc0j.mjs";import{S as h}from"./ScreenLayout-Dfp-g3KU.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const y=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:y})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof d)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof u&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:s.errorTitle||"You don't have access to this app",detail:s.errorDetail||"Have you been invited?",ctaText:s.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,s);/*#__PURE__*/return t(h,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:y,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(y,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
|
|
2
|
+
color: var(--privy-color-accent) !important;
|
|
3
|
+
font-weight: 600;
|
|
4
|
+
`;export{f as ErrorScreen,y as ErrorScreenView,f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as a}from"react";import{isMobile as n,isIOS as s}from"react-device-detect";import{styled as l}from"styled-components";import{L as c}from"./useActiveWallet-DaOhml0T.mjs";import{O as d}from"./OpenLink-DZHy38vr.mjs";import{Q as m}from"./QrCode-0otXb_E9.mjs";import{Check as p,Copy as u}from"lucide-react";import{S as h}from"./ModalHeader-Dt9RfCUU.mjs";import{L as v}from"./LabelXs-oqZNqbm_.mjs";import{u as f,q as g}from"./context-DJw8ICPU.mjs";import{u as y,b,k as w}from"./internal-context-Z-fyxadS.mjs";import{u as x,a as C}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{s as S}from"./shouldProceedtoEmbeddedWalletCreationFlow-C9ZLO2KP.mjs";import{S as k}from"./ScreenLayout-Dfp-g3KU.mjs";import{F as E}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./use-export-wallet-ByGs9MT4.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"qrcode";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"./index-CMDYWbe4.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";let T=l.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
`,j=l.div`
|
|
4
4
|
display: flex;
|
|
@@ -19,7 +19,7 @@ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState
|
|
|
19
19
|
min-width: 0;
|
|
20
20
|
display: flex;
|
|
21
21
|
align-items: center;
|
|
22
|
-
`,
|
|
22
|
+
`,L=l.span`
|
|
23
23
|
display: block;
|
|
24
24
|
font-size: 16px;
|
|
25
25
|
line-height: 24px;
|
|
@@ -36,7 +36,7 @@ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState
|
|
|
36
36
|
font-size: 14px;
|
|
37
37
|
line-height: 20px;
|
|
38
38
|
}
|
|
39
|
-
`,
|
|
39
|
+
`,F=l(L)`
|
|
40
40
|
color: var(--privy-color-foreground-3);
|
|
41
41
|
font-style: italic;
|
|
42
42
|
`,O=l(v)`
|
|
@@ -47,24 +47,24 @@ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState
|
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
flex-shrink: 0;
|
|
49
49
|
}
|
|
50
|
-
`;const I=({value:a,title:n,placeholder:s,className:l,showCopyButton:c=!0,truncate:d,maxLength:m=40,disabled:h=!1})=>{let[v,f]=
|
|
50
|
+
`;const I=({value:a,title:n,placeholder:s,className:l,showCopyButton:c=!0,truncate:d,maxLength:m=40,disabled:h=!1})=>{let[v,f]=o(!1),g=d&&a?((e,r,t)=>{if((e=e.startsWith("https://")?e.slice(8):e).length<=t)return e;if("middle"===r){let r=Math.ceil(t/2)-2,o=Math.floor(t/2)-1;return`${e.slice(0,r)}...${e.slice(-o)}`}return`${e.slice(0,t-3)}...`})(a,d,m):a;return i((()=>{if(v){let e=setTimeout((()=>f(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e(T,{className:l,children:[n&&/*#__PURE__*/r(O,{children:n}),/*#__PURE__*/e(j,{$disabled:h,children:[/*#__PURE__*/r(A,{children:a?/*#__PURE__*/r(L,{$disabled:h,title:a,children:g}):/*#__PURE__*/r(F,{$disabled:h,children:s||"No value"})}),c&&a&&/*#__PURE__*/r(_,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(a).then((()=>f(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/r(p,{size:14})]}:{children:["Copy",/*#__PURE__*/r(u,{size:14})]})})]})]})},R=({connectUri:t,loading:o,success:i,errorMessage:a,onBack:l,onClose:p,onOpenFarcaster:u})=>/*#__PURE__*/r(k,n||o?s?{title:a?a.message:"Sign in with Farcaster",subtitle:a?a.detail:"To sign in with Farcaster, please open the Farcaster app.",icon:E,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},primaryCta:t&&u?{label:"Open Farcaster app",onClick:u}:void 0,onBack:l,onClose:p,watermark:!0}:{title:a?a.message:"Signing in with Farcaster",subtitle:a?a.detail:"This should only take a moment",icon:E,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},onBack:l,onClose:p,watermark:!0,children:t&&n&&/*#__PURE__*/r(U,{children:/*#__PURE__*/r(d,{text:"Take me to Farcaster",url:t,color:"#8a63d2"})})}:{title:"Sign in with Farcaster",subtitle:"Scan with your phone's camera to continue.",onBack:l,onClose:p,watermark:!0,children:/*#__PURE__*/e(W,{children:[/*#__PURE__*/r(M,{children:t?/*#__PURE__*/r(m,{url:t,size:275,squareLogoElement:E}):/*#__PURE__*/r(z,{children:/*#__PURE__*/r(c,{})})}),/*#__PURE__*/e($,{children:[/*#__PURE__*/r(D,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),t&&/*#__PURE__*/r(I,{value:t,truncate:"end",maxLength:30,showCopyButton:!0,disabled:!0})]})]})}),N={component:()=>{let{authenticated:e,logout:t,ready:n,user:s}=x(),{lastScreen:l,navigate:c,navigateBack:d,setModalData:m}=C(),p=f(),{getAuthFlow:u,loginWithFarcaster:h,closePrivyModal:v,createAnalyticsEvent:k}=y(),[E,T]=o(void 0),[j,A]=o(!1),[L,F]=o(!1),O=a([]),_=u(),I=_?.meta.connectUri;return i((()=>{let e=Date.now(),r=setInterval((async()=>{let t=await _.pollForReady.execute(),o=Date.now()-e;if(t){clearInterval(r),A(!0);try{await h(),F(!0)}catch(e){let r={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===b.ALLOWLIST_REJECTED)return void c("AllowlistRejectionScreen");if(e?.privyErrorCode===b.USER_LIMIT_REACHED)return console.error(new w(e).toString()),void c("UserLimitReachedScreen");if(e?.privyErrorCode===b.USER_DOES_NOT_EXIST)return void c("AccountNotFoundScreen");if(e?.privyErrorCode===b.LINKED_TO_ANOTHER_USER)r.detail=e.message??"This account has already been linked to another user.";else{if(e?.privyErrorCode===b.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return m({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void c("LinkConflictScreen");e?.privyErrorCode===b.INVALID_CREDENTIALS?(r.retryable=!0,r.detail="Something went wrong. Try again."):e?.privyErrorCode===b.TOO_MANY_REQUESTS&&(r.detail="Too many requests. Please wait before trying again.")}T(r)}}else o>12e4&&(clearInterval(r),T({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(r),O.current.forEach((e=>clearTimeout(e)))}}),[]),i((()=>{if(n&&e&&L&&s){if(p?.legal.requireUsersAcceptTerms&&!s.hasAcceptedTerms){let e=setTimeout((()=>{c("AffirmativeConsentScreen")}),g);return()=>clearTimeout(e)}L&&(S(s,p.embeddedWallets)?O.current.push(setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),k({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),g)):O.current.push(setTimeout((()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0})),g)))}}),[L,n,e,s]),/*#__PURE__*/r(R,{connectUri:I,loading:j,success:L,errorMessage:E,onBack:l?d:void 0,onClose:v,onOpenFarcaster:()=>{I&&(window.location.href=I)}})}};let U=l.div`
|
|
51
51
|
margin-top: 24px;
|
|
52
|
-
`,
|
|
52
|
+
`,W=l.div`
|
|
53
53
|
display: flex;
|
|
54
54
|
flex-direction: column;
|
|
55
55
|
align-items: center;
|
|
56
56
|
gap: 24px;
|
|
57
|
-
`,
|
|
57
|
+
`,M=l.div`
|
|
58
58
|
display: flex;
|
|
59
59
|
align-items: center;
|
|
60
60
|
justify-content: center;
|
|
61
61
|
min-height: 275px;
|
|
62
|
-
|
|
62
|
+
`,$=l.div`
|
|
63
63
|
display: flex;
|
|
64
64
|
flex-direction: column;
|
|
65
65
|
align-items: center;
|
|
66
66
|
gap: 16px;
|
|
67
|
-
|
|
67
|
+
`,D=l.div`
|
|
68
68
|
font-size: 0.875rem;
|
|
69
69
|
text-align: center;
|
|
70
70
|
color: var(--privy-color-foreground-2);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as a}from"react";import{isMobile as i,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-BGTSFnT3.mjs";import{L as c}from"./useActiveWallet-DaOhml0T.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-0otXb_E9.mjs";import{u as d,q as u}from"./context-DJw8ICPU.mjs";import{u as g}from"./internal-context-Z-fyxadS.mjs";import{a as h}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as f}from"./ScreenLayout-Dfp-g3KU.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"./copy-Bx2Jwc5_.mjs";import"zustand";import"./use-export-wallet-ByGs9MT4.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:a,errorMessage:n,connectUri:d,onBack:u,onClose:g,onOpenFarcaster:h})=>/*#__PURE__*/e(f,i||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},primaryCta:d&&h?{label:"Open Farcaster app",onClick:h}:void 0,onBack:u,onClose:g,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},onBack:u,onClose:g,watermark:!0,children:d&&i&&/*#__PURE__*/e(w,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:g,watermark:!0,children:/*#__PURE__*/t(x,{children:[/*#__PURE__*/e(j,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(S,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(b,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let w=n.div`
|
|
2
|
+
margin-top: 24px;
|
|
3
|
+
`,x=n.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 24px;
|
|
8
|
+
`,j=n.div`
|
|
9
|
+
padding: 24px;
|
|
10
|
+
position: relative;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
min-height: 275px;
|
|
15
|
+
`,C=n.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 16px;
|
|
20
|
+
`,b=n.div`
|
|
21
|
+
font-size: 0.875rem;
|
|
22
|
+
text-align: center;
|
|
23
|
+
color: var(--privy-color-foreground-2);
|
|
24
|
+
`,S=n.div`
|
|
25
|
+
position: relative;
|
|
26
|
+
width: 82px;
|
|
27
|
+
height: 82px;
|
|
28
|
+
`;const I={component:()=>{let{lastScreen:t,navigateBack:i,data:s}=h(),n=d(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=g(),[m,p]=r(void 0),[f,v]=r(!1),[y,w]=r(!1),x=o([]),j=s?.farcasterSigner;a((()=>{let e=Date.now(),t=setInterval((async()=>{if(!j?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===j.status&&(clearInterval(t),v(!1),w(!0),x.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(j?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),v(!1),w(!0),x.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u))):o>3e5?(clearInterval(t),p({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),p({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),x.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===j?.status?j.signer_approval_url:void 0;/*#__PURE__*/return e(k,{appName:n.name,loading:f,success:y,errorMessage:m,connectUri:C,onBack:t?i:void 0,onClose:c,onOpenFarcaster:()=>{C&&(window.location.href=C)}})}};export{I as FarcasterSignerStatusScreen,k as FarcasterSignerStatusView,I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as s}from"@privy-io/js-sdk-core";import{B as i,P as l}from"./ModalHeader-Dt9RfCUU.mjs";import{b as m,c,R as u,e as d}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-CDUUJTHP.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-Dq_xe9dz.mjs";import{L as I,V as w}from"./Value-tcJV9e0L.mjs";import{a as S,R as v}from"./Row-C9vrS4Zi.mjs";import{u as j,t as C}from"./context-DJw8ICPU.mjs";import{u as y,a as L,b as x}from"./internal-context-Z-fyxadS.mjs";import{a as F}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{u as k,g as U}from"./useWallets-CbdM0Ytx.mjs";import{u as T}from"./useGetTokenPrice-D-ZL2L5m.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as W}from"@solana-program/system";import{pipe as b,createTransactionMessage as P,setTransactionMessageFeePayerSigner as D,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as M,compileTransaction as O,getTransactionEncoder as E}from"@solana/kit";import{findAssociatedTokenPda as $,getCreateAssociatedTokenIdempotentInstruction as B,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as Q}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as _,f as z,s as X,w as Y}from"./useSolanaRpcClient-B1FbNl2G.mjs";import{g as q}from"./getChainName-DjpPdUSc.mjs";import{t as J}from"./use-export-wallet-ByGs9MT4.mjs";import"styled-components";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-Cgll-RH3.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"./usePrivy-CJdU0Qbv.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";function K({rows:a}){/*#__PURE__*/return t(S,{children:a.filter((t=>!!t)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/e(v,{children:[/*#__PURE__*/t(I,{children:a.label}),/*#__PURE__*/t(w,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(t){return BigInt(Math.floor(1e9*parseFloat(t)))}function tt(t){return+et.format(parseFloat(t.toString())/1e9)}let et=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function at({tx:t,solanaClient:e,amount:a,asset:n,tokenPrice:o}){if(!t)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:e,tx:t});return{amountInUsd:r,feeInUsd:o?V(s,o):void 0,totalInUsd:V(n+s,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:e,tx:t}),s=function(t,e){let a=parseFloat(t.toString())/G*e;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:V(r,o),totalInUsd:"$"+(parseFloat(a)+s).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:e,tx:t});return{amountInSol:a+" SOL",feeInSol:tt(o)+" SOL",totalInSol:tt(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:tt(await z({solanaClient:e,tx:t}))+" SOL"}}const nt={component:function(){let I=j(),{closePrivyModal:w,createAnalyticsEvent:S}=y(),{data:v,setModalData:G,navigate:z}=F(),{wallets:tt}=k(),[et,nt]=o("preparing"),[ot,rt]=o(),[st,it]=o(),[lt,mt]=o();if(!v?.solanaFundingData)throw Error("Funding config is missing");if(!v.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ct,asset:ut,chain:dt,sourceWalletData:pt,destinationAddress:ft,afterSuccessScreen:gt}=v.solanaFundingData,ht=tt.find((t=>t.address===pt.address&&J(pt.walletClientType)===J(t.standardWallet.name))),It=_()(dt),{tokenPrice:wt,isTokenPriceLoading:St}=T("solana");return r((()=>{if("preparing"!==et||St||!ht)return;let t="SOL"===ut?Z(ct):function(t){return BigInt(Math.floor(1e6*parseFloat(t)))}(ct);it({amount:("SOL"===ut&&wt?V(t,wt):ct)??ct}),("SOL"===ut?async function({solanaClient:t,source:e,destination:a,amountInLamports:n}){let{value:o}=await t.rpc.getLatestBlockhash().send(),r={address:e},s=b(P({version:0}),(t=>D(r,t)),(t=>N(o,t)),(t=>M(W({amount:n,source:r,destination:a}),t)),(t=>O(t)));return new Uint8Array(E().encode(s))}({solanaClient:It,source:ht.address,destination:ft,amountInLamports:t}):async function({solanaClient:t,source:e,destination:a,amountInBaseUnits:n}){let o=Q(t.chain),{value:r}=await t.rpc.getLatestBlockhash().send(),s={address:e},[i]=await $({mint:o,owner:e,tokenProgram:H}),[l]=await $({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([t.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),t.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${e}`);let u=B({payer:s,ata:l,owner:a,mint:o}),d=b(P({version:0}),(t=>D(s,t)),(t=>N(r,t)),(t=>c?.value?t:M(u,t)),(t=>M(R({source:i,destination:l,authority:s,amount:n}),t)),(t=>O(t)));return new Uint8Array(E().encode(d))}({solanaClient:It,source:ht.address,destination:ft,amountInBaseUnits:t})).then(rt).catch((t=>{nt("error"),mt(t)}))}),[et,ct,ut,dt,ht,ft,St,wt]),r((()=>{"preparing"===et&&ot&&at({tx:ot,solanaClient:It,amount:ct,asset:ut,tokenPrice:wt}).then((t=>{nt("loaded"),it({amount:t?.amountInUsd??t?.amountInUsdc??t?.amountInSol??ct,fee:t?.feeInUsd??t?.feeInSol,total:t?.totalInUsd??t?.totalInSol})})).catch((t=>{nt("error"),mt(t)}))}),[ot,ct,ut,et,wt]),r((()=>{"error"===et&<&&(G({errorModalData:{error:lt,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:v.solanaFundingData}),z("ErrorScreen",!1))}),[et,z]),r((()=>{if("success"!==et)return;let t=setTimeout(gt?()=>z(gt):w,C);return()=>clearTimeout(t)}),[et]),/*#__PURE__*/e(a,"success"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(m,{}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/t(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(p,{title:"Success!",description:`You’ve successfully added ${ct} ${ut} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(i,{})]}:"preparing"===et||"loaded"===et||"sending"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(d,{style:{marginTop:"16px"},children:/*#__PURE__*/t(g,{icon:ht?.standardWallet.icon,name:ht?.standardWallet.name})}),/*#__PURE__*/t(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===et&&ht?`Confirming with ${ht.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/t(K,{rows:[{label:"Source",value:s(pt.address)},{label:"Destination",value:s(ft)},{label:"Network",value:q(dt)},{label:"Amount",value:st?.amount,isLoading:"preparing"===et},{label:"Estimated fee",value:st?.fee,isLoading:"preparing"===et},{label:"Total",value:st?.total,isLoading:"preparing"===et}]}),/*#__PURE__*/t(l,{style:{marginTop:"1rem"},loading:"preparing"===et||"sending"===et,onClick:function(){"loaded"===et&&ot&&ht&&(nt("sending"),async function({transaction:t,chain:e,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await X({solanaClient:n,tx:t});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:t,chain:e}).catch((t=>{throw new L("Transaction was rejected by the user",t,x.TRANSACTION_FAILURE)}))).signature);return await Y({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:It,transaction:ot,chain:dt,sourceWallet:ht}).then((t=>{nt("success"),S({eventName:A,payload:{provider:"external",status:"success",txHash:t,address:ht.address,value:ct,chainType:"solana",clusterName:dt,token:ut,destinationAddress:ft,destinationValue:ct,destinationChainType:"solana",destinationClusterName:dt,destinationToken:ut}})})).catch((t=>{nt("error"),mt(t)})))},children:"Confirm"}),/*#__PURE__*/t(i,{})]}:{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(h,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(i,{})]})}};export{nt as FundSolWalletWithExternalSolanaWallet,nt as default};
|
package/dist/esm/{FundWalletMethodHeader-PIxwFzzh.mjs → FundWalletMethodHeader-CDUUJTHP.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as n}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{M as a}from"./ModalHeader-Dt9RfCUU.mjs";function t({title:t}){let{currentScreen:i,navigateBack:r,navigate:d,data:o,setModalData:u}=e();/*#__PURE__*/return n(a,{title:t,backFn:"ManualTransferScreen"===i?r:i===o?.funding?.methodScreen?o.funding.comingFromSendTransactionScreen?()=>d("SendTransactionScreen"):void 0:o?.funding?.methodScreen?()=>{let n=o.funding;n.usingDefaultFundingMethod&&(n.usingDefaultFundingMethod=!1),u({funding:n,solanaFundingData:o?.solanaFundingData}),d(n.methodScreen)}:void 0})}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-Dt9RfCUU.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as m}from"./FundWalletMethodHeader-CDUUJTHP.mjs";import{N as a}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{u as p}from"./useGetTokenPrice-D-ZL2L5m.mjs";import{c as d}from"./ethers-CG8w3aPx.mjs";import{F as u,a as h,h as j,c as f,d as C}from"./styles-Bb6ZtmWU.mjs";import"styled-components";import"./context-DJw8ICPU.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./useGetSolPrice-DwwjjGbd.mjs";import"./LinkPasskeyScreen-C0qjIYHG.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-Dfp-g3KU.mjs";import"./Screen-D3XHNOhT.mjs";const g={component:()=>{let{data:g,setModalData:v}=l(),y=g?.funding,k="solana"===y.chainType,x=r(null),{tokenPrice:S}=p(k?"solana":y.chain.id),D=k?void 0:y,T=!(!D?.erc20Address||D?.erc20ContractInfo),F=k?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",A=parseFloat(y.amount),I=!isNaN(A)&&A>0,L=S?d(y.amount,S):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(m,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:T?/*#__PURE__*/o(a,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>x.current?.focus(),children:[/*#__PURE__*/o(j,{ref:x,value:y.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&v({...g,funding:{...y,amount:e},solanaFundingData:g?.solanaFundingData?{...g.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:F})]}),!D?.erc20Address&&!(k&&y.isUSDC)&&/*#__PURE__*/o(C,{children:L&&I?`${L} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!I,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{g as FundingAmountEditScreen,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-Dt9RfCUU.mjs";import{t as h}from"./FundWalletMethodHeader-CDUUJTHP.mjs";import{E as p}from"./ErrorBanner-CQERa7bL.mjs";import{I as m}from"./InfoBanner-Dk1KghcK.mjs";import{u}from"./context-DJw8ICPU.mjs";import{v as f,Q as g,U as y}from"./useActiveWallet-DaOhml0T.mjs";import{a as C,u as v}from"./internal-context-Z-fyxadS.mjs";import{a as w}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{u as F}from"./useWallets-Cgll-RH3.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-CxatSwzi.mjs";import{avalanche as S,arbitrum as W,polygon as x,optimism as I,base as j,mainnet as T,toCoinbaseAssetId as D,getCoinbaseOnRampUrl as k,chainToMoonpayCurrency as A,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as E}from"@privy-io/popup";import{a as U}from"./index-RPlvvhMv.mjs";import{e as O,I as _,f as H,g as P}from"./styles-Bb6ZtmWU.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-C0qjIYHG.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-Dfp-g3KU.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const B=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),R=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function q(e){let n=N[e];if(!n)throw new C(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let N={[T.id]:"ethereum",[j.id]:"base",[I.id]:"optimism",[x.id]:"polygon",[W.id]:"arbitrum",[S.id]:"avacchain"};const Q=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=E();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?q(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?D(n.chain.id,"native-currency"):"SOL",h=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:p}=k({appId:e.getAppId(),input:h,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=p.toString();let m={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(m.usingDefaultFundingMethod=!1),t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:h.partner_user_id,popup:d}})}),5e3),r()})),$=async(e,n,t,a,i,o,r,c)=>{let d=E();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?A(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:h}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:U(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),d.location=l;let p={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:p,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:h},funding:p,solanaFundingData:r?.solanaFundingData})}),8e3)};let J=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const X=()=>J("https://apple.com/apple-pay"),G=()=>J("https://google.com/pay"),K={component:()=>{let{wallets:r}=F(),{connectors:C}=v(),S=C.filter(f).flatMap((e=>e.wallets)),{navigate:W,data:x,setModalData:I}=w(),{client:j}=v(),T=u(),D=x?.funding,k=V(X),A=V(G),E="solana"===D.chainType,U=E?void 0:D,q=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",h=!!d||l&&z(Number(t.chain.id),l),p=!!d||l&&L(Number(t.chain.id),l),m=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&p&&m.push((()=>Q(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&h&&l&&m.push((()=>$(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&p&&(r=()=>Q(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:m,onFundWithExchange:r,onFundWithWallet:c}})(T,j,D,I,W,x)),[T,j,D,x,I,W]),N=E?S.find((({address:e})=>e===D.address)):r.find((({address:e})=>s(e)===s(D.address))),J=g(N?.walletClientType||"unknown"),K=J?.name||"wallet",Y=N&&"privy"!==N.walletClientType?K:T.name,Z=d((()=>D.uiConfig?.landing?.title?D.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[D.uiConfig?.landing?.title,Y]);c((()=>{if(D?.defaultFundingMethod&&D.usingDefaultFundingMethod)switch(I({funding:{...D,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),D?.defaultFundingMethod){case"card":q.onFundWithCard[0]&&q.onFundWithCard[0]();break;case"exchange":q.onFundWithExchange&&q.onFundWithExchange();break;case"wallet":q.onFundWithWallet&&q.onFundWithWallet();break;case"manual":W("ManualTransferScreen")}}),[]),c((()=>{U?.erc20Address&&!U.erc20ContractInfo&&b({address:U.erc20Address,chain:U.chain,rpcConfig:T.rpcConfig,privyAppId:T.id}).then((e=>{I({...x,funding:{...U,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[U?.erc20Address,U?.chain]);let ee=!(!U?.erc20Address||U?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(h,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(O,{children:[D.errorMessage&&/*#__PURE__*/e(p,{theme:T.appearance.palette.colorScheme,children:D.errorMessage}),q.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithCard[0],children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",k?/*#__PURE__*/e(B,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):A?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),q.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithExchange,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),q.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithWallet,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>W("ManualTransferScreen"),children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),D?.showAlternateFundingMethod&&q.onFundWithCard?.[1]&&/*#__PURE__*/e(m,{theme:T.appearance.palette.colorScheme,children:/*#__PURE__*/n(H,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(P,{onClick:q.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{K as FundingMethodSelectionScreen,K as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{ExternalLink as o}from"lucide-react";import{u as e}from"./internal-context-Z-fyxadS.mjs";import{S as r}from"./ScreenLayout-Dfp-g3KU.mjs";import"ofetch";import"react";import"./ModalHeader-Dt9RfCUU.mjs";import"styled-components";import"./context-DJw8ICPU.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-CtfiZMWv.mjs";import"viem";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/t(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:o,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=e();/*#__PURE__*/return t(i,{onClose:()=>o()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as o}from"react/jsx-runtime";import{L as r}from"./Link-DJ5gq9Di.mjs";import{T as i,a as l}from"./TodoList-CgrU7uwu.mjs";import{a}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as n}from"./ScreenLayout-Dfp-g3KU.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-DJw8ICPU.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-Dt9RfCUU.mjs";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const s=({walletName:a,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${a} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(o,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(r,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(l,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(r,{href:s,target:"_blank",children:[a," browser extension"]})]})}),/*#__PURE__*/t(l,{children:"Set up your first wallet"}),/*#__PURE__*/t(l,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:o}=a();if(!o?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:r}=o.installWalletModalData;/*#__PURE__*/return t(s,{walletName:r.name,installLink:r.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-DJw8ICPU.mjs";import{C as r,L as i}from"./CustomLandingScreenView-C2HMC1Df.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-Dt9RfCUU.mjs";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-CtfiZMWv.mjs";import"viem";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CMDYWbe4.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ConnectWalletView-NvVzGHBr.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-0otXb_E9.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-OYSBAOoJ.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-BOaRwgjM.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-CwVcpNfb.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-DxD32Aku.mjs";import"./ScreenLayout-Dfp-g3KU.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!1}):/*#__PURE__*/t(i,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0};export{e as LandingScreen,e as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import n from"@heroicons/react/24/outline/WalletIcon";import{useState as a}from"react";import{P as i,M as s,B as c,S as l}from"./ModalHeader-
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import n from"@heroicons/react/24/outline/WalletIcon";import{useState as a}from"react";import{P as i,M as s,B as c,S as l}from"./ModalHeader-Dt9RfCUU.mjs";import{styled as d}from"styled-components";import{e as u}from"./StackedContainer-B2vaEl56.mjs";import{A as p}from"./Address-B3pOzvIk.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{e as f}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{u as g}from"./context-DJw8ICPU.mjs";import x from"@heroicons/react/24/outline/ExclamationCircleIcon";import y from"@heroicons/react/24/outline/Square2StackIcon";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"lucide-react";import"ofetch";import"tinycolor2";const v=d.span`
|
|
2
2
|
&& {
|
|
3
3
|
width: 82px;
|
|
4
4
|
height: 82px;
|
|
@@ -13,7 +13,7 @@ import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import t from"@h
|
|
|
13
13
|
transition: border-color 800ms;
|
|
14
14
|
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
15
15
|
}
|
|
16
|
-
`;function
|
|
16
|
+
`;function w(o){/*#__PURE__*/return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",...o,children:[/*#__PURE__*/r("circle",{cx:"12",cy:"12",r:"10"}),/*#__PURE__*/r("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),/*#__PURE__*/r("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})]})}const b=({onTransfer:e,isTransferring:o,transferSuccess:t})=>/*#__PURE__*/r(i,{...t?{success:!0,children:"Success!"}:{warn:!0,loading:o,onClick:e,children:"Transfer and delete account"}}),T=d.div`
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
align-items: center;
|
|
@@ -76,4 +76,4 @@ import{jsxs as e,jsx as r,Fragment as o}from"react/jsx-runtime";import t from"@h
|
|
|
76
76
|
display: flex;
|
|
77
77
|
justify-content: center;
|
|
78
78
|
align-items: center;
|
|
79
|
-
`;let M=()=>/*#__PURE__*/r(I,{children:/*#__PURE__*/r(A,{$iconSize:60})});const $=({address:t,onClose:a,onRetry:i,onTransfer:l,isTransferring:d,transferSuccess:u})=>{let{defaultChain:h}=g(),m=h.blockExplorers?.default.url??"https://etherscan.io";/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(s,{onClose:a,backFn:i}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/r(M,{}),/*#__PURE__*/e(k,{children:[/*#__PURE__*/r("h3",{children:"Check account assets before transferring"}),/*#__PURE__*/r("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),/*#__PURE__*/e(j,{children:[/*#__PURE__*/r("p",{children:" To check your balance, you can:"}),/*#__PURE__*/r(W,{children:"Log out and log back into the other account, or "}),/*#__PURE__*/e(W,{children:["Copy your wallet address and use a"," ",/*#__PURE__*/r("u",{children:/*#__PURE__*/r("a",{target:"_blank",href:m,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),/*#__PURE__*/e(C,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(p,{address:t,showCopyIcon:!1}),/*#__PURE__*/r(S,{})]}),/*#__PURE__*/r(
|
|
79
|
+
`;let M=()=>/*#__PURE__*/r(I,{children:/*#__PURE__*/r(A,{$iconSize:60})});const $=({address:t,onClose:a,onRetry:i,onTransfer:l,isTransferring:d,transferSuccess:u})=>{let{defaultChain:h}=g(),m=h.blockExplorers?.default.url??"https://etherscan.io";/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(s,{onClose:a,backFn:i}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/r(M,{}),/*#__PURE__*/e(k,{children:[/*#__PURE__*/r("h3",{children:"Check account assets before transferring"}),/*#__PURE__*/r("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),/*#__PURE__*/e(j,{children:[/*#__PURE__*/r("p",{children:" To check your balance, you can:"}),/*#__PURE__*/r(W,{children:"Log out and log back into the other account, or "}),/*#__PURE__*/e(W,{children:["Copy your wallet address and use a"," ",/*#__PURE__*/r("u",{children:/*#__PURE__*/r("a",{target:"_blank",href:m,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),/*#__PURE__*/e(C,{onClick:()=>navigator.clipboard.writeText(t).catch(console.error),children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(p,{address:t,showCopyIcon:!1}),/*#__PURE__*/r(S,{})]}),/*#__PURE__*/r(b,{onTransfer:l,isTransferring:d,transferSuccess:u})]})]}),/*#__PURE__*/r(c,{})]})},z={component:()=>{let{initiateAccountTransfer:e,closePrivyModal:o}=h(),{data:t,navigate:n,lastScreen:i,setModalData:s}=m(),[c,l]=a(void 0),[d,u]=a(!1),[p,f]=a(!1),g=async()=>{try{if(!t?.accountTransfer?.nonce||!t?.accountTransfer?.account)throw Error("missing account transfer inputs");f(!0),await e({nonce:t?.accountTransfer?.nonce,account:t?.accountTransfer?.account,accountType:t?.accountTransfer?.linkMethod,externalWalletMetadata:t?.accountTransfer?.externalWalletMetadata,telegramWebAppData:t?.accountTransfer?.telegramWebAppData,telegramAuthResult:t?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:t?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:t?.accountTransfer?.oAuthUserInfo}),u(!0),f(!1),setTimeout(o,1e3)}catch(e){s({errorModalData:{error:e,previousScreen:i||"LinkConflictScreen"}}),n("ErrorScreen",!0)}};return c?/*#__PURE__*/r($,{address:c,onClose:o,onRetry:()=>l(void 0),onTransfer:g,isTransferring:p,transferSuccess:d}):/*#__PURE__*/r(E,{onClose:o,onInfo:()=>l(t?.accountTransfer?.embeddedWalletAddress),onContinue:()=>l(t?.accountTransfer?.embeddedWalletAddress),onTransfer:g,isTransferring:p,transferSuccess:d,data:t})}},E=({onClose:n,onContinue:a,onInfo:d,onTransfer:p,transferSuccess:h,isTransferring:m,data:g})=>{if(!g?.accountTransfer?.linkMethod||!g?.accountTransfer?.displayName)return;let x={method:g?.accountTransfer?.linkMethod,handle:g?.accountTransfer?.displayName,disclosedAccount:g?.accountTransfer?.embeddedWalletAddress?{type:"wallet",handle:g?.accountTransfer?.embeddedWalletAddress}:void 0};/*#__PURE__*/return e(o,{children:[/*#__PURE__*/r(s,{closeable:!0}),/*#__PURE__*/e(T,{children:[/*#__PURE__*/r(u,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/r(v,{color:"var(--privy-color-error)"}),/*#__PURE__*/r(t,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),/*#__PURE__*/e(k,{children:[/*#__PURE__*/e("h3",{children:[function(e){switch(e){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"siws":return"Solana wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"line":case"twitch":case"twitter":case"telegram":case"farcaster":return`${f(e.replace("_oauth",""))} profile`;default:return e.startsWith("privy:")?"Cross-app account":e}}(x.method)," is associated with another account"]}),/*#__PURE__*/e("p",{children:["Do you want to transfer",/*#__PURE__*/r("b",{children:x.handle?` ${x.handle}`:""})," to this account instead? This will delete your other account."]}),/*#__PURE__*/r(L,{onClick:d,disclosedAccount:x.disclosedAccount})]}),/*#__PURE__*/e(k,{style:{gap:12,marginTop:12},children:[g?.accountTransfer?.embeddedWalletAddress?/*#__PURE__*/r(i,{onClick:a,children:"Continue"}):/*#__PURE__*/r(b,{onTransfer:p,transferSuccess:h,isTransferring:m}),/*#__PURE__*/r(l,{onClick:n,children:"No thanks"})]})]}),/*#__PURE__*/r(c,{})]})};function L({disclosedAccount:o,onClick:t}){return o?/*#__PURE__*/e(C,{onClick:t,children:[/*#__PURE__*/r(n,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),/*#__PURE__*/r(p,{address:o.handle,showCopyIcon:!1}),/*#__PURE__*/r(w,{width:15,height:15,color:"var(--privy-color-foreground-3)",style:{marginLeft:"auto"}})]}):null}export{z as LinkConflictScreen,E as LinkConflictScreenView,z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/EnvelopeIcon";import{C as r}from"./ConnectEmailForm-BOaRwgjM.mjs";import{B as i}from"./Layouts-BlFm53ED.mjs";import{u as e}from"./context-DJw8ICPU.mjs";import{S as m}from"./ScreenLayout-Dfp-g3KU.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./index-CMDYWbe4.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-CtfiZMWv.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"tinycolor2";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(i,{children:/*#__PURE__*/t(r,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{CheckCircle as t,FingerprintIcon as o,Trash2 as i}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s,css as c}from"styled-components";import{G as l}from"./useActiveWallet-
|
|
1
|
+
import{jsx as e,jsxs as r}from"react/jsx-runtime";import{CheckCircle as t,FingerprintIcon as o,Trash2 as i}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s,css as c}from"styled-components";import{G as l}from"./useActiveWallet-DaOhml0T.mjs";import{T as d,a as p}from"./TodoList-CgrU7uwu.mjs";import{u as m,c as h,b as u}from"./internal-context-Z-fyxadS.mjs";import{u as y}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as f}from"./ScreenLayout-Dfp-g3KU.mjs";import"zustand";import"./context-DJw8ICPU.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const k=({passkeys:r,isLoading:i,errorReason:n,success:a,expanded:s,onLinkPasskey:c,onUnlinkPasskey:l,onExpand:d,onBack:p,onClose:m})=>/*#__PURE__*/e(f,a?{title:"Passkeys updated",icon:t,iconVariant:"success",primaryCta:{label:"Done",onClick:m},onClose:m,watermark:!0}:s?{icon:o,title:"Your passkeys",onBack:p,onClose:m,watermark:!0,children:/*#__PURE__*/e(v,{passkeys:r,expanded:s,onUnlink:l,onExpand:d})}:{icon:o,title:"Set up passkey verification",subtitle:"Verify with passkey",primaryCta:{label:"Add new passkey",onClick:c,loading:i},onClose:m,watermark:!0,helpText:n||void 0,children:0===r.length?/*#__PURE__*/e(x,{}):/*#__PURE__*/e(g,{children:/*#__PURE__*/e(v,{passkeys:r,expanded:s,onUnlink:l,onExpand:d})})});let g=s.div`
|
|
2
2
|
margin-bottom: 12px;
|
|
3
3
|
`,v=({passkeys:t,expanded:o,onUnlink:a,onExpand:s})=>{let[c,d]=n([]),p=o?t.length:2;/*#__PURE__*/return r("div",{children:[/*#__PURE__*/e(A,{children:"Your passkeys"}),/*#__PURE__*/r(I,{children:[t.slice(0,p).map((t=>{/*#__PURE__*/return r(P,{children:[/*#__PURE__*/r("div",{children:[/*#__PURE__*/e(E,{children:(o=t,o.authenticatorName?o.createdWithBrowser?`${o.authenticatorName} on ${o.createdWithBrowser}`:o.authenticatorName:o.createdWithBrowser?o.createdWithOs?`${o.createdWithBrowser} on ${o.createdWithOs}`:`${o.createdWithBrowser}`:"Unknown device")}),/*#__PURE__*/r(L,{children:["Last used:"," ",(t.latestVerifiedAt??t.firstVerifiedAt)?.toLocaleString()??"N/A"]})]}),/*#__PURE__*/e(W,{disabled:c.includes(t.credentialId),onClick:()=>(async e=>{d((r=>r.concat([e]))),await a(e),d((r=>r.filter((r=>r!==e))))})(t.credentialId),children:c.includes(t.credentialId)?/*#__PURE__*/e(l,{}):/*#__PURE__*/e(i,{size:16})})]},t.credentialId);var o})),t.length>2&&!o&&/*#__PURE__*/e(C,{onClick:s,children:"View all"})]})]})},x=()=>/*#__PURE__*/r(d,{style:{color:"var(--privy-color-foreground)"},children:[/*#__PURE__*/e(p,{children:"Verify with Touch ID, Face ID, PIN, or hardware key"}),/*#__PURE__*/e(p,{children:"Takes seconds to set up and use"}),/*#__PURE__*/e(p,{children:"Use your passkey to verify transactions and login to your account"})]});const w={component:()=>{let{user:r,unlinkPasskey:t}=y(),{linkWithPasskey:o,closePrivyModal:i}=m(),s=r?.linkedAccounts.filter((e=>"passkey"===e.type)),[c,l]=n(!1),[d,p]=n(""),[f,g]=n(!1),[v,x]=n(!1);return a((()=>{0===s.length&&x(!1)}),[s.length]),/*#__PURE__*/e(k,{passkeys:s,isLoading:c,errorReason:d,success:f,expanded:v,onLinkPasskey:()=>{l(!0),o().then((()=>g(!0))).catch((e=>{if(e instanceof h){if(e.privyErrorCode===u.CANNOT_LINK_MORE_OF_TYPE)return void p("Cannot link more passkeys to account.");if(e.privyErrorCode===u.PASSKEY_NOT_ALLOWED)return void p("Passkey request timed out or rejected by user.")}p("Unknown error occurred.")})).finally((()=>{l(!1)}))},onUnlinkPasskey:async e=>(l(!0),await t(e).then((()=>g(!0))).catch((e=>{e instanceof h&&e.privyErrorCode===u.MISSING_MFA_CREDENTIALS?p("Cannot unlink a passkey enrolled in MFA"):p("Unknown error occurred.")})).finally((()=>{l(!1)}))),onExpand:()=>x(!0),onBack:()=>x(!1),onClose:()=>i()})}},b=s.div`
|
|
4
4
|
display: flex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-CwVcpNfb.mjs";import{u as i}from"./context-DJw8ICPU.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as a}from"./ScreenLayout-Dfp-g3KU.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{S as i}from"./ScreenLayout-Dfp-g3KU.mjs";import"ofetch";import"react";import"viem";import"./context-DJw8ICPU.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-Dt9RfCUU.mjs";import"styled-components";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";const n=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:n="Try again",secondaryCtaText:a="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:n,onClick:m},secondaryCta:{label:a,onClick:c},watermark:!0}),a={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(n,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{a as LoginFailedScreen,n as LoginFailedScreenView,a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useMemo as a}from"react";import{formatUnits as s}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c,B as d}from"./ModalHeader-Dt9RfCUU.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-0otXb_E9.mjs";import{t as u}from"./FundWalletMethodHeader-CDUUJTHP.mjs";import{I as f}from"./InfoBanner-Dk1KghcK.mjs";import{S as h}from"./Subtitle-CV-2yKE4.mjs";import{T as g}from"./Title-BnzYV3Is.mjs";import{W as v}from"./WalletInfoCard-D4QREH8T.mjs";import{u as j}from"./context-DJw8ICPU.mjs";import{v as y,D as C}from"./useActiveWallet-DaOhml0T.mjs";import{u as S}from"./internal-context-Z-fyxadS.mjs";import{a as I}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{u as b}from"./useWalletBalance-CRXiZUj2.mjs";import{u as T}from"./useWallets-Cgll-RH3.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{x as A,z as k}from"./index-CMDYWbe4.mjs";import{g as D}from"./getChainName-DjpPdUSc.mjs";import{g as F}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as U}from"./getErc20Balance-DA4dGV9O.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-B3pOzvIk.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const x={component:()=>{let{wallets:k}=T(),{connectors:x}=S(),E=x.filter(y).flatMap((e=>e.wallets)),{data:$,setModalData:L,navigate:W,lastScreen:O}=I(),{rpcConfig:P,appId:z,createAnalyticsEvent:Q,closePrivyModal:R}=S(),q=j(),[H,N]=o(void 0),[X,Y]=o(!1),G=$?.funding,{reloadBalance:J}=b({rpcConfig:P,appId:z,address:"ethereum"===G.chainType?G.address:void 0,chain:"ethereum"===G.chainType?G.chain:void 0}),K="solana"===G.chainType,V=K?G.isUSDC?"USDC":"SOL":G.erc20Address?G.erc20ContractInfo?.symbol:G.chain.nativeCurrency.symbol,Z=K?E.find((({address:e})=>e===G.address)):k.find((({address:e})=>C(e)===C(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:O||"FundingMethodSelectionScreen"},funding:$?.funding,solanaFundingData:$?.solanaFundingData,sendTransaction:$?.sendTransaction}),W("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=q.solanaRpcs[G.chain];e?(G.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=o.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:G.address,mintAddress:F(G.chain)}):A({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);H&&r>H&&(Y(!0),Q({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-H,6):s(r-H,9),token:G.isUSDC?"USDC":"SOL"}})),N(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await U({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:P,appId:z});return e}})().then((e=>{H&&e>H&&(Y(!0),Q({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-H,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),N(e)})).catch((()=>N(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[H]);let _=a((()=>null==H?"":G.isUSDC?n({amount:H,decimals:6}):K?M(H,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:H,decimals:G.erc20ContractInfo.decimals}):m({wei:H})),[H,K,G]),ee="ethereum"===G.chainType?G.chain.name:D(G.chain),re=a((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(g,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=a((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&F(G.chain)?`?spl-token=${F(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:B}),/*#__PURE__*/t(f,{theme:q.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(v,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>R({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let B=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{x as ManualTransferScreen,x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{M as s,b as a,P as m}from"./ModalHeader-Dt9RfCUU.mjs";import{L as l}from"./useActiveWallet-DaOhml0T.mjs";import{u as c}from"./context-DJw8ICPU.mjs";import{u as p,a as u}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-w6UxoJph.mjs";import{A as v,C as j,I as k,T as g,S as C,B as w}from"./PinInput-3SLvbnQa.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"tinycolor2";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-CWTvIq8L.mjs";import"lucide-react";import"./index-CMDYWbe4.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-0wfhnc0j.mjs";import"./ScreenLayout-Dfp-g3KU.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-C0qjIYHG.mjs";import"./TodoList-CgrU7uwu.mjs";import"./CopyToClipboard-BGTSFnT3.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-0otXb_E9.mjs";import"qrcode";const M={component:()=>{let{user:M,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:S}=u(),A=c(),[E,R]=n(null),[P,x]=n(null),[T,F]=n(null),[L,B]=n(!1),[U,W]=n(!1),[D,O]=n(),X=async()=>{D?$(D):M?await H({user:M}):$(Error("Must be logged in to manage MFA")),setTimeout((()=>{R(null),x(null)}),500)};if(S.current=X,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:$,onSuccess:H,onBack:K,mfaMethods:Q,verify:q,generateTotpSecret:z,enrollTotp:J,unenrollTotp:N,enrollPasskey:V}=I.mfaEnroll,_=M?.mfaMethods.includes("sms"),G=M?.mfaMethods.includes("totp"),Y=M?.mfaMethods.includes("passkey"),Z=!!M?.phone,ee=M?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){R(null),x(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await V(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),B(!1)}}if(!b||!M||!A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{onClose:X,backFn:K},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(l,{})}),/*#__PURE__*/t(a,{})]});if("sms"===E)return null;if("totp"===E)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:X},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(C,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await N();return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(a,{})]});if("passkey"===E){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:X},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(C,{children:i?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V([]);return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(a,{})]})}return 0!==Q.length||_||G||Y?"sms"===P?null:"totp"===P&&T?/*#__PURE__*/t(h,{onClose:X,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await J(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),R(null)}}(e.mfaCode),error:D,totpInfo:{...T,appName:A?.name||"Privy"}}):"passkey"===P?/*#__PURE__*/t(y,{onReset:oe,onClose:X,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:M.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:Z,backFn:K,handleSelectMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}return"totp"===e?(x(e),F(null),void z().then((({totpSecret:e,totpAuthUrl:o})=>{F({authUrl:o,secret:e})})).catch((()=>{F(null),oe()}))):"passkey"===e&&1===ee.length?await te():void x(e)},isTotpLoading:"totp"===P&&!T,isPasskeyLoading:L,error:D,onClose:X,setRemovingMfaMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}R(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(s,{onClose:X,backFn:K},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[A?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{onClick:X,children:"Close"})}),/*#__PURE__*/t(a,{})]})}};export{M as MfaAuthEnrollmentFlowScreen,M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useMemo as e,useState as t,useEffect as r,useRef as i}from"react";import{u as s}from"./context-DJw8ICPU.mjs";import{u as m,a as n}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{V as a,a as c,b as p,t as l}from"./to-ui-error-CRLswbee.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-Dt9RfCUU.mjs";import"styled-components";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ScreenLayout-Dfp-g3KU.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-D-ZL2L5m.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./index-CMDYWbe4.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./TransactionDetails-BnQV3aq5.mjs";import"./WalletLink-CeVlaFWB.mjs";import"./ethers-CG8w3aPx.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u={component:()=>{let{user:u}=m(),d=s(),h=e((()=>u?.mfaMethods.filter((o=>"passkey"!==o||!d.globalDisablePasskeys))??[]),[u?.mfaMethods,d.globalDisablePasskeys]),{data:f}=n(),[j,y]=t(h[0]),[v,k]=t(!1),[g,w]=t(),[b,C]=t();if(r((()=>{y(h[0])}),[h]),!f?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:I,onSuccess:M,generateOptions:S,verifyTotpCode:P,verifyPasskey:x,verifySmsCode:A,sendSmsCode:E}=f.mfaVerify,B=async o=>{if("passkey"!==o)try{y(o),"sms"===o&&(y(o),await E()),"totp"===o&&y(o)}catch(o){console.error(o)}else try{y(o);let e=await S();if(!e)throw Error("something went wrong");w(e),await x(e),k(!0),C(void 0),M()}catch(o){C(l(o))}},F=async o=>{C(void 0);try{if(!o||!j)return;if("passkey"===j){if(!g)throw Error("Missing passkey challenge");await x(g)}else"sms"===j?await A(o):"totp"===j&&await P(o);C(void 0),k(!0),M()}catch(o){throw l(o).error}},L=()=>{b||!v?I(b?.error??Error("Canceled MFA verification.")):M()},D=i(!1);return r((()=>{!D.current&&j&&(D.current=!0,B(j).finally((()=>{D.current=!1})))}),[open]),u?"passkey"===j?/*#__PURE__*/o(a,{account:u.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,e)=>e.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:b?.isBlocking??!1,error:b?.error,onClose:L,onBack:()=>{y(void 0),C(void 0)},handleSubmit:()=>F(g).catch(C)}):"sms"===j||"totp"===j?/*#__PURE__*/o(c,{selectedMethod:j,submitSuccess:v,hasBlockingError:b?.isBlocking??!1,handleSubmitCode:F,onClose:L,onBack:h.length>1?()=>y(void 0):void 0}):/*#__PURE__*/o(p,{mfaMethods:h,onSelect:B,handleClose:L}):null}};export{u as MfaAuthVerifyFlowScreen,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import n from"@heroicons/react/24/outline/ShieldCheckIcon";import i from"@heroicons/react/24/solid/CheckBadgeIcon";import l from"@heroicons/react/24/solid/IdentificationIcon";import{useState as a,useEffect as s}from"react";import{M as c,b as m,P as d,S as h}from"./ModalHeader-Dt9RfCUU.mjs";import{L as u}from"./useActiveWallet-DaOhml0T.mjs";import{u as p}from"./context-DJw8ICPU.mjs";import{u as f}from"./internal-context-Z-fyxadS.mjs";import{a as y,u as v}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-CMDYWbe4.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-w6UxoJph.mjs";import P from"@heroicons/react/24/outline/CheckCircleIcon";import F from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-CwVcpNfb.mjs";import{I as W,T,S as B,C as L,a as A,B as N,N as U,A as O,L as D,b as $,c as X}from"./PinInput-3SLvbnQa.mjs";import{ErrorScreenView as Y}from"./ErrorScreen-CWTvIq8L.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-C0qjIYHG.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-Dfp-g3KU.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";import"./CopyToClipboard-BGTSFnT3.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-0otXb_E9.mjs";import"qrcode";import"./reservoir-0wfhnc0j.mjs";const q=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,h]=a(""),[u,f]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=y(),D=p();function $(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(Y,{allowlistConfig:D.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(c,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(T,{children:"Set up SMS verification"}),/*#__PURE__*/o(B,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(L,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),h(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(A,{children:["By providing your mobile number, you agree to receive text messages from ",D?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(m,{})]}:u?{children:[/*#__PURE__*/e(c,{onClose:$},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(T,{children:"SMS verification added"}),/*#__PURE__*/o(B,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:$,children:"Done"})}),/*#__PURE__*/e(m,{})]}:{children:[/*#__PURE__*/e(c,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(T,{children:"Enter enrollment code"}),/*#__PURE__*/o(L,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),f(!0)}catch(e){if(w(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(k(e))throw Error("The code you entered is not valid");if(g(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw j(e)?Error("Verification canceled"):Error("Unknown error")}}}),/*#__PURE__*/o(B,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(m,{})]})},H={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,P]=a(null),{unenrollWithSms:F,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:A,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:Y,initEnrollmentWithTotp:H}=C(),{data:K,onUserCloseViaDialogOrKeybindRef:Q}=y(),V=p(),{closePrivyModal:z}=f(),{promptMfa:J}=b(),[_,G]=a(!1),[Z,ee]=a(null),[oe,re]=a(null),te=()=>{z({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{P(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();Q.current=te;let se=w?.mfaMethods.includes("sms"),ce=!!w?.phone,me=w?.mfaMethods.includes("totp"),de=w?.mfaMethods.includes("passkey"),he=se||me||de,ue=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){P(null),ee(null)}async function fe(e=ue){ie(!0);try{return await U(),await Y({credentialIds:e},{removeForLogin:K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),K?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&G(!0)}),[he]),!g||!w||!V/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(L,{children:/*#__PURE__*/e(u,{})}),/*#__PURE__*/e(m,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(T,{children:"Remove SMS verification?"}),/*#__PURE__*/o(B,{children:["MFA adds an extra layer of security to your ",V?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await F()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(T,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(B,{children:["MFA adds an extra layer of security to your ",V?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await R()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("passkey"===j){let n=K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(T,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(B,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await x({removeForLogin:K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]})}if(0===K.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(T,{children:"Add more security"}),/*#__PURE__*/o(B,{children:[V?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:te,children:"Close"})}),/*#__PURE__*/e(m,{})]});let ye=!he&&!_;return ye?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(T,{children:"Transaction Protection"}),/*#__PURE__*/e(B,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/o($,{children:[/*#__PURE__*/e(X,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",V?.name," wallet."]}),/*#__PURE__*/o($,{children:[/*#__PURE__*/e(X,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(d,{onClick:()=>G(!0),children:"Continue"}),/*#__PURE__*/e(h,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(m,{})]}):"sms"===Z?/*#__PURE__*/e(q,{appName:V?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===Z&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await A({mfaCode:e}),K?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{P(null)}}(e),totpInfo:{...oe,appName:V?.name||"Privy"}}):"passkey"===Z?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:fe}):/*#__PURE__*/e(I,{showIntro:ye,userMfaMethods:w.mfaMethods,appMfaMethods:V.mfa.methods,userHasAuthSms:ce,backFn:function(){G(!1)},handleSelectMethod:async function(e){try{await J()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void H().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await fe():void ee(e)},isTotpLoading:"totp"===Z&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await J()}catch(e){return void ae(e)}P(e)}})}};export{H as MfaEnrollmentFlowScreen,H as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{useMemo as t,useState as e,useEffect as r,useRef as i}from"react";import{u as s}from"./context-DJw8ICPU.mjs";import{u as m}from"./get-is-unified-wallet-CtfiZMWv.mjs";import{u as n}from"./index-CMDYWbe4.mjs";import{V as a,a as c,b as l,t as p}from"./to-ui-error-CRLswbee.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DaOhml0T.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-ByGs9MT4.mjs";import"viem/utils";import"./useWallets-Cgll-RH3.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CJdU0Qbv.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-Dt9RfCUU.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ScreenLayout-Dfp-g3KU.mjs";import"./Screen-D3XHNOhT.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-D-ZL2L5m.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./TransactionDetails-BnQV3aq5.mjs";import"./WalletLink-CeVlaFWB.mjs";import"./ethers-CG8w3aPx.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u=({onClose:u})=>{let{user:d}=m(),h=s(),j=t((()=>d?.mfaMethods.filter((o=>"passkey"!==o||!h.globalDisablePasskeys))??[]),[d?.mfaMethods,h.globalDisablePasskeys]),[f,v]=e(j[0]??null),{init:y,cancel:k,submit:g}=n(),[b,w]=e(!1),[I,C]=e(null),[P,S]=e();r((()=>{v(j[0]??null)}),[j]);let x=i(!1);async function M(o){S(void 0);try{if(!o||!f)return;await g(f,o),w(!0),S(void 0),u()}catch(o){throw p(o).error}}async function B(o){if("passkey"!==o)try{v(o),await y(o)}catch(o){console.error(o)}else try{v(o);let t=await y(o);if(!t)throw Error("something went wrong");C(t),await g(o,t),w(!0),S(void 0),u()}catch(o){S(p(o))}}r((()=>{!x.current&&f&&(x.current=!0,B(f).finally((()=>{x.current=!1})))}),[]);let A=()=>{v(null),S(void 0),k(),u()};return d?"passkey"===f?/*#__PURE__*/o(a,{account:d.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:b,hasBlockingError:P?.isBlocking??!1,error:P?.error,onClose:A,onBack:()=>{v(null),S(void 0)},handleSubmit:()=>M(I).catch(S)}):f?/*#__PURE__*/o(c,{submitSuccess:b,hasBlockingError:P?.isBlocking??!1,handleSubmitCode:M,selectedMethod:f,onClose:A,onBack:j.length>1?()=>v(null):void 0}):/*#__PURE__*/o(l,{mfaMethods:j,onSelect:B,handleClose:A}):null};export{u as MfaVerifyFlowScreen,u as default};
|