@privy-io/react-auth 3.10.1 → 3.10.2
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-DpWbazhN.js → AccountNotFoundScreen-CccXh5Ow.js} +1 -1
- package/dist/cjs/{Address-B_I2EZZe.js → Address-szbhr3eZ.js} +1 -1
- package/dist/cjs/{AffirmativeConsentScreen-9ZT_Z3WZ.js → AffirmativeConsentScreen-DmfPpl2i.js} +1 -1
- package/dist/cjs/{AllowlistRejectionScreen-DkSBlXbO.js → AllowlistRejectionScreen-B75b3HjF.js} +1 -1
- package/dist/cjs/{AuthenticateWithWalletScreen-B8X_BqjA.js → AuthenticateWithWalletScreen-CMdBkn5P.js} +1 -1
- package/dist/cjs/{AwaitingEvmToSolBridgingScreen-TqLrYeHi.js → AwaitingEvmToSolBridgingScreen-zqMa3M-c.js} +1 -1
- package/dist/cjs/{AwaitingExternalEthereumTransferScreen-Dy4mxIoc.js → AwaitingExternalEthereumTransferScreen-Tm1ncf9g.js} +1 -1
- package/dist/cjs/{AwaitingPasswordlessCodeScreen-gcHc0S-p.js → AwaitingPasswordlessCodeScreen-DSJA4ZJF.js} +1 -1
- package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DtJ9-ogk.js → AwaitingSolToEvmBridgingScreen-Wrz0ccTo.js} +1 -1
- package/dist/cjs/{BridgeNetworkSelectionView-dk0l0q-M.js → BridgeNetworkSelectionView-CfUjmKJ-.js} +1 -1
- package/dist/cjs/{Button-BEaVAnh4.js → Button-CyX7JNsa.js} +1 -1
- package/dist/cjs/{CaptchaScreen-C_mEgCfb.js → CaptchaScreen-MhvzUgNQ.js} +1 -1
- package/dist/cjs/{CoinbaseOnrampStatusScreen-retAGRaW.js → CoinbaseOnrampStatusScreen-BhR230ZS.js} +1 -1
- package/dist/cjs/{ConnectEmailForm-CfACIV6_.js → ConnectEmailForm-BSkD5EKc.js} +1 -1
- package/dist/cjs/{ConnectLedgerScreen-B_lID1I6.js → ConnectLedgerScreen-BvlmHoA3.js} +1 -1
- package/dist/cjs/{ConnectOnlyLandingScreen-ByTgLbTP.js → ConnectOnlyLandingScreen-nbPM7web.js} +1 -1
- package/dist/cjs/{ConnectOnlyStatusScreen-9JAufomE.js → ConnectOnlyStatusScreen-C2Wl0jxa.js} +1 -1
- package/dist/cjs/{ConnectOrCreateScreen-BF_OuFpX.js → ConnectOrCreateScreen-CtzSeQ-J.js} +1 -1
- package/dist/cjs/{ConnectPhoneForm-C0SpJtis.js → ConnectPhoneForm-BYlpF5oC.js} +1 -1
- package/dist/cjs/ConnectWalletView-O70yBQFu.js +1 -0
- package/dist/cjs/{ConnectionStatusScreen-CLgTwzQu.js → ConnectionStatusScreen-DML_ZDfW.js} +1 -1
- package/dist/cjs/CrossAppAuthScreen-Dz6PZNOw.js +1 -0
- package/dist/cjs/CustomLandingScreenView-CBW3Yr3o.js +2 -0
- package/dist/cjs/{DelegatedActionsConsentScreen-Co_Y95XG.js → DelegatedActionsConsentScreen-CN5Y30M4.js} +1 -1
- package/dist/cjs/{DelegatedActionsRevokeScreen-YAYK0-5r.js → DelegatedActionsRevokeScreen-CMkHii4b.js} +1 -1
- package/dist/cjs/{EmbeddedWalletConnectingScreen-ziUZeTLk.js → EmbeddedWalletConnectingScreen-SBfyKPRv.js} +1 -1
- package/dist/cjs/{EmbeddedWalletCreatedScreen-CG0y5Ke2.js → EmbeddedWalletCreatedScreen-sMHJGzfv.js} +1 -1
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-DFqz986K.js → EmbeddedWalletKeyExportScreen-C5uNOzfr.js} +1 -1
- package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-B4WNBQna.js → EmbeddedWalletOnAccountCreateScreen-B84q1xGE.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-Y2DUG4YB.js → EmbeddedWalletPasswordUpdateScreen-CxeydwO6.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-Dy8KboAq.js → EmbeddedWalletPasswordUpdateSplashScreen-BVc-qFqk.js} +1 -1
- package/dist/cjs/{EnrollTotp-CasC3VFI.js → EnrollTotp-DQKYLdAQ.js} +1 -1
- package/dist/cjs/{ErrorScreen-BrKj88o9.js → ErrorScreen-MrSIGio_.js} +1 -1
- package/dist/cjs/{FarcasterConnectStatusScreen-BLXWWJmD.js → FarcasterConnectStatusScreen-BYDqDWAC.js} +1 -1
- package/dist/cjs/{FarcasterSignerStatusScreen-Cr0xAGvg.js → FarcasterSignerStatusScreen-Bik8wrMR.js} +1 -1
- package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-BdR31dg6.js → FundSolWalletWithExternalSolanaWallet-CUYnW9m7.js} +1 -1
- package/dist/cjs/{FundWalletMethodHeader-CxH_zVnz.js → FundWalletMethodHeader-D2b7Summ.js} +1 -1
- package/dist/cjs/{FundingEditAmountScreen-CP4EaEYh.js → FundingEditAmountScreen-BNL_9NSc.js} +1 -1
- package/dist/cjs/{FundingMethodSelectionScreen-BgZw0u6b.js → FundingMethodSelectionScreen-pjtPGWB4.js} +1 -1
- package/dist/cjs/HCaptchaWrapper-CxqJE5RH.js +1 -0
- package/dist/cjs/{InAppBrowserLoginNotPossible-Cg9HwW8w.js → InAppBrowserLoginNotPossible-BDP_0K6U.js} +1 -1
- package/dist/cjs/{InstallWalletScreen-DRTLmXtV.js → InstallWalletScreen-DatnwQ5S.js} +1 -1
- package/dist/cjs/{LandingScreen-Crcwq_g8.js → LandingScreen-PhSFsQAW.js} +1 -1
- package/dist/cjs/{LinkConflictScreen-C3dRaiQk.js → LinkConflictScreen-DhG3p7sJ.js} +1 -1
- package/dist/cjs/{LinkEmailScreen-DgQb2Wg1.js → LinkEmailScreen-nUhaHOKN.js} +1 -1
- package/dist/cjs/{LinkPasskeyScreen-52yLU_Q-.js → LinkPasskeyScreen-n7IJuNlF.js} +1 -1
- package/dist/cjs/{LinkPhoneScreen-DQXhoFL4.js → LinkPhoneScreen-Dek16_Y5.js} +1 -1
- package/dist/cjs/{LoginFailedScreen-yCmKlIj1.js → LoginFailedScreen-Du15IoL5.js} +1 -1
- package/dist/cjs/{ManualTransferScreen-Dk4BMFPw.js → ManualTransferScreen-CBWn4JvN.js} +1 -1
- package/dist/cjs/{MfaAuthEnrollmentFlowScreen-yFdG0eOh.js → MfaAuthEnrollmentFlowScreen-BT0TbVv2.js} +1 -1
- package/dist/cjs/{MfaAuthVerifyFlowScreen-BZJ1SkGe.js → MfaAuthVerifyFlowScreen-CRQ4FiuC.js} +1 -1
- package/dist/cjs/{MfaEnrollmentFlowScreen-DSsoPwhQ.js → MfaEnrollmentFlowScreen-CqRzU9XV.js} +1 -1
- package/dist/cjs/{MfaVerifyFlowScreen-CtOltjrq.js → MfaVerifyFlowScreen-BDOehbLb.js} +1 -1
- package/dist/cjs/{ModalHeader-n6Aqpos_.js → ModalHeader-D9UKo-3h.js} +1 -1
- package/dist/cjs/{MoonpayStatusScreen-IxyonJvb.js → MoonpayStatusScreen-CdZgJRrM.js} +1 -1
- package/dist/cjs/{OAuthStatusScreen-D1DDf9yn.js → OAuthStatusScreen-CIma0mu9.js} +1 -1
- package/dist/cjs/{PasskeySelectSignupOrLogin-D4XaKl_E.js → PasskeySelectSignupOrLogin-D1NqVZW7.js} +1 -1
- package/dist/cjs/{PasskeyStatusScreen-CFQM6Nh7.js → PasskeyStatusScreen-Q0ehEMbT.js} +1 -1
- package/dist/cjs/{PasswordRecoveryScreen-DZhILc6f.js → PasswordRecoveryScreen-C3g17CVW.js} +1 -1
- package/dist/cjs/{QrCode-D-MkB93C.js → QrCode-DWvu0AHR.js} +1 -1
- package/dist/cjs/{RecoveryOAuthStatusScreen-C47Vu6bz.js → RecoveryOAuthStatusScreen-DN0I--HN.js} +1 -1
- package/dist/cjs/{RecoveryPasswordCreateScreen-Cd7NUBpB.js → RecoveryPasswordCreateScreen-BAAoBkhn.js} +1 -1
- package/dist/cjs/{RecoverySelectionScreen-C62og2VL.js → RecoverySelectionScreen-Chnml1GU.js} +1 -1
- package/dist/cjs/{Screen-J7z62u7O.js → Screen-Cjd8kgCg.js} +1 -1
- package/dist/cjs/{ScreenLayout-D6r13vU7.js → ScreenLayout-0BeoRza6.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-3unBTQcy.js → SetAutomaticRecoveryScreen-C82NF48g.js} +1 -1
- package/dist/cjs/{SetWalletPasswordForm-Bw9mi-NI.js → SetWalletPasswordForm-CwwM_HsZ.js} +1 -1
- package/dist/cjs/{SignRequestScreen-ZHkIJ3-6.js → SignRequestScreen-CN-YxEIW.js} +1 -1
- package/dist/cjs/{StandardSignAndSendTransactionScreen-A5KpXb14.js → StandardSignAndSendTransactionScreen-BWqXsnZ-.js} +1 -1
- package/dist/cjs/{TelegramAuthScreen-qw6gcnZA.js → TelegramAuthScreen-JINnIb1q.js} +1 -1
- package/dist/cjs/{TransactionDetails-6aFlRhNd.js → TransactionDetails-DHxuRDQm.js} +1 -1
- package/dist/cjs/{TransactionErrorView-U-Fg5udU.js → TransactionErrorView-DV1Rbaza.js} +1 -1
- package/dist/cjs/{TransferFromWalletScreen-DnUQ6O_8.js → TransferFromWalletScreen-D1RGQm-9.js} +1 -1
- package/dist/cjs/{TransferOrBridgeLoadingScreen-C3pf0mwq.js → TransferOrBridgeLoadingScreen-0auJk1V_.js} +1 -1
- package/dist/cjs/{UpdateEmailScreen-dPy98Sn_.js → UpdateEmailScreen-CjEQsyJ6.js} +1 -1
- package/dist/cjs/{UpdatePhoneScreen-CtNBijCK.js → UpdatePhoneScreen-66qCevzc.js} +1 -1
- package/dist/cjs/{UserLimitReachedScreen-DwbMomyS.js → UserLimitReachedScreen-OwK_WZiy.js} +1 -1
- package/dist/cjs/{WalletInfoCard-DxO9lMen.js → WalletInfoCard-BgUUNBb1.js} +1 -1
- package/dist/cjs/{WalletInterstitialScreen-CsZg29Za.js → WalletInterstitialScreen-BMQau9a_.js} +1 -1
- package/dist/cjs/{WalletLink-J6Gw0D9R.js → WalletLink-B8qg2sNq.js} +1 -1
- package/dist/cjs/{WalletOverflowButton-Tdaiid33.js → WalletOverflowButton-4OUSs2qQ.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-BPd2qxKv.js → context-B6zndZbE.js} +1 -1
- package/dist/cjs/{ethers-CqH8abGL.js → ethers-BrWeKm_S.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/get-is-unified-wallet-CYQvifpN.js +1 -0
- package/dist/cjs/{index-B4TzPiCM.js → index-DBN8rlPN.js} +1 -1
- package/dist/cjs/{index-BsEjyknv.js → index-JLbo6ZA0.js} +1 -1
- package/dist/cjs/{index-Dz7affvL.js → index-xKFTBD9J.js} +5 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{prepareFundingModalData-Do7d2fgq.js → prepareFundingModalData-DKaL1Oqz.js} +1 -1
- package/dist/cjs/{shared-CbD3Tm1u.js → shared-DAxDIdOV.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-BjZ_f-Zv.js → shouldProceedtoEmbeddedWalletCreationFlow-Brj0fZpr.js} +1 -1
- package/dist/cjs/{smart-wallets-DFIScSPs.js → smart-wallets-DSBosnGS.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{to-ui-error-B83yFdtm.js → to-ui-error-3msE736K.js} +1 -1
- package/dist/cjs/{twitter-BVVRWkcG.js → twitter-CJSxxOMI.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-create-wallet-without-fallback-BSl4qcLv.js → use-create-wallet-without-fallback-DOZsyElA.js} +1 -1
- package/dist/cjs/{use-export-wallet-ABk4jSh5.js → use-export-wallet-DYcsnUD8.js} +1 -1
- package/dist/cjs/{useActiveWallet-B-Pd49hn.js → useActiveWallet-uEEQi70o.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-Cm0Ldnuy.js → useGetTokenPrice-tWpOVbJz.js} +1 -1
- package/dist/cjs/{useI18n-5uCrUblH.js → useI18n-5bG-Cpbl.js} +1 -1
- package/dist/cjs/{usePrivy-CANb3vg4.js → usePrivy-DZJwQPwT.js} +1 -1
- package/dist/cjs/{useSolanaRpcClient-BBCvBn6x.js → useSolanaRpcClient-CEhNB-sj.js} +1 -1
- package/dist/cjs/{useWallets-Bi_kf80t.js → useWallets-CMRZ0IEw.js} +1 -1
- package/dist/cjs/{useWallets-CTdzIPwr.js → useWallets-DXi6lmEg.js} +1 -1
- package/dist/dts/index.d.mts +1 -0
- package/dist/dts/index.d.ts +1 -0
- package/dist/esm/{AccountNotFoundScreen-S6aY2Bit.mjs → AccountNotFoundScreen-BANDQZGv.mjs} +1 -1
- package/dist/esm/{Address-BZeOq9QH.mjs → Address-C2aXxM2N.mjs} +1 -1
- package/dist/esm/{AffirmativeConsentScreen-Duhzxm_H.mjs → AffirmativeConsentScreen-CFZO2H5q.mjs} +1 -1
- package/dist/esm/{AllowlistRejectionScreen-BMPe-U6U.mjs → AllowlistRejectionScreen-DBeGUmgt.mjs} +1 -1
- package/dist/esm/{AuthenticateWithWalletScreen-B0-JIF_P.mjs → AuthenticateWithWalletScreen-ZM6DZFh1.mjs} +1 -1
- package/dist/esm/{AwaitingEvmToSolBridgingScreen-SpjPGAVg.mjs → AwaitingEvmToSolBridgingScreen-8IBtNu5_.mjs} +1 -1
- package/dist/esm/{AwaitingExternalEthereumTransferScreen-MaJkRZM2.mjs → AwaitingExternalEthereumTransferScreen-BN4n273Y.mjs} +1 -1
- package/dist/esm/{AwaitingPasswordlessCodeScreen-CpmHzcEh.mjs → AwaitingPasswordlessCodeScreen-BquZxC7l.mjs} +1 -1
- package/dist/esm/{AwaitingSolToEvmBridgingScreen-B3HJI5qn.mjs → AwaitingSolToEvmBridgingScreen-B0I6wDuo.mjs} +1 -1
- package/dist/esm/{BridgeNetworkSelectionView-ITdiT09i.mjs → BridgeNetworkSelectionView-BZmf7ayB.mjs} +1 -1
- package/dist/esm/{Button-CrJpeX0e.mjs → Button-3JMVXKiE.mjs} +1 -1
- package/dist/esm/{CaptchaScreen-BEvV9l59.mjs → CaptchaScreen-Bnh-Gpgm.mjs} +1 -1
- package/dist/esm/{CoinbaseOnrampStatusScreen-CYKvPSTa.mjs → CoinbaseOnrampStatusScreen-_W6kQCwE.mjs} +1 -1
- package/dist/esm/{ConnectEmailForm-CzIQouaK.mjs → ConnectEmailForm-o04NTrIc.mjs} +1 -1
- package/dist/esm/{ConnectLedgerScreen-B84x_XJQ.mjs → ConnectLedgerScreen-CQUW_48V.mjs} +1 -1
- package/dist/esm/{ConnectOnlyLandingScreen-DOUEqxQS.mjs → ConnectOnlyLandingScreen-BtemYXlu.mjs} +1 -1
- package/dist/esm/{ConnectOnlyStatusScreen-C2DOQ20l.mjs → ConnectOnlyStatusScreen-CN2kWiW2.mjs} +1 -1
- package/dist/esm/{ConnectOrCreateScreen-ls3v_wzh.mjs → ConnectOrCreateScreen-BC1JYHYR.mjs} +1 -1
- package/dist/esm/{ConnectPhoneForm-BeT3tDQM.mjs → ConnectPhoneForm-CK2ZaLcy.mjs} +1 -1
- package/dist/esm/ConnectWalletView-D3ZQBnjF.mjs +1 -0
- package/dist/esm/{ConnectionStatusScreen-BFOC7TO_.mjs → ConnectionStatusScreen-BHg6K1gF.mjs} +1 -1
- package/dist/esm/CrossAppAuthScreen-D1gqy4CI.mjs +1 -0
- package/dist/esm/CustomLandingScreenView-DOwh2oce.mjs +2 -0
- package/dist/esm/{DelegatedActionsConsentScreen-h8zjYxdK.mjs → DelegatedActionsConsentScreen-C2p3P6bN.mjs} +1 -1
- package/dist/esm/{DelegatedActionsRevokeScreen-C1RofLwl.mjs → DelegatedActionsRevokeScreen-C4XKaajw.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletConnectingScreen-DRLC8HnL.mjs → EmbeddedWalletConnectingScreen-k-UW2In7.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletCreatedScreen-BiqITDV_.mjs → EmbeddedWalletCreatedScreen-D-5pbs0R.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletKeyExportScreen-lPloqMsw.mjs → EmbeddedWalletKeyExportScreen-C35WVhPC.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-DjXY44ON.mjs → EmbeddedWalletOnAccountCreateScreen-BbhGfibt.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CfZ6F7Xo.mjs → EmbeddedWalletPasswordUpdateScreen-B3eyAAfe.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-1u-5wz14.mjs → EmbeddedWalletPasswordUpdateSplashScreen-D7wjWeB8.mjs} +1 -1
- package/dist/esm/{EnrollTotp-Ds_-ZGUd.mjs → EnrollTotp-BE-JDa07.mjs} +1 -1
- package/dist/esm/{ErrorScreen-A7eS3gFZ.mjs → ErrorScreen-CR_0-6OL.mjs} +1 -1
- package/dist/esm/{FarcasterConnectStatusScreen-CoUFovnM.mjs → FarcasterConnectStatusScreen-DcwiNT96.mjs} +1 -1
- package/dist/esm/{FarcasterSignerStatusScreen-DJMF_7OC.mjs → FarcasterSignerStatusScreen-DmELTB-0.mjs} +1 -1
- package/dist/esm/{FundSolWalletWithExternalSolanaWallet-BCElohac.mjs → FundSolWalletWithExternalSolanaWallet-BDy0ldlm.mjs} +1 -1
- package/dist/esm/{FundWalletMethodHeader-DBV2Rnau.mjs → FundWalletMethodHeader-C0uPKdYw.mjs} +1 -1
- package/dist/esm/{FundingEditAmountScreen-hLQBUAs6.mjs → FundingEditAmountScreen-aSBCTHvs.mjs} +1 -1
- package/dist/esm/{FundingMethodSelectionScreen-CQ6Kjv8P.mjs → FundingMethodSelectionScreen-BF0zdnRp.mjs} +1 -1
- package/dist/esm/HCaptchaWrapper-CUi9LJsp.mjs +1 -0
- package/dist/esm/{InAppBrowserLoginNotPossible-B6aOQR90.mjs → InAppBrowserLoginNotPossible-MMzbXP1G.mjs} +1 -1
- package/dist/esm/{InstallWalletScreen-gwlyer4j.mjs → InstallWalletScreen-CrnAF_wK.mjs} +1 -1
- package/dist/esm/{LandingScreen-BkCClWy8.mjs → LandingScreen-DvQZRxAA.mjs} +1 -1
- package/dist/esm/{LinkConflictScreen-C0K1Bw7W.mjs → LinkConflictScreen-CyCVN1lq.mjs} +1 -1
- package/dist/esm/{LinkEmailScreen-DDH1Ent-.mjs → LinkEmailScreen-D5s-Ggjy.mjs} +1 -1
- package/dist/esm/{LinkPasskeyScreen-75b0FmMc.mjs → LinkPasskeyScreen-Br7W1Zmq.mjs} +1 -1
- package/dist/esm/{LinkPhoneScreen-CZaTFcuX.mjs → LinkPhoneScreen-DbRDyzwM.mjs} +1 -1
- package/dist/esm/{LoginFailedScreen-Csu_ek1s.mjs → LoginFailedScreen-B1tnBE4h.mjs} +1 -1
- package/dist/esm/{ManualTransferScreen-Cn8sFLD_.mjs → ManualTransferScreen-pFyGqOCu.mjs} +1 -1
- package/dist/esm/{MfaAuthEnrollmentFlowScreen-9HiNxKYV.mjs → MfaAuthEnrollmentFlowScreen-C8Pvz5fy.mjs} +1 -1
- package/dist/esm/{MfaAuthVerifyFlowScreen-C9Pe8A-f.mjs → MfaAuthVerifyFlowScreen-CJEESJMU.mjs} +1 -1
- package/dist/esm/{MfaEnrollmentFlowScreen-C-VfRmbP.mjs → MfaEnrollmentFlowScreen-DNMYRR9X.mjs} +1 -1
- package/dist/esm/{MfaVerifyFlowScreen-BLzgEe8U.mjs → MfaVerifyFlowScreen-CzhmszLp.mjs} +1 -1
- package/dist/esm/{ModalHeader-YP9pLMEP.mjs → ModalHeader-B27O6soE.mjs} +1 -1
- package/dist/esm/{MoonpayStatusScreen-tt17kvkR.mjs → MoonpayStatusScreen-CzQ-mLP5.mjs} +1 -1
- package/dist/esm/{OAuthStatusScreen-DA8QEDgm.mjs → OAuthStatusScreen-D1IVqsCW.mjs} +1 -1
- package/dist/esm/{PasskeySelectSignupOrLogin-BnOxpeKy.mjs → PasskeySelectSignupOrLogin-CQUv5kpw.mjs} +1 -1
- package/dist/esm/{PasskeyStatusScreen-CqoYgdZ0.mjs → PasskeyStatusScreen-Co_LVG4x.mjs} +1 -1
- package/dist/esm/{PasswordRecoveryScreen-BgFiWz_H.mjs → PasswordRecoveryScreen-CKc7ZSJe.mjs} +1 -1
- package/dist/esm/{QrCode-C0_lXRph.mjs → QrCode-CGBH7ZqU.mjs} +1 -1
- package/dist/esm/{RecoveryOAuthStatusScreen-B698r-dZ.mjs → RecoveryOAuthStatusScreen-Co_qik6B.mjs} +1 -1
- package/dist/esm/{RecoveryPasswordCreateScreen-U7uAGUdt.mjs → RecoveryPasswordCreateScreen-DeZGEgr1.mjs} +1 -1
- package/dist/esm/{RecoverySelectionScreen-CvZ8jmi2.mjs → RecoverySelectionScreen-BOUh-dCZ.mjs} +1 -1
- package/dist/esm/{Screen-CpIMiJNF.mjs → Screen-Bj-1pwMI.mjs} +1 -1
- package/dist/esm/{ScreenLayout-t3qtbQ3-.mjs → ScreenLayout-Dp0ezg8Q.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-BlqLhOJS.mjs → SetAutomaticRecoveryScreen-DqeQkzbI.mjs} +1 -1
- package/dist/esm/{SetWalletPasswordForm-DMOSI5Cu.mjs → SetWalletPasswordForm-D9WKtYos.mjs} +1 -1
- package/dist/esm/{SignRequestScreen-Bc6WEdOH.mjs → SignRequestScreen-ClKQEiLC.mjs} +1 -1
- package/dist/esm/{StandardSignAndSendTransactionScreen-CNnIfg-v.mjs → StandardSignAndSendTransactionScreen-COscrw9p.mjs} +1 -1
- package/dist/esm/{TelegramAuthScreen-C_5cJWas.mjs → TelegramAuthScreen-DC1ppGbz.mjs} +1 -1
- package/dist/esm/{TransactionDetails-Dpy5T9tM.mjs → TransactionDetails-BBNigCES.mjs} +1 -1
- package/dist/esm/{TransactionErrorView-Dyy8JzAg.mjs → TransactionErrorView-DKnANlpi.mjs} +1 -1
- package/dist/esm/{TransferFromWalletScreen-DsWLEs0t.mjs → TransferFromWalletScreen-DW25GKHH.mjs} +1 -1
- package/dist/esm/{TransferOrBridgeLoadingScreen-CKF3jFy2.mjs → TransferOrBridgeLoadingScreen-R7No-8Yr.mjs} +1 -1
- package/dist/esm/{UpdateEmailScreen-DjS9mWl8.mjs → UpdateEmailScreen-CXd8_t7z.mjs} +1 -1
- package/dist/esm/{UpdatePhoneScreen-0Wm7i3sR.mjs → UpdatePhoneScreen-B9pfgcCa.mjs} +1 -1
- package/dist/esm/{UserLimitReachedScreen-C4J0L2bZ.mjs → UserLimitReachedScreen-pxpwGSM-.mjs} +1 -1
- package/dist/esm/{WalletInfoCard-QxupP_e1.mjs → WalletInfoCard-DFrqmXTc.mjs} +1 -1
- package/dist/esm/{WalletInterstitialScreen-ofT84gQY.mjs → WalletInterstitialScreen-BduifiaN.mjs} +1 -1
- package/dist/esm/{WalletLink-DFEVbh0m.mjs → WalletLink-D5DTXYny.mjs} +1 -1
- package/dist/esm/{WalletOverflowButton-gDOg31Q5.mjs → WalletOverflowButton-yerFFdMA.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/{context-BOoFAPna.mjs → context-BqHnoxK5.mjs} +1 -1
- package/dist/esm/{ethers-DnpKeAXc.mjs → ethers-CUqPIRrW.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/get-is-unified-wallet-GLvRyJlT.mjs +1 -0
- package/dist/esm/{index-DL7cst3F.mjs → index-5iW2YlYC.mjs} +1 -1
- package/dist/esm/{index-CUao1WyN.mjs → index-B24hEnAn.mjs} +4 -4
- package/dist/esm/{index-Doo2h9wE.mjs → index-DT54fwyL.mjs} +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{prepareFundingModalData-CzDMa8gy.mjs → prepareFundingModalData-lYYA8ZfI.mjs} +1 -1
- package/dist/esm/{shared-C_3e8pDa.mjs → shared-RdgpdEMG.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BkG4QVN4.mjs → shouldProceedtoEmbeddedWalletCreationFlow-F4FtZ8gq.mjs} +1 -1
- package/dist/esm/{smart-wallets-DUDljgWK.mjs → smart-wallets-Bk5LCXUu.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{to-ui-error-BuXu0iWM.mjs → to-ui-error-ySeuG-hJ.mjs} +1 -1
- package/dist/esm/{twitter-6jomarO4.mjs → twitter-BoAxhlj6.mjs} +1 -1
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{use-create-wallet-without-fallback-4kJuPNnl.mjs → use-create-wallet-without-fallback-DCFiaOUd.mjs} +1 -1
- package/dist/esm/{use-export-wallet-DLpQ6ZuE.mjs → use-export-wallet-BSyJ6wXH.mjs} +1 -1
- package/dist/esm/{useActiveWallet-BdFIc7_K.mjs → useActiveWallet-CBIiGG1k.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-Cw9UgOp3.mjs → useGetTokenPrice-DOgFQ9vL.mjs} +1 -1
- package/dist/esm/{useI18n-fcpgyVzo.mjs → useI18n-BotQj3s2.mjs} +1 -1
- package/dist/esm/{usePrivy-CeQ3C1KS.mjs → usePrivy-C5z76Qhs.mjs} +1 -1
- package/dist/esm/{useSolanaRpcClient-DyBoxaVM.mjs → useSolanaRpcClient-BMkY8W80.mjs} +1 -1
- package/dist/esm/{useWallets-3r4yfFNg.mjs → useWallets-Aw21dxK9.mjs} +1 -1
- package/dist/esm/{useWallets-CZrLXHtS.mjs → useWallets-CHDUUIx3.mjs} +1 -1
- package/package.json +3 -3
- package/dist/cjs/ConnectWalletView-B7tEQCbZ.js +0 -1
- package/dist/cjs/CrossAppAuthScreen-M__fDCJH.js +0 -1
- package/dist/cjs/CustomLandingScreenView-D-7kPzjH.js +0 -2
- package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +0 -1
- package/dist/cjs/get-is-unified-wallet-D6pn8A8g.js +0 -1
- package/dist/esm/ConnectWalletView-Ch6TwKX_.mjs +0 -1
- package/dist/esm/CrossAppAuthScreen-BbWHC41s.mjs +0 -1
- package/dist/esm/CustomLandingScreenView-CKarTBuo.mjs +0 -2
- package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +0 -1
- package/dist/esm/get-is-unified-wallet-Ca5aEojK.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-B6zndZbE.js"),i=require("./index-xKFTBD9J.js"),s=require("./internal-context-NWsAL807.js"),o=require("./use-create-wallet-without-fallback-DOZsyElA.js"),a=require("./get-is-unified-wallet-CYQvifpN.js"),u=require("./SetWalletPasswordForm-CwwM_HsZ.js");require("@privy-io/js-sdk-core"),require("tinycolor2"),require("uuid"),require("jose"),require("eventemitter3"),require("./useActiveWallet-uEEQi70o.js"),require("zustand"),require("styled-components"),require("react-device-detect"),require("./prepareFundingModalData-DKaL1Oqz.js"),require("./events-context-Di6--rDg.js"),require("viem"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-CMRZ0IEw.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DZJwQPwT.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("ofetch"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("./Layouts-dRL0OSpp.js"),require("./ModalHeader-D9UKo-3h.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./shared-DAxDIdOV.js"),require("@heroicons/react/24/outline/ArrowPathIcon"),require("@heroicons/react/24/outline/EyeIcon"),require("@heroicons/react/24/outline/EyeSlashIcon"),require("./Button-CyX7JNsa.js"),require("./Checkbox-DXPQZFlQ.js"),require("@heroicons/react/24/outline/KeyIcon"),require("@heroicons/react/24/solid/CheckCircleIcon"),require("fast-password-entropy"),require("secure-password-utilities"),require("secure-password-utilities/wordlists"),require("@heroicons/react/24/outline/ArrowDownTrayIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/DocumentDuplicateIcon"),require("@heroicons/react/24/solid/XCircleIcon"),require("./ScreenHeader-CyURV6Ti.js");const n={component:()=>{let{navigate:n,data:c,onUserCloseViaDialogOrKeybindRef:l}=a.usePrivyModal(),d=t.useAppConfig(),[q,h]=r.useState(""),[w,p]=r.useState(!1),[y,v]=r.useState(),[m,j]=r.useState(null),{create:f}=o.useCreateWalletWithoutFallback(),{authenticated:C,user:b}=a.usePrivyContext(),{closePrivyModal:g,isNewUserThisSession:P,initializeWalletProxy:S}=s.usePrivyInternal(),{onSuccess:I,onFailure:x,callAuthOnSuccessOnClose:E,shouldCreateEth:W,shouldCreateSol:A}=c.createWallet,[k,M]=r.useState(null),T=new i.RunEffectOnce((async()=>{try{let e;if(W&&A)e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"ethereum",walletIndex:0,latestUser:b}),e=await f({chainType:"solana",walletIndex:0,latestUser:e.user});else if(A)e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"solana",walletIndex:0,latestUser:b});else{if(!W)throw Error("Invalid args to create wallet");e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"ethereum",walletIndex:0,latestUser:b})}M(e),P?n("EmbeddedWalletCreatedScreen"):(I(e),g({shouldCallAuthOnSuccess:E}))}catch(e){h(e.message)}}));r.useEffect((()=>{m||S(3e4).then((e=>j(e)))}),[m]),r.useEffect((()=>{if(!C||!b)return n("LandingScreen"),void x(Error("User must be authenticated before creating a Privy wallet"))}),[C]),l.current=()=>null;/*#__PURE__*/return e.jsx(u.SetWalletPasswordForm,{config:{initiatedBy:"automatic"},appName:d?.name||"privy",loading:!m,buttonLoading:w,buttonHideAnimations:!k&&w,isResettingPassword:!1,error:q,password:y||"",onClose:()=>{k&&"user-passcode"!==k.account.recoveryMethod?(x(new s.PrivyEmbeddedWalletError("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):k?(I(k),g({shouldCallAuthOnSuccess:E})):(x(new s.PrivyEmbeddedWalletError("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))},onPasswordChange:v,onPasswordGenerate:()=>v(u.generatePassphrase()),onSubmit:async()=>(p(!0),T.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>p(!1))))})}};exports.EmbeddedWalletPasswordCreateScreen=n,exports.default=n;
|
package/dist/cjs/{RecoverySelectionScreen-C62og2VL.js → RecoverySelectionScreen-Chnml1GU.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("@heroicons/react/24/outline/PencilSquareIcon"),t=require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),i=require("react"),s=require("styled-components"),n=require("./get-is-unified-wallet-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("@heroicons/react/24/outline/PencilSquareIcon"),t=require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),i=require("react"),s=require("styled-components"),n=require("./get-is-unified-wallet-CYQvifpN.js"),c=require("./Button-CyX7JNsa.js"),u=require("./ModalHeader-D9UKo-3h.js"),l=require("./ScreenHeader-CyURV6Ti.js"),a=require("./context-B6zndZbE.js"),d=require("./internal-context-NWsAL807.js"),h=require("./index-xKFTBD9J.js"),p=require("./styles-Ca_DS00a.js"),y=require("./useActiveWallet-uEEQi70o.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-CMRZ0IEw.js"),require("./prepareFundingModalData-DKaL1Oqz.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DZJwQPwT.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js");var q=/*#__PURE__*/v(r),j=/*#__PURE__*/v(o),g=/*#__PURE__*/v(t);let x=/*#__PURE__*/s.styled.div.withConfig({displayName:"IconContainer",componentId:"sc-1c4e63fb-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),C={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},m=({onClose:r})=>/*#__PURE__*/e.jsxs(p.RecoveryExplainerContainer,{children:[/*#__PURE__*/e.jsx(l.CenteredScreenHeader,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/e.jsx(g.default,{width:48}),description:/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/e.jsx("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/e.jsx(c.PrimaryButton,{onClick:r,children:"Select backup method"})]});const w={component:()=>{let[r,o]=i.useState(!1),{navigate:t,lastScreen:s,navigateBack:c,setModalData:v,data:g,onUserCloseViaDialogOrKeybindRef:w}=n.usePrivyModal(),{user:f}=n.usePrivyContext(),{embeddedWallets:S}=a.useAppConfig(),{closePrivyModal:b}=d.usePrivyInternal(),k=n.getPrivyPrimaryWallet(f),P=null===k,{isInAccountCreateFlow:M,isResettingPassword:A,shouldCreateEth:I,shouldCreateSol:F}=g.recoverySelection,W=k&&"privy"!==k.recoveryMethod,B=W?/*#__PURE__*/e.jsxs("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/e.jsx("strong",{children:C[k?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function R(e){v({recoveryOAuthStatus:{provider:e,action:P?"create-wallet":"set-recovery",isInAccountCreateFlow:M,shouldCreateEth:I,shouldCreateSol:F}}),t("RecoveryOAuthScreen")}function O(){g?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),b({shouldCallAuthOnSuccess:g?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return w.current=O,/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(u.ModalHeader,{onClose:O,backFn:r?()=>o(!1):s?c:void 0,infoFn:s||r?void 0:()=>o(!0)},"header"),r?/*#__PURE__*/e.jsx(m,{onClose:()=>o(!1)}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.CenteredScreenHeader,{title:W?"Update backup method":"Secure your account",icon:/*#__PURE__*/e.jsx(q.default,{width:48}),description:B}),/*#__PURE__*/e.jsx(p.RecoveryContainer,{children:S.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(k?.recoveryMethod||"")||e!==k?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>R("google-drive"),children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(p.GoogleDrive,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>R("icloud"),children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(p.AppleICloud,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>{t(h.embeddedWalletSetPasswordScreen({isCreatingWallet:P,skipSplashScreen:!0}))},children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(j.default,{style:{width:18}})}),A?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),/*#__PURE__*/e.jsx(u.BlobbyFooter,{})]})}};exports.RecoverySelectionScreen=w,exports.default=w;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("styled-components"),n=require("./useActiveWallet-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("styled-components"),n=require("./useActiveWallet-uEEQi70o.js"),o=require("./ModalHeader-D9UKo-3h.js"),t=require("./index-CRFXS9pP.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/a(r);const c=/*#__PURE__*/i.styled.div.withConfig({displayName:"ScreenRoot",componentId:"sc-2e815abe-0"})(["--screen-space:16px;--screen-space-lg:calc(var(--screen-space) * 1.5);position:relative;overflow:hidden;margin:0 calc(-1 * var(--screen-space));height:100%;border-radius:var(--privy-border-radius-lg);"]),s=/*#__PURE__*/i.styled.div.withConfig({displayName:"ScreenRootInner",componentId:"sc-2e815abe-1"})(["display:flex;flex-direction:column;gap:calc(var(--screen-space) * 1.5);width:100%;background:var(--privy-color-background);padding:0 var(--screen-space-lg) var(--screen-space);height:100%;border-radius:var(--privy-border-radius-lg);"]),d=/*#__PURE__*/i.styled.div.withConfig({displayName:"HeaderContainer",componentId:"sc-2e815abe-2"})(["position:relative;display:flex;flex-direction:column;"]),p=/*#__PURE__*/i.styled(o.ModalHeader).withConfig({displayName:"StyledModalHeader",componentId:"sc-2e815abe-3"})(["margin:0 -8px;"]),g=/*#__PURE__*/i.styled.div.withConfig({displayName:"BodyContainer",componentId:"sc-2e815abe-4"})(["flex:1 1 auto;display:flex;flex-direction:column;overflow-y:auto;padding:3px;margin:-3px;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(({$colorScheme:e})=>"light"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0)),h=/*#__PURE__*/i.styled.div.withConfig({displayName:"FooterContainer",componentId:"sc-2e815abe-5"})(["display:flex;flex-direction:column;gap:var(--screen-space-lg);"]);let u=/*#__PURE__*/i.styled.div.withConfig({displayName:"CenteredHeader",componentId:"sc-2e815abe-6"})(["text-align:center;display:flex;flex-direction:column;align-items:center;gap:var(--screen-space);"]),y=/*#__PURE__*/i.styled.div.withConfig({displayName:"TitleContainer",componentId:"sc-2e815abe-7"})(["display:flex;flex-direction:column;gap:4px;"]),v=/*#__PURE__*/i.styled.h3.withConfig({displayName:"HeaderTitle",componentId:"sc-2e815abe-8"})(["&&{font-size:20px;line-height:32px;font-weight:500;color:var(--privy-color-foreground);margin:0;}"]),x=/*#__PURE__*/i.styled.p.withConfig({displayName:"HeaderSubtitle",componentId:"sc-2e815abe-9"})(["&&{margin:0;font-size:16px;font-weight:300;line-height:24px;color:var(--privy-color-foreground);}"]),f=/*#__PURE__*/i.styled.div.withConfig({displayName:"IconContainer",componentId:"sc-2e815abe-10"})(["background:",";border-radius:50%;width:64px;height:64px;display:flex;align-items:center;justify-content:center;"],(({$variant:e})=>{switch(e){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"warning":return"var(--privy-color-warn, #FEF3C7)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";case"loading":case"logo":return"transparent";default:return"var(--privy-color-background-2)"}})),m=/*#__PURE__*/i.styled.div.withConfig({displayName:"LogoContainer",componentId:"sc-2e815abe-11"})(["display:flex;align-items:center;justify-content:center;margin-bottom:var(--screen-space);img,svg{max-height:90px;max-width:180px;}"]),b=/*#__PURE__*/i.styled.div.withConfig({displayName:"LoadingWithIconContainer",componentId:"sc-2e815abe-12"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > :first-child{position:relative;}> div > :last-child{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);}"]);const w=({children:r,...i})=>/*#__PURE__*/e.jsx(c,{children:/*#__PURE__*/e.jsx(s,{...i,children:r})});let j=/*#__PURE__*/i.styled.div.withConfig({displayName:"ProgressBarContainer",componentId:"sc-2e815abe-13"})(["position:absolute;top:0;left:calc(-1 * var(--screen-space-lg));width:calc(100% + calc(var(--screen-space-lg) * 2));height:4px;background:var(--privy-color-background-2);border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;"]),C=/*#__PURE__*/i.styled(o.BlobbyFooter).withConfig({displayName:"StyledBlobbyFooter",componentId:"sc-2e815abe-14"})(["padding:0;&& a{padding:0;color:var(--privy-color-foreground-3);}"]),k=/*#__PURE__*/i.styled.div.withConfig({displayName:"ProgressBarFill",componentId:"sc-2e815abe-15"})(["height:100%;width:","%;background:var(--privy-color-foreground-3);border-radius:2px;transition:width 300ms ease-in-out;"],(({pct:e})=>e)),I=({step:r})=>r?/*#__PURE__*/e.jsx(j,{children:/*#__PURE__*/e.jsx(k,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:r,subtitle:i,icon:n,iconVariant:o,iconLoadingStatus:t,showBack:a,onBack:l,showInfo:c,onInfo:s,showClose:g,onClose:h,step:f,...m})=>/*#__PURE__*/e.jsxs(d,{...m,children:[/*#__PURE__*/e.jsx(p,{backFn:a?l:void 0,infoFn:c?s:void 0,onClose:g?h:void 0,closeable:g}),(n||o||r||i)&&/*#__PURE__*/e.jsxs(u,{children:[n||o?/*#__PURE__*/e.jsx(w.Icon,{icon:n,variant:o,loadingStatus:t}):null,/*#__PURE__*/e.jsxs(y,{children:[r&&/*#__PURE__*/e.jsx(v,{children:r}),i&&/*#__PURE__*/e.jsx(x,{children:i})]})]}),f&&/*#__PURE__*/e.jsx(I,{step:f})]}),w.Body=/*#__PURE__*/l.default.forwardRef((({children:r,...i},n)=>/*#__PURE__*/e.jsx(g,{ref:n,...i,children:r}))),w.Body.displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e.jsx(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e.jsx(N,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e.jsx(E,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e.jsx(C,{}),w.Icon=({icon:r,variant:i="subtle",loadingStatus:o})=>"logo"===i&&r?"string"==typeof r?/*#__PURE__*/e.jsx(m,{children:/*#__PURE__*/e.jsx("img",{src:r,alt:""})}):/*#__PURE__*/l.default.isValidElement(r)?/*#__PURE__*/e.jsx(m,{children:r}):
|
|
2
2
|
/*#__PURE__*/e.jsx(m,{children:/*#__PURE__*/l.default.createElement(r)}):"loading"===i?r?
|
|
3
3
|
/*#__PURE__*/e.jsx(b,{children:/*#__PURE__*/e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[/*#__PURE__*/e.jsx(n.ConnectionLoader,{success:o?.success,fail:o?.fail}),"string"==typeof r?
|
|
4
4
|
/*#__PURE__*/e.jsx("span",{style:{background:`url('${r}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):/*#__PURE__*/l.default.isValidElement(r)?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("./Button-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("./Button-CyX7JNsa.js"),n=require("./Screen-Cjd8kgCg.js");exports.ScreenLayout=({primaryCta:t,secondaryCta:l,helpText:s,watermark:a=!0,children:c,...i})=>{let u=t||l?/*#__PURE__*/e.jsxs(e.Fragment,{children:[t&&(()=>{let{label:n,...l}=t,s=l.variant||"primary";/*#__PURE__*/return e.jsx(r.Button,{...l,variant:s,style:{width:"100%",...l.style},children:n})})(),l&&(()=>{let{label:n,...t}=l,s=t.variant||"secondary";/*#__PURE__*/return e.jsx(r.Button,{...t,variant:s,style:{width:"100%",...t.style},children:n})})()]}):null;/*#__PURE__*/return e.jsxs(n.Screen,{id:i.id,className:i.className,children:[/*#__PURE__*/e.jsx(n.Screen.Header,{...i}),c?/*#__PURE__*/e.jsx(n.Screen.Body,{children:c}):null,s||u||a?/*#__PURE__*/e.jsxs(n.Screen.Footer,{children:[s?/*#__PURE__*/e.jsx(n.Screen.HelpText,{children:s}):null,u?/*#__PURE__*/e.jsx(n.Screen.Actions,{children:u}):null,a?/*#__PURE__*/e.jsx(n.Screen.Watermark,{}):null]}):null]})};
|
package/dist/cjs/{SetAutomaticRecoveryScreen-3unBTQcy.js → SetAutomaticRecoveryScreen-C82NF48g.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),t=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("react"),i=require("./get-is-unified-wallet-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),t=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("react"),i=require("./get-is-unified-wallet-CYQvifpN.js"),n=require("./Button-CyX7JNsa.js"),l=require("./ModalHeader-D9UKo-3h.js"),s=require("styled-components"),a=require("./Subtitle-Dtmrw8l5.js"),c=require("./Title-C-tHJvrb.js"),u=require("./context-B6zndZbE.js"),d=require("./internal-context-NWsAL807.js"),y=require("./useActiveWallet-uEEQi70o.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("zustand"),require("react-device-detect"),require("./prepareFundingModalData-DKaL1Oqz.js"),require("eventemitter3"),require("./events-context-Di6--rDg.js"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-CMRZ0IEw.js");var v=/*#__PURE__*/h(r),f=/*#__PURE__*/h(t);const g=/*#__PURE__*/s.styled.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),m={component:()=>{let{user:r}=i.usePrivyContext(),{client:t,walletProxy:s,refreshSessionAndUser:h,closePrivyModal:m}=d.usePrivyInternal(),j=i.usePrivyModal(),{entropyId:q,entropyIdVerifier:x}=j.data?.recoverWallet,[p,w]=o.useState(!1),[S,b]=o.useState(null),[C,I]=o.useState(null);function W(){if(!p){if(C)return j.data?.setWalletPassword?.onFailure(C),void m();if(!S)return j.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void m()}}j.onUserCloseViaDialogOrKeybindRef.current=W;let P=!(!p&&!S);return C?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:W},"header"),/*#__PURE__*/e.jsx(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/e.jsx(v.default,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/e.jsx(c.Title,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/e.jsx(y.Grow,{style:{minHeight:"2rem"}}),/*#__PURE__*/e.jsx(n.PrimaryButtonWithoutGray,{onClick:()=>I(null),children:"Try again"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:W},"header"),/*#__PURE__*/e.jsx(f.default,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/e.jsx(c.Title,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/e.jsx(a.Subtitle,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/e.jsx(y.Grow,{style:{minHeight:"2rem"}}),/*#__PURE__*/e.jsx(n.PrimaryButtonWithoutGray,{loading:p,disabled:P,onClick:()=>async function(){w(!0);try{let e=await t.getAccessToken(),o=i.getPrivyWalletWithAddress(r,q);if(!e||!s||!o)return;if(!(await s.setRecovery({accessToken:e,entropyId:q,entropyIdVerifier:x,existingRecoveryMethod:o.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let n=await h();if(!n)throw Error("Unable to set recovery on wallet");let l=i.getPrivyWalletWithAddress(n,o.address);if(!l)throw Error("Unabled to set recovery on wallet");b(!!n),setTimeout((()=>{j.data?.setWalletPassword?.onSuccess(l),m()}),u.DEFAULT_SUCCESS_SCREEN_DURATION_MS)}catch(e){I(e)}finally{w(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})}};exports.SetAutomaticRecoveryScreen=m,exports.default=m;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-B6zndZbE.js"),o=require("./get-is-unified-wallet-CYQvifpN.js"),n=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),s=require("./Layouts-dRL0OSpp.js"),a=require("./ModalHeader-D9UKo-3h.js"),i=require("./shared-DAxDIdOV.js"),l=require("styled-components"),c=require("./Button-CyX7JNsa.js"),d=require("./Checkbox-DXPQZFlQ.js"),u=require("@heroicons/react/24/outline/KeyIcon"),h=require("@heroicons/react/24/solid/CheckCircleIcon"),p=require("fast-password-entropy"),x=require("secure-password-utilities"),j=require("secure-password-utilities/wordlists"),g=require("@heroicons/react/24/outline/ArrowDownTrayIcon"),y=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),m=require("@heroicons/react/24/outline/DocumentDuplicateIcon"),f=require("@heroicons/react/24/solid/XCircleIcon"),v=require("./ScreenHeader-CyURV6Ti.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function w(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var C=/*#__PURE__*/b(n),k=/*#__PURE__*/b(u),S=/*#__PURE__*/b(h),I=/*#__PURE__*/b(p),B=/*#__PURE__*/w(x),R=/*#__PURE__*/b(g),P=/*#__PURE__*/b(y),E=/*#__PURE__*/b(m),q=/*#__PURE__*/b(f);const F=({buttonHideAnimations:t,buttonLoading:o,password:n,onSubmit:l,onBack:c})=>{let[d,u]=r.useState(!0),[h,p]=r.useState(!1),[x,j]=r.useState(""),g=n===x;return r.useEffect((()=>{x&&!h&&p(!0)}),[x]),/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1,backFn:c}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{children:[/*#__PURE__*/e.jsx(i.PasswordInput,{value:x,onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&l()},onBlur:()=>p(!0),placeholder:"confirm your password",type:d?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/e.jsx(i.InputRightIcons,{style:{right:"0.75rem"},children:d?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>u(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>u(!0)})})]}),
|
|
2
2
|
/*#__PURE__*/e.jsx(i.StatusText,{"aria-hidden":!h||g,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:l,loading:o,disabled:!g,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})},H=({buttonHideAnimations:t,buttonLoading:o,onSubmit:n,onBack:l,config:u})=>{let[h,p]=r.useState(!1);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1,backFn:l}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/e.jsx(i.Details,{children:/*#__PURE__*/e.jsxs(i.DetailItem,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),p((e=>!e))},children:[/*#__PURE__*/e.jsx(d.Checkbox,{color:"var(--privy-color-error)",readOnly:!0,checked:h}),/*#__PURE__*/e.jsx(e.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e.jsxs(A,{children:["user"===u.initiatedBy&&/*#__PURE__*/e.jsx(c.SecondaryButton,{onClick:u.onCancel,disabled:o,children:"Cancel"}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:n,loading:o,$hideAnimations:t,disabled:!h,children:"Set Password"})]}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})};let A=/*#__PURE__*/l.styled.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),D=/[a-z]/,T=/[A-Z]/,$=/[0-9]/,L="!@#$%^&*()\\-_+.",M=`a-zA-Z0-9${L}`,O=RegExp(`[${L}]`),U=RegExp(`[${M}]`);const N=RegExp(`^[${M}]{6,}$`);function W(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function z(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return D.test(e)&&(r+=1),T.test(e)&&(r+=1),$.test(e)&&(r+=1),O.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+I.default(e)/95)/2}const _=({buttonHideAnimations:t,buttonLoading:o,password:n="",config:l,isResettingPassword:c,onSubmit:d,onClose:u,onBack:h,onPasswordChange:p,onPasswordGenerate:x})=>{let[j,g]=r.useState(!1),[y,m]=r.useState(!1);r.useEffect((()=>{n&&!y&&m(!0)}),[n]);let f=r.useMemo((()=>y?6>(n?.length||0)?"Password must be at least 6 characters":N.test(n||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!U.test(e))).map((e=>e.replace(" ","SPACE"))))])(n).join(" ")} )`:null),[n,y]),v=r.useMemo((()=>f?{value:0,label:"Weak"}:function(e=""){let r=z(e);return{value:r,label:W(r)}}(n)),[n,f]),b=r.useMemo((()=>!n?.length||!!f),[f,n]);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{onClose:u,closeable:"user"===l.initiatedBy,backFn:h}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(k.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[c?"Reset":"Set"," your password"]}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{children:[/*#__PURE__*/e.jsx(i.PasswordInput,{value:n,onChange:e=>p(e.target.value),onKeyUp:e=>{"Enter"===e.key&&d()},placeholder:"enter or generate a strong password",type:j?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e.jsxs(i.InputRightIcons,{style:{width:"3.5rem"},children:[j?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>g(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>g(!0)}),/*#__PURE__*/e.jsx(i.RegenerateIcon,{onClick:x})]})]}),/*#__PURE__*/e.jsx(i.StrengthMeter,{value:0===v.value?.01:v.value,label:v.label}),/*#__PURE__*/e.jsx(i.StatusText,{error:!!f,children:f||`Password Strength: ${y?v.label:"--"}`}),/*#__PURE__*/e.jsxs(K,{children:[/*#__PURE__*/e.jsx(G,{children:/*#__PURE__*/e.jsxs(i.Details,{children:[/*#__PURE__*/e.jsxs(i.DetailItem,{children:[/*#__PURE__*/e.jsx(S.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e.jsxs(i.DetailItem,{children:[/*#__PURE__*/e.jsx(S.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:d,loading:o,disabled:b,$hideAnimations:t,children:"Continue"})]})]}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})};let G=/*#__PURE__*/l.styled(i.Details).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),K=/*#__PURE__*/l.styled.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const Y=({buttonHideAnimations:t,buttonLoading:o,appName:n,password:l,onSubmit:c,onBack:d})=>{let[u,h]=r.useState(!1),[p,x]=r.useState(!0),j=r.useCallback((()=>{h(!0),l&&navigator.clipboard.writeText(l)}),[l]),g=r.useCallback((()=>{let e=document.createElement("a"),r=n.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),t=new Blob([Z(n,l)],{type:"text/plain"}),o=URL.createObjectURL(t);e.href=o,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(o)}),5e3)}),[l]);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{backFn:d,closeable:!1}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{centered:!0,children:[/*#__PURE__*/e.jsx(i.PasswordDisplay,{children:p?"•".repeat(l.length):l}),/*#__PURE__*/e.jsx(i.InputRightIcons,{style:{right:"0.75rem"},children:p?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>x(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>x(!0)})})]}),/*#__PURE__*/e.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/e.jsx(i.ExportButton,{onClick:j,children:u?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(P.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(E.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e.jsxs(i.ExportButton,{onClick:g,children:[/*#__PURE__*/e.jsx(R.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:c,loading:o,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})};let Z=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const X=({error:r,onClose:t})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),r?/*#__PURE__*/e.jsxs(s.CenteredItemWithGap,{children:[/*#__PURE__*/e.jsx(q.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/e.jsx(v.CenteredScreenHeader,{title:"Something went wrong",description:r})]}):/*#__PURE__*/e.jsxs(s.CenteredItemWithGap,{children:[/*#__PURE__*/e.jsx(S.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/e.jsx(v.CenteredScreenHeader,{title:"Success"})]}),/*#__PURE__*/e.jsx(c.PrimaryButton,{onClick:t,children:"Close"}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]});let J=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};exports.SetWalletPasswordForm=({onSubmit:n,...s})=>{let{lastScreen:a,navigate:i}=o.usePrivyModal(),{send:l,state:c}=(()=>{let[e,t]=r.useReducer(J,"creating");return{send:t,state:e}})(),d=r.useCallback((async()=>{"finalizing"===c&&await n(),l("next")}),[c,l,n]);r.useEffect((()=>{let e;return"done"===c&&"automatic"===s.config.initiatedBy&&(e=setTimeout((()=>s.onClose?.()),t.DEFAULT_SUCCESS_SCREEN_DURATION_MS)),()=>{e&&clearTimeout(e)}}),[c,s.config.initiatedBy,s.onClose]);let u=r.useCallback((()=>{l("back")}),[l]),h=r.useCallback((()=>{i("RecoverySelectionScreen")}),[a,i]);return"creating"===c?/*#__PURE__*/e.jsx(_,{...s,onSubmit:d,onBack:"RecoverySelectionScreen"===a?h:void 0}):"saving"===c?/*#__PURE__*/e.jsx(Y,{...s,onSubmit:d,onBack:u}):"confirming"===c?/*#__PURE__*/e.jsx(F,{...s,onSubmit:d,onBack:u}):"finalizing"===c?/*#__PURE__*/e.jsx(H,{...s,onSubmit:d,onBack:u}):"done"===c?/*#__PURE__*/e.jsx(X,{...s,onSubmit:d}):null},exports.generatePassphrase=()=>B.generatePassphrase(4,j.DEFAULT_WORDLIST);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("@scure/base"),i=require("lucide-react"),t=require("react"),o=require("styled-components"),s=require("viem"),n=require("@privy-io/js-sdk-core"),a=require("./CopyToClipboard-fd8Z3kQX.js"),l=require("./Layouts-dRL0OSpp.js"),c=require("./JsonTree-xaeo0q6z.js"),d=require("./prepareFundingModalData-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("@scure/base"),i=require("lucide-react"),t=require("react"),o=require("styled-components"),s=require("viem"),n=require("@privy-io/js-sdk-core"),a=require("./CopyToClipboard-fd8Z3kQX.js"),l=require("./Layouts-dRL0OSpp.js"),c=require("./JsonTree-xaeo0q6z.js"),d=require("./prepareFundingModalData-DKaL1Oqz.js"),u=require("./context-B6zndZbE.js"),p=require("./internal-context-NWsAL807.js"),y=require("./get-is-unified-wallet-CYQvifpN.js"),g=require("./ScreenLayout-0BeoRza6.js");require("./copy-BiZ7dtqy.js"),require("eventemitter3"),require("tinycolor2"),require("ofetch"),require("./Button-CyX7JNsa.js"),require("./useActiveWallet-uEEQi70o.js"),require("zustand"),require("react-device-detect"),require("./events-context-Di6--rDg.js"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-CMRZ0IEw.js"),require("./Screen-Cjd8kgCg.js"),require("./ModalHeader-D9UKo-3h.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./index-CRFXS9pP.js");const x=/*#__PURE__*/o.styled.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(e=>"sm"===e.size?"65px":"140px"),(e=>"sm"===e.size?"65px":"140px"));let h=e=>{if(!s.isHex(e))return e;try{let r=s.hexToString(e);return r.includes("�")?e:r}catch{return e}},m=e=>{try{let i=r.base64.decode(e),t=(new TextDecoder).decode(i);return t.includes("�")?e:t}catch{return e}},q=r=>{let{types:i,primaryType:t,...o}=r.typedData;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(j,{data:o}),/*#__PURE__*/e.jsx(a.CopytoClipboardButton,{text:(s=r.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const C=({method:r,messageData:t,copy:o,iconUrl:s,isLoading:n,success:a,walletProxyIsLoading:c,errorMessage:d,isCancellable:u,onSign:p,onCancel:y,onClose:C})=>/*#__PURE__*/e.jsx(g.ScreenLayout,{title:o.title,subtitle:o.description,showClose:!0,onClose:C,icon:i.Edit,iconVariant:"subtle",helpText:d?/*#__PURE__*/e.jsx(S,{children:d}):void 0,primaryCta:{label:o.buttonText,onClick:p,disabled:n||a||c,loading:n},secondaryCta:u?{label:"Not now",onClick:y,disabled:n||a||c}:void 0,watermark:!0,children:/*#__PURE__*/e.jsxs(l.FixedGappedContainer,{children:[s?/*#__PURE__*/e.jsx(x,{style:{alignSelf:"center"},size:"sm",src:s,alt:"app image"}):null,/*#__PURE__*/e.jsxs(E,{children:["personal_sign"===r&&/*#__PURE__*/e.jsx(T,{children:h(t)}),"eth_signTypedData_v4"===r&&/*#__PURE__*/e.jsx(q,{typedData:t}),"solana_signMessage"===r&&/*#__PURE__*/e.jsx(T,{children:m(t)})]})]})}),v={component:()=>{let{authenticated:r}=y.usePrivyContext(),{initializeWalletProxy:i,closePrivyModal:o}=p.usePrivyInternal(),{navigate:s,data:a,onUserCloseViaDialogOrKeybindRef:l}=y.usePrivyModal(),[c,g]=t.useState(!0),[x,h]=t.useState(""),[m,q]=t.useState(),[v,E]=t.useState(null),[S,j]=t.useState(!1);t.useEffect((()=>{r||s("LandingScreen")}),[r]),t.useEffect((()=>{i(u.WALLET_PROXY_TIMEOUT).then((e=>{g(!1),e||(h("An error has occurred, please try again."),q(new d.PrivyProviderRpcError(new d.ProviderRpcError(x,n.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:T,data:w,confirmAndSign:f,onSuccess:R,onFailure:b,uiOptions:P}=a.signMessage,_={title:P?.title||"Sign message",description:P?.description||"Signing this message will not cost you any fees.",buttonText:P?.buttonText||"Sign and continue"},D=e=>{e?R(e):b(m||new d.PrivyProviderRpcError(new d.ProviderRpcError("The user rejected the request.",n.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{E(null),h(""),q(void 0)}),200)};l.current=()=>{D(v)};/*#__PURE__*/return e.jsx(C,{method:T,messageData:w,copy:_,iconUrl:P?.iconUrl&&"string"==typeof P.iconUrl?P.iconUrl:void 0,isLoading:S,success:null!==v,walletProxyIsLoading:c,errorMessage:x,isCancellable:P?.isCancellable,onSign:async()=>{j(!0),h("");try{let e=await f();E(e),j(!1),setTimeout((()=>{D(e)}),u.DEFAULT_SUCCESS_SCREEN_DURATION_MS)}catch(e){console.error(e),h("An error has occurred, please try again."),q(new d.PrivyProviderRpcError(new d.ProviderRpcError(x,n.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),j(!1)}},onCancel:()=>D(null),onClose:()=>D(v)})}};let E=/*#__PURE__*/o.styled.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),S=/*#__PURE__*/o.styled.p.withConfig({displayName:"ErrorText",componentId:"sc-124260c0-1"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-error-dark);font-size:14px;line-height:22px;}"]),j=/*#__PURE__*/o.styled(c.DisplayJsonTree).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),T=/*#__PURE__*/o.styled(c.Message).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);exports.SignRequestScreen=v,exports.SignRequestView=C,exports.default=v;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("@privy-io/js-sdk-core"),r=require("./get-is-unified-wallet-D6pn8A8g.js"),a=require("./context-BPd2qxKv.js"),i=require("./internal-context-NWsAL807.js"),o=require("./useGetSolPrice-C986iVoO.js"),s=require("./ErrorScreen-BrKj88o9.js"),c=require("@heroicons/react/24/outline/CheckCircleIcon"),u=require("styled-components"),l=require("./Button-BEaVAnh4.js"),d=require("./Layouts-dRL0OSpp.js"),p=require("./ModalHeader-n6Aqpos_.js"),m=require("./ScreenHeader-CyURV6Ti.js"),f=require("./Row-CxDF-VMy.js"),g=require("./Value-C-XtZyFa.js"),h=require("./WalletLink-J6Gw0D9R.js"),y=require("./StackedContainer-ByB6Mdu0.js"),w=require("./useActiveWallet-B-Pd49hn.js"),S=require("./TransactionErrorView-U-Fg5udU.js"),k=require("./transaction-DjF5X-by.js"),A=require("@solana/kit"),b=require("./useSolanaRpcClient-BBCvBn6x.js"),v=require("./getFormattedUsdFromLamports-Mu2fqwL2.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("tinycolor2"),require("ofetch"),require("lucide-react"),require("./index-Dz7affvL.js"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-Bi_kf80t.js"),require("./prepareFundingModalData-Do7d2fgq.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-CANb3vg4.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("./reservoir-CQGyEBb7.js"),require("./ScreenLayout-D6r13vU7.js"),require("./Screen-J7z62u7O.js"),require("./index-CRFXS9pP.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./LoadingSkeleton-DoCrfGnl.js"),require("./ethers-CqH8abGL.js"),require("@heroicons/react/24/outline"),require("./ErrorMessage-f0cRWc29.js"),require("./LabelXs-CYMv6rOZ.js"),require("./Subtitle-Dtmrw8l5.js"),require("./Title-C-tHJvrb.js"),require("./Address-B_I2EZZe.js"),require("./WalletInfoCard-DxO9lMen.js"),require("./shared-BPGwTh8c.js"),require("./Checkbox-DXPQZFlQ.js"),require("./ErrorBanner-CMjaobRI.js"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("./WarningBanner-B_Gs_15p.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/ClipboardDocumentIcon");var I=/*#__PURE__*/j(c);const q=/*#__PURE__*/u.styled.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)")),T=({instruction:t,fees:n,transactionInfo:r,solPrice:a,chain:i})=>/*#__PURE__*/e.jsxs(f.Rows,{children:[r?.action&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(g.Value,{children:r.action})]}),null!=t?.total&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:t.total})]}),!t?.total&&null!=t?.amount&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[t.amount,n],tokenPrice:a})})]}),/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Fees"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[n],tokenPrice:a})})]}),t?.to&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.WalletLink,{walletAddress:t.to,chainId:i,chainType:"solana"})})]})]}),x=({fees:t,onClose:n,receiptHeader:r,receiptDescription:a,transactionInfo:i,solPrice:o,signOnly:s,instruction:c,chain:u})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(p.ModalHeader,{onClose:n}),/*#__PURE__*/e.jsx(y.e,{style:{marginBottom:"16px"},children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx(q,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/e.jsx(I.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/e.jsx(m.CenteredScreenHeader,{title:r??`Transaction ${s?"signed":"complete"}!`,description:a??"You're all set."}),/*#__PURE__*/e.jsx(T,{solPrice:o,instruction:c,fees:t,transactionInfo:i,chain:u}),/*#__PURE__*/e.jsx(w.Grow,{}),/*#__PURE__*/e.jsx(C,{loading:!1,onClick:n,children:"Close"}),/*#__PURE__*/e.jsx(d.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(p.BlobbyFooter,{})]});let C=/*#__PURE__*/u.styled(l.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function O(e,t){try{return await e}catch{return t}}function _(e){switch(e){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function E({privyClient:e,chain:t,mint:n}){let r=v.DEFAULT_TOKENS_DATA[t];if(!r[n]){let a=await e.getSplTokenMetadata({mintAddress:n,cluster:_(t)});a&&(r[n]={address:n,symbol:a.symbol,decimals:a.decimals})}return r[n]}async function P({tx:e,solanaClient:t,privyClient:n,checkFunds:r}){let a=A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(e)),i=a.staticAccounts[0]??"",o=await b.fetchTransactionEstimatedFees({solanaClient:t,tx:e}),s=r?await O(b.simulateTransaction({solanaClient:t,tx:e})):void 0,c=s?.hasFunds??!0,u={},l=[],d=await async function({solanaClient:e,message:t}){if(!("addressTableLookups"in t)||!t.addressTableLookups)return[...t.staticAccounts];let n=t.addressTableLookups.map((e=>e.lookupTableAddress)),r=await A.fetchAddressesForLookupTables(n,e.rpc),a=n.map(((e,n)=>[...t.addressTableLookups[n]?.writableIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!0,altIdx:n}}))??[],...t.addressTableLookups[n]?.readonlyIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!1,altIdx:n}}))??[]])).flat().filter((e=>!!e)).sort(((e,t)=>e.isWritable!==t.isWritable?e.isWritable?-1:1:e.altIdx-t.altIdx)).map((({key:e})=>e));return[...t.staticAccounts,...a]}({solanaClient:t,message:a});for(let e of a.instructions){let r=a.staticAccounts[e.programAddressIndex]||"";if(r!==v.TOKEN_PROGRAM_ID&&r!==v.TOKEN_2022_PROGRAM_ID)if(r!==v.SYSTEM_PROGRAM_ID){if(r===v.ASSOCIATED_TOKEN_PROGRAM_ID){let t=await O(function(e,t,n){let[r,a,i,o]=e.accountIndices?.map((e=>t[e]))??[];return{type:"ata-creation",program:n,payer:r,ata:a,owner:i,mint:o}}(e,d,r));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}if(l.push(t),t.ata&&t.owner&&t.mint){u[t.ata]={owner:t.owner,mint:t.mint};continue}}if(v.RAYDIUM_SWAP_PROGRAM_IDS.includes(r)){let a=await O($(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else if(v.JUPITER_SWAP_PROGRAM_IDS.includes(r)){let a=await O(F(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else l.push({type:"unknown",program:r,discriminator:e.data?.[0]})}else{let t=await O(M(e,d));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(t)}else{let a=await O(L(e,d,t,n,u,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a),"spl-transfer"===a.type&&(a.fromAta&&a.fromAccount&&a.token.address&&(u[a.fromAta]??={owner:a.fromAccount,mint:a.token.address}),a.toAta&&a.toAccount&&a.token.address&&(u[a.toAta]??={owner:a.toAccount,mint:a.token.address}))}}return{spender:i,fee:o,instructions:l,hasFunds:!!c}}function R(e,t=0){try{return function(e,t=0){let n=0n;for(let r=0;r<8;r++)n|=BigInt(e[t+r])<<BigInt(8*r);return n}(e,t)}catch{}try{return e.readBigInt64LE(t)}catch{}let n=b.bufferFrom(e);try{return((e,t=0)=>{let n=e[t],r=e[t+7];if(!n||!r)throw Error(`Buffer offset out of range: first: ${n}, last: ${r}.`);return(BigInt(e[t+4]+256*e[t+5]+65536*e[t+6]+(r<<24))<<32n)+BigInt(n+256*e[++t]+65536*e[++t]+16777216*e[++t])})(n)}catch{}try{return n.subarray(t).readBigInt64LE()}catch{}try{return n.readBigInt64LE(t)}catch{}return 0n}async function L(e,t,n,r,a,i){let o=e.data?.[0],s=e.accountIndices?.map((e=>t[e]))??[];if(1===o){let[e,t,n]=s;return{type:"spl-init-account",program:i,account:e,mint:t,owner:n}}if(3===o){let t,o,[c,u,l]=s,d="",p=u?a[u]:void 0;if(p)t=p.owner,d=p.mint;else if(u){let e=await n.rpc.getAccountInfo(u,{commitment:"confirmed",encoding:"jsonParsed"}).send(),r=e.value?.data;t=r?.parsed?.info?.owner,d=r?.parsed?.info?.mint??"",o=r?.parsed?.info?.tokenAmount?.decimals}if(!d&&c){let e=await n.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),t=e.value?.data;d=t?.parsed?.info?.mint??""}let m=await E({privyClient:r,chain:n.chain,mint:d}),f=m?.symbol??"";return o??=m?.decimals??9,{type:"spl-transfer",program:i,fromAta:c,fromAccount:l,toAta:u,toAccount:t,value:R(e.data,1),token:{symbol:f,decimals:o,address:d}}}if(9===o){let[e,t,n]=s;return{type:"spl-close-account",program:i,source:e,destination:t,owner:n}}if(17===o)return{type:"spl-sync-native",program:i};throw Error(`Token program instruction type ${o} not supported`)}async function M(e,t){let n=e.data?.[0],r=e.accountIndices?.map((e=>t[e]))??[];if(0===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t?.toString(),value:R(e.data,4),withSeed:!1}}if(2===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,token:{symbol:"SOL",decimals:9},value:R(e.data,4),withSeed:!1}}if(3===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t,withSeed:!0,value:R(e.data.slice(e.data.length-32-8-8))}}if(11===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,value:R(e.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${n} not supported`)}async function $(e,t,n,r,a){let i=e.accountIndices?.map((e=>t[e]))??[],o=e.data?.[0];if(143===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-input",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,amountIn:R(e.data,8),minimumAmountOut:R(e.data,16)}}if(55===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-output",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,maxAmountIn:R(e.data,8),amountOut:R(e.data,16)}}throw Error(`Raydium swap program instruction type ${o} not supported`)}async function F(e,t,n,r,a){let i=e.data?.[0],o=e.accountIndices?.map((e=>t[e]))??[];if([208,51,239,151,123,43,237,92].includes(i)){let t=o[5],i=o[6];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:R(e.data,e.data.length-1-2-8-8),quotedInAmount:R(e.data,e.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:R(e.data,e.data.length-1-2-8-8),quotedInAmount:R(e.data,e.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-shared-accounts-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,inAmount:R(e.data,e.data.length-1-2-8-8),quotedOutAmount:R(e.data,e.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(i)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(i)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(i)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(i)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(i)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(i)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(i)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(i)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(i)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${i} not supported`)}const D={component:()=>{let{data:c,onUserCloseViaDialogOrKeybindRef:u,setModalData:l,navigate:d}=r.usePrivyModal(),{client:p,closePrivyModal:m,walletProxy:f,showFiatPrices:g}=i.usePrivyInternal(),h=a.useAppConfig(),{user:y}=r.usePrivyContext(),w=b.useSolanaRpcClient()(c?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[j,I]=t.useState(c?.standardSignAndSendTransaction?.transaction),[q,T]=t.useState(),[C,O]=t.useState(),[_,E]=t.useState({value:0n,isLoading:!1}),[R,L]=t.useState(!1),[M,$]=t.useState({}),[F,D]=t.useState(),B=c?.standardSignAndSendTransaction?.account,W=!!c?.standardSignAndSendTransaction?.signOnly,G=B?.imported?r.getImportedPrivySolanaWallets(y).find((e=>e.address===B.address)):r.getPrivyPrimaryWallet(y),{solPrice:J,isSolPriceLoading:U}=o.useGetSolPrice({enabled:g}),V=t.useMemo((()=>{if(!q)return;let e=q.spender,t=k.getNativeCurrencyFromLamports(q.fee),r=k.getNativeCurrencyFromLamports(_.value,3,!0),a=q.instructions.filter((e=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(e.type))),i=a.at(0);if(!i||a.length>1)return{fee:t,spender:e,balance:r};if("sol-transfer"===i.type)return{fee:t,spender:e,balance:r,total:k.getNativeCurrencyFromLamports(i.value)};if("spl-transfer"===i.type)return{fee:t,spender:e,balance:r,total:`${n.formatTokenAmount({amount:i.value,decimals:i.token.decimals})} ${i.token.symbol}`};if("raydium-swap-base-input"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.amountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.minimumAmountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.maxAmountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.amountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.inAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.quotedOutAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.quotedInAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.outAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}return{fee:t,spender:e,balance:r}}),[q,B?.address,_]),N=t.useMemo((()=>{let e;if(!q||!g||!J||U)return;function t(...e){return v.getFormattedUsdFromLamports(e.reduce(((e,t)=>e+t),0n),J??0)}B?.address===q.spender&&(e=t(q.fee));let r=t(_.value),a=q.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)).at(0);return!a||q.instructions.length>1?{fee:e,balance:r}:"sol-transfer"===a.type?{fee:e,balance:r,total:t(a.value,B?.address===q.spender?q.fee:0n)}:"spl-transfer"===a.type?{fee:e,balance:r,total:`${n.formatTokenAmount({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:e,balance:r}}),[q,g,J,U,B?.address,_]);if(t.useEffect((()=>{!async function(){if(j&&p)try{O(void 0);let e=await P({tx:j,solanaClient:w,privyClient:p,checkFunds:!W});T(e)}catch(e){console.error("Failed to prepare transaction",e),O(e)}}()}),[j,w,p,W]),t.useEffect((()=>{(async function(){if(!B)return;E({value:_.value,isLoading:!0});let{value:e}=await w.rpc.getBalance(B.address,{commitment:"confirmed"}).send();E({value:e??0n,isLoading:!1})})().catch(console.error)}),[q]),!j||!c?.standardSignAndSendTransaction||!B){let t=Error("Invalid transaction request");/*#__PURE__*/return e.jsx(s.ErrorScreenView,{error:t,allowlistConfig:h.allowlistConfig,onRetry:()=>{c?.standardSignAndSendTransaction?.onFailure(t),m({shouldCallAuthOnSuccess:!1})}})}let H=()=>{if(!R)return M.signature||M.signedTransaction?c?.standardSignAndSendTransaction?.onSuccess({signature:M.signature,signedTransaction:M.signedTransaction}):c?.standardSignAndSendTransaction?.onFailure(F??C??Error("User exited the modal before submitting the transaction")),m({shouldCallAuthOnSuccess:!1})};u.current=H;let Y=c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e.jsx("img",{src:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,K=!!(c.funding&&c.funding.supportedOptions.length>0),z=!q?.hasFunds&&K;if(M.signature||M.signedTransaction){let t=q?.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)),n=1===t?.length?t?.at(0):void 0;/*#__PURE__*/return e.jsx(x,{fees:M.fees??0n,onClose:H,transactionInfo:c.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:J,receiptHeader:c.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:c.standardSignAndSendTransaction?.uiOptions.successDescription,chain:w.chain,signOnly:W,instruction:"sol-transfer"===n?.type?{to:n.toAccount,amount:n.value}:{to:n?.toAccount||n?.toAta,total:V?.total}})}return F?/*#__PURE__*/e.jsx(S.TransactionErrorView,{transactionError:F,chainId:w.chain,onClose:H,chainType:"solana",onRetry:async()=>{D(void 0);let{value:e}=await w.rpc.getLatestBlockhash().send();var t,n;I((t=j,n=e,A.pipe(A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(t)),(e=>A.decompileTransactionMessage(e)),(e=>A.setTransactionMessageLifetimeUsingBlockhash(n,e)),(e=>A.compileTransaction(e)),(e=>new Uint8Array(A.getTransactionEncoder().encode(e))))))}}):/*#__PURE__*/e.jsx(S.SendSolanaTransactionScreenView,{img:Y,title:c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:c.standardSignAndSendTransaction?.uiOptions?.description||`${h.name} wants your permission to approve the following transaction.`,cta:z?"Add funds":c.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:q?.instructions??[],network:"solana:mainnet"==w.chain?"Solana":w.chain.replace("solana:",""),blockExplorerUrl:w.blockExplorerUrl,total:g?N?.total:V?.total,fee:g?N?.fee:V?.fee,balance:g?N?.balance:V?.balance,swap:V?.swap,transactingWalletAddress:B.address,disabled:!q?.hasFunds&&!K,isSubmitting:R,isPreparing:!q||_.isLoading,isTokenPriceLoading:g&&U,isMissingFunds:!q?.hasFunds,submitError:F??void 0,isSponsored:!!c.standardSignAndSendTransaction?.isSponsored,parseError:C,onClick:z?async()=>{if(!B)return;if(!K)throw Error("Funding wallet is not enabled");let e="FundingMethodSelectionScreen";l({...c,funding:{...c.funding,methodScreen:e},solanaFundingData:c?.solanaFundingData}),d(e)}:async()=>{try{if(L(!0),R||!B||!f||!y||!G)return;let e=await c.standardSignAndSendTransaction.onConfirm(j);if("signature"in e){let t=await async function({solanaClient:e,signature:t}){let n=A.getBase58Decoder().decode(t),r=await e.rpc.getTransaction(n,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return r?{fee:r.meta?.fee??0n}:null}({solanaClient:w,signature:e.signature});return void $({...e,fees:t?.fee})}$(e)}catch(e){console.warn({transaction:j,error:e}),D(e)}finally{L(!1)}},onClose:H})}};exports.StandardSignAndSendTransactionScreen=D,exports.default=D;
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("@privy-io/js-sdk-core"),r=require("./get-is-unified-wallet-CYQvifpN.js"),a=require("./context-B6zndZbE.js"),i=require("./internal-context-NWsAL807.js"),o=require("./useGetSolPrice-C986iVoO.js"),s=require("./ErrorScreen-MrSIGio_.js"),c=require("@heroicons/react/24/outline/CheckCircleIcon"),u=require("styled-components"),l=require("./Button-CyX7JNsa.js"),d=require("./Layouts-dRL0OSpp.js"),p=require("./ModalHeader-D9UKo-3h.js"),m=require("./ScreenHeader-CyURV6Ti.js"),f=require("./Row-CxDF-VMy.js"),g=require("./Value-C-XtZyFa.js"),h=require("./WalletLink-B8qg2sNq.js"),y=require("./StackedContainer-ByB6Mdu0.js"),w=require("./useActiveWallet-uEEQi70o.js"),S=require("./TransactionErrorView-DV1Rbaza.js"),k=require("./transaction-DjF5X-by.js"),A=require("@solana/kit"),b=require("./useSolanaRpcClient-CEhNB-sj.js"),v=require("./getFormattedUsdFromLamports-Mu2fqwL2.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("tinycolor2"),require("ofetch"),require("lucide-react"),require("./index-xKFTBD9J.js"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-CMRZ0IEw.js"),require("./prepareFundingModalData-DKaL1Oqz.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DZJwQPwT.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("./reservoir-CQGyEBb7.js"),require("./ScreenLayout-0BeoRza6.js"),require("./Screen-Cjd8kgCg.js"),require("./index-CRFXS9pP.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./LoadingSkeleton-DoCrfGnl.js"),require("./ethers-BrWeKm_S.js"),require("@heroicons/react/24/outline"),require("./ErrorMessage-f0cRWc29.js"),require("./LabelXs-CYMv6rOZ.js"),require("./Subtitle-Dtmrw8l5.js"),require("./Title-C-tHJvrb.js"),require("./Address-szbhr3eZ.js"),require("./WalletInfoCard-BgUUNBb1.js"),require("./shared-BPGwTh8c.js"),require("./Checkbox-DXPQZFlQ.js"),require("./ErrorBanner-CMjaobRI.js"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("./WarningBanner-B_Gs_15p.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/ClipboardDocumentIcon");var I=/*#__PURE__*/j(c);const q=/*#__PURE__*/u.styled.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)")),T=({instruction:t,fees:n,transactionInfo:r,solPrice:a,chain:i})=>/*#__PURE__*/e.jsxs(f.Rows,{children:[r?.action&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(g.Value,{children:r.action})]}),null!=t?.total&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:t.total})]}),!t?.total&&null!=t?.amount&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[t.amount,n],tokenPrice:a})})]}),/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Fees"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[n],tokenPrice:a})})]}),t?.to&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.WalletLink,{walletAddress:t.to,chainId:i,chainType:"solana"})})]})]}),x=({fees:t,onClose:n,receiptHeader:r,receiptDescription:a,transactionInfo:i,solPrice:o,signOnly:s,instruction:c,chain:u})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(p.ModalHeader,{onClose:n}),/*#__PURE__*/e.jsx(y.e,{style:{marginBottom:"16px"},children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx(q,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/e.jsx(I.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/e.jsx(m.CenteredScreenHeader,{title:r??`Transaction ${s?"signed":"complete"}!`,description:a??"You're all set."}),/*#__PURE__*/e.jsx(T,{solPrice:o,instruction:c,fees:t,transactionInfo:i,chain:u}),/*#__PURE__*/e.jsx(w.Grow,{}),/*#__PURE__*/e.jsx(C,{loading:!1,onClick:n,children:"Close"}),/*#__PURE__*/e.jsx(d.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(p.BlobbyFooter,{})]});let C=/*#__PURE__*/u.styled(l.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function O(e,t){try{return await e}catch{return t}}function _(e){switch(e){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function E({privyClient:e,chain:t,mint:n}){let r=v.DEFAULT_TOKENS_DATA[t];if(!r[n]){let a=await e.getSplTokenMetadata({mintAddress:n,cluster:_(t)});a&&(r[n]={address:n,symbol:a.symbol,decimals:a.decimals})}return r[n]}async function P({tx:e,solanaClient:t,privyClient:n,checkFunds:r}){let a=A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(e)),i=a.staticAccounts[0]??"",o=await b.fetchTransactionEstimatedFees({solanaClient:t,tx:e}),s=r?await O(b.simulateTransaction({solanaClient:t,tx:e})):void 0,c=s?.hasFunds??!0,u={},l=[],d=await async function({solanaClient:e,message:t}){if(!("addressTableLookups"in t)||!t.addressTableLookups)return[...t.staticAccounts];let n=t.addressTableLookups.map((e=>e.lookupTableAddress)),r=await A.fetchAddressesForLookupTables(n,e.rpc),a=n.map(((e,n)=>[...t.addressTableLookups[n]?.writableIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!0,altIdx:n}}))??[],...t.addressTableLookups[n]?.readonlyIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!1,altIdx:n}}))??[]])).flat().filter((e=>!!e)).sort(((e,t)=>e.isWritable!==t.isWritable?e.isWritable?-1:1:e.altIdx-t.altIdx)).map((({key:e})=>e));return[...t.staticAccounts,...a]}({solanaClient:t,message:a});for(let e of a.instructions){let r=a.staticAccounts[e.programAddressIndex]||"";if(r!==v.TOKEN_PROGRAM_ID&&r!==v.TOKEN_2022_PROGRAM_ID)if(r!==v.SYSTEM_PROGRAM_ID){if(r===v.ASSOCIATED_TOKEN_PROGRAM_ID){let t=await O(function(e,t,n){let[r,a,i,o]=e.accountIndices?.map((e=>t[e]))??[];return{type:"ata-creation",program:n,payer:r,ata:a,owner:i,mint:o}}(e,d,r));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}if(l.push(t),t.ata&&t.owner&&t.mint){u[t.ata]={owner:t.owner,mint:t.mint};continue}}if(v.RAYDIUM_SWAP_PROGRAM_IDS.includes(r)){let a=await O($(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else if(v.JUPITER_SWAP_PROGRAM_IDS.includes(r)){let a=await O(F(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else l.push({type:"unknown",program:r,discriminator:e.data?.[0]})}else{let t=await O(M(e,d));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(t)}else{let a=await O(L(e,d,t,n,u,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a),"spl-transfer"===a.type&&(a.fromAta&&a.fromAccount&&a.token.address&&(u[a.fromAta]??={owner:a.fromAccount,mint:a.token.address}),a.toAta&&a.toAccount&&a.token.address&&(u[a.toAta]??={owner:a.toAccount,mint:a.token.address}))}}return{spender:i,fee:o,instructions:l,hasFunds:!!c}}function R(e,t=0){try{return function(e,t=0){let n=0n;for(let r=0;r<8;r++)n|=BigInt(e[t+r])<<BigInt(8*r);return n}(e,t)}catch{}try{return e.readBigInt64LE(t)}catch{}let n=b.bufferFrom(e);try{return((e,t=0)=>{let n=e[t],r=e[t+7];if(!n||!r)throw Error(`Buffer offset out of range: first: ${n}, last: ${r}.`);return(BigInt(e[t+4]+256*e[t+5]+65536*e[t+6]+(r<<24))<<32n)+BigInt(n+256*e[++t]+65536*e[++t]+16777216*e[++t])})(n)}catch{}try{return n.subarray(t).readBigInt64LE()}catch{}try{return n.readBigInt64LE(t)}catch{}return 0n}async function L(e,t,n,r,a,i){let o=e.data?.[0],s=e.accountIndices?.map((e=>t[e]))??[];if(1===o){let[e,t,n]=s;return{type:"spl-init-account",program:i,account:e,mint:t,owner:n}}if(3===o){let t,o,[c,u,l]=s,d="",p=u?a[u]:void 0;if(p)t=p.owner,d=p.mint;else if(u){let e=await n.rpc.getAccountInfo(u,{commitment:"confirmed",encoding:"jsonParsed"}).send(),r=e.value?.data;t=r?.parsed?.info?.owner,d=r?.parsed?.info?.mint??"",o=r?.parsed?.info?.tokenAmount?.decimals}if(!d&&c){let e=await n.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),t=e.value?.data;d=t?.parsed?.info?.mint??""}let m=await E({privyClient:r,chain:n.chain,mint:d}),f=m?.symbol??"";return o??=m?.decimals??9,{type:"spl-transfer",program:i,fromAta:c,fromAccount:l,toAta:u,toAccount:t,value:R(e.data,1),token:{symbol:f,decimals:o,address:d}}}if(9===o){let[e,t,n]=s;return{type:"spl-close-account",program:i,source:e,destination:t,owner:n}}if(17===o)return{type:"spl-sync-native",program:i};throw Error(`Token program instruction type ${o} not supported`)}async function M(e,t){let n=e.data?.[0],r=e.accountIndices?.map((e=>t[e]))??[];if(0===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t?.toString(),value:R(e.data,4),withSeed:!1}}if(2===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,token:{symbol:"SOL",decimals:9},value:R(e.data,4),withSeed:!1}}if(3===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t,withSeed:!0,value:R(e.data.slice(e.data.length-32-8-8))}}if(11===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,value:R(e.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${n} not supported`)}async function $(e,t,n,r,a){let i=e.accountIndices?.map((e=>t[e]))??[],o=e.data?.[0];if(143===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-input",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,amountIn:R(e.data,8),minimumAmountOut:R(e.data,16)}}if(55===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-output",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,maxAmountIn:R(e.data,8),amountOut:R(e.data,16)}}throw Error(`Raydium swap program instruction type ${o} not supported`)}async function F(e,t,n,r,a){let i=e.data?.[0],o=e.accountIndices?.map((e=>t[e]))??[];if([208,51,239,151,123,43,237,92].includes(i)){let t=o[5],i=o[6];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:R(e.data,e.data.length-1-2-8-8),quotedInAmount:R(e.data,e.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:R(e.data,e.data.length-1-2-8-8),quotedInAmount:R(e.data,e.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-shared-accounts-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,inAmount:R(e.data,e.data.length-1-2-8-8),quotedOutAmount:R(e.data,e.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(i)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(i)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(i)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(i)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(i)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(i)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(i)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(i)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(i)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${i} not supported`)}const D={component:()=>{let{data:c,onUserCloseViaDialogOrKeybindRef:u,setModalData:l,navigate:d}=r.usePrivyModal(),{client:p,closePrivyModal:m,walletProxy:f,showFiatPrices:g}=i.usePrivyInternal(),h=a.useAppConfig(),{user:y}=r.usePrivyContext(),w=b.useSolanaRpcClient()(c?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[j,I]=t.useState(c?.standardSignAndSendTransaction?.transaction),[q,T]=t.useState(),[C,O]=t.useState(),[_,E]=t.useState({value:0n,isLoading:!1}),[R,L]=t.useState(!1),[M,$]=t.useState({}),[F,D]=t.useState(),B=c?.standardSignAndSendTransaction?.account,W=!!c?.standardSignAndSendTransaction?.signOnly,G=B?.imported?r.getImportedPrivySolanaWallets(y).find((e=>e.address===B.address)):r.getPrivyPrimaryWallet(y),{solPrice:J,isSolPriceLoading:U}=o.useGetSolPrice({enabled:g}),V=t.useMemo((()=>{if(!q)return;let e=q.spender,t=k.getNativeCurrencyFromLamports(q.fee),r=k.getNativeCurrencyFromLamports(_.value,3,!0),a=q.instructions.filter((e=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(e.type))),i=a.at(0);if(!i||a.length>1)return{fee:t,spender:e,balance:r};if("sol-transfer"===i.type)return{fee:t,spender:e,balance:r,total:k.getNativeCurrencyFromLamports(i.value)};if("spl-transfer"===i.type)return{fee:t,spender:e,balance:r,total:`${n.formatTokenAmount({amount:i.value,decimals:i.token.decimals})} ${i.token.symbol}`};if("raydium-swap-base-input"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.amountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.minimumAmountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.maxAmountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.amountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.inAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.quotedOutAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.quotedInAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.outAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}return{fee:t,spender:e,balance:r}}),[q,B?.address,_]),N=t.useMemo((()=>{let e;if(!q||!g||!J||U)return;function t(...e){return v.getFormattedUsdFromLamports(e.reduce(((e,t)=>e+t),0n),J??0)}B?.address===q.spender&&(e=t(q.fee));let r=t(_.value),a=q.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)).at(0);return!a||q.instructions.length>1?{fee:e,balance:r}:"sol-transfer"===a.type?{fee:e,balance:r,total:t(a.value,B?.address===q.spender?q.fee:0n)}:"spl-transfer"===a.type?{fee:e,balance:r,total:`${n.formatTokenAmount({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:e,balance:r}}),[q,g,J,U,B?.address,_]);if(t.useEffect((()=>{!async function(){if(j&&p)try{O(void 0);let e=await P({tx:j,solanaClient:w,privyClient:p,checkFunds:!W});T(e)}catch(e){console.error("Failed to prepare transaction",e),O(e)}}()}),[j,w,p,W]),t.useEffect((()=>{(async function(){if(!B)return;E({value:_.value,isLoading:!0});let{value:e}=await w.rpc.getBalance(B.address,{commitment:"confirmed"}).send();E({value:e??0n,isLoading:!1})})().catch(console.error)}),[q]),!j||!c?.standardSignAndSendTransaction||!B){let t=Error("Invalid transaction request");/*#__PURE__*/return e.jsx(s.ErrorScreenView,{error:t,allowlistConfig:h.allowlistConfig,onRetry:()=>{c?.standardSignAndSendTransaction?.onFailure(t),m({shouldCallAuthOnSuccess:!1})}})}let H=()=>{if(!R)return M.signature||M.signedTransaction?c?.standardSignAndSendTransaction?.onSuccess({signature:M.signature,signedTransaction:M.signedTransaction}):c?.standardSignAndSendTransaction?.onFailure(F??C??Error("User exited the modal before submitting the transaction")),m({shouldCallAuthOnSuccess:!1})};u.current=H;let Y=c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e.jsx("img",{src:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,K=!!(c.funding&&c.funding.supportedOptions.length>0),z=!q?.hasFunds&&K;if(M.signature||M.signedTransaction){let t=q?.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)),n=1===t?.length?t?.at(0):void 0;/*#__PURE__*/return e.jsx(x,{fees:M.fees??0n,onClose:H,transactionInfo:c.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:J,receiptHeader:c.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:c.standardSignAndSendTransaction?.uiOptions.successDescription,chain:w.chain,signOnly:W,instruction:"sol-transfer"===n?.type?{to:n.toAccount,amount:n.value}:{to:n?.toAccount||n?.toAta,total:V?.total}})}return F?/*#__PURE__*/e.jsx(S.TransactionErrorView,{transactionError:F,chainId:w.chain,onClose:H,chainType:"solana",onRetry:async()=>{D(void 0);let{value:e}=await w.rpc.getLatestBlockhash().send();var t,n;I((t=j,n=e,A.pipe(A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(t)),(e=>A.decompileTransactionMessage(e)),(e=>A.setTransactionMessageLifetimeUsingBlockhash(n,e)),(e=>A.compileTransaction(e)),(e=>new Uint8Array(A.getTransactionEncoder().encode(e))))))}}):/*#__PURE__*/e.jsx(S.SendSolanaTransactionScreenView,{img:Y,title:c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:c.standardSignAndSendTransaction?.uiOptions?.description||`${h.name} wants your permission to approve the following transaction.`,cta:z?"Add funds":c.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:q?.instructions??[],network:"solana:mainnet"==w.chain?"Solana":w.chain.replace("solana:",""),blockExplorerUrl:w.blockExplorerUrl,total:g?N?.total:V?.total,fee:g?N?.fee:V?.fee,balance:g?N?.balance:V?.balance,swap:V?.swap,transactingWalletAddress:B.address,disabled:!q?.hasFunds&&!K,isSubmitting:R,isPreparing:!q||_.isLoading,isTokenPriceLoading:g&&U,isMissingFunds:!q?.hasFunds,submitError:F??void 0,isSponsored:!!c.standardSignAndSendTransaction?.isSponsored,parseError:C,onClick:z?async()=>{if(!B)return;if(!K)throw Error("Funding wallet is not enabled");let e="FundingMethodSelectionScreen";l({...c,funding:{...c.funding,methodScreen:e},solanaFundingData:c?.solanaFundingData}),d(e)}:async()=>{try{if(L(!0),R||!B||!f||!y||!G)return;let e=await c.standardSignAndSendTransaction.onConfirm(j);if("signature"in e){let t=await async function({solanaClient:e,signature:t}){let n=A.getBase58Decoder().decode(t),r=await e.rpc.getTransaction(n,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return r?{fee:r.meta?.fee??0n}:null}({solanaClient:w,signature:e.signature});return void $({...e,fees:t?.fee})}$(e)}catch(e){console.warn({transaction:j,error:e}),D(e)}finally{L(!1)}},onClose:H})}};exports.StandardSignAndSendTransactionScreen=D,exports.default=D;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./index-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./index-xKFTBD9J.js"),i=require("./context-B6zndZbE.js"),a=require("./internal-context-NWsAL807.js"),o=require("./get-is-unified-wallet-CYQvifpN.js"),s=require("./shouldProceedtoEmbeddedWalletCreationFlow-Brj0fZpr.js"),u=require("./ScreenLayout-0BeoRza6.js"),n=require("./telegram-D3O0_F1a.js");require("@privy-io/js-sdk-core"),require("uuid"),require("jose"),require("eventemitter3"),require("./useActiveWallet-uEEQi70o.js"),require("zustand"),require("styled-components"),require("react-device-detect"),require("./prepareFundingModalData-DKaL1Oqz.js"),require("./events-context-Di6--rDg.js"),require("viem"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-CMRZ0IEw.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DZJwQPwT.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("ofetch"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("tinycolor2"),require("./Button-CyX7JNsa.js"),require("./Screen-Cjd8kgCg.js"),require("./ModalHeader-D9UKo-3h.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./index-CRFXS9pP.js");const l=({success:r,errorMessage:t,onRetry:i})=>{let a=r?"Successfully connected with Telegram":t?t.message:"Verifying connection to Telegram";/*#__PURE__*/return e.jsx(u.ScreenLayout,{title:a,subtitle:r?"You're good to go!":t?t.detail:"Just a few moments more",icon:n.Telegram,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!t},secondaryCta:t?.retryable&&i?{label:"Retry",onClick:i}:void 0,watermark:!0})},c={component:()=>{let{authenticated:u,logout:n,ready:c,user:d}=o.usePrivyContext(),{setModalData:m,navigate:q,resetNavigation:g,data:v}=o.usePrivyModal(),y=i.useAppConfig(),{initLoginWithTelegram:h,loginWithTelegram:E,updateWallets:S,setReadyToTrue:p,closePrivyModal:A,createAnalyticsEvent:C,getAuthMeta:T}=a.usePrivyInternal(),[f,j]=r.useState(!1),[R,b]=r.useState(void 0),_=t.useCaptcha();async function w(){try{let e=await async function(){let e;if(!u){if(_.enabled&&"error"===_.status)throw new t.CaptchaError(_.error,null,a.PrivyErrorCode.CAPTCHA_FAILURE);return _.enabled&&"success"!==_.status&&(_.execute(),e=await _.waitForResult()),e}}();await E({captchaToken:e}),j(!0),p(!0)}catch(e){if(e?.privyErrorCode===a.PrivyErrorCode.ALLOWLIST_REJECTED)return b(void 0),g(),void q("AllowlistRejectionScreen");if(e?.privyErrorCode===a.PrivyErrorCode.USER_LIMIT_REACHED)return console.error(new a.PrivyUserLimitReachedError(e).toString()),b(void 0),g(),void q("UserLimitReachedScreen");if(e?.privyErrorCode===a.PrivyErrorCode.USER_DOES_NOT_EXIST)return b(void 0),g(),void q("AccountNotFoundScreen");if(e?.privyErrorCode===a.PrivyErrorCode.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return b(void 0),g(),m({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:T()?.telegramAuthResult,telegramWebAppData:T()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void q("LinkConflictScreen");let{retryable:r,detail:i}=t.getTelegramAuthErrorMessage(e);b({retryable:r,detail:i,message:"Authentication failed"})}}r.useEffect((()=>{w()}),[]),r.useEffect((()=>{if(!(c&&u&&f&&d))return;if(y?.legal.requireUsersAcceptTerms&&!d.hasAcceptedTerms){let e=setTimeout((()=>{q("AffirmativeConsentScreen")}),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}if(s.shouldProceedtoEmbeddedWalletCreationFlow(d,y.embeddedWallets)){let e=setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),q("EmbeddedWalletOnAccountCreateScreen")}),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}S();let e=setTimeout((()=>A({shouldCallAuthOnSuccess:!0,isSuccess:!0})),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}),[c,u,f,d]);/*#__PURE__*/return e.jsx(l,{success:f,errorMessage:R,onRetry:R?.retryable?async()=>{try{b(void 0),v?.telegramAuthModalData?.seamlessAuth||await h(void 0,v?.login?.disableSignup),await w()}catch(e){let{retryable:r,detail:i}=t.getTelegramAuthErrorMessage(e);b({retryable:r,detail:i,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};exports.TelegramAuthScreen=c,exports.TelegramAuthScreenView=l,exports.default=c;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),i=require("styled-components"),t=require("./WalletLink-
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),i=require("styled-components"),t=require("./WalletLink-B8qg2sNq.js"),n=require("./ethers-BrWeKm_S.js"),o=require("./Layouts-dRL0OSpp.js"),r=require("@heroicons/react/24/outline/ChevronDownIcon"),l=require("react"),d=require("./context-B6zndZbE.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/s(r);const c=({label:i,children:t,valueStyles:n})=>/*#__PURE__*/e.jsxs(p,{children:[/*#__PURE__*/e.jsx("div",{children:i}),/*#__PURE__*/e.jsx(x,{style:{...n},children:t})]});let p=/*#__PURE__*/i.styled.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),x=/*#__PURE__*/i.styled.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const h=({gas:i,tokenPrice:r,tokenSymbol:l})=>/*#__PURE__*/e.jsxs(o.FlexContainer,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e.jsxs(u,{children:[/*#__PURE__*/e.jsx(y,{children:"Est. Fees"}),/*#__PURE__*/e.jsx("div",{children:/*#__PURE__*/e.jsx(t.PriceDisplay,{weiQuantities:[BigInt(i)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/e.jsx(g,{children:`${n.getNativeCurrencyFromWei(BigInt(i),l)}`})]}),f=({value:i,gas:r,tokenPrice:l,tokenSymbol:d})=>{let s=BigInt(i??0)+BigInt(r);/*#__PURE__*/return e.jsxs(o.FlexContainer,{children:[/*#__PURE__*/e.jsxs(u,{children:[/*#__PURE__*/e.jsx(y,{children:"Total (including fees)"}),/*#__PURE__*/e.jsx("div",{children:/*#__PURE__*/e.jsx(t.PriceDisplay,{weiQuantities:[BigInt(i||0),BigInt(r)],tokenPrice:l,tokenSymbol:d})})]}),l&&/*#__PURE__*/e.jsx(g,{children:n.getNativeCurrencyFromWei(s,d)})]})};let u=/*#__PURE__*/i.styled.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),g=/*#__PURE__*/i.styled.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),y=/*#__PURE__*/i.styled.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const v=/*#__PURE__*/l.createContext(void 0),m=/*#__PURE__*/l.createContext(void 0),j=({defaultValue:i,children:t})=>{let[n,o]=l.useState(i||null);/*#__PURE__*/return e.jsx(v.Provider,{value:{activePanel:n,togglePanel:e=>{o(n===e?null:e)}},children:/*#__PURE__*/e.jsx(k,{children:t})})},w=({value:i,children:t})=>{let{activePanel:n,togglePanel:o}=l.useContext(v),r=n===i;/*#__PURE__*/return e.jsx(m.Provider,{value:{onToggle:()=>o(i),value:i},children:/*#__PURE__*/e.jsx(A,{isActive:r?"true":"false","data-open":String(r),children:t})})},C=({children:i})=>{let{activePanel:t}=l.useContext(v),{onToggle:n,value:o}=l.useContext(m),r=t===o;/*#__PURE__*/
|
|
2
2
|
return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsxs(N,{onClick:n,"data-open":String(r),children:[/*#__PURE__*/e.jsx(T,{children:i}),/*#__PURE__*/e.jsx(W,{isactive:r?"true":"false",children:/*#__PURE__*/e.jsx(a.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/e.jsx(P,{})]})},I=({children:i})=>{let{activePanel:t}=l.useContext(v),{value:n}=l.useContext(m);/*#__PURE__*/return e.jsx(S,{"data-open":String(t===n),children:/*#__PURE__*/e.jsx(D,{children:i})})},b=({children:i})=>{let{activePanel:t}=l.useContext(v),{value:n}=l.useContext(m);/*#__PURE__*/return e.jsx(D,{children:"function"==typeof i?i({isActive:t===n}):i})};let k=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),N=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),P=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),T=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),A=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-d25f9267-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),S=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-d25f9267-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),D=/*#__PURE__*/i.styled.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),W=/*#__PURE__*/i.styled.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));let q=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),B=/*#__PURE__*/i.styled.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);exports.TransactionDetails=({from:i,to:n,txn:o,transactionInfo:r,tokenPrice:l,gas:s,tokenSymbol:a})=>{let p=BigInt(o?.value||0);/*#__PURE__*/
|
|
3
3
|
return e.jsx(j,{...d.useAppConfig().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e.jsxs(w,{value:"details",children:[/*#__PURE__*/e.jsx(C,{children:/*#__PURE__*/e.jsxs(q,{children:[/*#__PURE__*/e.jsx("div",{children:r?.title||"Details"}),/*#__PURE__*/e.jsx(B,{children:/*#__PURE__*/e.jsx(t.HeaderPriceDisplay,{weiQuantities:[p],tokenPrice:l,tokenSymbol:a})})]})}),/*#__PURE__*/e.jsxs(I,{children:[/*#__PURE__*/e.jsx(c,{label:"From",children:/*#__PURE__*/e.jsx(t.WalletLink,{walletAddress:i,chainId:o.chainId||d.CHAIN_ID_MAINNET,chainType:"ethereum"})}),/*#__PURE__*/e.jsx(c,{label:"To",children:/*#__PURE__*/e.jsx(t.WalletLink,{walletAddress:n,chainId:o.chainId||d.CHAIN_ID_MAINNET,chainType:"ethereum"})}),r&&r.action&&/*#__PURE__*/e.jsx(c,{label:"Action",children:r.action}),s&&/*#__PURE__*/e.jsx(h,{value:o.value,gas:s,tokenPrice:l,tokenSymbol:a})]}),/*#__PURE__*/e.jsx(b,{children:({isActive:i})=>/*#__PURE__*/e.jsx(f,{value:o.value,displayFee:i,gas:s||"0x0",tokenPrice:l,tokenSymbol:a})})]})})};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),s=require("@heroicons/react/24/outline"),r=require("react"),n=require("styled-components"),i=require("@privy-io/js-sdk-core"),o=require("./Button-BEaVAnh4.js"),l=require("./ModalHeader-n6Aqpos_.js"),t=require("./Value-C-XtZyFa.js"),a=require("./Row-CxDF-VMy.js"),d=require("./ErrorMessage-f0cRWc29.js"),c=require("./LabelXs-CYMv6rOZ.js"),x=require("./Subtitle-Dtmrw8l5.js"),h=require("./Title-C-tHJvrb.js"),u=require("./Address-B_I2EZZe.js"),m=require("./WalletInfoCard-DxO9lMen.js"),j=require("./context-BPd2qxKv.js"),p=require("./useActiveWallet-B-Pd49hn.js"),g=require("./LoadingSkeleton-DoCrfGnl.js"),b=require("viem"),f=require("./shared-BPGwTh8c.js"),w=require("./Checkbox-DXPQZFlQ.js"),y=require("./ErrorBanner-CMjaobRI.js"),S=require("./WarningBanner-B_Gs_15p.js"),k=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),v=require("@heroicons/react/24/outline/ClipboardDocumentIcon"),I=require("@heroicons/react/24/outline/ExclamationCircleIcon"),L=require("./internal-context-NWsAL807.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=/*#__PURE__*/C(k),A=/*#__PURE__*/C(v),T=/*#__PURE__*/C(I);const V=/*#__PURE__*/n.styled(t.LabelSm).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var N=({iconUrl:s,value:r,symbol:n,usdValue:i,nftName:o,nftCount:l,decimals:t,$isLoading:a})=>{if(a)/*#__PURE__*/return e.jsx(M,{$isLoading:a});let d=r&&i&&t?function(e,s,r){let n=parseFloat(e),i=parseFloat(r);if(0===n||0===i||Number.isNaN(n)||Number.isNaN(i))return e;let o=Math.ceil(-Math.log10(.01/(i/n))),l=Math.pow(10,o=Math.max(o=Math.min(o,s),1)),t=+(Math.floor(n*l)/l).toFixed(o).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:s}).format(t)}(r,t,i):r;/*#__PURE__*/return e.jsxs("div",{children:[/*#__PURE__*/e.jsxs(M,{$isLoading:a,children:[s&&/*#__PURE__*/e.jsx(F,{src:s,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",o,d," ",n]}),i&&/*#__PURE__*/e.jsxs(E,{$isLoading:a,children:["$",i]})]})};let M=/*#__PURE__*/n.styled.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],g.LoadingSkeleton);const E=/*#__PURE__*/n.styled.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],g.LoadingSkeleton);let F=/*#__PURE__*/n.styled.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const q=s=>{let{chain:r,transactionDetails:n,isTokenContractInfoLoading:i,symbol:o}=s,{action:l,functionName:d}=n;/*#__PURE__*/return e.jsx(f.Box,{children:/*#__PURE__*/e.jsxs(a.Rows,{children:["transaction"!==l&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(t.Value,{children:d})]}),"mint"===d&&"args"in n&&n.args.filter((e=>e)).map(((s,n)=>/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:`Param ${n}`}),/*#__PURE__*/e.jsx(t.Value,{children:"string"==typeof s&&b.isAddress(s)?/*#__PURE__*/e.jsx(u.Address,{address:s,url:r?.blockExplorers?.default?.url,showCopyIcon:!1}):s?.toString()})]},n))),"setApprovalForAll"===d&&n.operator&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Operator"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.operator,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==n.approved&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Set approval to"}),/*#__PURE__*/e.jsx(t.Value,{children:n.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/e.jsxs(e.Fragment,{children:["formattedAmount"in n&&n.formattedAmount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{$isLoading:i,children:[n.formattedAmount," ",o]})]}),"tokenId"in n&&n.tokenId&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token ID"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/e.jsxs(e.Fragment,{children:["amounts"in n&&n.amounts&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amounts"}),/*#__PURE__*/e.jsx(t.Value,{children:n.amounts.join(", ")})]}),"tokenIds"in n&&n.tokenIds&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token IDs"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenIds.join(", ")})]})]}),"approve"===d&&n.spender&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.spender,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferFrom&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring from"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferFrom,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferTo&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring to"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferTo,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},$=({variant:s,setPreventMaliciousTransaction:r,colorScheme:n="light",preventMaliciousTransaction:i})=>"warn"===s?/*#__PURE__*/e.jsx(D,{children:/*#__PURE__*/e.jsxs(S.WarningBanner,{theme:n,children:[/*#__PURE__*/e.jsx("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===s?/*#__PURE__*/e.jsx(e.Fragment,{children:/*#__PURE__*/e.jsxs(D,{children:[/*#__PURE__*/e.jsx(y.ErrorBanner,{theme:n,children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/e.jsxs(O,{children:[/*#__PURE__*/e.jsx(w.Checkbox,{color:"var(--privy-color-error)",checked:!i,readOnly:!0,onClick:()=>r(!i)}),/*#__PURE__*/e.jsx("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let D=/*#__PURE__*/n.styled.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),O=/*#__PURE__*/n.styled.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const B=({transactionIndex:e,maxIndex:s})=>"number"!=typeof e||0===s?"":` (${e+1} / ${s+1})`;let P=/*#__PURE__*/n.styled(m.WalletInfoCard).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),X=/*#__PURE__*/n.styled(a.Rows).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),W="There was an error preparing your transaction. Your transaction request will likely fail.",z=/*#__PURE__*/n.styled.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),H=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),U=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let G=()=>/*#__PURE__*/e.jsxs(K,{children:[/*#__PURE__*/e.jsx(_,{}),/*#__PURE__*/e.jsx(Z,{})]});let J=/*#__PURE__*/n.styled.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),Q=/*#__PURE__*/n.styled.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),Y=/*#__PURE__*/n.styled.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),K=/*#__PURE__*/n.styled.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),Z=/*#__PURE__*/n.styled(T.default).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),_=/*#__PURE__*/n.styled.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),ee=/*#__PURE__*/n.styled(o.PrimaryButton).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/n.styled.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),re=/*#__PURE__*/n.styled.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),ne=/*#__PURE__*/n.styled.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),ie=/*#__PURE__*/n.styled.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),oe=/*#__PURE__*/n.styled(A.default).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),le=/*#__PURE__*/n.styled(R.default).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),te=({clicked:s})=>s?/*#__PURE__*/e.jsx(le,{}):/*#__PURE__*/e.jsx(oe,{});exports.SendSolanaTransactionScreenView=({img:n,title:m,subtitle:g,cta:b,instructions:f,network:w,blockExplorerUrl:y,isMissingFunds:S,submitError:k,parseError:v,total:I,swap:L,transactingWalletAddress:C,fee:R,balance:A,disabled:T,isSubmitting:N,isPreparing:M,isTokenPriceLoading:E,onClick:F,onClose:q,onBack:$,isSponsored:D})=>{let O=M||E,[B,G]=r.useState(!1),J=j.useAppConfig();/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:q,backFn:$}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsx(h.Title,{style:{marginTop:n?"1.5rem":0},children:m}),/*#__PURE__*/e.jsx(x.Subtitle,{children:g}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(I||O)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:I})]}),L&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Swap"}),/*#__PURE__*/e.jsx(t.Value,{children:L})]}),w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:w})]}),(R||O||void 0!==D)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:D&&!O?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",J.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):R})]})]}),/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>G((e=>!e)),children:[/*#__PURE__*/e.jsx("span",{children:"Advanced"}),/*#__PURE__*/e.jsx(s.ChevronDownIcon,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:B?"rotate(180deg)":void 0}})]})}),B&&/*#__PURE__*/e.jsx(e.Fragment,{children:f.map(((s,r)=>"sol-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.withSeed?"with seed":""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:s.token.decimals})," ",s.token.symbol]})]}),!!s.toAccount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAccount,url:y})})]})]},r):"spl-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.token.symbol]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.value.toString()})]}),!!s.fromAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.fromAta,url:y})})]}),!!s.toAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAta,url:y})})]}),!!s.token.address&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.token.address,url:y})})]})]},r):"ata-creation"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Create token account"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"create-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Create account ",s.withSeed?"with seed":""]})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:9})," SOL"]})]})]},r):"spl-init-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Initialize token account"})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),!!s.mint&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Mint"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mint,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-close-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Close token account"})}),!!s.source&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.source,url:y})})]}),!!s.destination&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.destination,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-sync-native"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Sync native"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]})]},r):"raydium-swap-base-input"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Minimum amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.minimumAmountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"raydium-swap-base-output"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Max amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.maxAmountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-shared-accounts-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"In amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.inAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted out amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedOutAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-exact-out-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted in amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedInAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.outAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Data"}),/*#__PURE__*/e.jsx(t.Value,{children:s.discriminator})]})]},r)))}),/*#__PURE__*/e.jsx(p.Grow,{}),k?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:k.message}):v?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:W}):null,/*#__PURE__*/e.jsx(P,{$useSmallMargins:!(!v&&!k),title:"",address:C,balance:A,errMsg:M||v||k||!S?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e.jsx(o.PrimaryButton,{style:{marginTop:"1rem"},loading:N,disabled:T||M,onClick:F,children:b}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})},exports.SendTransactionScreenView=({img:n,submitError:i,prepareError:c,onClose:m,action:g,title:b,subtitle:f,to:w,tokenAddress:y,network:S,missingFunds:k,fee:v,from:I,cta:L,disabled:C,chain:R,isSubmitting:A,isPreparing:T,isTokenPriceLoading:M,isTokenContractInfoLoading:E,isSponsored:F,symbol:D,balance:O,onClick:X,transactionDetails:G,transactionIndex:J,maxIndex:Q,onBack:Y,chainName:K,validation:Z,hasScanDetails:_,setIsScanDetailsOpen:ee,preventMaliciousTransaction:se,setPreventMaliciousTransaction:re,tokensSent:ne,tokensReceived:ie,isScanning:oe,isCancellable:le,functionName:te})=>{let{showTransactionDetails:ae,setShowTransactionDetails:de,hasMoreDetails:ce,isErc20Ish:xe}=(e=>{let[s,n]=r.useState(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,s])=>s&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:s,setShowTransactionDetails:n,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(G),he=j.useAppConfig(),ue=xe&&E||T||M||oe;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:m,backFn:Y}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsxs(h.Title,{style:{marginTop:n?"1.5rem":0},children:[b,/*#__PURE__*/e.jsx(B,{maxIndex:Q,transactionIndex:J})]}),/*#__PURE__*/e.jsx(x.Subtitle,{children:f}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[(!!ne[0]||ue)&&/*#__PURE__*/e.jsxs(a.Row,{children:[ie.length>0?/*#__PURE__*/e.jsx(t.LabelSm,{children:"Send"}):/*#__PURE__*/e.jsx(t.LabelSm,{children:"approve"===g?"Approval amount":"Amount"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ne.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:"setApprovalForAll"===te?"All":s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),ie.length>0&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Receive"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ie.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:G.spender,url:R?.blockExplorers?.default?.url})})]}):null,w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:w,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),y&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:y,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:S})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:T||M||void 0===F,children:F?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",he.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):v})]}),ce&&!_&&/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.Row,{className:"cursor-pointer",onClick:()=>de(!ae),children:/*#__PURE__*/e.jsxs(t.LabelSmPrimary,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e.jsx(s.ChevronDownIcon,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ae?"rotate(180deg)":void 0}})]})}),ae&&G&&/*#__PURE__*/e.jsx(q,{action:g,chain:R,transactionDetails:G,isTokenContractInfoLoading:E,symbol:D})]}),_&&/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>ee(!0),children:[/*#__PURE__*/e.jsx("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e.jsx(s.ArrowRightIcon,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e.jsx(p.Grow,{}),i?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:i.message}):c&&0===J?
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),s=require("@heroicons/react/24/outline"),r=require("react"),n=require("styled-components"),i=require("@privy-io/js-sdk-core"),o=require("./Button-CyX7JNsa.js"),l=require("./ModalHeader-D9UKo-3h.js"),t=require("./Value-C-XtZyFa.js"),a=require("./Row-CxDF-VMy.js"),d=require("./ErrorMessage-f0cRWc29.js"),c=require("./LabelXs-CYMv6rOZ.js"),x=require("./Subtitle-Dtmrw8l5.js"),h=require("./Title-C-tHJvrb.js"),u=require("./Address-szbhr3eZ.js"),m=require("./WalletInfoCard-BgUUNBb1.js"),j=require("./context-B6zndZbE.js"),p=require("./useActiveWallet-uEEQi70o.js"),g=require("./LoadingSkeleton-DoCrfGnl.js"),b=require("viem"),f=require("./shared-BPGwTh8c.js"),w=require("./Checkbox-DXPQZFlQ.js"),y=require("./ErrorBanner-CMjaobRI.js"),S=require("./WarningBanner-B_Gs_15p.js"),k=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),v=require("@heroicons/react/24/outline/ClipboardDocumentIcon"),I=require("@heroicons/react/24/outline/ExclamationCircleIcon"),L=require("./internal-context-NWsAL807.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=/*#__PURE__*/C(k),A=/*#__PURE__*/C(v),T=/*#__PURE__*/C(I);const V=/*#__PURE__*/n.styled(t.LabelSm).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var N=({iconUrl:s,value:r,symbol:n,usdValue:i,nftName:o,nftCount:l,decimals:t,$isLoading:a})=>{if(a)/*#__PURE__*/return e.jsx(M,{$isLoading:a});let d=r&&i&&t?function(e,s,r){let n=parseFloat(e),i=parseFloat(r);if(0===n||0===i||Number.isNaN(n)||Number.isNaN(i))return e;let o=Math.ceil(-Math.log10(.01/(i/n))),l=Math.pow(10,o=Math.max(o=Math.min(o,s),1)),t=+(Math.floor(n*l)/l).toFixed(o).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:s}).format(t)}(r,t,i):r;/*#__PURE__*/return e.jsxs("div",{children:[/*#__PURE__*/e.jsxs(M,{$isLoading:a,children:[s&&/*#__PURE__*/e.jsx(F,{src:s,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",o,d," ",n]}),i&&/*#__PURE__*/e.jsxs(E,{$isLoading:a,children:["$",i]})]})};let M=/*#__PURE__*/n.styled.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],g.LoadingSkeleton);const E=/*#__PURE__*/n.styled.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],g.LoadingSkeleton);let F=/*#__PURE__*/n.styled.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const q=s=>{let{chain:r,transactionDetails:n,isTokenContractInfoLoading:i,symbol:o}=s,{action:l,functionName:d}=n;/*#__PURE__*/return e.jsx(f.Box,{children:/*#__PURE__*/e.jsxs(a.Rows,{children:["transaction"!==l&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(t.Value,{children:d})]}),"mint"===d&&"args"in n&&n.args.filter((e=>e)).map(((s,n)=>/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:`Param ${n}`}),/*#__PURE__*/e.jsx(t.Value,{children:"string"==typeof s&&b.isAddress(s)?/*#__PURE__*/e.jsx(u.Address,{address:s,url:r?.blockExplorers?.default?.url,showCopyIcon:!1}):s?.toString()})]},n))),"setApprovalForAll"===d&&n.operator&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Operator"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.operator,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==n.approved&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Set approval to"}),/*#__PURE__*/e.jsx(t.Value,{children:n.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/e.jsxs(e.Fragment,{children:["formattedAmount"in n&&n.formattedAmount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{$isLoading:i,children:[n.formattedAmount," ",o]})]}),"tokenId"in n&&n.tokenId&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token ID"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/e.jsxs(e.Fragment,{children:["amounts"in n&&n.amounts&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amounts"}),/*#__PURE__*/e.jsx(t.Value,{children:n.amounts.join(", ")})]}),"tokenIds"in n&&n.tokenIds&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token IDs"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenIds.join(", ")})]})]}),"approve"===d&&n.spender&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.spender,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferFrom&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring from"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferFrom,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferTo&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring to"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferTo,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},$=({variant:s,setPreventMaliciousTransaction:r,colorScheme:n="light",preventMaliciousTransaction:i})=>"warn"===s?/*#__PURE__*/e.jsx(D,{children:/*#__PURE__*/e.jsxs(S.WarningBanner,{theme:n,children:[/*#__PURE__*/e.jsx("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===s?/*#__PURE__*/e.jsx(e.Fragment,{children:/*#__PURE__*/e.jsxs(D,{children:[/*#__PURE__*/e.jsx(y.ErrorBanner,{theme:n,children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/e.jsxs(O,{children:[/*#__PURE__*/e.jsx(w.Checkbox,{color:"var(--privy-color-error)",checked:!i,readOnly:!0,onClick:()=>r(!i)}),/*#__PURE__*/e.jsx("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let D=/*#__PURE__*/n.styled.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),O=/*#__PURE__*/n.styled.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const B=({transactionIndex:e,maxIndex:s})=>"number"!=typeof e||0===s?"":` (${e+1} / ${s+1})`;let P=/*#__PURE__*/n.styled(m.WalletInfoCard).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),X=/*#__PURE__*/n.styled(a.Rows).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),W="There was an error preparing your transaction. Your transaction request will likely fail.",z=/*#__PURE__*/n.styled.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),H=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),U=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let G=()=>/*#__PURE__*/e.jsxs(K,{children:[/*#__PURE__*/e.jsx(_,{}),/*#__PURE__*/e.jsx(Z,{})]});let J=/*#__PURE__*/n.styled.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),Q=/*#__PURE__*/n.styled.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),Y=/*#__PURE__*/n.styled.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),K=/*#__PURE__*/n.styled.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),Z=/*#__PURE__*/n.styled(T.default).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),_=/*#__PURE__*/n.styled.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),ee=/*#__PURE__*/n.styled(o.PrimaryButton).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/n.styled.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),re=/*#__PURE__*/n.styled.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),ne=/*#__PURE__*/n.styled.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),ie=/*#__PURE__*/n.styled.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),oe=/*#__PURE__*/n.styled(A.default).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),le=/*#__PURE__*/n.styled(R.default).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),te=({clicked:s})=>s?/*#__PURE__*/e.jsx(le,{}):/*#__PURE__*/e.jsx(oe,{});exports.SendSolanaTransactionScreenView=({img:n,title:m,subtitle:g,cta:b,instructions:f,network:w,blockExplorerUrl:y,isMissingFunds:S,submitError:k,parseError:v,total:I,swap:L,transactingWalletAddress:C,fee:R,balance:A,disabled:T,isSubmitting:N,isPreparing:M,isTokenPriceLoading:E,onClick:F,onClose:q,onBack:$,isSponsored:D})=>{let O=M||E,[B,G]=r.useState(!1),J=j.useAppConfig();/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:q,backFn:$}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsx(h.Title,{style:{marginTop:n?"1.5rem":0},children:m}),/*#__PURE__*/e.jsx(x.Subtitle,{children:g}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(I||O)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:I})]}),L&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Swap"}),/*#__PURE__*/e.jsx(t.Value,{children:L})]}),w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:w})]}),(R||O||void 0!==D)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:D&&!O?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",J.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):R})]})]}),/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>G((e=>!e)),children:[/*#__PURE__*/e.jsx("span",{children:"Advanced"}),/*#__PURE__*/e.jsx(s.ChevronDownIcon,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:B?"rotate(180deg)":void 0}})]})}),B&&/*#__PURE__*/e.jsx(e.Fragment,{children:f.map(((s,r)=>"sol-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.withSeed?"with seed":""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:s.token.decimals})," ",s.token.symbol]})]}),!!s.toAccount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAccount,url:y})})]})]},r):"spl-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.token.symbol]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.value.toString()})]}),!!s.fromAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.fromAta,url:y})})]}),!!s.toAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAta,url:y})})]}),!!s.token.address&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.token.address,url:y})})]})]},r):"ata-creation"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Create token account"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"create-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Create account ",s.withSeed?"with seed":""]})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:9})," SOL"]})]})]},r):"spl-init-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Initialize token account"})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),!!s.mint&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Mint"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mint,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-close-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Close token account"})}),!!s.source&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.source,url:y})})]}),!!s.destination&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.destination,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-sync-native"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Sync native"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]})]},r):"raydium-swap-base-input"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Minimum amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.minimumAmountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"raydium-swap-base-output"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Max amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.maxAmountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-shared-accounts-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"In amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.inAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted out amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedOutAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-exact-out-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted in amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedInAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.outAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Data"}),/*#__PURE__*/e.jsx(t.Value,{children:s.discriminator})]})]},r)))}),/*#__PURE__*/e.jsx(p.Grow,{}),k?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:k.message}):v?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:W}):null,/*#__PURE__*/e.jsx(P,{$useSmallMargins:!(!v&&!k),title:"",address:C,balance:A,errMsg:M||v||k||!S?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e.jsx(o.PrimaryButton,{style:{marginTop:"1rem"},loading:N,disabled:T||M,onClick:F,children:b}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})},exports.SendTransactionScreenView=({img:n,submitError:i,prepareError:c,onClose:m,action:g,title:b,subtitle:f,to:w,tokenAddress:y,network:S,missingFunds:k,fee:v,from:I,cta:L,disabled:C,chain:R,isSubmitting:A,isPreparing:T,isTokenPriceLoading:M,isTokenContractInfoLoading:E,isSponsored:F,symbol:D,balance:O,onClick:X,transactionDetails:G,transactionIndex:J,maxIndex:Q,onBack:Y,chainName:K,validation:Z,hasScanDetails:_,setIsScanDetailsOpen:ee,preventMaliciousTransaction:se,setPreventMaliciousTransaction:re,tokensSent:ne,tokensReceived:ie,isScanning:oe,isCancellable:le,functionName:te})=>{let{showTransactionDetails:ae,setShowTransactionDetails:de,hasMoreDetails:ce,isErc20Ish:xe}=(e=>{let[s,n]=r.useState(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,s])=>s&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:s,setShowTransactionDetails:n,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(G),he=j.useAppConfig(),ue=xe&&E||T||M||oe;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:m,backFn:Y}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsxs(h.Title,{style:{marginTop:n?"1.5rem":0},children:[b,/*#__PURE__*/e.jsx(B,{maxIndex:Q,transactionIndex:J})]}),/*#__PURE__*/e.jsx(x.Subtitle,{children:f}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[(!!ne[0]||ue)&&/*#__PURE__*/e.jsxs(a.Row,{children:[ie.length>0?/*#__PURE__*/e.jsx(t.LabelSm,{children:"Send"}):/*#__PURE__*/e.jsx(t.LabelSm,{children:"approve"===g?"Approval amount":"Amount"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ne.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:"setApprovalForAll"===te?"All":s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),ie.length>0&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Receive"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ie.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:G.spender,url:R?.blockExplorers?.default?.url})})]}):null,w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:w,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),y&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:y,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:S})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:T||M||void 0===F,children:F?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",he.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):v})]}),ce&&!_&&/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.Row,{className:"cursor-pointer",onClick:()=>de(!ae),children:/*#__PURE__*/e.jsxs(t.LabelSmPrimary,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e.jsx(s.ChevronDownIcon,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ae?"rotate(180deg)":void 0}})]})}),ae&&G&&/*#__PURE__*/e.jsx(q,{action:g,chain:R,transactionDetails:G,isTokenContractInfoLoading:E,symbol:D})]}),_&&/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>ee(!0),children:[/*#__PURE__*/e.jsx("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e.jsx(s.ArrowRightIcon,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e.jsx(p.Grow,{}),i?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:i.message}):c&&0===J?
|
|
2
2
|
/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:c.shortMessage??W}):null,/*#__PURE__*/e.jsx($,{variant:Z,preventMaliciousTransaction:se,setPreventMaliciousTransaction:re}),/*#__PURE__*/e.jsx(P,{$useSmallMargins:!(!c&&!i&&"warn"!==Z&&"error"!==Z),address:I,balance:O,errMsg:T||c||i||!k?void 0:`Add funds on ${R?.name??K} to complete transaction.`}),/*#__PURE__*/e.jsx(o.PrimaryButton,{style:{marginTop:"1rem"},loading:A,disabled:C||T,onClick:X,children:L}),le&&/*#__PURE__*/e.jsx(o.EmbeddedButton,{style:{marginTop:"1rem"},onClick:m,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})},exports.TransactionErrorView=({transactionError:s,chainId:n,onClose:i,onRetry:o,chainType:t,transactionHash:a})=>{let{chains:d}=L.usePrivyInternal(),[c,x]=r.useState(!1),{errorCode:h,errorMessage:u}=((e,s)=>{if("ethereum"===s)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,n=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let s=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));s&&(n=s)}return{transactionHash:r,errorMessage:n}})(s,t),m=(({chains:e,chainId:s,chainType:r,transactionHash:n})=>"ethereum"===r?e.find((e=>e.id===s))?.blockExplorers?.default.url??"https://etherscan.io":function(e,s){return`https://explorer.solana.com/tx/${e}?chain=${s}`}(n||"",s))({chains:d,chainId:n,chainType:t,transactionHash:a});/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:i}),/*#__PURE__*/e.jsxs(J,{children:[/*#__PURE__*/e.jsx(G,{}),/*#__PURE__*/e.jsx(Q,{children:h}),/*#__PURE__*/e.jsx(Y,{children:"Please try again."}),/*#__PURE__*/e.jsxs(re,{children:[/*#__PURE__*/e.jsx(se,{children:"Error message"}),/*#__PURE__*/e.jsx(ie,{$clickable:!1,children:u})]}),a&&/*#__PURE__*/e.jsxs(re,{children:[/*#__PURE__*/e.jsx(se,{children:"Transaction hash"}),/*#__PURE__*/e.jsxs(ne,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e.jsx("u",{children:/*#__PURE__*/e.jsx("a",{href:m,children:"block explorer"})}),"."]}),/*#__PURE__*/e.jsxs(ie,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(a),x(!0)},children:[a,/*#__PURE__*/e.jsx(te,{clicked:c})]})]}),/*#__PURE__*/e.jsx(ee,{onClick:()=>o({resetNonce:!!a}),children:"Retry transaction"})]}),/*#__PURE__*/e.jsx(l.ModalFooter,{})]})};
|