@privy-io/react-auth 3.18.0 → 3.18.1-snapshot-20260323180320
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-BxW0mCgO.js +1 -0
- package/dist/cjs/{Address-BeuDoSGB.js → Address-5Tbt4Qwf.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-lvCxvQuU.js +6 -0
- package/dist/cjs/AllowlistRejectionScreen-B1RhO_lP.js +1 -0
- package/dist/cjs/AuthenticateWithWalletScreen-Dmf6jpHZ.js +1 -0
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-DYL6Zpq4.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-BWv2Hd1V.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-uDQENsAs.js +103 -0
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-gSaL9bry.js +2 -0
- package/dist/cjs/{BridgeNetworkSelectionView-DKogJoIK.js → BridgeNetworkSelectionView-BZUXfLMd.js} +1 -1
- package/dist/cjs/CaptchaScreen-DAX05cly.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-CXA5S3ul.js +16 -0
- package/dist/cjs/{ConnectEmailForm-CnoGdJHM.js → ConnectEmailForm-B3uVbxMT.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-d5u7isQV.js +9 -0
- package/dist/cjs/ConnectOnlyLandingScreen-DuVAnHMC.js +1 -0
- package/dist/cjs/ConnectOnlyStatusScreen-sMctneNr.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-AxO4VFOJ.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-D3q0wloY.js → ConnectPhoneForm-C5ORKRAh.js} +1 -1
- package/dist/cjs/{ConnectWalletView-C6ISoYJv.js → ConnectWalletView-C23PBQwL.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-CUE5ifn3.js +7 -0
- package/dist/cjs/CrossAppAuthScreen-5bVySoEO.js +1 -0
- package/dist/cjs/{CustomLandingScreenView--zrI99Tu.js → CustomLandingScreenView-gXROzBF7.js} +1 -1
- package/dist/cjs/DelegatedActionsConsentScreen-DRDv79eR.js +1 -0
- package/dist/cjs/DelegatedActionsRevokeScreen-qXQtFHm7.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-twPAutSZ.js +1 -0
- package/dist/cjs/EmbeddedWalletCreatedScreen-BZv82Ff1.js +1 -0
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-DiMRj8ux.js → EmbeddedWalletKeyExportScreen-JlitnF1Z.js} +1 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-BM_MIgWw.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-BvGjqdys.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-BwbxEhW_.js +1 -0
- package/dist/cjs/{EnrollTotp-RPco748Q.js → EnrollTotp-kUCnCKj8.js} +1 -1
- package/dist/cjs/ErrorScreen-DycVuH2C.js +4 -0
- package/dist/cjs/{FarcasterConnectStatusScreen-VcZ3BOP9.js → FarcasterConnectStatusScreen-D1_3iVIB.js} +3 -3
- package/dist/cjs/FarcasterSignerStatusScreen-CNzHekgg.js +29 -0
- package/dist/cjs/FiatOnrampScreen-MfACBLrS.js +86 -0
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-CabhwSoM.js +2 -0
- package/dist/cjs/{FundWalletMethodHeader-BTGxq_KO.js → FundWalletMethodHeader-DpTYOeDR.js} +1 -1
- package/dist/cjs/{FundWithBankDepositScreen-HfVq1zvk.js → FundWithBankDepositScreen-C2ivBVIB.js} +2 -2
- package/dist/cjs/FundingEditAmountScreen-BBgv2wGz.js +1 -0
- package/dist/cjs/FundingMethodSelectionScreen-Cw9e130G.js +1 -0
- package/dist/cjs/InAppBrowserLoginNotPossible-1ogqlFng.js +1 -0
- package/dist/cjs/InstallWalletScreen-iBT_xnUC.js +1 -0
- package/dist/cjs/LandingScreen-A5aZP3uM.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BsgVq6Bs.js → LinkConflictScreen-Crn9vsmb.js} +1 -1
- package/dist/cjs/LinkEmailScreen-C8yS1sQ0.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-D9Y8PpKL.js → LinkPasskeyScreen-irz40Jr-.js} +1 -1
- package/dist/cjs/LinkPhoneScreen-B8m7RwJ6.js +1 -0
- package/dist/cjs/LoginFailedScreen-DQYDpPdQ.js +1 -0
- package/dist/cjs/ManualTransferScreen-BK6ZGmgN.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BTAH5ysP.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-VNUL1aSi.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-Uk1CSf00.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-DlXtdhCi.js +1 -0
- package/dist/cjs/{ModalHeader-C5Wuo3-1.js → ModalHeader-DnfZmAVi.js} +1 -1
- package/dist/cjs/MoonpayStatusScreen-Br4-xEmC.js +16 -0
- package/dist/cjs/OAuthStatusScreen-6tvc6WIw.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-BjMI1dzm.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-CChKpO-B.js +3 -0
- package/dist/cjs/PasswordRecoveryScreen-CBfXDxM3.js +20 -0
- package/dist/cjs/{QrCode-Bbg48Zky.js → QrCode-CfEV2R0b.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-TVXERqGT.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-ClLkWOHk.js +1 -0
- package/dist/cjs/{RecoverySelectionScreen-5crBwkcF.js → RecoverySelectionScreen-CSPvN1YA.js} +2 -2
- package/dist/cjs/{Screen-DWnRbzSA.js → Screen-C5AJ9f0u.js} +1 -1
- package/dist/cjs/{ScreenLayout-C4QHZMbl.js → ScreenLayout-cjwLpqlf.js} +1 -1
- package/dist/cjs/{SelectSourceAsset-Mzj-MSFd.js → SelectSourceAsset-DQcckwC8.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-CYXvomBY.js → SetAutomaticRecoveryScreen-BWMiMl7e.js} +2 -2
- package/dist/cjs/{SetWalletPasswordForm-BCdbqkFk.js → SetWalletPasswordForm-cJ_BWgNU.js} +1 -1
- package/dist/cjs/SignRequestScreen-BBZTLAhZ.js +26 -0
- package/dist/cjs/{StandardSignAndSendTransactionScreen-BM1NyC8e.js → StandardSignAndSendTransactionScreen-Cz8dnswX.js} +3 -3
- package/dist/cjs/TelegramAuthScreen-Cnd1NRyI.js +1 -0
- package/dist/cjs/{TransactionDetails-BisPbyIV.js → TransactionDetails-DGH4ji2m.js} +1 -1
- package/dist/cjs/{TransactionErrorView-OoipbwSa.js → TransactionErrorView-BIL8-9ac.js} +1 -1
- package/dist/cjs/{TransferFromWalletScreen-BItctfpp.js → TransferFromWalletScreen-Cfq77dek.js} +1 -1
- package/dist/cjs/{TransferOrBridgeLoadingScreen-DsutKbzS.js → TransferOrBridgeLoadingScreen-BrTj6bl-.js} +1 -1
- package/dist/cjs/UpdateEmailScreen-BOOd8gIW.js +1 -0
- package/dist/cjs/UpdatePhoneScreen-DRpMSWyD.js +1 -0
- package/dist/cjs/UserLimitReachedScreen-B8_OaPQq.js +1 -0
- package/dist/cjs/{WalletInfoCard-B7ARTvO5.js → WalletInfoCard-DPm-y4VM.js} +1 -1
- package/dist/cjs/WalletInterstitialScreen-BAuBUJeB.js +1 -0
- package/dist/cjs/{WalletLink-CRWOuFlx.js → WalletLink-X7khQj5S.js} +1 -1
- package/dist/cjs/{WalletOverflowButton-BMn1cJfA.js → WalletOverflowButton-iM3TrjO5.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-Cg3IEi80.js → context-BHn2jiis.js} +1 -1
- package/dist/cjs/{ethers-p3w-Ig2U.js → ethers-DzzFQEau.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/get-entropy-details-for-user-DPOwc_4w.js +1 -0
- package/dist/cjs/getErc20Balance-CDVVppWI.js +1 -0
- package/dist/cjs/getErc20TokenInfo-Df0mF86i.js +1 -0
- package/dist/cjs/{index-DrQAmIx6.js → index-BkrQ4auF.js} +2 -2
- package/dist/cjs/index-CWA3Jcah.js +174 -0
- package/dist/cjs/{index-B6eKyGL-.js → index-DDIX8Ut3.js} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{privy-context-CrM9_s6G.js → privy-context-Cs8xLG2y.js} +1 -1
- package/dist/cjs/{shared-CiNVwcTc.js → shared-jdBCEAtE.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-BUJZ4s-V.js → shouldProceedtoEmbeddedWalletCreationFlow-BCW6JjS3.js} +1 -1
- package/dist/cjs/smart-wallets-8rYwotQ5.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{styles-B1M_BS_A.js → styles-CMmkssms.js} +1 -1
- package/dist/cjs/{to-ui-error-CS08QD8Q.js → to-ui-error-DMMiPFMN.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/use-export-wallet-B-Ax45Um.js +1 -0
- package/dist/cjs/use-export-wallet-BAmtC6Ll.js +1 -0
- package/dist/cjs/useActiveWallet-De91xEqr.js +185 -0
- package/dist/cjs/{useGetTokenPrice-CSWuvKuF.js → useGetTokenPrice-TNsFcNNe.js} +1 -1
- package/dist/cjs/{useI18n-DUN0YTKn.js → useI18n-CzBaNJQu.js} +1 -1
- package/dist/cjs/usePrivy-BuuA4AL6.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-DuOWyD1p.js → useSolanaRpcClient-DYPBeNIL.js} +1 -1
- package/dist/cjs/useWalletBalance-rYJzyIe0.js +1 -0
- package/dist/cjs/useWallets-CzUkZuuP.js +1 -0
- package/dist/dts/{events-context-BXis4NRh.d.mts → events-context-B-xMLvZ9.d.mts} +1 -1
- package/dist/dts/{events-context-BXis4NRh.d.ts → events-context-B-xMLvZ9.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 +4 -38
- package/dist/dts/index.d.ts +4 -38
- 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-Bc9w_mgT.d.mts → types-CHmbtLnY.d.mts} +1 -1
- package/dist/dts/{types-Bc9w_mgT.d.ts → types-CHmbtLnY.d.ts} +1 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-Dtxa0j0n.mjs +1 -0
- package/dist/esm/{Address-N-mzBgMy.mjs → Address-ztk_sJbY.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-ClYZtzJh.mjs +6 -0
- package/dist/esm/AllowlistRejectionScreen-CvERsAiW.mjs +1 -0
- package/dist/esm/AuthenticateWithWalletScreen-CClnNoxF.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-Bcmvkgxr.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-Dwm3BgmA.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-BWjy6ej2.mjs +103 -0
- package/dist/esm/AwaitingSolToEvmBridgingScreen-DhztCAZM.mjs +2 -0
- package/dist/esm/{BridgeNetworkSelectionView-CiJQDIy_.mjs → BridgeNetworkSelectionView-CVWEgLyC.mjs} +2 -2
- package/dist/esm/CaptchaScreen-DCNPigmD.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-B_64L4wB.mjs +16 -0
- package/dist/esm/ConnectEmailForm-BROxiluB.mjs +3 -0
- package/dist/esm/ConnectLedgerScreen-D5jE0oZ0.mjs +9 -0
- package/dist/esm/ConnectOnlyLandingScreen-CqKdIFMO.mjs +1 -0
- package/dist/esm/ConnectOnlyStatusScreen-57k3JgWT.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-BeaAjA78.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-DP4LRtUG.mjs → ConnectPhoneForm-fY21-qVb.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-pxEyo8WM.mjs → ConnectWalletView-Mc2T9ieN.mjs} +1 -1
- package/dist/esm/ConnectionStatusScreen-CI0DWa4J.mjs +7 -0
- package/dist/esm/CrossAppAuthScreen-CRxf-t9K.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-BxAx1Co_.mjs → CustomLandingScreenView-vaSO3Cgw.mjs} +1 -1
- package/dist/esm/DelegatedActionsConsentScreen-T6I3gKiO.mjs +1 -0
- package/dist/esm/DelegatedActionsRevokeScreen-BCcBpZTQ.mjs +1 -0
- package/dist/esm/EmbeddedWalletConnectingScreen-O85tys98.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-C89uPoS1.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-B3GsSPLG.mjs → EmbeddedWalletKeyExportScreen-Bljd1_Ne.mjs} +1 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-HY4euEhG.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-NQTdb4d4.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BaK_1ksZ.mjs +1 -0
- package/dist/esm/{EnrollTotp-V5tLY1MZ.mjs → EnrollTotp-CUzDQN0K.mjs} +1 -1
- package/dist/esm/ErrorScreen-DvY6YnX3.mjs +4 -0
- package/dist/esm/{FarcasterConnectStatusScreen-DmhyV2vW.mjs → FarcasterConnectStatusScreen-CovjQBp9.mjs} +4 -4
- package/dist/esm/FarcasterSignerStatusScreen-lYfAjo1V.mjs +28 -0
- package/dist/esm/FiatOnrampScreen-C5zkekrg.mjs +86 -0
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-DDA8AJ00.mjs +1 -0
- package/dist/esm/{FundWalletMethodHeader-Cb-ACySl.mjs → FundWalletMethodHeader-DzRf3TxY.mjs} +1 -1
- package/dist/esm/{FundWithBankDepositScreen--e9rfZCc.mjs → FundWithBankDepositScreen-BHZufg_F.mjs} +2 -2
- package/dist/esm/FundingEditAmountScreen-DsKxpzI2.mjs +1 -0
- package/dist/esm/FundingMethodSelectionScreen-C3Ey8QLl.mjs +1 -0
- package/dist/esm/InAppBrowserLoginNotPossible-DmIlipsa.mjs +1 -0
- package/dist/esm/InstallWalletScreen-TEtbhvDd.mjs +1 -0
- package/dist/esm/LandingScreen-CWwpn8ua.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-CElxCrSW.mjs → LinkConflictScreen-CAwKghOc.mjs} +6 -6
- package/dist/esm/LinkEmailScreen-Bmn-KaZ0.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-DmtRo8xi.mjs → LinkPasskeyScreen-DNMFOi_R.mjs} +6 -6
- package/dist/esm/LinkPhoneScreen-DcYP1v2I.mjs +1 -0
- package/dist/esm/LoginFailedScreen-Dsw6XnwB.mjs +1 -0
- package/dist/esm/ManualTransferScreen-DpqH3TVe.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-BtxPC4A6.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-DcVp8Kwh.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-CRhS937B.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-BH3c_6EQ.mjs +1 -0
- package/dist/esm/{ModalHeader-BnVmXtvG.mjs → ModalHeader-SZtVQvik.mjs} +1 -1
- package/dist/esm/MoonpayStatusScreen-DRn-F8B_.mjs +16 -0
- package/dist/esm/OAuthStatusScreen-DWxRYQP9.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-S-0nyZBM.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-BW37O8p7.mjs +3 -0
- package/dist/esm/PasswordRecoveryScreen-DYRmP_z1.mjs +20 -0
- package/dist/esm/{QrCode-B84kEIjT.mjs → QrCode-C1EFhNvP.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-CfcwbBNE.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DuWhl5st.mjs +1 -0
- package/dist/esm/{RecoverySelectionScreen-CFkgwzMS.mjs → RecoverySelectionScreen-LuYoLn9-.mjs} +2 -2
- package/dist/esm/{Screen-Cycy3IzT.mjs → Screen-CN4rqSk3.mjs} +1 -1
- package/dist/esm/{ScreenLayout-D1p_ntex.mjs → ScreenLayout-5dizeuV8.mjs} +1 -1
- package/dist/esm/{SelectSourceAsset-C10HQdge.mjs → SelectSourceAsset-Ck-rWdD5.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-CaXj1unh.mjs → SetAutomaticRecoveryScreen-B-r-OR4I.mjs} +2 -2
- package/dist/esm/{SetWalletPasswordForm-CbtQ4DZ1.mjs → SetWalletPasswordForm-CfVd6ha3.mjs} +1 -1
- package/dist/esm/{SignRequestScreen-CKO-pLHy.mjs → SignRequestScreen-CDekJecr.mjs} +1 -1
- package/dist/esm/{StandardSignAndSendTransactionScreen-Cya0O4wv.mjs → StandardSignAndSendTransactionScreen-BFoUItEM.mjs} +2 -2
- package/dist/esm/TelegramAuthScreen-CSIdJO9b.mjs +1 -0
- package/dist/esm/{TransactionDetails-DqFIa7IO.mjs → TransactionDetails-vGVxqJTf.mjs} +1 -1
- package/dist/esm/{TransactionErrorView-BjaCgZpa.mjs → TransactionErrorView-aSAFRf3w.mjs} +1 -1
- package/dist/esm/{TransferFromWalletScreen-DMoSgPhn.mjs → TransferFromWalletScreen-Cw3CPmt6.mjs} +2 -2
- package/dist/esm/{TransferOrBridgeLoadingScreen-DVeIRghG.mjs → TransferOrBridgeLoadingScreen-BCYNF0hZ.mjs} +1 -1
- package/dist/esm/UpdateEmailScreen-K_f07jSQ.mjs +1 -0
- package/dist/esm/UpdatePhoneScreen-BQRM4G9_.mjs +1 -0
- package/dist/esm/UserLimitReachedScreen-D9n9Ci_t.mjs +1 -0
- package/dist/esm/{WalletInfoCard-CEcdukTg.mjs → WalletInfoCard-C-e36Nix.mjs} +1 -1
- package/dist/esm/WalletInterstitialScreen-3xKc265f.mjs +1 -0
- package/dist/esm/{WalletLink-DNbGmOPX.mjs → WalletLink-BmpXoU__.mjs} +1 -1
- package/dist/esm/{WalletOverflowButton-CPDxFP5w.mjs → WalletOverflowButton-BYxNvERL.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-CTUTKfTP.mjs +1 -0
- package/dist/esm/{ethers-Dnv1tMN3.mjs → ethers-cuAocs4_.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-uzTmvtww.mjs → frame-CjhCpycO.mjs} +1 -1
- package/dist/esm/get-entropy-details-for-user-BSLx5drL.mjs +1 -0
- package/dist/esm/getErc20Balance-DGn8wuDJ.mjs +1 -0
- package/dist/esm/getErc20TokenInfo-Cxzr2l15.mjs +1 -0
- package/dist/esm/{index-CvvUk2Lm.mjs → index-BfBalsoU.mjs} +1 -1
- package/dist/esm/{index-B7Y-7rkw.mjs → index-CRvOUKJl.mjs} +1 -1
- package/dist/esm/index-CyGTVRWw.mjs +174 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-Z-fyxadS.mjs → internal-context-C4ZqP8IF.mjs} +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{paths-3HW55qZg.mjs → paths-BzM95ysC.mjs} +1 -1
- package/dist/esm/{privy-context-DrMxzgOR.mjs → privy-context-KWwEVjil.mjs} +1 -1
- package/dist/esm/reservoir-CB32KXxK.mjs +1 -0
- package/dist/esm/{shared-DhWmkz5T.mjs → shared-Bg_Mib-z.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-D2ZT5lW9.mjs → shouldProceedtoEmbeddedWalletCreationFlow-Dnn-YyK8.mjs} +1 -1
- package/dist/esm/smart-wallets-DVSNEnVR.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{styles-DDaGxKdi.mjs → styles-CImyOwKn.mjs} +1 -1
- package/dist/esm/{to-ui-error-YOQlKk5D.mjs → to-ui-error-BJ0QsSn7.mjs} +2 -2
- package/dist/esm/ui.mjs +9 -9
- package/dist/esm/use-export-wallet-6Oxe92mD.mjs +1 -0
- package/dist/esm/use-export-wallet-DtcF80nC.mjs +1 -0
- package/dist/esm/{use-sign-with-user-signer-Do5Oi_rb.mjs → use-sign-with-user-signer-BYctG7hm.mjs} +1 -1
- package/dist/esm/useActiveWallet-AXR7Ad3T.mjs +185 -0
- package/dist/esm/{useGetSolPrice-DwwjjGbd.mjs → useGetSolPrice-DaxM-vxD.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-LPJMl6JV.mjs → useGetTokenPrice-zmiNgRrw.mjs} +1 -1
- package/dist/esm/{useI18n-C4fmUAf3.mjs → useI18n-Bo8A3ofx.mjs} +1 -1
- package/dist/esm/usePrivy-CRZGeviV.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-71aYSqHX.mjs → useSolanaRpcClient-BFOAjONo.mjs} +1 -1
- package/dist/esm/useWalletBalance-BJeZI0tQ.mjs +1 -0
- package/dist/esm/useWallets-vSczvkAK.mjs +1 -0
- package/package.json +5 -5
- package/dist/cjs/AccountNotFoundScreen-B3YeQpWL.js +0 -1
- package/dist/cjs/AffirmativeConsentScreen-BxXaVIHv.js +0 -6
- package/dist/cjs/AllowlistRejectionScreen-BD_J-XYk.js +0 -1
- package/dist/cjs/AuthenticateWithWalletScreen-Cq6uIAU2.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-4-zu3acA.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-D29PTwhu.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-C1mky_bR.js +0 -103
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-C8F1Te8E.js +0 -2
- package/dist/cjs/CaptchaScreen-DBhEtYLQ.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-Dfnox1A2.js +0 -16
- package/dist/cjs/ConnectLedgerScreen-C65stJPS.js +0 -9
- package/dist/cjs/ConnectOnlyLandingScreen-CtEavMfn.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-_MF8WNxi.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dio0_2A7.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-D2KorLaB.js +0 -7
- package/dist/cjs/CrossAppAuthScreen-Hg4b16x6.js +0 -1
- package/dist/cjs/DelegatedActionsConsentScreen-Sexxy676.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-3ghpT6XE.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-Br1aDNP5.js +0 -1
- package/dist/cjs/EmbeddedWalletCreatedScreen-BpEQig7I.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-DjbrcMWa.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-BakLaUGz.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-sIrTUqTo.js +0 -1
- package/dist/cjs/ErrorScreen-CL31INic.js +0 -4
- package/dist/cjs/FarcasterSignerStatusScreen-CZMxSZ2B.js +0 -29
- package/dist/cjs/FiatOnrampScreen-BWE-wzus.js +0 -86
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-e1pL6w1L.js +0 -2
- package/dist/cjs/FundingEditAmountScreen-CIOt-oGd.js +0 -1
- package/dist/cjs/FundingMethodSelectionScreen-BGeCpJBJ.js +0 -1
- package/dist/cjs/InAppBrowserLoginNotPossible-CywcWPkZ.js +0 -1
- package/dist/cjs/InstallWalletScreen-JfaInrUT.js +0 -1
- package/dist/cjs/LandingScreen-CfjeYypD.js +0 -1
- package/dist/cjs/LinkEmailScreen-DFTW39Tg.js +0 -1
- package/dist/cjs/LinkPhoneScreen-C2upPfpV.js +0 -1
- package/dist/cjs/LoginFailedScreen-BIu3aXER.js +0 -1
- package/dist/cjs/ManualTransferScreen-CV6De31D.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BWPXMD7y.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-BUmI5UD9.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-DtN8H9mT.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-DJJ9kTZP.js +0 -1
- package/dist/cjs/MoonpayStatusScreen-w3skMb5T.js +0 -16
- package/dist/cjs/OAuthStatusScreen-G1IaSk2E.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-BsYJUF4P.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-hu8v0vH3.js +0 -3
- package/dist/cjs/PasswordRecoveryScreen-C0fjY1Ij.js +0 -20
- package/dist/cjs/RecoveryOAuthStatusScreen-Bv2UEdKD.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-CFg7-HMy.js +0 -1
- package/dist/cjs/SignRequestScreen-BfqKiJ9G.js +0 -26
- package/dist/cjs/TelegramAuthScreen-D1eqNUPF.js +0 -1
- package/dist/cjs/UpdateEmailScreen-BvoRUAa3.js +0 -1
- package/dist/cjs/UpdatePhoneScreen-a-ISQK3q.js +0 -1
- package/dist/cjs/UserLimitReachedScreen-twyMZzVF.js +0 -1
- package/dist/cjs/WalletInterstitialScreen-D0fMvmub.js +0 -1
- package/dist/cjs/getErc20Balance-CTO0RtgK.js +0 -1
- package/dist/cjs/getErc20TokenInfo-D0BUvlN2.js +0 -1
- package/dist/cjs/index-DchMyzt9.js +0 -174
- package/dist/cjs/smart-wallets-COAgLX4N.js +0 -1
- package/dist/cjs/use-export-wallet-DknByx6S.js +0 -1
- package/dist/cjs/use-export-wallet-_EIyxyle.js +0 -1
- package/dist/cjs/useActiveWallet-BfMD5hzE.js +0 -185
- package/dist/cjs/usePrivy-C-Rab7yP.js +0 -1
- package/dist/cjs/useWalletBalance-v_jFKi4B.js +0 -1
- package/dist/cjs/useWallets-DX7GoSc-.js +0 -1
- package/dist/cjs/useWallets-dikDynAG.js +0 -1
- package/dist/esm/AccountNotFoundScreen-D59Em28p.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-nijRFoNp.mjs +0 -6
- package/dist/esm/AllowlistRejectionScreen-CpZy18yk.mjs +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-BWicCqKg.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-Bca7Dq5r.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-NbFK0A1q.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-cLUlwC9S.mjs +0 -103
- package/dist/esm/AwaitingSolToEvmBridgingScreen-CXPb-Ukz.mjs +0 -2
- package/dist/esm/CaptchaScreen-Cu3_cr8h.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-lD0tNDQe.mjs +0 -16
- package/dist/esm/ConnectEmailForm-bgA9z3L3.mjs +0 -3
- package/dist/esm/ConnectLedgerScreen-BbsW8DSt.mjs +0 -9
- package/dist/esm/ConnectOnlyLandingScreen-D7uxtarL.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-DpKUDVIK.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-BNNYF6Ns.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-Dfv_mgId.mjs +0 -7
- package/dist/esm/CrossAppAuthScreen-BOCFddJL.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-CS1yCHBG.mjs +0 -1
- package/dist/esm/DelegatedActionsRevokeScreen-Cw1FPv8x.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-DGY8j-Si.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-DLR7TF4o.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-ColmQZ-q.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-BRG9dsaW.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-B3cMml6w.mjs +0 -1
- package/dist/esm/ErrorScreen-sNIfGI6q.mjs +0 -4
- package/dist/esm/FarcasterSignerStatusScreen-DqEULwox.mjs +0 -28
- package/dist/esm/FiatOnrampScreen-A5_TNfEg.mjs +0 -86
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-Cy3gO2rc.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-BLmy4zpf.mjs +0 -1
- package/dist/esm/FundingMethodSelectionScreen-CFTtSc8T.mjs +0 -1
- package/dist/esm/InAppBrowserLoginNotPossible-BcEZlehe.mjs +0 -1
- package/dist/esm/InstallWalletScreen-CtJuryxO.mjs +0 -1
- package/dist/esm/LandingScreen-yPpishM-.mjs +0 -1
- package/dist/esm/LinkEmailScreen-C08N0_oz.mjs +0 -1
- package/dist/esm/LinkPhoneScreen-aZRsfGsF.mjs +0 -1
- package/dist/esm/LoginFailedScreen-C8ktIEOG.mjs +0 -1
- package/dist/esm/ManualTransferScreen-DiSMGPNF.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-DnpsjnqC.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-cdXMRh6f.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-_yDQyI2u.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-lPVdBldW.mjs +0 -1
- package/dist/esm/MoonpayStatusScreen-tZ8mdR2X.mjs +0 -16
- package/dist/esm/OAuthStatusScreen-GWwbWdSi.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-Dl5rDsw7.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-2znvW7Lc.mjs +0 -3
- package/dist/esm/PasswordRecoveryScreen-DBLHkrI_.mjs +0 -20
- package/dist/esm/RecoveryOAuthStatusScreen-7cATjPBS.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-OrukIxHX.mjs +0 -1
- package/dist/esm/TelegramAuthScreen-DMBY4HLl.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-Dtbkg-xg.mjs +0 -1
- package/dist/esm/UpdatePhoneScreen-DJzzJhXJ.mjs +0 -1
- package/dist/esm/UserLimitReachedScreen-DsJc40Yi.mjs +0 -1
- package/dist/esm/WalletInterstitialScreen-CK6FWlf-.mjs +0 -1
- package/dist/esm/context-DLtU3JQy.mjs +0 -1
- package/dist/esm/getErc20Balance-o7J9W1su.mjs +0 -1
- package/dist/esm/getErc20TokenInfo-wKW6b8bj.mjs +0 -1
- package/dist/esm/index-YDEix4mU.mjs +0 -174
- package/dist/esm/reservoir-0wfhnc0j.mjs +0 -1
- package/dist/esm/smart-wallets-l4nwJjoH.mjs +0 -1
- package/dist/esm/use-export-wallet-BMt6c-lN.mjs +0 -1
- package/dist/esm/use-export-wallet-_wu5ex5t.mjs +0 -1
- package/dist/esm/useActiveWallet-CvP7iYvj.mjs +0 -185
- package/dist/esm/usePrivy-C_sY2Duk.mjs +0 -1
- package/dist/esm/useWalletBalance-RmRvKAUV.mjs +0 -1
- package/dist/esm/useWallets-BzNCTucF.mjs +0 -1
- package/dist/esm/useWallets-z8NFrORr.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import o from"@heroicons/react/24/outline/QrCodeIcon";import i from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as d,useMemo as s}from"react";import{getAddress as c}from"viem/utils";import{B as l}from"./ModalHeader-BnVmXtvG.mjs";import{t as m}from"./FundWalletMethodHeader-Cb-ACySl.mjs";import{E as u}from"./ErrorBanner-CQERa7bL.mjs";import{I as p}from"./InfoBanner-DkQEPd77.mjs";import{A as h,G as f}from"./GooglePay-DA-Ff7zK.mjs";import{u as g}from"./context-DLtU3JQy.mjs";import{j as y,z as C,A as w}from"./useActiveWallet-CvP7iYvj.mjs";import{a as F,u as v}from"./internal-context-Z-fyxadS.mjs";import{a as b}from"./privy-context-DrMxzgOR.mjs";import{u as W}from"./useWallets-BzNCTucF.mjs";import{W as S}from"./WalletCards-DH1rqayz.mjs";import{g as I}from"./getErc20TokenInfo-wKW6b8bj.mjs";import{monadMainnet as M,avalanche as j,arbitrum as x,polygon as T,optimism as D,base as k,mainnet as A,toCoinbaseAssetId as E,getCoinbaseOnRampUrl as O,chainToMoonpayCurrency as U,isSupportedChainIdForMoonpay as _,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as P}from"@privy-io/popup";import{a as R}from"./index-CvvUk2Lm.mjs";import{e as q,I as z,f as N,g as B}from"./styles-DDaGxKdi.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-_wu5ex5t.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-DmtRo8xi.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-D1p_ntex.mjs";import"./Screen-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";const G=e=>{let[n,t]=r();return d((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function H(e){let n=Q[e];if(!n)throw new F(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let Q={[A.id]:"ethereum",[k.id]:"base",[D.id]:"optimism",[T.id]:"polygon",[x.id]:"arbitrum",[j.id]:"avacchain",[M.id]:"monad"};const $=(e,n,t,a,o,i)=>new Promise((async(r,d)=>{let s=P();if(!s)return void d(Error("Unable to initialize flow"));let c="ethereum"===n.chainType?H(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?E(n.chain.id,"native-currency"):"SOL",m=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[c]}],assets:[l]}),{url:u}=O({appId:e.getAppId(),input:m,amount:n.amount,blockchain:c,asset:l,experience:i});s.location=u.toString();let p={...o?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),t({funding:p,solanaFundingData:o?.solanaFundingData,coinbaseOnrampStatus:{popup:s}}),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:p,solanaFundingData:o?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:m.partner_user_id,popup:s}})}),5e3),r()})),X=async(e,n,t,a,o,i,r,d)=>{let s=P();if(!s)throw Error("Unable to initialize flow");let c="ethereum"===n.chainType?U(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:m}=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:d,currencyCode:c,quoteCurrencyAmount:R(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}}),s.location=l;let u={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1),o({moonpayStatus:{},funding:u,solanaFundingData:r?.solanaFundingData}),i("MoonpayStatusScreen"),setTimeout((()=>{o({moonpayStatus:{externalTransactionId:m},funding:u,solanaFundingData:r?.solanaFundingData})}),8e3)};let J=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const K=()=>J("https://apple.com/apple-pay"),V=()=>J("https://google.com/pay"),Y={component:()=>{let{wallets:r}=W(),{connectors:F}=v(),M=F.filter(y).flatMap((e=>e.wallets)),{navigate:j,data:x,setModalData:T}=b(),{client:D}=v(),k=g(),A=x?.funding,E=G(K),O=G(V),U="solana"===A.chainType,P=U?void 0:A,R=s((()=>((e,n,t,a,o,i)=>{let r,d,s="solana"===t.chainType,c=s?void 0:t,l=t.isUSDC?"USDC":c?.erc20Address?void 0:"native-currency",m=!!s||l&&_(Number(t.chain.id),l),u=!!s||l&&L(Number(t.chain.id),l),p=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&u&&p.push((()=>$(n,t,a,o,i,"buy"))),"card"===r.method&&"moonpay"===r.provider&&m&&l&&p.push((()=>X(n,t,e,l,a,o,i,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&u&&(r=()=>$(n,t,a,o,i,"buy"));for(let e of i?.funding?.supportedOptions??[])"wallets"===e.method&&(d=()=>o("TransferFromWalletScreen"));return{onFundWithCard:p,onFundWithExchange:r,onFundWithWallet:d}})(k,D,A,T,j,x)),[k,D,A,x,T,j]),H=U?M.find((({address:e})=>e===A.address)):r.find((({address:e})=>c(e)===c(A.address))),Q=C(H?.walletClientType||"unknown"),J=Q?.name||"wallet",Y=H&&"privy"!==H.walletClientType?J:k.name,Z=s((()=>A.uiConfig?.landing?.title?A.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[A.uiConfig?.landing?.title,Y]);d((()=>{if(A?.defaultFundingMethod&&A.usingDefaultFundingMethod)switch(T({funding:{...A,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),A?.defaultFundingMethod){case"card":R.onFundWithCard[0]&&R.onFundWithCard[0]();break;case"exchange":R.onFundWithExchange&&R.onFundWithExchange();break;case"wallet":R.onFundWithWallet&&R.onFundWithWallet();break;case"manual":j("ManualTransferScreen")}}),[]),d((()=>{P?.erc20Address&&!P.erc20ContractInfo&&I({address:P.erc20Address,chain:P.chain,rpcConfig:k.rpcConfig,privyAppId:k.id}).then((e=>{T({...x,funding:{...P,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[P?.erc20Address,P?.chain]);let ee=!(!P?.erc20Address||P?.erc20ContractInfo);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(m,{}),/*#__PURE__*/t("h3",{children:Z}),/*#__PURE__*/e(q,{children:[A.errorMessage&&/*#__PURE__*/t(u,{theme:k.appearance.palette.colorScheme,children:A.errorMessage}),R.onFundWithCard?.[0]&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithCard[0],children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(a,{style:{width:24}})}),"Pay with card",E?/*#__PURE__*/t(h,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):O?/*#__PURE__*/t(f,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),R.onFundWithExchange&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithExchange,children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(i,{style:{width:24}})}),"Transfer from an exchange"]}),R.onFundWithWallet&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithWallet,children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(S,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/e(w,{disabled:ee,onClick:()=>j("ManualTransferScreen"),children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(o,{style:{width:24}})}),"Receive funds"]}),A?.showAlternateFundingMethod&&R.onFundWithCard?.[1]&&/*#__PURE__*/t(p,{theme:k.appearance.palette.colorScheme,children:/*#__PURE__*/e(N,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/t(B,{onClick:R.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/t(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-D1p_ntex.mjs";import"ofetch";import"react";import"./ModalHeader-BnVmXtvG.mjs";import"styled-components";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.mjs";import"./privy-context-DrMxzgOR.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-Cycy3IzT.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"./privy-context-DrMxzgOR.mjs";import{S as n}from"./ScreenLayout-D1p_ntex.mjs";import"styled-components";import"lucide-react";import"react";import"@privy-io/are-addresses-equal";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-BnVmXtvG.mjs";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-Cycy3IzT.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-DLtU3JQy.mjs";import{C as o,L as i}from"./CustomLandingScreenView-BxAx1Co_.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-BnVmXtvG.mjs";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-BzNCTucF.mjs";import"./privy-context-DrMxzgOR.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-YDEix4mU.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-C_sY2Duk.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-pxEyo8WM.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-B84kEIjT.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-C4fmUAf3.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";import"./ConnectEmailForm-bgA9z3L3.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-DP4LRtUG.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-CPDxFP5w.mjs";import"./ScreenLayout-D1p_ntex.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-bgA9z3L3.mjs";import{B as i}from"./Layouts-BlFm53ED.mjs";import{u as e}from"./context-DLtU3JQy.mjs";import{S as m}from"./ScreenLayout-D1p_ntex.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./index-YDEix4mU.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./privy-context-DrMxzgOR.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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-BnVmXtvG.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-Cycy3IzT.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-DP4LRtUG.mjs";import{u as i}from"./context-DLtU3JQy.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./privy-context-DrMxzgOR.mjs";import{S as a}from"./ScreenLayout-D1p_ntex.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./ModalHeader-BnVmXtvG.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-Cycy3IzT.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"./privy-context-DrMxzgOR.mjs";import{S as i}from"./ScreenLayout-D1p_ntex.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-BnVmXtvG.mjs";import"styled-components";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-Cycy3IzT.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 a}from"react";import{formatUnits as s}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c,B as d}from"./ModalHeader-BnVmXtvG.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-B84kEIjT.mjs";import{t as u}from"./FundWalletMethodHeader-Cb-ACySl.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-CEcdukTg.mjs";import{u as y}from"./context-DLtU3JQy.mjs";import{j}from"./useActiveWallet-CvP7iYvj.mjs";import{u as C}from"./internal-context-Z-fyxadS.mjs";import{a as S}from"./privy-context-DrMxzgOR.mjs";import{u as I}from"./useWalletBalance-RmRvKAUV.mjs";import{u as T}from"./useWallets-BzNCTucF.mjs";import{O as b}from"./analytics-mkkvFRju.mjs";import{x as w,z as A}from"./index-YDEix4mU.mjs";import{g as k}from"./getChainName-DjpPdUSc.mjs";import{g as F}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as x}from"./getErc20Balance-o7J9W1su.mjs";import{v as D}from"./use-export-wallet-_wu5ex5t.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-N-mzBgMy.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-C_sY2Duk.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 U={component:()=>{let{wallets:A}=T(),{connectors:U}=C(),$=U.filter(j).flatMap((e=>e.wallets)),{data:E,setModalData:L,navigate:W,lastScreen:P}=S(),{rpcConfig:O,appId:q,createAnalyticsEvent:z,closePrivyModal:H}=C(),N=y(),[Q,R]=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)):A.find((({address:e})=>D(e)===D(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=N.solanaRpcs[G.chain];e?(G.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=o.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:G.address,mintAddress:F(G.chain)}):w({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);Q&&r>Q&&(Y(!0),z({eventName:b,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-Q,6):s(r-Q,9),token:G.isUSDC?"USDC":"SOL"}})),R(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 x({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:O,appId:q});return e}})().then((e=>{Q&&e>Q&&(Y(!0),z({eventName:b,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-Q,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),R(e)})).catch((()=>R(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[Q]);let _=a((()=>null==Q?"":G.isUSDC?n({amount:Q,decimals:6}):K?M(Q,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:Q,decimals:G.erc20ContractInfo.decimals}):m({wei:Q})),[Q,K,G]),ee="ethereum"===G.chainType?G.chain.name:k(G.chain),re=a((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(v,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=a((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&F(G.chain)?`?spl-token=${F(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:B}),/*#__PURE__*/t(f,{theme:N.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:()=>H({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let B=({...r})=>/*#__PURE__*/e(A,{color:"black",...r});export{U as ManualTransferScreen,U as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{M as s,b as a,P as m}from"./ModalHeader-BnVmXtvG.mjs";import{L as l}from"./useActiveWallet-CvP7iYvj.mjs";import{u as c}from"./context-DLtU3JQy.mjs";import{u as p,a as u}from"./privy-context-DrMxzgOR.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-V5tLY1MZ.mjs";import{A as v,C as j,I as k,T as g,S as C,B as M}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-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-sNIfGI6q.mjs";import"lucide-react";import"./index-YDEix4mU.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-C_sY2Duk.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-D1p_ntex.mjs";import"./Screen-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-DmtRo8xi.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-B84kEIjT.mjs";import"qrcode";const w={component:()=>{let{user:w,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:A}=u(),S=c(),[P,R]=n(null),[x,E]=n(null),[F,L]=n(null),[T,U]=n(!1),[B,W]=n(!1),[q,O]=n(),z=async()=>{q?D(q):w?await H({user:w}):D(Error("Must be logged in to manage MFA")),setTimeout((()=>{R(null),E(null)}),500)};if(A.current=z,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:D,onSuccess:H,onBack:Q,mfaMethods:X,verify:$,generateTotpSecret:G,enrollTotp:K,unenrollTotp:N,enrollPasskey:V}=I.mfaEnroll,Z=w?.mfaMethods.includes("sms"),J=w?.mfaMethods.includes("totp"),Y=w?.mfaMethods.includes("passkey"),_=!!w?.phone,ee=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){R(null),E(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await V(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),U(!1)}}if(!b||!w||!S)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{onClose:z,backFn:Q},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(l,{})}),/*#__PURE__*/t(a,{})]});if("sms"===P)return null;if("totp"===P)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:z},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(C,{children:["MFA adds an extra layer of security to your ",S?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await N();return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:B,children:"Remove"})}),/*#__PURE__*/t(a,{})]});if("passkey"===P){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:z},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(C,{children:i?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V([]);return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:B,children:"Remove"})}),/*#__PURE__*/t(a,{})]})}return 0!==X.length||Z||J||Y?"sms"===x?null:"totp"===x&&F?/*#__PURE__*/t(h,{onClose:z,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await K(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),R(null)}}(e.mfaCode),error:q,totpInfo:{...F,appName:S?.name||"Privy"}}):"passkey"===x?/*#__PURE__*/t(y,{onReset:oe,onClose:z,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:w.mfaMethods,appMfaMethods:S.mfa.methods,userHasAuthSms:_,backFn:Q,handleSelectMethod:async function(e){O(void 0);try{await $()}catch(e){return void O(e)}return"totp"===e?(E(e),L(null),void G().then((({totpSecret:e,totpAuthUrl:o})=>{L({authUrl:o,secret:e})})).catch((()=>{L(null),oe()}))):"passkey"===e&&1===ee.length?await te():void E(e)},isTotpLoading:"totp"===x&&!F,isPasskeyLoading:T,error:q,onClose:z,setRemovingMfaMethod:async function(e){O(void 0);try{await $()}catch(e){return void O(e)}R(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(s,{onClose:z,backFn:Q},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[S?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(m,{onClick:z,children:"Close"})}),/*#__PURE__*/t(a,{})]})}};export{w as MfaAuthEnrollmentFlowScreen,w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{useMemo as e,useState as r,useEffect as t,useRef as i}from"react";import{u as s}from"./context-DLtU3JQy.mjs";import{u as m,a as n}from"./privy-context-DrMxzgOR.mjs";import{V as a,a as c,b as p,t as l}from"./to-ui-error-YOQlKk5D.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-BnVmXtvG.mjs";import"styled-components";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-D1p_ntex.mjs";import"./Screen-Cycy3IzT.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-LPJMl6JV.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./index-YDEix4mU.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-C_sY2Duk.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-DqFIa7IO.mjs";import"./WalletLink-DNbGmOPX.mjs";import"./ethers-Dnv1tMN3.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u={component:()=>{let{user:u}=m(),d=s(),h=e((()=>u?.mfaMethods.filter((o=>"passkey"!==o||!d.globalDisablePasskeys))??[]),[u?.mfaMethods,d.globalDisablePasskeys]),{data:f}=n(),[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:A,sendSmsCode:E}=f.mfaVerify,F=async o=>{if("passkey"!==o)try{j(o),"sms"===o&&(j(o),await E()),"totp"===o&&j(o)}catch(o){console.error(o)}else try{j(o);let e=await I();if(!e)throw Error("something went wrong");w(e),await x(e),k(!0),C(void 0),S()}catch(o){C(l(o))}},B=async o=>{C(void 0);try{if(!o||!y)return;if("passkey"===y){if(!g)throw Error("Missing passkey challenge");await x(g)}else"sms"===y?await A(o):"totp"===y&&await P(o);C(void 0),k(!0),S()}catch(o){throw l(o).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__*/o(a,{account:u.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,e)=>e.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:b?.isBlocking??!1,error:b?.error,onClose:L,onBack:()=>{j(void 0),C(void 0)},handleSubmit:()=>B(g).catch(C)}):"sms"===y||"totp"===y?/*#__PURE__*/o(c,{selectedMethod:y,submitSuccess:v,hasBlockingError:b?.isBlocking??!1,handleSubmitCode:B,onClose:L,onBack:h.length>1?()=>j(void 0):void 0}):/*#__PURE__*/o(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-BnVmXtvG.mjs";import{L as u}from"./useActiveWallet-CvP7iYvj.mjs";import{u as p}from"./context-DLtU3JQy.mjs";import{u as y}from"./internal-context-Z-fyxadS.mjs";import{a as f,u as v}from"./privy-context-DrMxzgOR.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-YDEix4mU.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-V5tLY1MZ.mjs";import P from"@heroicons/react/24/outline/CheckCircleIcon";import F from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as x}from"@privy-io/js-sdk-core";import{C as R}from"./ConnectPhoneForm-DP4LRtUG.mjs";import{I as W,T as L,S as T,C as A,a as B,B as U,N,A as O,L as q,b as D,c as Y}from"./PinInput-3SLvbnQa.mjs";import{ErrorScreenView as $}from"./ErrorScreen-sNIfGI6q.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-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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-DmtRo8xi.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-D1p_ntex.mjs";import"./Screen-Cycy3IzT.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-B84kEIjT.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 D(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e($,{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(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(L,{children:"Set up SMS verification"}),/*#__PURE__*/o(T,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(R,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),h(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(B,{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:D},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(L,{children:"SMS verification added"}),/*#__PURE__*/o(T,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(U,{children:/*#__PURE__*/e(d,{onClick:D,children:"Done"})}),/*#__PURE__*/e(m,{})]}:{children:[/*#__PURE__*/e(c,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(L,{children:"Enter enrollment code"}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(N,{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(T,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:x(s)})]})]}),/*#__PURE__*/e(m,{})]})},H={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,P]=a(null),{unenrollWithSms:F,unenrollWithTotp:x,unenrollWithPasskey:R,submitEnrollmentWithTotp:B,initEnrollmentWithPasskey:N,submitEnrollmentWithPasskey:$,initEnrollmentWithTotp:H}=C(),{data:Q,onUserCloseViaDialogOrKeybindRef:V}=f(),X=p(),{closePrivyModal:G}=y(),{promptMfa:K}=b(),[Z,J]=a(!1),[_,ee]=a(null),[oe,re]=a(null),te=()=>{G({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{P(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();V.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 N(),await $({credentialIds:e},{removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&J(!0)}),[he]),!g||!w||!X/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(A,{children:/*#__PURE__*/e(u,{})}),/*#__PURE__*/e(m,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(L,{children:"Remove SMS verification?"}),/*#__PURE__*/o(T,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(U,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await F()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(L,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(T,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(U,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await x()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("passkey"===j){let n=Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(L,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(T,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(U,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await R({removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]})}if(0===Q.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(L,{children:"Add more security"}),/*#__PURE__*/o(T,{children:[X?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(U,{children:/*#__PURE__*/e(d,{onClick:te,children:"Close"})}),/*#__PURE__*/e(m,{})]});let fe=!he&&!Z;return fe?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(L,{children:"Transaction Protection"}),/*#__PURE__*/e(T,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(q,{children:[/*#__PURE__*/o(D,{children:[/*#__PURE__*/e(Y,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",X?.name," wallet."]}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/e(Y,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(U,{children:[/*#__PURE__*/e(d,{onClick:()=>J(!0),children:"Continue"}),/*#__PURE__*/e(h,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(m,{})]}):"sms"===_?/*#__PURE__*/e(z,{appName:X?.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 B({mfaCode:e}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{P(null)}}(e),totpInfo:{...oe,appName:X?.name||"Privy"}}):"passkey"===_?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:ye}):/*#__PURE__*/e(I,{showIntro:fe,userMfaMethods:w.mfaMethods,appMfaMethods:X.mfa.methods,userHasAuthSms:ce,backFn:function(){J(!1)},handleSelectMethod:async function(e){try{await K()}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 K()}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-DLtU3JQy.mjs";import{u as m}from"./privy-context-DrMxzgOR.mjs";import{u as n}from"./index-YDEix4mU.mjs";import{V as a,a as c,b as l,t as p}from"./to-ui-error-YOQlKk5D.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-CvP7iYvj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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-BnVmXtvG.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-D1p_ntex.mjs";import"./Screen-Cycy3IzT.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-LPJMl6JV.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./TransactionDetails-DqFIa7IO.mjs";import"./WalletLink-DNbGmOPX.mjs";import"./ethers-Dnv1tMN3.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,x]=e(null),[C,P]=e();r((()=>{v(j[0]??null)}),[j]);let S=i(!1);async function M(o){P(void 0);try{if(!o||!f)return;await g(f,o),w(!0),P(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");x(t),await g(o,t),w(!0),P(void 0),u()}catch(o){P(p(o))}}r((()=>{!S.current&&f&&(S.current=!0,A(f).finally((()=>{S.current=!1})))}),[]);let B=()=>{v(null),P(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:C?.isBlocking??!1,error:C?.error,onClose:B,onBack:()=>{v(null),P(void 0)},handleSubmit:()=>M(I).catch(P)}):f?/*#__PURE__*/o(c,{submitSuccess:b,hasBlockingError:C?.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 r,jsxs as e,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-BnVmXtvG.mjs";import{a as m}from"./Layouts-BlFm53ED.mjs";import{L as d,O as u}from"./useActiveWallet-CvP7iYvj.mjs";import{u as p}from"./context-DLtU3JQy.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./privy-context-DrMxzgOR.mjs";import{u as g}from"./index-CvvUk2Lm.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-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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__*/r("svg",{width:t,height:t,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:/*#__PURE__*/e("g",{id:"moonpay_symbol_wht 2",children:[/*#__PURE__*/r("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),/*#__PURE__*/r("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 e(t,{children:[/*#__PURE__*/r(s,{title:"Fund account",backFn:()=>{let r={...o?.funding,showAlternateFundingMethod:!0};r.usingDefaultFundingMethod&&(r.usingDefaultFundingMethod=!1),i({funding:r,solanaFundingData:o?.solanaFundingData}),n()}}),/*#__PURE__*/r(C,{status:d,onClickCta:c}),/*#__PURE__*/r(l,{})]})}};let C=({status:o,onClickCta:i})=>{let{title:a,body:s,cta:l}=n((()=>(r=>{switch(r){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 e(t,{children:[/*#__PURE__*/e(b,{children:[/*#__PURE__*/r(w,{status:o}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/r("h3",{children:a}),/*#__PURE__*/r(x,{children:s})]})]}),l&&/*#__PURE__*/r(c,{onClick:i,children:l})]})},w=({status:t})=>{if(!t||"pending"===t){let t="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/r(d,{color:t,style:{position:"absolute"}}),/*#__PURE__*/r(u,{color:t}),/*#__PURE__*/r(y,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let n=(e=>{switch(e){case"completed":return i;case"waitingAuthorization":return()=>/*#__PURE__*/r(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 r("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/r(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"./privy-context-DrMxzgOR.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 v,G as h}from"./twitter-BoAxhlj6.mjs";import y from"@heroicons/react/24/outline/GlobeAltIcon";import{T as f,L as g}from"./twitch-5IOe4sIQ.mjs";import{u as E,q as A}from"./context-DLtU3JQy.mjs";import{b as T,u as S,k as w}from"./internal-context-Z-fyxadS.mjs";import{s as _}from"./shouldProceedtoEmbeddedWalletCreationFlow-D2ZT5lW9.mjs";import{S as b}from"./ScreenLayout-D1p_ntex.mjs";import{e as C}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{l as j}from"./index-YDEix4mU.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-BnVmXtvG.mjs";import"styled-components";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-Cycy3IzT.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-C_sY2Duk.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:h},discord:{name:"Discord",component:v},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:g},twitch:{name:"Twitch",component:f},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:v,loginWithOAuth:h,updateWallets:y,setReadyToTrue:f,closePrivyModal:g,createAnalyticsEvent:b}=S(),[C,O]=r(!1),[R,N]=r(void 0),k=u()?.provider||"google",{name:P,component:x}=U(k,p.customOAuthProviders);return o((()=>{h(k).then((()=>{O(!0),f(!0)})).catch((e=>{if(f(!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((()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0})),A);return y(),()=>clearTimeout(e)}}}),[s,t,C,m]),/*#__PURE__*/e(L,{providerName:P,ProviderLogo:x,success:C,errorMessage:R,onRetry:R?.retryable?()=>{j(),v(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-YDEix4mU.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./privy-context-DrMxzgOR.mjs";import{S as a}from"./ScreenLayout-D1p_ntex.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"./context-DLtU3JQy.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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-BnVmXtvG.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-Cycy3IzT.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-DLtU3JQy.mjs";import{c,b as m,u}from"./internal-context-Z-fyxadS.mjs";import{a as p,u as l}from"./privy-context-DrMxzgOR.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-D2ZT5lW9.mjs";import{S as y}from"./ScreenLayout-D1p_ntex.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-YDEix4mU.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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-BnVmXtvG.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-Cycy3IzT.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(v,{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}=p(),m=a(),{loginWithPasskey:y,signupWithPasskey:f,closePrivyModal:v,createAnalyticsEvent:g}=u(),{user:w,logout:j}=l(),{passkeySignupFlow:k}=r?.passkeyAuthModalData??{},S=n-500,[b,A]=t("loading"),[C,P]=t(null),x=o([]),E=e=>{x.current=[e,...x.current]};s((()=>()=>{x.current.forEach((e=>clearTimeout(e))),x.current=[]}),[]);let W=async()=>{A("loading");try{k?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 E(setTimeout((()=>{c("AffirmativeConsentScreen")}),S));if(!d(w,m?.embeddedWallets))return void E(setTimeout((()=>{v({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),n));E(setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"PasskeyStatusScreen"}}),j()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,b]),s((()=>{W()}),[]),/*#__PURE__*/e(h,{status:b,passkeySignupFlow:k,error:C,onRetry:W})}};let v=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"./privy-context-DrMxzgOR.mjs";import{P as m}from"./ModalHeader-BnVmXtvG.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-DhWmkz5T.mjs";import{n as f}from"./index-YDEix4mU.mjs";import{u as w,m as j}from"./internal-context-Z-fyxadS.mjs";import{S as g}from"./Screen-Cycy3IzT.mjs";import"@privy-io/are-addresses-equal";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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:W,data:T,onUserCloseViaDialogOrKeybindRef:_}=l(),[E,R]=t(void 0),[U,H]=t(""),[M,F]=t(!1),{entropyId:N,entropyIdVerifier:O,onCompleteNavigateTo:V,onSuccess:$,onFailure:z}=T.recoverWallet,L=(e="User exited before their wallet could be recovered")=>{I({shouldCallAuthOnSuccess:!1}),z("string"==typeof e?new j(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(g,{children:[/*#__PURE__*/r(g.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(g.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:M,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)})})]}),!!U&&/*#__PURE__*/r(k,{children:U})]})})}),/*#__PURE__*/e(g.Footer,{children:[/*#__PURE__*/r(g.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(g.Actions,{children:/*#__PURE__*/r(A,{loading:M||!C,disabled:!E,onClick:async()=>{F(!0);let e=await S.getAccessToken(),r=c(b,N);if(!e||!r||null===E)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:E})),H(""),V?W(V):I({shouldCallAuthOnSuccess:!1}),$?.(r),P({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}})}catch(e){f(e)?H("Invalid recovery password, please try again."):H("An error has occurred, please try again.")}finally{F(!1)}},$hideAnimations:!N&&M,children:"Recover your account"})}),/*#__PURE__*/r(g.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-BnVmXtvG.mjs";import{C as n}from"./ScreenHeader-CHmc4-Lu.mjs";import{q as d}from"./context-DLtU3JQy.mjs";import{o as p,q as u,r as m,v,R as h,l as w}from"./index-YDEix4mU.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"./privy-context-DrMxzgOR.mjs";import{a8 as b,a9 as R,aa as k}from"./paths-3HW55qZg.mjs";import{g as T}from"./useWallets-BzNCTucF.mjs";import{a as O}from"./events-context-CI0iqAXA.mjs";import{A as x,G as N,R as S}from"./styles-BsotlekN.mjs";import"styled-components";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.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-C_sY2Duk.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:N},icloud:{name:"iCloud",component:x}};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")}}}})(),[x,N]=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}),N(!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(!x)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)}),[x]);let Y=i((async()=>{await K.execute("recover"),G?u(G):N(!0)}),[]),X="google-drive"===W?"Google Drive":"Apple iCloud",Q=x&&`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(S,{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:!x&&!z?.retryable,children:"Try again"}):null]})}):/*#__PURE__*/e(S,{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-DLtU3JQy.mjs";import{v as i,R as s}from"./index-YDEix4mU.mjs";import{u as a,m as n}from"./internal-context-Z-fyxadS.mjs";import{a as c,u as m}from"./privy-context-DrMxzgOR.mjs";import{S as l,g as p}from"./SetWalletPasswordForm-CbtQ4DZ1.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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-BnVmXtvG.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-DhWmkz5T.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(""),[j,f]=o(!1),[C,I]=o(),[g,x]=o(null),{create:b}=i(),{authenticated:P,user:S}=m(),{closePrivyModal:A,isNewUserThisSession:U,initializeWalletProxy:k}=a(),{onSuccess:E,onFailure:M,callAuthOnSuccessOnClose:T,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:C,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:C,chainType:"solana",walletIndex:0,latestUser:S});else{if(!O)throw Error("Invalid args to create wallet");e=await b({recoveryMethod:"user-passcode",recoveryPassword:C,chainType:"ethereum",walletIndex:0,latestUser:S})}L(e),U?u("EmbeddedWalletCreatedScreen"):(E(e),A({shouldCallAuthOnSuccess:T}))}catch(e){v(e.message)}}));t((()=>{g||k(3e4).then((e=>x(e)))}),[g]),t((()=>{if(!P||!S)return u("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet"))}),[P]),h.current=()=>null;/*#__PURE__*/return e(l,{config:{initiatedBy:"automatic"},appName:w?.name||"privy",loading:!g,buttonLoading:j,buttonHideAnimations:!D&&j,isResettingPassword:!1,error:y,password:C||"",onClose:()=>{D&&"user-passcode"!==D.account.recoveryMethod?(M(new n("User created a wallet but failed to set a password for it")),A({shouldCallAuthOnSuccess:!1})):D?(E(D),A({shouldCallAuthOnSuccess:T})):(M(new n("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))},onPasswordChange:I,onPasswordGenerate:()=>I(p()),onSubmit:async()=>(f(!0),R.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>f(!1))))})}};export{u as EmbeddedWalletPasswordCreateScreen,u as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,m as i,C as a}from"./index-YDEix4mU.mjs";import{u as s,q as n}from"./context-DLtU3JQy.mjs";import{u as m,b as l,k as c}from"./internal-context-Z-fyxadS.mjs";import{u as d,a as u}from"./privy-context-DrMxzgOR.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-D2ZT5lW9.mjs";import{S as v}from"./ScreenLayout-D1p_ntex.mjs";import{T as y}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-C_sY2Duk.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"tinycolor2";import"./ModalHeader-BnVmXtvG.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-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";const g=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(v,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:y,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},f={component:()=>{let{authenticated:v,logout:y,ready:f,user:h}=d(),{setModalData:A,navigate:j,resetNavigation:b,data:T}=u(),S=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:x}=m(),[L,k]=t(!1),[M,I]=t(void 0),D=o();async function N(){try{let e=await async function(){let e;if(!v){if(D.enabled&&"error"===D.status)throw new a(D.error,null,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),k(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return I(void 0),b(),void j("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),I(void 0),b(),void j("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return I(void 0),b(),void j("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return I(void 0),b(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:x()?.telegramAuthResult,telegramWebAppData:x()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void j("LinkConflictScreen");let{retryable:t,detail:r}=i(e);I({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{N()}),[]),r((()=>{if(!(f&&v&&L&&h))return;if(S?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let e=setTimeout((()=>{j("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(h,S.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),y()},callAuthOnSuccessOnClose:!0}}),j("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[f,v,L,h]);/*#__PURE__*/return e(g,{success:L,errorMessage:M,onRetry:M?.retryable?async()=>{try{I(void 0),T?.telegramAuthModalData?.seamlessAuth||await C(void 0,T?.login?.disableSignup),await N()}catch(e){let{retryable:t,detail:r}=i(e);I({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{f as TelegramAuthScreen,g as TelegramAuthScreenView,f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-BlFm53ED.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-DLtU3JQy.mjs";import{a as l}from"./index-YDEix4mU.mjs";import{u as c}from"./internal-context-Z-fyxadS.mjs";import{u as d,a as p}from"./privy-context-DrMxzgOR.mjs";import{C as u}from"./useActiveWallet-CvP7iYvj.mjs";import{B as h}from"./use-export-wallet-_wu5ex5t.mjs";import{E as v,P as f}from"./ModalHeader-BnVmXtvG.mjs";import{I as j,E as y}from"./EmailInputForm-Dgoii4vf.mjs";import{E as g}from"./ErrorMessage-D8VaAP5m.mjs";import{S as w}from"./ScreenLayout-D1p_ntex.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BzNCTucF.mjs";import"viem";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-C_sY2Duk.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";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/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,j]=m(""),[y,w]=m(""),[k,S]=m(!1),{authenticated:x,user:A}=d(),{initUpdateEmail:C}=c(),{navigate:I,setModalData:P,currentScreen:M}=p(),{enabled:T,token:U}=l(),L=n(),q=h(s)&&(L.disablePlusEmails&&s.includes("+")?(y||w("Please enter a valid email address without a '+'."),!1):(y&&w(""),!0)),D=k||!q,W=()=>{!T||U||x?(async e=>{if(!A?.email)throw Error("User is required to have an email address to update it.");S(!0);try{await C({oldAddress:A.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){P({errorModalData:{error:e,previousScreen:M||"LandingScreen"}}),I("ErrorScreen")}S(!1)})(U):(P({captchaModalData:{callback:e=>{if(!A?.email)throw Error("User is required to have an email address to update it.");return C({oldAddress:A.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[y&&/*#__PURE__*/t(g,{style:{marginTop:"0.25rem",textAlign:"left"},children:y}),/*#__PURE__*/e(E,{$error:!!y,children:[/*#__PURE__*/t(u,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&W()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(v,{isSubmitting:k,onClick:W,disabled:D,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(f,{loadingText:null,loading:k,disabled:D,onClick:W,style:{width:"100%"},children:"Submit"}):null]})}));let b=j,E=y;const S=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),x={component:()=>/*#__PURE__*/t(S,{})};export{x as UpdateEmailScreen,S as UpdateEmailScreenView,x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-DP4LRtUG.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as n,u as m}from"./privy-context-DrMxzgOR.mjs";import{S as a}from"./ScreenLayout-D1p_ntex.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-DLtU3JQy.mjs";import"tinycolor2";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./ModalHeader-BnVmXtvG.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"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,p]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{p(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:p}=m(),{initUpdatePhone:u}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!p?.phone?.number)throw Error("User is required to have an phone number to update it.");await u(p?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{a as e}from"./privy-context-DrMxzgOR.mjs";import{S as o}from"./ScreenLayout-D1p_ntex.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-BnVmXtvG.mjs";import"styled-components";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";const r=({style:e,...o})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...o,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),i=({title:e="Unable to sign in",subtitle:i="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(o,{title:e,subtitle:i,icon:r,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:o}=e();/*#__PURE__*/return t(i,{onGoBack:()=>{o("LandingScreen")}})}};export{n as UserLimitReachedScreen,i as UserLimitReachedScreenView,n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{u as o,a as i}from"./privy-context-DrMxzgOR.mjs";import{S as r}from"./ScreenLayout-D1p_ntex.mjs";import"@privy-io/are-addresses-equal";import"./context-DLtU3JQy.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-BnVmXtvG.mjs";import"styled-components";import"./useActiveWallet-CvP7iYvj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-_wu5ex5t.mjs";import"./useWallets-BzNCTucF.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-Cycy3IzT.mjs";import"./index-Dq_xe9dz.mjs";const n=({title:e,subtitle:o,buttonText:i,buttonHref:n,isLoading:l=!1,helpText:a,onButtonClick:s})=>/*#__PURE__*/t(r,{title:e,subtitle:o,primaryCta:{label:i,onClick:()=>{n&&window.open(n,"_self"),s?.()},disabled:l},helpText:a,watermark:!0}),l={component:()=>{let{ready:r}=o(),{data:l}=i(),[a,s]=e(!1);if(!l?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:m,connectOnly:c,chainType:p}=l.installWalletModalData,u=m.getMobileRedirect({useUniversalLink:!a,isSolana:"solana"===p,connectOnly:c}),d=m.name.replace(/ wallet/gi,""),h={title:`Redirecting to ${d} Mobile Wallet`,description:`We'll take you to the ${d} Mobile Wallet app to continue your login experience.`,footnote:""};return r&&(h.description=`For the best experience, we'll automatically log you into the ${d} Mobile Wallet in-app browser.`,h.footnote="You can always return here to login via other methods."),a&&(h.title="Still here?",h.description=`You may need to install the ${m.name} mobile app.`,h.footnote=`Once you're done, you can connect with ${m.name} wallet to complete the login.`),/*#__PURE__*/t(n,{title:h.title,subtitle:h.description,buttonText:a?"Go to App Store":"Continue",buttonHref:u,isLoading:r&&!u,helpText:h.footnote||void 0,onButtonClick:()=>{setTimeout((()=>s(!0)),1e3)}})}};export{l as WalletInterstitialScreen,n as WalletInterstitialScreenView,l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,createContext as o,useContext as l}from"react";import{dedupeSupportedChains as r,DEFAULT_SUPPORTED_CHAINS as i,mainnet as s}from"@privy-io/js-sdk-core";import c from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.18.0",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",y="privy-id-token",F="privy-session",C="privy:caid",M=e=>`privy:guest:${e}`,A=e=>`privy:cross-app:${e}`,E="privy:state_code",x="privy:code_verifier",D="privy:headless_oauth",B="privy:oauth_disable_signup",W=e=>`privy:wallet:${e}`,L="privy:connections",S=12e4,H=1,I="0x1",O=3e4,U="https://api.moonpay.com/v1",P="https://api.moonpay.com/v1",q="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated",T={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect","phantom"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let N=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet"]),$=e=>N.has(e),z=(e,t,a)=>a.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($).filter(z):e?e.filter($).filter(z):T.appearance.walletList;let G=/paymaster\.biconomy\.io\/api/i,J={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const V=(e,t)=>e&&G.test(e)?J:t&&t.policy_id?{policyId:t.policy_id}:void 0;function K(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function X(e,t){let a=e.getLuminance(),n=t.getLuminance();return(Math.max(a,n)+.05)/(Math.min(a,n)+.05)}function Z(e,t){if(!e){let e=t?ee:te;return{accent:c(e.background.interactive),accentLight:c(e.background.interactive),accentHover:c(e.background["interactive-hover"]),accentDark:c(e.background["interactive-clicked"]),accentDarkest:c(e.background["interactive-disabled"])}}let a=c(e);return{accent:a,accentLight:K(a,.15),accentHover:K(a,.3),accentDark:K(a,-.06),accentDarkest:K(a,-.6)}}function Q({backgroundTheme:e,accentHex:t}){let a,n;"light"===e?a=!1:"dark"===e?a=!0:(a=.5>=c(e).getLuminance(),n=c(e).toHslString());let o=a?"dark":"light",l=a?ee:te,{accent:r,accentLight:i,accentHover:s,accentDark:d,accentDarkest:u}=Z(t,a),g=function(e){let t=c(te.text.default),a=c(ee.text.default),n=X(e,t),o=X(e,a),l=e.toHsl();return l.h>=220&&l.h<=300&&o>=3?ee.text.default:n>o?te.text.default:ee.text.default}(r),h=c(g),f=X(r,c(l.background.default))>=3;return{colorScheme:o,background:n||l.background.default,background2:l.background.elevated,background3:l.background.interactive,foreground:l.text.default,foreground2:l.text.muted,foreground3:l.text.placeholder,foreground4:l.border.default,accent:r.toHslString(),accentLight:i.toHslString(),accentHover:s.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:l.background.success,successDark:l.text.success,successLight:l.background.success,error:l.text.error,errorLight:l.background.error,warn:l.background.warning,warnLight:l.background.warning,warningDark:l.text.warning,errorDark:l.text.error,successBg:l.background.success,errorBg:l.background.error,errorBgHover:l.background["error-hover"],warnBg:l.background.warning,infoBg:l.background.info,infoBgHover:l.background["info-hover"],borderDefault:l.border.default,borderHover:l.border["default-hover"],borderFocus:l.border.focused,borderError:l.border.error,borderSuccess:l.border.success,borderWarning:l.border.warning,borderInfo:l.border.info,borderInteractive:l.border.interactive,borderInteractiveHover:l.border["interactive-hover"],backgroundHover:l.background["default-hover"],backgroundClicked:l.background["default-clicked"],backgroundDisabled:l.background["default-disabled"],backgroundInteractive:l.background.interactive,backgroundInteractiveHover:l.background["interactive-hover"],backgroundInteractiveClicked:l.background["interactive-clicked"],backgroundInteractiveDisabled:l.background["interactive-disabled"],foregroundHover:l.text.default,foregroundClicked:l.text.default,foregroundDisabled:l.text["default-disabled"],foregroundInteractive:l.text.interactive,foregroundInteractiveHover:l.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?r.toHslString():l.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:l.icon.default,iconMuted:l.icon.muted,iconSubtle:l.icon.subtle,iconInverse:l.icon.inverse,iconSuccess:l.icon.success,iconWarning:l.icon.warning,iconError:l.icon.error,iconInteractive:l.icon.interactive,iconDefaultHover:l.icon["default-hover"],iconMutedHover:l.icon["muted-hover"],iconSubtleHover:l.icon["subtle-hover"],iconDefaultClicked:l.icon["default-clicked"],iconMutedClicked:l.icon["muted-clicked"],iconSubtleClicked:l.icon["subtle-clicked"],iconDefaultDisabled:l.icon["default-disabled"],iconMutedDisabled:l.icon["muted-disabled"],iconSubtleDisabled:l.icon["subtle-disabled"],iconErrorHover:l.icon["error-hover"],iconInteractiveHover:l.icon["interactive-hover"],iconErrorClicked:l.icon["error-clicked"],iconInteractiveClicked:l.icon["interactive-clicked"],iconMutedDisabledAlt:l.icon["muted-disabled"],iconSubtleDisabledAlt:l.icon["subtle-disabled"]}}const ee={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},te={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function ae(e,t,a,n,o){let l,c,d,u,g,h,f,p,_,b,m,v,w,k,y,F,C,M,A=a?console.warn:()=>{},E=[];if(t?.loginMethods)for(let e of(l=t.loginMethods.includes("email"),c=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),y=t.loginMethods.includes("apple"),F=t.loginMethods.includes("farcaster"),C=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey"),t.loginMethods))"string"==typeof e&&e.startsWith("privy:")&&E.push(e);else l=e.email_auth,c=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,y=e.apple_oauth,F=e.farcaster_auth,C=e.telegram_auth,d=e.passkey_auth,M=e.custom_jwt_auth;e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let x=[l,c].filter(Boolean),D=[g,h,f,k,m,v,p,_,b,w,y,F,C].filter(Boolean),B=[u].filter(Boolean),W=t?.loginMethods?.includes("passkey")??!1,L=e.passkeys_for_signup_enabled??!1,S=[d&&(L||W)].filter(Boolean),H=[M].filter(Boolean);if(x.length+D.length+B.length+S.length+H.length+E.length===0)throw Error("You must enable at least one login method");let I=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;I&&0===B.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):I||D.length+x.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let O=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let U=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((U.includes("wallet_connect_qr")||U.includes("wallet_connect"))&&U.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let P=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let n of e.overflow??[])t.includes(n)||a.includes(n)?console.warn(`Duplicated login method: ${n}`):a.push(n);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),q=t?.intl?.defaultCountry??"US",{chains:j,defaultChain:R}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=r(e)}else a=[...i];let n=e?a[0]:s,o=t??n;if(!a.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),N=!!t?.defaultChain,$=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,z=$?"all-users":e.embedded_wallet_config.ethereum.create_on_login,G=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let J=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,K=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0,X=e.smart_wallet_config;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??T.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Q({backgroundTheme:t?.appearance?.theme??T.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:l,sms:c,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:y,farcaster:F,telegram:C},globalDisablePasskeys:t?.globalDisablePasskeys??!1,customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),crossAppProviders:E,disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:P,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??T.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:j,defaultChain:R,intl:{defaultCountry:q,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:N,captcha:{enabledProvider:e.enabled_captcha_provider??null,siteKey:e.captcha_site_key},externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:O},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!$&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:$?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??z},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??G},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??n??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:$?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:J,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??T._render.standalone},fundingConfig:K,fundingMethodConfig:{...t?.fundingMethodConfig??T.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??T.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??T.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null},smartWallets:X?.enabled?{enabled:X.enabled,smartWalletVersion:X.smart_wallet_version,smartWalletType:X.smart_wallet_type,configuredNetworks:X.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:V(e.paymaster_url,e.paymaster_context)})))}:{enabled:X?.enabled??!1},connectorsDebugLogs:t?.connectorsDebugLogs??!1}}const ne={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let oe=/*#__PURE__*/o({appConfig:ae(ne,void 0,!1),isServerConfigLoaded:!1});const le=({children:o,client:l,legacyClient:r,clientConfig:i,appClientId:s})=>{let[c,d]=t(null),u=a((()=>ae(c??ne,i,!!c,"undefined"!=typeof window?window.location.origin:void 0,s)),[c,i,s]);return n((()=>{if(!c)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:n,externalWallets:o,...l}=e;return{...l,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let a=3735928559^t,n=1103547991^t;for(let t,o=0;o<e.length;o++)a=Math.imul(a^(t=e.charCodeAt(o)),2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${c.id}:${t}`;localStorage.getItem(a)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,c]),n((()=>{c||(async()=>{try{await l.initialize();let e=l.app.getConfig();e.custom_api_url&&r.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(oe.Provider,{value:{appConfig:u,isServerConfigLoaded:!!c},children:o})},re=()=>{let{appConfig:e}=l(oe);return e},ie=()=>{let{isServerConfigLoaded:e}=l(oe);return e};export{_ as C,d as D,D as H,k as I,P as M,B as O,w as P,m as R,E as S,p as V,O as W,x as a,L as b,ie as c,C as d,A as e,F as f,M as g,R as h,b as i,v as j,y as k,u as l,le as m,S as n,W as o,I as p,g as q,h as r,H as s,f as t,re as u,U as v,j as w,q as x};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createPublicClient as a,http as t}from"viem";import{b as e}from"./useWallets-BzNCTucF.mjs";const n=async({chain:n,address:r,appId:c,rpcConfig:i,erc20Address:o})=>{let p=a({chain:n,transport:t(e(n,i,c))});return{balance:await p.readContract({address:o,abi:s,functionName:"balanceOf",args:[r]}).catch((()=>0n)),chain:n}};let s=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];export{n as g};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createPublicClient as t,http as e}from"viem";import{b as a}from"./useWallets-BzNCTucF.mjs";const n=async({address:n,chain:s,rpcConfig:r,privyAppId:o})=>{try{let l=t({chain:s,transport:e(a(s,r,o))}),[m,p]=await Promise.all([l.readContract({abi:i,address:n,functionName:"symbol"}),l.readContract({abi:i,address:n,functionName:"decimals"})]);return{decimals:p,symbol:m}}catch(t){return console.log(t),null}};let i=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];export{n as g};
|