@privy-io/react-auth 3.16.0 → 3.17.0-snapshot-20260316162155
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-CwdzzEXy.js +1 -0
- package/dist/cjs/{Address-DTfphH3Q.js → Address-LoABcDN2.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-DmmZQ1sk.js +6 -0
- package/dist/cjs/AllowlistRejectionScreen-zz2ccy4w.js +1 -0
- package/dist/cjs/AuthenticateWithWalletScreen-Czvq09k3.js +1 -0
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-Du2AUYJm.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-BB6Hvskb.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx2okNvo.js +103 -0
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-SZWzchnl.js +2 -0
- package/dist/cjs/{BridgeNetworkSelectionView-xdYr4mxx.js → BridgeNetworkSelectionView-MQxeBaNe.js} +1 -1
- package/dist/cjs/CaptchaScreen-DW7EenvZ.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-D5RD7It_.js +16 -0
- package/dist/cjs/ConnectEmailForm-vo9fqKEz.js +3 -0
- package/dist/cjs/ConnectLedgerScreen-D8iSTRW8.js +9 -0
- package/dist/cjs/ConnectOnlyLandingScreen-cr2IzL9D.js +1 -0
- package/dist/cjs/ConnectOnlyStatusScreen-D0wfwzBX.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-BYeXIW8Z.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-BYX8kgCj.js → ConnectPhoneForm-Fi9YeZhy.js} +1 -1
- package/dist/cjs/{ConnectWalletView-QyJORAZG.js → ConnectWalletView-5ye8dFgc.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-CSRdMfVR.js +7 -0
- package/dist/cjs/CrossAppAuthScreen-CJFlLgpK.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-Cx9QR2CX.js → CustomLandingScreenView-BtwRswsv.js} +6 -6
- package/dist/cjs/DelegatedActionsConsentScreen-DF8Sc_HK.js +1 -0
- package/dist/cjs/DelegatedActionsRevokeScreen-CL9jefJ1.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-zaop20tB.js +1 -0
- package/dist/cjs/EmbeddedWalletCreatedScreen-Dhe-a0kv.js +1 -0
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-wfa1ho1-.js → EmbeddedWalletKeyExportScreen-BBN8qZii.js} +4 -4
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-bCdFxWHi.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CEJb_sQt.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-aCheIy49.js +1 -0
- package/dist/cjs/{EnrollTotp-BzmjXzYC.js → EnrollTotp-CflAJviu.js} +1 -1
- package/dist/cjs/ErrorScreen-Bi5k_Sjg.js +4 -0
- package/dist/cjs/{FarcasterConnectStatusScreen-s3pS-ZH-.js → FarcasterConnectStatusScreen-Ci5w4QiX.js} +1 -1
- package/dist/cjs/FarcasterSignerStatusScreen-D_MQvu4m.js +29 -0
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-CSgOmmfz.js +2 -0
- package/dist/cjs/FundWalletMethodHeader-DKhpGbB_.js +1 -0
- package/dist/cjs/{FundWithBankDepositScreen-DUQAuyf5.js → FundWithBankDepositScreen-Dg07ySds.js} +3 -3
- package/dist/cjs/FundingEditAmountScreen-2cLAUxXk.js +1 -0
- package/dist/cjs/FundingMethodSelectionScreen-B7A8b8Zr.js +1 -0
- package/dist/cjs/InAppBrowserLoginNotPossible-9bla-3q6.js +1 -0
- package/dist/cjs/InstallWalletScreen-CwDyMFAp.js +1 -0
- package/dist/cjs/LandingScreen-Dubaxn5q.js +1 -0
- package/dist/cjs/{LinkConflictScreen-DnHf7IMX.js → LinkConflictScreen-Drbf_NwQ.js} +1 -1
- package/dist/cjs/LinkEmailScreen-CpSuii3Q.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-CTN6f7yX.js → LinkPasskeyScreen-CnQD9Uk7.js} +12 -12
- package/dist/cjs/LinkPhoneScreen-ntD0MGue.js +1 -0
- package/dist/cjs/LoginFailedScreen-Cr84lRK6.js +1 -0
- package/dist/cjs/ManualTransferScreen-BVQ6TTpl.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-C_VvcFPV.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-DS_5Kbyx.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-DUXHByYX.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-DcjydnRO.js +1 -0
- package/dist/cjs/{ModalHeader-CakS8Dcu.js → ModalHeader-CSc17xPp.js} +1 -1
- package/dist/cjs/MoonpayStatusScreen-CLC5rfIy.js +16 -0
- package/dist/cjs/OAuthStatusScreen-Cc7Q4CDA.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-C6SuJGP7.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-CFR4vHsn.js +3 -0
- package/dist/cjs/PasswordRecoveryScreen-BpR2oaTz.js +20 -0
- package/dist/cjs/{QrCode-C-Mk5-26.js → QrCode-DgSaqC0q.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-BkbE7aGR.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-rCKKxWO_.js +1 -0
- package/dist/cjs/{RecoverySelectionScreen-BAJ1nLeO.js → RecoverySelectionScreen-DZ61qdLo.js} +2 -2
- package/dist/cjs/{Screen-Dp9-H_S8.js → Screen-BcsJqsVd.js} +1 -1
- package/dist/cjs/{ScreenLayout-DANQ0V5E.js → ScreenLayout-DyEyA7A5.js} +1 -1
- package/dist/cjs/SetAutomaticRecoveryScreen-BleU8FUI.js +14 -0
- package/dist/cjs/{SetWalletPasswordForm-B7bBDQ8N.js → SetWalletPasswordForm-C8yNbL_5.js} +4 -4
- package/dist/cjs/{SignRequestScreen-BUvgSx9X.js → SignRequestScreen-BPqwS4r3.js} +2 -2
- package/dist/cjs/{StandardSignAndSendTransactionScreen-CzfhyIDP.js → StandardSignAndSendTransactionScreen-3pYKF2t4.js} +1 -1
- package/dist/cjs/TelegramAuthScreen-BIOvHaZW.js +1 -0
- package/dist/cjs/{TransactionDetails-BlPOqfEn.js → TransactionDetails-QfVYPGbU.js} +1 -1
- package/dist/cjs/{TransactionErrorView-BpXI1X_G.js → TransactionErrorView-BLwOc9N2.js} +1 -1
- package/dist/cjs/{TransferFromWalletScreen-Ds1sknGn.js → TransferFromWalletScreen-DgG_TT1f.js} +2 -2
- package/dist/cjs/{TransferOrBridgeLoadingScreen-CAYUlR4u.js → TransferOrBridgeLoadingScreen-CN_VlxUC.js} +1 -1
- package/dist/cjs/UpdateEmailScreen-CkT3mFji.js +1 -0
- package/dist/cjs/UpdatePhoneScreen-MtkPdjsi.js +1 -0
- package/dist/cjs/UserLimitReachedScreen-kN4nnRM_.js +1 -0
- package/dist/cjs/{WalletInfoCard-CRZt0t3t.js → WalletInfoCard-n_BoIOic.js} +1 -1
- package/dist/cjs/WalletInterstitialScreen-BR__AmNx.js +1 -0
- package/dist/cjs/{WalletLink-Cx_Zda0m.js → WalletLink-CuO09G-O.js} +1 -1
- package/dist/cjs/{WalletOverflowButton-cnlzyqcK.js → WalletOverflowButton-CgWvmdmC.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-BAmjgwZ7.js → context-CNQxiH4A.js} +1 -1
- package/dist/cjs/{ethers-D8g2mvSK.js → ethers-DWH-h922.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/{getErc20Balance-C6ZUC_1B.js → getErc20Balance-DBQPPbnK.js} +1 -1
- package/dist/cjs/{getErc20TokenInfo-DprFN1Dj.js → getErc20TokenInfo-Dl9FAxqA.js} +1 -1
- package/dist/cjs/index-8yj4NkHF.js +174 -0
- package/dist/cjs/{index-DIKBRogK.js → index-Bhi2b4Wz.js} +2 -2
- package/dist/cjs/index-DOqRGT6m.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/privy-context-BUPa46TW.js +1 -0
- package/dist/cjs/{shared-C-w7sNT2.js → shared-C6iMgJGT.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DAiUXgPZ.js → shouldProceedtoEmbeddedWalletCreationFlow-Qter_tq0.js} +1 -1
- package/dist/cjs/smart-wallets-Dd1dBbU0.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{styles-s2f3dL_6.js → styles-DNyswYeR.js} +1 -1
- package/dist/cjs/{to-ui-error-CqnwRcKJ.js → to-ui-error-BHpURyav.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/use-export-wallet-3J5BDtFL.js +1 -0
- package/dist/cjs/use-export-wallet-Dy66dCnh.js +1 -0
- package/dist/cjs/{useActiveWallet-CYUR_x0A.js → useActiveWallet-B2ZGQOqD.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-X3dW0I3y.js → useGetTokenPrice-DSz2_ndW.js} +1 -1
- package/dist/cjs/{useI18n-BsableMs.js → useI18n-Covg9gU-.js} +1 -1
- package/dist/cjs/usePrivy-BgdIKexA.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-BhX1Bzre.js → useSolanaRpcClient-DFziJZx0.js} +1 -1
- package/dist/cjs/{useWalletBalance-CcicA-jd.js → useWalletBalance-RkLvAARN.js} +1 -1
- package/dist/cjs/useWallets-CePTM2iC.js +1 -0
- package/dist/cjs/useWallets-LhNz5bUC.js +1 -0
- package/dist/dts/index.d.mts +38 -1
- package/dist/dts/index.d.ts +38 -1
- package/dist/esm/AccountNotFoundScreen-DVFOItI9.mjs +1 -0
- package/dist/esm/{Address-Cbulz6Wu.mjs → Address-CPCEzwZf.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-DOdcSwXi.mjs +6 -0
- package/dist/esm/AllowlistRejectionScreen-CW-4iFe3.mjs +1 -0
- package/dist/esm/AuthenticateWithWalletScreen-B82BbMWX.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DrRQ8jx6.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DMa82XoT.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-B6XB-azJ.mjs +103 -0
- package/dist/esm/AwaitingSolToEvmBridgingScreen-AG9YC4Po.mjs +2 -0
- package/dist/esm/{BridgeNetworkSelectionView-nrYQOGZA.mjs → BridgeNetworkSelectionView-BpGLl4Km.mjs} +1 -1
- package/dist/esm/CaptchaScreen-DpeO3tbc.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-BLz4G4Ps.mjs +16 -0
- package/dist/esm/ConnectEmailForm-BHbXRWOx.mjs +3 -0
- package/dist/esm/ConnectLedgerScreen-Cm9Maid3.mjs +9 -0
- package/dist/esm/ConnectOnlyLandingScreen-DgW6x1--.mjs +1 -0
- package/dist/esm/ConnectOnlyStatusScreen-DJjV2n2X.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-S9fCBz6I.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-D8SHd_ge.mjs → ConnectPhoneForm-tJp8qUlN.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-By6eXfKl.mjs → ConnectWalletView-DxWxjOjC.mjs} +1 -1
- package/dist/esm/ConnectionStatusScreen-ApbD7KFS.mjs +7 -0
- package/dist/esm/CrossAppAuthScreen-Bhfdy_gi.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-Co0nHKPw.mjs → CustomLandingScreenView-B3SypvcL.mjs} +1 -1
- package/dist/esm/DelegatedActionsConsentScreen-DjbqeAEg.mjs +1 -0
- package/dist/esm/DelegatedActionsRevokeScreen-Brl_FYla.mjs +1 -0
- package/dist/esm/EmbeddedWalletConnectingScreen-B56updgF.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-Dq2kZg2T.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-CVflSsvz.mjs → EmbeddedWalletKeyExportScreen-Cz9BshyG.mjs} +3 -3
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CuBtEhf9.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-CLLfj2dW.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-Cs3Iaprt.mjs +1 -0
- package/dist/esm/{EnrollTotp-nZPSS3Ux.mjs → EnrollTotp-BT_-h_0Y.mjs} +1 -1
- package/dist/esm/ErrorScreen-CZY1qK53.mjs +4 -0
- package/dist/esm/{FarcasterConnectStatusScreen-BdwUuSkv.mjs → FarcasterConnectStatusScreen-C6zmKfBj.mjs} +2 -2
- package/dist/esm/FarcasterSignerStatusScreen-Dvz9h1zE.mjs +28 -0
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-DkS_xMkO.mjs +1 -0
- package/dist/esm/FundWalletMethodHeader-BZ3UxTwI.mjs +1 -0
- package/dist/esm/{FundWithBankDepositScreen-HyqTUpLq.mjs → FundWithBankDepositScreen-DAH8GGVT.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-CZoruo9l.mjs +1 -0
- package/dist/esm/FundingMethodSelectionScreen-BGZZNugd.mjs +1 -0
- package/dist/esm/InAppBrowserLoginNotPossible-DfyMyaFh.mjs +1 -0
- package/dist/esm/InstallWalletScreen-_DQi1B5T.mjs +1 -0
- package/dist/esm/LandingScreen-CjU3MGir.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-DNGVg8dW.mjs → LinkConflictScreen-o65O1oJ_.mjs} +1 -1
- package/dist/esm/LinkEmailScreen-BsdMCjtQ.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-CTYGeo1r.mjs → LinkPasskeyScreen-DHCCysKA.mjs} +2 -2
- package/dist/esm/LinkPhoneScreen-Bmd4jv7M.mjs +1 -0
- package/dist/esm/LoginFailedScreen-xa-3Q1Dl.mjs +1 -0
- package/dist/esm/ManualTransferScreen-B8JFrKJ2.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-ByT7H0E_.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-Dfr4vUQN.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-DAi4CFJZ.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-Danwy2Qw.mjs +1 -0
- package/dist/esm/{ModalHeader-DfHxv9fE.mjs → ModalHeader-B3hf8Gf5.mjs} +1 -1
- package/dist/esm/MoonpayStatusScreen-Ci5Oi6Ec.mjs +16 -0
- package/dist/esm/OAuthStatusScreen-rN88I9Yr.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-ByI-NM15.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-s25IPE-D.mjs +3 -0
- package/dist/esm/PasswordRecoveryScreen-Bvc12Phr.mjs +20 -0
- package/dist/esm/{QrCode-D4XZQrgi.mjs → QrCode-DXutpDmP.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-JkYUmAdb.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-CSr1zpHY.mjs +1 -0
- package/dist/esm/{RecoverySelectionScreen-DVBTi436.mjs → RecoverySelectionScreen-BQtnEuQN.mjs} +2 -2
- package/dist/esm/{Screen-CDEd4p2a.mjs → Screen-C-LEnZLL.mjs} +1 -1
- package/dist/esm/{ScreenLayout-BdRrZJd_.mjs → ScreenLayout-C5tqY0au.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-DBcSNU6R.mjs → SetAutomaticRecoveryScreen-CxBT3GM6.mjs} +2 -2
- package/dist/esm/{SetWalletPasswordForm-DdWjdu2s.mjs → SetWalletPasswordForm-CmSpUP06.mjs} +4 -4
- package/dist/esm/{SignRequestScreen-CxAuntSd.mjs → SignRequestScreen-DDQHSSe2.mjs} +2 -2
- package/dist/esm/{StandardSignAndSendTransactionScreen-DIJRS8NR.mjs → StandardSignAndSendTransactionScreen-DfXITIWD.mjs} +1 -1
- package/dist/esm/TelegramAuthScreen-L0mUPKLc.mjs +1 -0
- package/dist/esm/{TransactionDetails-Ce_Cnzo2.mjs → TransactionDetails-n9RsmJQY.mjs} +1 -1
- package/dist/esm/{TransactionErrorView-JiZmO7NJ.mjs → TransactionErrorView-DwgBt1il.mjs} +1 -1
- package/dist/esm/{TransferFromWalletScreen-ad5b7GV7.mjs → TransferFromWalletScreen-DsqvsKwk.mjs} +2 -2
- package/dist/esm/{TransferOrBridgeLoadingScreen-Cwzefd9j.mjs → TransferOrBridgeLoadingScreen-CrM8LyTn.mjs} +1 -1
- package/dist/esm/UpdateEmailScreen-BbZC4Ce_.mjs +1 -0
- package/dist/esm/UpdatePhoneScreen-Chrnlpvk.mjs +1 -0
- package/dist/esm/UserLimitReachedScreen-DCDtmBML.mjs +1 -0
- package/dist/esm/{WalletInfoCard-D2dCT7_H.mjs → WalletInfoCard-9E_M4KpE.mjs} +1 -1
- package/dist/esm/WalletInterstitialScreen-Dwwg2p0u.mjs +1 -0
- package/dist/esm/{WalletLink-DNraFqEC.mjs → WalletLink-CGkyFW_c.mjs} +1 -1
- package/dist/esm/{WalletOverflowButton-Cn_nKCBf.mjs → WalletOverflowButton-BDgrWJ32.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-CTvHGnoI.mjs +1 -0
- package/dist/esm/{ethers-5oa3ZKLD.mjs → ethers-D_pXdGwy.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/{getErc20Balance-sCX8nL1s.mjs → getErc20Balance-BTMqTvue.mjs} +1 -1
- package/dist/esm/{getErc20TokenInfo-CwiO-mOs.mjs → getErc20TokenInfo-C3J46mR7.mjs} +1 -1
- package/dist/esm/index-DAEL2fAA.mjs +1 -0
- package/dist/esm/{index-B5B9f4U9.mjs → index-DPtolW6e.mjs} +2 -2
- package/dist/esm/index-ldG7uF5Z.mjs +174 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/privy-context-DjQaHYWB.mjs +1 -0
- package/dist/esm/{shared-Bw0pXSOO.mjs → shared-Dj3rRmjE.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs → shouldProceedtoEmbeddedWalletCreationFlow-B2ygR6ax.mjs} +1 -1
- package/dist/esm/smart-wallets-Y6_E73RM.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{styles-D5Jf27-u.mjs → styles-DNw1LY6I.mjs} +1 -1
- package/dist/esm/{to-ui-error-DnDY_33E.mjs → to-ui-error-iAm6GRH_.mjs} +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/use-export-wallet-DQk47ipd.mjs +1 -0
- package/dist/esm/use-export-wallet-DyWwXiCx.mjs +1 -0
- package/dist/esm/{useActiveWallet-CwS7ik68.mjs → useActiveWallet-jEsJB3LX.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-oI6b3gPZ.mjs → useGetTokenPrice-CAeZUPHp.mjs} +1 -1
- package/dist/esm/{useI18n-bIQlZhkW.mjs → useI18n-BWVpc1Y-.mjs} +1 -1
- package/dist/esm/usePrivy-MdJeWwyN.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-C2WlA-Ah.mjs → useSolanaRpcClient-BpNT8e8E.mjs} +1 -1
- package/dist/esm/{useWalletBalance-DopZXXwh.mjs → useWalletBalance-BTQ4EtcY.mjs} +1 -1
- package/dist/esm/useWallets-DoJmA9i9.mjs +1 -0
- package/dist/esm/useWallets-MCga77FD.mjs +1 -0
- package/package.json +1 -1
- package/dist/cjs/AccountNotFoundScreen-Bqh-CYrp.js +0 -1
- package/dist/cjs/AffirmativeConsentScreen-uogZ44HQ.js +0 -6
- package/dist/cjs/AllowlistRejectionScreen-3OKwgh23.js +0 -1
- package/dist/cjs/AuthenticateWithWalletScreen-DXy5TnZj.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-DR1RiU-S.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-DgQ9z_ck.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Bah7kXAV.js +0 -103
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-HSwPZmzZ.js +0 -2
- package/dist/cjs/CaptchaScreen-BLoD3u63.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-CoSS2KfY.js +0 -16
- package/dist/cjs/ConnectEmailForm-BjXzo_T8.js +0 -3
- package/dist/cjs/ConnectLedgerScreen-Brfd_c8H.js +0 -9
- package/dist/cjs/ConnectOnlyLandingScreen-C41qgoJf.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DPsh3aXI.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dpv9J_eC.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-DfKCyYnE.js +0 -7
- package/dist/cjs/CrossAppAuthScreen-CAmbPQb0.js +0 -1
- package/dist/cjs/DelegatedActionsConsentScreen-DOvRMKf-.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-5ecaxQ0D.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-B31DzW7n.js +0 -1
- package/dist/cjs/EmbeddedWalletCreatedScreen-BXEozrA_.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-DSrn-F5R.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DGlv7LlS.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-Byr5dLg5.js +0 -1
- package/dist/cjs/ErrorScreen-DJwJwrGn.js +0 -4
- package/dist/cjs/FarcasterSignerStatusScreen--CVrZRE9.js +0 -29
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-3Fn4CnSA.js +0 -2
- package/dist/cjs/FundWalletMethodHeader-D2fapeXN.js +0 -1
- package/dist/cjs/FundingEditAmountScreen-B3wEw9xm.js +0 -1
- package/dist/cjs/FundingMethodSelectionScreen-ChQNeyi6.js +0 -1
- package/dist/cjs/InAppBrowserLoginNotPossible-XFkxHwKR.js +0 -1
- package/dist/cjs/InstallWalletScreen-Cp3ZRRYf.js +0 -1
- package/dist/cjs/LandingScreen-DwFs0lRf.js +0 -1
- package/dist/cjs/LinkEmailScreen-_sfK6ECC.js +0 -1
- package/dist/cjs/LinkPhoneScreen-BjMfF3Kz.js +0 -1
- package/dist/cjs/LoginFailedScreen-BUnuwN-5.js +0 -1
- package/dist/cjs/ManualTransferScreen-D2hHGf6p.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-VFaXkogp.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-CVBdW4Cw.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-DxkzCr5s.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-AFZc7liT.js +0 -1
- package/dist/cjs/MoonpayStatusScreen-C66Eq4G4.js +0 -16
- package/dist/cjs/OAuthStatusScreen-NKl6SLvR.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-D9VfPofR.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-CBC-60D2.js +0 -3
- package/dist/cjs/PasswordRecoveryScreen-BSUhAJ63.js +0 -20
- package/dist/cjs/RecoveryOAuthStatusScreen-y2Z3cphT.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-CoDYHaJk.js +0 -1
- package/dist/cjs/SetAutomaticRecoveryScreen-BLiDEmlE.js +0 -14
- package/dist/cjs/TelegramAuthScreen-BGB40HSe.js +0 -1
- package/dist/cjs/UpdateEmailScreen-Bgn5JxGJ.js +0 -1
- package/dist/cjs/UpdatePhoneScreen-DPAxfLv5.js +0 -1
- package/dist/cjs/UserLimitReachedScreen-BG8gj4ah.js +0 -1
- package/dist/cjs/WalletInterstitialScreen-CBH05HpE.js +0 -1
- package/dist/cjs/get-is-unified-wallet-DitrQ4hx.js +0 -1
- package/dist/cjs/index-BohqOluI.js +0 -174
- package/dist/cjs/index-CCY3tkwt.js +0 -1
- package/dist/cjs/smart-wallets-BtILJe_K.js +0 -1
- package/dist/cjs/use-export-wallet-C6DaLOxp.js +0 -1
- package/dist/cjs/use-export-wallet-eDTOzHRt.js +0 -1
- package/dist/cjs/usePrivy-CHcu9hX8.js +0 -1
- package/dist/cjs/useWallets-CbvzYOqg.js +0 -1
- package/dist/cjs/useWallets-Cy6axcvW.js +0 -1
- package/dist/esm/AccountNotFoundScreen-BSYd-8_2.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-C_uGmdSa.mjs +0 -6
- package/dist/esm/AllowlistRejectionScreen-DBdNYwS-.mjs +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-D-Aw0iYo.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-BMr5CXgX.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-aOEMTW-b.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-CjPJ7IMM.mjs +0 -103
- package/dist/esm/AwaitingSolToEvmBridgingScreen-xrFngED1.mjs +0 -2
- package/dist/esm/CaptchaScreen-BOKElE1r.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-CTV5uUn3.mjs +0 -16
- package/dist/esm/ConnectEmailForm-Dp85JvZj.mjs +0 -3
- package/dist/esm/ConnectLedgerScreen-rxzesP5N.mjs +0 -9
- package/dist/esm/ConnectOnlyLandingScreen-CmImF7oZ.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-Bo90w6P9.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-Dc2VQF-B.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-C_fxSXJ2.mjs +0 -7
- package/dist/esm/CrossAppAuthScreen-DU0FD2ep.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-Dr-DeIXC.mjs +0 -1
- package/dist/esm/DelegatedActionsRevokeScreen-kXOJxXu-.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-tFedaOj3.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-DCx4NdAp.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-vSzXa62f.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-B4szV9Hg.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BOBLnE_O.mjs +0 -1
- package/dist/esm/ErrorScreen-BGE6wldq.mjs +0 -4
- package/dist/esm/FarcasterSignerStatusScreen-C-crikPv.mjs +0 -28
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-BX4gYmzv.mjs +0 -1
- package/dist/esm/FundWalletMethodHeader-CdXWChwL.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen--ffFSUmf.mjs +0 -1
- package/dist/esm/FundingMethodSelectionScreen-Djr0jY03.mjs +0 -1
- package/dist/esm/InAppBrowserLoginNotPossible-D6wMCuzD.mjs +0 -1
- package/dist/esm/InstallWalletScreen-B6VSXUWR.mjs +0 -1
- package/dist/esm/LandingScreen-BV0xq-oc.mjs +0 -1
- package/dist/esm/LinkEmailScreen-CtMuCZvp.mjs +0 -1
- package/dist/esm/LinkPhoneScreen-2nnXZB2B.mjs +0 -1
- package/dist/esm/LoginFailedScreen-hHvIsH81.mjs +0 -1
- package/dist/esm/ManualTransferScreen-C0xJ3si8.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-CznUpkq5.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-DUmOZHGX.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-DeoSfYAS.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-JJ1crW_8.mjs +0 -1
- package/dist/esm/MoonpayStatusScreen-BIzQZK9f.mjs +0 -16
- package/dist/esm/OAuthStatusScreen-DhmaZBTY.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-BmiJnukl.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-BStwA1_J.mjs +0 -3
- package/dist/esm/PasswordRecoveryScreen-DyBDQADG.mjs +0 -20
- package/dist/esm/RecoveryOAuthStatusScreen-BfcxgkUL.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-CBfvjxht.mjs +0 -1
- package/dist/esm/TelegramAuthScreen-BRDG8b6x.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-C5lQJUiA.mjs +0 -1
- package/dist/esm/UpdatePhoneScreen-BwkzWVHl.mjs +0 -1
- package/dist/esm/UserLimitReachedScreen-ComDV9kj.mjs +0 -1
- package/dist/esm/WalletInterstitialScreen-riBB51NH.mjs +0 -1
- package/dist/esm/context-Cw2-86-G.mjs +0 -1
- package/dist/esm/get-is-unified-wallet-CQc-E5dS.mjs +0 -1
- package/dist/esm/index-Bvw5OxHl.mjs +0 -174
- package/dist/esm/index-yxF2V6XY.mjs +0 -1
- package/dist/esm/smart-wallets-Dl42tBUP.mjs +0 -1
- package/dist/esm/use-export-wallet-Bd5Sg5V-.mjs +0 -1
- package/dist/esm/use-export-wallet-NF9h_lS_.mjs +0 -1
- package/dist/esm/usePrivy-DAnfSvB5.mjs +0 -1
- package/dist/esm/useWallets-2_uCkhA8.mjs +0 -1
- package/dist/esm/useWallets-DpbBw4Vl.mjs +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as d}from"viem";import{ConnectedStandardSolanaWallet as l}from"@privy-io/js-sdk-core";import{b as c,c as m,R as u}from"./Layouts-BlFm53ED.mjs";import{B as p}from"./ModalHeader-B3hf8Gf5.mjs";import{C as f}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as h}from"./FundWalletMethodHeader-BZ3UxTwI.mjs";import{N as g}from"./index-Dq_xe9dz.mjs";import{u as v,t as w}from"./context-CTvHGnoI.mjs";import{u as I,a as y,b as C}from"./internal-context-Z-fyxadS.mjs";import{z as T}from"./useActiveWallet-jEsJB3LX.mjs";import{a as S}from"./privy-context-DjQaHYWB.mjs";import{O as j}from"./analytics-mkkvFRju.mjs";import{g as A,t as b,d as N,a as F,b as U,u as x}from"./reservoir-0wfhnc0j.mjs";import{u as E}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as k}from"./usePrivy-MdJeWwyN.mjs";import{H as W,I as R}from"./use-export-wallet-DQk47ipd.mjs";import{T as L}from"./TransferOrBridgeLoadingScreen-CrM8LyTn.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useWallets-DoJmA9i9.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Row-C9vrS4Zi.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Address-CPCEzwZf.mjs";import"lucide-react";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";const P={component:function(){let P=v(),{closePrivyModal:B,createAnalyticsEvent:D,connectors:H}=I(),{navigate:$,setModalData:M,data:O}=S(),_=v(),q=o(!1),z=E(),[Q,V]=a(!1),[G,X]=a(!1),[Y,J]=a(null),[K,Z]=a(),[ee,te]=a();if(!O?.funding||"ethereum"!==O.funding.chainType)throw Error("Invalid funding data");let{amount:re,connectedWallet:ne,chain:oe,solanaChain:ae,isUSDC:ie}=O.funding,se=O.funding.address,de=O.funding.erc20Address,le=O.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,ce=i((()=>"solana"===ne?.type?ne.provider:function({connectors:e,connectedWalletAddress:t}){let r=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),n=r?.wallet.accounts.find((e=>e.address===t));if(!r||!n)throw new y("Unable to find source wallet connector");return new l({wallet:r.wallet,account:n})}({connectors:H,connectedWalletAddress:ne?.address||""})),[ne,H]),me=i((()=>{let e=z(k);if(!e)throw new y("Unable to load solana plugin");let t=P.solanaRpcs["solana:mainnet"];if(!t)throw new y("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),ue=T(W(ce?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!ce||!oe||q.current)return;let e=z(k);if(!e)return void J(new y("Unable to solana plugin"));q.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(re):d(re),r=await A({isTestnet:!!oe.testnet,input:b({appId:_.id,amount:t.toString(),user:ce.address,recipient:se,destinationChainId:oe.id,originChainId:U,originCurrency:ie?N:F,destinationCurrency:ie?de:void 0})}).catch(console.error);if(!r)return void J(new y(`Unable to fetch quotes for bridging. Wallet ${R(ce.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE));let n=await e.createTransactionFromRelayQuote({quote:r,source:ce.address,solanaClient:me});if(n)try{V(!0);let t=await e.simulateTransaction({solanaClient:me,tx:n});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))):void J(new y(`Wallet ${R(ce?.address)} does not have enough funds. ${r.details.currencyIn.amountFormatted} ${le} are needed to complete the transaction.`,void 0,C.INSUFFICIENT_BALANCE));let{signature:o}=await ce.signAndSendTransaction({chain:"solana:mainnet",transaction:n}),a=e.getAddressFromBuffer(o);Z(a),te("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void J(new y("Transaction was rejected by the user",void 0,C.TRANSACTION_FAILURE));J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))}else J(new y(`Unable to select bridge option from quotes. Wallet ${R(ce.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),x({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){V(!1),X(!0),D({eventName:j,payload:{provider:"external",status:"success",txHash:e,address:ce.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:re,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){V(!1),J(e)}}),s((()=>{if(!G)return;let e=setTimeout(B,w);return()=>clearTimeout(e)}),[G]),s((()=>{Y&&(M({funding:O?.funding,solanaFundingData:O?.solanaFundingData,sendTransaction:O?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),$("ErrorScreen",!1))}),[Y]),G?/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(c,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(f,{title:"Success!",description:`You’ve successfully added ${re} ${le} to your ${_.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):Q&&ce?/*#__PURE__*/t(L,{walletClientType:W(ce?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:Q,isErc20Flow:!1,chainId:oe.id,chainName:oe.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
|
|
2
|
+
/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(g,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(p,{})]})}};export{P as AwaitingSolToEvmBridgingScreen,P as default};
|
package/dist/esm/{BridgeNetworkSelectionView-nrYQOGZA.mjs → BridgeNetworkSelectionView-BpGLl4Km.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as a,formatWalletAddress as o}from"@privy-io/js-sdk-core";import{b as i}from"./useWallets-
|
|
1
|
+
import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as a,formatWalletAddress as o}from"@privy-io/js-sdk-core";import{b as i}from"./useWallets-DoJmA9i9.mjs";import{g as n}from"./getErc20Balance-BTMqTvue.mjs";import{jsx as t,jsxs as s,Fragment as c}from"react/jsx-runtime";import{useRef as l}from"react";import{c as m,B as d}from"./ModalHeader-B3hf8Gf5.mjs";import{b as h,R as p}from"./Layouts-BlFm53ED.mjs";import{t as u}from"./FundWalletMethodHeader-BZ3UxTwI.mjs";import{R as f}from"./Row-C9vrS4Zi.mjs";import{E as g}from"./ErrorMessage-D8VaAP5m.mjs";import{V as b,L as y}from"./Value-tcJV9e0L.mjs";import{S as v}from"./Subtitle-CV-2yKE4.mjs";import{T as j}from"./Title-BnzYV3Is.mjs";import w from"@heroicons/react/24/outline/WalletIcon";import{styled as x}from"styled-components";import{g as C}from"./getChainName-DjpPdUSc.mjs";import{C as k}from"./Chip-D2-wZOHJ.mjs";import{N}from"./NetworkIcon-B48ilzF8.mjs";import{B as T,a as B}from"./shared-FM0rljBt.mjs";import{Menu as $,MenuButton as I,MenuItems as S,MenuItem as A}from"@headlessui/react";import E from"@heroicons/react/24/outline/ChevronDownIcon";import{f as F}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{g as M}from"./ethers-D_pXdGwy.mjs";import{F as P,a as W,b as L,c as R,d as z}from"./styles-DNw1LY6I.mjs";const H=({chains:o,appId:t,address:s,rpcConfig:c,includeUsdc:l})=>Promise.all(o.map((async o=>{let m=e({chain:o,transport:r(i(o,c,t))}),d=await m.getBalance({address:s}).catch((()=>0n)),h=null,p=a[o.id];if(l&&p){let{balance:e}=await n({address:s,chain:o,rpcConfig:c,appId:t,erc20Address:p});h=e}return{balance:d,erc20Balance:h,erc20Address:p,chain:o}}))),Q=({balance:e,className:r,chain:a})=>/*#__PURE__*/t(T,{className:r,$state:void 0,children:/*#__PURE__*/t(U,{balance:e,chain:a})}),U=({balance:e,chain:r})=>/*#__PURE__*/s(c,{children:[/*#__PURE__*/s(V,{children:[/*#__PURE__*/t(O,{chainId:"object"==typeof r?r.id:"solana"}),/*#__PURE__*/t(b,{children:"object"==typeof r?r.name:C(r)})]}),/*#__PURE__*/s(k,{isLoading:!1,isPulsing:!1,color:"gray",children:[/*#__PURE__*/t(D,{children:/*#__PURE__*/t(w,{})}),e]})]});let V=x.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
`,D=x.div`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as s,useEffect as a}from"react";import{a as n,C as c}from"./index-ldG7uF5Z.mjs";import{a as m}from"./privy-context-DjQaHYWB.mjs";import{S as u}from"./ScreenLayout-C5tqY0au.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"./context-CTvHGnoI.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-DoJmA9i9.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-MdJeWwyN.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"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const p=({status:o,title:s,description:a,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),y=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:y,title:s,subtitle:a,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:y,reset:g,execute:v}=n(),h=o([]),j=e=>{h.current=[e,...h.current]},[C,f]=s(!0);a((()=>(j(setTimeout(f,1e3,!1)),()=>{h.current.forEach((e=>clearTimeout(e))),h.current=[]})),[]);let[b,k]=s(""),[w,R]=s("Checking that you are a human..."),[S,x]=s(!1),[I,T]=s(3),q=r?.captchaModalData,A=async e=>{try{await(q?.callback(e)),q?.onSuccessNavigateTo&&i(q?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(q?.onErrorNavigateTo||"ErrorScreen",!1)}};a((()=>{"success"===l?j(setTimeout((async()=>{let e=await y();!e||q?.userIntentRequired||A(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&v()}),500))}),[l]),a((()=>{if(!C)switch(l){case"success":k("Success!"),R("CAPTCHA passed successfully."),q?.userIntentRequired||setTimeout((()=>{x(!0),A(d)}),2e3);break;case"loading":k(""),R("Checking that you are a human...");break;case"error":k("Something went wrong"),R(I<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,C,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:w,userIntentRequired:q?.userIntentRequired,retriesRemaining:I,hasSelectedCta:S,onContinue:()=>{x(!0),A(d)},onRetry:async()=>{if(I<=0)return;T((e=>e-1)),g(),v();let e=await y();!e||q?.userIntentRequired||A(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{M as l,B as d,P as p}from"./ModalHeader-B3hf8Gf5.mjs";import{a as u}from"./Layouts-BlFm53ED.mjs";import{L as g,O as f}from"./useActiveWallet-jEsJB3LX.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as v}from"./privy-context-DjQaHYWB.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{I as b}from"./index-ldG7uF5Z.mjs";import"./context-CTvHGnoI.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";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-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";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-MdJeWwyN.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 w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:p,createAnalyticsEvent:u,client:g}=h(),[f,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:x}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===f||"pending-after-flow"===f){let e=setInterval((async()=>{if(k)try{let{status:e}=await g.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");x?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),u({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,x,f]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:f,onClickCta:p}),/*#__PURE__*/t(d,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(x,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(u,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(p,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(g,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(f,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=m.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
|
+
`,x=m.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{w as CoinbaseOnrampStatusScreen,w as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as a}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-CTvHGnoI.mjs";import{u as m,c,b as d}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./index-ldG7uF5Z.mjs";import{u,a as h}from"./privy-context-DjQaHYWB.mjs";import{r as g,C as f}from"./useActiveWallet-jEsJB3LX.mjs";import{B as y}from"./use-export-wallet-DQk47ipd.mjs";import{E,P as S}from"./ModalHeader-B3hf8Gf5.mjs";import{C as v}from"./Chip-D2-wZOHJ.mjs";import{I as b,a as C}from"./EmailInputForm-Dgoii4vf.mjs";import{E as k}from"./ErrorMessage-D8VaAP5m.mjs";const j=/*#__PURE__*/t(((t,l)=>{let[f,b]=o(t.defaultValue||""),[C,j]=o(""),[T,A]=o(!1),{authenticated:L}=u(),{initLoginWithEmail:M}=m(),{navigate:D,setModalData:I,currentScreen:U,data:N}=h(),{enabled:W,token:F}=p(),[R,$]=o(!1),{accountType:_}=g(),q=s();n((()=>{!f&&q.disablePlusEmails&&N?.inlineError?.error instanceof c&&N?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!C&&j("Please enter a valid email address without a '+'."),C&&j("")}),[f]);let B=y(f),H=T||!B,K=()=>{var e;I({login:N?.login,inlineError:void 0}),!W||F||L?(e=F,A(!0),M({email:f,captchaToken:e,disableSignup:N?.login?.disableSignup,withPrivyUi:!0}).then((()=>{D("AwaitingPasswordlessCodeScreen")})).catch((e=>{I({errorModalData:{error:e,previousScreen:U||"LandingScreen"}}),D("ErrorScreen")})).finally((()=>{A(!1)}))):(I({captchaModalData:{callback:e=>M({email:f,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(x,{children:[C&&/*#__PURE__*/a(k,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:C}),/*#__PURE__*/e(w,{stacked:t.stacked,$error:!!C,children:[/*#__PURE__*/a(P,{children:/*#__PURE__*/a(i,{})}),/*#__PURE__*/a("input",{ref:l,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>$(!0),onChange:e=>b(e.target.value),onKeyUp:e=>{"Enter"===e.key&&K()},value:f,autoComplete:"email"}),"email"!==_||R?t.stacked?/*#__PURE__*/a("span",{}):/*#__PURE__*/a(E,{isSubmitting:T,onClick:K,disabled:H,children:"Submit"}):/*#__PURE__*/a(v,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/a(S,{loadingText:null,loading:T,disabled:H,onClick:K,style:{width:"100%"},children:"Submit"}):null]})}));let x=b,w=C,P=l(f)`
|
|
2
|
+
display: inline-flex;
|
|
3
|
+
`;export{j as C};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./privy-context-DjQaHYWB.mjs";import{S as n}from"./ScreenLayout-C5tqY0au.mjs";import{H as m}from"./index-ldG7uF5Z.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-CTvHGnoI.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-B3hf8Gf5.mjs";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-C-LEnZLL.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-MdJeWwyN.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 s=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),p=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:p="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:p,subtitle:/*#__PURE__*/t(d,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(p,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=o.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: center;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
margin-bottom: var(--screen-space);
|
|
7
|
+
`,d=o.span`
|
|
8
|
+
white-space: pre-wrap;
|
|
9
|
+
`;export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,p as ConnectLedgerScreenView,c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-CTvHGnoI.mjs";import{u as r,c as n,b as a}from"./internal-context-Z-fyxadS.mjs";import{a as i}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./privy-context-DjQaHYWB.mjs";import{i as c}from"./ConnectWalletView-DxWxjOjC.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-B3hf8Gf5.mjs";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"eventemitter3";import"viem/utils";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"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-DXutpDmP.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BWVpc1Y-.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),C=i(),u=s?.externalConnectWallet?.description,E=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),j=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:E.current,walletChainType:j.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{C("connectWallet","onError",a.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{C("connectWallet","onSuccess",{wallet:t});let o=s?.externalConnectWallet?.onCompleteNavigateTo;o?p(o({address:t.address,walletClientType:e?.walletClientType,walletChainType:e?.chainType})):m()},onConnectError:e=>{e instanceof n?(console.warn(e.cause?e.cause:e.message),C("connectWallet","onError",e.privyErrorCode||a.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),C("connectWallet","onError",a.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:u,app:d,connectOnly:!0})},isUnauthenticatedScreem:!0};export{m as ConnectOnlyLandingScreen,m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as i}from"./use-export-wallet-DQk47ipd.mjs";import{q as n}from"./context-CTvHGnoI.mjs";import{z as a}from"./useActiveWallet-jEsJB3LX.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./privy-context-DjQaHYWB.mjs";import{S as c}from"./ScreenLayout-C5tqY0au.mjs";import{B as m}from"./index-ldG7uF5Z.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-ApbD7KFS.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-B3hf8Gf5.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-C-LEnZLL.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-MdJeWwyN.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"./Link-DJ5gq9Di.mjs";import"./useI18n-BWVpc1Y-.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-B2ygR6ax.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:n,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:n,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===i.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:m,watermark:!0}),d={component:()=>{let i,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:v}=l(),{walletConnectionStatus:g,closePrivyModal:j}=s(),[h,C]=t(void 0),[k,b]=t(0),x=a(g?.connector?.walletClientType||"unknown"),S="connected"===g?.status,R="switching_to_supported_chain"===g?.status;o((()=>{if(S){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=g.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&g.connector){let e=g.connector.wallets.find((e=>e.address===o));v({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:g.connector?.walletClientType,walletChainType:g.connector?.chainType}))}),n)}else e=setTimeout(j,n);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;g?.connectError&&(e=g?.connectError,C(p(e)))}),[g]);let T=g?.connector?.connectorType||"injected",W=g?.connector?.walletClientType||"unknown",E=x?.metadata?.shortName||x?.name||g?.connector?.walletBranding.name||"Browser Extension",B=x?.image_url?.md||g?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),M="Browser Extension"===E?E.toLowerCase():E;i=S?`Successfully connected with ${M}`:h?h.message:R?"Switching networks":`Waiting for ${M}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&h?_="Unable to connect wallet":h?_=h.detail:R?_="Switch your wallet to the requested network.":"metamask"===W&&r?_="Click to continue to open and connect MetaMask.":"metamask"===W?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===T?_="Open your mobile wallet app to continue":"coinbase_wallet"===T&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:E,walletLogo:B,success:S,errorMessage:h,title:i,subtitle:_,onRetry:()=>{b(k+1),C(void 0),g?.connectRetry()},onUseDifferentWallet:c,onBack:f===w?void 0:c,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-CTvHGnoI.mjs";import{C as r,L as i}from"./CustomLandingScreenView-B3SypvcL.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-B3hf8Gf5.mjs";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-DoJmA9i9.mjs";import"./privy-context-DjQaHYWB.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-ldG7uF5Z.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-MdJeWwyN.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-DxWxjOjC.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-DXutpDmP.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BWVpc1Y-.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";import"./ConnectEmailForm-BHbXRWOx.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-tJp8qUlN.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-BDgrWJ32.mjs";import"./ScreenLayout-C5tqY0au.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as o,jsxs as e,Fragment as r}from"react/jsx-runtime";import{forwardRef as n,useState as t,useEffect as i}from"react";import{styled as a}from"styled-components";import{countryCodesAndNumbers as d,validatePhoneNumber as l,phoneNumberTypingFormatter as c,getPlaceholderPhoneNumber as p,getCountryCallingCode as u,getPhoneCountryCodeAndNumber as h,formatPhoneNumber as s}from"@privy-io/js-sdk-core";import{u as g}from"./context-
|
|
1
|
+
import{jsx as o,jsxs as e,Fragment as r}from"react/jsx-runtime";import{forwardRef as n,useState as t,useEffect as i}from"react";import{styled as a}from"styled-components";import{countryCodesAndNumbers as d,validatePhoneNumber as l,phoneNumberTypingFormatter as c,getPlaceholderPhoneNumber as p,getCountryCallingCode as u,getPhoneCountryCodeAndNumber as h,formatPhoneNumber as s}from"@privy-io/js-sdk-core";import{u as g}from"./context-CTvHGnoI.mjs";import{r as m}from"./useActiveWallet-jEsJB3LX.mjs";import{E as b,P as x}from"./ModalHeader-B3hf8Gf5.mjs";import{C as v}from"./Chip-D2-wZOHJ.mjs";const f=({value:r,onChange:n})=>/*#__PURE__*/o("select",{value:r,onChange:n,children:d.map((o=>/*#__PURE__*/e("option",{value:o.code,children:[o.code," +",o.callCode]},o.code)))}),w=/*#__PURE__*/n(((n,a)=>{let d=g(),[w,k]=t(!1),{accountType:$}=m(),[N,P]=t(""),[S,j]=t(d?.intl.defaultCountry??"US"),V=l(N,S),z=c(S),T=p(S),U=u(S),L=!V,[q,E]=t(!1),B=U.length,D=o=>{let e=o.target.value;j(e),P(""),n.onChange&&n.onChange({rawPhoneNumber:N,qualifiedPhoneNumber:s(N,e),countryCode:e,isValid:l(N,S)})},I=(o,e)=>{try{let r=o.replace(/\D/g,"")===N.replace(/\D/g,"")?o:z.input(o);P(r),n.onChange&&n.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:s(o,e),countryCode:e,isValid:l(o,e)})}catch(o){console.error("Error processing phone number:",o)}},R=()=>{E(!0);let o=s(N,S);n.onSubmit({rawPhoneNumber:N,qualifiedPhoneNumber:o,countryCode:S,isValid:l(N,S)}).finally((()=>E(!1)))};return i((()=>{if(n.defaultValue){let o=h(n.defaultValue);z.reset(),D({target:{value:o.countryCode}}),I(o.phone,o.countryCode)}}),[n.defaultValue]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(y,{children:/*#__PURE__*/e(C,{$callingCodeLength:B,$stacked:n.stacked,children:[/*#__PURE__*/o(f,{value:S,onChange:D}),/*#__PURE__*/o("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:T,onFocus:()=>k(!0),onChange:o=>{I(o.target.value,S)},onKeyUp:o=>{"Enter"===o.key&&R()},value:N,autoComplete:"tel"}),"phone"!==$||w||n.hideRecent?n.stacked||n.noIncludeSubmitButton?/*#__PURE__*/o("span",{}):/*#__PURE__*/o(b,{isSubmitting:q,onClick:R,disabled:L,children:"Submit"}):/*#__PURE__*/o(v,{color:"gray",children:"Recent"})]})}),n.stacked&&!n.noIncludeSubmitButton?/*#__PURE__*/o(x,{loading:q,loadingText:null,onClick:R,disabled:L,children:"Submit"}):null]})}));let y=a.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
`,C=a.label`
|
|
4
4
|
--country-code-dropdown-width: calc(54px + calc(12 * ${o=>o.$callingCodeLength}px));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@heroicons/react/24/outline";import{useVirtualizer as i}from"@tanstack/react-virtual";import{useMemo as a,useState as o,useCallback as r,useRef as c,useEffect as s}from"react";import{isMobile as d}from"react-device-detect";import{styled as h}from"styled-components";import{a as u,T as m}from"./ModalHeader-
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as l}from"@heroicons/react/24/outline";import{useVirtualizer as i}from"@tanstack/react-virtual";import{useMemo as a,useState as o,useCallback as r,useRef as c,useEffect as s}from"react";import{isMobile as d}from"react-device-detect";import{styled as h}from"styled-components";import{a as u,T as m}from"./ModalHeader-B3hf8Gf5.mjs";import{C as p}from"./CopyableText-BCytXyJL.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{Q as w}from"./QrCode-DXutpDmP.mjs";import{E as y}from"./EmailInputForm-Dgoii4vf.mjs";import{u as f,q as v}from"./context-CTvHGnoI.mjs";import{u as b}from"./useI18n-BWVpc1Y-.mjs";import{M as C,m as T,c as x,s as _,w as W,C as k,k as L,S as z}from"./useActiveWallet-jEsJB3LX.mjs";import{W as S,c as A,A as E}from"./use-export-wallet-DQk47ipd.mjs";import{u as j,P as B,b as K}from"./internal-context-Z-fyxadS.mjs";import{W as q}from"./WalletCards-DH1rqayz.mjs";import{S as N}from"./Screen-C-LEnZLL.mjs";const I={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:C,md:C}}};class O{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.includes("eip155:")))}isSol(e){return e.chains.some((e=>e.includes("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=O.normalize(e);return this.normalizedAllowList.some((e=>t===O.normalize(e)))}inDenyList(e,n){return"listing"===n&&"rabby"===e||"agw"===O.normalize(e)}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}getAllowListKey(e,n,t,l){let i=O.normalize(e);for(let e of this.normalizedAllowList||[])if(i===O.normalize(e))return e;if("connector"===n){if(("injected"===t||"solana_adapter"===t)&&"ethereum"===l&&this.detectedEth)return"detected_ethereum_wallets";if(("injected"===t||"solana_adapter"===t)&&"solana"===l&&this.detectedSol)return"detected_solana_wallets"}if("listing"===n&&this.includeWalletConnect)return"wallet_connect"}connectorOk(e){return!!("null"!==e.connectorType&&"walletconnect_solana"!==e.walletBranding.id&&this.chainMatches(e.chainType)&&(this.inAllowList(e.walletClientType,"connector")||("injected"===e.connectorType||"solana_adapter"===e.connectorType)&&("ethereum"===e.chainType&&this.detectedEth||"solana"===e.chainType&&this.detectedSol)))}listingOk(e){if(e.slug.includes("coinbase"))return!1;if("ethereum-only"===this.chainFilter){if(!this.isEth(e))return!1}else if("solana-only"===this.chainFilter&&!this.isSol(e))return!1;return!(!this.inAllowList(e.slug,"listing")||this.inDenyList(e.slug,"listing"))}getWallets(e,n){let t=new Map,l=e=>{let n=t.get(e.id);if(n){n.chainType!==e.chainType&&(n.chainType="multi");let t=new Set(n.chains);e.chains.forEach((e=>t.add(e))),n.chains=Array.from(t),!n.icon&&e.icon&&(n.icon=e.icon),!n.url&&e.url&&(n.url=e.url),!n.listing&&e.listing&&(n.listing=e.listing),!n.allowListKey&&e.allowListKey&&(n.allowListKey=e.allowListKey)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=O.normalize(e.walletClientType);l({id:n,label:e.walletBranding?.name??n,source:"connector",connector:e,chainType:e.chainType,icon:e.walletBranding?.icon,url:void 0,chains:["ethereum"===e.chainType?"eip155":"solana"],allowListKey:this.getAllowListKey(e.walletClientType,"connector",e.connectorType,e.chainType)})}));let i=e.find((e=>"wallet_connect_v2"===e.connectorType)),a=e.find((e=>"walletconnect_solana"===e.walletBranding.id));n.filter((e=>this.listingOk(e))).forEach((n=>{let t=[...n.chains].filter((e=>e.includes("eip155:")||e.includes("solana:")));if(e.some((e=>O.normalize(e.walletClientType)===O.normalize(n.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||i||n.mobile.native||n.mobile.universal||T[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.includes("eip155:")))),e.some((e=>O.normalize(e.walletClientType)===O.normalize(n.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||a||n.mobile.native||n.mobile.universal||T[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.includes("solana:")))),!t.length)return;let o=O.normalize(n.slug),r=I[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.includes("eip155:")))&&l({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t,allowListKey:this.getAllowListKey(n.slug,"listing")}),t.some((e=>e.includes("solana:")))&&l({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t,allowListKey:this.getAllowListKey(n.slug,"listing")})})),this.includeWalletConnectQr&&i&&l({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:i,chainType:"ethereum",icon:S,url:void 0,chains:["eip155"],allowListKey:"wallet_connect_qr"}),this.includeWalletConnectQrSolana&&a&&l({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:S,url:void 0,chains:["solana"],allowListKey:"wallet_connect_qr_solana"});let o=Array.from(t.values());o.forEach((e=>{let n=I[e.listing?.slug||e.id];n?.image_url?.sm&&(e.icon=n.image_url.sm)}));let r=new Map;return this.normalizedAllowList?.forEach(((e,n)=>{r.set(O.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{if(e.allowListKey&&n.allowListKey){let t=this.normalizedAllowList?.findIndex((n=>O.normalize(n)===O.normalize(e.allowListKey)))??-1,l=this.normalizedAllowList?.findIndex((e=>O.normalize(e)===O.normalize(n.allowListKey)))??-1;if(t!==l&&t>=0&&l>=0)return t-l}if(e.allowListKey&&!n.allowListKey)return-1;if(!e.allowListKey&&n.allowListKey)return 1;let t=O.normalize(e.id),l=O.normalize(n.id);"binance-defi"===t?t="binance":"universalprofiles"===t?t="universal_profile":"cryptocom-defi"===t?t="cryptocom":"bitkeep"===t&&(t="bitget_wallet"),"binance-defi"===l?l="binance":"universalprofiles"===l?l="universal_profile":"cryptocom-defi"===l?l="cryptocom":"bitkeep"===l&&(l="bitget_wallet");let i=r.has(t),a=r.has(l);return i&&a?r.get(t)-r.get(l):i?-1:a?1:"connector"===e.source&&"listing"===n.source?-1:"listing"===e.source&&"connector"===n.source?1:e.label.toLowerCase().localeCompare(n.label.toLowerCase())})),walletCount:o.length}}constructor(e,n){this.chainFilter=e,n&&n.length>0&&(this.normalizedAllowList=n.map(String),this.normalizedAllowList.includes("binance")&&this.normalizedAllowList.push("binance-defi-wallet"),this.normalizedAllowList.includes("bitget_wallet")&&this.normalizedAllowList.push("bitkeep")),this.detectedEth=this.normalizedAllowList?.includes("detected_ethereum_wallets")??!1,this.detectedSol=this.normalizedAllowList?.includes("detected_solana_wallets")??!1,this.includeWalletConnect=this.normalizedAllowList?.includes("wallet_connect")??!1,this.includeWalletConnectQr=this.normalizedAllowList?.includes("wallet_connect_qr")??!1,this.includeWalletConnectQrSolana=this.normalizedAllowList?.includes("wallet_connect_qr_solana")??!1}}var U=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#5469d4"}),/*#__PURE__*/n("path",{d:"m15.997 5.333-.143.486v14.106l.143.143 6.548-3.87z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 5.333-6.548 10.865 6.548 3.87z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.997 21.306-.08.098v5.025l.08.236 6.552-9.227z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 26.665v-5.36l-6.548-3.867z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.995 20.07 6.548-3.87-6.548-2.976v6.847z",fill:"#8698e8"}),/*#__PURE__*/n("path",{d:"m9.448 16.2 6.548 3.87v-6.846z",fill:"#c2ccf4"})]}),$=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/e("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"7.233",x2:"24.766",y1:"24.766",y2:"7.234",children:[/*#__PURE__*/n("stop",{offset:"0",stopColor:"#9945ff"}),/*#__PURE__*/n("stop",{offset:".2",stopColor:"#7962e7"}),/*#__PURE__*/n("stop",{offset:"1",stopColor:"#00d18c"})]}),/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#10111a"}),/*#__PURE__*/n("path",{clipRule:"evenodd",d:"m9.873 20.41a.645.645 0 0 1 .476-.21l14.662.012a.323.323 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54zm15.376-2.862a.322.322 0 0 1 -.238.54l-14.662.012a.642.642 0 0 1 -.476-.21l-3.122-3.44a.323.323 0 0 1 .238-.54l14.662-.012a.644.644 0 0 1 .475.21zm-15.376-9.738a.644.644 0 0 1 .476-.21l14.662.012a.322.322 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54z",fill:"url(#a)",fillRule:"evenodd"})]});const F=h.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
justify-content: space-between;
|
|
4
4
|
align-items: center;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-ldG7uF5Z.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as h}from"./context-CTvHGnoI.mjs";import{u as y}from"./useI18n-BWVpc1Y-.mjs";import{C as S,P as f,w as C,k as v,y as b}from"./use-export-wallet-DQk47ipd.mjs";import{isHex as T,getAddress as _}from"viem";import{b as E,u as R,k}from"./internal-context-Z-fyxadS.mjs";import{z as A}from"./useActiveWallet-jEsJB3LX.mjs";import{u as W,a as I}from"./privy-context-DjQaHYWB.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-B2ygR6ax.mjs";import{u as j}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-MdJeWwyN.mjs";import{S as O}from"./ScreenLayout-C5tqY0au.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DoJmA9i9.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>T(e,{strict:!0}))).map((e=>_(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const x=e=>e?.privyErrorCode===E.LINKED_TO_ANOTHER_USER?S.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?S.ERROR_TIMED_OUT:e?.privyErrorCode===E.CANNOT_LINK_MORE_OF_TYPE?S.ERROR_USER_LIMIT_REACHED:S.ERROR_WALLET_CONNECTION,M=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:v,onCoinbaseReset:b,onDifferentWallet:T})=>{let{t:_}=y(),E=w?{label:"Use a different wallet",onClick:b,disabled:r}:c===S.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&h<2?{label:"Retry",onClick:v,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:E,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(F,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,T]=a(void 0),{authenticated:_,logout:O}=W(),{navigate:D,navigateBack:F,lastScreen:B,currentScreen:P,setModalData:q,data:z}=I(),H=w(),{t:X}=y(),{getAuthFlow:K,walletConnectionStatus:Y,closePrivyModal:Q,initLoginWithWallet:J,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=R(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=A(Y?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Y?.connector?.connectorType||c&&"coinbase_wallet"===Y?.connector?.connectorType||c&&"base_account"===Y?.connector?.connectorType||c&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||c&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,ye="switching_to_supported_chain"===Y?.status;i((()=>{let e=K(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===z?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||_?J(Y.connectedWallet,pe,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>J(Y.connectedWallet,e,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&z?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),T(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(H?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,H.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}$();let t=setTimeout((()=>Q({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let Se=e=>{if(e?.privyErrorCode!==E.ALLOWLIST_REJECTED){if(e?.privyErrorCode===E.USER_LIMIT_REACHED)return console.error(new k(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==E.USER_DOES_NOT_EXIST)return e?.privyErrorCode===E.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:K()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:K()?.meta.walletClientType,chainId:K()?.meta.chainId,connectorType:K()?.meta.connectorType},linkMethod:K()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void T(x(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){Se(e)}finally{f(!1)}}i((()=>{Y?.connectError&&Se(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",ve=Y?.connector?.walletClientType||"unknown",be=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===be?be.toLowerCase():be;t=n?X("connectionStatus.successfullyConnected",{walletName:_e}):C?X("connectionStatus.errorTitle",{errorMessage:C.message}):ye?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=X("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:ye?Ee="Switch your wallet to the requested network.":he&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===ve&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===ve?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?b()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):z?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===ve&&(N(ne)||C===S.ERROR_USER_EXISTS);/*#__PURE__*/return e(M,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:B&&P!==B?F:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),T(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:F})}};let F=l.p`
|
|
2
|
+
text-align: center;
|
|
3
|
+
color: var(--privy-color-foreground-2);
|
|
4
|
+
font-size: 14px;
|
|
5
|
+
line-height: 22px;
|
|
6
|
+
margin: 16px 0;
|
|
7
|
+
`;export{D as ConnectionStatusScreen,M as ConnectionStatusView,D as default,x as getErrorDetails};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as a,q as i}from"./context-CTvHGnoI.mjs";import{R as s}from"./index-ldG7uF5Z.mjs";import{u as n,a as c,e as p,b as l}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./privy-context-DjQaHYWB.mjs";import{n as d}from"./useActiveWallet-jEsJB3LX.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-B2ygR6ax.mjs";import{S as f}from"./ScreenLayout-C5tqY0au.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DoJmA9i9.mjs";import"viem";import"./use-export-wallet-DQk47ipd.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-MdJeWwyN.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"styled-components";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"./ModalHeader-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:a,onClose:i})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:a?{title:"Authentication failed",subtitle:a.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,a,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!a},onBack:i,watermark:!0})},v={component:()=>{let t=a(),{data:f,navigate:v,setModalData:y,onUserCloseViaDialogOrKeybindRef:A}=m(),{crossAppAuthFlow:g,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),U=f?.crossAppAuth,x=new c(`There was an issue connecting your ${U?.name} account. Please try again.`),T=new s((async e=>{if(U?.popup)try{let t=await g({appId:e,popup:U.popup,action:U.action,disableSignup:U.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return y({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${U.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");U.popup&&U.popup.close(),I({error:x})}else I({error:x})}else I({error:x})})),k=()=>{C.data&&(j(),U?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return A.current=k,r((()=>{U?.appId?.length&&T.execute(U.appId)}),[U?.appId]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),i);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{y({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${U?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),i);return()=>clearTimeout(e)}let o=setTimeout(k,i);return()=>clearTimeout(o)}),[C.data]),U?.appId?/*#__PURE__*/e(h,{providerApp:{id:U?.appId,logoUrl:U?.logoUrl,name:U?.name},success:!!C.data,error:C.error,onClose:k}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
|
package/dist/esm/{CustomLandingScreenView-Co0nHKPw.mjs → CustomLandingScreenView-B3SypvcL.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-B3hf8Gf5.mjs";import{u}from"./context-CTvHGnoI.mjs";import{A as g,C as m,B as f,H as y,r as w,D as v,F as C,G as b,s as k,I as S,c as T,J as M,K as x}from"./useActiveWallet-jEsJB3LX.mjs";import{u as A}from"./internal-context-Z-fyxadS.mjs";import{u as L,a as W,i as I}from"./privy-context-DjQaHYWB.mjs";import{a as E,t as P}from"./index-ldG7uF5Z.mjs";import{u as N,b as D,c as j}from"./ConnectWalletView-DxWxjOjC.mjs";import{z as O}from"./use-export-wallet-DQk47ipd.mjs";import{Mail as R,Smartphone as _,UserCircle as V}from"lucide-react";import{C as F}from"./ConnectEmailForm-BHbXRWOx.mjs";import{C as U}from"./Chip-D2-wZOHJ.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as q}from"./Link-DJ5gq9Di.mjs";import{C as B}from"./ConnectPhoneForm-tJp8qUlN.mjs";import{T as K,a as J,I as Q,S as X,L as Z,G as Y,b as ee,D as te,A as ie}from"./twitter-BoAxhlj6.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-BDgrWJ32.mjs";import{S as oe}from"./ScreenLayout-C5tqY0au.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=c.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as s,useEffect as i}from"react";import{W as a}from"./WalletInfoCard-9E_M4KpE.mjs";import{u as n,r as c}from"./context-CTvHGnoI.mjs";import{u as m,a as l}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./privy-context-DjQaHYWB.mjs";import{S as u}from"./ScreenLayout-C5tqY0au.mjs";import"styled-components";import"./ModalHeader-B3hf8Gf5.mjs";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"@privy-io/js-sdk-core";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"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-CPCEzwZf.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const d=({appName:s,address:i,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${s}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${s} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:i,title:"Wallet"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=s(!1),[j,y]=s(),{address:f,onDelegate:h,onSuccess:v,onError:w}=t.delegatedActions.consent,g=async()=>{a?v():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return i((()=>{if(!a&&!j)return;let e=setTimeout(g,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:f,success:a,error:j,onAccept:async()=>{try{await h(),u(!0)}catch(e){y(e)}},onDecline:()=>{g()},onClose:g})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-CTvHGnoI.mjs";import{u as c,a as m}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./privy-context-DjQaHYWB.mjs";import{S as p}from"./ScreenLayout-C5tqY0au.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-B3hf8Gf5.mjs";import"styled-components";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[y,v]=i(),{onRevoke:f,onSuccess:k,onError:h}=o.delegatedActions.revoke,w=async()=>{p?k():h(y??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!y)return;let e=setTimeout(w,a);return()=>clearTimeout(e)}),[p,y]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:y,onRevoke:async()=>{try{await f(),d(!0)}catch(e){v(e)}},onDeny:()=>{w()},onClose:w})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-ldG7uF5Z.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{u as l,a as c}from"./privy-context-DjQaHYWB.mjs";import{S as m}from"./ScreenLayout-C5tqY0au.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"./context-CTvHGnoI.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-MdJeWwyN.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-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:w,setModalData:f,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[C,g]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:x,entropyId:k,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:F,isUnifiedWallet:T=!1}=w?.connectWallet,W=e=>{C||(g(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return W("User must be authenticated and have a Privy wallet before it can be connected");try{if(!T){if(!k||!P)return W("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:k,entropyIdVerifier:P})}x&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===S){let e=await d.getAccessToken();if(!e)return W("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:F}});let t=await(v?.recover({accessToken:e,entropyId:k,entropyIdVerifier:P}));t?.entropyId||W(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F}}),h(A)}catch(e){W("An error has occurred, please try again.")}}else a(e)&&"privy"!==S&&"privy-v2"!==S?(f({...w,recoverWallet:{entropyId:k,entropyIdVerifier:P,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:S,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(S))):W(e)}})(),()=>clearTimeout(e)):void 0:W("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{W("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:C,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,c as s,e as c}from"./privy-context-DjQaHYWB.mjs";import{u as a,r as n}from"./context-CTvHGnoI.mjs";import{u as m}from"./internal-context-Z-fyxadS.mjs";import{S as l}from"./ScreenLayout-C5tqY0au.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-B3hf8Gf5.mjs";import"styled-components";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=m(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:x}=j.createWallet,A=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:x})};o((()=>{let e=setTimeout(A,n);return()=>clearTimeout(e)}),[]),f.current=A;let S=p&&!((t?.linkedAccounts?.length??0)>1);/*#__PURE__*/return e(u,{title:S?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:S?"You've successfully created an account.":"Your account is secured.",onClose:A})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as
|
|
1
|
+
import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as c}from"./WarningBanner-c8L53pJ2.mjs";import{W as d}from"./WalletInfoCard-9E_M4KpE.mjs";import{u as s}from"./context-CTvHGnoI.mjs";import{u as p}from"./internal-context-Z-fyxadS.mjs";import{u as m,a as u}from"./privy-context-DjQaHYWB.mjs";import{S as h}from"./ScreenLayout-C5tqY0au.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-B3hf8Gf5.mjs";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"@privy-io/js-sdk-core";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"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-CPCEzwZf.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s,onBack:p})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/r(t,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:p,showBack:!!p,watermark:!0,children:/*#__PURE__*/r(f,{children:[/*#__PURE__*/e(c,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(d,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let f=a.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
gap: 1.25rem;
|
|
@@ -18,8 +18,8 @@ import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState
|
|
|
18
18
|
border-radius: var(--privy-border-radius-md);
|
|
19
19
|
background-color: var(--privy-color-background-2);
|
|
20
20
|
color: var(--privy-color-foreground-3);
|
|
21
|
-
`;function w(t){let[a,
|
|
22
|
-
/*#__PURE__*/r(I,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...
|
|
21
|
+
`;function w(t){let[a,c]=o(t.dimensions.width),[d,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();c(e)}let e=getComputedStyle(document.documentElement);s({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let m="ethereum"===t.chainType&&!t.imported&&!t.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
|
|
22
|
+
/*#__PURE__*/r(I,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d}:{v:"1",entropy_id:t.entropyId,entropy_id_verifier:t.entropyIdVerifier,hd_wallet_index:t.hdWalletIndex,chain_type:t.chainType,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d},hash:{token:t.accessToken}})}),/*#__PURE__*/e(b,{children:"Loading..."}),m&&/*#__PURE__*/e(b,{children:"Loading..."})]})})}const k={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:c,clientAnalyticsId:d,client:h}=p(),f=s(),{data:g,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:k,appId:I,appClientId:b,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,chainType:T,address:V,isUnifiedWallet:W,imported:B,showBackButton:P}=g.keyExport,L=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},S=()=>{l({shouldCallAuthOnSuccess:!1}),w(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:V}})};return i((()=>{if(!n)return L("User must be authenticated before exporting their wallet");h.getAccessToken().then(t).catch(L)}),[n,a]),v.current=S,/*#__PURE__*/e(y,{address:V,accessToken:r,appConfigTheme:f.appearance.palette.colorScheme,onClose:S,isLoading:!r,onBack:P?S:void 0,exportButtonProps:r?{origin:k,appId:I,appClientId:b,clientAnalyticsId:d,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,isUnifiedWallet:W,imported:B,chainType:T}:void 0})}};let I=a.div`
|
|
23
23
|
overflow: visible;
|
|
24
24
|
position: relative;
|
|
25
25
|
overflow: none;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{generateWalletIdempotencyKey as i}from"@privy-io/js-sdk-core";import{u as a}from"./context-CTvHGnoI.mjs";import{F as s,s as l,k as n,v as m,G as c,R as d}from"./index-ldG7uF5Z.mjs";import{u as p,m as u}from"./internal-context-Z-fyxadS.mjs";import{a as h,u as y}from"./privy-context-DjQaHYWB.mjs";import{u as w}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as v}from"./ScreenLayout-C5tqY0au.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-MdJeWwyN.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const C=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(v,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),g={component:()=>{let{setModalData:t,navigate:v,data:g,onUserCloseViaDialogOrKeybindRef:j}=h(),f=a(),[b,x]=r(""),{embeddedWallets:S}=a(),{authenticated:W,user:O}=y(),{closePrivyModal:A,walletProxy:k,client:I}=p(),{onSuccess:P,onFailure:M,callAuthOnSuccessOnClose:R,shouldCreateEth:U,shouldCreateSol:E}=g.createWallet,K=w(),F=O?K(s)?.shouldCreateWallet({user:O}):void 0,L=!!O&&l(O,f.embeddedWallets.ethereum.createOnLogin,F),T=!!O&&n(O,f.embeddedWallets.solana.createOnLogin,F),V="legacy-embedded-wallets-only"===f.embeddedWallets.mode&&!0===f?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[q,D]=r(null),{create:z}=m(),G=U??L,H=E??T,Q=new d((async()=>{let e=await I.getAccessToken();if(O&&e&&k)try{let e,t=await i(O.id,"ethereum"),r=await i(O.id,"solana");if(G&&H)e=await z({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t}),e=await z({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(H)e=await z({chainType:"solana",walletIndex:0,latestUser:O,idempotencyKey:r});else{if(!G)return void A({shouldCallAuthOnSuccess:R});e=await z({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t})}D(e),v("EmbeddedWalletCreatedScreen")}catch(e){x(e.message)}}));return o((()=>W&&O?V?(t({...g,createWallet:{...g.createWallet,shouldCreateEth:G,shouldCreateSol:H},recoverySelection:{...g?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:G,shouldCreateSol:H}}),v(c({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:S.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void Q.execute():(v("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet")))),[V,W]),j.current=()=>null/*#__PURE__*/,e(C,{errorMessage:b||void 0,onClose:()=>{q?(P(q),A({shouldCallAuthOnSuccess:R})):(M(new u("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))}})}};export{g as EmbeddedWalletOnAccountCreateScreen,C as EmbeddedWalletOnAccountCreateView,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./privy-context-DjQaHYWB.mjs";import{u as i}from"./context-CTvHGnoI.mjs";import{u as n,o as d,m as c}from"./internal-context-Z-fyxadS.mjs";import{g as l}from"./useWallets-DoJmA9i9.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-CmSpUP06.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-B3hf8Gf5.mjs";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";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"./shared-Dj3rRmjE.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let[u,y]=o(null),[w,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:A,user:I}=t(),{client:M,walletProxy:R,refreshSessionAndUser:b,closePrivyModal:j,createAnalyticsEvent:x}=n(),{navigate:C,data:P,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=P.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,T="user-passcode"===D?.recoveryMethod;r((()=>{A||(C("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let L=()=>v?(N(v),void j({shouldCallAuthOnSuccess:!1})):O?(k(u),void j({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void j({shouldCallAuthOnSuccess:!1}));S.current=L;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:L},error:v?"An error has occurred, please try again.":void 0,buttonLoading:w,buttonHideAnimations:!1,password:f,isResettingPassword:T,onPasswordGenerate:()=>_(p()),onPasswordChange:_,onSubmit:async()=>{O?(k(u),j({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&R)try{x({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await R.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void x({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"error setting password"}});let t=await b(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void x({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"wallet disconnected"}});y(s),x({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),x({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:L})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-Z-fyxadS.mjs";import{a}from"./privy-context-DjQaHYWB.mjs";import{S as c}from"./ScreenLayout-C5tqY0au.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-CTvHGnoI.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-B3hf8Gf5.mjs";import"styled-components";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const m=({onClose:i,onProceed:s})=>/*#__PURE__*/e(c,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),n={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:c}=a(),{onFailure:n}=t.setWalletPassword,l=()=>{n(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return c.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{n as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{styled as o}from"styled-components";import i from"@heroicons/react/24/outline/ChevronRightIcon";import n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import s from"@heroicons/react/24/outline/FingerPrintIcon";import a from"@heroicons/react/24/outline/MinusCircleIcon";import l from"@heroicons/react/24/outline/PhoneIcon";import C from"@heroicons/react/24/outline/ShieldCheckIcon";import{A as c,L as d}from"./useActiveWallet-
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{styled as o}from"styled-components";import i from"@heroicons/react/24/outline/ChevronRightIcon";import n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import s from"@heroicons/react/24/outline/FingerPrintIcon";import a from"@heroicons/react/24/outline/MinusCircleIcon";import l from"@heroicons/react/24/outline/PhoneIcon";import C from"@heroicons/react/24/outline/ShieldCheckIcon";import{A as c,L as d}from"./useActiveWallet-jEsJB3LX.mjs";import{M as h,b as m,P as p}from"./ModalHeader-B3hf8Gf5.mjs";import{C as u}from"./Chip-D2-wZOHJ.mjs";import{I as y,T as f,S as g,E as k,M as w,d as v,e as b,f as M,g as x,R as Z,a as L,A as j,F as E,L as I,b as S,c as T,C as P,N as A}from"./PinInput-3SLvbnQa.mjs";import R from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import W from"@heroicons/react/24/outline/ClockIcon";import{useState as B,useMemo as F}from"react";import{u as z}from"./context-CTvHGnoI.mjs";import{u as $}from"./internal-context-Z-fyxadS.mjs";import{u as U}from"./privy-context-DjQaHYWB.mjs";import{ErrorScreenView as N}from"./ErrorScreen-CZY1qK53.mjs";import{DoubleIconWrapper as O}from"./LinkPasskeyScreen-DHCCysKA.mjs";import{C as D}from"./CopyToClipboard-DSTf_eKU.mjs";import{C as V}from"./Layouts-BlFm53ED.mjs";import{C as Y}from"./Column-C2X2MHYX.mjs";import{L as _}from"./LabelXs-oqZNqbm_.mjs";import{S as q}from"./Subtitle-CV-2yKE4.mjs";import{T as H}from"./Title-BnzYV3Is.mjs";import{B as Q}from"./shared-FM0rljBt.mjs";import{f as X,g as G,h as J,i as K}from"./index-ldG7uF5Z.mjs";import ee from"@heroicons/react/24/solid/ShieldCheckIcon";import{Q as re}from"./QrCode-DXutpDmP.mjs";const te=t=>/*#__PURE__*/e(oe,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...t,children:[/*#__PURE__*/r("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),/*#__PURE__*/r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let oe=o.svg`
|
|
2
2
|
height: 90px;
|
|
3
3
|
width: 90px;
|
|
4
4
|
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{AlertTriangle as i,Phone as a,Lock as o}from"lucide-react";import{styled as n}from"styled-components";import{u as s}from"./context-CTvHGnoI.mjs";import{a as c,P as l}from"./index-ldG7uF5Z.mjs";import{c as m,b as p,a as d,e as u}from"./internal-context-Z-fyxadS.mjs";import{a as T}from"./privy-context-DjQaHYWB.mjs";import{R as g}from"./reservoir-0wfhnc0j.mjs";import{S as y}from"./ScreenLayout-C5tqY0au.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.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-MdJeWwyN.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-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";const h=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:h})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof d)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof u&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:s.errorTitle||"You don't have access to this app",detail:s.errorDetail||"Have you been invited?",ctaText:s.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,s);/*#__PURE__*/return t(y,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:h,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(h,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
|
|
2
|
+
color: var(--privy-color-accent) !important;
|
|
3
|
+
font-weight: 600;
|
|
4
|
+
`;export{f as ErrorScreen,h as ErrorScreenView,f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as
|
|
1
|
+
import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as a}from"react";import{isMobile as n,isIOS as s}from"react-device-detect";import{styled as l}from"styled-components";import{L as c}from"./useActiveWallet-jEsJB3LX.mjs";import{O as d}from"./OpenLink-DZHy38vr.mjs";import{Q as m}from"./QrCode-DXutpDmP.mjs";import{Check as p,Copy as u}from"lucide-react";import{S as h}from"./ModalHeader-B3hf8Gf5.mjs";import{L as v}from"./LabelXs-oqZNqbm_.mjs";import{u as f,q as g}from"./context-CTvHGnoI.mjs";import{u as y,b,k as w}from"./internal-context-Z-fyxadS.mjs";import{u as x,a as C}from"./privy-context-DjQaHYWB.mjs";import{s as E}from"./shouldProceedtoEmbeddedWalletCreationFlow-B2ygR6ax.mjs";import{S}from"./ScreenLayout-C5tqY0au.mjs";import{F as k}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-ldG7uF5Z.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-MdJeWwyN.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"./Screen-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";let j=l.div`
|
|
2
2
|
width: 100%;
|
|
3
3
|
`,T=l.div`
|
|
4
4
|
display: flex;
|
|
@@ -47,7 +47,7 @@ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState
|
|
|
47
47
|
font-size: 14px;
|
|
48
48
|
flex-shrink: 0;
|
|
49
49
|
}
|
|
50
|
-
`;const I=({value:a,title:n,placeholder:s,className:l,showCopyButton:c=!0,truncate:d,maxLength:m=40,disabled:h=!1})=>{let[v,f]=
|
|
50
|
+
`;const I=({value:a,title:n,placeholder:s,className:l,showCopyButton:c=!0,truncate:d,maxLength:m=40,disabled:h=!1})=>{let[v,f]=o(!1),g=d&&a?((e,r,t)=>{if((e=e.startsWith("https://")?e.slice(8):e).length<=t)return e;if("middle"===r){let r=Math.ceil(t/2)-2,o=Math.floor(t/2)-1;return`${e.slice(0,r)}...${e.slice(-o)}`}return`${e.slice(0,t-3)}...`})(a,d,m):a;return i((()=>{if(v){let e=setTimeout((()=>f(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e(j,{className:l,children:[n&&/*#__PURE__*/r(O,{children:n}),/*#__PURE__*/e(T,{$disabled:h,children:[/*#__PURE__*/r(A,{children:a?/*#__PURE__*/r(F,{$disabled:h,title:a,children:g}):/*#__PURE__*/r(L,{$disabled:h,children:s||"No value"})}),c&&a&&/*#__PURE__*/r(_,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(a).then((()=>f(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/r(p,{size:14})]}:{children:["Copy",/*#__PURE__*/r(u,{size:14})]})})]})]})},R=({connectUri:t,loading:o,success:i,errorMessage:a,onBack:l,onClose:p,onOpenFarcaster:u})=>/*#__PURE__*/r(S,n||o?s?{title:a?a.message:"Sign in with Farcaster",subtitle:a?a.detail:"To sign in with Farcaster, please open the Farcaster app.",icon:k,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},primaryCta:t&&u?{label:"Open Farcaster app",onClick:u}:void 0,onBack:l,onClose:p,watermark:!0}:{title:a?a.message:"Signing in with Farcaster",subtitle:a?a.detail:"This should only take a moment",icon:k,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},onBack:l,onClose:p,watermark:!0,children:t&&n&&/*#__PURE__*/r(U,{children:/*#__PURE__*/r(d,{text:"Take me to Farcaster",url:t,color:"#8a63d2"})})}:{title:"Sign in with Farcaster",subtitle:"Scan with your phone's camera to continue.",onBack:l,onClose:p,watermark:!0,children:/*#__PURE__*/e(W,{children:[/*#__PURE__*/r(M,{children:t?/*#__PURE__*/r(m,{url:t,size:275,squareLogoElement:k}):/*#__PURE__*/r(z,{children:/*#__PURE__*/r(c,{})})}),/*#__PURE__*/e($,{children:[/*#__PURE__*/r(D,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),t&&/*#__PURE__*/r(I,{value:t,truncate:"end",maxLength:30,showCopyButton:!0,disabled:!0})]})]})}),N={component:()=>{let{authenticated:e,logout:t,ready:n,user:s}=x(),{lastScreen:l,navigate:c,navigateBack:d,setModalData:m}=C(),p=f(),{getAuthFlow:u,loginWithFarcaster:h,closePrivyModal:v,createAnalyticsEvent:S}=y(),[k,j]=o(void 0),[T,A]=o(!1),[F,L]=o(!1),O=a([]),_=u(),I=_?.meta.connectUri;return i((()=>{let e=Date.now(),r=setInterval((async()=>{let t=await _.pollForReady.execute(),o=Date.now()-e;if(t){clearInterval(r),A(!0);try{await h(),L(!0)}catch(e){let r={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===b.ALLOWLIST_REJECTED)return void c("AllowlistRejectionScreen");if(e?.privyErrorCode===b.USER_LIMIT_REACHED)return console.error(new w(e).toString()),void c("UserLimitReachedScreen");if(e?.privyErrorCode===b.USER_DOES_NOT_EXIST)return void c("AccountNotFoundScreen");if(e?.privyErrorCode===b.LINKED_TO_ANOTHER_USER)r.detail=e.message??"This account has already been linked to another user.";else{if(e?.privyErrorCode===b.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return m({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void c("LinkConflictScreen");e?.privyErrorCode===b.INVALID_CREDENTIALS?(r.retryable=!0,r.detail="Something went wrong. Try again."):e?.privyErrorCode===b.TOO_MANY_REQUESTS&&(r.detail="Too many requests. Please wait before trying again.")}j(r)}}else o>12e4&&(clearInterval(r),j({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(r),O.current.forEach((e=>clearTimeout(e)))}}),[]),i((()=>{if(n&&e&&F&&s){if(p?.legal.requireUsersAcceptTerms&&!s.hasAcceptedTerms){let e=setTimeout((()=>{c("AffirmativeConsentScreen")}),g);return()=>clearTimeout(e)}F&&(E(s,p.embeddedWallets)?O.current.push(setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),g)):O.current.push(setTimeout((()=>v({shouldCallAuthOnSuccess:!0,isSuccess:!0})),g)))}}),[F,n,e,s]),/*#__PURE__*/r(R,{connectUri:I,loading:T,success:F,errorMessage:k,onBack:l?d:void 0,onClose:v,onOpenFarcaster:()=>{I&&(window.location.href=I)}})}};let U=l.div`
|
|
51
51
|
margin-top: 24px;
|
|
52
52
|
`,W=l.div`
|
|
53
53
|
display: flex;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as a}from"react";import{isMobile as i,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-DSTf_eKU.mjs";import{L as c}from"./useActiveWallet-jEsJB3LX.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-DXutpDmP.mjs";import{u as d,q as u}from"./context-CTvHGnoI.mjs";import{u as g}from"./internal-context-Z-fyxadS.mjs";import{a as h}from"./privy-context-DjQaHYWB.mjs";import{S as f}from"./ScreenLayout-C5tqY0au.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./use-export-wallet-DQk47ipd.mjs";import"./useWallets-DoJmA9i9.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-B3hf8Gf5.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-C-LEnZLL.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:a,errorMessage:n,connectUri:d,onBack:u,onClose:g,onOpenFarcaster:h})=>/*#__PURE__*/e(f,i||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},primaryCta:d&&h?{label:"Open Farcaster app",onClick:h}:void 0,onBack:u,onClose:g,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},onBack:u,onClose:g,watermark:!0,children:d&&i&&/*#__PURE__*/e(x,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:g,watermark:!0,children:/*#__PURE__*/t(w,{children:[/*#__PURE__*/e(j,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(b,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(S,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let x=n.div`
|
|
2
|
+
margin-top: 24px;
|
|
3
|
+
`,w=n.div`
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 24px;
|
|
8
|
+
`,j=n.div`
|
|
9
|
+
padding: 24px;
|
|
10
|
+
position: relative;
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
min-height: 275px;
|
|
15
|
+
`,C=n.div`
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 16px;
|
|
20
|
+
`,S=n.div`
|
|
21
|
+
font-size: 0.875rem;
|
|
22
|
+
text-align: center;
|
|
23
|
+
color: var(--privy-color-foreground-2);
|
|
24
|
+
`,b=n.div`
|
|
25
|
+
position: relative;
|
|
26
|
+
width: 82px;
|
|
27
|
+
height: 82px;
|
|
28
|
+
`;const F={component:()=>{let{lastScreen:t,navigateBack:i,data:s}=h(),n=d(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=g(),[m,p]=r(void 0),[f,v]=r(!1),[y,x]=r(!1),w=o([]),j=s?.farcasterSigner;a((()=>{let e=Date.now(),t=setInterval((async()=>{if(!j?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===j.status&&(clearInterval(t),v(!1),x(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(j?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),v(!1),x(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u))):o>3e5?(clearInterval(t),p({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),p({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),w.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===j?.status?j.signer_approval_url:void 0;/*#__PURE__*/return e(k,{appName:n.name,loading:f,success:y,errorMessage:m,connectUri:C,onBack:t?i:void 0,onClose:c,onOpenFarcaster:()=>{C&&(window.location.href=C)}})}};export{F as FarcasterSignerStatusScreen,k as FarcasterSignerStatusView,F as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as s}from"@privy-io/js-sdk-core";import{B as i,P as l}from"./ModalHeader-B3hf8Gf5.mjs";import{b as m,c,R as d,e as u}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-BZ3UxTwI.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-Dq_xe9dz.mjs";import{L as I,V as v}from"./Value-tcJV9e0L.mjs";import{a as w,R as S}from"./Row-C9vrS4Zi.mjs";import{u as j,t as y}from"./context-CTvHGnoI.mjs";import{u as C,a as L,b as x}from"./internal-context-Z-fyxadS.mjs";import{a as F}from"./privy-context-DjQaHYWB.mjs";import{u as k,g as U}from"./useWallets-MCga77FD.mjs";import{u as T}from"./useGetTokenPrice-CAeZUPHp.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as W}from"@solana-program/system";import{pipe as b,createTransactionMessage as P,setTransactionMessageFeePayerSigner as D,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as O,compileTransaction as E,getTransactionEncoder as M}from"@solana/kit";import{findAssociatedTokenPda as B,getCreateAssociatedTokenIdempotentInstruction as $,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as _}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as q,f as z,s as Q,w as X}from"./useSolanaRpcClient-BpNT8e8E.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{H as J}from"./use-export-wallet-DQk47ipd.mjs";import"styled-components";import"./useActiveWallet-jEsJB3LX.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./useWallets-DoJmA9i9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./usePrivy-MdJeWwyN.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";function K({rows:a}){/*#__PURE__*/return e(w,{children:a.filter((e=>!!e)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/t(S,{children:[/*#__PURE__*/e(I,{children:a.label}),/*#__PURE__*/e(v,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(e){return BigInt(Math.floor(1e9*parseFloat(e)))}function ee(e){return+te.format(parseFloat(e.toString())/1e9)}let te=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function ae({tx:e,solanaClient:t,amount:a,asset:n,tokenPrice:o}){if(!e)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:t,tx:e});return{amountInUsd:r,feeInUsd:o?V(s,o):void 0,totalInUsd:V(n+s,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:t,tx:e}),s=function(e,t){let a=parseFloat(e.toString())/G*t;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:V(r,o),totalInUsd:"$"+(parseFloat(a)+s).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:t,tx:e});return{amountInSol:a+" SOL",feeInSol:ee(o)+" SOL",totalInSol:ee(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:ee(await z({solanaClient:t,tx:e}))+" SOL"}}const ne={component:function(){let I=j(),{closePrivyModal:v,createAnalyticsEvent:w}=C(),{data:S,setModalData:G,navigate:z}=F(),{wallets:ee}=k(),[te,ne]=o("preparing"),[oe,re]=o(),[se,ie]=o(),[le,me]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ce,asset:de,chain:ue,sourceWalletData:pe,destinationAddress:fe,afterSuccessScreen:ge}=S.solanaFundingData,he=ee.find((e=>e.address===pe.address&&J(pe.walletClientType)===J(e.standardWallet.name))),Ie=q()(ue),{tokenPrice:ve,isTokenPriceLoading:we}=T("solana");return r((()=>{if("preparing"!==te||we||!he)return;let e="SOL"===de?Z(ce):function(e){return BigInt(Math.floor(1e6*parseFloat(e)))}(ce);ie({amount:("SOL"===de&&ve?V(e,ve):ce)??ce}),("SOL"===de?async function({solanaClient:e,source:t,destination:a,amountInLamports:n}){let{value:o}=await e.rpc.getLatestBlockhash().send(),r={address:t},s=b(P({version:0}),(e=>D(r,e)),(e=>N(o,e)),(e=>O(W({amount:n,source:r,destination:a}),e)),(e=>E(e)));return new Uint8Array(M().encode(s))}({solanaClient:Ie,source:he.address,destination:fe,amountInLamports:e}):async function({solanaClient:e,source:t,destination:a,amountInBaseUnits:n}){let o=_(e.chain),{value:r}=await e.rpc.getLatestBlockhash().send(),s={address:t},[i]=await B({mint:o,owner:t,tokenProgram:H}),[l]=await B({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([e.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${t}`);let d=$({payer:s,ata:l,owner:a,mint:o}),u=b(P({version:0}),(e=>D(s,e)),(e=>N(r,e)),(e=>c?.value?e:O(d,e)),(e=>O(R({source:i,destination:l,authority:s,amount:n}),e)),(e=>E(e)));return new Uint8Array(M().encode(u))}({solanaClient:Ie,source:he.address,destination:fe,amountInBaseUnits:e})).then(re).catch((e=>{ne("error"),me(e)}))}),[te,ce,de,ue,he,fe,we,ve]),r((()=>{"preparing"===te&&oe&&ae({tx:oe,solanaClient:Ie,amount:ce,asset:de,tokenPrice:ve}).then((e=>{ne("loaded"),ie({amount:e?.amountInUsd??e?.amountInUsdc??e?.amountInSol??ce,fee:e?.feeInUsd??e?.feeInSol,total:e?.totalInUsd??e?.totalInSol})})).catch((e=>{ne("error"),me(e)}))}),[oe,ce,de,te,ve]),r((()=>{"error"===te&&le&&(G({errorModalData:{error:le,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:S.solanaFundingData}),z("ErrorScreen",!1))}),[te,z]),r((()=>{if("success"!==te)return;let e=setTimeout(ge?()=>z(ge):v,y);return()=>clearTimeout(e)}),[te]),/*#__PURE__*/t(a,"success"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(m,{}),/*#__PURE__*/t(c,{children:[/*#__PURE__*/e(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/e(p,{title:"Success!",description:`You’ve successfully added ${ce} ${de} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/e(d,{}),/*#__PURE__*/e(i,{})]}:"preparing"===te||"loaded"===te||"sending"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(u,{style:{marginTop:"16px"},children:/*#__PURE__*/e(g,{icon:he?.standardWallet.icon,name:he?.standardWallet.name})}),/*#__PURE__*/e(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===te&&he?`Confirming with ${he.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/e(K,{rows:[{label:"Source",value:s(pe.address)},{label:"Destination",value:s(fe)},{label:"Network",value:Y(ue)},{label:"Amount",value:se?.amount,isLoading:"preparing"===te},{label:"Estimated fee",value:se?.fee,isLoading:"preparing"===te},{label:"Total",value:se?.total,isLoading:"preparing"===te}]}),/*#__PURE__*/e(l,{style:{marginTop:"1rem"},loading:"preparing"===te||"sending"===te,onClick:function(){"loaded"===te&&oe&&he&&(ne("sending"),async function({transaction:e,chain:t,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:e});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:e,chain:t}).catch((e=>{throw new L("Transaction was rejected by the user",e,x.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:Ie,transaction:oe,chain:ue,sourceWallet:he}).then((e=>{ne("success"),w({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:he.address,value:ce,chainType:"solana",clusterName:ue,token:de,destinationAddress:fe,destinationValue:ce,destinationChainType:"solana",destinationClusterName:ue,destinationToken:de}})})).catch((e=>{ne("error"),me(e)})))},children:"Confirm"}),/*#__PURE__*/e(i,{})]}:{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(h,{}),/*#__PURE__*/e("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/e(i,{})]})}};export{ne as FundSolWalletWithExternalSolanaWallet,ne as default};
|