@privy-io/react-auth 3.12.0 → 3.12.1-beta-20260129222736
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-CvwC6yT4.js +1 -0
- package/dist/cjs/{Address-6qDWL5TN.js → Address-DLuP2x_5.js} +2 -2
- package/dist/cjs/AffirmativeConsentScreen-CrhHpJIl.js +6 -0
- package/dist/cjs/AllowlistRejectionScreen-C9DisX-N.js +1 -0
- package/dist/cjs/AuthenticateWithWalletScreen-B0VgWu8q.js +1 -0
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-Bi_9PQ7B.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-CtGjd9b2.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Du5DTUHu.js +103 -0
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-CV_xP4JF.js +2 -0
- package/dist/cjs/{BridgeNetworkSelectionView-DKA06V8u.js → BridgeNetworkSelectionView-C19AGc9H.js} +6 -6
- package/dist/cjs/CaptchaScreen-C7iLHHeQ.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-XHQ8dOpA.js +16 -0
- package/dist/cjs/{ConnectEmailForm-DZrCSv9t.js → ConnectEmailForm-h3tPoI4G.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-B4LtfSk5.js +9 -0
- package/dist/cjs/ConnectOnlyLandingScreen-CyuMbSMg.js +1 -0
- package/dist/cjs/ConnectOnlyStatusScreen-jOUGVKy8.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-D0CrcQ_S.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-BWSmRonl.js → ConnectPhoneForm-DuatDKeD.js} +1 -1
- package/dist/cjs/{ConnectWalletView-Bh1DK9t5.js → ConnectWalletView--gsCLvGp.js} +8 -8
- package/dist/cjs/ConnectionStatusScreen-BcbrfKI9.js +7 -0
- package/dist/cjs/CrossAppAuthScreen-C5K_S48z.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-DP1fJrBU.js → CustomLandingScreenView-StZ_yRGy.js} +3 -3
- package/dist/cjs/DelegatedActionsConsentScreen-BWp1I7xP.js +1 -0
- package/dist/cjs/DelegatedActionsRevokeScreen-1cfiT1k4.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-ClAC2HXm.js +1 -0
- package/dist/cjs/EmbeddedWalletCreatedScreen-DZOyC1XZ.js +1 -0
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-_4GMdJuo.js → EmbeddedWalletKeyExportScreen-B4OidTNt.js} +2 -2
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-BWb19zPz.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-BpSceG6F.js +1 -0
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-C3uD-zGl.js +1 -0
- package/dist/cjs/{EnrollTotp-leOB_B4o.js → EnrollTotp-DXOQ92Bg.js} +7 -7
- package/dist/cjs/ErrorScreen-Ca3XKcKy.js +4 -0
- package/dist/cjs/{FarcasterConnectStatusScreen-Bzmd4izn.js → FarcasterConnectStatusScreen-D5txkfHt.js} +6 -6
- package/dist/cjs/FarcasterSignerStatusScreen-DgkNomKJ.js +29 -0
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-72S7di11.js +2 -0
- package/dist/cjs/{FundWalletMethodHeader-YwNCXAU_.js → FundWalletMethodHeader-CWW5VpOx.js} +1 -1
- package/dist/cjs/FundingEditAmountScreen-B0NyVMoY.js +1 -0
- package/dist/cjs/FundingMethodSelectionScreen-CNI0RNo7.js +1 -0
- package/dist/cjs/InAppBrowserLoginNotPossible-DulwvV6c.js +1 -0
- package/dist/cjs/InstallWalletScreen-DGqXUqL5.js +1 -0
- package/dist/cjs/LandingScreen-DJnCYsej.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BCzS7Szr.js → LinkConflictScreen-CCpIoVFH.js} +2 -2
- package/dist/cjs/LinkEmailScreen-CbmbWy0A.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-o4qdrAL3.js → LinkPasskeyScreen-kbYgKEvh.js} +11 -11
- package/dist/cjs/LinkPhoneScreen-CPl7prX6.js +1 -0
- package/dist/cjs/LoginFailedScreen-B_S_MDGQ.js +1 -0
- package/dist/cjs/ManualTransferScreen-DRCNNQIx.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-DidF4v4i.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-CiIWaxe5.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-D9q7Pm2b.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-nhta_lwt.js +1 -0
- package/dist/cjs/{ModalHeader-C5O9gNUP.js → ModalHeader-MJIvqOQn.js} +1 -1
- package/dist/cjs/MoonpayStatusScreen-D4mvfrrO.js +16 -0
- package/dist/cjs/OAuthStatusScreen-BX78aDWF.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-Dc5VcXgD.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-C8zDLZtC.js +3 -0
- package/dist/cjs/PasswordRecoveryScreen-C-p9tQkF.js +20 -0
- package/dist/cjs/PrivyPluginContext-DsgaS6n9.js +1 -0
- package/dist/cjs/{QrCode-CLd3Ytk7.js → QrCode-CmGLmb4U.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-BEk1qz-9.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-kurEzKju.js +1 -0
- package/dist/cjs/{RecoverySelectionScreen-Bw9_M6y0.js → RecoverySelectionScreen-g3W6i8D1.js} +2 -2
- package/dist/cjs/{Screen-BSwlHqPg.js → Screen-Dl-2NR2R.js} +4 -5
- package/dist/cjs/{ScreenLayout-BtVIYAso.js → ScreenLayout-CZexjGvo.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-SUOUjBk4.js → SetAutomaticRecoveryScreen-5SOYfazO.js} +2 -2
- package/dist/cjs/{SetWalletPasswordForm-Gkq-DskE.js → SetWalletPasswordForm-CORYNAig.js} +3 -3
- package/dist/cjs/{SignRequestScreen-BNcy6yU_.js → SignRequestScreen-BDWDopt-.js} +2 -2
- package/dist/cjs/{StandardSignAndSendTransactionScreen-z_EUNaeD.js → StandardSignAndSendTransactionScreen-BxGI9yOT.js} +2 -2
- package/dist/cjs/TelegramAuthScreen-DQgQP8nT.js +1 -0
- package/dist/cjs/{TransactionDetails-DYow9ihU.js → TransactionDetails-B9vDqM-f.js} +4 -4
- package/dist/cjs/{TransactionErrorView-yUMJqqF2.js → TransactionErrorView-poVXJ4DK.js} +7 -7
- package/dist/cjs/{TransferFromWalletScreen-Duk7CEcq.js → TransferFromWalletScreen-B6W7ML55.js} +2 -2
- package/dist/cjs/{TransferOrBridgeLoadingScreen-DuBLyfE1.js → TransferOrBridgeLoadingScreen-DOaFBoVa.js} +2 -2
- package/dist/cjs/UpdateEmailScreen-P2vgr8MG.js +1 -0
- package/dist/cjs/UpdatePhoneScreen-C_Au2OyY.js +1 -0
- package/dist/cjs/UserLimitReachedScreen-BMwVWooZ.js +1 -0
- package/dist/cjs/{WalletInfoCard-CHEynRZS.js → WalletInfoCard-CPUWxQfs.js} +1 -1
- package/dist/cjs/WalletInterstitialScreen-R1cSmCDR.js +1 -0
- package/dist/cjs/{WalletLink-CZLtiI7E.js → WalletLink-DtgmIeIx.js} +1 -1
- package/dist/cjs/{WalletOverflowButton-FlgoA77a.js → WalletOverflowButton-_kpl5IST.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-BeSQM-Ma.js → context-BVLU-tYD.js} +1 -1
- package/dist/cjs/{ethers-XrYC9HG-.js → ethers-D6Dbymha.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/get-is-unified-wallet-CXggv1wa.js +1 -0
- package/dist/cjs/getEmbeddedConnectedWallet-C1vXXRY1.js +1 -0
- package/dist/cjs/getErc20Balance-CJvcxOe9.js +1 -0
- package/dist/cjs/{getErc20TokenInfo-DxDd_HN6.js → getErc20TokenInfo-DqY-nDYo.js} +1 -1
- package/dist/cjs/{index-0-2WrPDo.js → index-BF9t9wE_.js} +3 -3
- package/dist/cjs/index-Dq984Fi7.js +174 -0
- package/dist/cjs/{index-W2ZSukRW.js → index-DsvpCkrq.js} +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{shared-BcueHfN-.js → shared-2UXrNGgN.js} +6 -6
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-j6p9PEm-.js → shouldProceedtoEmbeddedWalletCreationFlow-wKHDOYL2.js} +1 -1
- package/dist/cjs/smart-wallets-NOwTquhw.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{styles-Csarwypj.js → styles-DC56SrYn.js} +4 -4
- package/dist/cjs/{to-ui-error-C4aac_aM.js → to-ui-error-B8N9wF4a.js} +2 -2
- package/dist/cjs/ui.js +14 -14
- package/dist/cjs/use-export-wallet-BmvX9OV-.js +1 -0
- package/dist/cjs/use-export-wallet-Bu1R636G.js +1 -0
- package/dist/cjs/{useActiveWallet-vlXeDPzp.js → useActiveWallet-C0_0HOZ9.js} +2 -2
- package/dist/cjs/{useGetTokenPrice-DJpJnTij.js → useGetTokenPrice-BqMAydh1.js} +1 -1
- package/dist/cjs/{useI18n-CnsBjm9v.js → useI18n-lYbeUUHb.js} +1 -1
- package/dist/cjs/usePrivy-DrdYrRZ_.js +1 -0
- package/dist/cjs/{useSolanaRpcClient-CYMWkK7E.js → useSolanaRpcClient-v9i37J6k.js} +1 -1
- package/dist/cjs/useWallets-D2MmNN1k.js +1 -0
- package/dist/cjs/{useWallets-DMyuB5aJ.js → useWallets-DHI-M9UM.js} +1 -1
- package/dist/dts/{events-context-DeukTtar.d.ts → events-context-CV9PiG6M.d.mts} +1 -1
- package/dist/dts/{events-context-DeukTtar.d.mts → events-context-CV9PiG6M.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 +58 -5
- package/dist/dts/index.d.ts +58 -5
- 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-FifkyCQc.d.mts → types-xIUh0rN4.d.mts} +43 -1
- package/dist/dts/{types-FifkyCQc.d.ts → types-xIUh0rN4.d.ts} +43 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-D87I7apb.mjs +1 -0
- package/dist/esm/{Address-QmAVCQtO.mjs → Address-DBfY9I-V.mjs} +2 -2
- package/dist/esm/AffirmativeConsentScreen-D16OZSmw.mjs +6 -0
- package/dist/esm/AllowlistRejectionScreen-JvRo0diS.mjs +1 -0
- package/dist/esm/AuthenticateWithWalletScreen-DDeFbi3u.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-D-G-QBXt.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-C2uzV8gi.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-C6ndKKq5.mjs +103 -0
- package/dist/esm/AwaitingSolToEvmBridgingScreen-DYYVMql3.mjs +2 -0
- package/dist/esm/{BridgeNetworkSelectionView-DQGcampg.mjs → BridgeNetworkSelectionView-Cjx8-IzN.mjs} +11 -11
- package/dist/esm/CaptchaScreen-CPAef6q_.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-5d3RVBO4.mjs +16 -0
- package/dist/esm/ConnectEmailForm-BPjeSmPk.mjs +3 -0
- package/dist/esm/ConnectLedgerScreen-BK_mUJJI.mjs +9 -0
- package/dist/esm/ConnectOnlyLandingScreen-qCRi3yCR.mjs +1 -0
- package/dist/esm/ConnectOnlyStatusScreen-DJtqyGSa.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-C5ZA94p5.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-BMtTIItD.mjs → ConnectPhoneForm-gCDafmIx.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-BMjEKo1_.mjs → ConnectWalletView-C4bswOSc.mjs} +4 -4
- package/dist/esm/ConnectionStatusScreen-Cl93wmJu.mjs +7 -0
- package/dist/esm/CrossAppAuthScreen-Cty8_Ahn.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-BlDfJaDr.mjs → CustomLandingScreenView-CtWV0s2_.mjs} +4 -4
- package/dist/esm/DelegatedActionsConsentScreen-DK0-n7eC.mjs +1 -0
- package/dist/esm/DelegatedActionsRevokeScreen-Bs63J15E.mjs +1 -0
- package/dist/esm/EmbeddedWalletConnectingScreen-CNakW1x5.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-BYKlkO28.mjs +1 -0
- package/dist/esm/EmbeddedWalletKeyExportScreen-CkjaBu62.mjs +40 -0
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-BAZWMs_z.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-BXI5GhNt.mjs +1 -0
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-8WX4n_ay.mjs +1 -0
- package/dist/esm/{EnrollTotp-DVLg14UT.mjs → EnrollTotp-CMppkqgm.mjs} +5 -5
- package/dist/esm/ErrorScreen-Big2etvs.mjs +4 -0
- package/dist/esm/{FarcasterConnectStatusScreen-CUO9DKCJ.mjs → FarcasterConnectStatusScreen-D7RZUwHm.mjs} +9 -9
- package/dist/esm/FarcasterSignerStatusScreen-CWuWkoF4.mjs +28 -0
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-QzSbA2oo.mjs +1 -0
- package/dist/esm/{FundWalletMethodHeader-PIxwFzzh.mjs → FundWalletMethodHeader-vji6aDSN.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-s9OZdLiy.mjs +1 -0
- package/dist/esm/FundingMethodSelectionScreen-BdEvfdJc.mjs +1 -0
- package/dist/esm/InAppBrowserLoginNotPossible-BDBIGEny.mjs +1 -0
- package/dist/esm/InstallWalletScreen-Dg9B6Qnm.mjs +1 -0
- package/dist/esm/LandingScreen-BVkfsda3.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-B94e_-2N.mjs → LinkConflictScreen-7xtZJDDB.mjs} +3 -3
- package/dist/esm/LinkEmailScreen-Yjqv2tgJ.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-DYfWSjKR.mjs → LinkPasskeyScreen-Dv9oGCVR.mjs} +1 -1
- package/dist/esm/LinkPhoneScreen-Cqf6I8DD.mjs +1 -0
- package/dist/esm/LoginFailedScreen-BWjivPRz.mjs +1 -0
- package/dist/esm/ManualTransferScreen-CmVkHC5K.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-x-7wkWPc.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-BCRn1A57.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-D9DED3dF.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-Cdu8dM2B.mjs +1 -0
- package/dist/esm/{ModalHeader-rCMpqA2a.mjs → ModalHeader-B7JiUyZG.mjs} +1 -1
- package/dist/esm/MoonpayStatusScreen-C42VxDI1.mjs +16 -0
- package/dist/esm/OAuthStatusScreen-BJoRrpcI.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-Dj1Z_dqZ.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-DgV-VxQU.mjs +3 -0
- package/dist/esm/PasswordRecoveryScreen-DLf3wdqx.mjs +20 -0
- package/dist/esm/PrivyPluginContext-2QN2dVUw.mjs +1 -0
- package/dist/esm/{QrCode-DjnQgnaZ.mjs → QrCode-D32W0rFB.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-DA0EIZSq.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DN3Xx4uG.mjs +1 -0
- package/dist/esm/RecoverySelectionScreen-8W7R6tWd.mjs +7 -0
- package/dist/esm/{Screen-CV2tt2Ap.mjs → Screen-DcqZvHom.mjs} +8 -9
- package/dist/esm/{ScreenLayout-DF3DCKOK.mjs → ScreenLayout-fGlkd51E.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-C6cFVbSx.mjs → SetAutomaticRecoveryScreen-CulFt8fI.mjs} +2 -2
- package/dist/esm/{SetWalletPasswordForm-ChA4tW4Y.mjs → SetWalletPasswordForm-DL7Siy6x.mjs} +4 -4
- package/dist/esm/SignRequestScreen-BpvOtDI4.mjs +26 -0
- package/dist/esm/{StandardSignAndSendTransactionScreen-D4OBsj5k.mjs → StandardSignAndSendTransactionScreen-C9ZKS0nz.mjs} +2 -2
- package/dist/esm/TelegramAuthScreen--uacrzGV.mjs +1 -0
- package/dist/esm/{TransactionDetails-BP142O9n.mjs → TransactionDetails-BJYUvpDT.mjs} +1 -1
- package/dist/esm/{TransactionErrorView-BwwGMqSj.mjs → TransactionErrorView-B0BIC9ro.mjs} +8 -8
- package/dist/esm/{TransferFromWalletScreen-BHH0YcI4.mjs → TransferFromWalletScreen-DrEg4Khy.mjs} +2 -2
- package/dist/esm/{TransferOrBridgeLoadingScreen-VLQTcf_6.mjs → TransferOrBridgeLoadingScreen-JVja_xjb.mjs} +1 -1
- package/dist/esm/UpdateEmailScreen-D_WM1VCn.mjs +1 -0
- package/dist/esm/UpdatePhoneScreen-ztnDFAV4.mjs +1 -0
- package/dist/esm/UserLimitReachedScreen-Bg0_GPm-.mjs +1 -0
- package/dist/esm/{WalletInfoCard-ChBHG5L5.mjs → WalletInfoCard-ClsfGrjn.mjs} +2 -2
- package/dist/esm/WalletInterstitialScreen-BIHDkMKZ.mjs +1 -0
- package/dist/esm/{WalletLink-CN4enmsE.mjs → WalletLink-BDeauVaR.mjs} +6 -6
- package/dist/esm/{WalletOverflowButton-B-nEN4GW.mjs → WalletOverflowButton-DMJ0BOTe.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-UVzNo7-f.mjs +1 -0
- package/dist/esm/{ethers-BQ45eiVv.mjs → ethers-DFsoKesJ.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/{get-is-unified-wallet-CNcx75Dp.mjs → get-is-unified-wallet-gEMK9zAN.mjs} +1 -1
- package/dist/esm/getEmbeddedConnectedWallet-pC2McXxQ.mjs +1 -0
- package/dist/esm/{getErc20Balance-DA4dGV9O.mjs → getErc20Balance-D0MGUaOw.mjs} +1 -1
- package/dist/esm/getErc20TokenInfo-CZJTqd4c.mjs +1 -0
- package/dist/esm/index-B2BfxLtd.mjs +174 -0
- package/dist/esm/{index-DoasOxbi.mjs → index-BwwizPYT.mjs} +1 -1
- package/dist/esm/{index-2knYP69D.mjs → index-njSRcD7r.mjs} +3 -3
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{shared-DwO5pr5t.mjs → shared-DEutgj0-.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs → shouldProceedtoEmbeddedWalletCreationFlow-DzY1kKF2.mjs} +1 -1
- package/dist/esm/smart-wallets-1REmVzqk.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{styles-BNn7MnP1.mjs → styles-B0ZcCJkO.mjs} +15 -15
- package/dist/esm/{to-ui-error-CCqAdorW.mjs → to-ui-error-EcEpo27f.mjs} +2 -2
- package/dist/esm/ui.mjs +40 -40
- package/dist/esm/use-export-wallet-BYgD16yE.mjs +1 -0
- package/dist/esm/use-export-wallet-aRKrQFFh.mjs +1 -0
- package/dist/esm/{useActiveWallet-RZ4w-uGq.mjs → useActiveWallet-BXJJRlvj.mjs} +2 -2
- package/dist/esm/{useGetTokenPrice-DERdsrmf.mjs → useGetTokenPrice-Dng0EqD0.mjs} +1 -1
- package/dist/esm/{useI18n-Dk9y58cU.mjs → useI18n-CnQzCQ4x.mjs} +1 -1
- package/dist/esm/usePrivy-Bfd0Mlrx.mjs +1 -0
- package/dist/esm/{useSolanaRpcClient-B7UDPdLi.mjs → useSolanaRpcClient-BW09SdSK.mjs} +1 -1
- package/dist/esm/{useWalletBalance-CRXiZUj2.mjs → useWalletBalance-BDrbQBDX.mjs} +1 -1
- package/dist/esm/useWallets-BZEdWBgc.mjs +1 -0
- package/dist/esm/{useWallets-DlGuNtGR.mjs → useWallets-DeRPXypD.mjs} +1 -1
- package/package.json +6 -6
- package/dist/cjs/AccountNotFoundScreen-BBWWze9O.js +0 -1
- package/dist/cjs/AffirmativeConsentScreen-CCwAwjH1.js +0 -6
- package/dist/cjs/AllowlistRejectionScreen-DEMYbzGA.js +0 -1
- package/dist/cjs/AuthenticateWithWalletScreen-dBvBC7MB.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-D9NwI47L.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-D_0NulpI.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-B4HAKL4-.js +0 -103
- package/dist/cjs/AwaitingSolToEvmBridgingScreen-CnuLLTC0.js +0 -2
- package/dist/cjs/CaptchaScreen-N-ueJQF3.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-06yaO6r4.js +0 -16
- package/dist/cjs/ConnectLedgerScreen-C7vGQocf.js +0 -9
- package/dist/cjs/ConnectOnlyLandingScreen-_9y9kOsT.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-mZHx4a7S.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Cp4uExOd.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-B27DUsGt.js +0 -7
- package/dist/cjs/CrossAppAuthScreen-BbLFbCdU.js +0 -1
- package/dist/cjs/DelegatedActionsConsentScreen-DzWruJOn.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-D-TwUXyj.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-CYav4Mjb.js +0 -1
- package/dist/cjs/EmbeddedWalletCreatedScreen-m0t_c_AA.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B5-JBZRJ.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CITAy3i6.js +0 -1
- package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DG5LKyjo.js +0 -1
- package/dist/cjs/ErrorScreen-xNDIVXx8.js +0 -4
- package/dist/cjs/FarcasterSignerStatusScreen-Cxoi54pp.js +0 -29
- package/dist/cjs/FundSolWalletWithExternalSolanaWallet-BCyBv_xe.js +0 -2
- package/dist/cjs/FundingEditAmountScreen-CDlb4Acx.js +0 -1
- package/dist/cjs/FundingMethodSelectionScreen-DlPxjsJq.js +0 -1
- package/dist/cjs/InAppBrowserLoginNotPossible-Bdx0vKyA.js +0 -1
- package/dist/cjs/InstallWalletScreen-Cshn01eK.js +0 -1
- package/dist/cjs/LandingScreen-0FdwpJ9w.js +0 -1
- package/dist/cjs/LinkEmailScreen-B7rxdQso.js +0 -1
- package/dist/cjs/LinkPhoneScreen-DweFqlM1.js +0 -1
- package/dist/cjs/LoginFailedScreen-mHcvCBEz.js +0 -1
- package/dist/cjs/ManualTransferScreen-CfYgtyLD.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-D631h0XW.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-BZ3IyqAd.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-_tNeX5lT.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-D_7nkuBq.js +0 -1
- package/dist/cjs/MoonpayStatusScreen-DoFbZ_0d.js +0 -16
- package/dist/cjs/OAuthStatusScreen-BZY7BiP5.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-C3k_ixTz.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-BX-SOBDr.js +0 -3
- package/dist/cjs/PasswordRecoveryScreen-VZQDtt5v.js +0 -20
- package/dist/cjs/RecoveryOAuthStatusScreen-DKYx6ECd.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-DP0xOBMA.js +0 -1
- package/dist/cjs/TelegramAuthScreen-DV8KYJMX.js +0 -1
- package/dist/cjs/UpdateEmailScreen-DRJv5CZs.js +0 -1
- package/dist/cjs/UpdatePhoneScreen-C3myqOv0.js +0 -1
- package/dist/cjs/UserLimitReachedScreen-l_e6Vhr0.js +0 -1
- package/dist/cjs/WalletInterstitialScreen-BgoDwKIp.js +0 -1
- package/dist/cjs/get-is-unified-wallet-BwdzQwn_.js +0 -1
- package/dist/cjs/getEmbeddedConnectedWallet-6TsVZJkD.js +0 -1
- package/dist/cjs/getErc20Balance-CN3JMVjF.js +0 -1
- package/dist/cjs/index-CzmnSRoa.js +0 -174
- package/dist/cjs/prepareFundingModalData-DDf6xLze.js +0 -1
- package/dist/cjs/smart-wallets-BBh3vgRq.js +0 -1
- package/dist/cjs/use-export-wallet-C9HWu0Dq.js +0 -1
- package/dist/cjs/usePrivy-Bx2PKTrU.js +0 -1
- package/dist/cjs/useWallets-BwB7ALB8.js +0 -1
- package/dist/esm/AccountNotFoundScreen-C6S8_GyN.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-QfJBfI_f.mjs +0 -6
- package/dist/esm/AllowlistRejectionScreen-CX57yv4U.mjs +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-CZJ-aWhZ.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-C1CMtT4Y.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-DX91STcF.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-BuExr50N.mjs +0 -103
- package/dist/esm/AwaitingSolToEvmBridgingScreen-Bm1i_2qW.mjs +0 -2
- package/dist/esm/CaptchaScreen-B-hFDb5f.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-OHm2RUBv.mjs +0 -16
- package/dist/esm/ConnectEmailForm-Df5OtmDR.mjs +0 -3
- package/dist/esm/ConnectLedgerScreen-BHLYW-F3.mjs +0 -9
- package/dist/esm/ConnectOnlyLandingScreen-C6nzEwpN.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-CremlXDY.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-262UvCdD.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-mk5beBL7.mjs +0 -7
- package/dist/esm/CrossAppAuthScreen-BXjEJQv6.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-ANmQe-9G.mjs +0 -1
- package/dist/esm/DelegatedActionsRevokeScreen-D9X7mWmI.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-2g-RrIvW.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-BXTAv4_-.mjs +0 -1
- package/dist/esm/EmbeddedWalletKeyExportScreen-DYVHVHOj.mjs +0 -40
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CYyMoMFF.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateScreen-oT5ZcPQV.mjs +0 -1
- package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BQcHDyuV.mjs +0 -1
- package/dist/esm/ErrorScreen-CLfeO5pd.mjs +0 -4
- package/dist/esm/FarcasterSignerStatusScreen-B135UOnV.mjs +0 -28
- package/dist/esm/FundSolWalletWithExternalSolanaWallet-DO3ttgom.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-BRQb2ffL.mjs +0 -1
- package/dist/esm/FundingMethodSelectionScreen-DTt1Z5RI.mjs +0 -1
- package/dist/esm/InAppBrowserLoginNotPossible-DH96QD2c.mjs +0 -1
- package/dist/esm/InstallWalletScreen-PnK6VfrP.mjs +0 -1
- package/dist/esm/LandingScreen-D_EvjOHf.mjs +0 -1
- package/dist/esm/LinkEmailScreen-CT8gAQr3.mjs +0 -1
- package/dist/esm/LinkPhoneScreen-ccrKA6tf.mjs +0 -1
- package/dist/esm/LoginFailedScreen-BwgxhbMf.mjs +0 -1
- package/dist/esm/ManualTransferScreen-DgCG2P3B.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-CNVUTOnE.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-2nvvFipu.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-DfnIqNNU.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-BwerwBz5.mjs +0 -1
- package/dist/esm/MoonpayStatusScreen-D5fRCEb3.mjs +0 -16
- package/dist/esm/OAuthStatusScreen-DtLgYw89.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-QoPhmagh.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-DzjU3ZVT.mjs +0 -3
- package/dist/esm/PasswordRecoveryScreen-LZYGRBkP.mjs +0 -20
- package/dist/esm/RecoveryOAuthStatusScreen-DKfp8Udh.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-D4DI5Bom.mjs +0 -1
- package/dist/esm/RecoverySelectionScreen-B2V3518x.mjs +0 -7
- package/dist/esm/SignRequestScreen-BslfKJ1N.mjs +0 -26
- package/dist/esm/TelegramAuthScreen-BJq5f_Rq.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-CMFBvYz5.mjs +0 -1
- package/dist/esm/UpdatePhoneScreen-DmhHcNq3.mjs +0 -1
- package/dist/esm/UserLimitReachedScreen-DNqgCf3B.mjs +0 -1
- package/dist/esm/WalletInterstitialScreen-RS89fm6t.mjs +0 -1
- package/dist/esm/context-LVpDfP2H.mjs +0 -1
- package/dist/esm/getEmbeddedConnectedWallet-CM6cDQCS.mjs +0 -1
- package/dist/esm/getErc20TokenInfo-CxatSwzi.mjs +0 -1
- package/dist/esm/index-DNz_w3-G.mjs +0 -174
- package/dist/esm/prepareFundingModalData-DjTxAoJ1.mjs +0 -1
- package/dist/esm/smart-wallets-9LKzbfWj.mjs +0 -1
- package/dist/esm/use-export-wallet-DllHf-2F.mjs +0 -1
- package/dist/esm/usePrivy-Dj52a5sp.mjs +0 -1
- package/dist/esm/useWallets-cSQYA-Jk.mjs +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@privy-io/js-sdk-core"),t=require("./internal-context-BJv4f_bO.js"),n=require("eventemitter3"),r=require("./context-BeSQM-Ma.js"),i=require("react/jsx-runtime");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=/*#__PURE__*/a(n);class s extends t.PrivyConnectorError{constructor(){super("Wallet timeout"),this.type="wallet_error"}}const l=e=>e instanceof t.PrivyConnectorError?e:e?.code?new d(e):new t.PrivyConnectorError("Unknown connector error",e);class c extends t.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){if(e.showPrompt)try{await this.promptConnection()}catch(e){if(0===this._wallet.accounts.length)throw new t.PrivyNoSolanaAccountsError;throw e}if(!await this.isConnected())throw new t.PrivyNoSolanaAccountsError;return await this.syncAccounts(),this.getConnectedWallet()}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:n,fundWalletConfig:r,methodScreen:i,chainIdOverride:a,comingFromSendTransactionScreen:o=!1,onComplete:s,onError:l})=>{let c,d;if(!n.fundingConfig)throw Error("Wallet funding is not enabled");let u=y(n.fundingConfig.options);if(u.length<1)throw Error("Wallet funding is not enabled");c=a||(r?.chain?r.chain.id:w(n.fundingConfig.defaultRecommendedCurrency.chain));let h=n.chains.find((e=>e.id===c));if(!h)throw new t.PrivyClientError(`Funding chain ${c} is not in PrivyProvider chains list`);let C=r?.amount??n.fundingConfig.defaultRecommendedAmount,p=!1;function A(){if(!c)return;let e=E[c];u.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."),d=e,p=!0}r&&"asset"in r?"USDC"===r.asset?A():"string"!=typeof r.asset&&"erc20"in r.asset&&(p=((e,t)=>e===E[t.id])(d=r.asset.erc20,h)):"USDC"===n.fundingConfig.defaultRecommendedCurrency.asset&&A();let f=r?.defaultFundingMethod;return{chainType:"ethereum",address:e,amount:C,chain:h,erc20Address:d,erc20ContractInfo:p?{symbol:"USDC",decimals:6}:void 0,isUSDC:p,methodScreen:i,supportedOptions:u,comingFromSendTransactionScreen:o,defaultFundingMethod:f,usingDefaultFundingMethod:!!f,preferredCardProvider:r?.card?.preferredProvider,crossChainBridgingEnabled:n.fundingConfig.crossChainBridgingEnabled??!1,solanaChain:"solana:mainnet",uiConfig:r&&"uiConfig"in r?r.uiConfig:void 0,externalSolanaFundingScreen:null,onComplete:s??(()=>{}),onError:l??(()=>{})}},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,onComplete:()=>{},onError:()=>{}}},exports.toSolanaWalletClientType=m,exports.u=C;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react"),t=require("viem"),r=require("./get-is-unified-wallet-BwdzQwn_.js"),n=require("./context-BeSQM-Ma.js"),a=require("./internal-context-BJv4f_bO.js"),i=require("./useWallets-DMyuB5aJ.js"),s=require("./getPublicClient-BsmZyCGX.js"),o=require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),l=require("permissionless"),c=require("permissionless/accounts"),d=require("permissionless/clients/pimlico"),u=require("viem/account-abstraction"),p=require("@privy-io/js-sdk-core");let y={address:u.entryPoint06Address,version:"0.6"},m={address:u.entryPoint07Address,version:"0.7"},g=({owner:e,smartWalletType:t,smartWalletVersion:r,publicClient:n})=>{switch(t){case p.SAFE:return c.toSafeSmartAccount({client:n,entryPoint:m,owners:[e],version:"1.4.1"});case p.KERNEL:return c.toKernelSmartAccount({client:n,version:"0.3.1",entryPoint:m,useMetaFactory:"optional",owners:[e]});case p.BICONOMY:return c.toBiconomySmartAccount({client:n,owners:[e],entryPoint:y});case p.LIGHT_ACCOUNT:return c.toLightSmartAccount({client:n,entryPoint:y,owner:e,version:"1.1.0"});case p.COINBASE_SMART_WALLET:return async function({client:e,owner:t,version:r}){let[n]=await t.request({method:"eth_accounts"});if(!n)throw Error("Unable to request embedded owner for eth_accounts");return await u.toCoinbaseSmartAccount({client:e,owners:[{type:"local",source:"privy",address:n,sign:async({hash:e})=>await t.request({method:"secp256k1_sign",params:[e]})}],version:r})}({client:n,owner:e,version:r??"1"});case p.THIRDWEB:return c.toThirdwebSmartAccount({client:n,entryPoint:m,owner:e});default:throw Error(`Invalid smart account type: ${t}.`)}};const h=({calls:e,chain:t,maxPriorityFeePerGas:r,maxFeePerGas:n,nonce:a})=>e.map((e=>({to:e.to||void 0,data:e.data,value:e.value,chainId:t.id,nonce:a,maxFeePerGas:n,maxPriorityFeePerGas:r}))),P=async({chain:e,paymasterContext:r,account:n,signer:i,user:o,smartWalletsConfig:c,rpcConfig:u,privyAppId:p})=>{if(!(c?.enabled&&o&&n&&i))return;let y=c?.configuredNetworks.find((t=>t.chainId===`eip155:${e.id}`));if(!y)throw new a.PrivyClientError(`The chain ${e.name} (eip155:${e.id}) must be configured in the smart wallet configuration in your dashboard`);let m=o.smartWallet?o.smartWallet.smartWalletType:c.smartWalletType,h=o.smartWallet?o.smartWallet.smartWalletVersion:c.smartWalletVersion,P=s.getJsonRpcEndpointFromChain(e,u,p),f=t.createPublicClient({chain:e,transport:t.http(P)}),w=r??y.paymasterContext,W=await(async({owner:e,smartWalletType:r,smartWalletVersion:n,chain:a,publicClient:i,bundlerUrl:s,paymasterUrl:o,paymasterContext:c})=>{let u=await g({owner:e,smartWalletType:r,publicClient:i,smartWalletVersion:n}),p=d.createPimlicoClient({transport:t.http(s),entryPoint:u.entryPoint}),y=o?d.createPimlicoClient({transport:t.http(o),entryPoint:u.entryPoint}):void 0;return l.createSmartAccountClient({account:u,chain:a,paymaster:y,paymasterContext:c,bundlerTransport:t.http(s),userOperation:{estimateFeesPerGas:async()=>{if(["public.pimlico.io","api.pimlico.io"].some((e=>s.includes(e))))return await p.getUserOperationGasPrice().then((e=>e.fast));if(["rpc.zerodev.app"].some((e=>s.includes(e))))return(await p.request({method:"zd_getUserOperationGasPrice",params:[]})).fast;if(["g.alchemy.com"].some((e=>s.includes(e)))){let[e,t]=await Promise.all([i.getBlock({blockTag:"latest"}),p.request({method:"rundler_maxPriorityFeePerGas",params:[]})]);if(!e.baseFeePerGas||!t)throw Error("Failed to get block or maxPriorityFeePerGasEstimate");return{maxFeePerGas:150n*e.baseFeePerGas/100n+BigInt(t.toString()),maxPriorityFeePerGas:BigInt(t.toString())}}{let e=await i.estimateFeesPerGas(),t=s.includes("api.developer.coinbase.com")?175n:150n;return{...e,maxFeePerGas:e.maxFeePerGas*t/100n,maxPriorityFeePerGas:e.maxPriorityFeePerGas*t/100n}}}}})})({owner:i,smartWalletType:m,smartWalletVersion:h,chain:e,publicClient:f,paymasterContext:w,...y});if(!W)throw new a.PrivyClientError(`Failed to create smart wallet client for chain ${e.name} (eip155:${e.id})`);return W};exports.callsToTransactionRequests=h,exports.getSmartWalletClient=P,exports.useSmartWalletsUIWrapper=()=>{let{hideWalletUIs:e,openPrivyModal:t,isHeadlessSigning:n}=a.usePrivyInternal(),{setModalData:s}=r.usePrivyModal(),{user:o}=r.usePrivyContext(),l=r.getPrivyEthereumWallet(o),c=!!l&&r.getIsUnifiedWallet(l);return{wrapSmartAccountClientWithUIs:r=>({...r,sendTransaction:async(a,d)=>{if(n({showWalletUIs:d?.uiOptions?.showWalletUIs}))return e.current=!0,await r.sendTransaction(a).finally((()=>e.current=!1));let u=[];"calls"in a&&void 0!==a.calls?u=[...a.calls]:"to"in a&&(u=[{to:a.to,value:a.value||BigInt(0),data:a.data||"0x"}]);let p=async()=>{if(!r.paymaster)return!1;let{paymasterData:e,paymasterAndData:t}=await r.prepareUserOperation({calls:u,maxFeePerGas:a.maxFeePerGas,maxPriorityFeePerGas:a.maxPriorityFeePerGas,nonce:a.nonce?BigInt(a.nonce):void 0});return Number(t??e??0)>0};return new Promise((async(n,y)=>{e.current=!0;let{entropyId:m,entropyIdVerifier:g}=i.getEntropyDetailsForUser(o);s({connectWallet:{recoveryMethod:l.recoveryMethod,connectingWalletAddress:l.address,isUnifiedWallet:c,entropyId:m,entropyIdVerifier:g,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:h({calls:u,chain:r.chain,maxPriorityFeePerGas:a.maxPriorityFeePerGas,maxFeePerGas:a.maxFeePerGas,nonce:a.nonce?BigInt(a.nonce):void 0}),transactingWalletIndex:0,transactingWalletAddress:r.account.address,entropyId:m,entropyIdVerifier:g,getIsSponsored:p,signOnly:!1,onConfirm:()=>r.sendTransaction(a),onSuccess:e=>n(e.hash),onFailure:y,uiOptions:d?.uiOptions??{}}}),t("EmbeddedWalletConnectingScreen")})).finally((()=>{e.current=!1}))},signMessage:async(a,d)=>n({showWalletUIs:d?.uiOptions?.showWalletUIs})?(e.current=!0,await r.signMessage(a).finally((()=>e.current=!1))):new Promise((async(n,u)=>{let{entropyId:p,entropyIdVerifier:y}=i.getEntropyDetailsForUser(o);e.current=!0,s({connectWallet:{recoveryMethod:l.recoveryMethod,connectingWalletAddress:l.address,isUnifiedWallet:c,entropyId:p,entropyIdVerifier:y,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof a.message?a.message:a.message.raw.toString(),confirmAndSign:()=>r.signMessage(a),onSuccess:e=>n(e),onFailure:u,uiOptions:d?.uiOptions??{}}}),t("EmbeddedWalletConnectingScreen")})).finally((()=>{e.current=!1})),signTypedData:async(a,d)=>n({showWalletUIs:d?.uiOptions?.showWalletUIs})?(e.current=!0,await r.signTypedData(a).finally((()=>e.current=!1))):new Promise((async(n,u)=>{e.current=!0;let{entropyId:p,entropyIdVerifier:y}=i.getEntropyDetailsForUser(o);s({connectWallet:{recoveryMethod:l.recoveryMethod,connectingWalletAddress:l.address,isUnifiedWallet:c,entropyId:p,entropyIdVerifier:y,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:a,confirmAndSign:()=>r.signTypedData(a),onSuccess:e=>n(e),onFailure:u,uiOptions:d?.uiOptions??{}}}),t("EmbeddedWalletConnectingScreen")})).finally((()=>{e.current=!1}))})}},exports.useSmartWalletsWrapper=({clientConfig:t,smartWalletsConfig:s})=>{let{hideWalletUIs:l,openPrivyModal:c,appId:d,isHeadlessSigning:u}=a.usePrivyInternal(),p=n.useAppConfig(),{setModalData:y}=r.usePrivyModal(),{user:m}=r.usePrivyContext(),{chains:g}=n.useAppConfig(),{chainId:f,clients:w,setChainId:W,chainIdState:I}=(()=>{let t=e.useRef(),[r,n]=e.useState();return{clients:e.useRef({}),setChainId:e=>{t.current=e,n(e)},chainId:t,chainIdState:r}})(),v=g.find((e=>e.id===I)),{wallets:C}=i.useWallets(),S=r.getPrivyEthereumWallet(m),F=o.getEmbeddedConnectedWalletWithAddress(C,S?.address),x=!!S&&r.getIsUnifiedWallet(S),T=e.useCallback((async()=>f.current),[f]),U=e.useCallback((async({id:e})=>{if(!w.current[e]){let r=await P({chain:g.find((t=>t.id===e)),account:S,signer:await(F?.getEthereumProvider()),user:m,paymasterContext:t?.paymasterContext,smartWalletsConfig:s,rpcConfig:p.rpcConfig,privyAppId:d});r&&(w.current[e]=r)}W(e)}),[g,t,C,m,s]);return{wrapSmartAccountClient:e=>{w.current[e.chain.id]=e,I||W(e.chain.id);return{...e,sendTransaction:async(e,t)=>{let r=w.current[f.current];if(!r)throw new a.PrivyClientError(`Smart wallet client for chain (eip155:${f.current}) not found`);if(delete e.account,u({showWalletUIs:t?.uiOptions?.showWalletUIs}))return l.current=!0,await r.sendTransaction(e).finally((()=>l.current=!1));let n=[];"calls"in e&&void 0!==e.calls?n=[...e.calls]:"to"in e&&(n=[{to:e.to,value:e.value||BigInt(0),data:e.data||"0x"}]);let s=async()=>{let{paymasterAndData:t,paymasterData:a,maxFeePerGas:i,maxPriorityFeePerGas:s}=await r.prepareUserOperation({calls:n,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0});return 0===Number(i)&&0===Number(s)||Number(t??a??0)>0};return new Promise((async(a,o)=>{l.current=!0;let{entropyId:d,entropyIdVerifier:u}=i.getEntropyDetailsForUser(m);y({connectWallet:{recoveryMethod:S.recoveryMethod,connectingWalletAddress:S.address,isUnifiedWallet:x,entropyId:d,entropyIdVerifier:u,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:h({calls:n,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),transactingWalletIndex:0,transactingWalletAddress:r.account.address,entropyId:d,entropyIdVerifier:u,getIsSponsored:s,signOnly:!1,onConfirm:()=>r.sendTransaction(e),onSuccess:e=>a(e.hash),onFailure:o,uiOptions:t?.uiOptions??{}}}),c("EmbeddedWalletConnectingScreen")})).finally((()=>{l.current=!1}))},signMessage:async(e,t)=>{let r=w.current[f.current];if(!r)throw new a.PrivyClientError(`Smart wallet client for chain (eip155:${f.current}) not found`);return u({showWalletUIs:t?.uiOptions?.showWalletUIs})?(l.current=!0,await r.signMessage(e).finally((()=>l.current=!1))):new Promise((async(n,a)=>{let{entropyId:s,entropyIdVerifier:o}=i.getEntropyDetailsForUser(m);l.current=!0,y({connectWallet:{recoveryMethod:S.recoveryMethod,connectingWalletAddress:S.address,isUnifiedWallet:x,entropyId:s,entropyIdVerifier:o,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"personal_sign",data:"string"==typeof e.message?e.message:e.message.raw.toString(),confirmAndSign:()=>r.signMessage(e),onSuccess:e=>n(e),onFailure:a,uiOptions:t?.uiOptions??{}}}),c("EmbeddedWalletConnectingScreen")})).finally((()=>{l.current=!1}))},signTypedData:async(e,t)=>{let r=w.current[f.current];if(!r)throw new a.PrivyClientError(`Smart wallet client for chain (eip155:${f.current}) not found`);return delete e.account,u({showWalletUIs:t?.uiOptions?.showWalletUIs})?(l.current=!0,await r.signTypedData(e).finally((()=>l.current=!1))):new Promise((async(n,a)=>{l.current=!0;let{entropyId:s,entropyIdVerifier:o}=i.getEntropyDetailsForUser(m);y({connectWallet:{recoveryMethod:S.recoveryMethod,connectingWalletAddress:S.address,isUnifiedWallet:x,entropyId:s,entropyIdVerifier:o,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>n(e),onFailure:a,uiOptions:t?.uiOptions??{}}}),c("EmbeddedWalletConnectingScreen")})).finally((()=>{l.current=!1}))},getChainId:T,chain:v,switchChain:U}}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./context-BeSQM-Ma.js"),t=require("./events-context-Di6--rDg.js"),n=require("./internal-context-BJv4f_bO.js"),r=require("./get-is-unified-wallet-BwdzQwn_.js"),a=require("./prepareFundingModalData-DDf6xLze.js"),i=require("react"),l=require("./useWallets-DMyuB5aJ.js");exports.useExportWallet=function(){let{user:t,getAccessToken:o}=r.usePrivyContext(),{walletProxy:d,openModal:s,client:u}=n.usePrivyInternal(),{setModalData:c}=r.usePrivyModal(),p=e.useAppConfig();return i.useMemo((()=>({exportWallet:e=>new Promise((async(i,y)=>{if(!t)return void y(new n.PrivyClientError("User must be authenticated before exporting their Privy wallet"));let f=e?.address?r.getPrivyWalletWithAddress(t,e.address):r.getPrivySolanaWallet(t);if(!f)return void y(new n.PrivyClientError("User must have an embedded wallet."));if(!a.isFirstClassChainWallet(f))return void y(Error(`Export is not supported for ${f.chainType} wallets`));let v=r.getIsUnifiedWallet(f),{entropyId:g,entropyIdVerifier:W}=l.getEntropyDetailsForUser(t,f);await o()?d?(c({connectWallet:{recoveryMethod:f.recoveryMethod,connectingWalletAddress:f.address,isUnifiedWallet:v,entropyId:g,entropyIdVerifier:W,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:y,shouldForceMFA:!0},keyExport:{appId:p.id,appClientId:p.appClientId,origin:u.apiUrl,address:f.address,entropyId:g,entropyIdVerifier:W,hdWalletIndex:f.walletIndex,chainType:f.chainType,walletId:f.id,isUnifiedWallet:v,imported:f.imported,onSuccess:i,onFailure:y}}),s("EmbeddedWalletConnectingScreen")):y(new n.PrivyClientError("Wallet not ready for export")):y(new n.PrivyClientError("Must have valid access token."))}))})),[t,o,d,s,u,c,p])},exports.useFundWallet=function(i){t.usePrivyEventSubscription("fundSolanaWallet",i);let l=e.useAppConfig(),{openModal:o}=n.usePrivyInternal(),{setModalData:d}=r.usePrivyModal();return{fundWallet:async({address:e,options:t})=>{let n=t?.amount||l.fundingConfig?.defaultRecommendedAmount||"1",r=t?.asset||l.fundingConfig?.defaultRecommendedCurrency.asset||"native-currency",i=t?.chain||"solana:mainnet";d({funding:a.prepareSolanaFundingModalData({address:e,appConfig:l,methodScreen:"FundingMethodSelectionScreen",fundWalletConfig:{...t,amount:n,asset:r,chain:i},externalSolanaFundingScreen:"FundSolWalletWithExternalSolanaWallet"}),solanaFundingData:{amount:n,asset:"native-currency"===r?"SOL":"USDC",chain:i,destinationAddress:e,sourceWalletData:void 0}}),o("FundingMethodSelectionScreen")}}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("react-device-detect"),r=require("./internal-context-BJv4f_bO.js"),t=require("react/jsx-runtime"),n=require("react"),o=require("./get-is-unified-wallet-BwdzQwn_.js"),a=require("./events-context-Di6--rDg.js"),i=require("@privy-io/js-sdk-core"),l=require("./useWallets-DMyuB5aJ.js"),s=require("./context-BeSQM-Ma.js");function d(e){return{name:e.metadata?.shortName||e.name||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}let c="WALLETCONNECT_DEEPLINK_CHOICE";function u(e){return e.startsWith("http://")||e.startsWith("https://")}function p(e,r){if(u(e))return y(e,r);let t=e;return t.includes("://")||(t=e.replaceAll("/","").replaceAll(":",""),t=`${t}://`),t.endsWith("/")||(t=`${t}/`),{redirect:`${t}wc?uri=${encodeURIComponent(r)}`,href:t}}function y(e,r){if(!u(e))return p(e,r);let t=e;return t.endsWith("/")||(t=`${t}/`),{redirect:`${t}wc?uri=${encodeURIComponent(r)}`,href:t}}let E=/*#__PURE__*/n.createContext({plugins:{current:{}}});const v=Symbol("solana-funding-plugin"),h=Symbol("solana-ledger-plugin"),w=(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)))??[],m=async({user:e,accessToken:r,proxy:t,refreshSessionAndUser:n,privy:a,appConfig:s,recoverEmbeddedWallet:d,setUser:c,walletIndex:u,chainType:p,recoveryMethod:y,recoveryPassword:E,recoveryAccessToken:v,idempotencyKey:h})=>{if(0===u)if("user-controlled-server-wallets-only"===s.embeddedWallets.mode)await i.create(a,{request:{chain_type:p},headers:h?{"privy-idempotency-key":h}:void 0});else if("ethereum"===p){let n=o.getPrivySolanaWallet(e);n&&await d({address:n.address}),await t.create({accessToken:r,solanaAddress:n?.address,recoveryMethod:y,recoveryPassword:E,recoveryAccessToken:v})}else{if("solana"!==p)throw Error("Invalid input to create wallet");{let n=o.getPrivyEthereumWallet(e);n&&await d({address:n.address}),await t.createSolana({accessToken:r,ethereumAddress:n?.address,recoveryMethod:y,recoveryPassword:E,recoveryAccessToken:v})}}else if("user-controlled-server-wallets-only"===s.embeddedWallets.mode)await i.create(a,{request:{chain_type:p}});else{let{entropyId:n,entropyIdVerifier:o}=l.getEntropyDetailsForUser(e);await d(),await t.addWallet({accessToken:r,entropyId:n,entropyIdVerifier:o,chainType:p,hdWalletIndex:u})}let m=await n(),f=w(m,{chainType:p,walletIndex:u})[0];return c(m),{user:m,account:f}},f=e=>e.reduce(((e,r)=>!e||e.walletIndex<r.walletIndex?r:e),null);let W=async({accessToken:e,appConfig:t,privy:n,emitPrivyEvent:a,proxy:i,refreshSessionAndUser:l,recoverEmbeddedWallet:s,user:d,walletIndex:c,setModalData:u,openModal:p,chainType:y,setUser:E,idempotencyKey:v})=>{if(c<0)throw a("createWallet","onError",r.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${c}) is invalid.`);let h=o.getPrivyPrimaryWallet(d);if(c>0&&!h)throw a("createWallet","onError",r.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND),Error("Must have an existing embedded wallet to create an additional wallet.");if(t.embeddedWallets.requireUserOwnedRecoveryOnCreate&&"user-controlled-server-wallets-only"===t.embeddedWallets.mode)throw a("createWallet","onError",r.PrivyErrorCode.EMBEDDED_WALLET_CREATE_ERROR),Error("User owned recovery not yet supported for this app.");if(!h&&t.embeddedWallets.requireUserOwnedRecoveryOnCreate)return await T({emitPrivyEvent:a,setModalData:u,openModal:p,chainType:y});let f=w(d,{chainType:y,walletIndex:c})[0];if(f)return{user:d,account:f};if(0===c&&!i)return T({emitPrivyEvent:a,setModalData:u,openModal:p,chainType:y});if(!i)throw a("createWallet","onError",r.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");return m({appConfig:t,walletIndex:c,chainType:y,user:d,accessToken:e,proxy:i,refreshSessionAndUser:l,privy:n,recoverEmbeddedWallet:s,setUser:E,idempotencyKey:v})},T=async({emitPrivyEvent:e,setModalData:t,openModal:n,chainType:o})=>new Promise(((a,i)=>{t({createWallet:{onSuccess:({user:r,account:t})=>{e("createWallet","onSuccess",{wallet:t}),a({user:r,account:t})},onFailure:t=>{e("createWallet","onError",r.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),i(t)},callAuthOnSuccessOnClose:!1,shouldCreateEth:"ethereum"===o,shouldCreateSol:"solana"===o}}),n("EmbeddedWalletOnAccountCreateScreen")}));const A=()=>{let e=s.useAppConfig(),t=a.useEmitPrivyEvent(),{setModalData:n}=o.usePrivyModal(),{initializeWalletProxy:i,recoverEmbeddedWallet:l,setUser:d,openModal:c,refreshSessionAndUser:u,privy:p,client:y}=r.usePrivyInternal();return{create:async({chainType:o,options:a,latestUser:E,idempotencyKey:v})=>{let h=E;if(h||(h=await u()),!h)throw t("createWallet","onError",r.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return await(async({appConfig:e,getAccessToken:t,initializeWalletProxy:n,user:o,privy:a,emitPrivyEvent:i,recoverEmbeddedWallet:l,setModalData:s,openModal:d,setUser:c,options:u,timeoutDuration:p,refreshSessionAndUser:y,chainType:E,idempotencyKey:v})=>{let[h,m]=await Promise.all([n(p),t()]);if(!m||!o)throw i("createWallet","onError",r.PrivyErrorCode.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");if(!h&&e.customAuth?.enabled)throw i("createWallet","onError",r.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(u&&"walletIndex"in u&&"number"==typeof u.walletIndex){if("user-controlled-server-wallets-only"===e.embeddedWallets.mode)throw i("createWallet","onError",r.PrivyErrorCode.INVALID_DATA),Error("Invalid input, use `createAdditional` instead of `walletIndex` to create additional wallets.");return W({accessToken:m,appConfig:e,privy:a,emitPrivyEvent:i,openModal:d,proxy:h,refreshSessionAndUser:y,recoverEmbeddedWallet:l,setModalData:s,user:o,walletIndex:u.walletIndex,chainType:E,setUser:c})}let T=u&&"createAdditional"in u&&u.createAdditional,A=w(o,{chainType:E});if(A[0]&&!T)throw i("createWallet","onError",r.PrivyErrorCode.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");return W({accessToken:m,appConfig:e,privy:a,emitPrivyEvent:i,openModal:d,proxy:h,recoverEmbeddedWallet:l,setModalData:s,user:o,walletIndex:(f(A)?.walletIndex??-1)+1,chainType:E,refreshSessionAndUser:y,setUser:c,idempotencyKey:v})})({appConfig:e,privy:p,getAccessToken:()=>y.getAccessToken(),refreshSessionAndUser:u,initializeWalletProxy:i,user:h,emitPrivyEvent:t,recoverEmbeddedWallet:l,setModalData:n,openModal:c,setUser:d,options:a,timeoutDuration:s.WALLET_PROXY_TIMEOUT,chainType:o,idempotencyKey:v})}}};function P(e){let{create:r}=A();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 x=async({emitPrivyEvent:e,getAccessToken:t,initializeWalletProxy:n,refreshSessionAndUser:a,user:i,appConfig:l},{privateKey:s,chainType:d,additionalSigners:c})=>{if(!i)throw e("linkAccount","onError",r.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new r.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 r.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[p,y]=await Promise.all([t(),n(15e3)]);if(!y||!p)throw e("linkAccount","onError",r.PrivyErrorCode.MUST_BE_AUTHENTICATED,{linkMethod:"siwe"}),new r.PrivyClientError("User must be authenticated before linking an account.");let{address:E}=await y.importWallet({privateKey:s,accessToken:p,chainType:d,mode:u,additionalSigners:c}),v=await a(),h="solana"===d?o.getImportedPrivySolanaWallets(v):o.getImportedPrivyEthereumWallets(v),w=h?.find((e=>e.address===E));if(!w)throw e("createWallet","onError",r.PrivyErrorCode.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to import wallet");return e("createWallet","onSuccess",{wallet:w}),w},g=()=>{let{user:e}=o.usePrivyContext(),{client:t,refreshSessionAndUser:i,initializeWalletProxy:l}=r.usePrivyInternal(),d=a.useEmitPrivyEvent(),c=s.useAppConfig();return{importWallet:n.useCallback((({privateKey:r,additionalSigners:n})=>x({getAccessToken:()=>t.getAccessToken(),user:e,initializeWalletProxy:l,refreshSessionAndUser:i,emitPrivyEvent:d,appConfig:c},{privateKey:r,chainType:"ethereum",additionalSigners:n})),[e,t,i,l,d,c])}};exports.PrivyPluginProvider=({children:e})=>{let r=n.useRef({});/*#__PURE__*/return t.jsx(E.Provider,{value:{plugins:r},children:e})},exports.SOLANA_FUNDING_PLUGIN_ID=v,exports.SOLANA_LEDGER_PLUGIN_ID=h,exports.buildTargetUrl=function(t,n){let o=d(n);if(e.isMobile&&o.universalLink)return y(o.universalLink,t);if(o.deepLink)return p(o.deepLink,t);if(o.universalLink)return y(o.universalLink,t);throw new r.PrivyClientError(`Unsupported wallet ${n.id}`)},exports.buildUniversalFallbackUrl=function(e,r){let t=d(r);if(t.universalLink)return y(t.universalLink,e)},exports.createWalletAtIndex=m,exports.deleteWalletConnectDeepLink=function(){try{localStorage.removeItem(c)}catch{}},exports.importWallet=x,exports.openHref=function(e,r){window.open(e,r,"noreferrer noopener")},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.removeWalletConnectDeepLink=function(){try{localStorage.removeItem(c)}catch{}},exports.setWalletConnectDeepLink=function({href:e,name:r}){try{localStorage.setItem(c,JSON.stringify({href:e,name:r}))}catch{}},exports.useCreateWallet=P,exports.useCreateWalletInternal=A,exports.useImportWallet=g,exports.usePlugins=()=>{let{plugins:e}=n.useContext(E);return n.useCallback((r=>e.current[r]),[e])},exports.usePrivy=()=>{let{importWallet:e}=g(),{createWallet:r}=P();return{...n.useContext(o.PrivyContext),importWallet:e,createWallet:r}},exports.useRegisterPlugin=(...e)=>{let{plugins:r}=n.useContext(E);n.useEffect((()=>{for(let t of e)r.current[t.id]=t;return()=>{for(let t of e)delete r.current[t.id]}}),[r])};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@solana/kit"),t=require("react"),n=require("@privy-io/js-sdk-core"),i=require("./internal-context-BJv4f_bO.js"),s=require("./get-is-unified-wallet-BwdzQwn_.js"),a=require("./usePrivy-Bx2PKTrU.js"),r=require("./useWallets-DMyuB5aJ.js"),o=require("eventemitter3"),l=require("@scure/base"),d=require("./context-BeSQM-Ma.js"),c=require("./use-sign-with-user-signer-Cu_6Bx7m.js"),u=require("./prepareFundingModalData-DDf6xLze.js"),g=require("./useSolanaRpcClient-CYMWkK7E.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var p=/*#__PURE__*/h(n),y=/*#__PURE__*/h(o);const f=["solana:mainnet","solana:devnet","solana:testnet"];function v(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var A=0,w="__private_"+A+++"__implementation";class E extends y.default{setImplementation(e){v(this,w)[w]=e}async signMessage(e){return v(this,w)[w].signMessage(e)}async signAndSendTransaction(e){return v(this,w)[w].signAndSendTransaction(e)}async signTransaction(e){return v(this,w)[w].signTransaction(e)}constructor(e){super(),Object.defineProperty(this,w,{writable:!0,value:void 0}),v(this,w)[w]=e}}function T(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var b=0;function m(e){return"__private_"+b+++"_"+e}var S=/*#__PURE__*/m("_address"),P=/*#__PURE__*/m("_publicKey"),I=/*#__PURE__*/m("_chains"),O=/*#__PURE__*/m("_features"),W=/*#__PURE__*/m("_label"),C=/*#__PURE__*/m("_icon");class _{get address(){return T(this,S)[S]}get publicKey(){return T(this,P)[P].slice()}get chains(){return T(this,I)[I].slice()}get features(){return T(this,O)[O].slice()}get label(){return T(this,W)[W]}get icon(){return T(this,C)[C]}constructor({address:e,publicKey:t,label:n,icon:i}){Object.defineProperty(this,S,{writable:!0,value:void 0}),Object.defineProperty(this,P,{writable:!0,value:void 0}),Object.defineProperty(this,I,{writable:!0,value:void 0}),Object.defineProperty(this,O,{writable:!0,value:void 0}),Object.defineProperty(this,W,{writable:!0,value:void 0}),Object.defineProperty(this,C,{writable:!0,value:void 0}),T(this,S)[S]=e,T(this,P)[P]=t,T(this,I)[I]=f,T(this,W)[W]=n,T(this,C)[C]=i,T(this,O)[O]=["solana:signAndSendTransaction","solana:signTransaction","solana:signMessage"],new.target===_&&Object.freeze(this)}}function M(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var F=0;function j(e){return"__private_"+F+++"_"+e}var U=/*#__PURE__*/j("_listeners"),D=/*#__PURE__*/j("_version"),N=/*#__PURE__*/j("_name"),B=/*#__PURE__*/j("_icon"),x=/*#__PURE__*/j("_injection"),R=/*#__PURE__*/j("_isPrivyWallet"),L=/*#__PURE__*/j("_accounts"),V=/*#__PURE__*/j("_on"),q=/*#__PURE__*/j("_emit"),Q=/*#__PURE__*/j("_off"),G=/*#__PURE__*/j("_connected"),H=/*#__PURE__*/j("_connect"),K=/*#__PURE__*/j("_disconnect"),J=/*#__PURE__*/j("_signMessage"),Y=/*#__PURE__*/j("_signAndSendTransaction"),k=/*#__PURE__*/j("_signTransaction");function Z(e,...t){M(this,U)[U][e]?.forEach((e=>e.apply(null,t)))}function z(e,t){M(this,U)[U][e]=M(this,U)[U][e]?.filter((e=>t!==e))}function X(t,n,i){let s=structuredClone(e.getTransactionDecoder().decode(t)),a=e.address(n);return a in s.signatures&&(s.signatures[a]=i),new Uint8Array(e.getTransactionEncoder().encode(s))}function $(){let{isHeadlessSigning:e,walletProxy:t,initializeWalletProxy:o,recoverEmbeddedWallet:l,openModal:d,privy:u,client:h}=i.usePrivyInternal(),{user:p}=a.usePrivy(),{setModalData:y}=s.usePrivyModal(),{signWithUserSigner:f}=c.useSignWithUserSigner();return{signMessage:({message:a,address:c,options:v})=>new Promise((async(A,w)=>{let E=s.getPrivyWalletWithAddress(p,c);if("privy"!==E?.walletClientType)return void w(new i.PrivyClientError("Wallet is not a Privy wallet",void 0,i.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND));let{entropyId:T,entropyIdVerifier:b}=r.getEntropyDetailsForUser(p,E),m=s.getIsUnifiedWallet(E),S=g.bufferFrom(a).toString("base64");if(S.length<1)return void w(new i.PrivyClientError("Message must be a non-empty string",void 0,i.PrivyErrorCode.INVALID_MESSAGE));let P=async()=>{let e;if(!p)throw Error("User must be authenticated before signing with a Privy wallet");let i=await h.getAccessToken();if(!i)throw Error("User must be authenticated to use their embedded wallet.");let s=t??await o(15e3);if(!s)throw Error("Failed to initialize embedded wallet proxy.");if(!await l({address:E.address}))throw Error("Unable to connect to wallet");if(m){let t=await n.rpc(u,f,{chain_type:"solana",method:"signMessage",params:{message:S,encoding:"base64"},wallet_id:E.id});if(!t.data||!("signature"in t.data))throw Error("Failed to sign message");e=t.data.signature}else{let{response:t}=await s.rpc({accessToken:i,entropyId:T,entropyIdVerifier:b,chainType:"solana",hdWalletIndex:E.walletIndex??0,requesterAppId:v?.uiOptions?.requesterAppId,request:{method:"signMessage",params:{message:S}}});e=t.data.signature}return e};if(e({showWalletUIs:v?.uiOptions?.showWalletUIs}))try{let e=await P(),t=new Uint8Array(g.bufferFrom(e,"base64"));A({signature:t})}catch(e){w(e)}else y({signMessage:{method:"solana_signMessage",data:S,confirmAndSign:P,onSuccess:e=>{A({signature:new Uint8Array(g.bufferFrom(e,"base64"))})},onFailure:e=>{w(e)},uiOptions:v?.uiOptions??{}},connectWallet:{recoveryMethod:E.recoveryMethod,connectingWalletAddress:E.address,entropyId:T,entropyIdVerifier:b,isUnifiedWallet:m,onCompleteNavigateTo:"SignRequestScreen",onFailure:e=>{w(new i.PrivyClientError("Failed to connect to wallet",e,i.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR))}}}),d("EmbeddedWalletConnectingScreen")}))}}function ee(){let{isHeadlessSigning:e,openModal:t}=i.usePrivyInternal(),{setModalData:n}=s.usePrivyModal(),{signMessage:o}=$(),{user:l}=a.usePrivy();return{signTransaction:async({transaction:a,options:d,chain:c="solana:mainnet",address:u})=>{async function h(e){let{signature:t}=await o({message:g.getTransactionMessageBytes(e),address:u,options:{...d,uiOptions:{...d?.uiOptions,showWalletUIs:!1}}});return{signedTransaction:X(e,u,t)}}return e({showWalletUIs:d?.uiOptions?.showWalletUIs})?h(a):new Promise((async(e,o)=>{let g=s.getPrivyWalletWithAddress(l,u);if("privy"!==g?.walletClientType)return void o(new i.PrivyClientError("Wallet is not a Privy wallet",void 0,i.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND));let{entropyId:p,entropyIdVerifier:y}=r.getEntropyDetailsForUser(l,g),f=s.getIsUnifiedWallet(g);function v(e){return t=>{t instanceof i.PrivyClientError?o(t):o(new i.PrivyClientError("Failed to connect to wallet",t,e))}}let A={account:g,transaction:a,chain:c,signOnly:!0,uiOptions:d?.uiOptions||{},onConfirm:h,onSuccess:e,onFailure:v(i.PrivyErrorCode.TRANSACTION_FAILURE)};n({connectWallet:{recoveryMethod:g.recoveryMethod,connectingWalletAddress:g.address,entropyId:p,entropyIdVerifier:y,isUnifiedWallet:f,onCompleteNavigateTo:"StandardSignAndSendTransactionScreen",onFailure:v(i.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR)},standardSignAndSendTransaction:A}),t("EmbeddedWalletConnectingScreen")}))}}}let te=new E({signTransaction:i.notImplementedWithMessage("signTransaction was not injected"),signAndSendTransaction:i.notImplementedWithMessage("signAndSendTransaction was not injected"),signMessage:i.notImplementedWithMessage("signMessage was not injected")}),ne=new class{get version(){return M(this,D)[D]}get name(){return M(this,N)[N]}get icon(){return M(this,B)[B]}get chains(){return f.slice()}get features(){return{"standard:connect":{version:"1.0.0",connect:M(this,H)[H]},"standard:disconnect":{version:"1.0.0",disconnect:M(this,K)[K]},"standard:events":{version:"1.0.0",on:M(this,V)[V]},"solana:signAndSendTransaction":{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:M(this,Y)[Y]},"solana:signTransaction":{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:M(this,k)[k]},"solana:signMessage":{version:"1.0.0",signMessage:M(this,J)[J]},"privy:":{privy:{signMessage:M(this,x)[x].signMessage,signTransaction:M(this,x)[x].signTransaction,signAndSendTransaction:M(this,x)[x].signAndSendTransaction}}}}get accounts(){return M(this,L)[L].slice()}get isPrivyWallet(){return M(this,R)[R]}constructor({name:e,icon:t,version:n,injection:i,wallets:s}){Object.defineProperty(this,q,{value:Z}),Object.defineProperty(this,Q,{value:z}),Object.defineProperty(this,U,{writable:!0,value:void 0}),Object.defineProperty(this,D,{writable:!0,value:void 0}),Object.defineProperty(this,N,{writable:!0,value:void 0}),Object.defineProperty(this,B,{writable:!0,value:void 0}),Object.defineProperty(this,x,{writable:!0,value:void 0}),Object.defineProperty(this,R,{writable:!0,value:void 0}),Object.defineProperty(this,L,{writable:!0,value:void 0}),Object.defineProperty(this,V,{writable:!0,value:void 0}),Object.defineProperty(this,G,{writable:!0,value:void 0}),Object.defineProperty(this,H,{writable:!0,value:void 0}),Object.defineProperty(this,K,{writable:!0,value:void 0}),Object.defineProperty(this,J,{writable:!0,value:void 0}),Object.defineProperty(this,Y,{writable:!0,value:void 0}),Object.defineProperty(this,k,{writable:!0,value:void 0}),M(this,U)[U]={},M(this,V)[V]=(e,t)=>(M(this,U)[U][e]?.push(t)||(M(this,U)[U][e]=[t]),()=>M(this,Q)[Q](e,t)),M(this,G)[G]=e=>{null!=e&&(M(this,L)[L]=e.map((({address:e})=>new _({address:e,publicKey:l.base58.decode(e)})))),M(this,q)[q]("change",{accounts:this.accounts})},M(this,H)[H]=async()=>(M(this,q)[q]("change",{accounts:this.accounts}),{accounts:this.accounts}),M(this,K)[K]=async()=>{M(this,q)[q]("change",{accounts:this.accounts})},M(this,J)[J]=async(...e)=>{let t=[];for(let{account:n,...i}of e){let{signature:e}=await M(this,x)[x].signMessage({...i,address:n.address});t.push({signedMessage:i.message,signature:e})}return t},M(this,Y)[Y]=async(...e)=>{let t=[];for(let n of e){let{signature:e}=await M(this,x)[x].signAndSendTransaction({...n,transaction:n.transaction,address:n.account.address,chain:n.chain||"solana:mainnet",options:n.options});t.push({signature:e})}return t},M(this,k)[k]=async(...e)=>{let t=[];for(let{transaction:n,account:i,options:s,chain:a}of e){let{signedTransaction:e}=await M(this,x)[x].signTransaction({transaction:n,address:i.address,chain:a||"solana:mainnet",options:s});t.push({signedTransaction:e})}return t},M(this,N)[N]=e,M(this,B)[B]=t,M(this,D)[D]=n,M(this,x)[x]=i,M(this,L)[L]=[],M(this,R)[R]=!0,i.on("accountChanged",M(this,G)[G],this),M(this,G)[G](s)}}({name:"Privy",version:"1.0.0",icon:"data:image/png;base64,AAABAAEAFBQAAAAAIABlAQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAUAAAAFAgGAAAAjYkdDQAAAAlwSFlzAAAOwwAADsMBx2+oZAAAAQVJREFUeJxiYMANZIC4E4ivAPFPIP4FxDeAuB+IlfDowwBMQFwJxF+B+D8O/AOI66Bq8QJGIF6ExyB0vAqImfEZmEeCYTDcgMswPiB+T4aB34FYApuBsWQYBsP52AycToGBK7EZuJECAw9jM3AVBQbuwWZgIwUGTsZmoDkFBnpiMxAEjpJh2FV8iVsbiD+TYBgoDVrgMgwGnID4HRGGgTKBGyHDYEAaiBdCSxh0g/5AU4Q8sYYhAzEgjoGmABBOgFo2eACowFABYn0oVgViAVINkQTiZUD8DIj/ATF6GILEXgLxCiCWIsZAbiAuBeKtQHwHiEHJ6C8UfwHie0C8E4jLoWpRAAAAAP//rcbhsQAAAAZJREFUAwBYFs3VKJ0cuQAAAABJRU5ErkJggg==",wallets:[],injection:te});function ie(){let{ready:e}=r.useWallets(),{user:o}=a.usePrivy(),{signMessage:h}=$(),{signTransaction:y}=ee(),{signAndSendTransaction:f}=function(){let e=d.useAppConfig(),{isHeadlessSigning:t,openModal:o}=i.usePrivyInternal(),{setModalData:h}=s.usePrivyModal(),{signTransaction:y}=ee(),f=g.useSolanaRpcClient(),{user:v}=a.usePrivy(),{signWithUserSigner:A}=c.useSignWithUserSigner();return{signAndSendTransaction:async({transaction:a,address:d,chain:c="solana:mainnet",options:w})=>{let E=s.getPrivyWalletWithAddress(v,d);if("privy"!==E?.walletClientType)throw new i.PrivyClientError("Wallet is not a Privy wallet",void 0,i.PrivyErrorCode.EMBEDDED_WALLET_NOT_FOUND);let T=s.getIsUnifiedWallet(E);async function b(t){if(w?.sponsor)return await(async t=>{if(!T)throw new i.PrivyClientError("Sponsoring transactions is only supported for wallets on the TEE stack",i.PrivyErrorCode.INVALID_DATA);let s=new p.default({appId:e.id,clientId:e.appClientId,storage:u.u}),a=await n.rpc(s,A,{chain_type:"solana",method:"signAndSendTransaction",sponsor:!0,params:{transaction:g.bufferFrom(t).toString("base64"),encoding:"base64"},caip2:`solana:${(await f(c).rpc.getGenesisHash().send()).substring(0,32)}`,wallet_id:E.id});if(a.data&&"hash"in a.data)return{signature:l.base58.decode(a.data.hash)};throw Error("Failed to sign and send transaction")})(t);let{signedTransaction:s}=await y({transaction:t,address:d,chain:c,options:{...w,uiOptions:{...w?.uiOptions,showWalletUIs:!1}}}),{signature:a}=await f(c).sendAndConfirmTransaction(s);return{signature:a}}return t({showWalletUIs:w?.uiOptions?.showWalletUIs})?b(a):new Promise((async(t,n)=>{let s,l,{entropyId:g,entropyIdVerifier:p}=r.getEntropyDetailsForUser(v,E);function y(e){return t=>{t instanceof i.PrivyClientError?n(t):n(new i.PrivyClientError("Failed to connect to wallet",t,e))}}let f={account:E,transaction:a,chain:c,signOnly:!1,uiOptions:w?.uiOptions||{},onConfirm:b,onSuccess:t,onFailure:y(i.PrivyErrorCode.TRANSACTION_FAILURE),isSponsored:!!w?.sponsor},A={recoveryMethod:E.recoveryMethod,connectingWalletAddress:E.address,entropyId:g,entropyIdVerifier:p,isUnifiedWallet:T,onCompleteNavigateTo:"StandardSignAndSendTransactionScreen",onFailure:y(i.PrivyErrorCode.UNKNOWN_CONNECT_WALLET_ERROR)};e.fundingConfig&&(s=u.prepareSolanaFundingModalData({address:d,appConfig:e,methodScreen:"FundingMethodSelectionScreen",fundWalletConfig:{...w,asset:"native-currency",chain:c},externalSolanaFundingScreen:"FundSolWalletWithExternalSolanaWallet"}),l={amount:e.fundingConfig.defaultRecommendedAmount,asset:"SOL",chain:c,destinationAddress:d,afterSuccessScreen:"StandardSignAndSendTransactionScreen",sourceWalletData:void 0}),h({connectWallet:A,standardSignAndSendTransaction:f,funding:s,solanaFundingData:l}),o("EmbeddedWalletConnectingScreen")}))}}}(),v=t.useMemo((()=>{let e=[...s.getPrivySolanaHDWallets(o).sort(((e,t)=>(e.walletIndex??0)-(t.walletIndex??0)))],t=s.getImportedPrivySolanaWallets(o);return t.length?[...e,...t]:e}),[o]),A=t.useMemo((()=>({signMessage:async({message:e,address:t,options:n})=>await h({message:e,address:t,options:n}),signTransaction:async({transaction:e,address:t,chain:n,options:i})=>await y({transaction:e,address:t,chain:n,options:i}),async signAndSendTransaction({transaction:e,address:t,chain:n,options:i}){let{signature:s}=await f({transaction:e,address:t,chain:n,options:i});return{signature:s}}})),[h,y,f]);return t.useEffect((()=>{te?.setImplementation(A)}),[A]),t.useEffect((()=>{var t;!e||(t=ne.accounts).length===v.length&&t.every(((e,t)=>e.address===v[t]?.address))||te?.emit("accountChanged",v)}),[e,v]),{ready:e,wallet:ne}}function se(){let{client:e}=i.usePrivyInternal(),{ready:n,wallet:s}=ie(),[a,r]=t.useState([]),[o,l]=t.useState([]);return t.useEffect((()=>{let e=[s,...a.filter((e=>"solana"===e.chainType&&!!e.wallet.features)).map((e=>e.wallet))];l(e);let t=a.flatMap((t=>{let n=()=>l([...e]);return t.on("walletsUpdated",n),{connector:t,off:n}})),n=e.map((t=>t.features["standard:events"]?.on("change",(()=>{l([...e])}))));return()=>{n.forEach((e=>e?.())),t.forEach((({connector:e,off:t})=>e.off("walletsUpdated",t)))}}),[a]),t.useEffect((()=>{r(e.connectors?.walletConnectors.filter((e=>"solana"===e.chainType))??[]);let t=()=>{r(e.connectors?.walletConnectors.filter((e=>"solana"===e.chainType))??[])};return e.connectors?.on("connectorInitialized",t),()=>{e.connectors?.off("connectorInitialized",t)}}),[n,e.connectors]),{ready:n,wallets:o}}exports.SOLANA_CHAINS=f,exports.getAddressFromBuffer=function(t){return e.getBase58Decoder().decode(t)},exports.useSolanaStandardWallets=se,exports.useWallets=function(){let{ready:e,wallets:i}=se();return{ready:e,wallets:t.useMemo((()=>i.flatMap((e=>e.accounts.map((t=>new n.ConnectedStandardSolanaWallet({wallet:e,account:t})))))),[i])}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{HelpCircle as e}from"lucide-react";import{u as o}from"./context-LVpDfP2H.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as a}from"./ScreenLayout-DF3DCKOK.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const n=({title:o="Account not found",subtitle:i,appName:r="this app",ctaText:n="Try logging in again",onRetry:m})=>/*#__PURE__*/t(a,{title:o,subtitle:i||`Please try logging in again or go to ${r} to create an account.`,icon:e,iconVariant:"warning",primaryCta:{label:n,onClick:m},watermark:!0}),m={component:()=>{let{navigate:e,setModalData:a,data:m}=r(),c=o(),{getAuthMeta:p,client:s}=i();/*#__PURE__*/return t(n,{appName:c?.name,onRetry:()=>{let t=p();a({...m,login:{...m?.login,...t?.disableSignup?{disableSignup:!0}:{}}}),s?.authFlow&&(s.authFlow=void 0),e("LandingScreen")}})}};export{m as AccountNotFoundScreen,n as AccountNotFoundScreenView,m as default};
|
|
@@ -1,6 +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{a}from"./ModalHeader-rCMpqA2a.mjs";import{u as s}from"./context-LVpDfP2H.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{u as m,a as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{s as c}from"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";import{S as p}from"./ScreenLayout-DF3DCKOK.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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"tinycolor2";import"ofetch";import"./index-DNz_w3-G.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const d={component:()=>{let{user:t,logout:r}=m(),{onUserCloseViaDialogOrKeybindRef:i,setModalData:o,navigate:a}=l(),p=s(),{acceptTerms:d,closePrivyModal:y,createAnalyticsEvent:h}=n(),v=e=>{e?.preventDefault(),y({shouldCallAuthOnSuccess:!1}),r()};i.current=v;/*#__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),h({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),a("EmbeddedWalletOnAccountCreateScreen")):y()},onDecline:v})}},u=({termsAndConditionsUrl:o,privacyPolicyUrl:s,onAccept:n,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:n},secondaryCta:{label:"No thanks",onClick:m},watermark:!0,children:(o||s)&&/*#__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})]}),s&&/*#__PURE__*/t(a,{variant:"muted",href:s,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=o.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
gap: 12px;
|
|
5
|
-
margin-top: var(--screen-space);
|
|
6
|
-
`;export{d as AffirmativeConsentScreen,u as AffirmativeConsentScreenView,d as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{Lock as o}from"lucide-react";import"react";import{u as e}from"./context-LVpDfP2H.mjs";import{a as i}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as r}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const n=({title:e="You don't have access to this app",subtitle:i="Have you been invited?",ctaText:n="Try another account",ctaLink:a,onCtaClick:m})=>/*#__PURE__*/t(r,{title:e,subtitle:i,icon:o,iconVariant:"warning",primaryCta:{label:n,onClick:()=>{a?window.open(a,"_blank"):m?.()}},watermark:!0}),a={component:()=>{let{navigate:o}=i(),r=e(),a=r?.allowlistConfig.errorTitle||"You don't have access to this app",m=r?.allowlistConfig.errorDetail||"Have you been invited?",c=r?.allowlistConfig.errorCtaText||"Try another account",l=r?.allowlistConfig.errorCtaLink;/*#__PURE__*/return t(n,{title:a,subtitle:m,ctaText:c,ctaLink:l??void 0,onCtaClick:()=>{o("LandingScreen")}})}};export{a as AllowlistRejectionScreen,n as AllowlistRejectionScreenView,a as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useRef as t,useCallback as o}from"react";import{u as r}from"./context-LVpDfP2H.mjs";import{u as n,c as a,b as i}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./events-context-CI0iqAXA.mjs";import{a as c}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{i as s}from"./ConnectWalletView-BMjEKo1_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-DjnQgnaZ.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-Dk9y58cU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{setWalletConnectionStatus:m,closePrivyModal:p,inProgressAuthFlowRef:u}=n(),{data:d,navigate:C}=c(),W=r(),j=l(),w=d?.externalConnectWallet?.description,h=t(d?.externalConnectWallet?.walletList??W.appearance.walletList),E=t(d?.externalConnectWallet?.walletChainType??W.appearance.walletChainType),f=h.current,v=E.current,x="link"===u.current?void 0:()=>C("LandingScreen");/*#__PURE__*/return e(s,{walletList:f,walletChainType:v,onClose:p,onConnect:o((({connector:e,wallet:t})=>{j("connectWallet","onSuccess",{wallet:t}),m({status:"connected",connectedWallet:t,connector:e,connectError:null,connectRetry:()=>null}),C("ConnectionStatusScreen",!d?.externalConnectWallet?.preSelectedWalletId)}),[m,C,d?.login?.disableSignup,d?.externalConnectWallet?.preSelectedWalletId]),onConnectError:e=>{e instanceof a?(console.warn(e.cause?e.cause:e.message),j("connectWallet","onError",e.privyErrorCode||i.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),j("connectWallet","onError",i.UNKNOWN_CONNECT_WALLET_ERROR))},onBack:x,customDescription:w||"",preSelectedWalletId:d?.externalConnectWallet?.preSelectedWalletId,app:W})},isUnauthenticatedScreem:!0};export{m as AuthenticateWithWalletScreen,m 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-BlFm53ED.mjs";import{B as f}from"./ModalHeader-rCMpqA2a.mjs";import{C as v}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as j}from"./FundWalletMethodHeader-PIxwFzzh.mjs";import{N as I}from"./index-Dq_xe9dz.mjs";import{u as w,t as y}from"./context-LVpDfP2H.mjs";import{u as T,a as C,b}from"./internal-context-Z-fyxadS.mjs";import{Q as S,D as N}from"./useActiveWallet-RZ4w-uGq.mjs";import{a as k}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as x}from"./useGetTokenPrice-DERdsrmf.mjs";import{u as E}from"./useWallets-DlGuNtGR.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as F,t as B,a as L,b as U,c as P,u as M}from"./reservoir-0wfhnc0j.mjs";import{x as W}from"./index-DNz_w3-G.mjs";import{g as H}from"./getChainName-DjpPdUSc.mjs";import{g as R,a as q}from"./transaction-CnfuREWo.mjs";import{g as D,B as O}from"./BridgeNetworkSelectionView-DQGcampg.mjs";import{a as $}from"./getPublicClient-B4uPLKn-.mjs";import{T as _}from"./TransferOrBridgeLoadingScreen-VLQTcf_6.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-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useGetSolPrice-DwwjjGbd.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./getErc20Balance-DA4dGV9O.mjs";import"./Row-C9vrS4Zi.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Chip-D2-wZOHJ.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"./formatErc20TokenAmount-BuPk9xcy.mjs";import"./ethers-BQ45eiVv.mjs";import"./styles-BNn7MnP1.mjs";import"./LinkPasskeyScreen-DYfWSjKR.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"./Address-QmAVCQtO.mjs";const Q={component:()=>{let Q=w(),{rpcConfig:V,appId:G,closePrivyModal:z,createAnalyticsEvent:J}=T(),{navigate:X,setModalData:Y,data:K}=k(),Z=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(!K?.funding||"solana"!==K.funding.chainType)throw Error("Invalid funding data");let{address:ye,chain:Te,connectedWallet:Ce}=K.funding,[be,Se]=r(K.funding.amount),Ne=("ethereum"===Ce?.type?Ce:void 0)??ee[0],ke=S(Ne?.walletClientType||"unknown"),xe=ke?.name||"wallet",[Ee,Ae]=r(null);n((()=>{(async()=>{if(!Ne)return;let e=await Ne.getEthereumProvider();Ae(o({account:Ne.address,transport:s(e)}).extend(d))})().catch(console.error)}),[Ne]);let[Fe,Be]=r(0n),Le=R(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[Ue,Pe]=r(),{tokenPrice:Me}=x("solana"),{fundingAmountInBaseUnit:We,fundingAmountInUsd:He}=q({amount:be,fee:0n,tokenPrice:Me,isUsdc:K.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(Z.chains).filter((({testnet:t})=>!!t===e)),a=(await D({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:U,destinationCurrency:L,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||!Ue)return;me(!0);let a=c({chain:Ue.chain,transport:m($(Ue.chain,V,G))});try{e=await a.prepareTransactionRequest({account:Ne.address,to:Ue.to,chain:Ue.chain,data:Ue.data,value:BigInt(Ue.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:Ue.chain.id})}catch(e){await Ee.addChain({chain:Ue.chain}),await Ee.switchChain({id:Ue.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 J({eventName:A,payload:{provider:"external",status:"success",txHash:t,address:Ne.address,chainId:Ue.chain.id,chainType:"ethereum",value:Ue.value?l(BigInt(Ue.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,Ue]),M({transactionHash:ve,isTestnet:!1,bridgingStatus:Ie,setBridgingStatus:we,onSuccess({transactionHash:e}){ue(!1),fe(!0),J({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:Ne?.address,chainId:Ue?.chain.id,chainType:"ethereum",value:Ue?.value?l(BigInt(Ue.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:K?.funding,solanaFundingData:K?.solanaFundingData,sendTransaction:K?.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 ${Z.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/a(g,{}),/*#__PURE__*/a(f,{})]});let Re=ne[se];return ne.length>1&&Re?/*#__PURE__*/a(O,{displayName:xe,configuredFundingChain:Te,formattedBalance:Le,fundingAmount:be,fundingCurrency:"SOL",fundingAmountInUsd:He,options:ne,selectedOption:Re,isPreparing:ce,isSubmitting:pe,addressToFund:ye,fundingWalletAddress:Ne?.address||"",errorMessage:ie,onSubmit:()=>{K.funding?.amount!==be?async function(){if(Ne&&Re)try{let e=await F({isTestnet:!1,input:B({appId:G,amount:We.toString(),user:Ne.address,recipient:ye,destinationChainId:U,destinationCurrency:L,originChainId:Re.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:Re.chain})}catch(e){console.error(e),ae(new C("Unable to fetch quotes for bridging",e,b.INSUFFICIENT_BALANCE))}}().catch(console.error):Pe({to:Re.bridgeTx.to,data:Re.bridgeTx.data,value:Re.bridgeTx.value,chain:Re.chain})},onSelect:e=>{e!==se&&(re(null),de(e))},onAmountChange:Se}):pe&&Ne?/*#__PURE__*/a(_,{walletClientType:Ne?.walletClientType||"unknown",displayName:xe,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 r from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as i,useEffect as n}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 p}from"viem";import{addToDefaultChains as h}from"@privy-io/js-sdk-core";import{b as f,c as g,R as v}from"./Layouts-BlFm53ED.mjs";import{B as y}from"./ModalHeader-rCMpqA2a.mjs";import{C}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as I}from"./FundWalletMethodHeader-PIxwFzzh.mjs";import{N as j}from"./index-Dq_xe9dz.mjs";import{u as w,t as T}from"./context-LVpDfP2H.mjs";import{u as b,a as E,b as S}from"./internal-context-Z-fyxadS.mjs";import{Q as N,D as A}from"./useActiveWallet-RZ4w-uGq.mjs";import{a as k}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as x}from"./useGetTokenPrice-DERdsrmf.mjs";import{u as B}from"./useWallets-DlGuNtGR.mjs";import{E as F,a as M}from"./transfer-6YztDh-t.mjs";import{f as P}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{c as U,a as W,g as L,s as H}from"./ethers-BQ45eiVv.mjs";import{O as $}from"./analytics-mkkvFRju.mjs";import{t as q,g as D,c as R,u as _}from"./reservoir-0wfhnc0j.mjs";import{y as Q}from"./index-DNz_w3-G.mjs";import{g as O,B as V}from"./BridgeNetworkSelectionView-DQGcampg.mjs";import{g as G}from"./getErc20Balance-DA4dGV9O.mjs";import{a as z}from"./getPublicClient-B4uPLKn-.mjs";import{T as J}from"./TransferOrBridgeLoadingScreen-VLQTcf_6.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-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useGetSolPrice-DwwjjGbd.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Row-C9vrS4Zi.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./getChainName-DjpPdUSc.mjs";import"./Chip-D2-wZOHJ.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"./styles-BNn7MnP1.mjs";import"./LinkPasskeyScreen-DYfWSjKR.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"./Address-QmAVCQtO.mjs";const X={component:()=>{let{rpcConfig:X,appId:Y,closePrivyModal:Z,createAnalyticsEvent:K}=b(),{navigate:ee,setModalData:te,data:ae}=k(),re=w(),{wallets:ie}=B(),[ne,oe]=i(!1),[se,de]=i(0n),[ce,le]=i(!1),[me,ue]=i(null),[pe,he]=i(null),[fe,ge]=i([]),[ve,ye]=i(0),[Ce,Ie]=i(!1),[je,we]=i(!1),[Te,be]=i(!1),[Ee,Se]=i(!1),[Ne,Ae]=i(),[ke,xe]=i();if(!ae?.funding||"ethereum"!==ae.funding.chainType)throw Error("Invalid funding data");let{erc20ContractInfo:Be,chain:Fe,connectedWallet:Me}=ae.funding,Pe=ae.funding.address,Ue=ae.funding.erc20Address,[We,Le]=i(ae.funding.amount);n((()=>{Ue&&!Be&&ue(Error("Unable to fetch token details"))}),[]);let He=!!Ue&&!!Be,$e=He?BigInt(parseFloat(We)*10**Be.decimals):o(We),qe=("ethereum"===Me?.type?Me:void 0)??ie[0],De=N(qe?.walletClientType||"unknown"),Re=De?.name||"wallet",[_e,Qe]=i(null);n((()=>{(async()=>{if(!qe)return;let e=await qe.getEthereumProvider();Qe(s({account:qe.address,transport:d(e)}).extend(c))})().catch(console.error)}),[qe]);let[Oe,Ve]=i(0n);n((()=>{l({chain:Fe,transport:m(z(Fe,X,Y))}).getBalance({address:Pe}).then(Ve).catch(console.error)}),[]);let[Ge,ze]=i(0n);n((()=>{He&&G({chain:Fe,address:Pe,appId:Y,rpcConfig:X,erc20Address:Ue}).then((e=>ze(e.balance))).catch(console.error)}),[]);let{tokenPrice:Je}=x(Fe.id),[Xe,Ye]=i({to:Pe,chain:Fe,value:$e,data:void 0});n((()=>{(async()=>{let e,t;if(!_e||!qe||Ce||Te)return;Ie(!0);let a=l({chain:Xe.chain,transport:m(z(Xe.chain,X,Y))});if(He&&!Xe.data)return await a.simulateContract({address:Ue,chain:Xe.chain,abi:F,functionName:"transfer",args:[Pe,$e],account:qe.address}).catch((e=>{if("ContractFunctionZeroDataError"===e?.cause?.name||e?.message?.includes("returned no data"))return a.simulateContract({address:Ue,chain:Xe.chain,abi:M,functionName:"transfer",args:[Pe,$e],account:qe.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}));console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(Ie(!1),void Ye({to:Ue,chain:Xe.chain,data:u({abi:F,functionName:"transfer",args:[Pe,$e]}),value:"0x0"})):(Ie(!1),void le(!0));try{e=await a.prepareTransactionRequest({account:qe.address,to:Xe.to,chain:Xe.chain,data:Xe.data,value:BigInt(Xe.value??0)})}catch(e){if(console.error(e),fe.length>1)he(e.shortMessage??"Something went wrong");else if(je&&0===fe.length)return void ue(new E(`Wallet ${A(qe.address)} does not have enough funds.`,void 0,S.INSUFFICIENT_BALANCE))}if(!e)return Ie(!1),void le(!0);Ie(!1),be(!0),oe(!0),de(e.gas);try{await _e.switchChain({id:Xe.chain.id})}catch(e){await _e.addChain({chain:Xe.chain}),await _e.switchChain({id:Xe.chain.id})}try{t=await _e.sendTransaction(e)}catch(e){if(console.error(e),"TransactionExecutionError"===e.name)if(fe.length<1){let t=e.shortMessage;(e.shortMessage.includes("rejected the request")||e.details.includes("rejected the request"))&&(t="User rejected the request."),ue(new E(t,void 0,S.TRANSACTION_FAILURE))}else he(e.shortMessage??"Something went wrong")}if(t)return await _e.waitForTransactionReceipt({hash:t}),be(!1),je?(Ae(t),void xe("pending")):(Se(!0),te(Q(ae,"completed",t,qe?.walletClientType,He,Be,Fe)),void K({eventName:$,payload:{provider:"external",status:"success",txHash:t,address:qe.address,chainId:Xe.chain.id,chainType:"ethereum",value:Xe.value?p(BigInt(Xe.value),Be?.decimals??18):void 0,token:Be?.symbol??Ue??"ETH",destinationAddress:Pe,destinationChainId:Fe.id,destinationChainType:"ethereum",destinationValue:$e?p($e,Be?.decimals??18):void 0,destinationToken:Be?.symbol??Ue??Fe.nativeCurrency.name}}));be(!1)})().catch(console.error)}),[_e,Xe]),n((()=>{(async()=>{if(!ce||!_e||!qe)return;let e=h(re.chains).filter((e=>e.id!==Fe.id&&!!e.testnet==!!Fe.testnet));He&&e.unshift(Fe);let t=await O({chains:e,address:qe.address,appId:Y,rpcConfig:X,includeUsdc:ae.funding?.isUSDC}),a=He?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>$e)),r=He&&t.every((e=>0n===e.balance));if(a.length<1)return void ue(new E(r?`Wallet ${A(qe.address)} doesn't have enough funds to cover gas fees. Top up your wallet and try again.`:`Wallet ${A(qe.address)} does not have enough funds.`,void 0,S.INSUFFICIENT_BALANCE));a.sort(((e,t)=>Number(He?(t.erc20Balance??0n)-(e.erc20Balance??0n):t.balance-e.balance)));let i=a.flatMap((e=>{let t=[{...e,isErc20Quote:!1,isTestnet:!!Fe.testnet,input:q({appId:Y,amount:$e.toString(),user:qe.address,recipient:Pe,destinationChainId:Fe.id,destinationCurrency:Ue,originChainId:e.chain.id})}];return He&&Ue&&(e.erc20Balance??0n)>=$e&&t.push({...e,isErc20Quote:!0,isTestnet:!!Fe.testnet,input:q({appId:Y,amount:$e.toString(),user:qe.address,recipient:Pe,destinationChainId:Fe.id,destinationCurrency:Ue,originChainId:e.chain.id,originCurrency:e.erc20Address})}),t})),n=(await Promise.allSettled(i.map((async e=>({...e,quote:await D(e)}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(n.length<1)return void ue(new E(`Wallet ${A(qe.address)} does not have enough funds.`,void 0,S.INSUFFICIENT_BALANCE));let o=n.map((e=>({bridgeTx:R(e.quote),balance:e.balance,chain:e.chain,erc20Balance:e.erc20Balance,isErc20Quote:e.isErc20Quote}))).filter((e=>!!e.bridgeTx));if(o.length>1)return void ge(o);let s=o[0];s?(we(!0),Ye({data:s.bridgeTx.data,to:s.bridgeTx.to,value:s.bridgeTx.value,chain:s.chain})):ue(new E(`Wallet ${A(qe.address)} does not have enough funds.`,void 0,S.INSUFFICIENT_BALANCE))})().catch(console.error)}),[ce]),_({transactionHash:Ne,isTestnet:!!Fe.testnet,bridgingStatus:ke,setBridgingStatus:xe,onSuccess({transactionHash:e}){we(!1),Se(!0),te(Q(ae,"completed",e,qe?.walletClientType,He,Be,Fe)),K({eventName:$,payload:{provider:"external",status:"success",txHash:e,address:qe?.address,chainId:Xe.chain.id,chainType:"ethereum",value:Xe.value?p(BigInt(Xe.value),Be?.decimals??18):void 0,token:Be?.symbol??Ue??"ETH",destinationAddress:Pe,destinationChainId:Fe.id,destinationChainType:"ethereum",destinationValue:$e?p($e,Be?.decimals??18):void 0,destinationToken:Be?.symbol??Ue??Fe.nativeCurrency.name}})},onFailure({error:e}){we(!1),ue(e)}}),n((()=>{me&&(te({funding:ae?.funding,solanaFundingData:ae?.solanaFundingData,sendTransaction:ae?.sendTransaction,errorModalData:{error:me,previousScreen:"TransferFromWalletScreen"}}),ee("ErrorScreen",!1))}),[me]);let Ze=!He&&Je?U(We??"0",Je):void 0,Ke=He?se:H([se,$e]),et=Ke&&Je?W(Ke,Je):void 0,tt=Ke?L(Ke,ae?.funding?.erc20Address?ae?.funding?.erc20ContractInfo?.symbol||"ETH":ae?.funding?.chain.nativeCurrency.symbol||"ETH"):void 0,at=se&&Je?W(se,Je):void 0,rt=se?L(se,Fe?.nativeCurrency?.symbol||"ETH"):void 0;if(n((()=>{if(!Ee)return;let e=setTimeout(Z,T);return()=>clearTimeout(e)}),[Ee]),Ee/*#__PURE__*/)return e(t,{children:[/*#__PURE__*/a(I,{}),/*#__PURE__*/a(f,{}),/*#__PURE__*/e(g,{children:[/*#__PURE__*/a(r,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/a(C,{title:"Success!",description:`You’ve successfully added ${We} ${He?Be.symbol:Fe.nativeCurrency.symbol} to your ${re.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/a(v,{}),/*#__PURE__*/a(y,{})]});let it=He?`${P({amount:Ge,decimals:Be.decimals})} ${Be.symbol}`:L(Oe,Fe.nativeCurrency.symbol,3,!0),nt=fe[ve];return fe.length>1&&nt?/*#__PURE__*/a(V,{displayName:Re,configuredFundingChain:Fe,erc20ContractInfo:Be,formattedBalance:it,fundingAmount:We,fundingCurrency:He?Be.symbol:Fe.nativeCurrency.symbol,fundingAmountInUsd:Ze,options:fe,selectedOption:nt,isPreparing:Ce,isSubmitting:Te,addressToFund:Pe,fundingWalletAddress:qe?.address||"",errorMessage:pe,onSubmit:()=>{ae.funding?.amount!==We?async function(){if(qe&&nt)try{let e=await D({isTestnet:!!Fe.testnet,input:q({appId:Y,amount:$e.toString(),user:qe.address,recipient:Pe,destinationChainId:Fe.id,destinationCurrency:Ue,originChainId:nt.chain.id})}),t=R(e);if(!t)throw Error("Invalid transaction request");we(!0),Ye({data:t.data,to:t.to,value:t.value,chain:nt.chain})}catch(e){console.error(e),ue(new E("Unable to fetch quotes for bridging",e,S.INSUFFICIENT_BALANCE))}}().catch(console.error):Ye({to:nt.bridgeTx.to,data:nt.bridgeTx.data,value:nt.bridgeTx.value,chain:nt.chain})},onSelect:e=>{e!==ve&&(he(null),ye(e))},onAmountChange:Le}):ne&&se&&qe&&ae?.funding?/*#__PURE__*/a(J,{walletClientType:qe?.walletClientType||"unknown",displayName:Re,addressToFund:Pe,isBridging:je,isErc20Flow:He,totalPriceInUsd:et,totalPriceInNativeCurrency:tt,gasPriceInUsd:at,gasPriceInNativeCurrency:rt,chainId:Fe.id,chainName:Fe.name}):
|
|
2
|
-
/*#__PURE__*/e(t,{children:[/*#__PURE__*/a(I,{}),/*#__PURE__*/a(j,{}),/*#__PURE__*/a("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/a(y,{})]})}};export{X as AwaitingExternalEthereumTransferScreen,X as default};
|
|
@@ -1,103 +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-BlFm53ED.mjs";import{L as d}from"./Link-DJ5gq9Di.mjs";import{u as p,q as m}from"./context-LVpDfP2H.mjs";import{u,e as f,b as v,k as h}from"./internal-context-Z-fyxadS.mjs";import{a as y,u as g}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{s as x}from"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";import{S as b}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-DNz_w3-G.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const E=({contactMethod:c,authFlow:p,appName:m="Privy",whatsAppEnabled:u=!1,onBack:f,onCodeSubmit:v,onResend:h,errorMessage:y,success:g=!1,resendCountdown:x=0,onInvalidInput:E,onClearError:w})=>{let[A,T]=n(S);a((()=>{y||T(S)}),[y]);let k=async e=>{e.preventDefault();let r=e.currentTarget.value.replace(" ","");if(""===r)return;if(isNaN(Number(r)))return void E?.("Code should be numeric");w?.();let o=Number(e.currentTarget.name?.charAt(5)),t=[...r||[""]].slice(0,C-o),i=[...A.slice(0,o),...t,...A.slice(o+t.length)];T(i);let n=Math.min(Math.max(o+t.length,0),C-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(b,{title:"Enter confirmation code",subtitle:/*#__PURE__*/r("span","email"===p?{children:["Please check ",/*#__PURE__*/e(R,{children:c})," for an email from privy.io and enter your code below."]}:{children:["Please check ",/*#__PURE__*/e(R,{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","?"]}),x?/*#__PURE__*/r(M,{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(_,{children:/*#__PURE__*/e(l,{children:/*#__PURE__*/r(I,{children:[/*#__PURE__*/e("div",{children:A.map(((r,o)=>/*#__PURE__*/e("input",{name:`code-${o}`,type:"text",value:A[o],onChange:k,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(w?.(),T([...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 C=6,S=Array(6).fill("");var w,A,T=((w=T||{})[w.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",w[w.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",w),k=((A=k||{})[A.EMAIL=0]="EMAIL",A[A.SMS=1]="SMS",A);const N={component:()=>{let{navigate:r,lastScreen:o,navigateBack:t,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=y(),c=p(),{closePrivyModal:l,resendEmailCode:d,resendSmsCode:b,getAuthMeta:C,loginWithCode:S,updateWallets:w,createAnalyticsEvent:A}=u(),{authenticated:T,logout:k,user:N}=g(),{whatsAppEnabled:_}=p(),[I,j]=n(!1),[L,M]=n(null),[R,D]=n(null),[O,P]=n(0);s.current=()=>null;let W=C()?.email?0:1,U=0===W?C()?.email||"":C()?.phoneNumber||"",F=m-500;a((()=>{if(O){let e=setTimeout((()=>{P(O-1)}),1e3);return()=>clearTimeout(e)}}),[O]),a((()=>{if(T&&I&&N){if(c?.legal.requireUsersAcceptTerms&&!N.hasAcceptedTerms){let e=setTimeout((()=>{r("AffirmativeConsentScreen")}),F);return()=>clearTimeout(e)}if(x(N,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"}}),k()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),F);return()=>clearTimeout(e)}{w();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),m);return()=>clearTimeout(e)}}}),[T,I,N]),a((()=>{if(L&&0===R){let e=setTimeout((()=>{M(null),D(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[L,R]);/*#__PURE__*/return e(E,{contactMethod:U,authFlow:0===W?"email":"sms",appName:c?.name,whatsAppEnabled:_,onBack:()=>t(),onCodeSubmit:async e=>{try{await S(e),j(!0)}catch(e){if(e instanceof f&&e.privyErrorCode===v.INVALID_CREDENTIALS)M("Invalid or expired verification code"),D(0);else if(e instanceof f&&e.privyErrorCode===v.CANNOT_LINK_MORE_OF_TYPE)M(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");M("Issue verifying code"),D(0)}}},onResend:async()=>{P(30),0===W?await d():await b()},errorMessage:L||void 0,success:I,resendCountdown:O,onInvalidInput:e=>{M(e),D(1)},onClearError:()=>{1===R&&(M(null),D(null))}})}};let _=c.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
flex-direction: column;
|
|
4
|
-
align-items: center;
|
|
5
|
-
justify-content: center;
|
|
6
|
-
margin: auto;
|
|
7
|
-
gap: 16px;
|
|
8
|
-
flex-grow: 1;
|
|
9
|
-
width: 100%;
|
|
10
|
-
`,I=c.div`
|
|
11
|
-
display: flex;
|
|
12
|
-
flex-direction: column;
|
|
13
|
-
width: 100%;
|
|
14
|
-
gap: 12px;
|
|
15
|
-
|
|
16
|
-
> div:first-child {
|
|
17
|
-
display: flex;
|
|
18
|
-
justify-content: center;
|
|
19
|
-
gap: 0.5rem;
|
|
20
|
-
width: 100%;
|
|
21
|
-
border-radius: var(--privy-border-radius-sm);
|
|
22
|
-
|
|
23
|
-
> input {
|
|
24
|
-
border: 1px solid var(--privy-color-foreground-4);
|
|
25
|
-
background: var(--privy-color-background);
|
|
26
|
-
border-radius: var(--privy-border-radius-sm);
|
|
27
|
-
padding: 8px 10px;
|
|
28
|
-
height: 48px;
|
|
29
|
-
width: 40px;
|
|
30
|
-
text-align: center;
|
|
31
|
-
font-size: 18px;
|
|
32
|
-
font-weight: 600;
|
|
33
|
-
color: var(--privy-color-foreground);
|
|
34
|
-
transition: all 0.2s ease;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
> input:focus {
|
|
38
|
-
border: 1px solid var(--privy-color-foreground);
|
|
39
|
-
box-shadow: 0 0 0 1px var(--privy-color-foreground);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
> input:invalid {
|
|
43
|
-
border: 1px solid var(--privy-color-error);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
> input.success {
|
|
47
|
-
border: 1px solid var(--privy-color-border-success);
|
|
48
|
-
background: var(--privy-color-success-bg);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
> input.fail {
|
|
52
|
-
border: 1px solid var(--privy-color-border-error);
|
|
53
|
-
background: var(--privy-color-error-bg);
|
|
54
|
-
animation: shake 180ms;
|
|
55
|
-
animation-iteration-count: 2;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
@keyframes shake {
|
|
60
|
-
0% {
|
|
61
|
-
transform: translate(1px, 0px);
|
|
62
|
-
}
|
|
63
|
-
33% {
|
|
64
|
-
transform: translate(-1px, 0px);
|
|
65
|
-
}
|
|
66
|
-
67% {
|
|
67
|
-
transform: translate(-1px, 0px);
|
|
68
|
-
}
|
|
69
|
-
100% {
|
|
70
|
-
transform: translate(1px, 0px);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`,j=c.div`
|
|
74
|
-
line-height: 20px;
|
|
75
|
-
min-height: 20px;
|
|
76
|
-
font-size: 14px;
|
|
77
|
-
font-weight: 400;
|
|
78
|
-
color: ${e=>e.$success?"var(--privy-color-success-dark)":e.$fail?"var(--privy-color-error-dark)":"transparent"};
|
|
79
|
-
display: flex;
|
|
80
|
-
justify-content: center;
|
|
81
|
-
width: 100%;
|
|
82
|
-
text-align: center;
|
|
83
|
-
`,L=c.div`
|
|
84
|
-
display: flex;
|
|
85
|
-
gap: 8px;
|
|
86
|
-
align-items: center;
|
|
87
|
-
justify-content: center;
|
|
88
|
-
width: 100%;
|
|
89
|
-
color: var(--privy-color-foreground-2);
|
|
90
|
-
`,M=c.div`
|
|
91
|
-
display: flex;
|
|
92
|
-
align-items: center;
|
|
93
|
-
justify-content: center;
|
|
94
|
-
border-radius: var(--privy-border-radius-sm);
|
|
95
|
-
padding: 2px 8px;
|
|
96
|
-
gap: 4px;
|
|
97
|
-
background: var(--privy-color-background-2);
|
|
98
|
-
color: var(--privy-color-foreground-2);
|
|
99
|
-
`,R=c.span`
|
|
100
|
-
font-weight: 500;
|
|
101
|
-
word-break: break-all;
|
|
102
|
-
color: var(--privy-color-foreground);
|
|
103
|
-
`;export{N as AwaitingPasswordlessCodeScreen,E as AwaitingPasswordlessCodeScreenView,N as default};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as d}from"viem";import{ConnectedStandardSolanaWallet as l}from"@privy-io/js-sdk-core";import{b as c,c as m,R as u}from"./Layouts-BlFm53ED.mjs";import{B as p}from"./ModalHeader-rCMpqA2a.mjs";import{C as f}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as h}from"./FundWalletMethodHeader-PIxwFzzh.mjs";import{N as g}from"./index-Dq_xe9dz.mjs";import{u as v,t as w}from"./context-LVpDfP2H.mjs";import{u as I,a as C,b as y}from"./internal-context-Z-fyxadS.mjs";import{Q as T,a6 as S}from"./useActiveWallet-RZ4w-uGq.mjs";import{a as j}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as b,t as N,d as F,a as U,b as E,u as x}from"./reservoir-0wfhnc0j.mjs";import{e as W,S as k}from"./usePrivy-Dj52a5sp.mjs";import{T as R}from"./TransferOrBridgeLoadingScreen-VLQTcf_6.mjs";import{t as L}from"./prepareFundingModalData-DjTxAoJ1.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Row-C9vrS4Zi.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Address-QmAVCQtO.mjs";import"lucide-react";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"eventemitter3";const D={component:function(){let D=v(),{closePrivyModal:$,createAnalyticsEvent:B,connectors:M}=I(),{navigate:P,setModalData:H,data:O}=j(),_=v(),q=o(!1),Q=W(),[V,z]=a(!1),[G,X]=a(!1),[Y,J]=a(null),[K,Z]=a(),[ee,te]=a();if(!O?.funding||"ethereum"!==O.funding.chainType)throw Error("Invalid funding data");let{amount:ne,connectedWallet:re,chain:oe,solanaChain:ae,isUSDC:ie}=O.funding,se=O.funding.address,de=O.funding.erc20Address,le=O.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,ce=i((()=>"solana"===re?.type?re.provider:function({connectors:e,connectedWalletAddress:t}){let n=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),r=n?.wallet.accounts.find((e=>e.address===t));if(!n||!r)throw new C("Unable to find source wallet connector");return new l({wallet:n.wallet,account:r})}({connectors:M,connectedWalletAddress:re?.address||""})),[re,M]),me=i((()=>{let e=Q(k);if(!e)throw new C("Unable to load solana plugin");let t=D.solanaRpcs["solana:mainnet"];if(!t)throw new C("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),ue=T(L(ce?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!ce||!oe||q.current)return;let e=Q(k);if(!e)return void J(new C("Unable to solana plugin"));q.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(ne):d(ne),n=await b({isTestnet:!!oe.testnet,input:N({appId:_.id,amount:t.toString(),user:ce.address,recipient:se,destinationChainId:oe.id,originChainId:E,originCurrency:ie?F:U,destinationCurrency:ie?de:void 0})}).catch(console.error);if(!n)return void J(new C(`Unable to fetch quotes for bridging. Wallet ${S(ce.address)} does not have enough funds.`,void 0,y.INSUFFICIENT_BALANCE));let r=await e.createTransactionFromRelayQuote({quote:n,source:ce.address,solanaClient:me});if(r)try{z(!0);let t=await e.simulateTransaction({solanaClient:me,tx:r});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void J(new C("Something went wrong",void 0,y.TRANSACTION_FAILURE))):void J(new C(`Wallet ${S(ce?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${le} are needed to complete the transaction.`,void 0,y.INSUFFICIENT_BALANCE));let{signature:o}=await ce.signAndSendTransaction({chain:"solana:mainnet",transaction:r}),a=e.getAddressFromBuffer(o);Z(a),te("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void J(new C("Transaction was rejected by the user",void 0,y.TRANSACTION_FAILURE));J(new C("Something went wrong",void 0,y.TRANSACTION_FAILURE))}else J(new C(`Unable to select bridge option from quotes. Wallet ${S(ce.address)} does not have enough funds.`,void 0,y.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),x({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){z(!1),X(!0),B({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:ce.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:ne,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){z(!1),J(e)}}),s((()=>{if(!G)return;let e=setTimeout($,w);return()=>clearTimeout(e)}),[G]),s((()=>{Y&&(H({funding:O?.funding,solanaFundingData:O?.solanaFundingData,sendTransaction:O?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),P("ErrorScreen",!1))}),[Y]),G?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(c,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(r,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(f,{title:"Success!",description:`You’ve successfully added ${ne} ${le} to your ${_.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):V&&ce?/*#__PURE__*/t(R,{walletClientType:L(ce?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:V,isErc20Flow:!1,chainId:oe.id,chainName:oe.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
|
|
2
|
-
/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(g,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(p,{})]})}};export{D as AwaitingSolToEvmBridgingScreen,D 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-DNz_w3-G.mjs";import{a as m}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as u}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"./context-LVpDfP2H.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.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]},[C,f]=a(!0);s((()=>(j(setTimeout(f,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(!C)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,C,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,16 +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{M as l,B as d,P as p}from"./ModalHeader-rCMpqA2a.mjs";import{a as u}from"./Layouts-BlFm53ED.mjs";import{L as g,a7 as f}from"./useActiveWallet-RZ4w-uGq.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as v}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{H as b}from"./index-DNz_w3-G.mjs";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:p,createAnalyticsEvent:u,client:g}=h(),[f,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:F}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===f||"pending-after-flow"===f){let e=setInterval((async()=>{if(k)try{let{status:e}=await g.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");F?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),u({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,F,f]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:f,onClickCta:p}),/*#__PURE__*/t(d,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(F,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(u,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(p,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(g,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(f,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=m.p`
|
|
2
|
-
font-size: 1rem;
|
|
3
|
-
color: var(--privy-color-foreground-3);
|
|
4
|
-
margin-bottom: 1rem;
|
|
5
|
-
display: flex;
|
|
6
|
-
flex-direction: column;
|
|
7
|
-
gap: 1rem;
|
|
8
|
-
`,F=m.div`
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
align-items: center;
|
|
12
|
-
justify-content: center;
|
|
13
|
-
margin-left: 1.75rem;
|
|
14
|
-
margin-right: 1.75rem;
|
|
15
|
-
padding: 2rem 0;
|
|
16
|
-
`;export{w as CoinbaseOnrampStatusScreen,w as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as a}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-LVpDfP2H.mjs";import{u as m,c,b as d}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./index-DNz_w3-G.mjs";import{u,a as h}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{F as g,a1 as f,V as y}from"./useActiveWallet-RZ4w-uGq.mjs";import{E,P as S}from"./ModalHeader-rCMpqA2a.mjs";import{C as b}from"./Chip-D2-wZOHJ.mjs";import{I as v,a as k}from"./EmailInputForm-Dgoii4vf.mjs";import{E as C}from"./ErrorMessage-D8VaAP5m.mjs";const j=/*#__PURE__*/t(((t,l)=>{let[y,v]=o(t.defaultValue||""),[k,j]=o(""),[T,A]=o(!1),{authenticated:L}=u(),{initLoginWithEmail:M}=m(),{navigate:D,setModalData:I,currentScreen:U,data:F}=h(),{enabled:N,token:W}=p(),[_,R]=o(!1),{accountType:V}=g(),q=s();n((()=>{!y&&q.disablePlusEmails&&F?.inlineError?.error instanceof c&&F?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!k&&j("Please enter a valid email address without a '+'."),k&&j("")}),[y]);let z=f(y),H=T||!z,K=()=>{var e;I({login:F?.login,inlineError:void 0}),!N||W||L?(e=W,A(!0),M({email:y,captchaToken:e,disableSignup:F?.login?.disableSignup,withPrivyUi:!0}).then((()=>{D("AwaitingPasswordlessCodeScreen")})).catch((e=>{I({errorModalData:{error:e,previousScreen:U||"LandingScreen"}}),D("ErrorScreen")})).finally((()=>{A(!1)}))):(I({captchaModalData:{callback:e=>M({email:y,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(w,{children:[k&&/*#__PURE__*/a(C,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:k}),/*#__PURE__*/e(x,{stacked:t.stacked,$error:!!k,children:[/*#__PURE__*/a(P,{children:/*#__PURE__*/a(i,{})}),/*#__PURE__*/a("input",{ref:l,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>R(!0),onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&K()},value:y,autoComplete:"email"}),"email"!==V||_?t.stacked?/*#__PURE__*/a("span",{}):/*#__PURE__*/a(E,{isSubmitting:T,onClick:K,disabled:H,children:"Submit"}):/*#__PURE__*/a(b,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/a(S,{loadingText:null,loading:T,disabled:H,onClick:K,style:{width:"100%"},children:"Submit"}):null]})}));let w=v,x=k,P=l(y)`
|
|
2
|
-
display: inline-flex;
|
|
3
|
-
`;export{j as C};
|
|
@@ -1,9 +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-CNcx75Dp.mjs";import{S as n}from"./ScreenLayout-DF3DCKOK.mjs";import{G as m}from"./index-DNz_w3-G.mjs";import"viem";import"react";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const p=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"})})}),s=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:s="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:s,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(p,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(s,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=o.div`
|
|
2
|
-
display: flex;
|
|
3
|
-
align-items: center;
|
|
4
|
-
justify-content: center;
|
|
5
|
-
gap: 8px;
|
|
6
|
-
margin-bottom: var(--screen-space);
|
|
7
|
-
`,d=o.span`
|
|
8
|
-
white-space: pre-wrap;
|
|
9
|
-
`;export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,s as ConnectLedgerScreenView,c as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-LVpDfP2H.mjs";import{u as r,c as n,b as a}from"./internal-context-Z-fyxadS.mjs";import{a as i}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{i as c}from"./ConnectWalletView-BMjEKo1_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-DjnQgnaZ.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-Dk9y58cU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),C=i(),u=s?.externalConnectWallet?.description,j=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),E=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:j.current,walletChainType:E.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{C("connectWallet","onError",a.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{C("connectWallet","onSuccess",{wallet:t});let o=s?.externalConnectWallet?.onCompleteNavigateTo;o?p(o({address:t.address,walletClientType:e?.walletClientType,walletChainType:e?.chainType})):m()},onConnectError:e=>{e instanceof n?(console.warn(e.cause?e.cause:e.message),C("connectWallet","onError",e.privyErrorCode||a.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),C("connectWallet","onError",a.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:u,app:d,connectOnly:!0})},isUnauthenticatedScreem:!0};export{m as ConnectOnlyLandingScreen,m as default};
|
|
@@ -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 n}from"./prepareFundingModalData-DjTxAoJ1.mjs";import{q as i}from"./context-LVpDfP2H.mjs";import{Q as a}from"./useActiveWallet-RZ4w-uGq.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as c}from"./ScreenLayout-DF3DCKOK.mjs";import{B as m}from"./index-DNz_w3-G.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-mk5beBL7.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-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"ofetch";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Link-DJ5gq9Di.mjs";import"./useI18n-Dk9y58cU.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:i,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:i,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===n.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:m,watermark:!0}),d={component:()=>{let n,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:h}=s(),[v,C]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,T="switching_to_supported_chain"===j?.status;o((()=>{if(S){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}))}),i)}else e=setTimeout(h,i);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,C(p(e)))}),[j]);let R=j?.connector?.connectorType||"injected",W=j?.connector?.walletClientType||"unknown",B=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",M=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),E="Browser Extension"===B?B.toLowerCase():B;n=S?`Successfully connected with ${E}`:v?v.message:T?"Switching networks":`Waiting for ${E}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&v?_="Unable to connect wallet":v?_=v.detail:T?_="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"===R?_="Open your mobile wallet app to continue":"coinbase_wallet"===R&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:B,walletLogo:M,success:S,errorMessage:v,title:n,subtitle:_,onRetry:()=>{b(k+1),C(void 0),j?.connectRetry()},onUseDifferentWallet:c,onBack:f===w?void 0:c,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-LVpDfP2H.mjs";import{C as r,L as i}from"./CustomLandingScreenView-BlDfJaDr.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./get-is-unified-wallet-CNcx75Dp.mjs";import"./useWallets-DlGuNtGR.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-DNz_w3-G.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ConnectWalletView-BMjEKo1_.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-DjnQgnaZ.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-Dk9y58cU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-Df5OtmDR.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-BMtTIItD.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-B-nEN4GW.mjs";import"./ScreenLayout-DF3DCKOK.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,7 +0,0 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as a,useState as i,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-DNz_w3-G.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as h}from"./context-LVpDfP2H.mjs";import{u as S}from"./useI18n-Dk9y58cU.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-DjTxAoJ1.mjs";import{Q as b,k as v,T}from"./useActiveWallet-RZ4w-uGq.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,k as A}from"./internal-context-Z-fyxadS.mjs";import{u as W,a as I}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";import{e as j,f as U}from"./usePrivy-Dj52a5sp.mjs";import{S as O}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const M=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>E(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const N=e=>e?.privyErrorCode===R.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===R.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,x=({walletLogo:o,title:a,subtitle:i,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(),E=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:a,subtitle:i,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:E,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]=i(!1),[g,f]=i(!1),[C,_]=i(void 0),{authenticated:E,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:H}=I(),X=w(),{t:z}=S(),{getAuthFlow:Q,walletConnectionStatus:Y,closePrivyModal:J,initLoginWithWallet:K,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=k(),{walletConnectors:Z}=W(),[ee,te]=i(0),{user:ne}=W(),oe=j(),[ae]=i(ne?.linkedAccounts.length||0),[ie,re]=i(""),[ce,le]=i(""),[se,de]=i(!1),{hasTabbedAway:me}=function(){let[e,t]=i(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return a((()=>(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;a((()=>{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===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?K(Y.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>K(Y.connectedWallet,e,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&H?.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]),a((()=>{if(ne&&n){let e=h-500;if(X?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,X.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}$();let t=setTimeout((()=>J({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==R.ALLOWLIST_REJECTED){if(e?.privyErrorCode===R.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==R.USER_DOES_NOT_EXIST)return e?.privyErrorCode===R.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({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 _(N(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){ye(e)}finally{f(!1)}}a((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));a((()=>{n.current=e})),a((()=>{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&&!ie?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?z("connectionStatus.successfullyConnected",{walletName:_e}):C?z("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=z("connectionStatus.checkOtherWindows");n?Ee=ae===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:Se?Ee="Switch your wallet to the requested network.":he&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===be?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Ee=M(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):H?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(M(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ie,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=l.p`
|
|
2
|
-
text-align: center;
|
|
3
|
-
color: var(--privy-color-foreground-2);
|
|
4
|
-
font-size: 14px;
|
|
5
|
-
line-height: 22px;
|
|
6
|
-
margin: 16px 0;
|
|
7
|
-
`;export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,N 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 a,q as i}from"./context-LVpDfP2H.mjs";import{R as s}from"./index-DNz_w3-G.mjs";import{u as n,a as c,e as p,b as l}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{z as d}from"./useActiveWallet-RZ4w-uGq.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";import{S as f}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DlGuNtGR.mjs";import"./prepareFundingModalData-DjTxAoJ1.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"./usePrivy-Dj52a5sp.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:a,onClose:i})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:a?{title:"Authentication failed",subtitle:a.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,a,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!a},onBack:i,watermark:!0})},g={component:()=>{let t=a(),{data:f,navigate:g,setModalData:v,onUserCloseViaDialogOrKeybindRef:A}=m(),{crossAppAuthFlow:y,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),T=f?.crossAppAuth,U=new c(`There was an issue connecting your ${T?.name} account. Please try again.`),k=new s((async e=>{if(T?.popup)try{let t=await y({appId:e,popup:T.popup,action:T.action,disableSignup:T.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return v({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${T.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void g("LinkConflictScreen");T.popup&&T.popup.close(),I({error:U})}else I({error:U})}else I({error:U})})),W=()=>{C.data&&(j(),T?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),T?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return A.current=W,r((()=>{T?.appId?.length&&k.execute(T.appId)}),[T?.appId]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{g("AffirmativeConsentScreen")}),i);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{v({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${T?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),g("EmbeddedWalletOnAccountCreateScreen")}),i);return()=>clearTimeout(e)}let o=setTimeout(W,i);return()=>clearTimeout(o)}),[C.data]),T?.appId?/*#__PURE__*/e(h,{providerApp:{id:T?.appId,logoUrl:T?.logoUrl,name:T?.name},success:!!C.data,error:C.error,onClose:W}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{g as CrossAppAuthScreen,h as CrossAppAuthScreenView,g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as a}from"./WalletInfoCard-ChBHG5L5.mjs";import{u as n,r as c}from"./context-LVpDfP2H.mjs";import{u as m,a as l}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as u}from"./ScreenLayout-DF3DCKOK.mjs";import"styled-components";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-QmAVCQtO.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.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:y,onDelegate:g,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:y,success:a,error:f,onAccept:async()=>{try{await g(),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{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-LVpDfP2H.mjs";import{u as c,a as m}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as p}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[f,y]=i(),{onRevoke:k,onSuccess:v,onError:h}=o.delegatedActions.revoke,j=async()=>{p?v():h(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await k(),d(!0)}catch(e){y(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
|