@privy-io/react-auth 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{AccountNotFoundScreen-jSbfPu_e.js → AccountNotFoundScreen-Cu7enz9o.js} +1 -1
- package/dist/cjs/{Address-CZQd_MIA.js → Address-DYZ3IQKV.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-Cl_SWg16.js +1 -0
- package/dist/cjs/{AllowlistRejectionScreen-B6roj0JU.js → AllowlistRejectionScreen-D5b9mnX_.js} +1 -1
- package/dist/cjs/{AuthenticateWithWalletScreen-BcBapHrq.js → AuthenticateWithWalletScreen-CfFbXvGY.js} +1 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-CCdsJbKx.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-CTI3rpHf.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-ftedBDSO.js +1 -0
- package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DYS3lDs0.js → AwaitingSolToEvmBridgingScreen-CaKyEgGQ.js} +1 -1
- package/dist/cjs/{BridgeNetworkSelectionView-uivzU_Y9.js → BridgeNetworkSelectionView-ekW1jVoZ.js} +1 -1
- package/dist/cjs/{Button-nXApC2Jy.js → Button-BpQ22RCK.js} +1 -1
- package/dist/cjs/CaptchaScreen-aaD10pK6.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-DXk7YS8-.js +1 -0
- package/dist/cjs/{ConnectEmailForm-BEv-7qU9.js → ConnectEmailForm-uUuYB04I.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-BsZYPosO.js +1 -0
- package/dist/cjs/{ConnectOnlyLandingScreen-bOhkl0xJ.js → ConnectOnlyLandingScreen-DDCcNqF9.js} +1 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DyJB2X3z.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-Dfoq-0pD.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-DK-bg2D5.js → ConnectPhoneForm-tjeQd9v8.js} +1 -1
- package/dist/cjs/{ConnectWalletView-4vj7Sq7-.js → ConnectWalletView-CxfQTEJ2.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-iMAYJhVc.js +1 -0
- package/dist/cjs/CrossAppAuthScreen-CsZ_rLLg.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-tt_NEfU6.js → CustomLandingScreenView-B0bNrKZn.js} +2 -2
- package/dist/cjs/{DelegatedActionsConsentScreen-B5WlYn7z.js → DelegatedActionsConsentScreen-CyITZiB7.js} +1 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-vQnlP7qN.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-D5yc0IhZ.js +1 -0
- package/dist/cjs/{EmbeddedWalletCreatedScreen-PycFyIz6.js → EmbeddedWalletCreatedScreen-BFJ6BKQ4.js} +1 -1
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-BDTDQY1f.js → EmbeddedWalletKeyExportScreen-Cz3cpL6Q.js} +2 -2
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-L4tUdjxn.js +1 -0
- package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js → EmbeddedWalletPasswordUpdateScreen-n5Z982kO.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js → EmbeddedWalletPasswordUpdateSplashScreen-BJQXfJ5I.js} +1 -1
- package/dist/cjs/{EnrollTotp-DZ5fIrXr.js → EnrollTotp-Bo2kHSAy.js} +1 -1
- package/dist/cjs/ErrorScreen-BGI-4cUT.js +1 -0
- package/dist/cjs/FarcasterConnectStatusScreen-BKcQ6ZMu.js +2 -0
- package/dist/cjs/{FarcasterSignerStatusScreen-CDYkqsxz.js → FarcasterSignerStatusScreen-BB63F9MZ.js} +2 -2
- package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js → FundSolWalletWithExternalSolanaWallet-DFQlLB8a.js} +1 -1
- package/dist/cjs/{FundWalletMethodHeader-zYWhBIiS.js → FundWalletMethodHeader-CZ9E9Pcd.js} +1 -1
- package/dist/cjs/{FundingEditAmountScreen-BB7-k00c.js → FundingEditAmountScreen-C8OzBV96.js} +1 -1
- package/dist/cjs/{FundingMethodSelectionScreen-BrV94GD2.js → FundingMethodSelectionScreen-GE2W8CGa.js} +1 -1
- package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +1 -0
- package/dist/cjs/{InAppBrowserLoginNotPossible-y8g07-kU.js → InAppBrowserLoginNotPossible-BDJuZ0-D.js} +1 -1
- package/dist/cjs/{InstallWalletScreen-CmGi6mS1.js → InstallWalletScreen-tcaVKdvZ.js} +1 -1
- package/dist/cjs/LandingScreen-BIRSSuAB.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BJXyOu2J.js → LinkConflictScreen-D6812iEs.js} +1 -1
- package/dist/cjs/LinkEmailScreen-D-kZRiYu.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-Bw7Xs741.js → LinkPasskeyScreen-Dn0beRU9.js} +1 -1
- package/dist/cjs/{LinkPhoneScreen-C4JQblY3.js → LinkPhoneScreen-D2wD2X6_.js} +1 -1
- package/dist/cjs/{LoginFailedScreen-CGT-2B2h.js → LoginFailedScreen-JL8lSBDT.js} +1 -1
- package/dist/cjs/ManualTransferScreen-rVVbGuHO.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-7wF7sedZ.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-DXT_z8L7.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-DJWHdMZL.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-BC3Vuttf.js +1 -0
- package/dist/cjs/{ModalHeader-DbV81e3m.js → ModalHeader-BmFtLkWJ.js} +1 -1
- package/dist/cjs/{MoonpayStatusScreen-yghPhz7v.js → MoonpayStatusScreen-DyW9zeoT.js} +1 -1
- package/dist/cjs/OAuthStatusScreen-FjNrpKlb.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-DyHtky_y.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-Q0ag_5Jx.js +1 -0
- package/dist/cjs/PasswordRecoveryScreen-D6vuUKqB.js +1 -0
- package/dist/cjs/{QrCode-Ua_0cVUP.js → QrCode-qgAdMqWi.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-D1xbanmh.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-DW-I4Bjp.js +1 -0
- package/dist/cjs/RecoverySelectionScreen-CSsw-SMB.js +1 -0
- package/dist/cjs/{Screen-65eQbiHD.js → Screen-BAXdSOJk.js} +1 -1
- package/dist/cjs/{ScreenLayout-B_60rKhZ.js → ScreenLayout-95K6C4n8.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-DQolobOz.js → SetAutomaticRecoveryScreen-DdYvhBam.js} +1 -1
- package/dist/cjs/{SetWalletPasswordForm-8g-lawop.js → SetWalletPasswordForm-D7TN70-K.js} +2 -2
- package/dist/cjs/{SignRequestScreen-BAgmmVVW.js → SignRequestScreen-B6DzD2bf.js} +1 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-Cl_1GhiF.js +1 -0
- package/dist/cjs/TelegramAuthScreen-D32WGqrh.js +1 -0
- package/dist/cjs/{TransactionDetails-BefABtVQ.js → TransactionDetails-B4mP9iqk.js} +1 -1
- package/dist/cjs/{TransactionErrorView-QKWh4urc.js → TransactionErrorView-BPMOzuyp.js} +2 -2
- package/dist/cjs/TransferFromWalletScreen-BbJ3ISYt.js +1 -0
- package/dist/cjs/{TransferOrBridgeLoadingScreen-C6t1_cTP.js → TransferOrBridgeLoadingScreen-DsBPxxqR.js} +1 -1
- package/dist/cjs/TurnstileWrapper-qLN0G5m7.js +1 -0
- package/dist/cjs/UpdateEmailScreen-fqqg8VfP.js +1 -0
- package/dist/cjs/{UpdatePhoneScreen-DefnuTEZ.js → UpdatePhoneScreen-BJDovBOR.js} +1 -1
- package/dist/cjs/{UserLimitReachedScreen-B76r_-LC.js → UserLimitReachedScreen-CSkM5uLj.js} +1 -1
- package/dist/cjs/WalletButtonList-jzt0Egd8.js +1 -0
- package/dist/cjs/{WalletInfoCard-CscdnrUV.js → WalletInfoCard-bdaI4ebq.js} +1 -1
- package/dist/cjs/{WalletInterstitialScreen-CG1k3EvV.js → WalletInterstitialScreen-BzSNp3dA.js} +1 -1
- package/dist/cjs/{WalletLink-DF6dDjkz.js → WalletLink-2kOfC5R5.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/context-CToLw7Dr.js +1 -0
- package/dist/cjs/{ethers-uj8IknV_.js → ethers-Djy--MKt.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{frame-bPqBJ8fS.js → frame-BSQIYvLs.js} +1 -1
- package/dist/cjs/{get-is-unified-wallet-DmiciSes.js → get-is-unified-wallet-CAK7Zx3C.js} +1 -1
- package/dist/cjs/{getErc20Balance-BZ5-OGfD.js → getErc20Balance-BiXU_58s.js} +1 -1
- package/dist/cjs/{getErc20TokenInfo-HX7DgcWx.js → getErc20TokenInfo-B78AxnZ3.js} +1 -1
- package/dist/cjs/{getPublicClient-EjAv8R2z.js → getPublicClient-d-gCTRgH.js} +1 -1
- package/dist/cjs/index-BqAmClyL.js +1 -0
- package/dist/cjs/{index-Cuv6j_Y0.js → index-CBf8l7UH.js} +1 -1
- package/dist/cjs/index-DKxtLOTJ.js +5 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal-context-D80qA_jS.js +1 -0
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{prepareFundingModalData-BVlyr8l5.js → prepareFundingModalData-BhY38T4k.js} +1 -1
- package/dist/cjs/{reservoir-3I-Vkf2B.js → reservoir-DLqCfAka.js} +1 -1
- package/dist/cjs/{shared-CT5ocsPG.js → shared-LnNw37YZ.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js → shouldProceedtoEmbeddedWalletCreationFlow-D8TmPfTs.js} +1 -1
- package/dist/cjs/{smart-wallets-B7vHjGAW.js → smart-wallets-BxBo7Rwr.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{to-ui-error-a-xwbRKZ.js → to-ui-error-DQR0PH1r.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-create-wallet-without-fallback-DSOJS4h0.js → use-create-wallet-without-fallback-DVsaEUAi.js} +1 -1
- package/dist/cjs/{use-export-wallet-BRFTskbr.js → use-export-wallet-Bp3Q263k.js} +1 -1
- package/dist/cjs/{use-sign-with-user-signer-On9f1Fag.js → use-sign-with-user-signer-H6aAias8.js} +1 -1
- package/dist/cjs/{useActiveWallet-DcxqWAsq.js → useActiveWallet-rCbIz7HK.js} +1 -1
- package/dist/cjs/{useGetSolPrice-eOpcFeNE.js → useGetSolPrice-mb9rbK56.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-EcT0H5rf.js → useGetTokenPrice-BXSjabMV.js} +1 -1
- package/dist/cjs/{useI18n-hYSvbQCq.js → useI18n-DnOEBAdg.js} +1 -1
- package/dist/cjs/{usePrivy-CXPeoT5g.js → usePrivy-fmKLKsT3.js} +1 -1
- package/dist/cjs/{useSolanaRpcClient-mfV88iJm.js → useSolanaRpcClient-BSb_hq8i.js} +1 -1
- package/dist/cjs/{useWalletBalance-CQAgfkRc.js → useWalletBalance-9yRQYIAe.js} +1 -1
- package/dist/cjs/{useWallets-h2xCj02C.js → useWallets-D6t7Ii2K.js} +1 -1
- package/dist/cjs/{useWallets-TxPVNWGS.js → useWallets-dr024nCy.js} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.mts → events-context-Bt8hY3AJ.d.mts} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.ts → events-context-Bt8hY3AJ.d.ts} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +17 -10
- package/dist/dts/index.d.ts +17 -10
- package/dist/dts/internal.d.mts +1 -1
- package/dist/dts/internal.d.ts +1 -1
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +3 -3
- package/dist/dts/solana.d.ts +3 -3
- package/dist/dts/{types-BkkvIRg5.d.mts → types-Dx2VbdX1.d.mts} +52 -7
- package/dist/dts/{types-BkkvIRg5.d.ts → types-Dx2VbdX1.d.ts} +52 -7
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-DQR0FatT.mjs +1 -0
- package/dist/esm/{Address-DtXA0OPS.mjs → Address-C1iw9r70.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-BU4I5ISJ.mjs +1 -0
- package/dist/esm/{AllowlistRejectionScreen-BuH5iBJ3.mjs → AllowlistRejectionScreen-WgcCN6CH.mjs} +1 -1
- package/dist/esm/{AuthenticateWithWalletScreen-CKJqrLEm.mjs → AuthenticateWithWalletScreen-D6Zy69An.mjs} +1 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-ByIVuwRF.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-Bq0rCErj.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-itJ4854u.mjs +1 -0
- package/dist/esm/{AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs → AwaitingSolToEvmBridgingScreen-BSxfnQcf.mjs} +1 -1
- package/dist/esm/{BridgeNetworkSelectionView-Bu0vi9_a.mjs → BridgeNetworkSelectionView-DXjTVIcQ.mjs} +1 -1
- package/dist/esm/{Button-DJ-mtuuD.mjs → Button-OlK_6fKk.mjs} +1 -1
- package/dist/esm/CaptchaScreen-BBjPbV4B.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-CZpfBNiz.mjs +1 -0
- package/dist/esm/{ConnectEmailForm-DUgOCS2V.mjs → ConnectEmailForm-C2TJPUYV.mjs} +1 -1
- package/dist/esm/ConnectLedgerScreen-TCVn5s4x.mjs +1 -0
- package/dist/esm/{ConnectOnlyLandingScreen-BVkcUaO6.mjs → ConnectOnlyLandingScreen-CjVJO9uh.mjs} +1 -1
- package/dist/esm/ConnectOnlyStatusScreen-BGJ4l52n.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-CZDi1Oaj.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-CbuSfwAI.mjs → ConnectPhoneForm-kW8tUq0-.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-DVDOSzi0.mjs → ConnectWalletView-tpdAD3K7.mjs} +1 -1
- package/dist/esm/ConnectionStatusScreen-B3NfUQx_.mjs +1 -0
- package/dist/esm/CrossAppAuthScreen-CnvB1lhx.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-DWt9lv8W.mjs → CustomLandingScreenView-DZTOg8z4.mjs} +2 -2
- package/dist/esm/DelegatedActionsConsentScreen-DeBkGN9b.mjs +1 -0
- package/dist/esm/{DelegatedActionsRevokeScreen-B-xLCB1j.mjs → DelegatedActionsRevokeScreen-CTgPXrqu.mjs} +1 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-Qu9cmWzJ.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-DFciR3k8.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-DX22sVNh.mjs → EmbeddedWalletKeyExportScreen-CEo3FI_N.mjs} +2 -2
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-C7cawTmQ.mjs +1 -0
- package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs → EmbeddedWalletPasswordUpdateScreen-GdNNmtZR.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs → EmbeddedWalletPasswordUpdateSplashScreen-BNOCuoES.mjs} +1 -1
- package/dist/esm/{EnrollTotp-BzAm1Ya4.mjs → EnrollTotp-CtNw20-I.mjs} +1 -1
- package/dist/esm/ErrorScreen-NoHFWbKU.mjs +1 -0
- package/dist/esm/FarcasterConnectStatusScreen-CiN00CmD.mjs +1 -0
- package/dist/esm/{FarcasterSignerStatusScreen-DIfmv7Ft.mjs → FarcasterSignerStatusScreen-MQ2QrijY.mjs} +1 -1
- package/dist/esm/{FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs → FundSolWalletWithExternalSolanaWallet-DVaHCgDh.mjs} +1 -1
- package/dist/esm/{FundWalletMethodHeader-CbTaIDLQ.mjs → FundWalletMethodHeader-RY6-H-Ry.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-DiZ2-4XS.mjs +1 -0
- package/dist/esm/{FundingMethodSelectionScreen-fBauGI0K.mjs → FundingMethodSelectionScreen-yZenKs6o.mjs} +1 -1
- package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +1 -0
- package/dist/esm/{InAppBrowserLoginNotPossible-DBhsoAkw.mjs → InAppBrowserLoginNotPossible-CTnPeOBa.mjs} +1 -1
- package/dist/esm/{InstallWalletScreen-CEcl2LHj.mjs → InstallWalletScreen-CBxWJiQf.mjs} +1 -1
- package/dist/esm/LandingScreen-CzhCoUSE.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-Bg9QTrJX.mjs → LinkConflictScreen-BnoDRUE0.mjs} +1 -1
- package/dist/esm/LinkEmailScreen-x_TPODcx.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-CNFL2N09.mjs → LinkPasskeyScreen-D9IfHaec.mjs} +1 -1
- package/dist/esm/{LinkPhoneScreen-DnPAvact.mjs → LinkPhoneScreen-DaK-7otl.mjs} +1 -1
- package/dist/esm/{LoginFailedScreen-CkxfR75o.mjs → LoginFailedScreen-CoukYLVP.mjs} +1 -1
- package/dist/esm/ManualTransferScreen-DdumQnbt.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-BsRpCR72.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-Cr92F0yT.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-CXyaDU1D.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-ghKHn2BT.mjs +1 -0
- package/dist/esm/{ModalHeader-D7WajfD8.mjs → ModalHeader-CxHK1IKF.mjs} +1 -1
- package/dist/esm/{MoonpayStatusScreen-CBc4DLDR.mjs → MoonpayStatusScreen-DhMZLroP.mjs} +1 -1
- package/dist/esm/OAuthStatusScreen-BFVDc4G4.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-Dvxli58H.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-c9nu4s_d.mjs +1 -0
- package/dist/esm/PasswordRecoveryScreen-CsdO4G6h.mjs +1 -0
- package/dist/esm/{QrCode-zzqjquVm.mjs → QrCode-BI2LxLLg.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-Dp7fnj5t.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DdzD09T3.mjs +1 -0
- package/dist/esm/RecoverySelectionScreen-D2nDGt4R.mjs +1 -0
- package/dist/esm/{Screen-dwi2CitY.mjs → Screen-Dzz_AFFs.mjs} +1 -1
- package/dist/esm/{ScreenLayout-Dmrhdwtt.mjs → ScreenLayout-pthdsODa.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs → SetAutomaticRecoveryScreen-g1kDOe61.mjs} +1 -1
- package/dist/esm/{SetWalletPasswordForm-ZtRqoZYj.mjs → SetWalletPasswordForm-DUTEhc4R.mjs} +2 -2
- package/dist/esm/{SignRequestScreen-DdAK4SlJ.mjs → SignRequestScreen-DjLHkDxK.mjs} +1 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-CFqthHKF.mjs +1 -0
- package/dist/esm/TelegramAuthScreen-B5uYbdxP.mjs +1 -0
- package/dist/esm/{TransactionDetails-fgHkAnf9.mjs → TransactionDetails-DITlhQNk.mjs} +3 -3
- package/dist/esm/{TransactionErrorView-Dgp1KSy5.mjs → TransactionErrorView-DmFbjQHi.mjs} +2 -2
- package/dist/esm/TransferFromWalletScreen-Dvp-YNqS.mjs +1 -0
- package/dist/esm/{TransferOrBridgeLoadingScreen-D3vBwM_o.mjs → TransferOrBridgeLoadingScreen-CFRKffkj.mjs} +1 -1
- package/dist/esm/TurnstileWrapper-Co-t5mTh.mjs +1 -0
- package/dist/esm/UpdateEmailScreen-DoDVvVCw.mjs +1 -0
- package/dist/esm/{UpdatePhoneScreen-Byn7UW7u.mjs → UpdatePhoneScreen-BoEnTnCl.mjs} +1 -1
- package/dist/esm/{UserLimitReachedScreen-DXDqdBpt.mjs → UserLimitReachedScreen-68Vv3bFU.mjs} +1 -1
- package/dist/esm/WalletButtonList-C1OqZHCA.mjs +1 -0
- package/dist/esm/{WalletInfoCard-DAv0WFcc.mjs → WalletInfoCard-DmIqX_B8.mjs} +1 -1
- package/dist/esm/{WalletInterstitialScreen-CKiSWjpa.mjs → WalletInterstitialScreen-Du_L0CK7.mjs} +1 -1
- package/dist/esm/{WalletLink-CjuEskpb.mjs → WalletLink-D2x4SkPO.mjs} +2 -2
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-B4VZqX5H.mjs +1 -0
- package/dist/esm/{ethers-CpMSCMOg.mjs → ethers-oRuqwv5W.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-BMa3kyjk.mjs → frame-BMn1PaPp.mjs} +1 -1
- package/dist/esm/{get-is-unified-wallet-DymQMSJy.mjs → get-is-unified-wallet-DXko-EzF.mjs} +1 -1
- package/dist/esm/{getErc20Balance-Dtau1386.mjs → getErc20Balance-Cl5jZN3g.mjs} +1 -1
- package/dist/esm/getErc20TokenInfo-wBcf5dYY.mjs +1 -0
- package/dist/esm/{getPublicClient-IxRndou_.mjs → getPublicClient-C_l_ocJu.mjs} +1 -1
- package/dist/esm/{index-DdlRJsoj.mjs → index-BctMJtH0.mjs} +1 -1
- package/dist/esm/index-CCrVHfyv.mjs +5 -0
- package/dist/esm/index-Ce4cEnEO.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-Cvo1WmWN.mjs → internal-context-DLZicboG.mjs} +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{prepareFundingModalData-BUyu5Vhr.mjs → prepareFundingModalData-CndHQFiM.mjs} +1 -1
- package/dist/esm/{reservoir-B0V48m2I.mjs → reservoir-DRNnyqld.mjs} +1 -1
- package/dist/esm/{shared-DsP7M4P5.mjs → shared-BMOp6N9y.mjs} +1 -1
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs +1 -0
- package/dist/esm/{smart-wallets-Cbhn7qlU.mjs → smart-wallets-B3-1-dnO.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{to-ui-error-B3m2hl6e.mjs → to-ui-error-B8DSJO-0.mjs} +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/{use-create-wallet-without-fallback-DodUf3VP.mjs → use-create-wallet-without-fallback-COqi_EHH.mjs} +1 -1
- package/dist/esm/{use-export-wallet-CWslDKqf.mjs → use-export-wallet-CRKJ4-yx.mjs} +1 -1
- package/dist/esm/{use-sign-with-user-signer-LJ6ROduD.mjs → use-sign-with-user-signer-J1po7l19.mjs} +1 -1
- package/dist/esm/useActiveWallet-Bj-s666H.mjs +1 -0
- package/dist/esm/{useGetSolPrice-Bi0pPiUW.mjs → useGetSolPrice-fF6UX0Cj.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-B4XVfxeD.mjs → useGetTokenPrice-CnQZmfvQ.mjs} +1 -1
- package/dist/esm/{useI18n-ByKvnaXP.mjs → useI18n-DIAzggWr.mjs} +1 -1
- package/dist/esm/{usePrivy-D3OPY7tm.mjs → usePrivy-BSIhOAz8.mjs} +1 -1
- package/dist/esm/{useSolanaRpcClient-DjD2ma5c.mjs → useSolanaRpcClient-Be5Dd6m5.mjs} +1 -1
- package/dist/esm/{useWalletBalance-Xca4-c_r.mjs → useWalletBalance-BuMx9pCk.mjs} +1 -1
- package/dist/esm/{useWallets-CQMJYOF9.mjs → useWallets-Cc1ILfGS.mjs} +1 -1
- package/dist/esm/{useWallets-BplPx0Pz.mjs → useWallets-DuxHKVvE.mjs} +1 -1
- package/package.json +7 -6
- package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +0 -1
- package/dist/cjs/CaptchaScreen-025syTLo.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +0 -1
- package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +0 -1
- package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +0 -1
- package/dist/cjs/ErrorScreen-Cob9AO30.js +0 -1
- package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +0 -2
- package/dist/cjs/LandingScreen-B9jb8n_d.js +0 -1
- package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +0 -1
- package/dist/cjs/ManualTransferScreen-DPz98CSt.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +0 -1
- package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +0 -1
- package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +0 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +0 -1
- package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +0 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +0 -1
- package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +0 -1
- package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +0 -1
- package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +0 -1
- package/dist/cjs/WalletButtonList-bICzXZXM.js +0 -1
- package/dist/cjs/context-JUEgi5-6.js +0 -1
- package/dist/cjs/index-BNNk54gK.js +0 -1
- package/dist/cjs/index-DvDeCr_m.js +0 -5
- package/dist/cjs/internal-context-VDPFkIXN.js +0 -1
- package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +0 -1
- package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +0 -1
- package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +0 -1
- package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +0 -1
- package/dist/esm/ErrorScreen-DFAo4S7A.mjs +0 -1
- package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +0 -1
- package/dist/esm/LandingScreen-BvRIrtFN.mjs +0 -1
- package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +0 -1
- package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +0 -1
- package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +0 -1
- package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +0 -1
- package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +0 -1
- package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +0 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +0 -1
- package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +0 -1
- package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +0 -1
- package/dist/esm/WalletButtonList-CGloXTN0.mjs +0 -1
- package/dist/esm/context-Cb5MFcME.mjs +0 -1
- package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +0 -1
- package/dist/esm/index-B_e8abKi.mjs +0 -1
- package/dist/esm/index-CI666IP9.mjs +0 -5
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +0 -1
- package/dist/esm/useActiveWallet-hrZcON-K.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t=require("ofetch"),r=require("react");class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,r){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=r}}class s extends i{constructor(e,t,r,i,s,n){super(r,i,s),this.type=e,this.status=t,this.data=n}}class n extends i{constructor(e,t,r){super(e,t,r),this.type="client_error"}}const a=e=>e instanceof i?e:e instanceof Error?new n(e.message,e):new n(`Internal error: ${e}`);var o=((e={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",e.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",e.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",e.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",e.INVALID_DATA="invalid_data",e.INVALID_CAPTCHA="invalid_captcha",e.LINKED_TO_ANOTHER_USER="linked_to_another_user",e.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",e.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",e.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",e.USER_EXITED_UPDATE_FLOW="exited_update_flow",e.ALLOWLIST_REJECTED="allowlist_rejected",e.OAUTH_USER_DENIED="oauth_user_denied",e.OAUTH_UNEXPECTED="oauth_unexpected",e.UNKNOWN_AUTH_ERROR="unknown_auth_error",e.USER_EXITED_AUTH_FLOW="exited_auth_flow",e.USER_EXITED_LINK_FLOW="exited_link_flow",e.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",e.MUST_BE_AUTHENTICATED="must_be_authenticated",e.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",e.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",e.CLIENT_REQUEST_TIMEOUT="client_request_timeout",e.INVALID_CREDENTIALS="invalid_credentials",e.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",e.UNKNOWN_MFA_ERROR="unknown_mfa_error",e.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",e.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",e.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",e.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",e.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",e.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",e.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",e.TRANSACTION_FAILURE="transaction_failure",e.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",e.NOT_SUPPORTED="not_supported",e.CAPTCHA_TIMEOUT="captcha_timeout",e.INVALID_MESSAGE="invalid_message",e.UNABLE_TO_SIGN="unable_to_sign",e.CAPTCHA_FAILURE="captcha_failure",e.CAPTCHA_DISABLED="captcha_disabled",e.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",e.TOO_MANY_REQUESTS="too_many_requests",e.USER_LIMIT_REACHED="max_accounts_reached",e.DISALLOWED_LOGIN_METHOD="disallowed_login_method",e.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",e.PASSKEY_NOT_ALLOWED="passkey_not_allowed",e.USER_DOES_NOT_EXIST="user_does_not_exist",e.INSUFFICIENT_BALANCE="insufficient_balance",e.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",e.BUFFER_NOT_DEFINED="buffer_not_defined",e.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",e);const _=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},l=/*#__PURE__*/r.createContext({setAuthenticated:_,setUser:_,setIsNewUser:_,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:_,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:_,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:_,initializeWalletProxy:_,getAuthMeta:_,getAuthFlow:_,closePrivyModal:_,openPrivyModal:_,connectWallet:_,initLoginWithWallet:_,loginWithWallet:_,initLoginWithFarcaster:_,loginWithFarcaster:_,loginWithCode:_,initLoginWithEmail:_,initLoginWithSms:_,initUpdateEmail:_,initUpdatePhone:_,resendEmailCode:_,resendSmsCode:_,initLoginWithHeadlessOAuth:_,loginWithHeadlessOAuth:_,crossAppAuthFlow:_,initLoginWithOAuth:_,loginWithOAuth:_,passkeyAuthState:{status:"initial"},setPasskeyAuthState:_,initSignupWithPasskey:_,signupWithPasskey:_,initLoginWithPasskey:_,loginWithPasskey:_,initLinkWithPasskey:_,linkWithPasskey:_,refreshSessionAndUser:_,walletProxy:null,createAnalyticsEvent:_,acceptTerms:_,getUsdTokenPrice:_,getUsdPriceForSol:_,getSplTokenMetadata:_,recoverEmbeddedWallet:_,updateWallets:_,fundWallet:_,openModal:_,setReadyToTrue:_,requestFarcasterSignerStatus:_,initLoginWithTelegram:_,loginWithTelegram:_,generateSiweMessage:_,generateSiweMessageForSmartWallet:_,loginWithSiwe:_,linkWithSiwe:_,linkSmartWallet:_,delegateWallet:_,revokeDelegatedWallets:_,connectCoinbaseSmartWallet:_,connectBaseAccount:_,initiateAccountTransfer:_,emailOtpState:{status:"initial"},setEmailOtpState:_,smsOtpState:{status:"initial"},setSmsOtpState:_,siweState:{status:"initial"},setSiweState:_,oAuthState:{status:"initial"},setOAuthState:_,telegramAuthState:{status:"initial"},setTelegramAuthState:_,isHeadlessOAuthLoading:!1,isHeadlessSigning:_,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:_});exports.InternalPrivyContext=l,exports.PrivyApiError=s,exports.PrivyClientError=n,exports.PrivyConnectorError=class extends i{constructor(e,t,r){super(e,t,r),this.type="connector_error"}},exports.PrivyEmbeddedWalletError=class extends n{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}},exports.PrivyError=i,exports.PrivyErrorCode=o,exports.PrivyNotReadyError=class extends n{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},exports.PrivyTimeoutError=class extends n{constructor(){super("Request timed out",void 0,"client_request_timeout")}},exports.PrivyUnauthenticatedError=class extends n{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},exports.PrivyUserLimitReachedError=class extends n{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}},exports.formatApiError=e=>{if(e instanceof i)return e;if(!(e instanceof t.FetchError))return a(e);if(!e.response)return new s("api_error",null,e.message,e);let{type:r,message:n,error:o,code:_}=e.data;return new s(r||"ApiError",e.response.status,n||o,e,_,e.data)},exports.formatPrivyError=a,exports.notImplemented=_,exports.notImplementedWithMessage=e=>()=>{throw Error(e.trim())},exports.usePrivyInternal=()=>r.useContext(l);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{HelpCircle as o}from"lucide-react";import{u as e}from"./context-Cb5MFcME.mjs";import{u as i}from"./internal-context-Cvo1WmWN.mjs";import{a as r}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as n}from"./ScreenLayout-Dmrhdwtt.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const a=({title:e="Account not found",subtitle:i,appName:r="this app",ctaText:a="Try logging in again",onRetry:m})=>/*#__PURE__*/t(n,{title:e,subtitle:i||`Please try logging in again or go to ${r} to create an account.`,icon:o,iconVariant:"warning",primaryCta:{label:a,onClick:m},watermark:!0}),m={component:()=>{let{navigate:o,setModalData:n,data:m}=r(),c=e(),{getAuthMeta:p,client:s}=i();/*#__PURE__*/return t(a,{appName:c?.name,onRetry:()=>{let t=p();n({...m,login:{...m?.login,...t?.disableSignup?{disableSignup:!0}:{}}}),s?.authFlow&&(s.authFlow=void 0),o("LandingScreen")}})}};export{m as AccountNotFoundScreen,a as AccountNotFoundScreenView,m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{FileCheck as r,ExternalLink as i}from"lucide-react";import"react";import{styled as o}from"styled-components";import{B as a}from"./Button-DJ-mtuuD.mjs";import{u as n}from"./context-Cb5MFcME.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{u as m,a as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as c}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as p}from"./ScreenLayout-Dmrhdwtt.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"tinycolor2";import"ofetch";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const d={component:()=>{let{user:t,logout:r}=m(),{onUserCloseViaDialogOrKeybindRef:i,setModalData:o,navigate:a}=l(),p=n(),{acceptTerms:d,closePrivyModal:y,createAnalyticsEvent:v}=s(),h=e=>{e?.preventDefault(),y({shouldCallAuthOnSuccess:!1}),r()};i.current=h;/*#__PURE__*/return e(u,{termsAndConditionsUrl:p?.legal.termsAndConditionsUrl,privacyPolicyUrl:p?.legal.privacyPolicyUrl,onAccept:async e=>{e?.preventDefault(),await d(),t&&c(t,p.embeddedWallets)?(o({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),a("EmbeddedWalletOnAccountCreateScreen")):y()},onDecline:h})}},u=({termsAndConditionsUrl:o,privacyPolicyUrl:n,onAccept:s,onDecline:m,title:l="One last step",subtitle:c="By signing up, you agree to our terms and privacy policy."})=>/*#__PURE__*/e(p,{title:l,subtitle:c,icon:r,primaryCta:{label:"Accept",onClick:s},secondaryCta:{label:"No thanks",onClick:m},watermark:!0,children:(o||n)&&/*#__PURE__*/t(y,{children:[o&&/*#__PURE__*/t(a,{variant:"muted",href:o,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Terms",/*#__PURE__*/e(i,{width:16,height:16,strokeWidth:2.25})]}),n&&/*#__PURE__*/t(a,{variant:"muted",href:n,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Privacy Policy",/*#__PURE__*/e(i,{width:16,height:16,strokeWidth:2.25})]})]})});let y=/*#__PURE__*/o.div.withConfig({displayName:"LinksContainer",componentId:"sc-d5115275-0"})(["display:flex;flex-direction:column;gap:12px;margin-top:var(--screen-space);"]);export{d as AffirmativeConsentScreen,u as AffirmativeConsentScreenView,d as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as a}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as r,useEffect as n}from"react";import{createWalletClient as o,custom as s,publicActions as d,createPublicClient as c,http as m,formatUnits as l}from"viem";import{addToDefaultChains as u}from"@privy-io/js-sdk-core";import{b as p,c as h,R as g}from"./Layouts-Bmf8DxNP.mjs";import{B as f}from"./ModalHeader-D7WajfD8.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{t as j}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{N as I}from"./index-CJMgUOnw.mjs";import{u as w,t as y}from"./context-Cb5MFcME.mjs";import{u as T,a as C,b}from"./internal-context-Cvo1WmWN.mjs";import{Q as S,D as N}from"./useActiveWallet-hrZcON-K.mjs";import{a as x}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as A}from"./useGetTokenPrice-B4XVfxeD.mjs";import{u as E}from"./useWallets-BplPx0Pz.mjs";import{O as k}from"./analytics-mkkvFRju.mjs";import{g as F,t as B,a as U,b as L,c as P,u as M}from"./reservoir-B0V48m2I.mjs";import{z as W}from"./index-CI666IP9.mjs";import{g as H}from"./getChainName-DjpPdUSc.mjs";import{g as O,a as D}from"./transaction-CnfuREWo.mjs";import{g as R,B as q}from"./BridgeNetworkSelectionView-Bu0vi9_a.mjs";import{a as $}from"./getPublicClient-IxRndou_.mjs";import{T as _}from"./TransferOrBridgeLoadingScreen-D3vBwM_o.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"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useGetSolPrice-Bi0pPiUW.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./getErc20Balance-Dtau1386.mjs";import"./Button-DJ-mtuuD.mjs";import"./Row-CG0lSY5Z.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./Value-B4M62ove.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Chip-Bsgj4Yc-.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"./formatErc20TokenAmount-BuPk9xcy.mjs";import"./ethers-CpMSCMOg.mjs";import"./styles-DY17fuAX.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"./Address-DtXA0OPS.mjs";import"lucide-react";const Q={component:()=>{let Q=w(),{rpcConfig:V,appId:G,closePrivyModal:z,createAnalyticsEvent:K}=T(),{navigate:X,setModalData:Y,data:Z}=x(),J=w(),{wallets:ee}=E(),[te,ae]=r(null),[ie,re]=r(null),[ne,oe]=r([]),[se,de]=r(0),[ce,me]=r(!1),[le,ue]=r(!1),[pe,he]=r(!1),[ge,fe]=r(!1),[ve,je]=r(),[Ie,we]=r();if(!Z?.funding||"solana"!==Z.funding.chainType)throw Error("Invalid funding data");let{address:ye,chain:Te,connectedWallet:Ce}=Z.funding,[be,Se]=r(Z.funding.amount),Ne=("ethereum"===Ce?.type?Ce:void 0)??ee[0],xe=S(Ne?.walletClientType||"unknown"),Ae=xe?.name||"wallet",[Ee,ke]=r(null);n((()=>{(async()=>{if(!Ne)return;let e=await Ne.getEthereumProvider();ke(o({account:Ne.address,transport:s(e)}).extend(d))})().catch(console.error)}),[Ne]);let[Fe,Be]=r(0n),Ue=O(Fe);n((()=>{let e=Q.solanaRpcs[Te];e?W({rpc:e.rpc,address:ye}).then((e=>Be(BigInt(e)))).catch(console.error):console.warn("Unable to load solana rpc, skipping balance")}),[]);let[Le,Pe]=r(),{tokenPrice:Me}=A("solana"),{fundingAmountInBaseUnit:We,fundingAmountInUsd:He}=D({amount:be,fee:0n,tokenPrice:Me,isUsdc:Z.funding.isUSDC});if(n((()=>{(async()=>{if(!Ee||!Ne)return;let e=["solana:testnet","solana:devnet"].includes(Te);e&&console.warn("Solana testnets are not supported for bridging");let t=u(J.chains).filter((({testnet:t})=>!!t===e)),a=(await R({chains:t,address:Ne.address,appId:G,rpcConfig:V})).filter((e=>e.balance>0n));if(a.length<1)return void ae(new C(`Wallet ${N(Ne.address)} does not have enough funds.`,void 0,b.INSUFFICIENT_BALANCE));a.sort(((e,t)=>Number(t.balance-e.balance)));let i=(await Promise.allSettled(a.map((async e=>({...e,quote:await F({isTestnet:!1,input:B({appId:G,amount:We.toString(),user:Ne.address,recipient:ye,destinationChainId:L,destinationCurrency:U,originChainId:e.chain.id})})}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(i.length<1)return void ae(new C(`Unable to fetch quotes for bridging. Wallet ${N(Ne.address)} does not have enough funds.`,void 0,b.INSUFFICIENT_BALANCE));let r=i.map((({quote:e,balance:t,chain:a})=>({bridgeTx:P(e),balance:t,chain:a,isErc20Quote:!1}))).filter((({bridgeTx:e})=>!!e));if(r.length>1)return void oe(r);let n=r.at(0);n?(ue(!0),Pe({data:n.bridgeTx.data,to:n.bridgeTx.to,value:n.bridgeTx.value,chain:n.chain})):ae(new C(`Unable to select bridge option from quotes. Wallet ${N(Ne.address)} does not have enough funds.`,void 0,b.INSUFFICIENT_BALANCE))})().catch(console.error)}),[Ee]),n((()=>{(async()=>{let e,t;if(!Ee||!Ne||ce||pe||!Le)return;me(!0);let a=c({chain:Le.chain,transport:m($(Le.chain,V,G))});try{e=await a.prepareTransactionRequest({account:Ne.address,to:Le.to,chain:Le.chain,data:Le.data,value:BigInt(Le.value??0)})}catch(e){console.error(e),ne.length>1&&re(e.shortMessage??"Something went wrong")}if(e){me(!1),he(!0);try{await Ee.switchChain({id:Le.chain.id})}catch(e){await Ee.addChain({chain:Le.chain}),await Ee.switchChain({id:Le.chain.id})}try{t=await Ee.sendTransaction(e)}catch(e){console.error(e),"TransactionExecutionError"===e.name&&(ne.length<1?ae(new C(e.shortMessage,void 0,b.TRANSACTION_FAILURE)):re(e.shortMessage??"Something went wrong"))}if(t)return await Ee.waitForTransactionReceipt({hash:t}),le?(we("pending"),void je(t)):(he(!1),fe(!0),void K({eventName:k,payload:{provider:"external",status:"success",txHash:t,address:Ne.address,chainId:Le.chain.id,chainType:"ethereum",value:Le.value?l(BigInt(Le.value),18):void 0,token:"ETH",destination:ye,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:l(We,9),destinationToken:"SOL"}}));he(!1)}else me(!1)})().catch(console.error)}),[Ee,Le]),M({transactionHash:ve,isTestnet:!1,bridgingStatus:Ie,setBridgingStatus:we,onSuccess({transactionHash:e}){ue(!1),fe(!0),K({eventName:k,payload:{provider:"external",status:"success",txHash:e,address:Ne?.address,chainId:Le?.chain.id,chainType:"ethereum",value:Le?.value?l(BigInt(Le.value),18):void 0,token:"ETH",destination:ye,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:l(We,9),destinationToken:"SOL"}})},onFailure({error:e}){ue(!1),ae(e)}}),n((()=>{te&&(Y({funding:Z?.funding,solanaFundingData:Z?.solanaFundingData,sendTransaction:Z?.sendTransaction,errorModalData:{error:te,previousScreen:"TransferFromWalletScreen"}}),X("ErrorScreen",!1))}),[te]),n((()=>{if(!ge)return;let e=setTimeout(z,y);return()=>clearTimeout(e)}),[ge]),ge/*#__PURE__*/)return e(t,{children:[/*#__PURE__*/a(j,{}),/*#__PURE__*/a(p,{}),/*#__PURE__*/e(h,{children:[/*#__PURE__*/a(i,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/a(v,{title:"Success!",description:`You’ve successfully added ${be} SOL to your ${J.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/a(g,{}),/*#__PURE__*/a(f,{})]});let Oe=ne[se];return ne.length>1&&Oe?/*#__PURE__*/a(q,{displayName:Ae,configuredFundingChain:Te,formattedBalance:Ue,fundingAmount:be,fundingCurrency:"SOL",fundingAmountInUsd:He,options:ne,selectedOption:Oe,isPreparing:ce,isSubmitting:pe,addressToFund:ye,fundingWalletAddress:Ne?.address||"",errorMessage:ie,onSubmit:()=>{Z.funding?.amount!==be?async function(){if(Ne&&Oe)try{let e=await F({isTestnet:!1,input:B({appId:G,amount:We.toString(),user:Ne.address,recipient:ye,destinationChainId:L,destinationCurrency:U,originChainId:Oe.chain.id})}),t=P(e);if(!t)throw Error("Invalid transaction request");ue(!0),Pe({data:t.data,to:t.to,value:t.value,chain:Oe.chain})}catch(e){console.error(e),ae(new C("Unable to fetch quotes for bridging",e,b.INSUFFICIENT_BALANCE))}}().catch(console.error):Pe({to:Oe.bridgeTx.to,data:Oe.bridgeTx.data,value:Oe.bridgeTx.value,chain:Oe.chain})},onSelect:e=>{e!==se&&(re(null),de(e))},onAmountChange:Se}):pe&&Ne?/*#__PURE__*/a(_,{walletClientType:Ne?.walletClientType||"unknown",displayName:Ae,addressToFund:ye,isBridging:le,isErc20Flow:!1,chainId:"solana",chainName:H(Te),totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
|
|
2
|
-
/*#__PURE__*/e(t,{children:[/*#__PURE__*/a(j,{}),/*#__PURE__*/a(I,{}),/*#__PURE__*/a("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/a(f,{})]})}};export{Q as AwaitingEvmToSolBridgingScreen,Q as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as r,useEffect as i}from"react";import{parseEther as o,createWalletClient as s,custom as d,publicActions as c,createPublicClient as l,http as m,encodeFunctionData as u,formatUnits as h}from"viem";import{addToDefaultChains as p}from"@privy-io/js-sdk-core";import{b as f,c as g,R as v}from"./Layouts-Bmf8DxNP.mjs";import{B as y}from"./ModalHeader-D7WajfD8.mjs";import{C}from"./ScreenHeader-Biz1wq02.mjs";import{t as I}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{N as T}from"./index-CJMgUOnw.mjs";import{u as w,t as b}from"./context-Cb5MFcME.mjs";import{u as j,a as E,b as A}from"./internal-context-Cvo1WmWN.mjs";import{Q as N,D as S}from"./useActiveWallet-hrZcON-K.mjs";import{a as x}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as B}from"./useGetTokenPrice-B4XVfxeD.mjs";import{u as F}from"./useWallets-BplPx0Pz.mjs";import{E as k}from"./transfer-CMPmjPsM.mjs";import{f as M}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{c as U,a as W,g as H,s as P}from"./ethers-CpMSCMOg.mjs";import{O as L}from"./analytics-mkkvFRju.mjs";import{t as $,g as q,c as D,u as Q}from"./reservoir-B0V48m2I.mjs";import{g as R,B as _}from"./BridgeNetworkSelectionView-Bu0vi9_a.mjs";import{g as O}from"./getErc20Balance-Dtau1386.mjs";import{a as V}from"./getPublicClient-IxRndou_.mjs";import{T as G}from"./TransferOrBridgeLoadingScreen-D3vBwM_o.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"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useGetSolPrice-Bi0pPiUW.mjs";import"./Button-DJ-mtuuD.mjs";import"./Row-CG0lSY5Z.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./Value-B4M62ove.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./getChainName-DjpPdUSc.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"./shared-CtYf3O54.mjs";import"@headlessui/react";import"@heroicons/react/24/outline/ChevronDownIcon";import"./styles-DY17fuAX.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"./Address-DtXA0OPS.mjs";import"lucide-react";const z={component:()=>{let{rpcConfig:z,appId:K,closePrivyModal:X,createAnalyticsEvent:Y}=j(),{navigate:Z,setModalData:J,data:ee}=x(),te=w(),{wallets:ae}=F(),[ne,re]=r(!1),[ie,oe]=r(0n),[se,de]=r(!1),[ce,le]=r(null),[me,ue]=r(null),[he,pe]=r([]),[fe,ge]=r(0),[ve,ye]=r(!1),[Ce,Ie]=r(!1),[Te,we]=r(!1),[be,je]=r(!1),[Ee,Ae]=r(),[Ne,Se]=r();if(!ee?.funding||"ethereum"!==ee.funding.chainType)throw Error("Invalid funding data");let{erc20ContractInfo:xe,chain:Be,connectedWallet:Fe}=ee.funding,ke=ee.funding.address,Me=ee.funding.erc20Address,[Ue,We]=r(ee.funding.amount);i((()=>{Me&&!xe&&le(Error("Unable to fetch token details"))}),[]);let He=!!Me&&!!xe,Pe=He?BigInt(parseFloat(Ue)*10**xe.decimals):o(Ue),Le=("ethereum"===Fe?.type?Fe:void 0)??ae[0],$e=N(Le?.walletClientType||"unknown"),qe=$e?.name||"wallet",[De,Qe]=r(null);i((()=>{(async()=>{if(!Le)return;let e=await Le.getEthereumProvider();Qe(s({account:Le.address,transport:d(e)}).extend(c))})().catch(console.error)}),[Le]);let[Re,_e]=r(0n);i((()=>{l({chain:Be,transport:m(V(Be,z,K))}).getBalance({address:ke}).then(_e).catch(console.error)}),[]);let[Oe,Ve]=r(0n);i((()=>{He&&O({chain:Be,address:ke,appId:K,rpcConfig:z,erc20Address:Me}).then((e=>Ve(e.balance))).catch(console.error)}),[]);let{tokenPrice:Ge}=B(Be.id),[ze,Ke]=r({to:ke,chain:Be,value:Pe,data:void 0});i((()=>{(async()=>{let e,t;if(!De||!Le||ve||Te)return;ye(!0);let a=l({chain:ze.chain,transport:m(V(ze.chain,z,K))});if(He&&!ze.data)return await a.simulateContract({address:Me,chain:ze.chain,abi:k,functionName:"transfer",args:[ke,Pe],account:Le.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(ye(!1),void Ke({to:Me,chain:ze.chain,data:u({abi:k,functionName:"transfer",args:[ke,Pe]}),value:"0x0"})):(ye(!1),void de(!0));try{e=await a.prepareTransactionRequest({account:Le.address,to:ze.to,chain:ze.chain,data:ze.data,value:BigInt(ze.value??0)})}catch(e){if(console.error(e),he.length>1)ue(e.shortMessage??"Something went wrong");else if(Ce&&0===he.length)return void le(new E(`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE))}if(!e)return ye(!1),void de(!0);ye(!1),we(!0),re(!0),oe(e.gas);try{await De.switchChain({id:ze.chain.id})}catch(e){await De.addChain({chain:ze.chain}),await De.switchChain({id:ze.chain.id})}try{t=await De.sendTransaction(e)}catch(e){if(console.error(e),"TransactionExecutionError"===e.name)if(he.length<1){let t=e.shortMessage;(e.shortMessage.includes("rejected the request")||e.details.includes("rejected the request"))&&(t="User rejected the request."),le(new E(t,void 0,A.TRANSACTION_FAILURE))}else ue(e.shortMessage??"Something went wrong")}if(t)return await De.waitForTransactionReceipt({hash:t}),we(!1),Ce?(Ae(t),void Se("pending")):(je(!0),void Y({eventName:L,payload:{provider:"external",status:"success",txHash:t,address:Le.address,chainId:ze.chain.id,chainType:"ethereum",value:ze.value?h(BigInt(ze.value),xe?.decimals??18):void 0,token:xe?.symbol??Me??"ETH",destinationAddress:ke,destinationChainId:Be.id,destinationChainType:"ethereum",destinationValue:Pe?h(Pe,xe?.decimals??18):void 0,destinationToken:xe?.symbol??Me??Be.nativeCurrency.name}}));we(!1)})().catch(console.error)}),[De,ze]),i((()=>{(async()=>{if(!se||!De||!Le)return;let e=p(te.chains).filter((e=>e.id!==Be.id&&!!e.testnet==!!Be.testnet));He&&e.unshift(Be);let t=await R({chains:e,address:Le.address,appId:K,rpcConfig:z,includeUsdc:ee.funding?.isUSDC}),a=He?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>Pe)),n=He&&t.every((e=>0n===e.balance));if(a.length<1)return void le(new E(n?`Wallet ${S(Le.address)} doesn't have enough funds to cover gas fees. Top up your wallet and try again.`:`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE));a.sort(((e,t)=>Number(He?(t.erc20Balance??0n)-(e.erc20Balance??0n):t.balance-e.balance)));let r=a.flatMap((e=>{let t=[{...e,isErc20Quote:!1,isTestnet:!!Be.testnet,input:$({appId:K,amount:Pe.toString(),user:Le.address,recipient:ke,destinationChainId:Be.id,destinationCurrency:Me,originChainId:e.chain.id})}];return He&&Me&&(e.erc20Balance??0n)>=Pe&&t.push({...e,isErc20Quote:!0,isTestnet:!!Be.testnet,input:$({appId:K,amount:Pe.toString(),user:Le.address,recipient:ke,destinationChainId:Be.id,destinationCurrency:Me,originChainId:e.chain.id,originCurrency:e.erc20Address})}),t})),i=(await Promise.allSettled(r.map((async e=>({...e,quote:await q(e)}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(i.length<1)return void le(new E(`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE));let o=i.map((e=>({bridgeTx:D(e.quote),balance:e.balance,chain:e.chain,erc20Balance:e.erc20Balance,isErc20Quote:e.isErc20Quote}))).filter((e=>!!e.bridgeTx));if(o.length>1)return void pe(o);let s=o[0];s?(Ie(!0),Ke({data:s.bridgeTx.data,to:s.bridgeTx.to,value:s.bridgeTx.value,chain:s.chain})):le(new E(`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE))})().catch(console.error)}),[se]),Q({transactionHash:Ee,isTestnet:!!Be.testnet,bridgingStatus:Ne,setBridgingStatus:Se,onSuccess({transactionHash:e}){Ie(!1),je(!0),Y({eventName:L,payload:{provider:"external",status:"success",txHash:e,address:Le?.address,chainId:ze.chain.id,chainType:"ethereum",value:ze.value?h(BigInt(ze.value),xe?.decimals??18):void 0,token:xe?.symbol??Me??"ETH",destinationAddress:ke,destinationChainId:Be.id,destinationChainType:"ethereum",destinationValue:Pe?h(Pe,xe?.decimals??18):void 0,destinationToken:xe?.symbol??Me??Be.nativeCurrency.name}})},onFailure({error:e}){Ie(!1),le(e)}}),i((()=>{ce&&(J({funding:ee?.funding,solanaFundingData:ee?.solanaFundingData,sendTransaction:ee?.sendTransaction,errorModalData:{error:ce,previousScreen:"TransferFromWalletScreen"}}),Z("ErrorScreen",!1))}),[ce]);let Xe=!He&&Ge?U(Ue??"0",Ge):void 0,Ye=He?ie:P([ie,Pe]),Ze=Ye&&Ge?W(Ye,Ge):void 0,Je=Ye?H(Ye,ee?.funding?.erc20Address?ee?.funding?.erc20ContractInfo?.symbol||"ETH":ee?.funding?.chain.nativeCurrency.symbol||"ETH"):void 0,et=ie&&Ge?W(ie,Ge):void 0,tt=ie?H(ie,Be?.nativeCurrency?.symbol||"ETH"):void 0;if(i((()=>{if(!be)return;let e=setTimeout(X,b);return()=>clearTimeout(e)}),[be]),be/*#__PURE__*/)return e(t,{children:[/*#__PURE__*/a(I,{}),/*#__PURE__*/a(f,{}),/*#__PURE__*/e(g,{children:[/*#__PURE__*/a(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/a(C,{title:"Success!",description:`You’ve successfully added ${Ue} ${He?xe.symbol:Be.nativeCurrency.symbol} to your ${te.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/a(v,{}),/*#__PURE__*/a(y,{})]});let at=He?`${M({amount:Oe,decimals:xe.decimals})} ${xe.symbol}`:H(Re,Be.nativeCurrency.symbol,3,!0),nt=he[fe];return he.length>1&&nt?/*#__PURE__*/a(_,{displayName:qe,configuredFundingChain:Be,erc20ContractInfo:xe,formattedBalance:at,fundingAmount:Ue,fundingCurrency:He?xe.symbol:Be.nativeCurrency.symbol,fundingAmountInUsd:Xe,options:he,selectedOption:nt,isPreparing:ve,isSubmitting:Te,addressToFund:ke,fundingWalletAddress:Le?.address||"",errorMessage:me,onSubmit:()=>{ee.funding?.amount!==Ue?async function(){if(Le&&nt)try{let e=await q({isTestnet:!!Be.testnet,input:$({appId:K,amount:Pe.toString(),user:Le.address,recipient:ke,destinationChainId:Be.id,destinationCurrency:Me,originChainId:nt.chain.id})}),t=D(e);if(!t)throw Error("Invalid transaction request");Ie(!0),Ke({data:t.data,to:t.to,value:t.value,chain:nt.chain})}catch(e){console.error(e),le(new E("Unable to fetch quotes for bridging",e,A.INSUFFICIENT_BALANCE))}}().catch(console.error):Ke({to:nt.bridgeTx.to,data:nt.bridgeTx.data,value:nt.bridgeTx.value,chain:nt.chain})},onSelect:e=>{e!==fe&&(ue(null),ge(e))},onAmountChange:We}):ne&&ie&&Le&&ee?.funding?/*#__PURE__*/a(G,{walletClientType:Le?.walletClientType||"unknown",displayName:qe,addressToFund:ke,isBridging:Ce,isErc20Flow:He,totalPriceInUsd:Ze,totalPriceInNativeCurrency:Je,gasPriceInUsd:et,gasPriceInNativeCurrency:tt,chainId:Be.id,chainName:Be.name}):
|
|
2
|
-
/*#__PURE__*/e(t,{children:[/*#__PURE__*/a(I,{}),/*#__PURE__*/a(T,{}),/*#__PURE__*/a("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/a(y,{})]})}};export{z as AwaitingExternalEthereumTransferScreen,z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"@heroicons/react/20/solid/CheckIcon";import t from"@heroicons/react/24/outline/EnvelopeIcon";import i from"@heroicons/react/24/outline/PhoneIcon";import{useState as n,useEffect as a}from"react";import{isMobile as s}from"react-device-detect";import{styled as c}from"styled-components";import{H as l}from"./Layouts-Bmf8DxNP.mjs";import{L as d}from"./Link-DwjLfHwW.mjs";import{u as p,q as m}from"./context-Cb5MFcME.mjs";import{u,d as f,b as v,i as h}from"./internal-context-Cvo1WmWN.mjs";import{a as y,u as g}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as b}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as x}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const C=({contactMethod:c,authFlow:p,appName:m="Privy",whatsAppEnabled:u=!1,onBack:f,onCodeSubmit:v,onResend:h,errorMessage:y,success:g=!1,resendCountdown:b=0,onInvalidInput:C,onClearError:S})=>{let[A,I]=n(w);a((()=>{y||I(w)}),[y]);let N=async e=>{e.preventDefault();let r=e.currentTarget.value.replace(" ","");if(""===r)return;if(isNaN(Number(r)))return void C?.("Code should be numeric");S?.();let o=Number(e.currentTarget.name?.charAt(5)),t=[...r||[""]].slice(0,E-o),i=[...A.slice(0,o),...t,...A.slice(o+t.length)];I(i);let n=Math.min(Math.max(o+t.length,0),E-1);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${n}]`);e?.focus()}if(i.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${n}]`);e?.blur(),await(v?.(i.join("")))}};/*#__PURE__*/return e(x,{title:"Enter confirmation code",subtitle:/*#__PURE__*/r("span","email"===p?{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for an email from privy.io and enter your code below."]}:{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for a",u?" WhatsApp":""," message from ",m," and enter your code below."]}),icon:"email"===p?t:i,onBack:f,showBack:!0,helpText:/*#__PURE__*/r(L,{children:[/*#__PURE__*/r("span",{children:["Didn't get ","email"===p?"an email":"a message","?"]}),b?/*#__PURE__*/r(R,{children:[/*#__PURE__*/e(o,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),/*#__PURE__*/e("span",{children:"Code sent"})]}):/*#__PURE__*/e(d,{as:"button",size:"sm",onClick:h,children:"Resend code"})]}),children:/*#__PURE__*/e(k,{children:/*#__PURE__*/e(l,{children:/*#__PURE__*/r(_,{children:[/*#__PURE__*/e("div",{children:A.map(((r,o)=>/*#__PURE__*/e("input",{name:`code-${o}`,type:"text",value:A[o],onChange:N,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(S?.(),I([...A.slice(0,e),"",...A.slice(e+1)]),e>0){let r=document.querySelector(`input[name=code-${e-1}]`);r?.focus()}})(o)},inputMode:"numeric",autoFocus:0===o,pattern:"[0-9]",className:`${g?"success":""} ${y?"fail":""}`,autoComplete:s?"one-time-code":"off"},o)))}),/*#__PURE__*/e(j,{$fail:!!y,$success:g,children:/*#__PURE__*/e("span",{children:"Invalid or expired verification code"===y?"Incorrect code":y||(g?"Success!":"")})})]})})})})};let E=6,w=Array(6).fill("");var S,A,I=((S=I||{})[S.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",S[S.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",S),N=((A=N||{})[A.EMAIL=0]="EMAIL",A[A.SMS=1]="SMS",A);const T={component:()=>{let{navigate:r,lastScreen:o,navigateBack:t,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=y(),c=p(),{closePrivyModal:l,resendEmailCode:d,resendSmsCode:x,getAuthMeta:E,loginWithCode:w,updateWallets:S,createAnalyticsEvent:A}=u(),{authenticated:I,logout:N,user:T}=g(),{whatsAppEnabled:k}=p(),[_,j]=n(!1),[L,R]=n(null),[M,D]=n(null),[O,P]=n(0);s.current=()=>null;let W=E()?.email?0:1,U=0===W?E()?.email||"":E()?.phoneNumber||"",F=m-500;a((()=>{if(O){let e=setTimeout((()=>{P(O-1)}),1e3);return()=>clearTimeout(e)}}),[O]),a((()=>{if(I&&_&&T){if(c?.legal.requireUsersAcceptTerms&&!T.hasAcceptedTerms){let e=setTimeout((()=>{r("AffirmativeConsentScreen")}),F);return()=>clearTimeout(e)}if(b(T,c.embeddedWallets)){let e=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),N()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),F);return()=>clearTimeout(e)}{S();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),m);return()=>clearTimeout(e)}}}),[I,_,T]),a((()=>{if(L&&0===M){let e=setTimeout((()=>{R(null),D(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[L,M]);/*#__PURE__*/return e(C,{contactMethod:U,authFlow:0===W?"email":"sms",appName:c?.name,whatsAppEnabled:k,onBack:()=>t(),onCodeSubmit:async e=>{try{await w(e),j(!0)}catch(e){if(e instanceof f&&e.privyErrorCode===v.INVALID_CREDENTIALS)R("Invalid or expired verification code"),D(0);else if(e instanceof f&&e.privyErrorCode===v.CANNOT_LINK_MORE_OF_TYPE)R(e.message);else{if(e instanceof f&&e.privyErrorCode===v.USER_LIMIT_REACHED)return console.error(new h(e).toString()),void r("UserLimitReachedScreen");if(e instanceof f&&e.privyErrorCode===v.USER_DOES_NOT_EXIST)return void r("AccountNotFoundScreen");if(e instanceof f&&e.privyErrorCode===v.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:e,previousScreen:o??"AwaitingPasswordlessCodeScreen"}}),void r("ErrorScreen",!1);if(e instanceof f&&e.privyErrorCode===v.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:e}}),void r("ConnectOrCreateScreen",!1);if(e instanceof f&&e.privyErrorCode===v.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return i({accountTransfer:{nonce:e.data?.data?.nonce,account:U,displayName:e.data?.data?.account?.displayName,linkMethod:0===W?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void r("LinkConflictScreen");R("Issue verifying code"),D(0)}}},onResend:async()=>{P(30),0===W?await d():await x()},errorMessage:L||void 0,success:_,resendCountdown:O,onInvalidInput:e=>{R(e),D(1)},onClearError:()=>{1===M&&(R(null),D(null))}})}};let k=/*#__PURE__*/c.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-6187bfee-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:auto;gap:16px;flex-grow:1;width:100%;"]),_=/*#__PURE__*/c.div.withConfig({displayName:"CodeInput",componentId:"sc-6187bfee-1"})(["display:flex;flex-direction:column;width:100%;gap:12px;> div:first-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-sm);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-sm);padding:8px 10px;height:48px;width:40px;text-align:center;font-size:18px;font-weight:600;color:var(--privy-color-foreground);transition:all 0.2s ease;}> input:focus{border:1px solid var(--privy-color-foreground);box-shadow:0 0 0 1px var(--privy-color-foreground);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-border-success);background:var(--privy-color-success-bg);}> input.fail{border:1px solid var(--privy-color-border-error);background:var(--privy-color-error-bg);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),j=/*#__PURE__*/c.div.withConfig({displayName:"InputHelp",componentId:"sc-6187bfee-2"})(["line-height:20px;min-height:20px;font-size:14px;font-weight:400;color:",";display:flex;justify-content:center;width:100%;text-align:center;"],(e=>e.$success?"var(--privy-color-success-dark)":e.$fail?"var(--privy-color-error-dark)":"transparent")),L=/*#__PURE__*/c.div.withConfig({displayName:"HelpTextContainer",componentId:"sc-6187bfee-3"})(["display:flex;gap:8px;align-items:center;justify-content:center;width:100%;color:var(--privy-color-foreground-2);"]),R=/*#__PURE__*/c.div.withConfig({displayName:"Badge",componentId:"sc-6187bfee-4"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),M=/*#__PURE__*/c.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-6187bfee-5"})(["font-weight:500;word-break:break-all;color:var(--privy-color-foreground);"]);export{T as AwaitingPasswordlessCodeScreen,C as AwaitingPasswordlessCodeScreenView,T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as a,useEffect as s}from"react";import{a as n,C as c}from"./index-CI666IP9.mjs";import{a as m}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as u}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const p=({status:o,title:a,description:s,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),g=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:g,title:a,subtitle:s,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:g,reset:y,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[f,C]=a(!0);s((()=>(j(setTimeout(C,1e3,!1)),()=>{v.current.forEach((e=>clearTimeout(e))),v.current=[]})),[]);let[b,k]=a(""),[w,R]=a("Checking that you are a human..."),[S,I]=a(!1),[T,x]=a(3),A=r?.captchaModalData,M=async e=>{try{await(A?.callback(e)),A?.onSuccessNavigateTo&&i(A?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(A?.onErrorNavigateTo||"ErrorScreen",!1)}};s((()=>{"success"===l?j(setTimeout((async()=>{let e=await g();!e||A?.userIntentRequired||M(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),s((()=>{if(!f)switch(l){case"success":k("Success!"),R("CAPTCHA passed successfully."),A?.userIntentRequired||setTimeout((()=>{I(!0),M(d)}),2e3);break;case"loading":k(""),R("Checking that you are a human...");break;case"error":k("Something went wrong"),R(T<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,f,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:w,userIntentRequired:A?.userIntentRequired,retriesRemaining:T,hasSelectedCta:S,onContinue:()=>{I(!0),M(d)},onRetry:async()=>{if(T<=0)return;x((e=>e-1)),y(),h();let e=await g();!e||A?.userIntentRequired||M(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{P as l}from"./Button-DJ-mtuuD.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{L as p,a7 as u}from"./useActiveWallet-hrZcON-K.mjs";import{M as f,B as g}from"./ModalHeader-D7WajfD8.mjs";import{u as h}from"./internal-context-Cvo1WmWN.mjs";import{a as v}from"./get-is-unified-wallet-DymQMSJy.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{F as b}from"./index-CI666IP9.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.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"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:l,createAnalyticsEvent:d,client:p}=h(),[u,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:I}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===u||"pending-after-flow"===u){let e=setInterval((async()=>{if(k)try{let{status:e}=await p.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");I?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),d({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,I,u]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(f,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:u,onClickCta:l}),/*#__PURE__*/t(g,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(I,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(d,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(l,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(p,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(u,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=/*#__PURE__*/m.p.withConfig({displayName:"StatusBody",componentId:"sc-e4350fdc-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),I=/*#__PURE__*/m.div.withConfig({displayName:"ConnectContainer",componentId:"sc-e4350fdc-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);export{w as CoinbaseOnrampStatusScreen,w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as n}from"./ScreenLayout-Dmrhdwtt.mjs";import{E as m}from"./index-CI666IP9.mjs";import"viem";import"react";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const s=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),p=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:p="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:p,subtitle:/*#__PURE__*/t(d,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(p,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=/*#__PURE__*/o.div.withConfig({displayName:"IconContainer",componentId:"sc-54536274-0"})(["display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:var(--screen-space);"]),d=/*#__PURE__*/o.span.withConfig({displayName:"SubtitleText",componentId:"sc-54536274-1"})(["white-space:pre-wrap;"]);export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,p as ConnectLedgerScreenView,c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as i}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{q as n}from"./context-Cb5MFcME.mjs";import{Q as a}from"./useActiveWallet-hrZcON-K.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{a as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as m}from"./ScreenLayout-Dmrhdwtt.mjs";import{B as c}from"./index-CI666IP9.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-DNdZyKcL.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Link-DwjLfHwW.mjs";import"./useI18n-ByKvnaXP.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:n,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:c,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(m,{title:n,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===i.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:c,watermark:!0}),d={component:()=>{let i,{navigateBack:m,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[h,C]=t(void 0),[k,b]=t(0),S=a(j?.connector?.walletClientType||"unknown"),x="connected"===j?.status,R="switching_to_supported_chain"===j?.status;o((()=>{if(x){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=j.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&j.connector){let e=j.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:j.connector?.walletClientType,walletChainType:j.connector?.chainType}))}),n)}else e=setTimeout(v,n);return()=>clearTimeout(e)}}),[x]);o((()=>{var e;j?.connectError&&(e=j?.connectError,C(p(e)))}),[j]);let T=j?.connector?.connectorType||"injected",W=j?.connector?.walletClientType||"unknown",B=S?.metadata?.shortName||S?.name||j?.connector?.walletBranding.name||"Browser Extension",M=S?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(c,{...t})),E="Browser Extension"===B?B.toLowerCase():B;i=x?`Successfully connected with ${E}`:h?h.message:R?"Switching networks":`Waiting for ${E}`;let _="Don’t see your wallet? Check your other browser windows.";return x?_="You’re good to go!":k>=2&&h?_="Unable to connect wallet":h?_=h.detail:R?_="Switch your wallet to the requested network.":"metamask"===W&&r?_="Click to continue to open and connect MetaMask.":"metamask"===W?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===T?_="Open your mobile wallet app to continue":"coinbase_wallet"===T&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:B,walletLogo:M,success:x,errorMessage:h,title:i,subtitle:_,onRetry:()=>{b(k+1),C(void 0),j?.connectRetry()},onUseDifferentWallet:m,onBack:f===w?void 0:m,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-Cb5MFcME.mjs";import{C as r,L as i}from"./CustomLandingScreenView-DWt9lv8W.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-D7WajfD8.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"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./get-is-unified-wallet-DymQMSJy.mjs";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"lucide-react";import"./ConnectEmailForm-DUgOCS2V.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./farcaster-DPlSjvF5.mjs";import"./ConnectWalletView-DVDOSzi0.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./QrCode-zzqjquVm.mjs";import"qrcode";import"./useI18n-ByKvnaXP.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./Link-DwjLfHwW.mjs";import"./ConnectPhoneForm-CbuSfwAI.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletButtonList-CGloXTN0.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./ScreenLayout-Dmrhdwtt.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-CI666IP9.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-Cb5MFcME.mjs";import{u as S}from"./useI18n-ByKvnaXP.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{Q as b,k as v,T}from"./useActiveWallet-hrZcON-K.mjs";import{isHex as _,getAddress as R}from"viem";import{b as E,u as k,i as A}from"./internal-context-Cvo1WmWN.mjs";import{u as W,a as I}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{a as j,b as U}from"./usePrivy-D3OPY7tm.mjs";import{S as O}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"@marsidev/react-turnstile";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>R(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const M=e=>e?.privyErrorCode===E.LINKED_TO_ANOTHER_USER?y.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?y.ERROR_TIMED_OUT:e?.privyErrorCode===E.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,x=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:b,onCoinbaseReset:v,onDifferentWallet:T})=>{let{t:_}=S(),R=w?{label:"Use a different wallet",onClick:v,disabled:r}:c===y.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&h<2?{label:"Retry",onClick:b,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:R,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,_]=a(void 0),{authenticated:R,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:H,setModalData:P,data:q}=I(),z=w(),{t:X}=S(),{getAuthFlow:Q,walletConnectionStatus:Y,closePrivyModal:K,initLoginWithWallet:$,loginWithWallet:J,updateWallets:V,createAnalyticsEvent:G}=k(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=b(Y?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Y?.connector?.connectorType||c&&"coinbase_wallet"===Y?.connector?.connectorType||c&&"base_account"===Y?.connector?.connectorType||c&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||c&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=Q(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===q?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||R?$(Y.connectedWallet,pe,q?.login?.disableSignup,q?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(P({captchaModalData:{callback:e=>$(Y.connectedWallet,e,q?.login?.disableSignup,q?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&q?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),_(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(z?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,z.embeddedWallets)){let t=setTimeout((()=>{P({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}V();let t=setTimeout((()=>K({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==E.ALLOWLIST_REJECTED){if(e?.privyErrorCode===E.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==E.USER_DOES_NOT_EXIST)return e?.privyErrorCode===E.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(P({accountTransfer:{nonce:e.data?.data?.nonce,account:Q()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Q()?.meta.walletClientType,chainId:Q()?.meta.chainId,connectorType:Q()?.meta.connectorType},linkMethod:Q()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await J(),l(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",be=Y?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===ve?ve.toLowerCase():ve;t=n?X("connectionStatus.successfullyConnected",{walletName:_e}):C?X("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Re=X("connectionStatus.checkOtherWindows");n?Re=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Re="Unable to connect wallet":C?Re=C.detail:Se?Re="Switch your wallet to the requested network.":he&&we?Re="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&c?Re="Click continue to open and connect MetaMask.":"metamask"===be?Re="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Re="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Re=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):q?.login?.isSigningInWithLedgerSolana&&(Re="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Ee=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{walletLogo:Te,title:t,subtitle:Re,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&H!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Ee&&Ee?.disconnect()},onDifferentWallet:B})}};let B=/*#__PURE__*/l.p.withConfig({displayName:"RedirectLinksContainer",componentId:"sc-2a867557-0"})(["text-align:center;color:var(--privy-color-foreground-2);font-size:14px;line-height:22px;margin:16px 0;"]);export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-Cb5MFcME.mjs";import{R as s}from"./index-CI666IP9.mjs";import{u as n,a as c,d as m,b as l}from"./internal-context-Cvo1WmWN.mjs";import{a as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{z as d}from"./useActiveWallet-hrZcON-K.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as f}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:A,onUserCloseViaDialogOrKeybindRef:j}=p(),{crossAppAuthFlow:y,updateWallets:g,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,T]=o({}),U=f?.crossAppAuth,k={id:U.appId,name:U.name,logoUrl:U.logoUrl},W=new c(`There was an issue connecting your ${k.name} account. Please try again.`),x=new s((async e=>{if(U.popup)try{let t=await y({appId:e,popup:U.popup,action:U.action});T({data:t})}catch(e){if(e instanceof c)T({error:e});else if(e instanceof m){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${k.id}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");U.popup&&U.popup.close(),T({error:W})}else T({error:W})}else T({error:W})})),E=()=>{C.data&&(g(),U.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return j.current=E,r((()=>{k.id.length&&x.execute(k.id)}),[k.id]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${k.id}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(E,a);return()=>clearTimeout(o)}),[C.data]),/*#__PURE__*/e(h,{providerApp:k,success:!!C.data,error:C.error,onClose:E})},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as a}from"./WalletInfoCard-DAv0WFcc.mjs";import{u as n,r as c}from"./context-Cb5MFcME.mjs";import{u as m,a as l}from"./internal-context-Cvo1WmWN.mjs";import{a as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as u}from"./ScreenLayout-Dmrhdwtt.mjs";import"styled-components";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-DtXA0OPS.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const d=({appName:i,address:s,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${i}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${i} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:s,title:"Wallet"})}),f={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=i(!1),[f,j]=i(),{address:g,onDelegate:y,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(f??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!f)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,f]),/*#__PURE__*/e(d,{appName:o.name,address:g,success:a,error:f,onAccept:async()=>{try{await y(),u(!0)}catch(e){j(e)}},onDecline:()=>{v()},onClose:v})}};export{f as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-CI666IP9.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{u as l,a as c}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as m}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,b as s,c}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as a,r as m}from"./context-Cb5MFcME.mjs";import{u as n}from"./internal-context-Cvo1WmWN.mjs";import{S as l}from"./ScreenLayout-Dmrhdwtt.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:A}=j.createWallet,C=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:A})};return o((()=>{let e=setTimeout(C,m);return()=>clearTimeout(e)}),[]),f.current=C,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:C})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
|
|
@@ -1 +0,0 @@
|
|
|
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{u as a}from"./context-Cb5MFcME.mjs";import{k as i,l as s,D as l,R as n}from"./index-CI666IP9.mjs";import{u as m,k as c}from"./internal-context-Cvo1WmWN.mjs";import{u as d}from"./use-create-wallet-without-fallback-DodUf3VP.mjs";import{a as u,u as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as h}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(h,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}),y={component:()=>{let{setModalData:t,navigate:h,data:y,onUserCloseViaDialogOrKeybindRef:v}=u(),g=a(),[j,f]=r(""),{embeddedWallets:C}=a(),{authenticated:b,user:S}=p(),{closePrivyModal:x,walletProxy:W,client:k}=m(),{onSuccess:A,onFailure:O,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:P}=y.createWallet,R="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[U,E]=r(null),{create:L}=d(),T=M??(!!S&&i(S,g.embeddedWallets.ethereum.createOnLogin)),D=P??(!!S&&s(S,g.embeddedWallets.solana.createOnLogin)),F=new n((async()=>{let e=await k.getAccessToken();if(S&&e&&W)try{let e;if(T&&D)e=await L({chainType:"ethereum",walletIndex:0,latestUser:S}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(D)e=await L({chainType:"solana",walletIndex:0,latestUser:S});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:S})}E(e),h("EmbeddedWalletCreatedScreen")}catch(e){f(e.message)}}));return o((()=>b&&S?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:D},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:D}}),h(l({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:C.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void F.execute():(h("LandingScreen"),void O(Error("User must be authenticated before creating a Privy wallet")))),[R,b]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{U?(A(U),x({shouldCallAuthOnSuccess:I})):(O(new c("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
|
|
@@ -1 +0,0 @@
|
|
|
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-Cb5MFcME.mjs";import{a as c,P as l}from"./index-CI666IP9.mjs";import{c as m,b as p,a as d,d as u}from"./internal-context-Cvo1WmWN.mjs";import{a as T}from"./get-is-unified-wallet-DymQMSJy.mjs";import{R as g}from"./reservoir-B0V48m2I.mjs";import{S as h}from"./ScreenLayout-Dmrhdwtt.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.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=/*#__PURE__*/n.a.withConfig({displayName:"Link",componentId:"sc-506514cb-0"})(["color:var(--privy-color-accent) !important;font-weight:600;"]);export{f as ErrorScreen,y as ErrorScreenView,f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as r}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-hrZcON-K.mjs";import{O as d}from"./OpenLink-BpeNYBKs.mjs";import{Q as m}from"./QrCode-zzqjquVm.mjs";import{Check as p,Copy as u}from"lucide-react";import{S as h}from"./Button-DJ-mtuuD.mjs";import{L as f}from"./LabelXs-BOisBtqT.mjs";import{u as g,q as v}from"./context-Cb5MFcME.mjs";import{u as y,b as C,i as w}from"./internal-context-Cvo1WmWN.mjs";import{u as b,a as x}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as S}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as T}from"./ScreenLayout-Dmrhdwtt.mjs";import{F as k}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";let E=/*#__PURE__*/l.div.withConfig({displayName:"Container",componentId:"sc-913deead-0"})(["width:100%;"]),I=/*#__PURE__*/l.div.withConfig({displayName:"InputContainer",componentId:"sc-913deead-1"})(["display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem;height:56px;background:",";border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);&:hover{border-color:",";}"],(e=>e.$disabled?"var(--privy-color-background-2)":"var(--privy-color-background)"),(e=>e.$disabled?"var(--privy-color-foreground-4)":"var(--privy-color-foreground-3)")),j=/*#__PURE__*/l.div.withConfig({displayName:"TextContainer",componentId:"sc-913deead-2"})(["flex:1;min-width:0;display:flex;align-items:center;"]),A=/*#__PURE__*/l.span.withConfig({displayName:"Text",componentId:"sc-913deead-3"})(["display:block;font-size:16px;line-height:24px;color:",";overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;word-break:break-all;@media (min-width:441px){font-size:14px;line-height:20px;}"],(e=>e.$disabled?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)")),N=/*#__PURE__*/l(A).withConfig({displayName:"PlaceholderText",componentId:"sc-913deead-4"})(["color:var(--privy-color-foreground-3);font-style:italic;"]),L=/*#__PURE__*/l(f).withConfig({displayName:"TitleLabel",componentId:"sc-913deead-5"})(["margin-bottom:0.5rem;"]),F=/*#__PURE__*/l(h).withConfig({displayName:"CopyButton",componentId:"sc-913deead-6"})(["&&{gap:0.375rem;font-size:14px;flex-shrink:0;}"]);const O=({value:a,title:n,placeholder:s,className:l,showCopyButton:c=!0,truncate:d,maxLength:m=40,disabled:h=!1})=>{let[f,g]=o(!1),v=d&&a?((e,t,r)=>{if((e=e.startsWith("https://")?e.slice(8):e).length<=r)return e;if("middle"===t){let t=Math.ceil(r/2)-2,o=Math.floor(r/2)-1;return`${e.slice(0,t)}...${e.slice(-o)}`}return`${e.slice(0,r-3)}...`})(a,d,m):a;return i((()=>{if(f){let e=setTimeout((()=>g(!1)),3e3);return()=>clearTimeout(e)}}),[f]),/*#__PURE__*/e(E,{className:l,children:[n&&/*#__PURE__*/t(L,{children:n}),/*#__PURE__*/e(I,{$disabled:h,children:[/*#__PURE__*/t(j,{children:a?/*#__PURE__*/t(A,{$disabled:h,title:a,children:v}):/*#__PURE__*/t(N,{$disabled:h,children:s||"No value"})}),c&&a&&/*#__PURE__*/t(F,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(a).then((()=>g(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(r,f?{children:["Copied",/*#__PURE__*/t(p,{size:14})]}:{children:["Copy",/*#__PURE__*/t(u,{size:14})]})})]})]})},_=({connectUri:r,loading:o,success:i,errorMessage:a,onBack:l,onClose:p,onOpenFarcaster:u})=>/*#__PURE__*/t(T,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:k,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},primaryCta:r&&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:k,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},onBack:l,onClose:p,watermark:!0,children:r&&n&&/*#__PURE__*/t(M,{children:/*#__PURE__*/t(d,{text:"Take me to Farcaster",url:r,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(U,{children:[/*#__PURE__*/t(W,{children:r?/*#__PURE__*/t(m,{url:r,size:275,squareLogoElement:k}):/*#__PURE__*/t(z,{children:/*#__PURE__*/t(c,{})})}),/*#__PURE__*/e(B,{children:[/*#__PURE__*/t(D,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),r&&/*#__PURE__*/t(O,{value:r,truncate:"end",maxLength:30,showCopyButton:!0,disabled:!0})]})]})}),R={component:()=>{let{authenticated:e,logout:r,ready:n,user:s}=b(),{lastScreen:l,navigate:c,navigateBack:d,setModalData:m}=x(),p=g(),{getAuthFlow:u,loginWithFarcaster:h,closePrivyModal:f,createAnalyticsEvent:T}=y(),[k,E]=o(void 0),[I,j]=o(!1),[A,N]=o(!1),L=a([]),F=u(),O=F?.meta.connectUri;return i((()=>{let e=Date.now(),t=setInterval((async()=>{let r=await F.pollForReady.execute(),o=Date.now()-e;if(r){clearInterval(t),j(!0);try{await h(),N(!0)}catch(e){let t={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===C.ALLOWLIST_REJECTED)return void c("AllowlistRejectionScreen");if(e?.privyErrorCode===C.USER_LIMIT_REACHED)return console.error(new w(e).toString()),void c("UserLimitReachedScreen");if(e?.privyErrorCode===C.USER_DOES_NOT_EXIST)return void c("AccountNotFoundScreen");if(e?.privyErrorCode===C.LINKED_TO_ANOTHER_USER)t.detail=e.message??"This account has already been linked to another user.";else{if(e?.privyErrorCode===C.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===C.INVALID_CREDENTIALS?(t.retryable=!0,t.detail="Something went wrong. Try again."):e?.privyErrorCode===C.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again.")}E(t)}}else o>12e4&&(clearInterval(t),E({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(t),L.current.forEach((e=>clearTimeout(e)))}}),[]),i((()=>{if(n&&e&&A&&s){if(p?.legal.requireUsersAcceptTerms&&!s.hasAcceptedTerms){let e=setTimeout((()=>{c("AffirmativeConsentScreen")}),v);return()=>clearTimeout(e)}A&&(S(s,p.embeddedWallets)?L.current.push(setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),T({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),v)):L.current.push(setTimeout((()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0})),v)))}}),[A,n,e,s]),/*#__PURE__*/t(_,{connectUri:O,loading:I,success:A,errorMessage:k,onBack:l?d:void 0,onClose:f,onOpenFarcaster:()=>{O&&(window.location.href=O)}})}};let M=/*#__PURE__*/l.div.withConfig({displayName:"MobileLinkContainer",componentId:"sc-914339e1-0"})(["margin-top:24px;"]),U=/*#__PURE__*/l.div.withConfig({displayName:"ContentContainer",componentId:"sc-914339e1-1"})(["display:flex;flex-direction:column;align-items:center;gap:24px;"]),W=/*#__PURE__*/l.div.withConfig({displayName:"QrContainer",componentId:"sc-914339e1-2"})(["display:flex;align-items:center;justify-content:center;min-height:275px;"]),B=/*#__PURE__*/l.div.withConfig({displayName:"InstructionsContainer",componentId:"sc-914339e1-3"})(["display:flex;flex-direction:column;align-items:center;gap:16px;"]),D=/*#__PURE__*/l.div.withConfig({displayName:"InstructionText",componentId:"sc-914339e1-4"})(["font-size:0.875rem;text-align:center;color:var(--privy-color-foreground-2);"]),z=/*#__PURE__*/l.div.withConfig({displayName:"LoaderWrapper",componentId:"sc-914339e1-5"})(["position:relative;width:82px;height:82px;"]);export{R as FarcasterConnectStatusScreen,_ as FarcasterConnectStatusView,R as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as t,Fragment as o,jsx as e}from"react/jsx-runtime";import{useRef as r}from"react";import{a as i}from"./Button-DJ-mtuuD.mjs";import{F as n}from"./Layouts-Bmf8DxNP.mjs";import{B as a}from"./ModalHeader-D7WajfD8.mjs";import{t as m}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{N as s}from"./index-CJMgUOnw.mjs";import{T as l}from"./Title-D0pfZff-.mjs";import{a as c}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as p}from"./useGetTokenPrice-B4XVfxeD.mjs";import{c as d}from"./ethers-CpMSCMOg.mjs";import{F as u,a as f,h,c as j,d as g}from"./styles-DY17fuAX.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.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-Bi0pPiUW.mjs";const v={component:()=>{let{data:v,setModalData:C}=c(),y=v?.funding,x="solana"===y.chainType,D=r(null),{tokenPrice:F}=p(x?"solana":y.chain.id),k=x?void 0:y,A=!(!k?.erc20Address||k?.erc20ContractInfo),T=x?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",I=parseFloat(y.amount),M=!isNaN(I)&&I>0,S=F?d(y.amount,F):void 0;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(m,{}),/*#__PURE__*/e(l,{children:"Confirm or edit amount"}),/*#__PURE__*/t(n,{style:{marginTop:"32px"},children:[/*#__PURE__*/e(u,{children:A?/*#__PURE__*/e(s,{size:"50px"}):/*#__PURE__*/t(o,{children:[/*#__PURE__*/t(f,{onClick:()=>D.current?.focus(),children:[/*#__PURE__*/e(h,{ref:D,value:y.amount,onChange:t=>{let o=t.target.value;/^[0-9.]*$/.test(o)&&o.split(".").length-1<=1&&C({...v,funding:{...y,amount:o},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:o}:void 0})}}),/*#__PURE__*/e(j,{children:T})]}),!k?.erc20Address&&/*#__PURE__*/e(g,{children:S&&M?`${S} USD`:""})]})}),/*#__PURE__*/e(i,{style:{marginTop:"1rem"},disabled:!M,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/e(a,{})]})}};export{v as FundingAmountEditScreen,v as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-Cb5MFcME.mjs";import{C as r,L as i}from"./CustomLandingScreenView-DWt9lv8W.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-D7WajfD8.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"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./get-is-unified-wallet-DymQMSJy.mjs";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"lucide-react";import"./ConnectEmailForm-DUgOCS2V.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./farcaster-DPlSjvF5.mjs";import"./ConnectWalletView-DVDOSzi0.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./QrCode-zzqjquVm.mjs";import"qrcode";import"./useI18n-ByKvnaXP.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./Link-DwjLfHwW.mjs";import"./ConnectPhoneForm-CbuSfwAI.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletButtonList-CGloXTN0.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./ScreenLayout-Dmrhdwtt.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 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/EnvelopeIcon";import{C as r}from"./ConnectEmailForm-DUgOCS2V.mjs";import{B as i}from"./Layouts-Bmf8DxNP.mjs";import{u as e}from"./context-Cb5MFcME.mjs";import{S as m}from"./ScreenLayout-Dmrhdwtt.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./index-CI666IP9.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-DymQMSJy.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"tinycolor2";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.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 +0,0 @@
|
|
|
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}from"./Button-DJ-mtuuD.mjs";import{F as d}from"./Layouts-Bmf8DxNP.mjs";import{B as l}from"./ModalHeader-D7WajfD8.mjs";import{Q as p}from"./QrCode-zzqjquVm.mjs";import{t as u}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{I as f}from"./InfoBanner-D6C6Bt8L.mjs";import{S as h}from"./Subtitle-DkvfP2Ev.mjs";import{T as g}from"./Title-D0pfZff-.mjs";import{W as v}from"./WalletInfoCard-DAv0WFcc.mjs";import{u as j}from"./context-Cb5MFcME.mjs";import{v as y,D as C}from"./useActiveWallet-hrZcON-K.mjs";import{u as S}from"./internal-context-Cvo1WmWN.mjs";import{a as I}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as b}from"./useWalletBalance-Xca4-c_r.mjs";import{u as T}from"./useWallets-BplPx0Pz.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{z as A,A as k}from"./index-CI666IP9.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 B}from"./getErc20Balance-Dtau1386.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-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-DtXA0OPS.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const U={component:()=>{let{wallets:k}=T(),{connectors:U}=S(),x=U.filter(y).flatMap((e=>e.wallets)),{data:E,setModalData:L,navigate:W,lastScreen:O}=I(),{rpcConfig:P,appId:Q,createAnalyticsEvent:z,closePrivyModal:H}=S(),N=j(),[R,q]=o(void 0),[X,Y]=o(!1),G=E?.funding,{reloadBalance:J}=b({rpcConfig:P,appId:Q,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?x.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:E?.funding,solanaFundingData:E?.solanaFundingData,sendTransaction:E?.sendTransaction}),W("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=N.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);R&&r>R&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-R,6):s(r-R,9),token:G.isUSDC?"USDC":"SOL"}})),q(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 B({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:P,appId:Q});return e}})().then((e=>{R&&e>R&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-R,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),q(e)})).catch((()=>q(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[R]);let _=a((()=>null==R?"":G.isUSDC?n({amount:R,decimals:6}):K?M(R,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:R,decimals:G.erc20ContractInfo.decimals}):m({wei:R})),[R,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(d,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:$}),/*#__PURE__*/t(f,{theme:N.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:()=>H({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(l,{})]})}};let $=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{U as ManualTransferScreen,U as default};
|
|
@@ -1 +0,0 @@
|
|
|
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{P as a}from"./Button-DJ-mtuuD.mjs";import{L as s}from"./useActiveWallet-hrZcON-K.mjs";import{M as m,a as l}from"./ModalHeader-D7WajfD8.mjs";import{u as c}from"./context-Cb5MFcME.mjs";import{u as p,a as u}from"./get-is-unified-wallet-DymQMSJy.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-BzAm1Ya4.mjs";import{A as v,C as j,I as k,T as g,S as C,B as M}from"./PinInput-C3_MNxMt.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";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-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-DFAo4S7A.mjs";import"lucide-react";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-B0V48m2I.mjs";import"./ScreenLayout-Dmrhdwtt.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./LinkPasskeyScreen-CNFL2N09.mjs";import"./TodoList-Dn0Qu-vv.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-zzqjquVm.mjs";import"qrcode";const w={component:()=>{let{user:w,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:A}=u(),S=c(),[R,E]=n(null),[P,F]=n(null),[T,L]=n(null),[x,B]=n(!1),[W,U]=n(!1),[D,H]=n(),O=async()=>{D?Q(D):w?await $({user:w}):Q(Error("Must be logged in to manage MFA")),setTimeout((()=>{E(null),F(null)}),500)};if(A.current=O,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:Q,onSuccess:$,onBack:z,mfaMethods:X,verify:q,generateTotpSecret:K,enrollTotp:N,unenrollTotp:V,enrollPasskey:Z}=I.mfaEnroll,_=w?.mfaMethods.includes("sms"),G=w?.mfaMethods.includes("totp"),J=w?.mfaMethods.includes("passkey"),Y=!!w?.phone,ee=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){E(null),F(null),H(void 0)}async function te(e=ee){try{H(void 0),U(!0);let o=await Z(e);return await $({user:o})}catch(e){H(e)}finally{U(!1),B(!1)}}if(!b||!w||!S)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{onClose:O,backFn:z},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(s,{})}),/*#__PURE__*/t(l,{})]});if("sms"===R)return null;if("totp"===R)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:O},"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 ",S?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{H(void 0),U(!0);let e=await V();return await $({user:e})}catch(e){H(e)}finally{U(!1),E(null)}},loading:W,children:"Remove"})}),/*#__PURE__*/t(l,{})]});if("passkey"===R){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:O},"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(M,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{H(void 0),U(!0);let e=await Z([]);return await $({user:e})}catch(e){H(e)}finally{U(!1),E(null)}},loading:W,children:"Remove"})}),/*#__PURE__*/t(l,{})]})}return 0!==X.length||_||G||J?"sms"===P?null:"totp"===P&&T?/*#__PURE__*/t(h,{onClose:O,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{H(void 0),U(!0);let o=await N(e);return await $({user:o})}catch(e){H(e)}finally{U(!1),E(null)}}(e.mfaCode),error:D,totpInfo:{...T,appName:S?.name||"Privy"}}):"passkey"===P?/*#__PURE__*/t(y,{onReset:oe,onClose:O,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:w.mfaMethods,appMfaMethods:S.mfa.methods,userHasAuthSms:Y,backFn:z,handleSelectMethod:async function(e){H(void 0);try{await q()}catch(e){return void H(e)}return"totp"===e?(F(e),L(null),void K().then((({totpSecret:e,totpAuthUrl:o})=>{L({authUrl:o,secret:e})})).catch((()=>{L(null),oe()}))):"passkey"===e&&1===ee.length?await te():void F(e)},isTotpLoading:"totp"===P&&!T,isPasskeyLoading:x,error:D,onClose:O,setRemovingMfaMethod:async function(e){H(void 0);try{await q()}catch(e){return void H(e)}E(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(m,{onClose:O,backFn:z},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[S?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(a,{onClick:O,children:"Close"})}),/*#__PURE__*/t(l,{})]})}};export{w as MfaAuthEnrollmentFlowScreen,w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as e,useRef as r}from"react";import{u as i,a as s}from"./get-is-unified-wallet-DymQMSJy.mjs";import{V as m,a as n,b as a,t as c}from"./to-ui-error-B3m2hl6e.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.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-D7WajfD8.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"./ScreenLayout-Dmrhdwtt.mjs";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-B4XVfxeD.mjs";import"./useGetSolPrice-Bi0pPiUW.mjs";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./TransactionDetails-fgHkAnf9.mjs";import"./WalletLink-CjuEskpb.mjs";import"./ethers-CpMSCMOg.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p={component:()=>{let{user:p}=i(),{data:l}=s(),[u,d]=t(p?.mfaMethods[0]),[h,f]=t(!1),[j,v]=t(),[y,k]=t();if(e((()=>{d(p?.mfaMethods[0])}),[p?.mfaMethods]),!l?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:g,onSuccess:w,generateOptions:M,verifyTotpCode:C,verifyPasskey:I,verifySmsCode:S,sendSmsCode:b}=l.mfaVerify,P=async o=>{if("passkey"!==o)try{d(o),"sms"===o&&(d(o),await b()),"totp"===o&&d(o)}catch(o){console.error(o)}else try{d(o);let t=await M();if(!t)throw Error("something went wrong");v(t),await I(t),f(!0),k(void 0),w()}catch(o){k(c(o))}},x=async o=>{k(void 0);try{if(!o||!u)return;if("passkey"===u){if(!j)throw Error("Missing passkey challenge");await I(j)}else"sms"===u?await S(o):"totp"===u&&await C(o);k(void 0),f(!0),w()}catch(o){throw c(o).error}},A=()=>{y||!h?g(y?.error??Error("Canceled MFA verification.")):w()},E=r(!1);return e((()=>{!E.current&&u&&(E.current=!0,P(u).finally((()=>{E.current=!1})))}),[open]),p?"passkey"===u?/*#__PURE__*/o(m,{account:p.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:h,hasBlockingError:y?.isBlocking??!1,error:y?.error,onClose:A,onBack:()=>{d(void 0),k(void 0)},handleSubmit:()=>x(j).catch(k)}):"sms"===u||"totp"===u?/*#__PURE__*/o(n,{selectedMethod:u,submitSuccess:h,hasBlockingError:y?.isBlocking??!1,handleSubmitCode:x,onClose:A,onBack:p.mfaMethods.length>1?()=>d(void 0):void 0}):/*#__PURE__*/o(a,{user:p,onSelect:P,handleClose:A}):null}};export{p as MfaAuthVerifyFlowScreen,p as default};
|
|
@@ -1 +0,0 @@
|
|
|
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{P as c,S as m}from"./Button-DJ-mtuuD.mjs";import{L as d}from"./useActiveWallet-hrZcON-K.mjs";import{M as h,a as u}from"./ModalHeader-D7WajfD8.mjs";import{u as p}from"./context-Cb5MFcME.mjs";import{u as f}from"./internal-context-Cvo1WmWN.mjs";import{a as y,u as v}from"./get-is-unified-wallet-DymQMSJy.mjs";import{d as C,f as k,g as w,h as g,i as j,u as b}from"./index-CI666IP9.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-BzAm1Ya4.mjs";import F from"@heroicons/react/24/outline/CheckCircleIcon";import P from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-CbuSfwAI.mjs";import{I as W,T as B,S as T,C as A,a as L,B as N,N as U,A as O,L as $,b as D,c as H}from"./PinInput-C3_MNxMt.mjs";import{ErrorScreenView as Q}from"./ErrorScreen-DFAo4S7A.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.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-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-CNFL2N09.mjs";import"lucide-react";import"./TodoList-Dn0Qu-vv.mjs";import"./ScreenLayout-Dmrhdwtt.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-zzqjquVm.mjs";import"qrcode";import"./reservoir-B0V48m2I.mjs";const Y=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,m]=a(""),[d,f]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=y(),$=p();function D(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(Q,{allowlistConfig:$.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(h,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(B,{children:"Set up SMS verification"}),/*#__PURE__*/o(T,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),m(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(L,{children:["By providing your mobile number, you agree to receive text messages from ",$?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(u,{})]}:d?{children:[/*#__PURE__*/e(h,{onClose:D},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(B,{children:"SMS verification added"}),/*#__PURE__*/o(T,{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(c,{onClick:D,children:"Done"})}),/*#__PURE__*/e(u,{})]}:{children:[/*#__PURE__*/e(h,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(B,{children:"Enter enrollment code"}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),f(!0)}catch(e){if(k(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(w(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(T,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(u,{})]})},q={component:()=>{let{user:k,enrollInMfa:w,ready:g}=v(),[j,F]=a(null),{unenrollWithSms:P,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:L,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:Q,initEnrollmentWithTotp:q}=C(),{data:z,onUserCloseViaDialogOrKeybindRef:V}=y(),X=p(),{closePrivyModal:K}=f(),{promptMfa:Z}=b(),[_,G]=a(!1),[J,ee]=a(null),[oe,re]=a(null),te=()=>{K({shouldCallAuthOnSuccess:!0}),w(!1),setTimeout((()=>{F(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();V.current=te;let se=k?.mfaMethods.includes("sms"),ce=!!k?.phone,me=k?.mfaMethods.includes("totp"),de=k?.mfaMethods.includes("passkey"),he=se||me||de,ue=k?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){F(null),ee(null)}async function fe(e=ue){ie(!0);try{return await U(),await Q({credentialIds:e},{removeForLogin:z?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),z?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&G(!0)}),[he]),!g||!k||!X/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(A,{children:/*#__PURE__*/e(d,{})}),/*#__PURE__*/e(u,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(B,{children:"Remove SMS verification?"}),/*#__PURE__*/o(T,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await P()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(B,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(T,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await R()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("passkey"===j){let n=z?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(B,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(T,{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(c,{$warn:!0,onClick:async function(){F(null);try{await x({removeForLogin:z?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]})}if(0===z.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(B,{children:"Add more security"}),/*#__PURE__*/o(T,{children:[X?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{onClick:te,children:"Close"})}),/*#__PURE__*/e(u,{})]});let ye=!he&&!_;return ye?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(B,{children:"Transaction Protection"}),/*#__PURE__*/e(T,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o($,{children:[/*#__PURE__*/o(D,{children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",X?.name," wallet."]}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(c,{onClick:()=>G(!0),children:"Continue"}),/*#__PURE__*/e(m,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(u,{})]}):"sms"===J?/*#__PURE__*/e(Y,{appName:X?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===J&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await L({mfaCode:e}),z?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{F(null)}}(e),totpInfo:{...oe,appName:X?.name||"Privy"}}):"passkey"===J?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:fe}):/*#__PURE__*/e(I,{showIntro:ye,userMfaMethods:k.mfaMethods,appMfaMethods:X.mfa.methods,userHasAuthSms:ce,backFn:function(){G(!1)},handleSelectMethod:async function(e){try{await Z()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void q().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await fe():void ee(e)},isTotpLoading:"totp"===J&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await Z()}catch(e){return void ae(e)}F(e)}})}};export{q as MfaEnrollmentFlowScreen,q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as e,useRef as r}from"react";import{u as i}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as m}from"./index-CI666IP9.mjs";import{V as n,a as s,b as c,t as a}from"./to-ui-error-B3m2hl6e.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.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-D7WajfD8.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-Dmrhdwtt.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-B4XVfxeD.mjs";import"./useGetSolPrice-Bi0pPiUW.mjs";import"./TransactionDetails-fgHkAnf9.mjs";import"./WalletLink-CjuEskpb.mjs";import"./ethers-CpMSCMOg.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p=({onClose:p})=>{let{user:l}=i(),[u,d]=o(l?.mfaMethods[0]??null),{init:h,cancel:j,submit:f}=m(),[v,y]=o(!1),[k,g]=o(null),[w,I]=o();e((()=>{d(l?.mfaMethods[0]??null)}),[l?.mfaMethods]);let b=r(!1);async function C(t){I(void 0);try{if(!t||!u)return;await f(u,t),y(!0),I(void 0),p()}catch(t){throw a(t).error}}async function M(t){if("passkey"!==t)try{d(t),await h(t)}catch(t){console.error(t)}else try{d(t);let o=await h(t);if(!o)throw Error("something went wrong");g(o),await f(t,o),y(!0),I(void 0),p()}catch(t){I(a(t))}}e((()=>{!b.current&&u&&(b.current=!0,M(u).finally((()=>{b.current=!1})))}),[]);let S=()=>{d(null),I(void 0),j(),p()};return l?"passkey"===u?/*#__PURE__*/t(n,{account:l.linkedAccounts.filter((t=>"passkey"===t.type&&t.enrolledInMfa)).sort(((t,o)=>o.firstVerifiedAt.valueOf()-t.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:w?.isBlocking??!1,error:w?.error,onClose:S,onBack:()=>{d(null),I(void 0)},handleSubmit:()=>C(k).catch(I)}):u?/*#__PURE__*/t(s,{submitSuccess:v,hasBlockingError:w?.isBlocking??!1,handleSubmitCode:C,selectedMethod:u,onClose:S,onBack:l.mfaMethods.length>1?()=>d(null):void 0}):/*#__PURE__*/t(c,{user:l,onSelect:M,handleClose:S}):null};export{p as MfaVerifyFlowScreen,p as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t,{useState as r,useEffect as o}from"react";import{i,u as a,a as n}from"./get-is-unified-wallet-DymQMSJy.mjs";import{A as s,T as m,I as c,S as l,a as d,L as p,b as u,D as h,G as v}from"./twitter-6jomarO4.mjs";import y from"@heroicons/react/24/outline/GlobeAltIcon";import{T as g,L as f}from"./twitch-5IOe4sIQ.mjs";import{u as E,q as A}from"./context-Cb5MFcME.mjs";import{b as T,u as S,i as w}from"./internal-context-Cvo1WmWN.mjs";import{s as b}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as _}from"./ScreenLayout-Dmrhdwtt.mjs";import{e as C}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{s as j}from"./index-CI666IP9.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const O=({style:t})=>/*#__PURE__*/e(y,{style:{color:"var(--privy-color-error)",...t}});let R={google:{name:"Google",component:v},discord:{name:"Discord",component:h},github:{name:"Github",component:u},linkedin:{name:"LinkedIn",component:p},twitter:{name:"Twitter",component:d},spotify:{name:"Spotify",component:l},instagram:{name:"Instagram",component:c},tiktok:{name:"Tiktok",component:m},line:{name:"LINE",component:f},twitch:{name:"Twitch",component:g},apple:{name:"Apple",component:s}},N=({iconUrl:e,...r})=>t.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},t.createElement("foreignObject",{x:"2",y:"2",width:"29",height:"28"},t.createElement("img",{src:e,width:"29",height:"28",style:{display:"block",objectFit:"contain",borderRadius:"4px"},alt:"Provider icon"})));const U=(e,r)=>{if(e in R)return R[e];if(i(e)&&r){let o=r.find((t=>t.provider===e));if(o)return{name:o.provider_display_name,component:e=>t.createElement(N,{...e,iconUrl:o.provider_icon_url})}}return{name:"Unknown",component:O}};function I(e,t,r){let o={detail:"",retryable:!1},i=C(t);if(e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER&&(o.detail="This account has already been linked to another user."),e?.privyErrorCode===T.INVALID_CREDENTIALS&&(o.retryable=!0,o.detail="Something went wrong. Try again."),e.privyErrorCode===T.OAUTH_USER_DENIED&&(o.detail=`Retry and check ${i} to finish connecting your account.`,o.retryable=!0),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(o.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=U(t,r).name;o.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===T.OAUTH_ACCOUNT_SUSPENDED){let e=U(t,r).name;o.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE&&(o.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===T.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(o.detail="Something went wrong. Please try again."),o}const L=({providerName:t,ProviderLogo:r,success:o,errorMessage:i,onRetry:a})=>{let n=o?`Successfully connected with ${t}`:i?i.message:`Verifying connection to ${t}`;/*#__PURE__*/return e(_,{title:n,subtitle:o?"You're good to go!":i?i.detail:"Just a few moments more",icon:r,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!i},secondaryCta:i?.retryable&&a?{label:"Retry",onClick:a}:void 0,watermark:!0})},k={component:()=>{let{authenticated:t,logout:i,ready:s,user:m}=a(),{setModalData:c,navigate:l,resetNavigation:d}=n(),p=E(),{getAuthMeta:u,initLoginWithOAuth:h,loginWithOAuth:v,updateWallets:y,setReadyToTrue:g,closePrivyModal:f,createAnalyticsEvent:_}=S(),[C,O]=r(!1),[R,N]=r(void 0),k=u()?.provider||"google",{name:D,component:P}=U(k,p.customOAuthProviders);return o((()=>{v(k).then((()=>{O(!0),g(!0)})).catch((e=>{if(g(!1),e?.privyErrorCode===T.ALLOWLIST_REJECTED)return N(void 0),d(),void l("AllowlistRejectionScreen");if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new w(e).toString()),N(void 0),d(),void l("UserLimitReachedScreen");if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return N(void 0),d(),void l("AccountNotFoundScreen");if(e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return N(void 0),d(),c({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:u()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void l("LinkConflictScreen");let{retryable:t,detail:r}=I(e,k,p.customOAuthProviders);N({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{j()}))}),[D,k]),o((()=>{if(s&&t&&C&&m){if(p?.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let e=setTimeout((()=>{l("AffirmativeConsentScreen")}),A);return()=>clearTimeout(e)}if(b(m,p.embeddedWallets)){let e=setTimeout((()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:k,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),l("EmbeddedWalletOnAccountCreateScreen")}),A);return()=>clearTimeout(e)}{let e=setTimeout((()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0})),A);return y(),()=>clearTimeout(e)}}}),[s,t,C,m]),/*#__PURE__*/e(L,{providerName:D,ProviderLogo:P,success:C,errorMessage:R,onRetry:R?.retryable?()=>{j(),h(k),N(void 0)}:void 0})},isShownBeforeReady:!0};export{k as OAuthStatusScreen,L as OAuthStatusScreenView,k as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{FingerprintIcon as e}from"lucide-react";import{a as i}from"./index-CI666IP9.mjs";import{u as o}from"./internal-context-Cvo1WmWN.mjs";import{a as r}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as a}from"./ScreenLayout-Dmrhdwtt.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const s=({title:i="Log in or create a new account?",subtitle:o="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:r,onLogin:s})=>/*#__PURE__*/t(a,{title:i,subtitle:o,icon:e,primaryCta:{label:"Create new account",onClick:r},secondaryCta:{label:"Log in with a passkey",onClick:s},watermark:!0}),n={component:()=>{let{enabled:e,token:a}=i(),{navigate:n,setModalData:p}=r(),{initSignupWithPasskey:m,initLoginWithPasskey:c}=o();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:t=>m({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await m({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:t=>c({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{FingerprintIcon as r}from"lucide-react";import{useState as t,useRef as o,useEffect as s}from"react";import{styled as i}from"styled-components";import{u as a,q as n}from"./context-Cb5MFcME.mjs";import{c,b as m,u}from"./internal-context-Cvo1WmWN.mjs";import{a as l,u as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as y}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const f=({status:t,passkeySignupFlow:o=!1,error:s,onRetry:i})=>/*#__PURE__*/e(y,{title:(()=>{switch(t){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})(),subtitle:/*#__PURE__*/e(g,{children:(()=>{switch(t){case"loading":return o?"Please follow prompts to register your passkey.":"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof c){if(s.privyErrorCode===m.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(s.privyErrorCode===m.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()}),icon:r,iconVariant:"loading",iconLoadingStatus:{success:"success"===t,fail:"error"===t},primaryCta:"error"===t&&i?{label:"Retry",onClick:i}:"success"===t?{label:"Continue",disabled:!0}:void 0,watermark:!0}),h={component:()=>{let{data:r,setModalData:i,navigate:c}=l(),m=a(),{loginWithPasskey:y,signupWithPasskey:h,closePrivyModal:g,createAnalyticsEvent:v}=u(),{user:w,logout:j}=p(),{passkeySignupFlow:k}=r?.passkeyAuthModalData??{},S=n-500,[b,A]=t("loading"),[C,P]=t(null),E=o([]),W=e=>{E.current=[e,...E.current]};s((()=>()=>{E.current.forEach((e=>clearTimeout(e))),E.current=[]}),[]);let T=async()=>{A("loading");try{k?await h():await y(),A("success")}catch(e){P(e),A("error")}};return s((()=>{if("success"===b&&w){if(m?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms)return void W(setTimeout((()=>{c("AffirmativeConsentScreen")}),S));if(!d(w,m?.embeddedWallets))return void W(setTimeout((()=>{g({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),n));W(setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"PasskeyStatusScreen"}}),j()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,b]),s((()=>{T()}),[]),/*#__PURE__*/e(f,{status:b,passkeySignupFlow:k,error:C,onRetry:T})}};let g=/*#__PURE__*/i.span.withConfig({displayName:"SubtitleText",componentId:"sc-5f92460f-0"})(["white-space:pre-wrap;"]);export{h as PasskeyStatusScreen,f as PasskeyStatusScreenView,h as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as o,useEffect as i}from"react";import{styled as s,css as a}from"styled-components";import{u as n,a as c,h as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{P as m}from"./Button-DJ-mtuuD.mjs";import{S as p}from"./Layouts-Bmf8DxNP.mjs";import{P as d,a as u,I as h,H as y,S as v}from"./shared-DsP7M4P5.mjs";import{r as f}from"./index-CI666IP9.mjs";import{u as w,k as g}from"./internal-context-Cvo1WmWN.mjs";import{S as j}from"./Screen-dwi2CitY.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-D7WajfD8.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-CJMgUOnw.mjs";const b={component:()=>{let[s,a]=o(!0),{authenticated:m,user:b}=n(),{walletProxy:A,closePrivyModal:k,createAnalyticsEvent:P,client:S}=w(),{navigate:N,data:E,onUserCloseViaDialogOrKeybindRef:M}=c(),[T,W]=o(void 0),[_,H]=o(""),[R,U]=o(!1),{entropyId:z,entropyIdVerifier:B,onCompleteNavigateTo:F,onSuccess:O,onFailure:V}=E.recoverWallet,$=(e="User exited before their wallet could be recovered")=>{k({shouldCallAuthOnSuccess:!1}),V("string"==typeof e?new g(e):e)};M.current=$,i((()=>{if(!m)return $("User must be authenticated and have a Privy wallet before it can be recovered")}),[m]);/*#__PURE__*/return e(j,{children:[/*#__PURE__*/r(j.Header,{icon:t,title:"Enter your password",subtitle:"Please provision your account on this new device. To continue, enter your recovery password.",showClose:!0,onClose:$}),/*#__PURE__*/r(j.Body,{children:/*#__PURE__*/r(x,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(d,{children:[/*#__PURE__*/r(u,{type:s?"password":"text",onChange:e=>(e=>{e&&W(e)})(e.target.value),disabled:R,style:{paddingRight:"2.3rem"}}),/*#__PURE__*/r(h,{style:{right:"0.75rem"},children:s?/*#__PURE__*/r(y,{onClick:()=>a(!1)}):/*#__PURE__*/r(v,{onClick:()=>a(!0)})})]}),!!_&&/*#__PURE__*/r(C,{children:_})]})})}),/*#__PURE__*/e(j.Footer,{children:[/*#__PURE__*/r(j.HelpText,{children:/*#__PURE__*/e(p,{children:[/*#__PURE__*/r("h4",{children:"Why is this necessary?"}),/*#__PURE__*/r("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]})}),/*#__PURE__*/r(j.Actions,{children:/*#__PURE__*/r(I,{loading:R||!A,disabled:!T,onClick:async()=>{U(!0);let e=await S.getAccessToken(),r=l(b,z);if(!e||!r||null===T)return $("User must be authenticated and have a Privy wallet before it can be recovered");try{P({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r.address}}),await(A?.recover({accessToken:e,entropyId:z,entropyIdVerifier:B,recoveryPassword:T})),H(""),F?N(F):k({shouldCallAuthOnSuccess:!1}),O?.(r),P({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}})}catch(e){f(e)?H("Invalid recovery password, please try again."):H("An error has occurred, please try again.")}finally{U(!1)}},$hideAnimations:!z&&R,children:"Recover your account"})}),/*#__PURE__*/r(j.Watermark,{})]})]})}};let x=/*#__PURE__*/s.div.withConfig({displayName:"Content",componentId:"sc-1247f710-0"})(["display:flex;flex-direction:column;gap:1.5rem;"]),C=/*#__PURE__*/s.div.withConfig({displayName:"ErrorMessage",componentId:"sc-1247f710-1"})(["line-height:20px;height:20px;font-size:13px;color:var(--privy-color-error);text-align:left;margin-top:0.5rem;"]),I=/*#__PURE__*/s(m).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-1247f710-2"})(["",""],(({$hideAnimations:e})=>e&&/*#__PURE__*/a(["&&{transition:none;}"])));export{b as PasswordRecoveryScreen,b as default};
|