@privy-io/react-auth 3.16.0 → 3.17.0
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-B_Ii7HuZ.js +1 -0
- package/dist/cjs/{Address-DTfphH3Q.js → Address-DVa7_frc.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-B7KmE68B.js +6 -0
- package/dist/cjs/AllowlistRejectionScreen-O8KznddG.js +1 -0
- package/dist/cjs/AuthenticateWithWalletScreen-C8K-iZIK.js +1 -0
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-cOTXpUAv.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-yMOq8AmY.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-lFFqycAd.js +103 -0
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-DmvP14kc.js +2 -0
- package/dist/cjs/{BridgeNetworkSelectionView-xdYr4mxx.js → BridgeNetworkSelectionView-pkX-b3EU.js} +3 -3
- package/dist/cjs/CaptchaScreen-C0GEjNbh.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-yT0aNgm6.js +16 -0
- package/dist/cjs/ConnectEmailForm-BBb0J8Qw.js +3 -0
- package/dist/cjs/ConnectLedgerScreen-DUt1xIAQ.js +9 -0
- package/dist/cjs/ConnectOnlyLandingScreen-DsDH4IPK.js +1 -0
- package/dist/cjs/ConnectOnlyStatusScreen-DHifzxdh.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-BUgdLxoo.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-BYX8kgCj.js → ConnectPhoneForm-Cz02aWfj.js} +1 -1
- package/dist/cjs/{ConnectWalletView-QyJORAZG.js → ConnectWalletView-CWInrfMx.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-BVrAip_u.js +7 -0
- package/dist/cjs/CrossAppAuthScreen-BlSprwdt.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-Cx9QR2CX.js → CustomLandingScreenView-FFU4u8kB.js} +6 -6
- package/dist/cjs/DelegatedActionsConsentScreen-2K48Ywrm.js +1 -0
- package/dist/cjs/DelegatedActionsRevokeScreen-AuQpKTzg.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-C4LTqs6h.js +1 -0
- package/dist/cjs/EmbeddedWalletCreatedScreen-C32Uofc9.js +1 -0
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-wfa1ho1-.js → EmbeddedWalletKeyExportScreen-SnvHNrgu.js} +4 -4
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-osK2tW68.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DKWmdrJ6.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DqSEVO7w.js +1 -0
- package/dist/cjs/{EnrollTotp-BzmjXzYC.js → EnrollTotp-CXMhvYqd.js} +8 -8
- package/dist/cjs/ErrorScreen-CPJ98NuU.js +4 -0
- package/dist/cjs/{FarcasterConnectStatusScreen-s3pS-ZH-.js → FarcasterConnectStatusScreen-D13iXt7h.js} +5 -5
- package/dist/cjs/FarcasterSignerStatusScreen-Bf_kP9J_.js +29 -0
- package/dist/cjs/FiatOnrampScreen-BV4GPQv0.js +97 -0
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-85QbPj5Z.js +2 -0
- package/dist/cjs/FundWalletMethodHeader-CcRikV5C.js +1 -0
- package/dist/cjs/FundWithBankDepositScreen-CETUOydb.js +58 -0
- package/dist/cjs/FundingEditAmountScreen-ro3pfZTg.js +1 -0
- package/dist/cjs/FundingMethodSelectionScreen-ecxVf53z.js +1 -0
- package/dist/cjs/InAppBrowserLoginNotPossible-BaL0j2oh.js +1 -0
- package/dist/cjs/InstallWalletScreen-D8WdMq8Y.js +1 -0
- package/dist/cjs/LandingScreen-D3EKQEkC.js +1 -0
- package/dist/cjs/{LinkConflictScreen-DnHf7IMX.js → LinkConflictScreen-Ch0YDBOh.js} +3 -3
- package/dist/cjs/LinkEmailScreen-BiHRv43F.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-CTN6f7yX.js → LinkPasskeyScreen-BkAhVm_K.js} +12 -12
- package/dist/cjs/LinkPhoneScreen-SMbGlFFp.js +1 -0
- package/dist/cjs/LoginFailedScreen-gThOR4ql.js +1 -0
- package/dist/cjs/ManualTransferScreen-C6_MKYQa.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BGwEDhYM.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-FkpTmQLM.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-D68k3d6k.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-DPiE_Oju.js +1 -0
- package/dist/cjs/{ModalHeader-CakS8Dcu.js → ModalHeader-DGIBNq1A.js} +1 -1
- package/dist/cjs/MoonpayStatusScreen-Bwey-ZFS.js +16 -0
- package/dist/cjs/OAuthStatusScreen-DCIvmlua.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-BrsgZDWY.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-CRdrwEDq.js +3 -0
- package/dist/cjs/PasswordRecoveryScreen-nT66Ca8q.js +20 -0
- package/dist/cjs/{QrCode-C-Mk5-26.js → QrCode-Di8xGbem.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-BC6heUn-.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-D6M_6kN8.js +1 -0
- package/dist/cjs/{RecoverySelectionScreen-BAJ1nLeO.js → RecoverySelectionScreen-BDCnVnE6.js} +2 -2
- package/dist/cjs/{Screen-Dp9-H_S8.js → Screen-B1vrS1Ly.js} +1 -1
- package/dist/cjs/{ScreenLayout-DANQ0V5E.js → ScreenLayout-yf03MRVf.js} +1 -1
- package/dist/cjs/SelectSourceAsset-BzCWfa5L.js +112 -0
- package/dist/cjs/SetAutomaticRecoveryScreen-CVn23TKd.js +14 -0
- package/dist/cjs/{SetWalletPasswordForm-B7bBDQ8N.js → SetWalletPasswordForm-0S2ymSzL.js} +4 -4
- package/dist/cjs/{SignRequestScreen-BUvgSx9X.js → SignRequestScreen-CPgU7Wo3.js} +4 -4
- package/dist/cjs/{StandardSignAndSendTransactionScreen-CzfhyIDP.js → StandardSignAndSendTransactionScreen-C-E3j4dP.js} +2 -2
- package/dist/cjs/TelegramAuthScreen-DiYpzHoT.js +1 -0
- package/dist/cjs/{TransactionDetails-BlPOqfEn.js → TransactionDetails-CHdkf5Rb.js} +1 -1
- package/dist/cjs/{TransactionErrorView-BpXI1X_G.js → TransactionErrorView-D1Nh7N_d.js} +4 -4
- package/dist/cjs/{TransferFromWalletScreen-Ds1sknGn.js → TransferFromWalletScreen-h9tRPXBH.js} +2 -2
- package/dist/cjs/{TransferOrBridgeLoadingScreen-CAYUlR4u.js → TransferOrBridgeLoadingScreen-DQZIn6hw.js} +2 -2
- package/dist/cjs/UpdateEmailScreen-BY3xMHK8.js +1 -0
- package/dist/cjs/UpdatePhoneScreen-ChbBiqBC.js +1 -0
- package/dist/cjs/UserLimitReachedScreen-AJZpREqN.js +1 -0
- package/dist/cjs/{WalletInfoCard-CRZt0t3t.js → WalletInfoCard-BfZ3_ji-.js} +6 -6
- package/dist/cjs/WalletInterstitialScreen-DRz63LSO.js +1 -0
- package/dist/cjs/{WalletLink-Cx_Zda0m.js → WalletLink--xpsJ0_X.js} +5 -5
- package/dist/cjs/{WalletOverflowButton-cnlzyqcK.js → WalletOverflowButton-B81EzN7L.js} +1 -1
- package/dist/cjs/{WarningBanner-COl_Q0K3.js → WarningBanner-DUcGaIpZ.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-BAmjgwZ7.js → context-DTLyrNSs.js} +1 -1
- package/dist/cjs/{ethers-D8g2mvSK.js → ethers-DkYZ2n_L.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/{getErc20Balance-C6ZUC_1B.js → getErc20Balance-CZkdpSqJ.js} +1 -1
- package/dist/cjs/{getErc20TokenInfo-DprFN1Dj.js → getErc20TokenInfo-B7OUw6ca.js} +1 -1
- package/dist/cjs/{index-BohqOluI.js → index-BbTBzvbB.js} +5 -5
- package/dist/cjs/{index-DIKBRogK.js → index-DLnQPdlD.js} +2 -2
- package/dist/cjs/index-DVVwP01f.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/privy-context-CqCBaHHR.js +1 -0
- package/dist/cjs/{shared-C-w7sNT2.js → shared-BrHBD7Qj.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DAiUXgPZ.js → shouldProceedtoEmbeddedWalletCreationFlow-By7HZi5X.js} +1 -1
- package/dist/cjs/smart-wallets-CXiwZqOu.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{styles-s2f3dL_6.js → styles-BU6XkGeI.js} +4 -4
- package/dist/cjs/{to-ui-error-CqnwRcKJ.js → to-ui-error-Bxoctv93.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/use-export-wallet-B4aMG55I.js +1 -0
- package/dist/cjs/use-export-wallet-CJFX3PX0.js +1 -0
- package/dist/cjs/{useActiveWallet-CYUR_x0A.js → useActiveWallet-DEJxYDtx.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-X3dW0I3y.js → useGetTokenPrice-zMimik1y.js} +1 -1
- package/dist/cjs/{useI18n-BsableMs.js → useI18n-CttJorXw.js} +1 -1
- package/dist/cjs/usePrivy-B61TDDeF.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-BhX1Bzre.js → useSolanaRpcClient-B5g3sWrW.js} +1 -1
- package/dist/cjs/{useWalletBalance-CcicA-jd.js → useWalletBalance-BD5uRFtG.js} +1 -1
- package/dist/cjs/useWallets-BsO73htS.js +1 -0
- package/dist/cjs/useWallets-CAFhVWLf.js +1 -0
- package/dist/dts/{events-context-DJ7XN_9I.d.mts → events-context-BXis4NRh.d.mts} +1 -1
- package/dist/dts/{events-context-DJ7XN_9I.d.ts → events-context-BXis4NRh.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 +41 -8
- package/dist/dts/index.d.ts +41 -8
- 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-CrwMc83t.d.mts → types-Bc9w_mgT.d.mts} +3 -2
- package/dist/dts/{types-CrwMc83t.d.ts → types-Bc9w_mgT.d.ts} +3 -2
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-qafr9ivT.mjs +1 -0
- package/dist/esm/{Address-Cbulz6Wu.mjs → Address-B99EaiMb.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-CIqvK8m6.mjs +6 -0
- package/dist/esm/AllowlistRejectionScreen-DU4DWBPE.mjs +1 -0
- package/dist/esm/AuthenticateWithWalletScreen-XPD7DrVO.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DD0jtqOa.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DzTmic9m.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-7QOTS6b-.mjs +103 -0
- package/dist/esm/AwaitingSolToEvmBridgingScreen-DYZZooDp.mjs +2 -0
- package/dist/esm/{BridgeNetworkSelectionView-nrYQOGZA.mjs → BridgeNetworkSelectionView-CmMVzAX5.mjs} +5 -5
- package/dist/esm/CaptchaScreen-DhwS3FJh.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-CTrA4xKy.mjs +16 -0
- package/dist/esm/ConnectEmailForm-yaDsKJmn.mjs +3 -0
- package/dist/esm/ConnectLedgerScreen-O8ZnkCDn.mjs +9 -0
- package/dist/esm/ConnectOnlyLandingScreen-BUO28erJ.mjs +1 -0
- package/dist/esm/ConnectOnlyStatusScreen-Dy6oAk17.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-H52RmK3k.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-D8SHd_ge.mjs → ConnectPhoneForm-SXho-ZCl.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-By6eXfKl.mjs → ConnectWalletView-mm5nV3qj.mjs} +1 -1
- package/dist/esm/ConnectionStatusScreen-XXeNlflJ.mjs +7 -0
- package/dist/esm/CrossAppAuthScreen-bAev2vFm.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-Co0nHKPw.mjs → CustomLandingScreenView-e-NPZniC.mjs} +4 -4
- package/dist/esm/DelegatedActionsConsentScreen-C2uGvUf3.mjs +1 -0
- package/dist/esm/DelegatedActionsRevokeScreen-DIURa5L6.mjs +1 -0
- package/dist/esm/EmbeddedWalletConnectingScreen-CznyXfNg.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-Vch95Jje.mjs +1 -0
- package/dist/esm/EmbeddedWalletKeyExportScreen-kW2-IWjW.mjs +40 -0
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-DtrWxrnI.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-QLodnJ1t.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-B0gtNXG6.mjs +1 -0
- package/dist/esm/{EnrollTotp-nZPSS3Ux.mjs → EnrollTotp-Du2Tjgrx.mjs} +5 -5
- package/dist/esm/ErrorScreen-P5oZf9cz.mjs +4 -0
- package/dist/esm/{FarcasterConnectStatusScreen-BdwUuSkv.mjs → FarcasterConnectStatusScreen-dpPMJ4I7.mjs} +8 -8
- package/dist/esm/FarcasterSignerStatusScreen-COkxl1bH.mjs +28 -0
- package/dist/esm/FiatOnrampScreen-Ci0mAJY4.mjs +97 -0
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-DW0tS4tS.mjs +1 -0
- package/dist/esm/FundWalletMethodHeader-D38FBVVM.mjs +1 -0
- package/dist/esm/FundWithBankDepositScreen-Dk_IouhM.mjs +58 -0
- package/dist/esm/FundingEditAmountScreen-BLsQoL4e.mjs +1 -0
- package/dist/esm/FundingMethodSelectionScreen-OlDe5HS2.mjs +1 -0
- package/dist/esm/InAppBrowserLoginNotPossible-BV3tTire.mjs +1 -0
- package/dist/esm/InstallWalletScreen-BMmSUe34.mjs +1 -0
- package/dist/esm/LandingScreen-B83IEgoc.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-DNGVg8dW.mjs → LinkConflictScreen-DNiusVkA.mjs} +3 -3
- package/dist/esm/LinkEmailScreen-1OEkvtrp.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-CTYGeo1r.mjs → LinkPasskeyScreen-CHPataTs.mjs} +5 -5
- package/dist/esm/LinkPhoneScreen-DiwKH2Mt.mjs +1 -0
- package/dist/esm/LoginFailedScreen-CDmqpAN2.mjs +1 -0
- package/dist/esm/ManualTransferScreen-DyN3_kBX.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-BNV7WReW.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-B-ukVyrA.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-COe5FpFP.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-DCIPle0Z.mjs +1 -0
- package/dist/esm/{ModalHeader-DfHxv9fE.mjs → ModalHeader-DpkEBdQv.mjs} +1 -1
- package/dist/esm/MoonpayStatusScreen-_owltgjZ.mjs +16 -0
- package/dist/esm/OAuthStatusScreen-KZmCHc_b.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-CQ_DHbaT.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-eu3lPB6M.mjs +3 -0
- package/dist/esm/PasswordRecoveryScreen-DndhFHx6.mjs +20 -0
- package/dist/esm/{QrCode-D4XZQrgi.mjs → QrCode-D-J14re9.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-CwCRvxCX.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DrRcz4CY.mjs +1 -0
- package/dist/esm/{RecoverySelectionScreen-DVBTi436.mjs → RecoverySelectionScreen-CPHkQlGF.mjs} +2 -2
- package/dist/esm/{Screen-CDEd4p2a.mjs → Screen-B0u1eY7p.mjs} +3 -3
- package/dist/esm/{ScreenLayout-BdRrZJd_.mjs → ScreenLayout-CyK-vOMq.mjs} +1 -1
- package/dist/esm/SelectSourceAsset-ac3FApgI.mjs +112 -0
- package/dist/esm/{SetAutomaticRecoveryScreen-DBcSNU6R.mjs → SetAutomaticRecoveryScreen-DLY7WHVZ.mjs} +2 -2
- package/dist/esm/{SetWalletPasswordForm-DdWjdu2s.mjs → SetWalletPasswordForm-CQWh647N.mjs} +4 -4
- package/dist/esm/SignRequestScreen-BYHN19dO.mjs +26 -0
- package/dist/esm/{StandardSignAndSendTransactionScreen-DIJRS8NR.mjs → StandardSignAndSendTransactionScreen-5sT-AMvv.mjs} +2 -2
- package/dist/esm/TelegramAuthScreen-DATrHQkr.mjs +1 -0
- package/dist/esm/{TransactionDetails-Ce_Cnzo2.mjs → TransactionDetails-D9GBw9C3.mjs} +4 -4
- package/dist/esm/{TransactionErrorView-JiZmO7NJ.mjs → TransactionErrorView-3qTJ_97m.mjs} +5 -5
- package/dist/esm/{TransferFromWalletScreen-ad5b7GV7.mjs → TransferFromWalletScreen-w3c3g8ys.mjs} +2 -2
- package/dist/esm/{TransferOrBridgeLoadingScreen-Cwzefd9j.mjs → TransferOrBridgeLoadingScreen-koaJdk-2.mjs} +1 -1
- package/dist/esm/UpdateEmailScreen-BKTgKvoR.mjs +1 -0
- package/dist/esm/UpdatePhoneScreen-z7-7NbIO.mjs +1 -0
- package/dist/esm/UserLimitReachedScreen-BK77vZJo.mjs +1 -0
- package/dist/esm/{WalletInfoCard-D2dCT7_H.mjs → WalletInfoCard-hC5PhrNs.mjs} +1 -1
- package/dist/esm/WalletInterstitialScreen-DzDGk-y-.mjs +1 -0
- package/dist/esm/{WalletLink-DNraFqEC.mjs → WalletLink-sGQdBvAh.mjs} +1 -1
- package/dist/esm/{WalletOverflowButton-Cn_nKCBf.mjs → WalletOverflowButton-BrrkHpeZ.mjs} +1 -1
- package/dist/esm/{WarningBanner-c8L53pJ2.mjs → WarningBanner-D5LqDt95.mjs} +2 -2
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{context-Cw2-86-G.mjs → context-Bj4czVEP.mjs} +1 -1
- package/dist/esm/{ethers-5oa3ZKLD.mjs → ethers-BozrzoVi.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/{getErc20Balance-sCX8nL1s.mjs → getErc20Balance-NThD2gHO.mjs} +1 -1
- package/dist/esm/{getErc20TokenInfo-CwiO-mOs.mjs → getErc20TokenInfo-BtdscGyJ.mjs} +1 -1
- package/dist/esm/index-CuKtz_xL.mjs +12 -0
- package/dist/esm/index-DQp_5KKJ.mjs +174 -0
- package/dist/esm/index-Ds8yBPhi.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/privy-context-DICqtyyT.mjs +1 -0
- package/dist/esm/{shared-Bw0pXSOO.mjs → shared-zCv-_9Pa.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs → shouldProceedtoEmbeddedWalletCreationFlow-DLpCU-0h.mjs} +1 -1
- package/dist/esm/smart-wallets-B8GvSECb.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{styles-D5Jf27-u.mjs → styles-pSKfqjN3.mjs} +15 -15
- package/dist/esm/{to-ui-error-DnDY_33E.mjs → to-ui-error-KRq5_d4z.mjs} +2 -2
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/use-export-wallet-D1P_g8O0.mjs +1 -0
- package/dist/esm/use-export-wallet-DVyBljMT.mjs +1 -0
- package/dist/esm/{useActiveWallet-CwS7ik68.mjs → useActiveWallet-DMrO7evY.mjs} +1 -1
- package/dist/esm/useGetTokenPrice-N5ZX6Yun.mjs +1 -0
- package/dist/esm/{useI18n-bIQlZhkW.mjs → useI18n-BiiKgmqw.mjs} +1 -1
- package/dist/esm/usePrivy-DDB15S8o.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-C2WlA-Ah.mjs → useSolanaRpcClient-B--BKNG3.mjs} +1 -1
- package/dist/esm/{useWalletBalance-DopZXXwh.mjs → useWalletBalance-C0WFIwSX.mjs} +1 -1
- package/dist/esm/useWallets-CJvLEQqE.mjs +1 -0
- package/dist/esm/useWallets-CS_W9ciB.mjs +1 -0
- package/package.json +5 -5
- package/dist/cjs/AccountNotFoundScreen-Bqh-CYrp.js +0 -1
- package/dist/cjs/AffirmativeConsentScreen-uogZ44HQ.js +0 -6
- package/dist/cjs/AllowlistRejectionScreen-3OKwgh23.js +0 -1
- package/dist/cjs/AuthenticateWithWalletScreen-DXy5TnZj.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-DR1RiU-S.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-DgQ9z_ck.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Bah7kXAV.js +0 -103
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-HSwPZmzZ.js +0 -2
- package/dist/cjs/CaptchaScreen-BLoD3u63.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-CoSS2KfY.js +0 -16
- package/dist/cjs/ConnectEmailForm-BjXzo_T8.js +0 -3
- package/dist/cjs/ConnectLedgerScreen-Brfd_c8H.js +0 -9
- package/dist/cjs/ConnectOnlyLandingScreen-C41qgoJf.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DPsh3aXI.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dpv9J_eC.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-DfKCyYnE.js +0 -7
- package/dist/cjs/CrossAppAuthScreen-CAmbPQb0.js +0 -1
- package/dist/cjs/DelegatedActionsConsentScreen-DOvRMKf-.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-5ecaxQ0D.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-B31DzW7n.js +0 -1
- package/dist/cjs/EmbeddedWalletCreatedScreen-BXEozrA_.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-DSrn-F5R.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DGlv7LlS.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-Byr5dLg5.js +0 -1
- package/dist/cjs/ErrorScreen-DJwJwrGn.js +0 -4
- package/dist/cjs/FarcasterSignerStatusScreen--CVrZRE9.js +0 -29
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-3Fn4CnSA.js +0 -2
- package/dist/cjs/FundWalletMethodHeader-D2fapeXN.js +0 -1
- package/dist/cjs/FundWithBankDepositScreen-DUQAuyf5.js +0 -176
- package/dist/cjs/FundingEditAmountScreen-B3wEw9xm.js +0 -1
- package/dist/cjs/FundingMethodSelectionScreen-ChQNeyi6.js +0 -1
- package/dist/cjs/InAppBrowserLoginNotPossible-XFkxHwKR.js +0 -1
- package/dist/cjs/InstallWalletScreen-Cp3ZRRYf.js +0 -1
- package/dist/cjs/LandingScreen-DwFs0lRf.js +0 -1
- package/dist/cjs/LinkEmailScreen-_sfK6ECC.js +0 -1
- package/dist/cjs/LinkPhoneScreen-BjMfF3Kz.js +0 -1
- package/dist/cjs/LoginFailedScreen-BUnuwN-5.js +0 -1
- package/dist/cjs/ManualTransferScreen-D2hHGf6p.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-VFaXkogp.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-CVBdW4Cw.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-DxkzCr5s.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-AFZc7liT.js +0 -1
- package/dist/cjs/MoonpayStatusScreen-C66Eq4G4.js +0 -16
- package/dist/cjs/OAuthStatusScreen-NKl6SLvR.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-D9VfPofR.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-CBC-60D2.js +0 -3
- package/dist/cjs/PasswordRecoveryScreen-BSUhAJ63.js +0 -20
- package/dist/cjs/RecoveryOAuthStatusScreen-y2Z3cphT.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-CoDYHaJk.js +0 -1
- package/dist/cjs/SetAutomaticRecoveryScreen-BLiDEmlE.js +0 -14
- package/dist/cjs/TelegramAuthScreen-BGB40HSe.js +0 -1
- package/dist/cjs/UpdateEmailScreen-Bgn5JxGJ.js +0 -1
- package/dist/cjs/UpdatePhoneScreen-DPAxfLv5.js +0 -1
- package/dist/cjs/UserLimitReachedScreen-BG8gj4ah.js +0 -1
- package/dist/cjs/WalletInterstitialScreen-CBH05HpE.js +0 -1
- package/dist/cjs/get-is-unified-wallet-DitrQ4hx.js +0 -1
- package/dist/cjs/index-CCY3tkwt.js +0 -1
- package/dist/cjs/smart-wallets-BtILJe_K.js +0 -1
- package/dist/cjs/use-export-wallet-C6DaLOxp.js +0 -1
- package/dist/cjs/use-export-wallet-eDTOzHRt.js +0 -1
- package/dist/cjs/usePrivy-CHcu9hX8.js +0 -1
- package/dist/cjs/useWallets-CbvzYOqg.js +0 -1
- package/dist/cjs/useWallets-Cy6axcvW.js +0 -1
- package/dist/esm/AccountNotFoundScreen-BSYd-8_2.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-C_uGmdSa.mjs +0 -6
- package/dist/esm/AllowlistRejectionScreen-DBdNYwS-.mjs +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-D-Aw0iYo.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-BMr5CXgX.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-aOEMTW-b.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-CjPJ7IMM.mjs +0 -103
- package/dist/esm/AwaitingSolToEvmBridgingScreen-xrFngED1.mjs +0 -2
- package/dist/esm/CaptchaScreen-BOKElE1r.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-CTV5uUn3.mjs +0 -16
- package/dist/esm/ConnectEmailForm-Dp85JvZj.mjs +0 -3
- package/dist/esm/ConnectLedgerScreen-rxzesP5N.mjs +0 -9
- package/dist/esm/ConnectOnlyLandingScreen-CmImF7oZ.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-Bo90w6P9.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-Dc2VQF-B.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-C_fxSXJ2.mjs +0 -7
- package/dist/esm/CrossAppAuthScreen-DU0FD2ep.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-Dr-DeIXC.mjs +0 -1
- package/dist/esm/DelegatedActionsRevokeScreen-kXOJxXu-.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-tFedaOj3.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-DCx4NdAp.mjs +0 -1
- package/dist/esm/EmbeddedWalletKeyExportScreen-CVflSsvz.mjs +0 -40
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-vSzXa62f.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-B4szV9Hg.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BOBLnE_O.mjs +0 -1
- package/dist/esm/ErrorScreen-BGE6wldq.mjs +0 -4
- package/dist/esm/FarcasterSignerStatusScreen-C-crikPv.mjs +0 -28
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-BX4gYmzv.mjs +0 -1
- package/dist/esm/FundWalletMethodHeader-CdXWChwL.mjs +0 -1
- package/dist/esm/FundWithBankDepositScreen-HyqTUpLq.mjs +0 -176
- package/dist/esm/FundingEditAmountScreen--ffFSUmf.mjs +0 -1
- package/dist/esm/FundingMethodSelectionScreen-Djr0jY03.mjs +0 -1
- package/dist/esm/InAppBrowserLoginNotPossible-D6wMCuzD.mjs +0 -1
- package/dist/esm/InstallWalletScreen-B6VSXUWR.mjs +0 -1
- package/dist/esm/LandingScreen-BV0xq-oc.mjs +0 -1
- package/dist/esm/LinkEmailScreen-CtMuCZvp.mjs +0 -1
- package/dist/esm/LinkPhoneScreen-2nnXZB2B.mjs +0 -1
- package/dist/esm/LoginFailedScreen-hHvIsH81.mjs +0 -1
- package/dist/esm/ManualTransferScreen-C0xJ3si8.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-CznUpkq5.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-DUmOZHGX.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-DeoSfYAS.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-JJ1crW_8.mjs +0 -1
- package/dist/esm/MoonpayStatusScreen-BIzQZK9f.mjs +0 -16
- package/dist/esm/OAuthStatusScreen-DhmaZBTY.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-BmiJnukl.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-BStwA1_J.mjs +0 -3
- package/dist/esm/PasswordRecoveryScreen-DyBDQADG.mjs +0 -20
- package/dist/esm/RecoveryOAuthStatusScreen-BfcxgkUL.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-CBfvjxht.mjs +0 -1
- package/dist/esm/SignRequestScreen-CxAuntSd.mjs +0 -26
- package/dist/esm/TelegramAuthScreen-BRDG8b6x.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-C5lQJUiA.mjs +0 -1
- package/dist/esm/UpdatePhoneScreen-BwkzWVHl.mjs +0 -1
- package/dist/esm/UserLimitReachedScreen-ComDV9kj.mjs +0 -1
- package/dist/esm/WalletInterstitialScreen-riBB51NH.mjs +0 -1
- package/dist/esm/get-is-unified-wallet-CQc-E5dS.mjs +0 -1
- package/dist/esm/index-B5B9f4U9.mjs +0 -12
- package/dist/esm/index-Bvw5OxHl.mjs +0 -174
- package/dist/esm/index-yxF2V6XY.mjs +0 -1
- package/dist/esm/smart-wallets-Dl42tBUP.mjs +0 -1
- package/dist/esm/use-export-wallet-Bd5Sg5V-.mjs +0 -1
- package/dist/esm/use-export-wallet-NF9h_lS_.mjs +0 -1
- package/dist/esm/useGetTokenPrice-oI6b3gPZ.mjs +0 -1
- package/dist/esm/usePrivy-DAnfSvB5.mjs +0 -1
- package/dist/esm/useWallets-2_uCkhA8.mjs +0 -1
- package/dist/esm/useWallets-DpbBw4Vl.mjs +0 -1
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useRef as i,useCallback as s,useMemo as n}from"react";import{trigger as a}from"@privy-io/popup";import{u as l,a as c}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{k as u}from"./use-export-wallet-Bd5Sg5V-.mjs";import{isMobile as d}from"react-device-detect";import{styled as m}from"styled-components";import{a as p}from"./CopyableText-BCytXyJL.mjs";import{J as f,K as y}from"./index-Bvw5OxHl.mjs";import{S as h}from"./ScreenLayout-BdRrZJd_.mjs";import{XCircle as g,Hourglass as v,UserCheck as w,Check as b,ChevronDown as C}from"lucide-react";import{I as k}from"./InfoBanner-DkQEPd77.mjs";import"@privy-io/are-addresses-equal";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"uuid";import"jose";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"@heroicons/react/24/outline/InformationCircleIcon";const x=async({operation:e,until:t,delay:r,interval:o,attempts:i,signal:s})=>{let n,a=0;for(;a<i;){if(s?.aborted)return{status:"aborted",result:n,attempts:a};a++;try{if(n=await e(),t(n))return{status:"success",result:n,attempts:a};a<i&&await u(o)}catch(e){a<i&&await u(o)}}return{status:"max_attempts",result:n,attempts:a}},j=({data:r,onClose:o})=>/*#__PURE__*/e(h,{showClose:!0,onClose:o,title:"Initiate bank transfer",subtitle:"Use the details below to complete a bank transfer from your bank.",primaryCta:{label:"Done",onClick:o},watermark:!1,footerText:"Exchange rates and fees are set when you authorize and determine the amount you receive. You'll see the applicable rates and fees for your transaction separately",children:/*#__PURE__*/e(A,{children:(f[r.deposit_instructions.asset]||[]).map((([o,i],s)=>{let n=r.deposit_instructions[o];if(!n)return null;let a="asset"===o?n.toUpperCase():n,l=a.length>100?`${a.slice(0,9)}...${a.slice(-9)}`:a;/*#__PURE__*/return t(S,{children:[/*#__PURE__*/e(U,{children:i}),/*#__PURE__*/e(p,{value:a,includeChildren:d,children:/*#__PURE__*/e(E,{children:l})})]},s)}))})});let A=m.ol`
|
|
2
|
-
border-color: var(--privy-color-border-default);
|
|
3
|
-
border-width: 1px;
|
|
4
|
-
border-radius: var(--privy-border-radius-mdlg);
|
|
5
|
-
border-style: solid;
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
|
|
9
|
-
&& {
|
|
10
|
-
padding: 0 1rem;
|
|
11
|
-
}
|
|
12
|
-
`,S=m.li`
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
align-items: center;
|
|
16
|
-
padding: 1rem 0;
|
|
17
|
-
|
|
18
|
-
&:not(:first-of-type) {
|
|
19
|
-
border-top: 1px solid var(--privy-color-border-default);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
& > {
|
|
23
|
-
:nth-child(1) {
|
|
24
|
-
flex-basis: 30%;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:nth-child(2) {
|
|
28
|
-
flex-basis: 60%;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
`,U=m.span`
|
|
32
|
-
color: var(--privy-color-foreground);
|
|
33
|
-
font-kerning: none;
|
|
34
|
-
font-variant-numeric: lining-nums proportional-nums;
|
|
35
|
-
font-feature-settings: 'calt' off;
|
|
36
|
-
|
|
37
|
-
/* text-xs/font-regular */
|
|
38
|
-
font-size: 0.75rem;
|
|
39
|
-
font-style: normal;
|
|
40
|
-
font-weight: 400;
|
|
41
|
-
line-height: 1.125rem; /* 150% */
|
|
42
|
-
|
|
43
|
-
text-align: left;
|
|
44
|
-
flex-shrink: 0;
|
|
45
|
-
`,E=m.span`
|
|
46
|
-
color: var(--privy-color-foreground);
|
|
47
|
-
font-kerning: none;
|
|
48
|
-
font-feature-settings: 'calt' off;
|
|
49
|
-
|
|
50
|
-
/* text-sm/font-medium */
|
|
51
|
-
font-size: 0.875rem;
|
|
52
|
-
font-style: normal;
|
|
53
|
-
font-weight: 500;
|
|
54
|
-
line-height: 1.375rem; /* 157.143% */
|
|
55
|
-
|
|
56
|
-
text-align: right;
|
|
57
|
-
word-break: break-all;
|
|
58
|
-
`;const L=({onClose:t})=>/*#__PURE__*/e(h,{showClose:!0,onClose:t,icon:g,iconVariant:"error",title:"Something went wrong",subtitle:"We couldn't complete account setup. This isn't caused by anything you did.",primaryCta:{label:"Close",onClick:t},watermark:!0}),I=({onClose:t,reason:r})=>{let o=r?r.charAt(0).toLowerCase()+r.slice(1):void 0;/*#__PURE__*/return e(h,{showClose:!0,onClose:t,icon:g,iconVariant:"error",title:"Identity verification failed",subtitle:o?`We can't complete identity verification because ${o}. Please try again or contact support for assistance.`:"We couldn't verify your identity. Please try again or contact support for assistance.",primaryCta:{label:"Close",onClick:t},watermark:!0})},T=({onClose:r,email:o})=>/*#__PURE__*/e(h,{showClose:!0,onClose:r,icon:v,title:"Identity verification in progress",subtitle:"We're waiting for Persona to approve your identity verification. This usually takes a few minutes, but may take up to 24 hours.",primaryCta:{label:"Done",onClick:r},watermark:!0,children:/*#__PURE__*/t(k,{theme:"light",children:["You'll receive an email at ",o," once approved with instructions for completing your deposit."]})}),z=({onClose:o,onAcceptTerms:i,isLoading:s})=>/*#__PURE__*/e(h,{showClose:!0,onClose:o,icon:w,title:"Verify your identity to continue",subtitle:"Finish verification with Persona — it takes just a few minutes and requires a government ID.",helpText:/*#__PURE__*/t(r,{children:['This app uses Bridge to securely connect accounts and move funds. By clicking "Accept," you agree to Bridge\'s'," ",/*#__PURE__*/e("a",{href:"https://www.bridge.xyz/legal",target:"_blank",rel:"noopener noreferrer",children:"Terms of Service"})," ","and"," ",/*#__PURE__*/e("a",{href:"https://www.bridge.xyz/legal/row-privacy-policy/bridge-building-limited",target:"_blank",rel:"noopener noreferrer",children:"Privacy Policy"}),"."]}),primaryCta:{label:"Accept and continue",onClick:i,loading:s},watermark:!0}),_=({onClose:t})=>/*#__PURE__*/e(h,{showClose:!0,onClose:t,icon:b,iconVariant:"success",title:"Identity verified successfully",subtitle:"We've successfully verified your identity. Now initiate a bank transfer to view instructions.",primaryCta:{label:"Initiate bank transfer",onClick:()=>{},loading:!0},watermark:!0}),B=({opts:r,onClose:o,onEditSourceAsset:i,onSelectAmount:s,isLoading:n})=>{let{icon:a}=y[r.source.selectedAsset];/*#__PURE__*/return t(h,{showClose:!0,onClose:o,headerTitle:`Buy ${r.destination.asset.toLocaleUpperCase()}`,primaryCta:{label:"Continue",onClick:s,loading:n},watermark:!0,children:[/*#__PURE__*/e(V,{currency:r.source.selectedAsset,inputMode:"decimal",autoFocus:!0}),/*#__PURE__*/t(K,{onClick:i,children:[/*#__PURE__*/e(W,{children:a}),/*#__PURE__*/e($,{children:r.source.selectedAsset.toLocaleUpperCase()}),/*#__PURE__*/e(P,{children:/*#__PURE__*/e(C,{})})]})]})};let K=m.button`
|
|
59
|
-
display: flex;
|
|
60
|
-
align-items: center;
|
|
61
|
-
justify-content: space-between;
|
|
62
|
-
width: auto;
|
|
63
|
-
gap: 0.5rem;
|
|
64
|
-
border: 1px solid var(--privy-color-border-default);
|
|
65
|
-
border-radius: var(--privy-border-radius-full);
|
|
66
|
-
|
|
67
|
-
&& {
|
|
68
|
-
margin: auto;
|
|
69
|
-
padding: 0.5rem 1rem;
|
|
70
|
-
}
|
|
71
|
-
`,W=m.div`
|
|
72
|
-
svg {
|
|
73
|
-
width: 1rem;
|
|
74
|
-
height: 1rem;
|
|
75
|
-
border-radius: var(--privy-border-radius-full);
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
}
|
|
78
|
-
`,$=m.span`
|
|
79
|
-
color: var(--privy-color-foreground);
|
|
80
|
-
font-kerning: none;
|
|
81
|
-
font-feature-settings: 'calt' off;
|
|
82
|
-
|
|
83
|
-
/* text-sm/font-medium */
|
|
84
|
-
font-size: 0.875rem;
|
|
85
|
-
font-style: normal;
|
|
86
|
-
font-weight: 500;
|
|
87
|
-
line-height: 1.375rem; /* 157.143% */
|
|
88
|
-
`,P=m.div`
|
|
89
|
-
color: var(--privy-color-foreground);
|
|
90
|
-
|
|
91
|
-
svg {
|
|
92
|
-
width: 1.25rem;
|
|
93
|
-
height: 1.25rem;
|
|
94
|
-
}
|
|
95
|
-
`,F={usd:"$",eur:"€",gbp:"£",mxn:"$",brl:"R$"},D=m.span`
|
|
96
|
-
background-color: var(--privy-color-background);
|
|
97
|
-
width: 100%;
|
|
98
|
-
text-align: center;
|
|
99
|
-
border: none;
|
|
100
|
-
|
|
101
|
-
font-kerning: none;
|
|
102
|
-
font-feature-settings: 'calt' off;
|
|
103
|
-
|
|
104
|
-
display: flex;
|
|
105
|
-
justify-content: center;
|
|
106
|
-
align-items: flex-start;
|
|
107
|
-
cursor: pointer;
|
|
108
|
-
|
|
109
|
-
&:focus {
|
|
110
|
-
outline: none !important;
|
|
111
|
-
border: none !important;
|
|
112
|
-
box-shadow: none !important;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
&& {
|
|
116
|
-
color: var(--privy-color-foreground);
|
|
117
|
-
/* text-6xl/font-semiBold */
|
|
118
|
-
font-size: 3.75rem;
|
|
119
|
-
font-style: normal;
|
|
120
|
-
font-weight: 600;
|
|
121
|
-
line-height: 5.375rem; /* 143.333% */
|
|
122
|
-
}
|
|
123
|
-
`,M=m.span`
|
|
124
|
-
color: var(--privy-color-foreground);
|
|
125
|
-
font-kerning: none;
|
|
126
|
-
font-feature-settings: 'calt' off;
|
|
127
|
-
|
|
128
|
-
font-size: 1rem;
|
|
129
|
-
font-style: normal;
|
|
130
|
-
font-weight: 600;
|
|
131
|
-
line-height: 1.5rem; /* 150% */
|
|
132
|
-
|
|
133
|
-
margin-top: 0.75rem;
|
|
134
|
-
`,V=({currency:a="usd",value:l,onChange:c,inputMode:u="decimal",autoFocus:d})=>{let[m,p]=o("0"),f=i(null),y=l??m,h=F[a.toLowerCase()]||"$",g=s((e=>{let t=e.target.value,r=(t=t.replace(/[^\d.]/g,"")).split(".");r.length>2&&(t=r[0]+"."+r.slice(1).join("")),2===r.length&&r[1].length>2&&(t=`${r[0]}.${r[1].slice(0,2)}`),t.length>1&&"0"===t[0]&&"."!==t[1]&&(t=t.slice(1)),(""===t||"."===t)&&(t="0"),c?c(t):p(t)}),[c]),v=s((e=>{-1===[46,8,9,27,13,110,190].indexOf(e.keyCode)&&(65!==e.keyCode||!0!==e.ctrlKey)&&(67!==e.keyCode||!0!==e.ctrlKey)&&(86!==e.keyCode||!0!==e.ctrlKey)&&(88!==e.keyCode||!0!==e.ctrlKey)&&(!(e.keyCode>=35)||!(e.keyCode<=39))&&(e.shiftKey||e.keyCode<48||e.keyCode>57)&&(e.keyCode<96||e.keyCode>105)&&e.preventDefault()}),[]),w=n((()=>(y.includes("."),y)),[y]);/*#__PURE__*/return e(r,{children:/*#__PURE__*/t(D,{onClick:()=>f.current?.focus(),children:[/*#__PURE__*/e(M,{children:h}),w,/*#__PURE__*/e("input",{ref:f,type:"text",inputMode:u,value:w,onChange:g,onKeyDown:v,autoFocus:d,placeholder:"0",style:{width:1,height:"1rem",opacity:0,alignSelf:"center",fontSize:"1rem"}}),/*#__PURE__*/e(M,{style:{opacity:0},children:h})]})})};const R=({opts:r,isLoading:o,onSelectSource:i})=>/*#__PURE__*/e(h,{showClose:!1,showBack:!0,onBack:()=>i(r.source.selectedAsset),title:"Select currency",children:/*#__PURE__*/e(Y,{children:r.source.assets.map((r=>{let{icon:s,name:n}=y[r];/*#__PURE__*/return e(q,{onClick:()=>i(r),disabled:o,children:/*#__PURE__*/t(O,{children:[/*#__PURE__*/e(H,{children:s}),/*#__PURE__*/t(J,{children:[/*#__PURE__*/e(N,{children:n}),/*#__PURE__*/e(Q,{children:r.toLocaleUpperCase()})]})]})},r)}))})});let Y=m.div`
|
|
135
|
-
display: flex;
|
|
136
|
-
flex-direction: column;
|
|
137
|
-
gap: 0.75rem;
|
|
138
|
-
width: 100%;
|
|
139
|
-
`,q=m.button`
|
|
140
|
-
border-color: var(--privy-color-border-default);
|
|
141
|
-
border-width: 1px;
|
|
142
|
-
border-radius: var(--privy-border-radius-mdlg);
|
|
143
|
-
border-style: solid;
|
|
144
|
-
display: flex;
|
|
145
|
-
|
|
146
|
-
&& {
|
|
147
|
-
padding: 0.75rem 1rem;
|
|
148
|
-
}
|
|
149
|
-
`,O=m.div`
|
|
150
|
-
display: flex;
|
|
151
|
-
align-items: center;
|
|
152
|
-
gap: 1rem;
|
|
153
|
-
width: 100%;
|
|
154
|
-
`,H=m.div`
|
|
155
|
-
svg {
|
|
156
|
-
width: 2.25rem;
|
|
157
|
-
height: 2.25rem;
|
|
158
|
-
border-radius: var(--privy-border-radius-full);
|
|
159
|
-
overflow: hidden;
|
|
160
|
-
}
|
|
161
|
-
`,J=m.div`
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
164
|
-
align-items: flex-start;
|
|
165
|
-
gap: 0.125rem;
|
|
166
|
-
`,N=m.span`
|
|
167
|
-
color: var(--privy-color-foreground);
|
|
168
|
-
font-size: 0.875rem;
|
|
169
|
-
font-weight: 600;
|
|
170
|
-
line-height: 1.25rem;
|
|
171
|
-
`,Q=m.span`
|
|
172
|
-
color: var(--privy-color-foreground-3);
|
|
173
|
-
font-size: 0.75rem;
|
|
174
|
-
font-weight: 400;
|
|
175
|
-
line-height: 1.125rem;
|
|
176
|
-
`;const X=({onClose:t,onAcceptTerms:r,onSelectAmount:o,onSelectSource:i,onEditSourceAsset:s,opts:n,state:a,email:l,isLoading:c})=>"select-amount"===a.status?/*#__PURE__*/e(B,{onClose:t,onSelectAmount:o,onEditSourceAsset:s,opts:n,isLoading:c}):"select-source-asset"===a.status?/*#__PURE__*/e(R,{onSelectSource:i,opts:n,isLoading:c}):"kyc-prompt"===a.status?/*#__PURE__*/e(z,{onClose:t,onAcceptTerms:r,opts:n,isLoading:c}):"kyc-incomplete"===a.status?/*#__PURE__*/e(T,{onClose:t,email:l}):"kyc-success"===a.status?/*#__PURE__*/e(_,{onClose:t}):"kyc-error"===a.status?/*#__PURE__*/e(I,{onClose:t,reason:a.reason}):"account-details"===a.status?/*#__PURE__*/e(j,{onClose:t,data:a.data}):"create-customer-error"===a.status||"get-customer-error"===a.status?/*#__PURE__*/e(L,{onClose:t}):null,G={component:()=>{let{user:t}=l(),r=c().data;if(!r?.FundWithBankDepositScreen)throw Error("Missing data");let{onSuccess:n,onFailure:u,opts:d,createOrUpdateCustomer:m,getCustomer:p,getOrCreateVirtualAccount:f}=r.FundWithBankDepositScreen,[y,h]=o(d),[g,v]=o({status:"select-amount"}),[w,b]=o(null),[C,k]=o(!1),j=i(null),A=s((async()=>{let e;k(!0),b(null);try{e=await p({kycRedirectUrl:window.location.origin})}catch(e){if(!e||"object"!=typeof e||!("status"in e)||404!==e.status)return v({status:"get-customer-error"}),b(e),void k(!1)}if(!e)try{e=await m({hasAcceptedTerms:!1,kycRedirectUrl:window.location.origin})}catch(e){return v({status:"create-customer-error"}),b(e),void k(!1)}if(!e)return v({status:"create-customer-error"}),b(Error("Unable to create customer")),void k(!1);if("not_started"===e.status&&e.kyc_url)return v({status:"kyc-prompt",kycUrl:e.kyc_url}),void k(!1);if("not_started"===e.status)return v({status:"get-customer-error"}),b(Error("Unexpected user state")),void k(!1);if("rejected"===e.status)return v({status:"kyc-error",reason:e.rejection_reasons?.[0]?.reason}),b(Error("User KYC rejected.")),void k(!1);if("incomplete"===e.status)return v({status:"kyc-incomplete"}),void k(!1);if("active"!==e.status)return v({status:"get-customer-error"}),b(Error("Unexpected user state")),void k(!1);e.status;try{let e=await f({destination:y.destination,provider:y.provider,source:{asset:y.source.selectedAsset}});v({status:"account-details",data:e})}catch(e){return v({status:"create-customer-error"}),b(e),void k(!1)}}),[y]),S=s((async()=>{if(b(null),k(!0),"kyc-prompt"!==g.status)return b(Error("Unexpected state")),void k(!1);let e=a({location:g.kycUrl});if(await m({hasAcceptedTerms:!0}),!e)return b(Error("Unable to begin kyc flow.")),k(!1),void v({status:"create-customer-error"});j.current=new AbortController;let t=await x({operation:async()=>({done:e.location.origin===window.location.origin,closed:e.closed}),until:({done:e,closed:t})=>e||t,delay:0,interval:100,attempts:18e3,signal:j.current.signal});if("aborted"===t.status)return void e.close();if("success"===t.status&&t.result.closed)return void k(!1);"success"===t.status&&t.result.done&&e.close();let r=await x({operation:()=>p({}),until:e=>"active"===e.status||"rejected"===e.status,delay:0,interval:2e3,attempts:60,signal:j.current.signal});if("aborted"!==r.status){if("max_attempts"===r.status)return v({status:"kyc-incomplete"}),void k(!1);if(r.status,"rejected"===r.result.status)return v({status:"kyc-error",reason:r.result.rejection_reasons?.[0]?.reason}),b(Error("User KYC rejected.")),void k(!1);if("active"!==r.result.status)return v({status:"kyc-incomplete"}),void k(!1);e.closed||e.close(),r.result.status;try{v({status:"kyc-success"});let e=await f({destination:y.destination,provider:y.provider,source:{asset:y.source.selectedAsset}});v({status:"account-details",data:e})}catch(e){v({status:"create-customer-error"}),b(e)}finally{k(!1)}}}),[v,b,k,m,f,g,y,j]),U=s((e=>{v({status:"select-amount"}),h({...y,source:{...y.source,selectedAsset:e}})}),[v,h]),E=s((()=>{v({status:"select-source-asset"})}),[v]);/*#__PURE__*/return e(X,{onClose:s((async()=>{j.current?.abort(),w?u(w):await n()}),[w,j]),opts:y,state:g,isLoading:C,email:t.email.address,onAcceptTerms:S,onSelectAmount:A,onSelectSource:U,onEditSourceAsset:E})}};export{G as FundWithBankDepositScreen,G as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-DfHxv9fE.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as a}from"./FundWalletMethodHeader-CdXWChwL.mjs";import{N as m}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as p}from"./useGetTokenPrice-oI6b3gPZ.mjs";import{c as d}from"./ethers-5oa3ZKLD.mjs";import{F as u,a as h,h as j,c as f,d as v}from"./styles-D5Jf27-u.mjs";import"styled-components";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.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"@privy-io/are-addresses-equal";import"./useGetSolPrice-DwwjjGbd.mjs";import"./LinkPasskeyScreen-CTYGeo1r.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-BdRrZJd_.mjs";import"./Screen-CDEd4p2a.mjs";const y={component:()=>{let{data:y,setModalData:C}=l(),g=y?.funding,x="solana"===g.chainType,k=r(null),{tokenPrice:S}=p(x?"solana":g.chain.id),T=x?void 0:g,D=!(!T?.erc20Address||T?.erc20ContractInfo),F=x?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",A=parseFloat(g.amount),I=!isNaN(A)&&A>0,L=S?d(g.amount,S):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(a,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:D?/*#__PURE__*/o(m,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/o(j,{ref:k,value:g.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&C({...y,funding:{...g,amount:e},solanaFundingData:y?.solanaFundingData?{...y.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:F})]}),!T?.erc20Address&&!(x&&g.isUSDC)&&/*#__PURE__*/o(v,{children:L&&I?`${L} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!I,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{y as FundingAmountEditScreen,y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-DfHxv9fE.mjs";import{t as h}from"./FundWalletMethodHeader-CdXWChwL.mjs";import{E as p}from"./ErrorBanner-CQERa7bL.mjs";import{I as m}from"./InfoBanner-DkQEPd77.mjs";import{u}from"./context-Cw2-86-G.mjs";import{j as f,z as g,A as y}from"./useActiveWallet-CwS7ik68.mjs";import{a as v,u as C}from"./internal-context-Z-fyxadS.mjs";import{a as w}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as F}from"./useWallets-2_uCkhA8.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-CwiO-mOs.mjs";import{monadMainnet as S,avalanche as W,arbitrum as x,polygon as I,optimism as j,base as T,mainnet as D,toCoinbaseAssetId as k,getCoinbaseOnRampUrl as A,chainToMoonpayCurrency as z,isSupportedChainIdForMoonpay as L,isSupportedChainIdForCoinbaseOnramp as E}from"@privy-io/js-sdk-core";import{trigger as O}from"@privy-io/popup";import{a as U}from"./index-yxF2V6XY.mjs";import{e as _,I as H,f as P,g as B}from"./styles-D5Jf27-u.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-CTYGeo1r.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-BdRrZJd_.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const R=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),q=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function N(e){let n=Q[e];if(!n)throw new v(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let Q={[D.id]:"ethereum",[T.id]:"base",[j.id]:"optimism",[I.id]:"polygon",[x.id]:"arbitrum",[W.id]:"avacchain",[S.id]:"monad"};const $=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=O();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?N(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?k(n.chain.id,"native-currency"):"SOL",h=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:p}=A({appId:e.getAppId(),input:h,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=p.toString();let m={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(m.usingDefaultFundingMethod=!1),t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:h.partner_user_id,popup:d}})}),5e3),r()})),K=async(e,n,t,a,i,o,r,c)=>{let d=O();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?z(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:h}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:U(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),d.location=l;let p={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:p,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:h},funding:p,solanaFundingData:r?.solanaFundingData})}),8e3)};let X=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const G=()=>X("https://apple.com/apple-pay"),J=()=>X("https://google.com/pay"),Y={component:()=>{let{wallets:r}=F(),{connectors:v}=C(),S=v.filter(f).flatMap((e=>e.wallets)),{navigate:W,data:x,setModalData:I}=w(),{client:j}=C(),T=u(),D=x?.funding,k=V(G),A=V(J),z="solana"===D.chainType,O=z?void 0:D,U=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",h=!!d||l&&L(Number(t.chain.id),l),p=!!d||l&&E(Number(t.chain.id),l),m=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&p&&m.push((()=>$(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&h&&l&&m.push((()=>K(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&p&&(r=()=>$(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:m,onFundWithExchange:r,onFundWithWallet:c}})(T,j,D,I,W,x)),[T,j,D,x,I,W]),N=z?S.find((({address:e})=>e===D.address)):r.find((({address:e})=>s(e)===s(D.address))),Q=g(N?.walletClientType||"unknown"),X=Q?.name||"wallet",Y=N&&"privy"!==N.walletClientType?X:T.name,Z=d((()=>D.uiConfig?.landing?.title?D.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[D.uiConfig?.landing?.title,Y]);c((()=>{if(D?.defaultFundingMethod&&D.usingDefaultFundingMethod)switch(I({funding:{...D,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),D?.defaultFundingMethod){case"card":U.onFundWithCard[0]&&U.onFundWithCard[0]();break;case"exchange":U.onFundWithExchange&&U.onFundWithExchange();break;case"wallet":U.onFundWithWallet&&U.onFundWithWallet();break;case"manual":W("ManualTransferScreen")}}),[]),c((()=>{O?.erc20Address&&!O.erc20ContractInfo&&b({address:O.erc20Address,chain:O.chain,rpcConfig:T.rpcConfig,privyAppId:T.id}).then((e=>{I({...x,funding:{...O,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[O?.erc20Address,O?.chain]);let ee=!(!O?.erc20Address||O?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(h,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(_,{children:[D.errorMessage&&/*#__PURE__*/e(p,{theme:T.appearance.palette.colorScheme,children:D.errorMessage}),U.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:U.onFundWithCard[0],children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",k?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):A?/*#__PURE__*/e(q,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),U.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:U.onFundWithExchange,children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),U.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:U.onFundWithWallet,children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>W("ManualTransferScreen"),children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),D?.showAlternateFundingMethod&&U.onFundWithCard?.[1]&&/*#__PURE__*/e(m,{theme:T.appearance.palette.colorScheme,children:/*#__PURE__*/n(P,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(B,{onClick:U.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{Y as FundingMethodSelectionScreen,Y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{ExternalLink as t}from"lucide-react";import{u as e}from"./internal-context-Z-fyxadS.mjs";import{S as r}from"./ScreenLayout-BdRrZJd_.mjs";import"ofetch";import"react";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"./get-is-unified-wallet-CQc-E5dS.mjs";import"@privy-io/are-addresses-equal";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/o(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:t,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:t}=e();/*#__PURE__*/return o(i,{onClose:()=>t()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{L as o}from"./Link-DJ5gq9Di.mjs";import{T as i,a}from"./TodoList-CgrU7uwu.mjs";import{a as l}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as n}from"./ScreenLayout-BdRrZJd_.mjs";import"styled-components";import"lucide-react";import"react";import"@privy-io/are-addresses-equal";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const s=({walletName:l,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${l} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(o,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(a,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(o,{href:s,target:"_blank",children:[l," browser extension"]})]})}),/*#__PURE__*/t(a,{children:"Set up your first wallet"}),/*#__PURE__*/t(a,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:r}=l();if(!r?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:o}=r.installWalletModalData;/*#__PURE__*/return t(s,{walletName:o.name,installLink:o.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{u as r}from"./context-Cw2-86-G.mjs";import{C as o,L as i}from"./CustomLandingScreenView-Co0nHKPw.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-2_uCkhA8.mjs";import"./get-is-unified-wallet-CQc-E5dS.mjs";import"@privy-io/are-addresses-equal";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.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-Bvw5OxHl.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ConnectWalletView-By6eXfKl.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-D4XZQrgi.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-bIQlZhkW.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"./ConnectEmailForm-Dp85JvZj.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-D8SHd_ge.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-Cn_nKCBf.mjs";import"./ScreenLayout-BdRrZJd_.mjs";const e={component:()=>{let e=r();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(o,{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-Dp85JvZj.mjs";import{B as i}from"./Layouts-BlFm53ED.mjs";import{u as e}from"./context-Cw2-86-G.mjs";import{S as m}from"./ScreenLayout-BdRrZJd_.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./index-Bvw5OxHl.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-CQc-E5dS.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"tinycolor2";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(i,{children:/*#__PURE__*/t(r,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-D8SHd_ge.mjs";import{u as i}from"./context-Cw2-86-G.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as a}from"./ScreenLayout-BdRrZJd_.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./ModalHeader-DfHxv9fE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as i}from"./ScreenLayout-BdRrZJd_.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const a=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:a="Try again",secondaryCtaText:n="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:a,onClick:m},secondaryCta:{label:n,onClick:c},watermark:!0}),n={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(a,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{n as LoginFailedScreen,a as LoginFailedScreenView,n 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 s}from"react";import{formatUnits as a}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c,B as d}from"./ModalHeader-DfHxv9fE.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-D4XZQrgi.mjs";import{t as u}from"./FundWalletMethodHeader-CdXWChwL.mjs";import{I as f}from"./InfoBanner-DkQEPd77.mjs";import{S as h}from"./Subtitle-CV-2yKE4.mjs";import{T as v}from"./Title-BnzYV3Is.mjs";import{W as g}from"./WalletInfoCard-D2dCT7_H.mjs";import{u as j}from"./context-Cw2-86-G.mjs";import{j as y}from"./useActiveWallet-CwS7ik68.mjs";import{u as C}from"./internal-context-Z-fyxadS.mjs";import{a as S}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as I}from"./useWalletBalance-DopZXXwh.mjs";import{u as T}from"./useWallets-2_uCkhA8.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{x as b,z as k}from"./index-Bvw5OxHl.mjs";import{g as A}from"./getChainName-DjpPdUSc.mjs";import{g as F}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as D}from"./getErc20Balance-sCX8nL1s.mjs";import{v as x}from"./use-export-wallet-Bd5Sg5V-.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-Cbulz6Wu.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"ofetch";import"@privy-io/are-addresses-equal";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const B={component:()=>{let{wallets:k}=T(),{connectors:B}=C(),$=B.filter(y).flatMap((e=>e.wallets)),{data:E,setModalData:L,navigate:W,lastScreen:P}=S(),{rpcConfig:O,appId:q,createAnalyticsEvent:z,closePrivyModal:R}=C(),H=j(),[N,Q]=o(void 0),[X,Y]=o(!1),G=E?.funding,{reloadBalance:J}=I({rpcConfig:O,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?$.find((({address:e})=>e===G.address)):k.find((({address:e})=>x(e)===x(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:P||"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=H.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)}):b({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);N&&r>N&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?a(r-N,6):a(r-N,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 D({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:O,appId:q});return e}})().then((e=>{N&&e>N&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:a(e-N,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)}),[N]);let _=s((()=>null==N?"":G.isUSDC?n({amount:N,decimals:6}):K?M(N,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:N,decimals:G.erc20ContractInfo.decimals}):m({wei:N})),[N,K,G]),ee="ethereum"===G.chainType?G.chain.name:A(G.chain),re=s((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(v,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=s((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&F(G.chain)?`?spl-token=${F(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:U}),/*#__PURE__*/t(f,{theme:H.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(g,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>R({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let U=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{B as ManualTransferScreen,B 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{M as s,b as a,P as m}from"./ModalHeader-DfHxv9fE.mjs";import{L as l}from"./useActiveWallet-CwS7ik68.mjs";import{u as c}from"./context-Cw2-86-G.mjs";import{u as p,a as u}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-nZPSS3Ux.mjs";import{A as v,C as j,I as k,T as g,S as w,B as C}from"./PinInput-3SLvbnQa.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"tinycolor2";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-BGE6wldq.mjs";import"lucide-react";import"./index-Bvw5OxHl.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./reservoir-0wfhnc0j.mjs";import"./ScreenLayout-BdRrZJd_.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-CTYGeo1r.mjs";import"./TodoList-CgrU7uwu.mjs";import"./CopyToClipboard-DSTf_eKU.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-D4XZQrgi.mjs";import"qrcode";const M={component:()=>{let{user:M,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:S}=u(),A=c(),[E,P]=n(null),[R,T]=n(null),[x,F]=n(null),[L,B]=n(!1),[U,W]=n(!1),[q,O]=n(),$=async()=>{q?z(q):M?await D({user:M}):z(Error("Must be logged in to manage MFA")),setTimeout((()=>{P(null),T(null)}),500)};if(S.current=$,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:z,onSuccess:D,onBack:H,mfaMethods:K,verify:Q,generateTotpSecret:X,enrollTotp:N,unenrollTotp:V,enrollPasskey:Y}=I.mfaEnroll,G=M?.mfaMethods.includes("sms"),J=M?.mfaMethods.includes("totp"),Z=M?.mfaMethods.includes("passkey"),_=!!M?.phone,ee=M?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){P(null),T(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await Y(e);return await D({user:o})}catch(e){O(e)}finally{W(!1),B(!1)}}if(!b||!M||!A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{onClose:$,backFn:H},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(l,{})}),/*#__PURE__*/t(a,{})]});if("sms"===E)return null;if("totp"===E)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(w,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(C,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V();return await D({user:e})}catch(e){O(e)}finally{W(!1),P(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(a,{})]});if("passkey"===E){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:$},"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(w,{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(C,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await Y([]);return await D({user:e})}catch(e){O(e)}finally{W(!1),P(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(a,{})]})}return 0!==K.length||G||J||Z?"sms"===R?null:"totp"===R&&x?/*#__PURE__*/t(h,{onClose:$,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await N(e);return await D({user:o})}catch(e){O(e)}finally{W(!1),P(null)}}(e.mfaCode),error:q,totpInfo:{...x,appName:A?.name||"Privy"}}):"passkey"===R?/*#__PURE__*/t(y,{onReset:oe,onClose:$,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:M.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:_,backFn:H,handleSelectMethod:async function(e){O(void 0);try{await Q()}catch(e){return void O(e)}return"totp"===e?(T(e),F(null),void X().then((({totpSecret:e,totpAuthUrl:o})=>{F({authUrl:o,secret:e})})).catch((()=>{F(null),oe()}))):"passkey"===e&&1===ee.length?await te():void T(e)},isTotpLoading:"totp"===R&&!x,isPasskeyLoading:L,error:q,onClose:$,setRemovingMfaMethod:async function(e){O(void 0);try{await Q()}catch(e){return void O(e)}P(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(s,{onClose:$,backFn:H},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(w,{children:[A?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(C,{children:/*#__PURE__*/t(m,{onClick:$,children:"Close"})}),/*#__PURE__*/t(a,{})]})}};export{M as MfaAuthEnrollmentFlowScreen,M as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as o,useState as r,useEffect as t,useRef as i}from"react";import{u as s}from"./context-Cw2-86-G.mjs";import{u as m,a as n}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{V as a,a as c,b as p,t as l}from"./to-ui-error-DnDY_33E.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@privy-io/are-addresses-equal";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.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-BdRrZJd_.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-oI6b3gPZ.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./index-Bvw5OxHl.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./TransactionDetails-Ce_Cnzo2.mjs";import"./WalletLink-DNraFqEC.mjs";import"./ethers-5oa3ZKLD.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u={component:()=>{let{user:u}=m(),d=s(),h=o((()=>u?.mfaMethods.filter((e=>"passkey"!==e||!d.globalDisablePasskeys))??[]),[u?.mfaMethods,d.globalDisablePasskeys]),{data:f}=n(),[y,j]=r(h[0]),[v,k]=r(!1),[g,w]=r(),[b,C]=r();if(t((()=>{j(h[0])}),[h]),!f?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:M,onSuccess:S,generateOptions:I,verifyTotpCode:P,verifyPasskey:x,verifySmsCode:E,sendSmsCode:A}=f.mfaVerify,F=async e=>{if("passkey"!==e)try{j(e),"sms"===e&&(j(e),await A()),"totp"===e&&j(e)}catch(e){console.error(e)}else try{j(e);let o=await I();if(!o)throw Error("something went wrong");w(o),await x(o),k(!0),C(void 0),S()}catch(e){C(l(e))}},B=async e=>{C(void 0);try{if(!e||!y)return;if("passkey"===y){if(!g)throw Error("Missing passkey challenge");await x(g)}else"sms"===y?await E(e):"totp"===y&&await P(e);C(void 0),k(!0),S()}catch(e){throw l(e).error}},L=()=>{b||!v?M(b?.error??Error("Canceled MFA verification.")):S()},D=i(!1);return t((()=>{!D.current&&y&&(D.current=!0,F(y).finally((()=>{D.current=!1})))}),[open]),u?"passkey"===y?/*#__PURE__*/e(a,{account:u.linkedAccounts.filter((e=>"passkey"===e.type&&e.enrolledInMfa)).sort(((e,o)=>o.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:b?.isBlocking??!1,error:b?.error,onClose:L,onBack:()=>{j(void 0),C(void 0)},handleSubmit:()=>B(g).catch(C)}):"sms"===y||"totp"===y?/*#__PURE__*/e(c,{selectedMethod:y,submitSuccess:v,hasBlockingError:b?.isBlocking??!1,handleSubmitCode:B,onClose:L,onBack:h.length>1?()=>j(void 0):void 0}):/*#__PURE__*/e(p,{mfaMethods:h,onSelect:F,handleClose:L}):null}};export{u as MfaAuthVerifyFlowScreen,u 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{M as c,b as m,P as d,S as h}from"./ModalHeader-DfHxv9fE.mjs";import{L as u}from"./useActiveWallet-CwS7ik68.mjs";import{u as p}from"./context-Cw2-86-G.mjs";import{u as y}from"./internal-context-Z-fyxadS.mjs";import{a as f,u as v}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-Bvw5OxHl.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-nZPSS3Ux.mjs";import P from"@heroicons/react/24/outline/CheckCircleIcon";import F from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-D8SHd_ge.mjs";import{I as T,T as W,S as L,C as B,a as A,B as N,N as U,A as O,L as q,b as Y,c as $}from"./PinInput-3SLvbnQa.mjs";import{ErrorScreenView as D}from"./ErrorScreen-BGE6wldq.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-CTYGeo1r.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-BdRrZJd_.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"./CopyToClipboard-DSTf_eKU.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-D4XZQrgi.mjs";import"qrcode";import"./reservoir-0wfhnc0j.mjs";const z=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,h]=a(""),[u,y]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=f(),q=p();function Y(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(D,{allowlistConfig:q.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(c,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(W,{children:"Set up SMS verification"}),/*#__PURE__*/o(L,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(B,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),h(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(A,{children:["By providing your mobile number, you agree to receive text messages from ",q?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(m,{})]}:u?{children:[/*#__PURE__*/e(c,{onClose:Y},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(W,{children:"SMS verification added"}),/*#__PURE__*/o(L,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:Y,children:"Done"})}),/*#__PURE__*/e(m,{})]}:{children:[/*#__PURE__*/e(c,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(W,{children:"Enter enrollment code"}),/*#__PURE__*/o(B,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),y(!0)}catch(e){if(w(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(k(e))throw Error("The code you entered is not valid");if(g(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw j(e)?Error("Verification canceled"):Error("Unknown error")}}}),/*#__PURE__*/o(L,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(m,{})]})},H={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,P]=a(null),{unenrollWithSms:F,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:A,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:D,initEnrollmentWithTotp:H}=C(),{data:K,onUserCloseViaDialogOrKeybindRef:Q}=f(),V=p(),{closePrivyModal:X}=y(),{promptMfa:G}=b(),[J,Z]=a(!1),[_,ee]=a(null),[oe,re]=a(null),te=()=>{X({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{P(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();Q.current=te;let se=w?.mfaMethods.includes("sms"),ce=!!w?.phone,me=w?.mfaMethods.includes("totp"),de=w?.mfaMethods.includes("passkey"),he=se||me||de,ue=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){P(null),ee(null)}async function ye(e=ue){ie(!0);try{return await U(),await D({credentialIds:e},{removeForLogin:K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),K?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&Z(!0)}),[he]),!g||!w||!V/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(B,{children:/*#__PURE__*/e(u,{})}),/*#__PURE__*/e(m,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove SMS verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",V?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await F()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",V?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await R()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("passkey"===j){let n=K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(L,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await x({removeForLogin:K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]})}if(0===K.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Add more security"}),/*#__PURE__*/o(L,{children:[V?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:te,children:"Close"})}),/*#__PURE__*/e(m,{})]});let fe=!he&&!J;return fe?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Transaction Protection"}),/*#__PURE__*/e(L,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(q,{children:[/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",V?.name," wallet."]}),/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(d,{onClick:()=>Z(!0),children:"Continue"}),/*#__PURE__*/e(h,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(m,{})]}):"sms"===_?/*#__PURE__*/e(z,{appName:V?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===_&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await A({mfaCode:e}),K?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{P(null)}}(e),totpInfo:{...oe,appName:V?.name||"Privy"}}):"passkey"===_?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:ye}):/*#__PURE__*/e(I,{showIntro:fe,userMfaMethods:w.mfaMethods,appMfaMethods:V.mfa.methods,userHasAuthSms:ce,backFn:function(){Z(!1)},handleSelectMethod:async function(e){try{await G()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void H().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await ye():void ee(e)},isTotpLoading:"totp"===_&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await G()}catch(e){return void ae(e)}P(e)}})}};export{H as MfaEnrollmentFlowScreen,H as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{useMemo as t,useState as e,useEffect as r,useRef as i}from"react";import{u as s}from"./context-Cw2-86-G.mjs";import{u as m}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as n}from"./index-Bvw5OxHl.mjs";import{V as a,a as c,b as l,t as p}from"./to-ui-error-DnDY_33E.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@privy-io/are-addresses-equal";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@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-DfHxv9fE.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-BdRrZJd_.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-oI6b3gPZ.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./TransactionDetails-Ce_Cnzo2.mjs";import"./WalletLink-DNraFqEC.mjs";import"./ethers-5oa3ZKLD.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u=({onClose:u})=>{let{user:d}=m(),h=s(),j=t((()=>d?.mfaMethods.filter((o=>"passkey"!==o||!h.globalDisablePasskeys))??[]),[d?.mfaMethods,h.globalDisablePasskeys]),[f,v]=e(j[0]??null),{init:y,cancel:k,submit:g}=n(),[b,w]=e(!1),[I,C]=e(null),[P,x]=e();r((()=>{v(j[0]??null)}),[j]);let S=i(!1);async function M(o){x(void 0);try{if(!o||!f)return;await g(f,o),w(!0),x(void 0),u()}catch(o){throw p(o).error}}async function A(o){if("passkey"!==o)try{v(o),await y(o)}catch(o){console.error(o)}else try{v(o);let t=await y(o);if(!t)throw Error("something went wrong");C(t),await g(o,t),w(!0),x(void 0),u()}catch(o){x(p(o))}}r((()=>{!S.current&&f&&(S.current=!0,A(f).finally((()=>{S.current=!1})))}),[]);let B=()=>{v(null),x(void 0),k(),u()};return d?"passkey"===f?/*#__PURE__*/o(a,{account:d.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:b,hasBlockingError:P?.isBlocking??!1,error:P?.error,onClose:B,onBack:()=>{v(null),x(void 0)},handleSubmit:()=>M(I).catch(x)}):f?/*#__PURE__*/o(c,{submitSuccess:b,hasBlockingError:P?.isBlocking??!1,handleSubmitCode:M,selectedMethod:f,onClose:B,onBack:j.length>1?()=>v(null):void 0}):/*#__PURE__*/o(l,{mfaMethods:j,onSelect:A,handleClose:B}):null};export{u as MfaVerifyFlowScreen,u as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as n}from"react";import{styled as a}from"styled-components";import{M as s,B as l,P as c}from"./ModalHeader-DfHxv9fE.mjs";import{a as m}from"./Layouts-BlFm53ED.mjs";import{L as d,O as u}from"./useActiveWallet-CwS7ik68.mjs";import{u as p}from"./context-Cw2-86-G.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as g}from"./index-yxF2V6XY.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"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";const y=({size:t=61,...o})=>/*#__PURE__*/e("svg",{width:t,height:t,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:/*#__PURE__*/r("g",{id:"moonpay_symbol_wht 2",children:[/*#__PURE__*/e("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),/*#__PURE__*/e("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});const v={component:()=>{let{data:o,setModalData:i,navigateBack:n}=f(),a=p(),{closePrivyModal:c}=h(),{externalTransactionId:m}=o?.moonpayStatus,d=g(m||null,a.fundingMethodConfig.moonpay.useSandbox??!1);/*#__PURE__*/return r(t,{children:[/*#__PURE__*/e(s,{title:"Fund account",backFn:()=>{let e={...o?.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(e.usingDefaultFundingMethod=!1),i({funding:e,solanaFundingData:o?.solanaFundingData}),n()}}),/*#__PURE__*/e(C,{status:d,onClickCta:c}),/*#__PURE__*/e(l,{})]})}};let C=({status:o,onClickCta:i})=>{let{title:a,body:s,cta:l}=n((()=>(e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return r(t,{children:[/*#__PURE__*/r(b,{children:[/*#__PURE__*/e(w,{status:o}),/*#__PURE__*/r(m,{children:[/*#__PURE__*/e("h3",{children:a}),/*#__PURE__*/e(x,{children:s})]})]}),l&&/*#__PURE__*/e(c,{onClick:i,children:l})]})},w=({status:t})=>{if(!t||"pending"===t){let t="var(--privy-color-foreground-4)";/*#__PURE__*/return r("div",{style:{position:"relative"},children:[/*#__PURE__*/e(d,{color:t,style:{position:"absolute"}}),/*#__PURE__*/e(u,{color:t}),/*#__PURE__*/e(y,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let n=(r=>{switch(r){case"completed":return i;case"waitingAuthorization":return()=>/*#__PURE__*/e(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"}});default:return}})(t),a=(s=t)?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[s]:"var(--privy-color-foreground-4)";var s;/*#__PURE__*/return e("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/e(n,{width:"4rem",height:"4rem",color:a})})},x=a.p`
|
|
2
|
-
font-size: 1rem;
|
|
3
|
-
color: var(--privy-color-foreground-3);
|
|
4
|
-
margin-bottom: 1rem;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 1rem;
|
|
8
|
-
`,b=a.div`
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
margin-left: 1.75rem;
|
|
14
|
-
margin-right: 1.75rem;
|
|
15
|
-
padding: 2rem 0;
|
|
16
|
-
`;export{v as MoonpayStatusScreen,v 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-CQc-E5dS.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-BoAxhlj6.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-Cw2-86-G.mjs";import{b as T,u as S,k as w}from"./internal-context-Z-fyxadS.mjs";import{s as _}from"./shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs";import{S as b}from"./ScreenLayout-BdRrZJd_.mjs";import{e as C}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{l as j}from"./index-Bvw5OxHl.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";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(b,{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:b}=S(),[C,O]=r(!1),[R,N]=r(void 0),k=u()?.provider||"google",{name:P,component:D}=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()}))}),[P,k]),o((()=>{if(s&&t&&C&&m){if(p?.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let e=setTimeout((()=>{l("AffirmativeConsentScreen")}),A);return()=>clearTimeout(e)}if(_(m,p.embeddedWallets)){let e=setTimeout((()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),b({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:P,ProviderLogo:D,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 o}from"./index-Bvw5OxHl.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as a}from"./ScreenLayout-BdRrZJd_.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"./context-Cw2-86-G.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:o="Log in or create a new account?",subtitle:i="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:o,subtitle:i,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}=o(),{navigate:n,setModalData:p}=r(),{initSignupWithPasskey:c,initLoginWithPasskey:m}=i();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!0},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:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!1},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:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
|
|
@@ -1,3 +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-Cw2-86-G.mjs";import{c,b as m,u}from"./internal-context-Z-fyxadS.mjs";import{a as l,u as p}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs";import{S as y}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-Bvw5OxHl.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const h=({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}),f={component:()=>{let{data:r,setModalData:i,navigate:c}=l(),m=a(),{loginWithPasskey:y,signupWithPasskey:f,closePrivyModal:g,createAnalyticsEvent:v}=u(),{user:w,logout:k}=p(),{passkeySignupFlow:j}=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 x=async()=>{A("loading");try{j?await f():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"}}),k()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,b]),s((()=>{x()}),[]),/*#__PURE__*/e(h,{status:b,passkeySignupFlow:j,error:C,onRetry:x})}};let g=i.span`
|
|
2
|
-
white-space: pre-wrap;
|
|
3
|
-
`;export{f as PasskeyStatusScreen,h as PasskeyStatusScreenView,f as default};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as t,useEffect as i}from"react";import{styled as s,css as a}from"styled-components";import{u as n,a as l,j as c}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{P as m}from"./ModalHeader-DfHxv9fE.mjs";import{S as d}from"./Layouts-BlFm53ED.mjs";import{P as p,a as u,I as h,H as y,S as v}from"./shared-Bw0pXSOO.mjs";import{n as f}from"./index-Bvw5OxHl.mjs";import{u as w,m as g}from"./internal-context-Z-fyxadS.mjs";import{S as j}from"./Screen-CDEd4p2a.mjs";import"@privy-io/are-addresses-equal";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/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"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./index-Dq_xe9dz.mjs";const b={component:()=>{let[s,a]=t(!0),{authenticated:m,user:b}=n(),{walletProxy:C,closePrivyModal:I,createAnalyticsEvent:P,client:S}=w(),{navigate:T,data:W,onUserCloseViaDialogOrKeybindRef:E}=l(),[_,R]=t(void 0),[H,M]=t(""),[U,F]=t(!1),{entropyId:N,entropyIdVerifier:O,onCompleteNavigateTo:V,onSuccess:$,onFailure:z}=W.recoverWallet,L=(e="User exited before their wallet could be recovered")=>{I({shouldCallAuthOnSuccess:!1}),z("string"==typeof e?new g(e):e)};E.current=L,i((()=>{if(!m)return L("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:o,title:"Enter your password",subtitle:"Please provision your account on this new device. To continue, enter your recovery password.",showClose:!0,onClose:L}),/*#__PURE__*/r(j.Body,{children:/*#__PURE__*/r(x,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(p,{children:[/*#__PURE__*/r(u,{type:s?"password":"text",onChange:e=>(e=>{e&&R(e)})(e.target.value),disabled:U,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)})})]}),!!H&&/*#__PURE__*/r(k,{children:H})]})})}),/*#__PURE__*/e(j.Footer,{children:[/*#__PURE__*/r(j.HelpText,{children:/*#__PURE__*/e(d,{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(A,{loading:U||!C,disabled:!_,onClick:async()=>{F(!0);let e=await S.getAccessToken(),r=c(b,N);if(!e||!r||null===_)return L("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(C?.recover({accessToken:e,entropyId:N,entropyIdVerifier:O,recoveryPassword:_})),M(""),V?T(V):I({shouldCallAuthOnSuccess:!1}),$?.(r),P({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}})}catch(e){f(e)?M("Invalid recovery password, please try again."):M("An error has occurred, please try again.")}finally{F(!1)}},$hideAnimations:!N&&U,children:"Recover your account"})}),/*#__PURE__*/r(j.Watermark,{})]})]})}};let x=s.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 1.5rem;
|
|
5
|
-
`,k=s.div`
|
|
6
|
-
line-height: 20px;
|
|
7
|
-
height: 20px;
|
|
8
|
-
font-size: 13px;
|
|
9
|
-
color: var(--privy-color-error);
|
|
10
|
-
text-align: left;
|
|
11
|
-
margin-top: 0.5rem;
|
|
12
|
-
`,A=s(m)`
|
|
13
|
-
${({$hideAnimations:e})=>e&&a`
|
|
14
|
-
&& {
|
|
15
|
-
// Remove animations because the recoverWallet task on the iframe partially
|
|
16
|
-
// blocks the renderer, so the animation stutters and doesn't look good
|
|
17
|
-
transition: none;
|
|
18
|
-
}
|
|
19
|
-
`}
|
|
20
|
-
`;export{b as PasswordRecoveryScreen,b as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as i}from"react";import{M as c,P as s,B as l}from"./ModalHeader-DfHxv9fE.mjs";import{C as n}from"./ScreenHeader-CHmc4-Lu.mjs";import{q as d}from"./context-Cw2-86-G.mjs";import{o as p,q as u,r as m,v,R as h,l as w}from"./index-Bvw5OxHl.mjs";import{a as y,f,b as _,u as A}from"./internal-context-Z-fyxadS.mjs";import{a as E,u as g,g as C}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{a8 as b,a9 as R,aa as k}from"./paths-3HW55qZg.mjs";import{g as T}from"./useWallets-2_uCkhA8.mjs";import{a as O}from"./events-context-CI0iqAXA.mjs";import{A as N,G as S,R as x}from"./styles-BsotlekN.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"viem";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"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";async function I({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function o(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),o()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),o()))}window.addEventListener("message",a)}))}async function M({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new y("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new y("User denied confirmation during OAuth flow");try{return(await e.post(b,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(e){let t=f(e);if(t.privyErrorCode)throw new y(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new y("Invalid code during oauth flow.",void 0,_.OAUTH_USER_DENIED);throw new y("Invalid code during OAuth flow.",void 0,_.UNKNOWN_AUTH_ERROR)}}async function U({api:e,provider:t}){let r=p(),o=u(),a=await m(r);try{return"icloud"===t?{url:(await e.post(R,{client_type:"web"})).url}:{url:(await e.post(k,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw f(e)}}let j={"google-drive":{name:"Google Drive",component:S},icloud:{name:"iCloud",component:N}};const W={component:()=>{let{logout:p}=g(),{navigate:u,setModalData:m,data:f}=E(),{closePrivyModal:b,createAnalyticsEvent:R}=A(),{execute:k}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=A(),{data:o}=E(),{user:a}=g(),i=O(),{create:c}=v();return{execute:async({provider:s,action:l,popup:n,shouldCreateEth:d,shouldCreateSol:p})=>{let u,m;if(!e)throw new y("Missing client");function v(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:s}}),new y("Recovery OAuth failed")}switch(s){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await U({api:e.api,provider:s});v(o);try{let a=await I({url:o,popup:n,provider:s});if(t=a.stateCode,r=a.authorizationCode,t!==i)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:s,storedStateCode:i??"",returnedStateCode:t??""}}),new y("Unexpected auth flow. This may be a phishing attempt.",void 0,_.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:s}}),new y("Recovery OAuth failed")}[u,m]=await Promise.all([e.getAccessToken(),M({api:e.api,provider:s,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await U({api:e.api,provider:s});v(t);let{ckWebAuthToken:r}=await I({url:t,popup:n,provider:s});m=r,u=await e.getAccessToken()}}if(!t)throw new y("Cannot connect to wallet proxy");if(!u)throw new y("Unable to authorize user");switch(l){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new y("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:s}}),await t.recover({accessToken:u,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:m}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:s}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),d&&p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await c({chainType:"solana",walletIndex:0,latestUser:t.user});else if(p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"solana",walletIndex:0,latestUser:a});else{if(!d)throw Error("Invalid args to create wallet");t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),i("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let o=C(a);if(!o)throw i("setWalletRecovery","onError",_.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}});let{entropyId:c,entropyIdVerifier:l}=T(a);await t.setRecovery({accessToken:u,entropyId:c,entropyIdVerifier:l,recoveryMethod:s,recoveryAccessToken:m});let n=C(await r());if(!n)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}}),i("setWalletRecovery","onSuccess",{method:s,wallet:n});break}default:throw new y("Unsupported recovery action")}}}})(),[N,S]=o(!1),{provider:W,action:D,isInAccountCreateFlow:P,shouldCreateEth:V,shouldCreateSol:L}=f?.recoveryOAuthStatus,[z,H]=o(void 0),[$,B]=o("create-wallet"===D);if("user-passcode"===W)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let F=j[W].name,q=j[W].component,G=f?.recoverWallet?.onCompleteNavigateTo,K=new h((async(e="create-wallet")=>(B(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await k({provider:W,action:e,popup:r,shouldCreateEth:V,shouldCreateSol:L}),S(!0),t()}catch(t){H({message:`${"recover"===e?"Recovery":"Back up"} with ${F} unsuccessful`,detail:"recover"===D?`Please verify that you are selecting the ${F} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));a((()=>{"recover"!==D&&K.execute(P?"create-wallet":"set-recovery")}),[]),a((()=>{if(!N)return;let e=setTimeout((()=>{P?(m({createWallet:{onSuccess:()=>{},onFailure:e=>{R({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),p()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),u("EmbeddedWalletCreatedScreen")):b({shouldCallAuthOnSuccess:!1})}),d);return()=>clearTimeout(e)}),[N]);let Y=i((async()=>{await K.execute("recover"),G?u(G):S(!0)}),[]),X="google-drive"===W?"Google Drive":"Apple iCloud",Q=N&&`Successfully ${"recover"===D?"recovered":"backed up"} with ${X}.`||z&&z.message||`${"recover"===D?"Recovering":"Backing up"} with ${X}...`,J=z?z.detail:"";/*#__PURE__*/return e(t,{children:[/*#__PURE__*/r(c,{}),$?/*#__PURE__*/r(t,{children:/*#__PURE__*/e(x,{children:[/*#__PURE__*/r(n,{title:Q,icon:/*#__PURE__*/r(q,{style:{width:"38px",height:"38px"}}),description:J}),z&&z?.retryable?/*#__PURE__*/r(s,{onClick:()=>{w(),H(void 0),"create-wallet"===D?K.execute("create-wallet"):Y()},disabled:!N&&!z?.retryable,children:"Try again"}):null]})}):/*#__PURE__*/e(x,{children:[/*#__PURE__*/r(n,{title:"Confirm it's really you",icon:/*#__PURE__*/r(q,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${X} where your account is backed up.`}),/*#__PURE__*/e(s,{onClick:Y,children:["Confirm with ",X]})]}),/*#__PURE__*/r(l,{})]})}};export{W as RecoveryOAuthScreen,W as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{u as r}from"./context-Cw2-86-G.mjs";import{v as i,R as s}from"./index-Bvw5OxHl.mjs";import{u as a,m as n}from"./internal-context-Z-fyxadS.mjs";import{a as c,u as l}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-DdWjdu2s.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"./ModalHeader-DfHxv9fE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./shared-Bw0pXSOO.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let{navigate:u,data:d,onUserCloseViaDialogOrKeybindRef:h}=c(),w=r(),[y,v]=o(""),[f,j]=o(!1),[g,C]=o(),[I,x]=o(null),{create:b}=i(),{authenticated:P,user:S}=l(),{closePrivyModal:A,isNewUserThisSession:T,initializeWalletProxy:U}=a(),{onSuccess:k,onFailure:E,callAuthOnSuccessOnClose:M,shouldCreateEth:O,shouldCreateSol:W}=d.createWallet,[D,L]=o(null),R=new s((async()=>{try{let e;if(O&&W)e=await b({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:S}),e=await b({chainType:"solana",walletIndex:0,latestUser:e.user});else if(W)e=await b({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"solana",walletIndex:0,latestUser:S});else{if(!O)throw Error("Invalid args to create wallet");e=await b({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:S})}L(e),T?u("EmbeddedWalletCreatedScreen"):(k(e),A({shouldCallAuthOnSuccess:M}))}catch(e){v(e.message)}}));t((()=>{I||U(3e4).then((e=>x(e)))}),[I]),t((()=>{if(!P||!S)return u("LandingScreen"),void E(Error("User must be authenticated before creating a Privy wallet"))}),[P]),h.current=()=>null;/*#__PURE__*/return e(m,{config:{initiatedBy:"automatic"},appName:w?.name||"privy",loading:!I,buttonLoading:f,buttonHideAnimations:!D&&f,isResettingPassword:!1,error:y,password:g||"",onClose:()=>{D&&"user-passcode"!==D.account.recoveryMethod?(E(new n("User created a wallet but failed to set a password for it")),A({shouldCallAuthOnSuccess:!1})):D?(k(D),A({shouldCallAuthOnSuccess:M})):(E(new n("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))},onPasswordChange:C,onPasswordGenerate:()=>C(p()),onSubmit:async()=>(j(!0),R.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>j(!1))))})}};export{u as EmbeddedWalletPasswordCreateScreen,u as default};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as r}from"@scure/base";import{Edit as i}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DSTf_eKU.mjs";import{a as d}from"./Layouts-BlFm53ED.mjs";import{M as u,D as g}from"./JsonTree-aPaJmPx7.mjs";import{P as h,G as y}from"./use-export-wallet-Bd5Sg5V-.mjs";import{W as f,q as x}from"./context-Cw2-86-G.mjs";import{u as C}from"./internal-context-Z-fyxadS.mjs";import{u as w,a as v}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as T}from"./ScreenLayout-BdRrZJd_.mjs";import"./useWallets-2_uCkhA8.mjs";import"eventemitter3";import"viem/utils";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const b=s.img`
|
|
2
|
-
&& {
|
|
3
|
-
height: ${e=>"sm"===e.size?"65px":"140px"};
|
|
4
|
-
width: ${e=>"sm"===e.size?"65px":"140px"};
|
|
5
|
-
border-radius: 16px;
|
|
6
|
-
margin-bottom: 12px;
|
|
7
|
-
}
|
|
8
|
-
`;let j=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},E=e=>{try{let t=r.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},S=r=>{let{types:i,primaryType:n,...a}=r.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(A,{data:a}),/*#__PURE__*/e(p,{text:(s=r.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const R=({method:o,messageData:r,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:h})=>/*#__PURE__*/e(T,{title:n.title,subtitle:n.description,showClose:!0,onClose:h,icon:i,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(L,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(b,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(D,{children:["personal_sign"===o&&/*#__PURE__*/e(U,{children:j(r)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(S,{typedData:r}),"solana_signMessage"===o&&/*#__PURE__*/e(U,{children:E(r)})]})]})}),_={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:r}=C(),{navigate:i,data:s,onUserCloseViaDialogOrKeybindRef:l}=v(),[c,p]=n(!0),[d,u]=n(""),[g,T]=n(),[b,j]=n(null),[E,S]=n(!1);a((()=>{t||i("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),T(new h(new y(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:_,data:D,confirmAndSign:L,onSuccess:A,onFailure:U,uiOptions:M}=s.signMessage,I={title:M?.title||"Sign message",description:M?.description||"Signing this message will not cost you any fees.",buttonText:M?.buttonText||"Sign and continue"},k=e=>{e?A(e):U(g||new h(new y("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{j(null),u(""),T(void 0)}),200)};l.current=()=>{k(b)};/*#__PURE__*/return e(R,{method:_,messageData:D,copy:I,iconUrl:M?.iconUrl&&"string"==typeof M.iconUrl?M.iconUrl:void 0,isLoading:E,success:null!==b,walletProxyIsLoading:c,errorMessage:d,isCancellable:M?.isCancellable,onSign:async()=>{S(!0),u("");try{let e=await L();j(e),S(!1),setTimeout((()=>{k(e)}),x)}catch(e){console.error(e),u("An error has occurred, please try again."),T(new h(new y(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),S(!1)}},onCancel:()=>k(null),onClose:()=>k(b)})}};let D=s.div`
|
|
9
|
-
flex: 1;
|
|
10
|
-
display: flex;
|
|
11
|
-
flex-direction: column;
|
|
12
|
-
gap: 16px;
|
|
13
|
-
`,L=s.p`
|
|
14
|
-
&& {
|
|
15
|
-
margin: 0;
|
|
16
|
-
width: 100%;
|
|
17
|
-
text-align: center;
|
|
18
|
-
color: var(--privy-color-error-dark);
|
|
19
|
-
font-size: 14px;
|
|
20
|
-
line-height: 22px;
|
|
21
|
-
}
|
|
22
|
-
`,A=s(g)`
|
|
23
|
-
margin-top: 0;
|
|
24
|
-
`,U=s(u)`
|
|
25
|
-
margin-top: 0;
|
|
26
|
-
`;export{_ as SignRequestScreen,R as SignRequestView,_ as default};
|