@privy-io/react-auth 3.8.0 → 3.9.0-beta-20251212212932
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{AccountNotFoundScreen-jSbfPu_e.js → AccountNotFoundScreen-C1W2fcyo.js} +1 -1
- package/dist/cjs/{Address-CZQd_MIA.js → Address-DGUdKafT.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-D4OJpmEg.js +1 -0
- package/dist/cjs/{AllowlistRejectionScreen-B6roj0JU.js → AllowlistRejectionScreen-B7rDhjpU.js} +1 -1
- package/dist/cjs/{AuthenticateWithWalletScreen-BcBapHrq.js → AuthenticateWithWalletScreen-CtH28Vb7.js} +1 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-DNo_etZr.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-B0mcg1q6.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-BgOZn2kl.js +1 -0
- package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DYS3lDs0.js → AwaitingSolToEvmBridgingScreen-Cegtmcyh.js} +1 -1
- package/dist/cjs/{BridgeNetworkSelectionView-uivzU_Y9.js → BridgeNetworkSelectionView-DQ4AKZVL.js} +1 -1
- package/dist/cjs/{Button-nXApC2Jy.js → Button-QElvggxT.js} +1 -1
- package/dist/cjs/CaptchaScreen-KIwoUwV2.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-ClsWbyMu.js +1 -0
- package/dist/cjs/{ConnectEmailForm-BEv-7qU9.js → ConnectEmailForm-Cpvu7PEt.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-C9nw3QVj.js +1 -0
- package/dist/cjs/{ConnectOnlyLandingScreen-bOhkl0xJ.js → ConnectOnlyLandingScreen-BOuJ1H9w.js} +1 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DK4bjLii.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-YCIhmLCW.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-DK-bg2D5.js → ConnectPhoneForm-BhTwbwML.js} +1 -1
- package/dist/cjs/{ConnectWalletView-4vj7Sq7-.js → ConnectWalletView-OFVLgqsD.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-BmZIqpN7.js +1 -0
- package/dist/cjs/CrossAppAuthScreen-BeUpL_ke.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-tt_NEfU6.js → CustomLandingScreenView-BMEITA7m.js} +2 -2
- package/dist/cjs/{DelegatedActionsConsentScreen-B5WlYn7z.js → DelegatedActionsConsentScreen-D7pwtlqL.js} +1 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-CjM9Sioz.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-CNsU7jHP.js +1 -0
- package/dist/cjs/{EmbeddedWalletCreatedScreen-PycFyIz6.js → EmbeddedWalletCreatedScreen-D3pPFl5h.js} +1 -1
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-BDTDQY1f.js → EmbeddedWalletKeyExportScreen-Cbxp8HfV.js} +2 -2
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-BawUOKbB.js +1 -0
- package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js → EmbeddedWalletPasswordUpdateScreen-CXManbsF.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js → EmbeddedWalletPasswordUpdateSplashScreen-qQpsP_mz.js} +1 -1
- package/dist/cjs/{EnrollTotp-DZ5fIrXr.js → EnrollTotp-CRTazMDP.js} +1 -1
- package/dist/cjs/ErrorScreen-Cyi-HnSe.js +1 -0
- package/dist/cjs/FarcasterConnectStatusScreen-CR6ZMxx9.js +2 -0
- package/dist/cjs/{FarcasterSignerStatusScreen-CDYkqsxz.js → FarcasterSignerStatusScreen-9YR9eiIc.js} +2 -2
- package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js → FundSolWalletWithExternalSolanaWallet-CQsAijyt.js} +1 -1
- package/dist/cjs/{FundWalletMethodHeader-zYWhBIiS.js → FundWalletMethodHeader-DSaZB2cG.js} +1 -1
- package/dist/cjs/{FundingEditAmountScreen-BB7-k00c.js → FundingEditAmountScreen-CECyNIVY.js} +1 -1
- package/dist/cjs/{FundingMethodSelectionScreen-BrV94GD2.js → FundingMethodSelectionScreen-2tZJu9S7.js} +1 -1
- package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +1 -0
- package/dist/cjs/{InAppBrowserLoginNotPossible-y8g07-kU.js → InAppBrowserLoginNotPossible-D0k0zJDX.js} +1 -1
- package/dist/cjs/{InstallWalletScreen-CmGi6mS1.js → InstallWalletScreen-CmP6yADd.js} +1 -1
- package/dist/cjs/LandingScreen-Cu2tjqig.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BJXyOu2J.js → LinkConflictScreen-B0536MT6.js} +1 -1
- package/dist/cjs/LinkEmailScreen-CxvkEfct.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-Bw7Xs741.js → LinkPasskeyScreen-C5PJWoRd.js} +1 -1
- package/dist/cjs/{LinkPhoneScreen-C4JQblY3.js → LinkPhoneScreen-CAFdBxm2.js} +1 -1
- package/dist/cjs/{LoginFailedScreen-CGT-2B2h.js → LoginFailedScreen-COhVPqkq.js} +1 -1
- package/dist/cjs/ManualTransferScreen-DBf-aZcN.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-Gnjz9u3K.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-DEYm-6ZO.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-DNN15QXI.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-BxkXBdCC.js +1 -0
- package/dist/cjs/{ModalHeader-DbV81e3m.js → ModalHeader-BcLfp3ap.js} +1 -1
- package/dist/cjs/{MoonpayStatusScreen-yghPhz7v.js → MoonpayStatusScreen-CflXzPye.js} +1 -1
- package/dist/cjs/OAuthStatusScreen-CKAOb1-J.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-CfiXMGxb.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-DM5bpsYR.js +1 -0
- package/dist/cjs/PasswordRecoveryScreen-_VPOOzJe.js +1 -0
- package/dist/cjs/{QrCode-Ua_0cVUP.js → QrCode-D0s6bMSy.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-BvETyFFb.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-BdTjGqc1.js +1 -0
- package/dist/cjs/RecoverySelectionScreen-CBpXYztT.js +1 -0
- package/dist/cjs/{Screen-65eQbiHD.js → Screen-BDXOD3ca.js} +1 -1
- package/dist/cjs/{ScreenLayout-B_60rKhZ.js → ScreenLayout-Bolj7ZKh.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-DQolobOz.js → SetAutomaticRecoveryScreen-DpsqqlQy.js} +1 -1
- package/dist/cjs/{SetWalletPasswordForm-8g-lawop.js → SetWalletPasswordForm-D4BBkjST.js} +2 -2
- package/dist/cjs/{SignRequestScreen-BAgmmVVW.js → SignRequestScreen-CnKp7Qy1.js} +1 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-DqmwzL-5.js +1 -0
- package/dist/cjs/TelegramAuthScreen-BkWQJqdn.js +1 -0
- package/dist/cjs/{TransactionDetails-BefABtVQ.js → TransactionDetails-Da0Tpo_k.js} +1 -1
- package/dist/cjs/{TransactionErrorView-QKWh4urc.js → TransactionErrorView-DAmbVGy2.js} +2 -2
- package/dist/cjs/TransferFromWalletScreen-CFe0X_NF.js +1 -0
- package/dist/cjs/{TransferOrBridgeLoadingScreen-C6t1_cTP.js → TransferOrBridgeLoadingScreen-DF7kw9zr.js} +1 -1
- package/dist/cjs/TurnstileWrapper-qLN0G5m7.js +1 -0
- package/dist/cjs/UpdateEmailScreen-Kwl7tG4l.js +1 -0
- package/dist/cjs/{UpdatePhoneScreen-DefnuTEZ.js → UpdatePhoneScreen-44FR5anq.js} +1 -1
- package/dist/cjs/{UserLimitReachedScreen-B76r_-LC.js → UserLimitReachedScreen-ojZueqmT.js} +1 -1
- package/dist/cjs/WalletButtonList-DLB8T0RX.js +1 -0
- package/dist/cjs/{WalletInfoCard-CscdnrUV.js → WalletInfoCard-5UbicbMB.js} +1 -1
- package/dist/cjs/{WalletInterstitialScreen-CG1k3EvV.js → WalletInterstitialScreen-DAgZQaZB.js} +1 -1
- package/dist/cjs/{WalletLink-DF6dDjkz.js → WalletLink-B5xI6wVT.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/context-WcHVngsl.js +1 -0
- package/dist/cjs/{ethers-uj8IknV_.js → ethers-DbIujY7-.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{frame-bPqBJ8fS.js → frame-B14fp9oC.js} +1 -1
- package/dist/cjs/{get-is-unified-wallet-DmiciSes.js → get-is-unified-wallet-wZ72VTZL.js} +1 -1
- package/dist/cjs/{getErc20Balance-BZ5-OGfD.js → getErc20Balance-DknCauCO.js} +1 -1
- package/dist/cjs/{getErc20TokenInfo-HX7DgcWx.js → getErc20TokenInfo-CBduyYx4.js} +1 -1
- package/dist/cjs/{getPublicClient-EjAv8R2z.js → getPublicClient-CGlodIp_.js} +1 -1
- package/dist/cjs/index-DC9qNqKe.js +5 -0
- package/dist/cjs/index-DDm5kac-.js +1 -0
- package/dist/cjs/{index-Cuv6j_Y0.js → index-DZwAWF8d.js} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal-context-NWsAL807.js +1 -0
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/prepareFundingModalData-CM8ukvbz.js +1 -0
- package/dist/cjs/{reservoir-3I-Vkf2B.js → reservoir-CQGyEBb7.js} +1 -1
- package/dist/cjs/{shared-CT5ocsPG.js → shared-CV6uFlbd.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js → shouldProceedtoEmbeddedWalletCreationFlow-DemSlJUp.js} +1 -1
- package/dist/cjs/{smart-wallets-B7vHjGAW.js → smart-wallets-Lspn5i9s.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{to-ui-error-a-xwbRKZ.js → to-ui-error-BJpQLLfd.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-create-wallet-without-fallback-DSOJS4h0.js → use-create-wallet-without-fallback-CnS2odqx.js} +1 -1
- package/dist/cjs/{use-export-wallet-BRFTskbr.js → use-export-wallet-C5Fb5bFu.js} +1 -1
- package/dist/cjs/{use-sign-with-user-signer-On9f1Fag.js → use-sign-with-user-signer-BcAsQTGF.js} +1 -1
- package/dist/cjs/useActiveWallet-CXspRD1P.js +1 -0
- package/dist/cjs/{useGetSolPrice-eOpcFeNE.js → useGetSolPrice-C986iVoO.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-EcT0H5rf.js → useGetTokenPrice-COGokVcE.js} +1 -1
- package/dist/cjs/{useI18n-hYSvbQCq.js → useI18n-Cs1I7xTm.js} +1 -1
- package/dist/cjs/usePrivy-DH2ITnCQ.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-mfV88iJm.js → useSolanaRpcClient-CcJs2x9f.js} +1 -1
- package/dist/cjs/{useWalletBalance-CQAgfkRc.js → useWalletBalance-BVb8F3RO.js} +1 -1
- package/dist/cjs/{useWallets-TxPVNWGS.js → useWallets-BFvRErfm.js} +1 -1
- package/dist/cjs/{useWallets-h2xCj02C.js → useWallets-jLpT3nOf.js} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.mts → events-context-D8iPaW-H.d.mts} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.ts → events-context-D8iPaW-H.d.ts} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +17 -10
- package/dist/dts/index.d.ts +17 -10
- package/dist/dts/internal.d.mts +1 -1
- package/dist/dts/internal.d.ts +1 -1
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +3 -3
- package/dist/dts/solana.d.ts +3 -3
- package/dist/dts/{types-BkkvIRg5.d.mts → types-diVZpIb-.d.mts} +60 -8
- package/dist/dts/{types-BkkvIRg5.d.ts → types-diVZpIb-.d.ts} +60 -8
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-BzlsVk3E.mjs +1 -0
- package/dist/esm/{Address-DtXA0OPS.mjs → Address-yr-IopMB.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-DkgWeZ_J.mjs +1 -0
- package/dist/esm/{AllowlistRejectionScreen-BuH5iBJ3.mjs → AllowlistRejectionScreen-rYOJHwfe.mjs} +1 -1
- package/dist/esm/{AuthenticateWithWalletScreen-CKJqrLEm.mjs → AuthenticateWithWalletScreen-CkxHgH4i.mjs} +1 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-BWZ-wh0M.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DbIN3EKS.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-C5zFT5_8.mjs +1 -0
- package/dist/esm/{AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs → AwaitingSolToEvmBridgingScreen-Cr4qsHWY.mjs} +1 -1
- package/dist/esm/{BridgeNetworkSelectionView-Bu0vi9_a.mjs → BridgeNetworkSelectionView-DvYzBNcx.mjs} +1 -1
- package/dist/esm/{Button-DJ-mtuuD.mjs → Button-BGdXsfbI.mjs} +1 -1
- package/dist/esm/CaptchaScreen-Cm9qqF-6.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-CmX3D7il.mjs +1 -0
- package/dist/esm/{ConnectEmailForm-DUgOCS2V.mjs → ConnectEmailForm-Bth5xsJK.mjs} +1 -1
- package/dist/esm/ConnectLedgerScreen-ISKD8Msf.mjs +1 -0
- package/dist/esm/{ConnectOnlyLandingScreen-BVkcUaO6.mjs → ConnectOnlyLandingScreen-Bm8VrsST.mjs} +1 -1
- package/dist/esm/ConnectOnlyStatusScreen-2kQJ9RM2.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-BCwMWyuI.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-CbuSfwAI.mjs → ConnectPhoneForm-DBvRusd4.mjs} +1 -1
- package/dist/esm/ConnectWalletView-6VokbyOr.mjs +1 -0
- package/dist/esm/ConnectionStatusScreen-CdTfe93C.mjs +1 -0
- package/dist/esm/CrossAppAuthScreen-BTo6-pn-.mjs +1 -0
- package/dist/esm/CustomLandingScreenView-BNZtDY8q.mjs +2 -0
- package/dist/esm/DelegatedActionsConsentScreen-DKTTJRC4.mjs +1 -0
- package/dist/esm/{DelegatedActionsRevokeScreen-B-xLCB1j.mjs → DelegatedActionsRevokeScreen-Bc0pjFZb.mjs} +1 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-BRHQSNLs.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-CVkkyV1q.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-DX22sVNh.mjs → EmbeddedWalletKeyExportScreen-souOGCpG.mjs} +2 -2
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-pATMOIdC.mjs +1 -0
- package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs → EmbeddedWalletPasswordUpdateScreen-B_2nRtJK.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs → EmbeddedWalletPasswordUpdateSplashScreen-DC0m1YqY.mjs} +1 -1
- package/dist/esm/{EnrollTotp-BzAm1Ya4.mjs → EnrollTotp-DBtXbrmN.mjs} +1 -1
- package/dist/esm/ErrorScreen-BT6kRegh.mjs +1 -0
- package/dist/esm/FarcasterConnectStatusScreen-DeX21V2U.mjs +1 -0
- package/dist/esm/{FarcasterSignerStatusScreen-DIfmv7Ft.mjs → FarcasterSignerStatusScreen-DjDF7M3x.mjs} +1 -1
- package/dist/esm/{FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs → FundSolWalletWithExternalSolanaWallet-CQCuKKUv.mjs} +1 -1
- package/dist/esm/{FundWalletMethodHeader-CbTaIDLQ.mjs → FundWalletMethodHeader-CuTZ50v9.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-DA3nETVC.mjs +1 -0
- package/dist/esm/{FundingMethodSelectionScreen-fBauGI0K.mjs → FundingMethodSelectionScreen-Cl2Q20C1.mjs} +1 -1
- package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +1 -0
- package/dist/esm/{InAppBrowserLoginNotPossible-DBhsoAkw.mjs → InAppBrowserLoginNotPossible-DNAwsnTl.mjs} +1 -1
- package/dist/esm/{InstallWalletScreen-CEcl2LHj.mjs → InstallWalletScreen-CWnE7vnq.mjs} +1 -1
- package/dist/esm/LandingScreen-DxyFLgbb.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-Bg9QTrJX.mjs → LinkConflictScreen-mdWjrw4c.mjs} +1 -1
- package/dist/esm/LinkEmailScreen-DIPP5Qni.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-CNFL2N09.mjs → LinkPasskeyScreen-ThpOshKf.mjs} +1 -1
- package/dist/esm/{LinkPhoneScreen-DnPAvact.mjs → LinkPhoneScreen-rAq6W4BG.mjs} +1 -1
- package/dist/esm/{LoginFailedScreen-CkxfR75o.mjs → LoginFailedScreen-BXxeN2zX.mjs} +1 -1
- package/dist/esm/ManualTransferScreen-Lvm8KD2W.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-CO2wD8m4.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-BJ6-SZiF.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-B3urEFgN.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-Ds1oHXcL.mjs +1 -0
- package/dist/esm/{ModalHeader-D7WajfD8.mjs → ModalHeader-QHPmjFNo.mjs} +1 -1
- package/dist/esm/{MoonpayStatusScreen-CBc4DLDR.mjs → MoonpayStatusScreen-CZG4vGlx.mjs} +1 -1
- package/dist/esm/OAuthStatusScreen-Ds4YHlqV.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-BjefL5Sg.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-DsgPquPG.mjs +1 -0
- package/dist/esm/PasswordRecoveryScreen-CEytJb4j.mjs +1 -0
- package/dist/esm/{QrCode-zzqjquVm.mjs → QrCode-DYm8DzfO.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-DRKjGnJC.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DSvqTOh4.mjs +1 -0
- package/dist/esm/RecoverySelectionScreen-hH9LThp9.mjs +1 -0
- package/dist/esm/{Screen-dwi2CitY.mjs → Screen-CWSnJQQ_.mjs} +1 -1
- package/dist/esm/{ScreenLayout-Dmrhdwtt.mjs → ScreenLayout-CUnsRpZP.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs → SetAutomaticRecoveryScreen-Df5GT1nk.mjs} +1 -1
- package/dist/esm/{SetWalletPasswordForm-ZtRqoZYj.mjs → SetWalletPasswordForm-DVIMtdiG.mjs} +2 -2
- package/dist/esm/{SignRequestScreen-DdAK4SlJ.mjs → SignRequestScreen-CxefKveW.mjs} +1 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-jFi5e18-.mjs +1 -0
- package/dist/esm/TelegramAuthScreen-BVJcbU6W.mjs +1 -0
- package/dist/esm/{TransactionDetails-fgHkAnf9.mjs → TransactionDetails-Bc22QvDx.mjs} +3 -3
- package/dist/esm/{TransactionErrorView-Dgp1KSy5.mjs → TransactionErrorView-C1vRGAqn.mjs} +2 -2
- package/dist/esm/TransferFromWalletScreen-Be38QQ4h.mjs +1 -0
- package/dist/esm/{TransferOrBridgeLoadingScreen-D3vBwM_o.mjs → TransferOrBridgeLoadingScreen-CwlvhVb6.mjs} +1 -1
- package/dist/esm/TurnstileWrapper-Co-t5mTh.mjs +1 -0
- package/dist/esm/UpdateEmailScreen-B5J0E6kb.mjs +1 -0
- package/dist/esm/{UpdatePhoneScreen-Byn7UW7u.mjs → UpdatePhoneScreen-C1HOHXOX.mjs} +1 -1
- package/dist/esm/{UserLimitReachedScreen-DXDqdBpt.mjs → UserLimitReachedScreen-D-zVOlb8.mjs} +1 -1
- package/dist/esm/WalletButtonList-8WEh4_jp.mjs +1 -0
- package/dist/esm/{WalletInfoCard-DAv0WFcc.mjs → WalletInfoCard-MF3MtEmQ.mjs} +1 -1
- package/dist/esm/{WalletInterstitialScreen-CKiSWjpa.mjs → WalletInterstitialScreen-1gCTcafs.mjs} +1 -1
- package/dist/esm/{WalletLink-CjuEskpb.mjs → WalletLink-YnR_-97O.mjs} +2 -2
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-DiNfuFGT.mjs +1 -0
- package/dist/esm/{ethers-CpMSCMOg.mjs → ethers-DIoYcpjG.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-BMa3kyjk.mjs → frame-CwE9r3cT.mjs} +1 -1
- package/dist/esm/{get-is-unified-wallet-DymQMSJy.mjs → get-is-unified-wallet-K0mTk9yp.mjs} +1 -1
- package/dist/esm/{getErc20Balance-Dtau1386.mjs → getErc20Balance-CaKjNAs9.mjs} +1 -1
- package/dist/esm/getErc20TokenInfo-BFoeg5F6.mjs +1 -0
- package/dist/esm/{getPublicClient-IxRndou_.mjs → getPublicClient-A9RSftUZ.mjs} +1 -1
- package/dist/esm/index-BWOKHYTy.mjs +1 -0
- package/dist/esm/{index-DdlRJsoj.mjs → index-CFRKlMDE.mjs} +1 -1
- package/dist/esm/index-lYmwKGIx.mjs +5 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-Cvo1WmWN.mjs → internal-context-e-Eni5bG.mjs} +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/prepareFundingModalData-WE6JA8F4.mjs +1 -0
- package/dist/esm/{reservoir-B0V48m2I.mjs → reservoir-kvLjIrEo.mjs} +1 -1
- package/dist/esm/{shared-DsP7M4P5.mjs → shared-MHIQ423d.mjs} +1 -1
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CqO4vU4u.mjs +1 -0
- package/dist/esm/{smart-wallets-Cbhn7qlU.mjs → smart-wallets-D5JfcVKT.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{to-ui-error-B3m2hl6e.mjs → to-ui-error-BRKruPsR.mjs} +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/{use-create-wallet-without-fallback-DodUf3VP.mjs → use-create-wallet-without-fallback-CHBqJaDR.mjs} +1 -1
- package/dist/esm/{use-export-wallet-CWslDKqf.mjs → use-export-wallet-BrdknVyy.mjs} +1 -1
- package/dist/esm/{use-sign-with-user-signer-LJ6ROduD.mjs → use-sign-with-user-signer-eEm9Olt_.mjs} +1 -1
- package/dist/esm/useActiveWallet-CP0uCd2v.mjs +1 -0
- package/dist/esm/{useGetSolPrice-Bi0pPiUW.mjs → useGetSolPrice-Cfm8o9C5.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-B4XVfxeD.mjs → useGetTokenPrice-CSolUboj.mjs} +1 -1
- package/dist/esm/{useI18n-ByKvnaXP.mjs → useI18n-CWj3uwjJ.mjs} +1 -1
- package/dist/esm/usePrivy-B07VkOGc.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-DjD2ma5c.mjs → useSolanaRpcClient-Cj4b2UVF.mjs} +1 -1
- package/dist/esm/{useWalletBalance-Xca4-c_r.mjs → useWalletBalance-CkNw6kj0.mjs} +1 -1
- package/dist/esm/{useWallets-CQMJYOF9.mjs → useWallets-D4Q4lJPh.mjs} +1 -1
- package/dist/esm/{useWallets-BplPx0Pz.mjs → useWallets-DltUT6WJ.mjs} +1 -1
- package/package.json +10 -9
- package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +0 -1
- package/dist/cjs/CaptchaScreen-025syTLo.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +0 -1
- package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +0 -1
- package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +0 -1
- package/dist/cjs/ErrorScreen-Cob9AO30.js +0 -1
- package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +0 -2
- package/dist/cjs/LandingScreen-B9jb8n_d.js +0 -1
- package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +0 -1
- package/dist/cjs/ManualTransferScreen-DPz98CSt.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +0 -1
- package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +0 -1
- package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +0 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +0 -1
- package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +0 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +0 -1
- package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +0 -1
- package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +0 -1
- package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +0 -1
- package/dist/cjs/WalletButtonList-bICzXZXM.js +0 -1
- package/dist/cjs/context-JUEgi5-6.js +0 -1
- package/dist/cjs/index-BNNk54gK.js +0 -1
- package/dist/cjs/index-DvDeCr_m.js +0 -5
- package/dist/cjs/internal-context-VDPFkIXN.js +0 -1
- package/dist/cjs/prepareFundingModalData-BVlyr8l5.js +0 -1
- package/dist/cjs/useActiveWallet-DcxqWAsq.js +0 -1
- package/dist/cjs/usePrivy-CXPeoT5g.js +0 -1
- package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +0 -1
- package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +0 -1
- package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +0 -1
- package/dist/esm/ConnectWalletView-DVDOSzi0.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +0 -1
- package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +0 -1
- package/dist/esm/CustomLandingScreenView-DWt9lv8W.mjs +0 -2
- package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +0 -1
- package/dist/esm/ErrorScreen-DFAo4S7A.mjs +0 -1
- package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +0 -1
- package/dist/esm/LandingScreen-BvRIrtFN.mjs +0 -1
- package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +0 -1
- package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +0 -1
- package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +0 -1
- package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +0 -1
- package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +0 -1
- package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +0 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +0 -1
- package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +0 -1
- package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +0 -1
- package/dist/esm/WalletButtonList-CGloXTN0.mjs +0 -1
- package/dist/esm/context-Cb5MFcME.mjs +0 -1
- package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +0 -1
- package/dist/esm/index-B_e8abKi.mjs +0 -1
- package/dist/esm/index-CI666IP9.mjs +0 -5
- package/dist/esm/prepareFundingModalData-BUyu5Vhr.mjs +0 -1
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +0 -1
- package/dist/esm/useActiveWallet-hrZcON-K.mjs +0 -1
- package/dist/esm/usePrivy-D3OPY7tm.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e,t=require("ofetch"),r=require("react");class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(e,t,r){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=r}}class s extends i{constructor(e,t,r,i,s,n){super(r,i,s),this.type=e,this.status=t,this.data=n}}class n extends i{constructor(e,t,r){super(e,t,r),this.type="client_error"}}const a=e=>e instanceof i?e:e instanceof Error?new n(e.message,e):new n(`Internal error: ${e}`);var o=((e={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",e.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",e.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",e.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",e.INVALID_DATA="invalid_data",e.INVALID_CAPTCHA="invalid_captcha",e.LINKED_TO_ANOTHER_USER="linked_to_another_user",e.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",e.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",e.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",e.USER_EXITED_UPDATE_FLOW="exited_update_flow",e.ALLOWLIST_REJECTED="allowlist_rejected",e.OAUTH_USER_DENIED="oauth_user_denied",e.OAUTH_UNEXPECTED="oauth_unexpected",e.UNKNOWN_AUTH_ERROR="unknown_auth_error",e.USER_EXITED_AUTH_FLOW="exited_auth_flow",e.USER_EXITED_LINK_FLOW="exited_link_flow",e.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",e.MUST_BE_AUTHENTICATED="must_be_authenticated",e.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",e.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",e.CLIENT_REQUEST_TIMEOUT="client_request_timeout",e.INVALID_CREDENTIALS="invalid_credentials",e.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",e.UNKNOWN_MFA_ERROR="unknown_mfa_error",e.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",e.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",e.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",e.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",e.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",e.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",e.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",e.TRANSACTION_FAILURE="transaction_failure",e.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",e.NOT_SUPPORTED="not_supported",e.CAPTCHA_TIMEOUT="captcha_timeout",e.INVALID_MESSAGE="invalid_message",e.UNABLE_TO_SIGN="unable_to_sign",e.CAPTCHA_FAILURE="captcha_failure",e.CAPTCHA_DISABLED="captcha_disabled",e.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",e.TOO_MANY_REQUESTS="too_many_requests",e.USER_LIMIT_REACHED="max_accounts_reached",e.DISALLOWED_LOGIN_METHOD="disallowed_login_method",e.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",e.PASSKEY_NOT_ALLOWED="passkey_not_allowed",e.USER_DOES_NOT_EXIST="user_does_not_exist",e.INSUFFICIENT_BALANCE="insufficient_balance",e.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",e.BUFFER_NOT_DEFINED="buffer_not_defined",e.UNSUPPORTED_WALLET_TYPE="unsupported_wallet_type",e);const _=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},l=/*#__PURE__*/r.createContext({setAuthenticated:_,setUser:_,setIsNewUser:_,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:_,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:_,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:_,initializeWalletProxy:_,getAuthMeta:_,getAuthFlow:_,closePrivyModal:_,openPrivyModal:_,connectWallet:_,initLoginWithWallet:_,loginWithWallet:_,initLoginWithFarcaster:_,loginWithFarcaster:_,loginWithCode:_,initLoginWithEmail:_,initLoginWithSms:_,initUpdateEmail:_,initUpdatePhone:_,resendEmailCode:_,resendSmsCode:_,initLoginWithHeadlessOAuth:_,loginWithHeadlessOAuth:_,crossAppAuthFlow:_,initLoginWithOAuth:_,loginWithOAuth:_,passkeyAuthState:{status:"initial"},setPasskeyAuthState:_,initSignupWithPasskey:_,signupWithPasskey:_,initLoginWithPasskey:_,loginWithPasskey:_,initLinkWithPasskey:_,linkWithPasskey:_,refreshSessionAndUser:_,walletProxy:null,createAnalyticsEvent:_,acceptTerms:_,getUsdTokenPrice:_,getUsdPriceForSol:_,getSplTokenMetadata:_,recoverEmbeddedWallet:_,updateWallets:_,fundWallet:_,openModal:_,setReadyToTrue:_,requestFarcasterSignerStatus:_,initLoginWithTelegram:_,loginWithTelegram:_,generateSiweMessage:_,generateSiweMessageForSmartWallet:_,loginWithSiwe:_,linkWithSiwe:_,linkSmartWallet:_,delegateWallet:_,revokeDelegatedWallets:_,connectCoinbaseSmartWallet:_,connectBaseAccount:_,initiateAccountTransfer:_,emailOtpState:{status:"initial"},setEmailOtpState:_,smsOtpState:{status:"initial"},setSmsOtpState:_,siweState:{status:"initial"},setSiweState:_,oAuthState:{status:"initial"},setOAuthState:_,telegramAuthState:{status:"initial"},setTelegramAuthState:_,isHeadlessOAuthLoading:!1,isHeadlessSigning:_,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:_});exports.InternalPrivyContext=l,exports.PrivyApiError=s,exports.PrivyClientError=n,exports.PrivyConnectorError=class extends i{constructor(e,t,r){super(e,t,r),this.type="connector_error"}},exports.PrivyEmbeddedWalletError=class extends n{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}},exports.PrivyError=i,exports.PrivyErrorCode=o,exports.PrivyNotReadyError=class extends n{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},exports.PrivyTimeoutError=class extends n{constructor(){super("Request timed out",void 0,"client_request_timeout")}},exports.PrivyUnauthenticatedError=class extends n{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},exports.PrivyUserLimitReachedError=class extends n{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}},exports.formatApiError=e=>{if(e instanceof i)return e;if(!(e instanceof t.FetchError))return a(e);if(!e.response)return new s("api_error",null,e.message,e);let{type:r,message:n,error:o,code:_}=e.data;return new s(r||"ApiError",e.response.status,n||o,e,_,e.data)},exports.formatPrivyError=a,exports.notImplemented=_,exports.notImplementedWithMessage=e=>()=>{throw Error(e.trim())},exports.usePrivyInternal=()=>r.useContext(l);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@privy-io/js-sdk-core"),t=require("eventemitter3"),n=require("./internal-context-VDPFkIXN.js"),r=require("./context-JUEgi5-6.js"),i=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/a(t);class s extends n.PrivyConnectorError{constructor(){super("Wallet timeout"),this.type="wallet_error"}}const l=e=>e instanceof n.PrivyConnectorError?e:e?.code?new d(e):new n.PrivyConnectorError("Unknown connector error",e);class c extends n.PrivyError{constructor(e,t,n){super(e),this.type="provider_error",this.code=t,this.data=n}}class d extends c{constructor(t){super(t.message,t.code,t.data);let n=Object.values(e.ProviderErrors).find((e=>e.eipCode===t.code));this.details=n||e.ProviderErrors.UNKNOWN_ERROR,-32002===t.code&&(t.message?.includes("already pending for origin")?t.message?.includes("wallet_requestPermissions")?this.details=e.ProviderErrors.E32002_CONNECTION_ALREADY_PENDING:this.details=e.ProviderErrors.E32002_REQUEST_ALREADY_PENDING:t.message?.includes("Already processing")&&t.message.includes("eth_requestAccounts")&&(this.details=e.ProviderErrors.E32002_WALLET_LOCKED))}}const u={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_LIMIT_REACHED:{message:"Unable to link",detail:"You've reached the maximum number of linked wallets.",retryable:!1},...e.ProviderErrors};class h{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}var C="undefined"!=typeof window&&window.localStorage?new h:new class{get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};class p extends o.default{constructor(e){super(),this.walletClientType=e,this.connected=!1,this.initialized=!1}}const A=()=>{let e=C.get(r.CONNECTIONS_HISTORY_KEY);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let f=["phantom","glow","solflare","backpack","okx_wallet","walletconnect","mobile_wallet_adapter","jupiter"];function m(e){return e.toLowerCase().split(" ").join("_")}function g(e){return"isWalletConnectSolana"in e&&e.isWalletConnectSolana}function w(e){let t=e.replace("eip155:","");if(t)return parseInt(t);throw Error("Chain ID not compatible with CAIP-2 format.")}const y=e=>e.filter((e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1)))),E={[e.mainnet.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[e.sepolia.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[e.optimism.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[e.optimismSepolia.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[e.polygon.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[e.polygonAmoy.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[e.base.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[e.baseSepolia.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[e.avalanche.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[e.avalancheFuji.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[e.arbitrum.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[e.arbitrumSepolia.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"};exports.ConnectorErrors=u,exports.PrivyProviderRpcError=d,exports.ProviderRpcError=c,exports.SolanaWalletConnector=class extends p{get isInstalled(){return!0}get wallet(){return this._wallet}buildConnectedWallet(){return this._wallet.accounts.map((t=>({type:"solana",provider:new e.ConnectedStandardSolanaWallet({wallet:this._wallet,account:t}),address:t.address,connectedAt:Date.now(),walletClientType:this._wallet.name,connectorType:this.connectorType,imported:!1,meta:{name:this._wallet.name,id:this._wallet.name,icon:this._wallet.icon},isConnected:async()=>this._wallet.accounts.length>0,disconnect:async()=>{await this.disconnect()}})))}async syncAccounts(){this.wallets=this.buildConnectedWallet(),this.emit("walletsUpdated")}get walletBranding(){return{id:g(this.wallet)?"walletconnect_solana":this.wallet.name,name:this.wallet.name,icon:this.wallet.icon}}async initialize(){this.subscribeListeners(),await this.syncAccounts(),this.shouldAttemptAutoConnect()&&(await(this.wallet.features["standard:connect"]?.connect({silent:!0}).catch((()=>{}))),await this.isConnected()&&await this.syncAccounts()),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?(await this.syncAccounts(),this.getConnectedWallet()):null}async getConnectedWallet(){return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt))[0]||null}async isConnected(){return this._wallet.accounts.length>0}subscribeListeners(){this._unsubscribeListeners=this.wallet.features["standard:events"]?.on("change",this.onChange)}unsubscribeListeners(){this._unsubscribeListeners?.()}shouldAttemptAutoConnect(){return!(!this.autoConnectEnabled||!f.includes(this.walletClientType))&&("phantom"!==this.walletClientType&&"metamask"!==this.walletClientType.toLowerCase()||A().some((({walletClientType:e})=>"phantom"===e||"metamask"===e.toLowerCase())))}constructor(e,t){super(m(g(e)?"walletconnect_solana":e.name)),this.chainType="solana",this.connectorType="solana_adapter",this.disconnect=async()=>{await(this.wallet.features["standard:disconnect"]?.disconnect().catch((e=>console.error("Error disconnecting",e)))),await this.syncAccounts()},this.promptConnection=async()=>{try{await(this.wallet.features["standard:connect"]?.connect())}catch(e){throw l(e)}},this.onChange=()=>{this.syncAccounts()},this._wallet=e,this.autoConnectEnabled=t,this.wallets=[]}},exports.WALLET_CONNECT_LOGO_DATA_URI="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",exports.WalletConnect=({style:e,...t})=>{let n=r.useAppConfig();/*#__PURE__*/return i.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[/*#__PURE__*/i.jsx("rect",{width:"28",height:"28",rx:"3",fill:"dark"===n?.appearance.palette.colorScheme?"#3396ff":"#141414"}),/*#__PURE__*/i.jsx("g",{clipPath:"url(#clip0_1765_9946)",children:/*#__PURE__*/i.jsx("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),/*#__PURE__*/i.jsx("defs",{children:/*#__PURE__*/i.jsx("clipPath",{id:"clip0_1765_9946",children:/*#__PURE__*/i.jsx("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},exports.WalletConnector=p,exports.WalletTimeoutError=s,exports.e=function(){try{let e="privy:__session_storage__test",t=new h;return t.put(e,"blobby"),t.del(e),!0}catch(e){return!1}},exports.extractChainIdFromCAIP2=w,exports.filterSupportedOptions=y,exports.formatConnectorError=l,exports.isFirstClassChainWallet=function(e){return["ethereum","solana"].includes(e.chainType)},exports.loadConnectionHistory=A,exports.prepareFundingModalData=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:i,chainIdOverride:a,comingFromSendTransactionScreen:o=!1})=>{let s,l;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let c=y(t.fundingConfig.options);if(c.length<1)throw Error("Wallet funding is not enabled");s=a||(r?.chain?r.chain.id:w(t.fundingConfig.defaultRecommendedCurrency.chain));let d=t.chains.find((e=>e.id===s));if(!d)throw new n.PrivyClientError(`Funding chain ${s} is not in PrivyProvider chains list`);let u=r?.amount??t.fundingConfig.defaultRecommendedAmount,h=!1;function C(){if(!s)return;let e=E[s];c.find((e=>"wallets"===e.method))&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),l=e,h=!0}r&&"asset"in r?"USDC"===r.asset?C():"string"!=typeof r.asset&&"erc20"in r.asset&&(h=((e,t)=>e===E[t.id])(l=r.asset.erc20,d)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&C();let p=r?.defaultFundingMethod;return{chainType:"ethereum",address:e,amount:u,chain:d,erc20Address:l,erc20ContractInfo:h?{symbol:"USDC",decimals:6}:void 0,isUSDC:h,methodScreen:i,supportedOptions:c,comingFromSendTransactionScreen:o,defaultFundingMethod:p,usingDefaultFundingMethod:!!p,preferredCardProvider:r?.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:r&&"uiConfig"in r?r.uiConfig:void 0,externalSolanaFundingScreen:null}},exports.prepareSolanaFundingModalData=function({address:e,fundWalletConfig:t,appConfig:n,comingFromSendTransactionScreen:r,externalSolanaFundingScreen:i,methodScreen:a}){if(!n.fundingConfig)throw Error("Wallet funding is not enabled");let o=y(n.fundingConfig.options);if(o.length<1)throw Error("Wallet funding is not enabled");if("USDC"===t?.asset&&"solana:testnet"===t?.chain)throw Error("USDC funding is not supported on the Solana testnet");let s=t?.amount??n.fundingConfig.defaultRecommendedAmount,l=t?.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:o,amount:s,isUSDC:"USDC"===t?.asset,methodScreen:a,comingFromSendTransactionScreen:r,chain:t?.chain||"solana:mainnet",crossChainBridgingEnabled:n.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:l,preferredCardProvider:t?.card?.preferredProvider,usingDefaultFundingMethod:!!l,uiConfig:t?.uiConfig,externalSolanaFundingScreen:i}},exports.toSolanaWalletClientType=m,exports.u=C;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("zustand"),n=require("./context-JUEgi5-6.js"),i=require("styled-components"),o=require("react/jsx-runtime"),r=require("react-device-detect"),a=require("./prepareFundingModalData-BVlyr8l5.js"),l=require("./events-context-Di6--rDg.js"),s=require("viem"),c=require("viem/utils"),d=require("./internal-context-VDPFkIXN.js"),p=require("./getPublicClient-EjAv8R2z.js"),h=require("./get-is-unified-wallet-DmiciSes.js"),u=require("./useWallets-h2xCj02C.js");function m(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var w=/*#__PURE__*/m(r);const f=t.create((()=>({listings:[],loading:!1}))),y=f.setState,g=(t=!0)=>{let i=n.useAppConfig(),o=f((e=>e.listings)),r=f((e=>e.loading)),a=!!o.length;return e.useEffect((()=>{t&&!a&&(y({listings:[],loading:!0}),(async e=>{let t=new URL("v3/wallets","https://explorer-api.walletconnect.com");t.searchParams.append("projectId",e);let n=await fetch(t);return n.ok?Object.values((await n.json()).listings).sort((({slug:e},{slug:t})=>"rainbow"===e&&"metamask"===t?1:"metamask"===e||"rainbow"===e?-1:1)):(console.debug(`Failed to fetch WalletConnect listings: ${await n.text().catch((()=>"No response."))}`),[])})(i.walletConnectCloudProjectId).then((e=>y({listings:e,loading:!1}))).catch((e=>{console.error(e),y({listings:[],loading:!1})})))}),[t,a,i.walletConnectCloudProjectId]),{listings:o,loading:r}};function b(e){return"cryptocom"===e?"cryptocom-defi":"binance"===e?"binance-defi":e.replace(/[-_]wallet$/,"")}const x=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom||"isPhantom"in e?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,v=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==x(e))return!1;if(e.providers)for(let t of e.providers)if(!v(t))return!1;return!0},C=(e,t=3,n=4,i="ethereum")=>{if(!e)return"";let o="ethereum"===i?2:0;return t+n+o+3>=e.length?e:`${e.slice(0,o+t)}...${e.slice(e.length-n,e.length)}`},k=e=>new Promise((t=>setTimeout(t,e)));const P=(e,t={})=>{let n=t.delayMs||150,i=t.maxAttempts||270;return new Promise((async(o,r)=>{let a=!1,l=0;for(;!a&&l<i;){if(t.abortSignal?.aborted)return;e().then((e=>{a=!0,o(e)}),((...e)=>{a=!0,r(...e)})),l+=1,await k(n)}a||r(Error("Exceeded max attempts before resolving function"))}))};function W(e){return`eip155:${String(Number(e))}`}function T(e){return"ethereum"===e.type}function _(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let i=e[n],o=t[n];if(i?.address!==o?.address||i&&o&&T(i)&&T(o)&&i?.chainId!==o?.chainId||i?.connectorType!==o?.connectorType||i?.connectedAt!==o?.connectedAt||i?.walletClientType!==o?.walletClientType||i?.isConnected!==o?.isConnected||i?.linked!==o?.linked)return!1}return!0}const E=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||n.DEFAULT_RPC_TIMEOUT;class I extends a.WalletConnector{buildConnectedWallet(e,t,n,i){let o=async()=>!!this.wallets.find((t=>c.getAddress(t.address)===c.getAddress(e)));return{type:"ethereum",address:c.getAddress(e),chainId:t,meta:n,imported:i,switchChain:async n=>{let i,r;if(!o)throw new d.PrivyConnectorError("Wallet is not currently connected.");let a=this.wallets.find((t=>c.getAddress(t.address)===c.getAddress(e)))?.chainId;if(!a)throw new d.PrivyConnectorError("Unable to determine current chainId.");if("number"==typeof n?(i=`0x${n.toString(16)}`,r=n):(i=n,r=Number(n)),a===W(i))return;let l=this.chains.find((e=>e.id===r));if(!l)throw new d.PrivyConnectorError(`Unsupported chainId: ${n}`);let s=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:i}]})};try{return await s()}catch(e){if(((e,t)=>{switch(t){case"coinbase_wallet":case"base_account":return e.message.includes("addEthereumChain");case"rabby_wallet":return e.message.includes("Unrecognized chain ID");default:return 4902===e.code||e.message?.includes("4902")}})(e,this.walletClientType))return"rabby_wallet"===this.walletClientType&&await k(300),await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:i,chainName:l.name,nativeCurrency:l.nativeCurrency,rpcUrls:[l.rpcUrls.default?.http[0]??""],blockExplorerUrls:[l.blockExplorers?.default.url??""]}]}),s();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new d.PrivyConnectorError(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:o,getEthereumProvider:async()=>{if(!await o())throw new d.PrivyConnectorError("Wallet is not currently connected.");return this.proxyProvider},sign:async e=>{if(!await o())throw new d.PrivyConnectorError("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,i=e;try{if(void 0===i){let e=await P((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(i=e)}}catch(e){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!i||!Array.isArray(i)||i.length<=0||!i[0])return;let o=i[0];if(!s.isAddress(o))return void console.warn(`Invalid ethereum address reported by ${this.walletClientType}: ${o}`);let r=c.getAddress(o),l=[];if("privy"===this.walletClientType){let e=a.u.get(n.getPrivyWalletKey(r));this.chains.find((t=>t.id===Number(e)))||(a.u.del(n.getPrivyWalletKey(r)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await P((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${n.DEFAULT_NETWORK}`,e),t=n.DEFAULT_NETWORK}let d=W(t);if(!l.find((e=>c.getAddress(e.address)===r))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};l.push(this.buildConnectedWallet(c.getAddress(o),d,e,"embedded_imported"===this.connectorType))}_(l,this.wallets)||(this.wallets=l,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>c.getAddress(e)===c.getAddress(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),this.proxyProvider.request({method:"personal_sign",params:[c.toHex(e),this.wallets[0]?.address]})}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,i,o){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=W(e),"privy"===this.walletClientType&&a.u.put(n.getPrivyWalletKey(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=async()=>{"base_account"===this.connectorType&&this.connected||(this.connected=!0,"coinbase_wallet"===this.connectorType&&await k(500),this.syncAccounts())},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=i,this.rpcConfig=o,this.rpcTimeoutDuration=E(o,e),this.connected=!1,this.initialized=!1}}class S{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new d.PrivyConnectorError(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw a.formatConnectorError(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new a.WalletTimeoutError,t=this.rpcTimeoutDuration)=>new Promise(((n,i)=>setTimeout((()=>{i(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||n.DEFAULT_RPC_TIMEOUT,this._subscriptions=[]}}const j=/*#__PURE__*/i.styled.div.withConfig({displayName:"Grow",componentId:"sc-681ff332-0"})(["text-align:left;flex-grow:1;"]),z=/*#__PURE__*/i.styled.div.withConfig({displayName:"AlignBottom",componentId:"sc-681ff332-1"})(["display:flex;flex-direction:column;justify-content:flex-end;flex-grow:1;"]),A=/*#__PURE__*/i.styled.div.withConfig({displayName:"LoginMethodContainer",componentId:"sc-681ff332-2"})(["display:flex;flex-direction:column;gap:8px;-ms-overflow-style:none;scrollbar-width:none;&::-webkit-scrollbar{display:none;}"]),L=/*#__PURE__*/i.styled(A).withConfig({displayName:"LoginMethodContainerWithScrollShadows",componentId:"sc-681ff332-3"})([""," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;max-height:400px;overflow-y:auto;scrollbar-width:none;padding:3px;"],(e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0));let N=/*#__PURE__*/i.css(["&&{width:100%;font-size:16px;line-height:24px;min-height:56px;@media (min-width:440px){font-size:14px;}display:flex;gap:12px;align-items:center;color:var(--privy-color-foreground);padding:10px 12px;border:1px solid var(--privy-color-foreground-4) !important;border-radius:var(--privy-border-radius-md);transition:background-color 200ms ease;cursor:pointer;&:hover{background-color:var(--privy-color-background-2);}&:disabled{cursor:pointer;background-color:var(--privy-color-background-2);}}"]);const M=/*#__PURE__*/i.styled.div.withConfig({displayName:"Subtitle",componentId:"sc-681ff332-4"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),$=/*#__PURE__*/i.styled.button.attrs({className:"login-method-button"}).withConfig({displayName:"LoginMethodButton",componentId:"sc-681ff332-5"})(["",""],N),D=/*#__PURE__*/i.styled.div.withConfig({displayName:"LoginMethodIconWrapper",componentId:"sc-681ff332-7"})(["width:32px;height:32px;border-radius:",";background:",";display:flex;align-items:center;justify-content:center;flex-shrink:0;svg{width:",";height:",";color:",";}"],(e=>e.$fullSize?"0":"4px"),(e=>e.$fullSize?"transparent":"var(--privy-color-background-2)"),(e=>e.$fullSize?"32px":"18px"),(e=>e.$fullSize?"32px":"18px"),(e=>e.$fullSize?"inherit":"var(--privy-color-icon-muted)")),O=/*#__PURE__*/i.styled.div.withConfig({displayName:"Hide",componentId:"sc-681ff332-8"})(["width:100%;height:100%;min-height:inherit;display:flex;flex-direction:column;",""],(e=>e.$if?"display: none;":"")),F=/*#__PURE__*/i.styled.div.withConfig({displayName:"EmptyWalletState",componentId:"sc-681ff332-9"})(["width:100%;height:100%;padding:",";"],(e=>e.$withPadding?"64px 0px":"0px")),U=/*#__PURE__*/i.styled.div.withConfig({displayName:"Header",componentId:"sc-681ff332-10"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-bottom:32px;gap:12px;& h3{font-size:18px;font-style:normal;font-weight:600;line-height:24px;}& p{max-width:300px;font-size:14px;font-style:normal;font-weight:400;line-height:20px;}"]);let B=/*#__PURE__*/i.styled.span.withConfig({displayName:"PositionedAbsoluteLoader",componentId:"sc-aba6339d-0"})(["&&{position:absolute;top:0;left:0;z-index:2;}"]),R=/*#__PURE__*/i.styled.span.withConfig({displayName:"ConnectionLoaderContainer",componentId:"sc-aba6339d-1"})(["position:relative;width:82px;height:82px;display:inline-block;"]);const q=/*#__PURE__*/i.styled.span.withConfig({displayName:"Loader",componentId:"sc-aba6339d-2"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";border-bottom-color:transparent;border-radius:50%;display:inline-block;box-sizing:border-box;animation:rotation 1.2s linear infinite;transition:border-color 800ms;}@keyframes rotation{0%{transform:rotate(0deg);}100%{transform:rotate(360deg);}}&&&.success{border-color:var(--privy-color-icon-success);border-bottom-color:var(--privy-color-icon-success);}&&&.fail{border-color:var(--privy-color-icon-error);border-bottom-color:var(--privy-color-icon-error);}"],(e=>e.color??"var(--privy-color-icon-subtle)")),K=/*#__PURE__*/i.styled(q).withConfig({displayName:"LoaderFaint",componentId:"sc-aba6339d-3"})(["&&{border-bottom-color:",";border-color:",";animation:none;opacity:0.5;}"],(e=>e.color??"var(--privy-color-border-default)"),(e=>e.color??"var(--privy-color-border-default)"));let H=/*#__PURE__*/i.styled(q).withConfig({displayName:"StyledButtonLoader",componentId:"sc-aba6339d-4"})(["&&{height:1rem;width:1rem;margin:2px 0;border-width:1.5px;transition:border-color 200ms ease;}"]);const Z=["metamask","phantom","brave_wallet","rainbow","uniswap_wallet_extension","uniswap_extension","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","crypto.com_wallet_extension","crypto.com_onchain","binance","bitget_wallet","coinbase_wallet","coinbase_smart_wallet","base_account","metamask","trust","safe","rainbow","uniswap","zerion","argent","spot","omni","cryptocom","blockchain","safepal","bitget_wallet","zengo","1inch","binance","exodus","mew_wallet","alphawallet","keyring_pro","mathwallet","unstoppable","obvious","ambire","internet_money_wallet","coin98","abc_wallet","arculus_wallet","haha","cling_wallet","broearn","copiosa","burrito_wallet","enjin_wallet","plasma_wallet","avacus","bee","pitaka","pltwallet","minerva","kryptogo","prema","slingshot","kriptonio","timeless","secux","bitizen","blocto","okx_wallet","safemoon","rabby_wallet","bybit_wallet","ronin_wallet","haha_wallet","privy","unknown","phantom","solflare","glow","backpack","mobile_wallet_adapter"],G=Object.freeze({phantom:{client:"phantom",name:"Phantom",installLink:w.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",chainTypes:["ethereum","solana"],get isInstalled(){if("phantom"in window){let e=window;if(e?.phantom?.ethereum?.isPhantom&&e?.phantom?.ethereum?.chainId||e?.phantom?.solana?.isPhantom)return!0}return!1},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:n}){let i=X({client:this.client,isSolana:t,connectOnly:n});return`${e?"phantom://":"https://phantom.app/ul/"}browse/${i}?ref=${i}`}},solflare:{client:"solflare",name:"Solflare",installLink:w.isFirefox?"https://addons.mozilla.org/es/firefox/addon/solflare-wallet/":"https://chromewebstore.google.com/detail/solflare-wallet/bhhhlbepdkbapadjdnnojkbgioiodbic",chainTypes:["solana"],get isInstalled(){return"solflare"in window&&!!window?.solflare?.isSolflare},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:n}){let i=X({client:this.client,isSolana:t,connectOnly:n});return`${e?"solflare://ul/v1/":"https://solflare.com/ul/v1/"}browse/${i}?ref=${i}`}},backpack:{client:"backpack",name:"Backpack",installLink:"https://chromewebstore.google.com/detail/backpack/aflkmfhebedbjioipglgcbcmnbpgliof",chainTypes:["ethereum","solana"],get isInstalled(){return!(!("backpack"in window)||!window?.backpack?.ethereum?.isBackpack&&!window?.backpack?.solana?.isBackpack)},getMobileRedirect({useUniversalLink:e,isSolana:t,connectOnly:n}){let i=X({client:this.client,isSolana:t,connectOnly:n});return`${e?"backpack://ul/v1/":"https://backpack.app/ul/v1/"}browse/${i}?ref=${i}`}},okx_wallet:{client:"okx_wallet",name:"OKX Wallet",installLink:"https://chromewebstore.google.com/detail/okx-wallet/mcohilncbfahbmgdjkbpemcciiolgcge",chainTypes:["solana"],get isInstalled(){return"okxwallet"in window&&!!window?.okxwallet?.isOkxWallet},getMobileRedirect({isSolana:e,connectOnly:t}){return"https://www.okx.com/download?deeplink="+encodeURIComponent("okx://wallet/dapp/url?dappUrl="+X({client:this.client,isSolana:e,connectOnly:t}))}}});function X({client:e,isSolana:t,connectOnly:n}){let i=new URL(window.location.href);return i.searchParams.set("privy_connector",t?"solana_adapter":"injected"),i.searchParams.set("privy_wallet_client",e),i.searchParams.set("privy_connect_only",String(n)),encodeURIComponent(i.href.replace(/\/$/g,""))}class J extends a.SolanaWalletConnector{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the SolanaNullConnector")}constructor({id:e,name:t,icon:i}){super({name:t},!1),this.connectorType="null",this.proxyProvider=new S(void 0,n.DEFAULT_RPC_TIMEOUT),this.disconnect=async()=>{throw Error("disconnect called for an uninstalled wallet via the SolanaNullConnector")},this.promptConnection=async()=>{throw Error("promptConnection called for an uninstalled wallet via the SolanaNullConnector")},this.id=e,this.name=t,this.icon=i}}function Q(e){return"solana"===e.chainType}let V=/*#__PURE__*/e.createContext({});let Y=e=>`privy:${e}:recent-login-method`,ee=e=>`privy:${e}:recent-login-wallet-client`,te=e=>`privy:${e}:recent-login-chain-type`;const ne=t.create((()=>({isModalOpen:!1,resolvers:null})));let ie=t.create((()=>({})));const oe=async()=>{let e,t,n=new Promise(((n,i)=>{e=n,t=i}));return ie.setState({}),ne.setState({isModalOpen:!0,resolvers:{resolve:e,reject:t}}),await n},re=({address:e,client:t,appId:n})=>{let i=`${t}:${e}`;n&&a.u.put(ae(n),i),ne.setState({wallet:i})},ae=e=>`privy:${e}:active-wallet-connection`;exports.AlignBottom=z,exports.ButtonLoader=e=>/*#__PURE__*/o.jsx(H,{color:e.color||"var(--privy-color-foreground-3)"}),exports.ConnectionLoader=({success:e,fail:t})=>/*#__PURE__*/o.jsxs(R,{children:[/*#__PURE__*/o.jsx(B,{children:/*#__PURE__*/o.jsx(K,{className:e?"success":t?"fail":""})}),/*#__PURE__*/o.jsx(B,{children:/*#__PURE__*/o.jsx(q,{className:e?"success":t?"fail":""})})]}),exports.EmptyWalletState=F,exports.EthereumNullConnector=class extends I{get walletBranding(){return{id:this.id,name:this.name,icon:this.icon}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the EthereumNullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the EthereumNullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the EthereumNullConnector for ${e}`)}constructor({id:e,name:t,icon:i,walletClientType:o,defaultChain:r}){super(o,[],r,{}),this.connectorType="null",this.proxyProvider=new S(void 0,n.DEFAULT_RPC_TIMEOUT),this.id=e,this.name=t,this.icon=i}},exports.EthereumWalletConnector=I,exports.Grow=j,exports.Header=U,exports.Hide=O,exports.Loader=q,exports.LoaderFaint=K,exports.LoginMethodButton=$,exports.LoginMethodContainer=A,exports.LoginMethodContainerWithScrollShadows=L,exports.LoginMethodIconWrapper=D,exports.Metamask=({...e})=>/*#__PURE__*/o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",...e,children:[/*#__PURE__*/o.jsx("rect",{width:"32",height:"32",rx:"6",fill:"#121314"}),/*#__PURE__*/o.jsx("g",{transform:"translate(4, 4)",children:/*#__PURE__*/o.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 318.6 318.6",children:[/*#__PURE__*/o.jsx("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),/*#__PURE__*/o.jsx("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),/*#__PURE__*/o.jsx("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),/*#__PURE__*/o.jsx("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),/*#__PURE__*/o.jsx("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),/*#__PURE__*/o.jsx("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),/*#__PURE__*/o.jsx("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),/*#__PURE__*/o.jsx("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),/*#__PURE__*/o.jsx("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),/*#__PURE__*/o.jsx("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),/*#__PURE__*/o.jsx("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),/*#__PURE__*/o.jsx("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),/*#__PURE__*/o.jsx("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]})})]}),exports.PrivyProxyProvider=S,exports.RecentlyUsedAccountProvider=({children:t})=>{let i=n.useAppConfig(),[r,s]=e.useState({});return l.usePrivyEventSubscription("login",{onComplete:({loginAccount:e})=>{e&&"passkey"!==e.type&&"cross_app"!==e.type&&("wallet"!==e.type||"privy"!==e.walletClientType)&&(a.u.put(Y(i.id),e.type),"wallet"===e.type?(a.u.put(ee(i.id),e.walletClientType),a.u.put(te(i.id),e.chainType),s({accountType:e.type,walletClientType:e.walletClientType,chainType:e.chainType})):(a.u.del(ee(i.id)),a.u.del(te(i.id)),s({accountType:e.type})))}}),e.useEffect((()=>{if(!i.id)return;let e=a.u.get(Y(i.id)),t=a.u.get(ee(i.id)),n=a.u.get(te(i.id));e&&s("wallet"===e?{accountType:e,walletClientType:t,chainType:n}:{accountType:e})}),[i.id]),/*#__PURE__*/o.jsx(V.Provider,{value:r,children:t})},exports.SolanaNullConnector=J,exports.Subtitle=M,exports.areWalletArraysEqual=_,exports.clamp=function(e,{min:t,max:n}){return Math.min(Math.max(e,t),n)},exports.close=()=>{let e=ne.getState().resolvers;e||console.warn("useActiveWalletStore: Called close while modal was not open"),ne.setState({isModalOpen:!1}),e?.resolve({wallet:ne.getState().wallet})},exports.convert1dTo2dArray=(e,t)=>{let n=e.slice(0),i=[];for(;n.length;)i.push(n.splice(0,t));return i},exports.detectInjectedConnectors=async function({store:e,walletList:t,externalWalletConfig:n,walletChainType:i,timeout:o=3e3}){let r=!1,a=window;return new Promise((l=>{function s(){if(r)return;r=!0,window.removeEventListener("ethereum#initialized",s);let o=e.getProviders();console.debug("Detected injected providers:",o.map((e=>e.info)));let a=[];for(let e of o)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||"solana-only"===i&&"app.phantom"===e.info.rdns||a.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});if("solana-only"!==i)for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let n=[];if(t.providers?.length)for(let e of t.providers)e&&n.push(e);return n.push(e.ethereum),n}()){let t=x(e);if(!o.some((e=>e.info.name===t))){if(v(e,!0)&&!a.find((e=>"metamask"===e.type))){a.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!a.find((e=>"phantom"===e.type))){a.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!a.find((e=>"coinbase_wallet"===e.type&&"smartWalletOnly"!==n.coinbaseWallet?.config?.preference?.options))){a.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}a.find((e=>"unknown_browser_extension"===e.type))||a.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}l(a)}a.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout((()=>{s()}),o))}))},exports.formatChainIdToCAIP2=W,exports.formatSolanaWalletAddress=(e,t=3,n=4)=>C(e,t,n,"solana"),exports.formatWalletAddress=C,exports.generateTypedDataWithDomainType=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},n=e.types.EIP712Domain??Object.entries(e.domain).map((([e,n])=>{if(null!=n&&"string"==typeof e&&e in t)return{name:e,type:t[e]}})).filter((e=>void 0!==e));return{...e,types:{...e.types,EIP712Domain:n}}},exports.getBlockExplorer=(e,t)=>{let n=Number(e),i=t.find((e=>e.id===n));if(!i)throw new d.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return i.blockExplorers?.default.url},exports.getExternalWalletData=e=>f.getState().listings.find((({slug:t})=>b(t)===b(e))),exports.getExternalWalletDataByUrl=e=>{let t;try{t=new URL(e).hostname}catch(e){return}return f.getState().listings.find((({homepage:e})=>{let n;try{n=new URL(e).hostname}catch(e){return!1}return t.includes(n)}))},exports.getJsonRpcEndpoint=(e,t,n,i)=>{let o=Number(e),r=t.find((e=>e.id===o));if(!r)throw new d.PrivyConnectorError(`Unsupported chainId ${e}`,4901);return p.getJsonRpcEndpointFromChain(r,n,i)},exports.getRpcTimeout=E,exports.getWalletConfigForConnector=function({connectorType:e,walletClientType:t}){for(let n of Z)if(e===n||t===n)return G[n]},exports.invokeUntilSettled=P,exports.isBaseConnectedEthereumWallet=T,exports.isBaseConnectedSolanaWallet=function(e){return"solana"===e.type},exports.isCoinbaseWalletInstalled=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers)for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0;return!1},exports.isEthereumWalletConnector=function(e){return"ethereum"===e.chainType},exports.isSolanaWalletConnector=Q,exports.mobileWalletsConfig=G,exports.parseAdditionalSigners=e=>e?.map((e=>({signer_id:e.signerId,override_policy_ids:e.policyIds}))),exports.pollForResult=function(e,{interval:t=100,timeout:n=5e3}={}){return new Promise(((i,o)=>{let r,a=0,l=()=>{a>=n?o("Max attempts reached without result"):(r=e(),a+=t,null==r?setTimeout(l,t):i(r))};l()}))},exports.setActiveWallet=re,exports.shouldFetchWcRegistryListings=function(e){return["wallet_connect","backpack","binance","binanceus","bitget_wallet","bybit_wallet","cryptocom","haha_wallet","metamask","okx_wallet","phantom","rabby_wallet","rainbow","ronin_wallet","safe","solflare","uniswap","zerion"].some((t=>e?.includes(t)))},exports.sleep=k,exports.splitAtIndex=(e,t)=>{let n=[],i=[];for(let[o,r]of e.entries())o<t?n.push(r):i.push(r);return[n,i]},exports.stripEmoji=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),exports.toHex=e=>"string"==typeof e?e:"0x"+e.toString(16),exports.updateBalance=(e,t,n)=>{ie.setState((i=>({[e]:{...i[e],[t]:n}})))},exports.useActiveWallet=()=>{let t=n.useAppConfig(),{wallets:i}=u.useWallets(),{connectors:o}=d.usePrivyInternal(),r=e.useMemo((()=>o.filter(Q).flatMap((e=>e.wallets))),[o]),l=ne((e=>e.wallet));e.useEffect((()=>{if(!t.id)return;let e=a.u.get(ae(t.id));ne.setState({wallet:e})}),[t.id]);let s=e.useMemo((()=>{if(!l)return;let[,e]=l.split(":");return i.find((t=>t.address===e))||r.find((t=>t.address===e))}),[l,i,r]),c=e.useMemo((()=>s?"ethereum"===s.type?s.chainId:"solana":void 0),[s]);return{connect:async e=>{e?.reset&&(a.u.del(ae(t.id)),ne.setState({wallet:void 0}));let{wallet:n}=await oe();if(!n)return{};let[,o]=n.split(":"),l=i.find((e=>e.address===o));if(l)return{wallet:l,network:l.chainId};let s=r.find((e=>e.address===o));return s?{wallet:s,network:"solana"}:{}},setActiveWallet:e.useCallback((e=>{re({address:e.address,client:e.walletClientType,appId:t.id})}),[t.id]),wallet:s,network:c}},exports.useBalance=(e,t)=>ie((n=>n[e]?.[t])),exports.useConnectWallet=function(t){let{connectWallet:n}=e.useContext(h.PrivyContext);return l.usePrivyEventSubscription("connectWallet",t),{connectWallet:n}},exports.useElementHeight=t=>{let[n,i]=e.useState("auto");return e.useEffect((()=>{let e=new ResizeObserver((e=>{i(e[0]?.contentRect.height??"auto")}));return t.current&&e.observe(t.current),()=>{t.current&&e.unobserve(t.current)}}),[t.current]),n},exports.useExternalWalletListing=e=>{let{listings:t}=g();return t.find((({slug:t})=>b(t)===b(e)))},exports.useExternalWalletListings=g,exports.useFundWallet=e=>{l.usePrivyEventSubscription("fundWallet",e);let{fundWallet:t}=d.usePrivyInternal();return{fundWallet:({address:e,options:n})=>t(e,n)}},exports.useIsModalOpen=()=>ne((e=>e.isModalOpen)),exports.useLogin=function(t){let{login:n}=e.useContext(h.PrivyContext);return l.usePrivyEventSubscription("login",t),{login:n}},exports.useLogout=function(t){let{logout:n}=e.useContext(h.PrivyContext);return l.usePrivyEventSubscription("logout",t),{logout:n}},exports.useRecentlyUsedLogin=()=>e.useContext(V),exports.validateEmail=e=>!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./get-is-unified-wallet-DmiciSes.js"),a=require("./events-context-Di6--rDg.js"),o=require("./internal-context-VDPFkIXN.js"),n=require("@privy-io/js-sdk-core"),i=require("./useWallets-h2xCj02C.js"),l=require("./context-JUEgi5-6.js");let s=/*#__PURE__*/r.createContext({plugins:{current:{}}});const d=Symbol("solana-funding-plugin"),c=Symbol("solana-ledger-plugin"),u=(e,{chainType:r,walletIndex:t}={})=>e?.linkedAccounts.filter((e=>!("wallet"!==e.type||"privy"!==e.walletClientType||void 0!==t&&e.walletIndex!==t||void 0!==r&&e.chainType!==r)))??[],y=e=>e.reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null),p=async({user:e,accessToken:r,proxy:a,refreshSessionAndUser:o,privy:l,appConfig:s,recoverEmbeddedWallet:d,setUser:c,walletIndex:y,chainType:p,recoveryMethod:E,recoveryPassword:v,recoveryAccessToken:w})=>{if(0===y)if("user-controlled-server-wallets-only"===s.embeddedWallets.mode)await n.create(l,{request:{chain_type:p}});else if("ethereum"===p){let o=t.getPrivySolanaWallet(e);o&&await d({address:o.address}),await a.create({accessToken:r,solanaAddress:o?.address,recoveryMethod:E,recoveryPassword:v,recoveryAccessToken:w})}else{if("solana"!==p)throw Error("Invalid input to create wallet");{let o=t.getPrivyEthereumWallet(e);o&&await d({address:o.address}),await a.createSolana({accessToken:r,ethereumAddress:o?.address,recoveryMethod:E,recoveryPassword:v,recoveryAccessToken:w})}}else if("user-controlled-server-wallets-only"===s.embeddedWallets.mode)await n.create(l,{request:{chain_type:p}});else{let{entropyId:t,entropyIdVerifier:o}=i.getEntropyDetailsForUser(e);await d(),await a.addWallet({accessToken:r,entropyId:t,entropyIdVerifier:o,chainType:p,hdWalletIndex:y})}let h=await o(),T=u(h,{chainType:p,walletIndex:y})[0];return c(h),{user:h,account:T}};let E=async({accessToken:e,appConfig:r,privy:a,emitPrivyEvent:n,proxy:i,refreshSessionAndUser:l,recoverEmbeddedWallet:s,user:d,walletIndex:c,setModalData:y,openModal:E,chainType:w,setUser:h})=>{if(c<0)throw n("createWallet","onError",o.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${c}) is invalid.`);let T=t.getPrivyPrimaryWallet(d);if(c>0&&!T)throw n("createWallet","onError",o.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(r.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===r.embeddedWallets.mode)throw n("createWallet","onError",o.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!T&&r.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await v({emitPrivyEvent:n,setModalData:y,openModal:E,chainType:w});let W=u(d,{chainType:w,walletIndex:c})[0];if(W)return{user:d,account:W};if(0===c&&!i)return v({emitPrivyEvent:n,setModalData:y,openModal:E,chainType:w});if(!i)throw n("createWallet","onError",o.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return p({appConfig:r,walletIndex:c,chainType:w,user:d,accessToken:e,proxy:i,refreshSessionAndUser:l,privy:a,recoverEmbeddedWallet:s,setUser:h})},v=async({emitPrivyEvent:e,setModalData:r,openModal:t,chainType:a})=>new Promise(((n,i)=>{r({createWallet:{onSuccess:({user:r,account:t})=>{e("createWallet","onSuccess",{wallet:t}),n({user:r,account:t})},onFailure:r=>{e("createWallet","onError",o.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),i(r)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===a,shouldCreateSol:"solana"===a}}),t("EmbeddedWalletOnAccountCreateScreen")}));const w=()=>{let e=l.useAppConfig(),r=a.useEmitPrivyEvent(),{setModalData:n}=t.usePrivyModal(),{initializeWalletProxy:i,recoverEmbeddedWallet:s,setUser:d,openModal:c,refreshSessionAndUser:p,privy:v,client:w}=o.usePrivyInternal();return{create:async({chainType:t,options:a,latestUser:h})=>{let T=h;if(T||(T=await p()),!T)throw r("createWallet","onError",o.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await(async({appConfig:e,getAccessToken:r,initializeWalletProxy:t,user:a,privy:n,emitPrivyEvent:i,recoverEmbeddedWallet:l,setModalData:s,openModal:d,setUser:c,options:p,timeoutDuration:v,refreshSessionAndUser:w,chainType:h})=>{let[T,W]=await Promise.all([t(v),r()]);if(!W||!a)throw i("createWallet","onError",o.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!T&&e.customAuth?.enabled)throw i("createWallet","onError",o.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(p&&"walletIndex"in p&&"number"==typeof p.walletIndex){if("user-controlled-server-wallets-only"===e.embeddedWallets.mode)throw i("createWallet","onError",o.PrivyErrorCode.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return E({accessToken:W,appConfig:e,privy:n,emitPrivyEvent:i,openModal:d,proxy:T,refreshSessionAndUser:w,recoverEmbeddedWallet:l,setModalData:s,user:a,walletIndex:p.walletIndex,chainType:h,setUser:c})}let m=p&&"createAdditional"in p&&p.createAdditional,f=u(a,{chainType:h});if(f[0]&&!m)throw i("createWallet","onError",o.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return E({accessToken:W,appConfig:e,privy:n,emitPrivyEvent:i,openModal:d,proxy:T,recoverEmbeddedWallet:l,setModalData:s,user:a,walletIndex:(y(f)?.walletIndex??-1)+1,chainType:h,refreshSessionAndUser:w,setUser:c})})({appConfig:e,privy:v,getAccessToken:()=>w.getAccessToken(),refreshSessionAndUser:p,initializeWalletProxy:i,user:T,emitPrivyEvent:r,recoverEmbeddedWallet:s,setModalData:n,openModal:c,setUser:d,options:a,timeoutDuration:l.WALLET_PROXY_TIMEOUT,chainType:t})}}};function h(e){let{create:r}=w();return a.usePrivyEventSubscription("createWallet",e),{createWallet:async e=>{e&&"target"in e&&e&&(e=void 0);let{account:t}=await r({chainType:"ethereum",options:e});return t}}}const T=async({emitPrivyEvent:e,getAccessToken:r,initializeWalletProxy:a,refreshSessionAndUser:n,user:i,appConfig:l},{privateKey:s,chainType:d,additionalSigners:c})=>{if(!i)throw e("linkAccount","onError",o.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new o.PrivyClientError("User must be authenticated before linking an account.");let u="user-controlled-server-wallets-only"===l.embeddedWallets.mode?"tee":"on-device";if(c&&"on-device"===u)throw new o.PrivyClientError("Specifying additionalSigners is only supported for TEE execution and this app uses On-device execution. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let[y,p]=await Promise.all([r(),a(15e3)]);if(!p||!y)throw e("linkAccount","onError",o.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new o.PrivyClientError("User must be authenticated before linking an account.");let{address:E}=await p.importWallet({privateKey:s,accessToken:y,chainType:d,mode:u,additionalSigners:c}),v=await n(),w="solana"===d?t.getImportedPrivySolanaWallets(v):t.getImportedPrivyEthereumWallets(v),h=w?.find((e=>e.address===E));if(!h)throw e("createWallet","onError",o.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return e("createWallet","onSuccess",{wallet:h}),h},W=()=>{let{user:e}=t.usePrivyContext(),{client:n,refreshSessionAndUser:i,initializeWalletProxy:s}=o.usePrivyInternal(),d=a.useEmitPrivyEvent(),c=l.useAppConfig();return{importWallet:r.useCallback((({privateKey:r,additionalSigners:t})=>T({getAccessToken:()=>n.getAccessToken(),user:e,initializeWalletProxy:s,refreshSessionAndUser:i,emitPrivyEvent:d,appConfig:c},{privateKey:r,chainType:"ethereum",additionalSigners:t})),[e,n,i,s,d,c])}};exports.PrivyPluginProvider=({children:t})=>{let a=r.useRef({});/*#__PURE__*/return e.jsx(s.Provider,{value:{plugins:a},children:t})},exports.SOLANA_FUNDING_PLUGIN_ID=d,exports.SOLANA_LEDGER_PLUGIN_ID=c,exports.createWalletAtIndex=p,exports.importWallet=T,exports.prepareSiwsMessageWithNonce=({address:e,nonce:r})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\n${`You are proving you own ${e}.`}\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${r}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`,exports.useCreateWallet=h,exports.useCreateWalletInternal=w,exports.useImportWallet=W,exports.usePlugins=()=>{let{plugins:e}=r.useContext(s);return r.useCallback((r=>e.current[r]),[e])},exports.usePrivy=()=>{let{importWallet:e}=W(),{createWallet:a}=h();return{...r.useContext(t.PrivyContext),importWallet:e,createWallet:a}},exports.useRegisterPlugin=(...e)=>{let{plugins:t}=r.useContext(s);r.useEffect((()=>{for(let r of e)t.current[r.id]=r;return()=>{for(let r of e)delete t.current[r.id]}}),[t])};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{HelpCircle as o}from"lucide-react";import{u as e}from"./context-Cb5MFcME.mjs";import{u as i}from"./internal-context-Cvo1WmWN.mjs";import{a as r}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as n}from"./ScreenLayout-Dmrhdwtt.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const a=({title:e="Account not found",subtitle:i,appName:r="this app",ctaText:a="Try logging in again",onRetry:m})=>/*#__PURE__*/t(n,{title:e,subtitle:i||`Please try logging in again or go to ${r} to create an account.`,icon:o,iconVariant:"warning",primaryCta:{label:a,onClick:m},watermark:!0}),m={component:()=>{let{navigate:o,setModalData:n,data:m}=r(),c=e(),{getAuthMeta:p,client:s}=i();/*#__PURE__*/return t(a,{appName:c?.name,onRetry:()=>{let t=p();n({...m,login:{...m?.login,...t?.disableSignup?{disableSignup:!0}:{}}}),s?.authFlow&&(s.authFlow=void 0),o("LandingScreen")}})}};export{m as AccountNotFoundScreen,a as AccountNotFoundScreenView,m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t}from"react/jsx-runtime";import{FileCheck as r,ExternalLink as i}from"lucide-react";import"react";import{styled as o}from"styled-components";import{B as a}from"./Button-DJ-mtuuD.mjs";import{u as n}from"./context-Cb5MFcME.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{u as m,a as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as c}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as p}from"./ScreenLayout-Dmrhdwtt.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"tinycolor2";import"ofetch";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const d={component:()=>{let{user:t,logout:r}=m(),{onUserCloseViaDialogOrKeybindRef:i,setModalData:o,navigate:a}=l(),p=n(),{acceptTerms:d,closePrivyModal:y,createAnalyticsEvent:v}=s(),h=e=>{e?.preventDefault(),y({shouldCallAuthOnSuccess:!1}),r()};i.current=h;/*#__PURE__*/return e(u,{termsAndConditionsUrl:p?.legal.termsAndConditionsUrl,privacyPolicyUrl:p?.legal.privacyPolicyUrl,onAccept:async e=>{e?.preventDefault(),await d(),t&&c(t,p.embeddedWallets)?(o({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),a("EmbeddedWalletOnAccountCreateScreen")):y()},onDecline:h})}},u=({termsAndConditionsUrl:o,privacyPolicyUrl:n,onAccept:s,onDecline:m,title:l="One last step",subtitle:c="By signing up, you agree to our terms and privacy policy."})=>/*#__PURE__*/e(p,{title:l,subtitle:c,icon:r,primaryCta:{label:"Accept",onClick:s},secondaryCta:{label:"No thanks",onClick:m},watermark:!0,children:(o||n)&&/*#__PURE__*/t(y,{children:[o&&/*#__PURE__*/t(a,{variant:"muted",href:o,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Terms",/*#__PURE__*/e(i,{width:16,height:16,strokeWidth:2.25})]}),n&&/*#__PURE__*/t(a,{variant:"muted",href:n,target:"_blank",size:"lg",style:{justifyContent:"space-between"},as:"a",children:["View Privacy Policy",/*#__PURE__*/e(i,{width:16,height:16,strokeWidth:2.25})]})]})});let y=/*#__PURE__*/o.div.withConfig({displayName:"LinksContainer",componentId:"sc-d5115275-0"})(["display:flex;flex-direction:column;gap:12px;margin-top:var(--screen-space);"]);export{d as AffirmativeConsentScreen,u as AffirmativeConsentScreenView,d as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as a}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as r,useEffect as n}from"react";import{createWalletClient as o,custom as s,publicActions as d,createPublicClient as c,http as m,formatUnits as l}from"viem";import{addToDefaultChains as u}from"@privy-io/js-sdk-core";import{b as p,c as h,R as g}from"./Layouts-Bmf8DxNP.mjs";import{B as f}from"./ModalHeader-D7WajfD8.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{t as j}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{N as I}from"./index-CJMgUOnw.mjs";import{u as w,t as y}from"./context-Cb5MFcME.mjs";import{u as T,a as C,b}from"./internal-context-Cvo1WmWN.mjs";import{Q as S,D as N}from"./useActiveWallet-hrZcON-K.mjs";import{a as x}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as A}from"./useGetTokenPrice-B4XVfxeD.mjs";import{u as E}from"./useWallets-BplPx0Pz.mjs";import{O as k}from"./analytics-mkkvFRju.mjs";import{g as F,t as B,a as U,b as L,c as P,u as M}from"./reservoir-B0V48m2I.mjs";import{z as W}from"./index-CI666IP9.mjs";import{g as H}from"./getChainName-DjpPdUSc.mjs";import{g as O,a as D}from"./transaction-CnfuREWo.mjs";import{g as R,B as q}from"./BridgeNetworkSelectionView-Bu0vi9_a.mjs";import{a as $}from"./getPublicClient-IxRndou_.mjs";import{T as _}from"./TransferOrBridgeLoadingScreen-D3vBwM_o.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useGetSolPrice-Bi0pPiUW.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./getErc20Balance-Dtau1386.mjs";import"./Button-DJ-mtuuD.mjs";import"./Row-CG0lSY5Z.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./Value-B4M62ove.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Chip-Bsgj4Yc-.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"./formatErc20TokenAmount-BuPk9xcy.mjs";import"./ethers-CpMSCMOg.mjs";import"./styles-DY17fuAX.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"./Address-DtXA0OPS.mjs";import"lucide-react";const Q={component:()=>{let Q=w(),{rpcConfig:V,appId:G,closePrivyModal:z,createAnalyticsEvent:K}=T(),{navigate:X,setModalData:Y,data:Z}=x(),J=w(),{wallets:ee}=E(),[te,ae]=r(null),[ie,re]=r(null),[ne,oe]=r([]),[se,de]=r(0),[ce,me]=r(!1),[le,ue]=r(!1),[pe,he]=r(!1),[ge,fe]=r(!1),[ve,je]=r(),[Ie,we]=r();if(!Z?.funding||"solana"!==Z.funding.chainType)throw Error("Invalid funding data");let{address:ye,chain:Te,connectedWallet:Ce}=Z.funding,[be,Se]=r(Z.funding.amount),Ne=("ethereum"===Ce?.type?Ce:void 0)??ee[0],xe=S(Ne?.walletClientType||"unknown"),Ae=xe?.name||"wallet",[Ee,ke]=r(null);n((()=>{(async()=>{if(!Ne)return;let e=await Ne.getEthereumProvider();ke(o({account:Ne.address,transport:s(e)}).extend(d))})().catch(console.error)}),[Ne]);let[Fe,Be]=r(0n),Ue=O(Fe);n((()=>{let e=Q.solanaRpcs[Te];e?W({rpc:e.rpc,address:ye}).then((e=>Be(BigInt(e)))).catch(console.error):console.warn("Unable to load solana rpc, skipping balance")}),[]);let[Le,Pe]=r(),{tokenPrice:Me}=A("solana"),{fundingAmountInBaseUnit:We,fundingAmountInUsd:He}=D({amount:be,fee:0n,tokenPrice:Me,isUsdc:Z.funding.isUSDC});if(n((()=>{(async()=>{if(!Ee||!Ne)return;let e=["solana:testnet","solana:devnet"].includes(Te);e&&console.warn("Solana testnets are not supported for bridging");let t=u(J.chains).filter((({testnet:t})=>!!t===e)),a=(await R({chains:t,address:Ne.address,appId:G,rpcConfig:V})).filter((e=>e.balance>0n));if(a.length<1)return void ae(new C(`Wallet ${N(Ne.address)} does not have enough funds.`,void 0,b.INSUFFICIENT_BALANCE));a.sort(((e,t)=>Number(t.balance-e.balance)));let i=(await Promise.allSettled(a.map((async e=>({...e,quote:await F({isTestnet:!1,input:B({appId:G,amount:We.toString(),user:Ne.address,recipient:ye,destinationChainId:L,destinationCurrency:U,originChainId:e.chain.id})})}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(i.length<1)return void ae(new C(`Unable to fetch quotes for bridging. Wallet ${N(Ne.address)} does not have enough funds.`,void 0,b.INSUFFICIENT_BALANCE));let r=i.map((({quote:e,balance:t,chain:a})=>({bridgeTx:P(e),balance:t,chain:a,isErc20Quote:!1}))).filter((({bridgeTx:e})=>!!e));if(r.length>1)return void oe(r);let n=r.at(0);n?(ue(!0),Pe({data:n.bridgeTx.data,to:n.bridgeTx.to,value:n.bridgeTx.value,chain:n.chain})):ae(new C(`Unable to select bridge option from quotes. Wallet ${N(Ne.address)} does not have enough funds.`,void 0,b.INSUFFICIENT_BALANCE))})().catch(console.error)}),[Ee]),n((()=>{(async()=>{let e,t;if(!Ee||!Ne||ce||pe||!Le)return;me(!0);let a=c({chain:Le.chain,transport:m($(Le.chain,V,G))});try{e=await a.prepareTransactionRequest({account:Ne.address,to:Le.to,chain:Le.chain,data:Le.data,value:BigInt(Le.value??0)})}catch(e){console.error(e),ne.length>1&&re(e.shortMessage??"Something went wrong")}if(e){me(!1),he(!0);try{await Ee.switchChain({id:Le.chain.id})}catch(e){await Ee.addChain({chain:Le.chain}),await Ee.switchChain({id:Le.chain.id})}try{t=await Ee.sendTransaction(e)}catch(e){console.error(e),"TransactionExecutionError"===e.name&&(ne.length<1?ae(new C(e.shortMessage,void 0,b.TRANSACTION_FAILURE)):re(e.shortMessage??"Something went wrong"))}if(t)return await Ee.waitForTransactionReceipt({hash:t}),le?(we("pending"),void je(t)):(he(!1),fe(!0),void K({eventName:k,payload:{provider:"external",status:"success",txHash:t,address:Ne.address,chainId:Le.chain.id,chainType:"ethereum",value:Le.value?l(BigInt(Le.value),18):void 0,token:"ETH",destination:ye,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:l(We,9),destinationToken:"SOL"}}));he(!1)}else me(!1)})().catch(console.error)}),[Ee,Le]),M({transactionHash:ve,isTestnet:!1,bridgingStatus:Ie,setBridgingStatus:we,onSuccess({transactionHash:e}){ue(!1),fe(!0),K({eventName:k,payload:{provider:"external",status:"success",txHash:e,address:Ne?.address,chainId:Le?.chain.id,chainType:"ethereum",value:Le?.value?l(BigInt(Le.value),18):void 0,token:"ETH",destination:ye,destinationClusterName:"mainnet-beta",destinationChainType:"solana",destinationValue:l(We,9),destinationToken:"SOL"}})},onFailure({error:e}){ue(!1),ae(e)}}),n((()=>{te&&(Y({funding:Z?.funding,solanaFundingData:Z?.solanaFundingData,sendTransaction:Z?.sendTransaction,errorModalData:{error:te,previousScreen:"TransferFromWalletScreen"}}),X("ErrorScreen",!1))}),[te]),n((()=>{if(!ge)return;let e=setTimeout(z,y);return()=>clearTimeout(e)}),[ge]),ge/*#__PURE__*/)return e(t,{children:[/*#__PURE__*/a(j,{}),/*#__PURE__*/a(p,{}),/*#__PURE__*/e(h,{children:[/*#__PURE__*/a(i,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/a(v,{title:"Success!",description:`You’ve successfully added ${be} SOL to your ${J.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/a(g,{}),/*#__PURE__*/a(f,{})]});let Oe=ne[se];return ne.length>1&&Oe?/*#__PURE__*/a(q,{displayName:Ae,configuredFundingChain:Te,formattedBalance:Ue,fundingAmount:be,fundingCurrency:"SOL",fundingAmountInUsd:He,options:ne,selectedOption:Oe,isPreparing:ce,isSubmitting:pe,addressToFund:ye,fundingWalletAddress:Ne?.address||"",errorMessage:ie,onSubmit:()=>{Z.funding?.amount!==be?async function(){if(Ne&&Oe)try{let e=await F({isTestnet:!1,input:B({appId:G,amount:We.toString(),user:Ne.address,recipient:ye,destinationChainId:L,destinationCurrency:U,originChainId:Oe.chain.id})}),t=P(e);if(!t)throw Error("Invalid transaction request");ue(!0),Pe({data:t.data,to:t.to,value:t.value,chain:Oe.chain})}catch(e){console.error(e),ae(new C("Unable to fetch quotes for bridging",e,b.INSUFFICIENT_BALANCE))}}().catch(console.error):Pe({to:Oe.bridgeTx.to,data:Oe.bridgeTx.data,value:Oe.bridgeTx.value,chain:Oe.chain})},onSelect:e=>{e!==se&&(re(null),de(e))},onAmountChange:Se}):pe&&Ne?/*#__PURE__*/a(_,{walletClientType:Ne?.walletClientType||"unknown",displayName:Ae,addressToFund:ye,isBridging:le,isErc20Flow:!1,chainId:"solana",chainName:H(Te),totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
|
|
2
|
-
/*#__PURE__*/e(t,{children:[/*#__PURE__*/a(j,{}),/*#__PURE__*/a(I,{}),/*#__PURE__*/a("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/a(f,{})]})}};export{Q as AwaitingEvmToSolBridgingScreen,Q as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as t,jsx as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as r,useEffect as i}from"react";import{parseEther as o,createWalletClient as s,custom as d,publicActions as c,createPublicClient as l,http as m,encodeFunctionData as u,formatUnits as h}from"viem";import{addToDefaultChains as p}from"@privy-io/js-sdk-core";import{b as f,c as g,R as v}from"./Layouts-Bmf8DxNP.mjs";import{B as y}from"./ModalHeader-D7WajfD8.mjs";import{C}from"./ScreenHeader-Biz1wq02.mjs";import{t as I}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{N as T}from"./index-CJMgUOnw.mjs";import{u as w,t as b}from"./context-Cb5MFcME.mjs";import{u as j,a as E,b as A}from"./internal-context-Cvo1WmWN.mjs";import{Q as N,D as S}from"./useActiveWallet-hrZcON-K.mjs";import{a as x}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as B}from"./useGetTokenPrice-B4XVfxeD.mjs";import{u as F}from"./useWallets-BplPx0Pz.mjs";import{E as k}from"./transfer-CMPmjPsM.mjs";import{f as M}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{c as U,a as W,g as H,s as P}from"./ethers-CpMSCMOg.mjs";import{O as L}from"./analytics-mkkvFRju.mjs";import{t as $,g as q,c as D,u as Q}from"./reservoir-B0V48m2I.mjs";import{g as R,B as _}from"./BridgeNetworkSelectionView-Bu0vi9_a.mjs";import{g as O}from"./getErc20Balance-Dtau1386.mjs";import{a as V}from"./getPublicClient-IxRndou_.mjs";import{T as G}from"./TransferOrBridgeLoadingScreen-D3vBwM_o.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useGetSolPrice-Bi0pPiUW.mjs";import"./Button-DJ-mtuuD.mjs";import"./Row-CG0lSY5Z.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./Value-B4M62ove.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./getChainName-DjpPdUSc.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"./shared-CtYf3O54.mjs";import"@headlessui/react";import"@heroicons/react/24/outline/ChevronDownIcon";import"./styles-DY17fuAX.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"./Address-DtXA0OPS.mjs";import"lucide-react";const z={component:()=>{let{rpcConfig:z,appId:K,closePrivyModal:X,createAnalyticsEvent:Y}=j(),{navigate:Z,setModalData:J,data:ee}=x(),te=w(),{wallets:ae}=F(),[ne,re]=r(!1),[ie,oe]=r(0n),[se,de]=r(!1),[ce,le]=r(null),[me,ue]=r(null),[he,pe]=r([]),[fe,ge]=r(0),[ve,ye]=r(!1),[Ce,Ie]=r(!1),[Te,we]=r(!1),[be,je]=r(!1),[Ee,Ae]=r(),[Ne,Se]=r();if(!ee?.funding||"ethereum"!==ee.funding.chainType)throw Error("Invalid funding data");let{erc20ContractInfo:xe,chain:Be,connectedWallet:Fe}=ee.funding,ke=ee.funding.address,Me=ee.funding.erc20Address,[Ue,We]=r(ee.funding.amount);i((()=>{Me&&!xe&&le(Error("Unable to fetch token details"))}),[]);let He=!!Me&&!!xe,Pe=He?BigInt(parseFloat(Ue)*10**xe.decimals):o(Ue),Le=("ethereum"===Fe?.type?Fe:void 0)??ae[0],$e=N(Le?.walletClientType||"unknown"),qe=$e?.name||"wallet",[De,Qe]=r(null);i((()=>{(async()=>{if(!Le)return;let e=await Le.getEthereumProvider();Qe(s({account:Le.address,transport:d(e)}).extend(c))})().catch(console.error)}),[Le]);let[Re,_e]=r(0n);i((()=>{l({chain:Be,transport:m(V(Be,z,K))}).getBalance({address:ke}).then(_e).catch(console.error)}),[]);let[Oe,Ve]=r(0n);i((()=>{He&&O({chain:Be,address:ke,appId:K,rpcConfig:z,erc20Address:Me}).then((e=>Ve(e.balance))).catch(console.error)}),[]);let{tokenPrice:Ge}=B(Be.id),[ze,Ke]=r({to:ke,chain:Be,value:Pe,data:void 0});i((()=>{(async()=>{let e,t;if(!De||!Le||ve||Te)return;ye(!0);let a=l({chain:ze.chain,transport:m(V(ze.chain,z,K))});if(He&&!ze.data)return await a.simulateContract({address:Me,chain:ze.chain,abi:k,functionName:"transfer",args:[ke,Pe],account:Le.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(ye(!1),void Ke({to:Me,chain:ze.chain,data:u({abi:k,functionName:"transfer",args:[ke,Pe]}),value:"0x0"})):(ye(!1),void de(!0));try{e=await a.prepareTransactionRequest({account:Le.address,to:ze.to,chain:ze.chain,data:ze.data,value:BigInt(ze.value??0)})}catch(e){if(console.error(e),he.length>1)ue(e.shortMessage??"Something went wrong");else if(Ce&&0===he.length)return void le(new E(`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE))}if(!e)return ye(!1),void de(!0);ye(!1),we(!0),re(!0),oe(e.gas);try{await De.switchChain({id:ze.chain.id})}catch(e){await De.addChain({chain:ze.chain}),await De.switchChain({id:ze.chain.id})}try{t=await De.sendTransaction(e)}catch(e){if(console.error(e),"TransactionExecutionError"===e.name)if(he.length<1){let t=e.shortMessage;(e.shortMessage.includes("rejected the request")||e.details.includes("rejected the request"))&&(t="User rejected the request."),le(new E(t,void 0,A.TRANSACTION_FAILURE))}else ue(e.shortMessage??"Something went wrong")}if(t)return await De.waitForTransactionReceipt({hash:t}),we(!1),Ce?(Ae(t),void Se("pending")):(je(!0),void Y({eventName:L,payload:{provider:"external",status:"success",txHash:t,address:Le.address,chainId:ze.chain.id,chainType:"ethereum",value:ze.value?h(BigInt(ze.value),xe?.decimals??18):void 0,token:xe?.symbol??Me??"ETH",destinationAddress:ke,destinationChainId:Be.id,destinationChainType:"ethereum",destinationValue:Pe?h(Pe,xe?.decimals??18):void 0,destinationToken:xe?.symbol??Me??Be.nativeCurrency.name}}));we(!1)})().catch(console.error)}),[De,ze]),i((()=>{(async()=>{if(!se||!De||!Le)return;let e=p(te.chains).filter((e=>e.id!==Be.id&&!!e.testnet==!!Be.testnet));He&&e.unshift(Be);let t=await R({chains:e,address:Le.address,appId:K,rpcConfig:z,includeUsdc:ee.funding?.isUSDC}),a=He?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>Pe)),n=He&&t.every((e=>0n===e.balance));if(a.length<1)return void le(new E(n?`Wallet ${S(Le.address)} doesn't have enough funds to cover gas fees. Top up your wallet and try again.`:`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE));a.sort(((e,t)=>Number(He?(t.erc20Balance??0n)-(e.erc20Balance??0n):t.balance-e.balance)));let r=a.flatMap((e=>{let t=[{...e,isErc20Quote:!1,isTestnet:!!Be.testnet,input:$({appId:K,amount:Pe.toString(),user:Le.address,recipient:ke,destinationChainId:Be.id,destinationCurrency:Me,originChainId:e.chain.id})}];return He&&Me&&(e.erc20Balance??0n)>=Pe&&t.push({...e,isErc20Quote:!0,isTestnet:!!Be.testnet,input:$({appId:K,amount:Pe.toString(),user:Le.address,recipient:ke,destinationChainId:Be.id,destinationCurrency:Me,originChainId:e.chain.id,originCurrency:e.erc20Address})}),t})),i=(await Promise.allSettled(r.map((async e=>({...e,quote:await q(e)}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(i.length<1)return void le(new E(`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE));let o=i.map((e=>({bridgeTx:D(e.quote),balance:e.balance,chain:e.chain,erc20Balance:e.erc20Balance,isErc20Quote:e.isErc20Quote}))).filter((e=>!!e.bridgeTx));if(o.length>1)return void pe(o);let s=o[0];s?(Ie(!0),Ke({data:s.bridgeTx.data,to:s.bridgeTx.to,value:s.bridgeTx.value,chain:s.chain})):le(new E(`Wallet ${S(Le.address)} does not have enough funds.`,void 0,A.INSUFFICIENT_BALANCE))})().catch(console.error)}),[se]),Q({transactionHash:Ee,isTestnet:!!Be.testnet,bridgingStatus:Ne,setBridgingStatus:Se,onSuccess({transactionHash:e}){Ie(!1),je(!0),Y({eventName:L,payload:{provider:"external",status:"success",txHash:e,address:Le?.address,chainId:ze.chain.id,chainType:"ethereum",value:ze.value?h(BigInt(ze.value),xe?.decimals??18):void 0,token:xe?.symbol??Me??"ETH",destinationAddress:ke,destinationChainId:Be.id,destinationChainType:"ethereum",destinationValue:Pe?h(Pe,xe?.decimals??18):void 0,destinationToken:xe?.symbol??Me??Be.nativeCurrency.name}})},onFailure({error:e}){Ie(!1),le(e)}}),i((()=>{ce&&(J({funding:ee?.funding,solanaFundingData:ee?.solanaFundingData,sendTransaction:ee?.sendTransaction,errorModalData:{error:ce,previousScreen:"TransferFromWalletScreen"}}),Z("ErrorScreen",!1))}),[ce]);let Xe=!He&&Ge?U(Ue??"0",Ge):void 0,Ye=He?ie:P([ie,Pe]),Ze=Ye&&Ge?W(Ye,Ge):void 0,Je=Ye?H(Ye,ee?.funding?.erc20Address?ee?.funding?.erc20ContractInfo?.symbol||"ETH":ee?.funding?.chain.nativeCurrency.symbol||"ETH"):void 0,et=ie&&Ge?W(ie,Ge):void 0,tt=ie?H(ie,Be?.nativeCurrency?.symbol||"ETH"):void 0;if(i((()=>{if(!be)return;let e=setTimeout(X,b);return()=>clearTimeout(e)}),[be]),be/*#__PURE__*/)return e(t,{children:[/*#__PURE__*/a(I,{}),/*#__PURE__*/a(f,{}),/*#__PURE__*/e(g,{children:[/*#__PURE__*/a(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/a(C,{title:"Success!",description:`You’ve successfully added ${Ue} ${He?xe.symbol:Be.nativeCurrency.symbol} to your ${te.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/a(v,{}),/*#__PURE__*/a(y,{})]});let at=He?`${M({amount:Oe,decimals:xe.decimals})} ${xe.symbol}`:H(Re,Be.nativeCurrency.symbol,3,!0),nt=he[fe];return he.length>1&&nt?/*#__PURE__*/a(_,{displayName:qe,configuredFundingChain:Be,erc20ContractInfo:xe,formattedBalance:at,fundingAmount:Ue,fundingCurrency:He?xe.symbol:Be.nativeCurrency.symbol,fundingAmountInUsd:Xe,options:he,selectedOption:nt,isPreparing:ve,isSubmitting:Te,addressToFund:ke,fundingWalletAddress:Le?.address||"",errorMessage:me,onSubmit:()=>{ee.funding?.amount!==Ue?async function(){if(Le&&nt)try{let e=await q({isTestnet:!!Be.testnet,input:$({appId:K,amount:Pe.toString(),user:Le.address,recipient:ke,destinationChainId:Be.id,destinationCurrency:Me,originChainId:nt.chain.id})}),t=D(e);if(!t)throw Error("Invalid transaction request");Ie(!0),Ke({data:t.data,to:t.to,value:t.value,chain:nt.chain})}catch(e){console.error(e),le(new E("Unable to fetch quotes for bridging",e,A.INSUFFICIENT_BALANCE))}}().catch(console.error):Ke({to:nt.bridgeTx.to,data:nt.bridgeTx.data,value:nt.bridgeTx.value,chain:nt.chain})},onSelect:e=>{e!==fe&&(ue(null),ge(e))},onAmountChange:We}):ne&&ie&&Le&&ee?.funding?/*#__PURE__*/a(G,{walletClientType:Le?.walletClientType||"unknown",displayName:qe,addressToFund:ke,isBridging:Ce,isErc20Flow:He,totalPriceInUsd:Ze,totalPriceInNativeCurrency:Je,gasPriceInUsd:et,gasPriceInNativeCurrency:tt,chainId:Be.id,chainName:Be.name}):
|
|
2
|
-
/*#__PURE__*/e(t,{children:[/*#__PURE__*/a(I,{}),/*#__PURE__*/a(T,{}),/*#__PURE__*/a("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/a(y,{})]})}};export{z as AwaitingExternalEthereumTransferScreen,z as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"@heroicons/react/20/solid/CheckIcon";import t from"@heroicons/react/24/outline/EnvelopeIcon";import i from"@heroicons/react/24/outline/PhoneIcon";import{useState as n,useEffect as a}from"react";import{isMobile as s}from"react-device-detect";import{styled as c}from"styled-components";import{H as l}from"./Layouts-Bmf8DxNP.mjs";import{L as d}from"./Link-DwjLfHwW.mjs";import{u as p,q as m}from"./context-Cb5MFcME.mjs";import{u,d as f,b as v,i as h}from"./internal-context-Cvo1WmWN.mjs";import{a as y,u as g}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as b}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as x}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const C=({contactMethod:c,authFlow:p,appName:m="Privy",whatsAppEnabled:u=!1,onBack:f,onCodeSubmit:v,onResend:h,errorMessage:y,success:g=!1,resendCountdown:b=0,onInvalidInput:C,onClearError:S})=>{let[A,I]=n(w);a((()=>{y||I(w)}),[y]);let N=async e=>{e.preventDefault();let r=e.currentTarget.value.replace(" ","");if(""===r)return;if(isNaN(Number(r)))return void C?.("Code should be numeric");S?.();let o=Number(e.currentTarget.name?.charAt(5)),t=[...r||[""]].slice(0,E-o),i=[...A.slice(0,o),...t,...A.slice(o+t.length)];I(i);let n=Math.min(Math.max(o+t.length,0),E-1);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${n}]`);e?.focus()}if(i.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${n}]`);e?.blur(),await(v?.(i.join("")))}};/*#__PURE__*/return e(x,{title:"Enter confirmation code",subtitle:/*#__PURE__*/r("span","email"===p?{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for an email from privy.io and enter your code below."]}:{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for a",u?" WhatsApp":""," message from ",m," and enter your code below."]}),icon:"email"===p?t:i,onBack:f,showBack:!0,helpText:/*#__PURE__*/r(L,{children:[/*#__PURE__*/r("span",{children:["Didn't get ","email"===p?"an email":"a message","?"]}),b?/*#__PURE__*/r(R,{children:[/*#__PURE__*/e(o,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),/*#__PURE__*/e("span",{children:"Code sent"})]}):/*#__PURE__*/e(d,{as:"button",size:"sm",onClick:h,children:"Resend code"})]}),children:/*#__PURE__*/e(k,{children:/*#__PURE__*/e(l,{children:/*#__PURE__*/r(_,{children:[/*#__PURE__*/e("div",{children:A.map(((r,o)=>/*#__PURE__*/e("input",{name:`code-${o}`,type:"text",value:A[o],onChange:N,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(S?.(),I([...A.slice(0,e),"",...A.slice(e+1)]),e>0){let r=document.querySelector(`input[name=code-${e-1}]`);r?.focus()}})(o)},inputMode:"numeric",autoFocus:0===o,pattern:"[0-9]",className:`${g?"success":""} ${y?"fail":""}`,autoComplete:s?"one-time-code":"off"},o)))}),/*#__PURE__*/e(j,{$fail:!!y,$success:g,children:/*#__PURE__*/e("span",{children:"Invalid or expired verification code"===y?"Incorrect code":y||(g?"Success!":"")})})]})})})})};let E=6,w=Array(6).fill("");var S,A,I=((S=I||{})[S.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",S[S.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",S),N=((A=N||{})[A.EMAIL=0]="EMAIL",A[A.SMS=1]="SMS",A);const T={component:()=>{let{navigate:r,lastScreen:o,navigateBack:t,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=y(),c=p(),{closePrivyModal:l,resendEmailCode:d,resendSmsCode:x,getAuthMeta:E,loginWithCode:w,updateWallets:S,createAnalyticsEvent:A}=u(),{authenticated:I,logout:N,user:T}=g(),{whatsAppEnabled:k}=p(),[_,j]=n(!1),[L,R]=n(null),[M,D]=n(null),[O,P]=n(0);s.current=()=>null;let W=E()?.email?0:1,U=0===W?E()?.email||"":E()?.phoneNumber||"",F=m-500;a((()=>{if(O){let e=setTimeout((()=>{P(O-1)}),1e3);return()=>clearTimeout(e)}}),[O]),a((()=>{if(I&&_&&T){if(c?.legal.requireUsersAcceptTerms&&!T.hasAcceptedTerms){let e=setTimeout((()=>{r("AffirmativeConsentScreen")}),F);return()=>clearTimeout(e)}if(b(T,c.embeddedWallets)){let e=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),N()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),F);return()=>clearTimeout(e)}{S();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),m);return()=>clearTimeout(e)}}}),[I,_,T]),a((()=>{if(L&&0===M){let e=setTimeout((()=>{R(null),D(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[L,M]);/*#__PURE__*/return e(C,{contactMethod:U,authFlow:0===W?"email":"sms",appName:c?.name,whatsAppEnabled:k,onBack:()=>t(),onCodeSubmit:async e=>{try{await w(e),j(!0)}catch(e){if(e instanceof f&&e.privyErrorCode===v.INVALID_CREDENTIALS)R("Invalid or expired verification code"),D(0);else if(e instanceof f&&e.privyErrorCode===v.CANNOT_LINK_MORE_OF_TYPE)R(e.message);else{if(e instanceof f&&e.privyErrorCode===v.USER_LIMIT_REACHED)return console.error(new h(e).toString()),void r("UserLimitReachedScreen");if(e instanceof f&&e.privyErrorCode===v.USER_DOES_NOT_EXIST)return void r("AccountNotFoundScreen");if(e instanceof f&&e.privyErrorCode===v.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:e,previousScreen:o??"AwaitingPasswordlessCodeScreen"}}),void r("ErrorScreen",!1);if(e instanceof f&&e.privyErrorCode===v.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:e}}),void r("ConnectOrCreateScreen",!1);if(e instanceof f&&e.privyErrorCode===v.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return i({accountTransfer:{nonce:e.data?.data?.nonce,account:U,displayName:e.data?.data?.account?.displayName,linkMethod:0===W?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void r("LinkConflictScreen");R("Issue verifying code"),D(0)}}},onResend:async()=>{P(30),0===W?await d():await x()},errorMessage:L||void 0,success:_,resendCountdown:O,onInvalidInput:e=>{R(e),D(1)},onClearError:()=>{1===M&&(R(null),D(null))}})}};let k=/*#__PURE__*/c.div.withConfig({displayName:"PasswordlessCodeContainer",componentId:"sc-6187bfee-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin:auto;gap:16px;flex-grow:1;width:100%;"]),_=/*#__PURE__*/c.div.withConfig({displayName:"CodeInput",componentId:"sc-6187bfee-1"})(["display:flex;flex-direction:column;width:100%;gap:12px;> div:first-child{display:flex;justify-content:center;gap:0.5rem;width:100%;border-radius:var(--privy-border-radius-sm);> input{border:1px solid var(--privy-color-foreground-4);background:var(--privy-color-background);border-radius:var(--privy-border-radius-sm);padding:8px 10px;height:48px;width:40px;text-align:center;font-size:18px;font-weight:600;color:var(--privy-color-foreground);transition:all 0.2s ease;}> input:focus{border:1px solid var(--privy-color-foreground);box-shadow:0 0 0 1px var(--privy-color-foreground);}> input:invalid{border:1px solid var(--privy-color-error);}> input.success{border:1px solid var(--privy-color-border-success);background:var(--privy-color-success-bg);}> input.fail{border:1px solid var(--privy-color-border-error);background:var(--privy-color-error-bg);animation:shake 180ms;animation-iteration-count:2;}}@keyframes shake{0%{transform:translate(1px,0px);}33%{transform:translate(-1px,0px);}67%{transform:translate(-1px,0px);}100%{transform:translate(1px,0px);}}"]),j=/*#__PURE__*/c.div.withConfig({displayName:"InputHelp",componentId:"sc-6187bfee-2"})(["line-height:20px;min-height:20px;font-size:14px;font-weight:400;color:",";display:flex;justify-content:center;width:100%;text-align:center;"],(e=>e.$success?"var(--privy-color-success-dark)":e.$fail?"var(--privy-color-error-dark)":"transparent")),L=/*#__PURE__*/c.div.withConfig({displayName:"HelpTextContainer",componentId:"sc-6187bfee-3"})(["display:flex;gap:8px;align-items:center;justify-content:center;width:100%;color:var(--privy-color-foreground-2);"]),R=/*#__PURE__*/c.div.withConfig({displayName:"Badge",componentId:"sc-6187bfee-4"})(["display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-sm);padding:2px 8px;gap:4px;background:var(--privy-color-background-2);color:var(--privy-color-foreground-2);"]),M=/*#__PURE__*/c.span.withConfig({displayName:"BoldWrappingSpan",componentId:"sc-6187bfee-5"})(["font-weight:500;word-break:break-all;color:var(--privy-color-foreground);"]);export{T as AwaitingPasswordlessCodeScreen,C as AwaitingPasswordlessCodeScreenView,T as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as a,useEffect as s}from"react";import{a as n,C as c}from"./index-CI666IP9.mjs";import{a as m}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as u}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const p=({status:o,title:a,description:s,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),g=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:g,title:a,subtitle:s,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:g,reset:y,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[f,C]=a(!0);s((()=>(j(setTimeout(C,1e3,!1)),()=>{v.current.forEach((e=>clearTimeout(e))),v.current=[]})),[]);let[b,k]=a(""),[w,R]=a("Checking that you are a human..."),[S,I]=a(!1),[T,x]=a(3),A=r?.captchaModalData,M=async e=>{try{await(A?.callback(e)),A?.onSuccessNavigateTo&&i(A?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(A?.onErrorNavigateTo||"ErrorScreen",!1)}};s((()=>{"success"===l?j(setTimeout((async()=>{let e=await g();!e||A?.userIntentRequired||M(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),s((()=>{if(!f)switch(l){case"success":k("Success!"),R("CAPTCHA passed successfully."),A?.userIntentRequired||setTimeout((()=>{I(!0),M(d)}),2e3);break;case"loading":k(""),R("Checking that you are a human...");break;case"error":k("Something went wrong"),R(T<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,f,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:w,userIntentRequired:A?.userIntentRequired,retriesRemaining:T,hasSelectedCta:S,onContinue:()=>{I(!0),M(d)},onRetry:async()=>{if(T<=0)return;x((e=>e-1)),y(),h();let e=await g();!e||A?.userIntentRequired||M(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{P as l}from"./Button-DJ-mtuuD.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{L as p,a7 as u}from"./useActiveWallet-hrZcON-K.mjs";import{M as f,B as g}from"./ModalHeader-D7WajfD8.mjs";import{u as h}from"./internal-context-Cvo1WmWN.mjs";import{a as v}from"./get-is-unified-wallet-DymQMSJy.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{F as b}from"./index-CI666IP9.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:l,createAnalyticsEvent:d,client:p}=h(),[u,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:I}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===u||"pending-after-flow"===u){let e=setInterval((async()=>{if(k)try{let{status:e}=await p.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");I?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),d({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,I,u]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(f,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:u,onClickCta:l}),/*#__PURE__*/t(g,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(I,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(d,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(l,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(p,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(u,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=/*#__PURE__*/m.p.withConfig({displayName:"StatusBody",componentId:"sc-e4350fdc-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),I=/*#__PURE__*/m.div.withConfig({displayName:"ConnectContainer",componentId:"sc-e4350fdc-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);export{w as CoinbaseOnrampStatusScreen,w as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as n}from"./ScreenLayout-Dmrhdwtt.mjs";import{E as m}from"./index-CI666IP9.mjs";import"viem";import"react";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const s=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),p=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:p="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:p,subtitle:/*#__PURE__*/t(d,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(p,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=/*#__PURE__*/o.div.withConfig({displayName:"IconContainer",componentId:"sc-54536274-0"})(["display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:var(--screen-space);"]),d=/*#__PURE__*/o.span.withConfig({displayName:"SubtitleText",componentId:"sc-54536274-1"})(["white-space:pre-wrap;"]);export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,p as ConnectLedgerScreenView,c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as i}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{q as n}from"./context-Cb5MFcME.mjs";import{Q as a}from"./useActiveWallet-hrZcON-K.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{a as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as m}from"./ScreenLayout-Dmrhdwtt.mjs";import{B as c}from"./index-CI666IP9.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-DNdZyKcL.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Link-DwjLfHwW.mjs";import"./useI18n-ByKvnaXP.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:n,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:c,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(m,{title:n,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===i.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:c,watermark:!0}),d={component:()=>{let i,{navigateBack:m,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[h,C]=t(void 0),[k,b]=t(0),S=a(j?.connector?.walletClientType||"unknown"),x="connected"===j?.status,R="switching_to_supported_chain"===j?.status;o((()=>{if(x){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=j.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&j.connector){let e=j.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:j.connector?.walletClientType,walletChainType:j.connector?.chainType}))}),n)}else e=setTimeout(v,n);return()=>clearTimeout(e)}}),[x]);o((()=>{var e;j?.connectError&&(e=j?.connectError,C(p(e)))}),[j]);let T=j?.connector?.connectorType||"injected",W=j?.connector?.walletClientType||"unknown",B=S?.metadata?.shortName||S?.name||j?.connector?.walletBranding.name||"Browser Extension",M=S?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(c,{...t})),E="Browser Extension"===B?B.toLowerCase():B;i=x?`Successfully connected with ${E}`:h?h.message:R?"Switching networks":`Waiting for ${E}`;let _="Don’t see your wallet? Check your other browser windows.";return x?_="You’re good to go!":k>=2&&h?_="Unable to connect wallet":h?_=h.detail:R?_="Switch your wallet to the requested network.":"metamask"===W&&r?_="Click to continue to open and connect MetaMask.":"metamask"===W?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===T?_="Open your mobile wallet app to continue":"coinbase_wallet"===T&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:B,walletLogo:M,success:x,errorMessage:h,title:i,subtitle:_,onRetry:()=>{b(k+1),C(void 0),j?.connectRetry()},onUseDifferentWallet:m,onBack:f===w?void 0:m,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-Cb5MFcME.mjs";import{C as r,L as i}from"./CustomLandingScreenView-DWt9lv8W.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./get-is-unified-wallet-DymQMSJy.mjs";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"lucide-react";import"./ConnectEmailForm-DUgOCS2V.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./farcaster-DPlSjvF5.mjs";import"./ConnectWalletView-DVDOSzi0.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./QrCode-zzqjquVm.mjs";import"qrcode";import"./useI18n-ByKvnaXP.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./Link-DwjLfHwW.mjs";import"./ConnectPhoneForm-CbuSfwAI.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletButtonList-CGloXTN0.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./ScreenLayout-Dmrhdwtt.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as i}from"@heroicons/react/24/outline";import{useVirtualizer as l}from"@tanstack/react-virtual";import{useState as a,useMemo 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{B as m}from"./Button-DJ-mtuuD.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as u}from"./copy-Bx2Jwc5_.mjs";import{T as g}from"./ModalHeader-D7WajfD8.mjs";import{Q as w}from"./QrCode-zzqjquVm.mjs";import{E as f}from"./EmailInputForm-B4hjCxRU.mjs";import{u as y,q as v}from"./context-Cb5MFcME.mjs";import{u as b}from"./useI18n-ByKvnaXP.mjs";import{M as C,q as x,d as W,e as k,K as T,V as _,w as z,S}from"./useActiveWallet-hrZcON-K.mjs";import{u as L,P as I}from"./internal-context-Cvo1WmWN.mjs";import{W as N}from"./WalletCards-DH1rqayz.mjs";import{W as A,h as B}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{S as E}from"./Screen-dwi2CitY.mjs";let j=/*#__PURE__*/h.button.withConfig({displayName:"CopyTextButton",componentId:"sc-4b0620dc-0"})(["display:flex;align-items:center;gap:0.5rem;&:hover{text-decoration:underline;}svg{width:0.875rem;height:0.875rem;}"]),q=/*#__PURE__*/h.span.withConfig({displayName:"CopiedText",componentId:"sc-4b0620dc-1"})(["display:flex;align-items:center;gap:0.25rem;font-size:0.875rem;color:var(--privy-color-foreground-2);"]),O=/*#__PURE__*/h(p).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),U=/*#__PURE__*/h(u).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function F({children:t,iconOnly:i,value:l,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(j,{...r,onClick:()=>{navigator.clipboard.writeText(l||t).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[t," ",c?/*#__PURE__*/e(q,{children:[/*#__PURE__*/n(O,{})," ",!i&&"Copied"]}):!o&&/*#__PURE__*/n(U,{})]})}const M={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 Q{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.startsWith("eip155:")))}isSol(e){return e.chains.some((e=>e.startsWith("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=Q.normalize(e);return this.normalizedAllowList.some((e=>t===Q.normalize(e)))}inDenyList(e,n){return"listing"===n&&"rabby"===e}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}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,i=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)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=Q.normalize(e.walletClientType);i({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"]})}));let l=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.startsWith("eip155")||e.startsWith("solana")));if(e.some((e=>Q.normalize(e.walletClientType)===Q.normalize(n.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||l||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.startsWith("eip155")))),e.some((e=>Q.normalize(e.walletClientType)===Q.normalize(n.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||a||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.startsWith("solana")))),!t.length)return;let o=Q.normalize(n.slug),r=M[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.startsWith("eip155")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t}),t.some((e=>e.startsWith("solana")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t})})),this.includeWalletConnectQr&&l&&i({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:l,chainType:"ethereum",icon:A,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&a&&i({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:A,url:void 0,chains:["solana"]});let o=Array.from(t.values());o.forEach((e=>{let n=M[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(Q.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{let t=Q.normalize(e.id),i=Q.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"===i?i="binance":"universalprofiles"===i?i="universal_profile":"cryptocom-defi"===i?i="cryptocom":"bitkeep"===i&&(i="bitget_wallet");let l=r.has(t),a=r.has(i);return l&&a?r.get(t)-r.get(i):l?-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 $=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"})]}),P=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 D=/*#__PURE__*/h.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),H=/*#__PURE__*/h.button.withConfig({displayName:"CloseButton",componentId:"sc-9b65f2b6-1"})(["padding:0.25rem;height:30px;width:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background:var(--privy-color-background-2);"]),R=/*#__PURE__*/h.div.withConfig({displayName:"WalletIconWithActiveIndicator",componentId:"sc-9b65f2b6-2"})(["position:relative;display:inline-flex;align-items:center;&::after{content:' ';border-radius:var(--privy-border-radius-full);height:6px;width:6px;background-color:var(--privy-color-icon-success);position:absolute;right:-3px;top:-3px;}"]),V=/*#__PURE__*/h.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),G=/*#__PURE__*/h.span.withConfig({displayName:"Chip",componentId:"sc-9b65f2b6-4"})(["display:flex;gap:0.25rem;align-items:center;padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);background-color:var(--privy-color-background-2);svg{width:100%;max-width:1rem;max-height:1rem;stroke-width:2;}"]),Y=/*#__PURE__*/h.div.withConfig({displayName:"ScrollContainer",componentId:"sc-9b65f2b6-5"})(["display:flex;flex-direction:column;gap:0.5rem;max-height:24rem;overflow-y:scroll;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0));function K({enabled:e=!0,walletList:n,walletChainType:t}){let i=y(),{connectors:l}=L(),{listings:r,loading:c}=W(e),s=t??i.appearance.walletChainType,d=n??i.appearance?.walletList,h=o((()=>new Q(s,d)),[s,d]),{wallets:m,walletCount:p}=o((()=>h.getWallets(l,r)),[h,l,r]),[u,g]=a(""),w=o((()=>u?m.filter((e=>e.label.toLowerCase().includes(u.toLowerCase()))):m),[u,m]),[f,v]=a();return{selected:f,setSelected:v,search:u,setSearch:g,loadingListings:c,wallets:w,walletCount:p}}let J=e=>!e||"string"!=typeof e&&(e instanceof z||e instanceof S);const X=({index:i,style:l,data:a,recent:o})=>{let r=a.wallets[i],{walletChainType:c,handleWalletClick:s}=a,{t:d}=b(),h={...l,boxSizing:"border-box"};return r?/*#__PURE__*/e(te,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!J(r.connector)?/*#__PURE__*/n(R,{children:"string"==typeof r.icon?/*#__PURE__*/n(V,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(V,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(ae,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(G,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n($,{}),"solana-only"===c&&/*#__PURE__*/n(P,{})]})})]}):/*#__PURE__*/n(ie,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n($,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(P,{})]})})]}):null};var Z=({className:h,customDescription:p,connectOnly:u,preSelectedWalletId:C,hideHeader:W,...A})=>{let j=y(),{t:q}=b(),{connectors:O}=L(),U=A.walletChainType||j.appearance.walletChainType,F=A.walletList||j.appearance?.walletList,{onBack:D,onClose:H,app:R}=A,{selected:G,setSelected:Y,qrUrl:Z,setQrUrl:re,connecting:ce,uiState:se,wallets:de,walletCount:he,handleConnect:me,handleBack:pe,showSearchBar:ue,isInitialConnectView:ge,title:we,search:fe,setSearch:ye}=function({onConnect:e,onBack:n,onClose:t,onConnectError:i,walletList:l,walletChainType:c,app:s}){let h=y(),{connectors:m}=L(),{t:p}=b(),{wallets:u,walletCount:g,search:w,setSearch:f,selected:C,setSelected:x}=K({enabled:k(l??[]),walletList:l,walletChainType:c}),[W,_]=a(),[z,S]=a(),[N,A]=a(),B=!C&&!z&&!N,E=B&&(g>6||w.length>0),j=m.find((e=>"wallet_connect_v2"===e.connectorType)),q=r((async(n,t)=>{if(n){if(N?.connector===n&&"loading"===W)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(_("loading"),"string"==typeof n)return A({connector:n,name:t?.name??"Wallet",icon:t?.icon}),void window.open(n,"_blank");A({connector:n,name:t?.name??n.walletBranding.name??"Wallet",icon:t?.icon??n.walletBranding.icon});try{let t=await n.connect({showPrompt:!0});if(!t)return _("error"),void i?.(new I("Unable to connect wallet"));_("success"),T({address:t.address,client:t.walletClientType,appId:h.id}),setTimeout((()=>{e({connector:n,wallet:t})}),v)}catch(n){if(console.error("ERROR: ",{e:n}),n?.message?.includes("already pending for origin")||n?.message?.includes("wallet_requestPermissions"))return void console.log("Connection request already pending, maintaining loading state");_("error"),i?.(new I("Unable to connect wallet"))}}}),[h.id,e,N]),O=r((()=>z?(_(void 0),A(void 0),void S(void 0)):N?(_(void 0),void A(void 0)):C?(_(void 0),A(void 0),void x(void 0)):"error"===W||"loading"===W?(_(void 0),void A(void 0)):void n?.()),[z,N,C,W,n]),U=o((()=>N?.connector===j&&z&&d&&N?.name?p("connectWallet.goToWallet",{walletName:N.name}):N?.connector===j&&z&&N?.name?p("connectWallet.scanToConnect",{walletName:N.name}):z&&N?.name?p(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:N.name}):"string"==typeof N?.connector?p("connectWallet.openOrInstall",{walletName:N.name}):C&&!N?p("connectWallet.selectNetwork"):N?null:p("connectWallet.selectYourWallet")),[N,z,C,j,p]);return{selected:C,setSelected:x,qrUrl:z,setQrUrl:S,connecting:N,uiState:W,search:w,setSearch:f,wallets:u,walletCount:g,wc:j,isInitialConnectView:B,showSearchBar:E,title:U,handleConnect:q,handleBack:O,onClose:t,onConnect:e,app:s}}({...A,walletList:F,walletChainType:U}),ve=O.find((e=>"wallet_connect_v2"===e.connectorType)),be=O.find((e=>"walletconnect_solana"===e.walletBranding.id)),Ce=c(null),xe=l({count:de.length,getScrollElement:()=>Ce.current,estimateSize:()=>56,overscan:6,gap:5}),We=r((async e=>{let n="solana-only"!==U&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==U&&e.chains?.some((e=>e.startsWith("solana"))),i=n=>{let t=Q.normalize(e.id);return O.find((e=>Q.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof z||"solana"===e.chainType&&e instanceof S)))},l=async()=>{if(!ve||!e.listing)return!1;let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;return ve.setWalletEntry(n,re),await ve.resetConnection(e.id),await me(ve,{name:e.label,icon:e.icon}),!0},a=async()=>!!be&&!!e.listing&&(await be.disconnect(),be.wallet.setWalletEntry(e.listing,re),await new Promise((e=>setTimeout(e,100))),await me(be,{name:e.label,icon:e.icon}),!0),o=async n=>{let t=(n=>{let t=x[e.id];if(t)return t.getMobileRedirect({isSolana:n,connectOnly:!!u,useUniversalLink:!1});let i=e.listing?.mobile?.native;return e.listing?.mobile?.universal||i||e.url})(n);return!!t&&(await me(t,{name:e.label,icon:e.icon}),!0)};if(n&&t)Y(e);else{if(n&&!t){let n=i("ethereum");if(n&&!J(n))return void await me(n,{name:e.label,icon:e.icon});if(d&&"phantom"===e.id){if(await o(!1)||await l())return}else if(await l()||await o(!1))return}if(t&&!n){let n=i("solana");if(n&&!J(n))return void await me(n,{name:e.label,icon:e.icon});if(d){if(await o(!0)||await a())return}else if(await a()||await o(!0))return}if(!J(e.connector)){if(ve&&"wallet_connect_v2"===e.connector?.connectorType)if(await ve.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;ve.setWalletEntry(n,re)}else ve.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},re);return be&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await be.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?be.wallet.setWalletEntry(e.listing,re):be.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},re),await new Promise((e=>setTimeout(e,100)))),void await me(e.connector,{name:e.label,icon:e.icon})}e.url&&await me(e.url,{name:e.label,icon:e.icon})}}),[ve,be,me,Y,re,U,u,O]);return s((()=>{if(!C)return;let e=de.find((({id:e})=>e===C));e&&We(e).catch(console.error)}),[C]),/*#__PURE__*/e(E,{className:h,children:[/*#__PURE__*/n(E.Header,{icon:W&&ge?void 0:ce&&!Z||Z&&d&&ce?.icon?ce.icon:ce?void 0:N,iconVariant:ce&&!Z||Z&&d?"loading":void 0,iconLoadingStatus:ce&&!Z||Z&&d?{success:"success"===se,fail:"error"===se}:void 0,title:W&&ge?void 0:ce&&!Z?q("connectWallet.waitingForWallet",{walletName:ce.name}):Z&&d?q("connectWallet.waitingForWallet",{walletName:ce?.name??"connection"}):we,subtitle:W&&ge?void 0:ce&&!Z&&"string"==typeof ce.connector?q("connectWallet.installAndConnect",{walletName:ce.name}):ce&&!Z&&"string"!=typeof ce.connector?q("error"===se?"connectWallet.tryConnectingAgain":"connectionStatus.connectOneWallet"):ge?p??(R?q("connectWallet.connectToAccount",{appName:R.name}):null):null,showBack:!!D||!ge,showClose:!0,onBack:D||pe,onClose:H}),/*#__PURE__*/e(E.Body,{ref:Ce,$colorScheme:j.appearance.palette.colorScheme,style:{marginBottom:Z?"0.5rem":void 0},children:[ue&&/*#__PURE__*/n(ee,{children:/*#__PURE__*/e(f,{style:{background:"transparent"},children:[/*#__PURE__*/n(_,{children:/*#__PURE__*/n(i,{})}),/*#__PURE__*/n("input",{className:"login-method-button",type:"text",placeholder:q("connectWallet.searchPlaceholder",{count:String(he)}),onChange:e=>ye(e.target.value),value:fe})]})}),Z&&d&&"loading"===se&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(Z.universal??Z.native,"_blank"),style:{width:"100%"},children:q("connectWallet.openInApp")}),/*#__PURE__*/n(oe,{value:Z.universal??Z.native,iconOnly:!0,children:"Copy link"})]}),Z&&!d&&"loading"===se&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(oe,{value:Z.universal??Z.native,iconOnly:!0,children:q("connectWallet.copyLink")})}),Z&&!d&&/*#__PURE__*/n(w,{size:280,url:Z.universal??Z.native,squareLogoElement:ce?.icon?"string"==typeof ce.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:ce.icon,height:e.height,width:e.width})}):ce.icon:B}),/*#__PURE__*/e(ne,{children:[ce&&!Z&&"string"==typeof ce.connector&&/*#__PURE__*/e(te,{onClick:()=>window.open(ce.connector,"_blank"),children:[ce.icon&&("string"==typeof ce.icon?/*#__PURE__*/n(V,{src:ce.icon}):/*#__PURE__*/n(ce.icon,{})),/*#__PURE__*/n(ae,{children:ce.name})]}),G?.chains.some((e=>e.startsWith("eip155")))&&!ce&&/*#__PURE__*/e(te,{onClick:()=>We({...G,chains:G.chains.filter((e=>e.startsWith("eip155")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(V,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(ae,{children:G.label}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/n($,{})})]}),G?.chains.some((e=>e.startsWith("solana")))&&!ce&&/*#__PURE__*/e(te,{onClick:()=>We({...G,chains:G.chains.filter((e=>e.startsWith("solana")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(V,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(ae,{children:G.label}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/n(P,{})})]}),ge&&/*#__PURE__*/e(t,{children:[!(he>0)&&/*#__PURE__*/n(le,{children:q("connectWallet.noWalletsFound")}),he>0&&!Z&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(de.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${xe.getTotalSize()}px`,width:"100%",position:"relative"},children:xe.getVirtualItems().map((e=>/*#__PURE__*/n(X,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:de,walletChainType:U,handleWalletClick:We}},e.key)))})})]})]})]}),/*#__PURE__*/e(E.Footer,{children:[ce&&!Z&&"string"!=typeof ce.connector&&"error"===se&&/*#__PURE__*/n(E.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>me(ce.connector,{name:ce.name,icon:ce.icon}),children:q("connectWallet.retry")})}),!!(R&&R.legal.privacyPolicyUrl&&R.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(g,{app:R,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(E.Watermark,{})]})]})};let ee=/*#__PURE__*/h.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-3f4ad407-0"})(["position:sticky;margin-top:-3px;padding-top:3px;top:-3px;z-index:1;background:var(--privy-color-background);padding-bottom:calc(var(--screen-space) / 2);"]),ne=/*#__PURE__*/h.div.withConfig({displayName:"WalletListContainer",componentId:"sc-3f4ad407-1"})(["display:flex;flex-direction:column;gap:","px;"],5),te=/*#__PURE__*/h.button.withConfig({displayName:"Button",componentId:"sc-3f4ad407-2"})(["&&{gap:0.5rem;align-items:center;display:flex;position:relative;text-align:left;font-weight:500;transition:background 200ms ease-in;width:calc(100% - 4px);border-radius:var(--privy-border-radius-md);padding:0.75em;border:1px solid var(--privy-color-foreground-4);justify-content:space-between;}&:hover{background:var(--privy-color-background-2);}"]),ie=/*#__PURE__*/h.span.withConfig({displayName:"ButtonBadge",componentId:"sc-3f4ad407-3"})(["display:flex;align-items:center;justify-content:end;position:relative;& > svg{border-radius:var(--privy-border-radius-full);stroke-width:2.5;width:100%;max-height:1rem;max-width:1rem;flex-shrink:0;}& > svg:not(:last-child){border-radius:var(--privy-border-radius-full);margin-right:-0.375rem;}"]),le=/*#__PURE__*/h.div.withConfig({displayName:"EmptyContainer",componentId:"sc-3f4ad407-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),ae=/*#__PURE__*/h.span.withConfig({displayName:"WalletName",componentId:"sc-3f4ad407-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),oe=/*#__PURE__*/h(F).withConfig({displayName:"StyledCopyableText",componentId:"sc-3f4ad407-6"})(["&&{margin:0.5rem auto 0 auto;}"]);export{F as C,D as H,Y as S,V as W,G as a,H as b,Q as c,X as d,Z as i,K as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-CI666IP9.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-Cb5MFcME.mjs";import{u as S}from"./useI18n-ByKvnaXP.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{Q as b,k as v,T}from"./useActiveWallet-hrZcON-K.mjs";import{isHex as _,getAddress as R}from"viem";import{b as E,u as k,i as A}from"./internal-context-Cvo1WmWN.mjs";import{u as W,a as I}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{a as j,b as U}from"./usePrivy-D3OPY7tm.mjs";import{S as O}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"@marsidev/react-turnstile";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>R(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const M=e=>e?.privyErrorCode===E.LINKED_TO_ANOTHER_USER?y.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?y.ERROR_TIMED_OUT:e?.privyErrorCode===E.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,x=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:b,onCoinbaseReset:v,onDifferentWallet:T})=>{let{t:_}=S(),R=w?{label:"Use a different wallet",onClick:v,disabled:r}:c===y.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&h<2?{label:"Retry",onClick:b,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:R,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,_]=a(void 0),{authenticated:R,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:H,setModalData:P,data:q}=I(),z=w(),{t:X}=S(),{getAuthFlow:Q,walletConnectionStatus:Y,closePrivyModal:K,initLoginWithWallet:$,loginWithWallet:J,updateWallets:V,createAnalyticsEvent:G}=k(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=b(Y?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Y?.connector?.connectorType||c&&"coinbase_wallet"===Y?.connector?.connectorType||c&&"base_account"===Y?.connector?.connectorType||c&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||c&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=Q(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===q?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||R?$(Y.connectedWallet,pe,q?.login?.disableSignup,q?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(P({captchaModalData:{callback:e=>$(Y.connectedWallet,e,q?.login?.disableSignup,q?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&q?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),_(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(z?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,z.embeddedWallets)){let t=setTimeout((()=>{P({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}V();let t=setTimeout((()=>K({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==E.ALLOWLIST_REJECTED){if(e?.privyErrorCode===E.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==E.USER_DOES_NOT_EXIST)return e?.privyErrorCode===E.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(P({accountTransfer:{nonce:e.data?.data?.nonce,account:Q()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Q()?.meta.walletClientType,chainId:Q()?.meta.chainId,connectorType:Q()?.meta.connectorType},linkMethod:Q()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await J(),l(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",be=Y?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===ve?ve.toLowerCase():ve;t=n?X("connectionStatus.successfullyConnected",{walletName:_e}):C?X("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Re=X("connectionStatus.checkOtherWindows");n?Re=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Re="Unable to connect wallet":C?Re=C.detail:Se?Re="Switch your wallet to the requested network.":he&&we?Re="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&c?Re="Click continue to open and connect MetaMask.":"metamask"===be?Re="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Re="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Re=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):q?.login?.isSigningInWithLedgerSolana&&(Re="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Ee=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{walletLogo:Te,title:t,subtitle:Re,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&H!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Ee&&Ee?.disconnect()},onDifferentWallet:B})}};let B=/*#__PURE__*/l.p.withConfig({displayName:"RedirectLinksContainer",componentId:"sc-2a867557-0"})(["text-align:center;color:var(--privy-color-foreground-2);font-size:14px;line-height:22px;margin:16px 0;"]);export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-Cb5MFcME.mjs";import{R as s}from"./index-CI666IP9.mjs";import{u as n,a as c,d as m,b as l}from"./internal-context-Cvo1WmWN.mjs";import{a as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{z as d}from"./useActiveWallet-hrZcON-K.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as f}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:A,onUserCloseViaDialogOrKeybindRef:j}=p(),{crossAppAuthFlow:y,updateWallets:g,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,T]=o({}),U=f?.crossAppAuth,k={id:U.appId,name:U.name,logoUrl:U.logoUrl},W=new c(`There was an issue connecting your ${k.name} account. Please try again.`),x=new s((async e=>{if(U.popup)try{let t=await y({appId:e,popup:U.popup,action:U.action});T({data:t})}catch(e){if(e instanceof c)T({error:e});else if(e instanceof m){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${k.id}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");U.popup&&U.popup.close(),T({error:W})}else T({error:W})}else T({error:W})})),E=()=>{C.data&&(g(),U.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return j.current=E,r((()=>{k.id.length&&x.execute(k.id)}),[k.id]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${k.id}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(E,a);return()=>clearTimeout(o)}),[C.data]),/*#__PURE__*/e(h,{providerApp:k,success:!!C.data,error:C.error,onClose:E})},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as n,useEffect as r,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-D7WajfD8.mjs";import{u}from"./context-Cb5MFcME.mjs";import{u as m}from"./internal-context-Cvo1WmWN.mjs";import{u as g,a as f,i as y}from"./get-is-unified-wallet-DymQMSJy.mjs";import{a as w,t as v}from"./index-CI666IP9.mjs";import{U as C,G as b,H as k,V as S,F as T,W as M,X as x,Y as L,e as A,Z as N,_ as I,$ as W,a0 as E}from"./useActiveWallet-hrZcON-K.mjs";import{Mail as P,Smartphone as j,UserCircle as D}from"lucide-react";import{C as O}from"./ConnectEmailForm-DUgOCS2V.mjs";import{C as R}from"./Chip-Bsgj4Yc-.mjs";import{F as V}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as _}from"@privy-io/js-sdk-core";import{u as U,c as F,d as $}from"./ConnectWalletView-DVDOSzi0.mjs";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import z from"@heroicons/react/24/outline/FingerPrintIcon";import{L as G}from"./Link-DwjLfHwW.mjs";import{C as q}from"./ConnectPhoneForm-CbuSfwAI.mjs";import{T as B,a as Z,I as K,S as Y,L as Q,G as X,b as J,D as ee,A as te}from"./twitter-6jomarO4.mjs";import{T as ae,L as ie}from"./twitch-5IOe4sIQ.mjs";import{T as le}from"./telegram-B-JqnkqZ.mjs";import{W as ne,t as re}from"./WalletButtonList-CGloXTN0.mjs";import{S as oe}from"./ScreenLayout-Dmrhdwtt.mjs";const se=()=>{let t=u(),a=t?.appearance?.logo,i=`${t?.name} logo`,n={maxHeight:"90px",maxWidth:"180px"};return a?"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:i,style:n}):"svg"===a.type||"img"===a.type?/*#__PURE__*/l.cloneElement(a,{alt:i,style:n}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=t=>{let a=u();return a?.appearance.logo?/*#__PURE__*/e(de,{...t,children:/*#__PURE__*/e(se,{})}):null},de=/*#__PURE__*/c.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-b210074-0"})(["display:flex;flex-direction:column;align-items:center;padding:24px 0;flex-grow:1;justify-content:center;"]),pe=({name:t,logoUrl:a,size:i="38px"})=>"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:`${t??"Provider app"} logo`,style:{width:i,height:i,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
|
|
2
|
-
/*#__PURE__*/e("span",{}),he=({appId:i})=>{let[l,o]=n(void 0),{startCrossAppAuthFlow:s,authenticated:c}=g(),{client:d}=m();return r((()=>{(async()=>{d&&o(await d.getCrossAppProviderDetails(i))})()}),[d]),/*#__PURE__*/e(C,{onClick:()=>s({appId:i,action:c?"link":"login"}),disabled:!l,children:l?/*#__PURE__*/t(a,{children:[/*#__PURE__*/e(pe,{name:l.name,logoUrl:l.icon_url||void 0,size:"24px"})," ",l.name]}):/*#__PURE__*/e(b,{})})},ue=({isEditable:i,setIsEditable:l,defaultValue:n})=>{let r=o(null);/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(O,{ref:r,defaultValue:n})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{r.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(P,{})}),"Continue with Email"]})})]})},me=()=>{let[a,i]=n(!1),{currentScreen:l,navigate:r,setModalData:o,data:s}=f(),{enabled:c,token:d}=w(),{initLoginWithFarcaster:p}=m(),{accountType:h}=T();/*#__PURE__*/return t(C,{onClick:async()=>{i(!0);try{c&&!d?(o({captchaModalData:{callback:e=>p(e,s?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"FarcasterConnectStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),r("CaptchaScreen")):(await p(d,s?.login?.disableSignup),r("FarcasterConnectStatusScreen"))}catch(e){o({errorModalData:{error:e,previousScreen:l||"LandingScreen"}}),r("ErrorScreen")}finally{i(!1)}},disabled:!1,children:[/*#__PURE__*/e(V,{width:32,height:32})," Farcaster",a&&/*#__PURE__*/e(b,{}),"farcaster"===h&&/*#__PURE__*/e(ge,{color:"gray",children:"Recent"})]})};let ge=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-2f1c7323-0"})(["margin-left:auto;"]);const fe=({...a})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...a,children:[/*#__PURE__*/t("g",{clipPath:"url(#clip0_2856_1743)",children:[/*#__PURE__*/e("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/e("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),/*#__PURE__*/e("defs",{children:/*#__PURE__*/e("clipPath",{id:"clip0_2856_1743",children:/*#__PURE__*/e("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),ye=({chainType:a,withPadding:i})=>{let l="";return l="ethereum-only"===a||"ethereum-and-solana"===a?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/e(M,{$withPadding:i,children:/*#__PURE__*/t(x,{children:[/*#__PURE__*/e(H,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),/*#__PURE__*/e("h3",{children:"No wallets available"}),/*#__PURE__*/t("p",{children:["Please download an external wallet provider, like ",l,"."]})]})},"empty-wallet-state")},we=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:n,data:r}=f(),o=u(),{initLoginWithPasskey:c}=m(),d=()=>{o.loginConfig.passkeysForSignupEnabled?l("PasskeySelectSignupOrLogin"):(async()=>{a&&!i?(n({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>c({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),l("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:i}),n({passkeyAuthModalData:{passkeySignupFlow:!1}}),l("PasskeyStatusScreen"))})()};return 0===s((()=>{let e=r?.login?.loginMethods;return e?e.filter((e=>"passkey"!==e)).length:Object.entries(o.loginMethods).filter((([e,t])=>t)).filter((([e])=>"passkey"!==e)).length}),[o.loginMethods,r?.login])?/*#__PURE__*/t(C,{onClick:d,children:[/*#__PURE__*/e(z,{})," Continue with passkey"]}):/*#__PURE__*/e(G,{as:"button",onClick:d,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},ve=({isEditable:i,setIsEditable:l,defaultValue:n})=>{let r=o(null),{authenticated:s}=g(),{navigate:c,setModalData:d,currentScreen:p,data:h}=f(),{initLoginWithSms:y}=m(),{enabled:v,token:b}=w(),{whatsAppEnabled:T}=u();/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(q,{ref:r,onSubmit:async function({qualifiedPhoneNumber:e}){if(!v||b||s)try{await y({phoneNumber:e,captchaToken:b,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),c("AwaitingPasswordlessCodeScreen")}catch(e){d({errorModalData:{error:e,previousScreen:p||"LandingScreen"}}),c("ErrorScreen")}else d({captchaModalData:{callback:t=>y({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),c("CaptchaScreen")},defaultValue:n})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{r.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(j,{})}),"Continue with ",T?"WhatsApp":"SMS"]})})]})};let Ce={apple:{logo:te,displayName:"Apple"},discord:{logo:ee,displayName:"Discord"},github:{logo:J,displayName:"GitHub"},google:{logo:X,displayName:"Google"},linkedin:{logo:Q,displayName:"LinkedIn"},spotify:{logo:Y,displayName:"Spotify"},instagram:{logo:K,displayName:"Instagram"},twitter:{logo:Z,displayName:"Twitter"},tiktok:{logo:B,displayName:"TikTok"},line:{logo:ie,displayName:"LINE"},twitch:{logo:ae,displayName:"Twitch"}};const be=({provider:a})=>{let{enabled:i,token:l}=w(),{navigate:r,setModalData:o,data:c}=f(),[d,p]=n(!1),h=u(),{initLoginWithOAuth:g}=m(),{accountType:b}=T(),k=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),{displayName:M,logo:x}=s((()=>{if(y(a)){let t=h.customOAuthProviders.find((e=>e.provider===a)),i=t.provider_icon_url,l=t.provider_display_name;return{displayName:l,logo:({style:t})=>/*#__PURE__*/e("img",{alt:`${l} logo`,src:i,style:t})}}return Ce[a]}),[a,h.customOAuthProviders]);/*#__PURE__*/return t(C,{onClick:()=>{p(!0),setTimeout((()=>{p(!1)}),2e3),i&&!l?(o({captchaModalData:{callback:e=>g(a,e,c?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),r("CaptchaScreen")):g(a,void 0,c?.login?.disableSignup)},disabled:d,children:[/*#__PURE__*/e(S,{$fullSize:!0,children:/*#__PURE__*/e(x,{style:{width:"32px",height:"32px"}})}),M,k?.loginMethod===a&&/*#__PURE__*/e(ke,{color:"gray",children:"Recent"})]})};let ke=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-e74c7091-0"})(["margin-left:auto;"]);const Se=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:r,data:o}=f(),[s,c]=n(!1),{initLoginWithTelegram:d}=m(),{accountType:p}=T();async function h(e){try{await d(e,o?.login?.disableSignup),r({telegramAuthModalData:{seamlessAuth:!1}}),l("TelegramAuthScreen")}catch(e){console.error(e),c(!1)}}/*#__PURE__*/return t(C,{onClick:async function(){if(c(!0),a&&!i)return r({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),void l("CaptchaScreen");await h(i)},disabled:s,children:[/*#__PURE__*/e(le,{width:32,height:32}),"Telegram","telegram"===p&&/*#__PURE__*/e(Te,{color:"gray",children:"Recent"})]})};let Te=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-639dd483-0"})(["margin-left:auto;"]);const Me=({onClick:a,text:i,icon:l})=>/*#__PURE__*/t(C,{onClick:a,children:[/*#__PURE__*/e(S,{children:l}),/*#__PURE__*/e(L,{children:i})]}),xe=({connectOnly:i})=>{let{closePrivyModal:l}=m(),{data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:p,navigate:h}=f(),g=u(),w=o?.login,C=g.appearance.walletList,b=w?.walletChainType??g.appearance.walletChainType,{accountType:k,walletClientType:S,chainType:M}=T(),x=s((()=>k&&"guest"!==k&&"authorization_key"!==k&&"cross_app"!==k?v(k):null),[k]),{email:L,sms:I,google:W,twitter:E,discord:P,github:j,spotify:D,instagram:O,tiktok:R,line:V,twitch:H,linkedin:z,apple:G,wallet:q,farcaster:B,telegram:Z}=s((()=>w?.loginMethods?_(w.loginMethods,!0):null),[w])??g.loginMethods,{wallets:K}=U({enabled:A(q?C:[]),walletList:C,walletChainType:b}),Y=g.customOAuthProviders,{passkey:Q}=g.loginMethods,X=[L&&"email",I&&"sms",W&&"google",E&&"twitter",P&&"discord",j&&"github",D&&"spotify",O&&"instagram",R&&"tiktok",V&&"line",H&&"twitch",z&&"linkedin",G&&"apple",B&&"farcaster",Z&&"telegram",...Y.map((e=>e.provider))].filter((e=>!!e)),J=X.length>0,ee=s((()=>q&&!J?"web3-first":q&&g?.appearance.loginGroupPriority||"web2-first"),[q,J,g?.appearance.loginGroupPriority]),te=g?.appearance.hideDirectWeb2Inputs,[ae,ie]=n("default"),[le,re]=n(Ee({mostRecentlyUsedAccountType:k,smsAvailable:I,emailAvailable:L,prefilledType:w?.prefill?.type}));r((()=>{re(Ee({mostRecentlyUsedAccountType:k,smsAvailable:I,emailAvailable:L,prefilledType:w?.prefill?.type}))}),[L,I,k]);let ce=()=>{l({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{ie("default")}),150)};p.current=ce;let de=[];S&&q?de.push(S):x?.loginMethod&&X.includes(x.loginMethod)&&de.push(x.loginMethod);let pe=t=>{if("email"===t)/*#__PURE__*/return e(ue,{isEditable:"email"===le,setIsEditable:()=>{re("email")},defaultValue:"email"===w?.prefill?.type?w.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(ve,{isEditable:"sms"===le,setIsEditable:()=>{re("sms")},defaultValue:"phone"===w?.prefill?.type?w.prefill.value:void 0},t);if("apple"===t)/*#__PURE__*/return e(be,{provider:"apple"},t);if("discord"===t)/*#__PURE__*/return e(be,{provider:"discord"},t);if("farcaster"===t)/*#__PURE__*/return e(me,{},t);if("github"===t)/*#__PURE__*/return e(be,{provider:"github"},t);if("google"===t)/*#__PURE__*/return e(be,{provider:"google"},t);if("linkedin"===t)/*#__PURE__*/return e(be,{provider:"linkedin"},t);if("tiktok"===t)/*#__PURE__*/return e(be,{provider:"tiktok"},t);if("line"===t)/*#__PURE__*/return e(be,{provider:"line"},t);if("twitch"===t)/*#__PURE__*/return e(be,{provider:"twitch"},t);if("spotify"===t)/*#__PURE__*/return e(be,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(be,{provider:"instagram"},t);if("twitter"===t)/*#__PURE__*/return e(be,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(Se,{},t);if(y(t))/*#__PURE__*/return e(be,{provider:t},t);let a=K.findIndex((({id:e})=>e===F.normalize(t))),l="solana"===M?"solana-only":"ethereum-only";/*#__PURE__*/return e($,{recent:!0,index:a,data:{wallets:K,walletChainType:l,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:l,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}})},he=K.filter((e=>e.id!==F.normalize(S||""))),ge=he.map(((t,a)=>/*#__PURE__*/e($,{index:a,data:{walletChainType:b,wallets:he,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:b,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id))),fe=X.filter((e=>e!==x?.loginMethod)).flatMap(pe),Ce=de.flatMap(pe);"web3-first"===ee&&"default"===ae?ge.unshift(...Ce):"web2-first"===ee&&fe.unshift(...Ce);let ke="web2-overflow"===ae?()=>ie("default"):void 0,Te=X.filter((e=>"email"!==e&&"sms"!==e)),xe=Ne({priority:ee,email:L,sms:I,social:Te}),Pe=Ie({priority:ee,email:L,sms:I,social:Te}),je=/*#__PURE__*/e(ne,{text:We({priority:ee}),onClick:()=>{c({...o,externalConnectWallet:{walletChainType:w?.walletChainType??g.appearance.walletChainType}}),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}),De=/*#__PURE__*/e(Me,{text:xe,icon:Pe,onClick:()=>ie("web2-overflow")}),Oe=te?0:1,Re=q&&ge.length>0,Ve=0===fe.length&&q&&0===ge.length,_e=5-(Re?1:0),Ue="default"===ae&&g?.appearance.logo,Fe="default"===ae&&g.appearance.loginMessage;/*#__PURE__*/return t(oe,{title:g.appearance.landingHeader,icon:Ue?/*#__PURE__*/e(se,{}):void 0,iconVariant:Ue?"logo":void 0,onClose:ce,showClose:!0,onBack:ke,showBack:!!ke,helpText:g||Q&&"default"===ae?/*#__PURE__*/t(a,{children:[Q&&"default"===ae&&/*#__PURE__*/e(we,{}),g&&/*#__PURE__*/e(d,{app:g})]}):void 0,watermark:!0,children:[Fe&&("string"==typeof g.appearance.loginMessage?/*#__PURE__*/e(Le,{children:g.appearance.loginMessage}):/*#__PURE__*/e(Ae,{children:g.appearance.loginMessage})),/*#__PURE__*/e(N,{$colorScheme:g.appearance.palette.colorScheme,children:"default"===ae&&"web2-first"===ee?/*#__PURE__*/t(a,{children:[fe.length>_e?fe.slice(0,_e-1):fe,fe.length>_e&&De,Re&&je,Ve&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"default"===ae&&"web3-first"===ee?/*#__PURE__*/t(a,{children:[q&&/*#__PURE__*/t(a,{children:[ge.length>_e?ge.slice(0,_e-1):ge,ge.length>_e&&je]}),fe.length>Oe&&De,fe.length===Oe&&fe[0],Ve&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"web2-overflow"===ae?/*#__PURE__*/e(a,{children:"web3-first"===ee?fe:fe.slice(3)}):null})]})};let Le=/*#__PURE__*/c.div.withConfig({displayName:"StyledSubtitle",componentId:"sc-b318685a-0"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Ae=/*#__PURE__*/c.div.withConfig({displayName:"MessageContainer",componentId:"sc-b318685a-1"})(["margin-bottom:24px;"]),Ne=({priority:e,email:t,sms:a,social:i})=>"web2-first"===e?"Other socials":t&&a&&i.length>0||t&&i.length>0?"Log in with email or socials":a&&i.length>0?"Log in with sms or socials":t&&a?"Continue with email or sms":t?"Continue with email":a?"Continue with sms":"Log in with a social account",Ie=({priority:t,email:a,sms:i,social:l})=>"web2-first"===t||l.length>0?/*#__PURE__*/e(D,{}):a&&i?/*#__PURE__*/e(fe,{}):a?/*#__PURE__*/e(P,{}):i?/*#__PURE__*/e(j,{}):null,We=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Ee=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:a,prefilledType:i})=>a&&("email"===e&&"phone"!==i||"email"===i)||!t||"phone"!==e&&"phone"!==i?"email":"sms",Pe=({connectOnly:l})=>{let{closePrivyModal:o,connectors:c}=m(),{onUserCloseViaDialogOrKeybindRef:g,data:y}=f(),w=u(),{appearance:{palette:{colorScheme:C}}}=u(),{accountType:b,walletClientType:k,chainType:S}=T(),M=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),x=w.loginMethodsAndOrder?.primary??[],L=w.loginMethodsAndOrder?.overflow??[],A=s((()=>[...x,...L]),[x,L]),P=w.loginMethods.passkey,j=y?.login,D=[];k&&A.includes(k)?D.push(k):b&&A.includes(M?.loginMethod)&&D.push(M?.loginMethod);let[O,R]=n("default"),[V,_]=n(Ee({mostRecentlyUsedAccountType:b,smsAvailable:A.includes("sms"),emailAvailable:A.includes("email"),prefilledType:j?.prefill?.type}));r((()=>{_(Ee({mostRecentlyUsedAccountType:b,smsAvailable:A.includes("sms"),emailAvailable:A.includes("email"),prefilledType:j?.prefill?.type}))}),[A,b]),r((()=>{"phone"===b&&_("sms");let e=A.indexOf("sms"),t=A.indexOf("email");e>-1&&e<t&&_("sms")}),[b,x,L]);let U=()=>{o({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{R("default")}),150)};g.current=U;let F=t=>"email"===t?/*#__PURE__*/e(ue,{isEditable:"email"===V,setIsEditable:()=>{_("email")},defaultValue:"email"===j?.prefill?.type?j.prefill.value:void 0},t):"sms"===t?/*#__PURE__*/e(ve,{isEditable:"sms"===V,setIsEditable:()=>{_("sms")},defaultValue:"phone"===j?.prefill?.type?j.prefill.value:void 0},t):"apple"===t?/*#__PURE__*/e(be,{provider:"apple"},t):"discord"===t?/*#__PURE__*/e(be,{provider:"discord"},t):"farcaster"===t?/*#__PURE__*/e(me,{},t):"github"===t?/*#__PURE__*/e(be,{provider:"github"},t):"google"===t?/*#__PURE__*/e(be,{provider:"google"},t):"linkedin"===t?/*#__PURE__*/e(be,{provider:"linkedin"},t):"spotify"===t?/*#__PURE__*/e(be,{provider:"spotify"},t):"instagram"===t?/*#__PURE__*/e(be,{provider:"instagram"},t):"tiktok"===t?/*#__PURE__*/e(be,{provider:"tiktok"},t):"line"===t?/*#__PURE__*/e(be,{provider:"line"},t):"twitch"===t?/*#__PURE__*/e(be,{provider:"twitch"},t):"twitter"===t?/*#__PURE__*/e(be,{provider:"twitter"},t):"telegram"===t?/*#__PURE__*/e(Se,{},t):t.startsWith("privy:")?/*#__PURE__*/e(he,{appId:t.replace("privy:","")},t):re({walletList:w.appearance.walletList,walletChainType:j?.walletChainType??w.appearance.walletChainType,connectors:c,connectOnly:l,ignore:A,walletConnectEnabled:w.externalWallets.walletConnect.enabled,forceWallet:{wallet:t,chainType:S??"ethereum"}}),$=D.flatMap(F),H=x.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),z=L.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),[G,q]=I([...$,...H,...z],je({primary:H.length+$.length,overflow:z.length}));/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(p,{title:w.appearance.landingHeader,onClose:U,backFn:"default"===O?void 0:()=>{R("default")}}),"default"===O&&/*#__PURE__*/e(De,{}),"default"===O&&("string"==typeof w.appearance.loginMessage?/*#__PURE__*/e(W,{children:w.appearance.loginMessage}):w.appearance.loginMessage),/*#__PURE__*/e(E,{style:{overflow:"hidden"},children:/*#__PURE__*/t(N,{$colorScheme:C,children:["default"===O&&/*#__PURE__*/t(a,{children:[G,q.length>0&&/*#__PURE__*/e(Me,{text:"More options",icon:/*#__PURE__*/e(i,{}),onClick:()=>R("overflow")})]}),"overflow"===O&&/*#__PURE__*/e(a,{children:q}),P&&"default"===O&&/*#__PURE__*/e(we,{})]})}),w&&/*#__PURE__*/e(d,{app:w}),/*#__PURE__*/e(h,{})]})};let je=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,De=/*#__PURE__*/c(ce).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-7cdadd41-0"})(["margin-bottom:16px;"]);export{Pe as C,xe as L};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as a}from"./WalletInfoCard-DAv0WFcc.mjs";import{u as n,r as c}from"./context-Cb5MFcME.mjs";import{u as m,a as l}from"./internal-context-Cvo1WmWN.mjs";import{a as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as u}from"./ScreenLayout-Dmrhdwtt.mjs";import"styled-components";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-DtXA0OPS.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const d=({appName:i,address:s,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${i}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${i} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:s,title:"Wallet"})}),f={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=i(!1),[f,j]=i(),{address:g,onDelegate:y,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(f??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!f)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,f]),/*#__PURE__*/e(d,{appName:o.name,address:g,success:a,error:f,onAccept:async()=>{try{await y(),u(!0)}catch(e){j(e)}},onDecline:()=>{v()},onClose:v})}};export{f as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,f as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-CI666IP9.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{u as l,a as c}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as m}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,b as s,c}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as a,r as m}from"./context-Cb5MFcME.mjs";import{u as n}from"./internal-context-Cvo1WmWN.mjs";import{S as l}from"./ScreenLayout-Dmrhdwtt.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:A}=j.createWallet,C=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:A})};return o((()=>{let e=setTimeout(C,m);return()=>clearTimeout(e)}),[]),f.current=C,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:C})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
|