@privy-io/react-auth 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{AccountNotFoundScreen-jSbfPu_e.js → AccountNotFoundScreen-Cu7enz9o.js} +1 -1
- package/dist/cjs/{Address-CZQd_MIA.js → Address-DYZ3IQKV.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-Cl_SWg16.js +1 -0
- package/dist/cjs/{AllowlistRejectionScreen-B6roj0JU.js → AllowlistRejectionScreen-D5b9mnX_.js} +1 -1
- package/dist/cjs/{AuthenticateWithWalletScreen-BcBapHrq.js → AuthenticateWithWalletScreen-CfFbXvGY.js} +1 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-CCdsJbKx.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-CTI3rpHf.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-ftedBDSO.js +1 -0
- package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DYS3lDs0.js → AwaitingSolToEvmBridgingScreen-CaKyEgGQ.js} +1 -1
- package/dist/cjs/{BridgeNetworkSelectionView-uivzU_Y9.js → BridgeNetworkSelectionView-ekW1jVoZ.js} +1 -1
- package/dist/cjs/{Button-nXApC2Jy.js → Button-BpQ22RCK.js} +1 -1
- package/dist/cjs/CaptchaScreen-aaD10pK6.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-DXk7YS8-.js +1 -0
- package/dist/cjs/{ConnectEmailForm-BEv-7qU9.js → ConnectEmailForm-uUuYB04I.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-BsZYPosO.js +1 -0
- package/dist/cjs/{ConnectOnlyLandingScreen-bOhkl0xJ.js → ConnectOnlyLandingScreen-DDCcNqF9.js} +1 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DyJB2X3z.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-Dfoq-0pD.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-DK-bg2D5.js → ConnectPhoneForm-tjeQd9v8.js} +1 -1
- package/dist/cjs/{ConnectWalletView-4vj7Sq7-.js → ConnectWalletView-CxfQTEJ2.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-iMAYJhVc.js +1 -0
- package/dist/cjs/CrossAppAuthScreen-CsZ_rLLg.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-tt_NEfU6.js → CustomLandingScreenView-B0bNrKZn.js} +2 -2
- package/dist/cjs/{DelegatedActionsConsentScreen-B5WlYn7z.js → DelegatedActionsConsentScreen-CyITZiB7.js} +1 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-vQnlP7qN.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-D5yc0IhZ.js +1 -0
- package/dist/cjs/{EmbeddedWalletCreatedScreen-PycFyIz6.js → EmbeddedWalletCreatedScreen-BFJ6BKQ4.js} +1 -1
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-BDTDQY1f.js → EmbeddedWalletKeyExportScreen-Cz3cpL6Q.js} +2 -2
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-L4tUdjxn.js +1 -0
- package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js → EmbeddedWalletPasswordUpdateScreen-n5Z982kO.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js → EmbeddedWalletPasswordUpdateSplashScreen-BJQXfJ5I.js} +1 -1
- package/dist/cjs/{EnrollTotp-DZ5fIrXr.js → EnrollTotp-Bo2kHSAy.js} +1 -1
- package/dist/cjs/ErrorScreen-BGI-4cUT.js +1 -0
- package/dist/cjs/FarcasterConnectStatusScreen-BKcQ6ZMu.js +2 -0
- package/dist/cjs/{FarcasterSignerStatusScreen-CDYkqsxz.js → FarcasterSignerStatusScreen-BB63F9MZ.js} +2 -2
- package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js → FundSolWalletWithExternalSolanaWallet-DFQlLB8a.js} +1 -1
- package/dist/cjs/{FundWalletMethodHeader-zYWhBIiS.js → FundWalletMethodHeader-CZ9E9Pcd.js} +1 -1
- package/dist/cjs/{FundingEditAmountScreen-BB7-k00c.js → FundingEditAmountScreen-C8OzBV96.js} +1 -1
- package/dist/cjs/{FundingMethodSelectionScreen-BrV94GD2.js → FundingMethodSelectionScreen-GE2W8CGa.js} +1 -1
- package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +1 -0
- package/dist/cjs/{InAppBrowserLoginNotPossible-y8g07-kU.js → InAppBrowserLoginNotPossible-BDJuZ0-D.js} +1 -1
- package/dist/cjs/{InstallWalletScreen-CmGi6mS1.js → InstallWalletScreen-tcaVKdvZ.js} +1 -1
- package/dist/cjs/LandingScreen-BIRSSuAB.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BJXyOu2J.js → LinkConflictScreen-D6812iEs.js} +1 -1
- package/dist/cjs/LinkEmailScreen-D-kZRiYu.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-Bw7Xs741.js → LinkPasskeyScreen-Dn0beRU9.js} +1 -1
- package/dist/cjs/{LinkPhoneScreen-C4JQblY3.js → LinkPhoneScreen-D2wD2X6_.js} +1 -1
- package/dist/cjs/{LoginFailedScreen-CGT-2B2h.js → LoginFailedScreen-JL8lSBDT.js} +1 -1
- package/dist/cjs/ManualTransferScreen-rVVbGuHO.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-7wF7sedZ.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-DXT_z8L7.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-DJWHdMZL.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-BC3Vuttf.js +1 -0
- package/dist/cjs/{ModalHeader-DbV81e3m.js → ModalHeader-BmFtLkWJ.js} +1 -1
- package/dist/cjs/{MoonpayStatusScreen-yghPhz7v.js → MoonpayStatusScreen-DyW9zeoT.js} +1 -1
- package/dist/cjs/OAuthStatusScreen-FjNrpKlb.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-DyHtky_y.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-Q0ag_5Jx.js +1 -0
- package/dist/cjs/PasswordRecoveryScreen-D6vuUKqB.js +1 -0
- package/dist/cjs/{QrCode-Ua_0cVUP.js → QrCode-qgAdMqWi.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-D1xbanmh.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-DW-I4Bjp.js +1 -0
- package/dist/cjs/RecoverySelectionScreen-CSsw-SMB.js +1 -0
- package/dist/cjs/{Screen-65eQbiHD.js → Screen-BAXdSOJk.js} +1 -1
- package/dist/cjs/{ScreenLayout-B_60rKhZ.js → ScreenLayout-95K6C4n8.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-DQolobOz.js → SetAutomaticRecoveryScreen-DdYvhBam.js} +1 -1
- package/dist/cjs/{SetWalletPasswordForm-8g-lawop.js → SetWalletPasswordForm-D7TN70-K.js} +2 -2
- package/dist/cjs/{SignRequestScreen-BAgmmVVW.js → SignRequestScreen-B6DzD2bf.js} +1 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-Cl_1GhiF.js +1 -0
- package/dist/cjs/TelegramAuthScreen-D32WGqrh.js +1 -0
- package/dist/cjs/{TransactionDetails-BefABtVQ.js → TransactionDetails-B4mP9iqk.js} +1 -1
- package/dist/cjs/{TransactionErrorView-QKWh4urc.js → TransactionErrorView-BPMOzuyp.js} +2 -2
- package/dist/cjs/TransferFromWalletScreen-BbJ3ISYt.js +1 -0
- package/dist/cjs/{TransferOrBridgeLoadingScreen-C6t1_cTP.js → TransferOrBridgeLoadingScreen-DsBPxxqR.js} +1 -1
- package/dist/cjs/TurnstileWrapper-qLN0G5m7.js +1 -0
- package/dist/cjs/UpdateEmailScreen-fqqg8VfP.js +1 -0
- package/dist/cjs/{UpdatePhoneScreen-DefnuTEZ.js → UpdatePhoneScreen-BJDovBOR.js} +1 -1
- package/dist/cjs/{UserLimitReachedScreen-B76r_-LC.js → UserLimitReachedScreen-CSkM5uLj.js} +1 -1
- package/dist/cjs/WalletButtonList-jzt0Egd8.js +1 -0
- package/dist/cjs/{WalletInfoCard-CscdnrUV.js → WalletInfoCard-bdaI4ebq.js} +1 -1
- package/dist/cjs/{WalletInterstitialScreen-CG1k3EvV.js → WalletInterstitialScreen-BzSNp3dA.js} +1 -1
- package/dist/cjs/{WalletLink-DF6dDjkz.js → WalletLink-2kOfC5R5.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/context-CToLw7Dr.js +1 -0
- package/dist/cjs/{ethers-uj8IknV_.js → ethers-Djy--MKt.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{frame-bPqBJ8fS.js → frame-BSQIYvLs.js} +1 -1
- package/dist/cjs/{get-is-unified-wallet-DmiciSes.js → get-is-unified-wallet-CAK7Zx3C.js} +1 -1
- package/dist/cjs/{getErc20Balance-BZ5-OGfD.js → getErc20Balance-BiXU_58s.js} +1 -1
- package/dist/cjs/{getErc20TokenInfo-HX7DgcWx.js → getErc20TokenInfo-B78AxnZ3.js} +1 -1
- package/dist/cjs/{getPublicClient-EjAv8R2z.js → getPublicClient-d-gCTRgH.js} +1 -1
- package/dist/cjs/index-BqAmClyL.js +1 -0
- package/dist/cjs/{index-Cuv6j_Y0.js → index-CBf8l7UH.js} +1 -1
- package/dist/cjs/index-DKxtLOTJ.js +5 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal-context-D80qA_jS.js +1 -0
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{prepareFundingModalData-BVlyr8l5.js → prepareFundingModalData-BhY38T4k.js} +1 -1
- package/dist/cjs/{reservoir-3I-Vkf2B.js → reservoir-DLqCfAka.js} +1 -1
- package/dist/cjs/{shared-CT5ocsPG.js → shared-LnNw37YZ.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js → shouldProceedtoEmbeddedWalletCreationFlow-D8TmPfTs.js} +1 -1
- package/dist/cjs/{smart-wallets-B7vHjGAW.js → smart-wallets-BxBo7Rwr.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{to-ui-error-a-xwbRKZ.js → to-ui-error-DQR0PH1r.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-create-wallet-without-fallback-DSOJS4h0.js → use-create-wallet-without-fallback-DVsaEUAi.js} +1 -1
- package/dist/cjs/{use-export-wallet-BRFTskbr.js → use-export-wallet-Bp3Q263k.js} +1 -1
- package/dist/cjs/{use-sign-with-user-signer-On9f1Fag.js → use-sign-with-user-signer-H6aAias8.js} +1 -1
- package/dist/cjs/{useActiveWallet-DcxqWAsq.js → useActiveWallet-rCbIz7HK.js} +1 -1
- package/dist/cjs/{useGetSolPrice-eOpcFeNE.js → useGetSolPrice-mb9rbK56.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-EcT0H5rf.js → useGetTokenPrice-BXSjabMV.js} +1 -1
- package/dist/cjs/{useI18n-hYSvbQCq.js → useI18n-DnOEBAdg.js} +1 -1
- package/dist/cjs/{usePrivy-CXPeoT5g.js → usePrivy-fmKLKsT3.js} +1 -1
- package/dist/cjs/{useSolanaRpcClient-mfV88iJm.js → useSolanaRpcClient-BSb_hq8i.js} +1 -1
- package/dist/cjs/{useWalletBalance-CQAgfkRc.js → useWalletBalance-9yRQYIAe.js} +1 -1
- package/dist/cjs/{useWallets-h2xCj02C.js → useWallets-D6t7Ii2K.js} +1 -1
- package/dist/cjs/{useWallets-TxPVNWGS.js → useWallets-dr024nCy.js} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.mts → events-context-Bt8hY3AJ.d.mts} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.ts → events-context-Bt8hY3AJ.d.ts} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +17 -10
- package/dist/dts/index.d.ts +17 -10
- package/dist/dts/internal.d.mts +1 -1
- package/dist/dts/internal.d.ts +1 -1
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +3 -3
- package/dist/dts/solana.d.ts +3 -3
- package/dist/dts/{types-BkkvIRg5.d.mts → types-Dx2VbdX1.d.mts} +52 -7
- package/dist/dts/{types-BkkvIRg5.d.ts → types-Dx2VbdX1.d.ts} +52 -7
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-DQR0FatT.mjs +1 -0
- package/dist/esm/{Address-DtXA0OPS.mjs → Address-C1iw9r70.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-BU4I5ISJ.mjs +1 -0
- package/dist/esm/{AllowlistRejectionScreen-BuH5iBJ3.mjs → AllowlistRejectionScreen-WgcCN6CH.mjs} +1 -1
- package/dist/esm/{AuthenticateWithWalletScreen-CKJqrLEm.mjs → AuthenticateWithWalletScreen-D6Zy69An.mjs} +1 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-ByIVuwRF.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-Bq0rCErj.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-itJ4854u.mjs +1 -0
- package/dist/esm/{AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs → AwaitingSolToEvmBridgingScreen-BSxfnQcf.mjs} +1 -1
- package/dist/esm/{BridgeNetworkSelectionView-Bu0vi9_a.mjs → BridgeNetworkSelectionView-DXjTVIcQ.mjs} +1 -1
- package/dist/esm/{Button-DJ-mtuuD.mjs → Button-OlK_6fKk.mjs} +1 -1
- package/dist/esm/CaptchaScreen-BBjPbV4B.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-CZpfBNiz.mjs +1 -0
- package/dist/esm/{ConnectEmailForm-DUgOCS2V.mjs → ConnectEmailForm-C2TJPUYV.mjs} +1 -1
- package/dist/esm/ConnectLedgerScreen-TCVn5s4x.mjs +1 -0
- package/dist/esm/{ConnectOnlyLandingScreen-BVkcUaO6.mjs → ConnectOnlyLandingScreen-CjVJO9uh.mjs} +1 -1
- package/dist/esm/ConnectOnlyStatusScreen-BGJ4l52n.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-CZDi1Oaj.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-CbuSfwAI.mjs → ConnectPhoneForm-kW8tUq0-.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-DVDOSzi0.mjs → ConnectWalletView-tpdAD3K7.mjs} +1 -1
- package/dist/esm/ConnectionStatusScreen-B3NfUQx_.mjs +1 -0
- package/dist/esm/CrossAppAuthScreen-CnvB1lhx.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-DWt9lv8W.mjs → CustomLandingScreenView-DZTOg8z4.mjs} +2 -2
- package/dist/esm/DelegatedActionsConsentScreen-DeBkGN9b.mjs +1 -0
- package/dist/esm/{DelegatedActionsRevokeScreen-B-xLCB1j.mjs → DelegatedActionsRevokeScreen-CTgPXrqu.mjs} +1 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-Qu9cmWzJ.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-DFciR3k8.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-DX22sVNh.mjs → EmbeddedWalletKeyExportScreen-CEo3FI_N.mjs} +2 -2
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-C7cawTmQ.mjs +1 -0
- package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs → EmbeddedWalletPasswordUpdateScreen-GdNNmtZR.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs → EmbeddedWalletPasswordUpdateSplashScreen-BNOCuoES.mjs} +1 -1
- package/dist/esm/{EnrollTotp-BzAm1Ya4.mjs → EnrollTotp-CtNw20-I.mjs} +1 -1
- package/dist/esm/ErrorScreen-NoHFWbKU.mjs +1 -0
- package/dist/esm/FarcasterConnectStatusScreen-CiN00CmD.mjs +1 -0
- package/dist/esm/{FarcasterSignerStatusScreen-DIfmv7Ft.mjs → FarcasterSignerStatusScreen-MQ2QrijY.mjs} +1 -1
- package/dist/esm/{FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs → FundSolWalletWithExternalSolanaWallet-DVaHCgDh.mjs} +1 -1
- package/dist/esm/{FundWalletMethodHeader-CbTaIDLQ.mjs → FundWalletMethodHeader-RY6-H-Ry.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-DiZ2-4XS.mjs +1 -0
- package/dist/esm/{FundingMethodSelectionScreen-fBauGI0K.mjs → FundingMethodSelectionScreen-yZenKs6o.mjs} +1 -1
- package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +1 -0
- package/dist/esm/{InAppBrowserLoginNotPossible-DBhsoAkw.mjs → InAppBrowserLoginNotPossible-CTnPeOBa.mjs} +1 -1
- package/dist/esm/{InstallWalletScreen-CEcl2LHj.mjs → InstallWalletScreen-CBxWJiQf.mjs} +1 -1
- package/dist/esm/LandingScreen-CzhCoUSE.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-Bg9QTrJX.mjs → LinkConflictScreen-BnoDRUE0.mjs} +1 -1
- package/dist/esm/LinkEmailScreen-x_TPODcx.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-CNFL2N09.mjs → LinkPasskeyScreen-D9IfHaec.mjs} +1 -1
- package/dist/esm/{LinkPhoneScreen-DnPAvact.mjs → LinkPhoneScreen-DaK-7otl.mjs} +1 -1
- package/dist/esm/{LoginFailedScreen-CkxfR75o.mjs → LoginFailedScreen-CoukYLVP.mjs} +1 -1
- package/dist/esm/ManualTransferScreen-DdumQnbt.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-BsRpCR72.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-Cr92F0yT.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-CXyaDU1D.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-ghKHn2BT.mjs +1 -0
- package/dist/esm/{ModalHeader-D7WajfD8.mjs → ModalHeader-CxHK1IKF.mjs} +1 -1
- package/dist/esm/{MoonpayStatusScreen-CBc4DLDR.mjs → MoonpayStatusScreen-DhMZLroP.mjs} +1 -1
- package/dist/esm/OAuthStatusScreen-BFVDc4G4.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-Dvxli58H.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-c9nu4s_d.mjs +1 -0
- package/dist/esm/PasswordRecoveryScreen-CsdO4G6h.mjs +1 -0
- package/dist/esm/{QrCode-zzqjquVm.mjs → QrCode-BI2LxLLg.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-Dp7fnj5t.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DdzD09T3.mjs +1 -0
- package/dist/esm/RecoverySelectionScreen-D2nDGt4R.mjs +1 -0
- package/dist/esm/{Screen-dwi2CitY.mjs → Screen-Dzz_AFFs.mjs} +1 -1
- package/dist/esm/{ScreenLayout-Dmrhdwtt.mjs → ScreenLayout-pthdsODa.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs → SetAutomaticRecoveryScreen-g1kDOe61.mjs} +1 -1
- package/dist/esm/{SetWalletPasswordForm-ZtRqoZYj.mjs → SetWalletPasswordForm-DUTEhc4R.mjs} +2 -2
- package/dist/esm/{SignRequestScreen-DdAK4SlJ.mjs → SignRequestScreen-DjLHkDxK.mjs} +1 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-CFqthHKF.mjs +1 -0
- package/dist/esm/TelegramAuthScreen-B5uYbdxP.mjs +1 -0
- package/dist/esm/{TransactionDetails-fgHkAnf9.mjs → TransactionDetails-DITlhQNk.mjs} +3 -3
- package/dist/esm/{TransactionErrorView-Dgp1KSy5.mjs → TransactionErrorView-DmFbjQHi.mjs} +2 -2
- package/dist/esm/TransferFromWalletScreen-Dvp-YNqS.mjs +1 -0
- package/dist/esm/{TransferOrBridgeLoadingScreen-D3vBwM_o.mjs → TransferOrBridgeLoadingScreen-CFRKffkj.mjs} +1 -1
- package/dist/esm/TurnstileWrapper-Co-t5mTh.mjs +1 -0
- package/dist/esm/UpdateEmailScreen-DoDVvVCw.mjs +1 -0
- package/dist/esm/{UpdatePhoneScreen-Byn7UW7u.mjs → UpdatePhoneScreen-BoEnTnCl.mjs} +1 -1
- package/dist/esm/{UserLimitReachedScreen-DXDqdBpt.mjs → UserLimitReachedScreen-68Vv3bFU.mjs} +1 -1
- package/dist/esm/WalletButtonList-C1OqZHCA.mjs +1 -0
- package/dist/esm/{WalletInfoCard-DAv0WFcc.mjs → WalletInfoCard-DmIqX_B8.mjs} +1 -1
- package/dist/esm/{WalletInterstitialScreen-CKiSWjpa.mjs → WalletInterstitialScreen-Du_L0CK7.mjs} +1 -1
- package/dist/esm/{WalletLink-CjuEskpb.mjs → WalletLink-D2x4SkPO.mjs} +2 -2
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-B4VZqX5H.mjs +1 -0
- package/dist/esm/{ethers-CpMSCMOg.mjs → ethers-oRuqwv5W.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-BMa3kyjk.mjs → frame-BMn1PaPp.mjs} +1 -1
- package/dist/esm/{get-is-unified-wallet-DymQMSJy.mjs → get-is-unified-wallet-DXko-EzF.mjs} +1 -1
- package/dist/esm/{getErc20Balance-Dtau1386.mjs → getErc20Balance-Cl5jZN3g.mjs} +1 -1
- package/dist/esm/getErc20TokenInfo-wBcf5dYY.mjs +1 -0
- package/dist/esm/{getPublicClient-IxRndou_.mjs → getPublicClient-C_l_ocJu.mjs} +1 -1
- package/dist/esm/{index-DdlRJsoj.mjs → index-BctMJtH0.mjs} +1 -1
- package/dist/esm/index-CCrVHfyv.mjs +5 -0
- package/dist/esm/index-Ce4cEnEO.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-Cvo1WmWN.mjs → internal-context-DLZicboG.mjs} +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{prepareFundingModalData-BUyu5Vhr.mjs → prepareFundingModalData-CndHQFiM.mjs} +1 -1
- package/dist/esm/{reservoir-B0V48m2I.mjs → reservoir-DRNnyqld.mjs} +1 -1
- package/dist/esm/{shared-DsP7M4P5.mjs → shared-BMOp6N9y.mjs} +1 -1
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs +1 -0
- package/dist/esm/{smart-wallets-Cbhn7qlU.mjs → smart-wallets-B3-1-dnO.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{to-ui-error-B3m2hl6e.mjs → to-ui-error-B8DSJO-0.mjs} +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/{use-create-wallet-without-fallback-DodUf3VP.mjs → use-create-wallet-without-fallback-COqi_EHH.mjs} +1 -1
- package/dist/esm/{use-export-wallet-CWslDKqf.mjs → use-export-wallet-CRKJ4-yx.mjs} +1 -1
- package/dist/esm/{use-sign-with-user-signer-LJ6ROduD.mjs → use-sign-with-user-signer-J1po7l19.mjs} +1 -1
- package/dist/esm/useActiveWallet-Bj-s666H.mjs +1 -0
- package/dist/esm/{useGetSolPrice-Bi0pPiUW.mjs → useGetSolPrice-fF6UX0Cj.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-B4XVfxeD.mjs → useGetTokenPrice-CnQZmfvQ.mjs} +1 -1
- package/dist/esm/{useI18n-ByKvnaXP.mjs → useI18n-DIAzggWr.mjs} +1 -1
- package/dist/esm/{usePrivy-D3OPY7tm.mjs → usePrivy-BSIhOAz8.mjs} +1 -1
- package/dist/esm/{useSolanaRpcClient-DjD2ma5c.mjs → useSolanaRpcClient-Be5Dd6m5.mjs} +1 -1
- package/dist/esm/{useWalletBalance-Xca4-c_r.mjs → useWalletBalance-BuMx9pCk.mjs} +1 -1
- package/dist/esm/{useWallets-CQMJYOF9.mjs → useWallets-Cc1ILfGS.mjs} +1 -1
- package/dist/esm/{useWallets-BplPx0Pz.mjs → useWallets-DuxHKVvE.mjs} +1 -1
- package/package.json +7 -6
- package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +0 -1
- package/dist/cjs/CaptchaScreen-025syTLo.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +0 -1
- package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +0 -1
- package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +0 -1
- package/dist/cjs/ErrorScreen-Cob9AO30.js +0 -1
- package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +0 -2
- package/dist/cjs/LandingScreen-B9jb8n_d.js +0 -1
- package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +0 -1
- package/dist/cjs/ManualTransferScreen-DPz98CSt.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +0 -1
- package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +0 -1
- package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +0 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +0 -1
- package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +0 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +0 -1
- package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +0 -1
- package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +0 -1
- package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +0 -1
- package/dist/cjs/WalletButtonList-bICzXZXM.js +0 -1
- package/dist/cjs/context-JUEgi5-6.js +0 -1
- package/dist/cjs/index-BNNk54gK.js +0 -1
- package/dist/cjs/index-DvDeCr_m.js +0 -5
- package/dist/cjs/internal-context-VDPFkIXN.js +0 -1
- package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +0 -1
- package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +0 -1
- package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +0 -1
- package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +0 -1
- package/dist/esm/ErrorScreen-DFAo4S7A.mjs +0 -1
- package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +0 -1
- package/dist/esm/LandingScreen-BvRIrtFN.mjs +0 -1
- package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +0 -1
- package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +0 -1
- package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +0 -1
- package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +0 -1
- package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +0 -1
- package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +0 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +0 -1
- package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +0 -1
- package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +0 -1
- package/dist/esm/WalletButtonList-CGloXTN0.mjs +0 -1
- package/dist/esm/context-Cb5MFcME.mjs +0 -1
- package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +0 -1
- package/dist/esm/index-B_e8abKi.mjs +0 -1
- package/dist/esm/index-CI666IP9.mjs +0 -5
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +0 -1
- package/dist/esm/useActiveWallet-hrZcON-K.mjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-
|
|
2
|
-
/*#__PURE__*/o(S,{"aria-hidden":!$||j,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(x,{onClick:c,loading:a,disabled:!j,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,u]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(B,{children:/*#__PURE__*/e($,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),u((e=>!e))},children:[/*#__PURE__*/o(D,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(L,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(x,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let _=/*#__PURE__*/A.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),q=/[a-z]/,G=/[A-Z]/,
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-B4VZqX5H.mjs";import{a as s}from"./get-is-unified-wallet-DXko-EzF.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-Bmf8DxNP.mjs";import{M as m,B as g}from"./ModalHeader-CxHK1IKF.mjs";import{E as y,b as v,P as f,a as w,I as b,H as k,S as C,c as S,N as x,D as B,d as $,R as I,e as R,f as P,g as j}from"./shared-BMOp6N9y.mjs";import{styled as A}from"styled-components";import{S as L,P as E}from"./Button-OlK_6fKk.mjs";import{C as D}from"./Checkbox-NmGCZeKL.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import H from"@heroicons/react/24/solid/CheckCircleIcon";import T from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import K from"@heroicons/react/24/outline/DocumentDuplicateIcon";import O from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-Biz1wq02.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,B]=n(!0),[$,I]=n(!1),[R,P]=n(""),j=l===R;return i((()=>{R&&!$&&I(!0)}),[R]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:R,onChange:e=>P(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>I(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(k,{onClick:()=>B(!1)}):/*#__PURE__*/o(C,{onClick:()=>B(!0)})})]}),
|
|
2
|
+
/*#__PURE__*/o(S,{"aria-hidden":!$||j,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(x,{onClick:c,loading:a,disabled:!j,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,u]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(B,{children:/*#__PURE__*/e($,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),u((e=>!e))},children:[/*#__PURE__*/o(D,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(L,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(x,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let _=/*#__PURE__*/A.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>U.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),X.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+T(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:u,onClose:P,onBack:j,onPasswordChange:A,onPasswordGenerate:L})=>{let[E,D]=n(!1),[T,U]=n(!1);i((()=>{c&&!T&&U(!0)}),[c]);let F=t((()=>T?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,T]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),N=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:P,closeable:"user"===s.initiatedBy,backFn:j}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:c,onChange:e=>A(e.target.value),onKeyUp:e=>{"Enter"===e.key&&u()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(b,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(k,{onClick:()=>D(!1)}):/*#__PURE__*/o(C,{onClick:()=>D(!0)}),/*#__PURE__*/o(I,{onClick:L})]})]}),/*#__PURE__*/o(R,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o(S,{error:!!F,children:F||`Password Strength: ${T?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(B,{children:[/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(x,{onClick:u,loading:l,disabled:N,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let ae=/*#__PURE__*/A(B).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),le=/*#__PURE__*/A.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:u})=>{let[w,S]=n(!1),[B,$]=n(!0),I=a((()=>{S(!0),c&&navigator.clipboard.writeText(c)}),[c]),R=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:u,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(f,{centered:!0,children:[/*#__PURE__*/o(P,{children:B?"•".repeat(c.length):c}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:B?/*#__PURE__*/o(k,{onClick:()=>$(!1)}):/*#__PURE__*/o(C,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(j,{onClick:I,children:/*#__PURE__*/e(r,w?{children:[/*#__PURE__*/o(N,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(j,{onClick:R,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(x,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let se=(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 de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(u,n?{children:[/*#__PURE__*/o(O,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(H,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(E,{onClick:i,children:"Close"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]});let he=(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}};const pe=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),p=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let u=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:p,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:p,onBack:u}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:p,onBack:u}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:p,onBack:u}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:p}):null};export{pe as S,oe as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-CndHQFiM.mjs";import{W as f,q as C}from"./context-B4VZqX5H.mjs";import{u as x}from"./internal-context-DLZicboG.mjs";import{u as w,a as j}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as b}from"./ScreenLayout-pthdsODa.mjs";import"./copy-Bx2Jwc5_.mjs";import"eventemitter3";import"tinycolor2";import"ofetch";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const S=/*#__PURE__*/s.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 T=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},v=e=>{try{let t=i.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=i=>{let{types:r,primaryType:n,...a}=i.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(_,{data:a}),/*#__PURE__*/e(p,{text:(s=i.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const D=({method:o,messageData:i,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(b,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:r,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(R,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(S,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(L,{children:["personal_sign"===o&&/*#__PURE__*/e(M,{children:T(i)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:i}),"solana_signMessage"===o&&/*#__PURE__*/e(M,{children:v(i)})]})]})}),I={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:i}=x(),{navigate:r,data:s,onUserCloseViaDialogOrKeybindRef:l}=j(),[c,p]=n(!0),[d,u]=n(""),[g,b]=n(),[S,T]=n(null),[v,E]=n(!1);a((()=>{t||r("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:I,data:L,confirmAndSign:R,onSuccess:_,onFailure:M,uiOptions:N}=s.signMessage,A={title:N?.title||"Sign message",description:N?.description||"Signing this message will not cost you any fees.",buttonText:N?.buttonText||"Sign and continue"},U=e=>{e?_(e):M(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{T(null),u(""),b(void 0)}),200)};l.current=()=>{U(S)};/*#__PURE__*/return e(D,{method:I,messageData:L,copy:A,iconUrl:N?.iconUrl&&"string"==typeof N.iconUrl?N.iconUrl:void 0,isLoading:v,success:null!==S,walletProxyIsLoading:c,errorMessage:d,isCancellable:N?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await R();T(e),E(!1),setTimeout((()=>{U(e)}),C)}catch(e){console.error(e),u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>U(null),onClose:()=>U(S)})}};let L=/*#__PURE__*/s.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),R=/*#__PURE__*/s.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;}"]),_=/*#__PURE__*/s(g).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),M=/*#__PURE__*/s(u).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);export{I as SignRequestScreen,D as SignRequestView,I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u}from"./context-B4VZqX5H.mjs";import{u as m}from"./internal-context-DLZicboG.mjs";import{u as p}from"./useGetSolPrice-fF6UX0Cj.mjs";import{ErrorScreenView as f}from"./ErrorScreen-NoHFWbKU.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-OlK_6fKk.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-CxHK1IKF.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as I,R as A}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-D2x4SkPO.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-Bj-s666H.mjs";import{T as $,a as L}from"./TransactionErrorView-DmFbjQHi.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as F,getCompiledTransactionMessageDecoder as _,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as V,u as H}from"./useSolanaRpcClient-Be5Dd6m5.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-CCrVHfyv.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"./prepareFundingModalData-CndHQFiM.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-C_l_ocJu.mjs";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-DRNnyqld.mjs";import"./ScreenLayout-pthdsODa.mjs";import"./Screen-Dzz_AFFs.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-oRuqwv5W.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-C1iw9r70.mjs";import"./WalletInfoCard-DmIqX_B8.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.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;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(I,{children:[r?.action&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=_().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=V(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:I}=c(),A=H()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,V]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(I).find((t=>t.address===Y.address)):d(I),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:A,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,A,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await A.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:A.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:A.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await A.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,F(_().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==A.chain?"Solana":A.chain.replace("solana:",""),blockExplorerUrl:A.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(V(!0),U||!Y||!k||!I||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:A,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{V(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,q as i,C as a}from"./index-CCrVHfyv.mjs";import{u as s,q as n}from"./context-B4VZqX5H.mjs";import{u as m,b as l,j as c}from"./internal-context-DLZicboG.mjs";import{u as d,a as u}from"./get-is-unified-wallet-DXko-EzF.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";import{S as g}from"./ScreenLayout-pthdsODa.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const y=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(g,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:v,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},h={component:()=>{let{authenticated:g,logout:v,ready:h,user:f}=d(),{setModalData:A,navigate:j,resetNavigation:b,data:T}=u(),S=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[L,k]=t(!1),[I,x]=t(void 0),D=o();async function U(){try{let e=await async function(){let e;if(!g){if(D.enabled&&"error"===D.status)throw new a(D.error,null,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),k(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return x(void 0),b(),void j("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),b(),void j("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),b(),void j("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),b(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void j("LinkConflictScreen");let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{U()}),[]),r((()=>{if(!(h&&g&&L&&f))return;if(S?.legal.requireUsersAcceptTerms&&!f.hasAcceptedTerms){let e=setTimeout((()=>{j("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(f,S.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),j("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[h,g,L,f]);/*#__PURE__*/return e(y,{success:L,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),T?.telegramAuthModalData?.seamlessAuth||await C(void 0,T?.login?.disableSignup),await U()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{h as TelegramAuthScreen,y as TelegramAuthScreenView,h as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-
|
|
2
|
-
return e(n,{children:[/*#__PURE__*/e(B,{onClick:r,"data-open":String(d),children:[/*#__PURE__*/i(z,{children:t}),/*#__PURE__*/i(
|
|
3
|
-
return i(P,{...g().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(
|
|
1
|
+
import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-D2x4SkPO.mjs";import{g as d}from"./ethers-oRuqwv5W.mjs";import{F as a}from"./Layouts-Bmf8DxNP.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as p,useContext as h}from"react";import{s as f,u as g}from"./context-B4VZqX5H.mjs";const m=({label:n,children:t,valueStyles:o})=>/*#__PURE__*/e(v,{children:[/*#__PURE__*/i("div",{children:n}),/*#__PURE__*/i(u,{style:{...o},children:t})]});let v=/*#__PURE__*/t.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;}"]),u=/*#__PURE__*/t.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 y=({gas:n,tokenPrice:t,tokenSymbol:r})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n)],tokenPrice:t,tokenSymbol:r})})]}),t&&/*#__PURE__*/i(b,{children:`${d(BigInt(n),r)}`})]}),x=({value:n,gas:t,tokenPrice:r,tokenSymbol:l})=>{let c=BigInt(n??0)+BigInt(t);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n||0),BigInt(t)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/i(b,{children:d(c,l)})]})};let w=/*#__PURE__*/t.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),b=/*#__PURE__*/t.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;"]),I=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const C=/*#__PURE__*/s(void 0),k=/*#__PURE__*/s(void 0),P=({defaultValue:e,children:n})=>{let[t,o]=p(e||null);/*#__PURE__*/return i(C.Provider,{value:{activePanel:t,togglePanel:e=>{o(t===e?null:e)}},children:/*#__PURE__*/i(j,{children:n})})},T=({value:e,children:n})=>{let{activePanel:t,togglePanel:o}=h(C),r=t===e;/*#__PURE__*/return i(k.Provider,{value:{onToggle:()=>o(e),value:e},children:/*#__PURE__*/i(D,{isActive:r?"true":"false","data-open":String(r),children:n})})},N=({children:t})=>{let{activePanel:o}=h(C),{onToggle:r,value:l}=h(k),d=o===l;/*#__PURE__*/
|
|
2
|
+
return e(n,{children:[/*#__PURE__*/e(B,{onClick:r,"data-open":String(d),children:[/*#__PURE__*/i(z,{children:t}),/*#__PURE__*/i(V,{isactive:d?"true":"false",children:/*#__PURE__*/i(c,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/i(W,{})]})},S=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(F,{"data-open":String(n===t),children:/*#__PURE__*/i(R,{children:e})})},A=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(R,{children:"function"==typeof e?e({isActive:n===t}):e})};let j=/*#__PURE__*/t.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),B=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),W=/*#__PURE__*/t.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),z=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),D=/*#__PURE__*/t.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);}"]),F=/*#__PURE__*/t.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;}"]),R=/*#__PURE__*/t.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),V=/*#__PURE__*/t.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));const Q=({from:n,to:t,txn:o,transactionInfo:d,tokenPrice:a,gas:c,tokenSymbol:s})=>{let p=BigInt(o?.value||0);/*#__PURE__*/
|
|
3
|
+
return i(P,{...g().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(T,{value:"details",children:[/*#__PURE__*/i(N,{children:/*#__PURE__*/e(L,{children:[/*#__PURE__*/i("div",{children:d?.title||"Details"}),/*#__PURE__*/i(E,{children:/*#__PURE__*/i(r,{weiQuantities:[p],tokenPrice:a,tokenSymbol:s})})]})}),/*#__PURE__*/e(S,{children:[/*#__PURE__*/i(m,{label:"From",children:/*#__PURE__*/i(l,{walletAddress:n,chainId:o.chainId||f,chainType:"ethereum"})}),/*#__PURE__*/i(m,{label:"To",children:/*#__PURE__*/i(l,{walletAddress:t,chainId:o.chainId||f,chainType:"ethereum"})}),d&&d.action&&/*#__PURE__*/i(m,{label:"Action",children:d.action}),c&&/*#__PURE__*/i(y,{value:o.value,gas:c,tokenPrice:a,tokenSymbol:s})]}),/*#__PURE__*/i(A,{children:({isActive:e})=>/*#__PURE__*/i(x,{value:o.value,displayFee:e,gas:c||"0x0",tokenPrice:a,tokenSymbol:s})})]})})};let L=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),E=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);export{Q as T};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as c}from"@privy-io/js-sdk-core";import{P as d,E as s}from"./Button-DJ-mtuuD.mjs";import{M as h,B as m,a as p}from"./ModalHeader-D7WajfD8.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as x}from"./Row-CG0lSY5Z.mjs";import{E as b}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-DtXA0OPS.mjs";import{W as C}from"./WalletInfoCard-DAv0WFcc.mjs";import{u as T}from"./context-Cb5MFcME.mjs";import{Y as S}from"./useActiveWallet-hrZcON-K.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-Cvo1WmWN.mjs";const B=/*#__PURE__*/l(u).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 P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:c,$isLoading:d})=>{if(d)/*#__PURE__*/return e(R,{$isLoading:d});let s=i&&t&&c?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,c,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:d,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:d,children:["$",t]})]})};let R=/*#__PURE__*/l.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;",""],N);const W=/*#__PURE__*/l.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;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:c,functionName:d}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==c&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:d})]}),"mint"===d&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===d&&t.operator&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==t.approved&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===d&&t.spender&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferFrom&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferTo&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:c,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:_,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:ce,setIsScanDetailsOpen:de,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:xe,hasMoreDetails:be,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(K,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(x,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(Z,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),be&&!ce&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(x,{className:"cursor-pointer",onClick:()=>xe(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),ce&&/*#__PURE__*/e(x,{children:/*#__PURE__*/n(B,{onClick:()=>de(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),c?/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:c.message}):p&&0===ie?
|
|
2
|
-
/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:p.shortMessage??G}):null,/*#__PURE__*/e(H,{variant:le,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!p&&!c&&"warn"!==le&&"error"!==le),address:D,balance:_,errMsg:z||p||c||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:ne,children:F}),fe&&/*#__PURE__*/e(s,{style:{marginTop:"1rem"},onClick:k,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},Y=({img:o,title:l,subtitle:s,cta:p,instructions:g,network:C,blockExplorerUrl:N,isMissingFunds:A,submitError:j,parseError:E,total:M,swap:$,transactingWalletAddress:O,fee:D,balance:F,disabled:L,isSubmitting:P,isPreparing:R,isTokenPriceLoading:W,onClick:z,onClose:V,onBack:H,isSponsored:U})=>{let q=R||W,[J,Q]=a(!1),Y=T();/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:V,backFn:H}),o&&/*#__PURE__*/e(K,{children:o}),/*#__PURE__*/e(v,{style:{marginTop:o?"1.5rem":0},children:l}),/*#__PURE__*/e(w,{children:s}),/*#__PURE__*/n(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(M||q)&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{$isLoading:q,children:M})]}),$&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Swap"}),/*#__PURE__*/e(f,{children:$})]}),C&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:C})]}),(D||q||void 0!==U)&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:q,children:U&&!q?/*#__PURE__*/n(Z,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",Y.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]})]}),/*#__PURE__*/e(x,{children:/*#__PURE__*/n(B,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(r,{children:g.map(((r,i)=>"sol-transfer"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.withSeed?"with seed":""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:r.token.decimals})," ",r.token.symbol]})]}),!!r.toAccount&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAccount,url:N})})]})]},i):"spl-transfer"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.token.symbol]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{children:r.value.toString()})]}),!!r.fromAta&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.fromAta,url:N})})]}),!!r.toAta&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAta,url:N})})]}),!!r.token.address&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.token.address,url:N})})]})]},i):"ata-creation"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Create token account"})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),!!r.owner&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"create-account"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Create account ",r.withSeed?"with seed":""]})}),!!r.account&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Initialize token account"})}),!!r.account&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),!!r.mint&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Mint"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mint,url:N})})]}),!!r.owner&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-close-account"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Close token account"})}),!!r.source&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.source,url:N})})]}),!!r.destination&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.destination,url:N})})]}),!!r.owner&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-sync-native"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Sync native"})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]})]},i):"raydium-swap-base-input"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount in"}),/*#__PURE__*/e(f,{children:r.amountIn.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Minimum amount out"}),/*#__PURE__*/e(f,{children:r.minimumAmountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"raydium-swap-base-output"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Max amount in"}),/*#__PURE__*/e(f,{children:r.maxAmountIn.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.amountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-shared-accounts-route"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"In amount"}),/*#__PURE__*/e(f,{children:r.inAmount.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Quoted out amount"}),/*#__PURE__*/e(f,{children:r.quotedOutAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-exact-out-route"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Quoted in amount"}),/*#__PURE__*/e(f,{children:r.quotedInAmount.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.outAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Data"}),/*#__PURE__*/e(f,{children:r.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:j.message}):E?/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:G}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!E&&!j),title:"",address:O,balance:F,errMsg:R||E||j||!A?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:P,disabled:L||R,onClick:z,children:p}),/*#__PURE__*/e(m,{})]})};let X=/*#__PURE__*/l(C).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),_=/*#__PURE__*/l(y).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;"]),G="There was an error preparing your transaction. Your transaction request will likely fail.",K=/*#__PURE__*/l.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);}"]),Z=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),ee=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let ne=()=>/*#__PURE__*/n(ae,{children:[/*#__PURE__*/e(ce,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:c,transactionHash:d})=>{let{chains:s}=L(),[m,u]=a(!1),{errorCode:f,errorMessage:g}=((e,n)=>{if("ethereum"===n)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,i=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));n&&(i=n)}return{transactionHash:r,errorMessage:i}})(i,c),y=(({chains:e,chainId:n,chainType:r,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===n))?.blockExplorers?.default.url??"https://etherscan.io":function(e,n){return`https://explorer.solana.com/tx/${e}?chain=${n}`}(i||"",n))({chains:s,chainId:o,chainType:c,transactionHash:d});/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:t}),/*#__PURE__*/n(ie,{children:[/*#__PURE__*/e(ne,{}),/*#__PURE__*/e(oe,{children:f}),/*#__PURE__*/e(te,{children:"Please try again."}),/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Error message"}),/*#__PURE__*/e(pe,{$clickable:!1,children:g})]}),d&&/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Transaction hash"}),/*#__PURE__*/n(me,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e("u",{children:/*#__PURE__*/e("a",{href:y,children:"block explorer"})}),"."]}),/*#__PURE__*/n(pe,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(d),u(!0)},children:[d,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(de,{onClick:()=>l({resetNonce:!!d}),children:"Retry transaction"})]}),/*#__PURE__*/e(p,{})]})};let ie=/*#__PURE__*/l.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),oe=/*#__PURE__*/l.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;"]),te=/*#__PURE__*/l.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;"]),ae=/*#__PURE__*/l.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),le=/*#__PURE__*/l(F).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),ce=/*#__PURE__*/l.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;"]),de=/*#__PURE__*/l(d).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/l.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),he=/*#__PURE__*/l.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),me=/*#__PURE__*/l.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;"]),pe=/*#__PURE__*/l.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 }")),ue=/*#__PURE__*/l(D).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),fe=/*#__PURE__*/l(O).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),ge=({clicked:n})=>/*#__PURE__*/e(n?fe:ue,{});export{Q as S,re as T,Y as a};
|
|
1
|
+
import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as c}from"@privy-io/js-sdk-core";import{P as d,E as s}from"./Button-OlK_6fKk.mjs";import{M as h,B as m,a as p}from"./ModalHeader-CxHK1IKF.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as b}from"./Row-CG0lSY5Z.mjs";import{E as x}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-C1iw9r70.mjs";import{W as C}from"./WalletInfoCard-DmIqX_B8.mjs";import{u as T}from"./context-B4VZqX5H.mjs";import{Y as S}from"./useActiveWallet-Bj-s666H.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-DLZicboG.mjs";const B=/*#__PURE__*/l(u).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 P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:c,$isLoading:d})=>{if(d)/*#__PURE__*/return e(R,{$isLoading:d});let s=i&&t&&c?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,c,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:d,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:d,children:["$",t]})]})};let R=/*#__PURE__*/l.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;",""],N);const W=/*#__PURE__*/l.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;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:c,functionName:d}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==c&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:d})]}),"mint"===d&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===d&&t.operator&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===d&&t.spender&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferFrom&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferTo&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:c,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:G,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:ce,setIsScanDetailsOpen:de,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:be,hasMoreDetails:xe,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(Z,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(b,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),xe&&!ce&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(b,{className:"cursor-pointer",onClick:()=>be(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),ce&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>de(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),c?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:c.message}):p&&0===ie?
|
|
2
|
+
/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:p.shortMessage??K}):null,/*#__PURE__*/e(H,{variant:le,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!p&&!c&&"warn"!==le&&"error"!==le),address:D,balance:G,errMsg:z||p||c||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:ne,children:F}),fe&&/*#__PURE__*/e(s,{style:{marginTop:"1rem"},onClick:k,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},Y=({img:o,title:l,subtitle:s,cta:p,instructions:g,network:C,blockExplorerUrl:N,isMissingFunds:A,submitError:j,parseError:E,total:M,swap:$,transactingWalletAddress:O,fee:D,balance:F,disabled:L,isSubmitting:P,isPreparing:R,isTokenPriceLoading:W,onClick:z,onClose:V,onBack:H,isSponsored:U})=>{let q=R||W,[J,Q]=a(!1),Y=T();/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:V,backFn:H}),o&&/*#__PURE__*/e(Z,{children:o}),/*#__PURE__*/e(v,{style:{marginTop:o?"1.5rem":0},children:l}),/*#__PURE__*/e(w,{children:s}),/*#__PURE__*/n(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(M||q)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{$isLoading:q,children:M})]}),$&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Swap"}),/*#__PURE__*/e(f,{children:$})]}),C&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:C})]}),(D||q||void 0!==U)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:q,children:U&&!q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",Y.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]})]}),/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(r,{children:g.map(((r,i)=>"sol-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.withSeed?"with seed":""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:r.token.decimals})," ",r.token.symbol]})]}),!!r.toAccount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAccount,url:N})})]})]},i):"spl-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.token.symbol]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{children:r.value.toString()})]}),!!r.fromAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.fromAta,url:N})})]}),!!r.toAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAta,url:N})})]}),!!r.token.address&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.token.address,url:N})})]})]},i):"ata-creation"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Create token account"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"create-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Create account ",r.withSeed?"with seed":""]})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Initialize token account"})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),!!r.mint&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Mint"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mint,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-close-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Close token account"})}),!!r.source&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.source,url:N})})]}),!!r.destination&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.destination,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-sync-native"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Sync native"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]})]},i):"raydium-swap-base-input"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount in"}),/*#__PURE__*/e(f,{children:r.amountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Minimum amount out"}),/*#__PURE__*/e(f,{children:r.minimumAmountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"raydium-swap-base-output"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Max amount in"}),/*#__PURE__*/e(f,{children:r.maxAmountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.amountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-shared-accounts-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"In amount"}),/*#__PURE__*/e(f,{children:r.inAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted out amount"}),/*#__PURE__*/e(f,{children:r.quotedOutAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-exact-out-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted in amount"}),/*#__PURE__*/e(f,{children:r.quotedInAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.outAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):/*#__PURE__*/n(G,{children:[/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Data"}),/*#__PURE__*/e(f,{children:r.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:j.message}):E?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:K}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!E&&!j),title:"",address:O,balance:F,errMsg:R||E||j||!A?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:P,disabled:L||R,onClick:z,children:p}),/*#__PURE__*/e(m,{})]})};let X=/*#__PURE__*/l(C).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),G=/*#__PURE__*/l(y).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;"]),K="There was an error preparing your transaction. Your transaction request will likely fail.",Z=/*#__PURE__*/l.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);}"]),_=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),ee=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let ne=()=>/*#__PURE__*/n(ae,{children:[/*#__PURE__*/e(ce,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:c,transactionHash:d})=>{let{chains:s}=L(),[m,u]=a(!1),{errorCode:f,errorMessage:g}=((e,n)=>{if("ethereum"===n)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,i=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));n&&(i=n)}return{transactionHash:r,errorMessage:i}})(i,c),y=(({chains:e,chainId:n,chainType:r,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===n))?.blockExplorers?.default.url??"https://etherscan.io":function(e,n){return`https://explorer.solana.com/tx/${e}?chain=${n}`}(i||"",n))({chains:s,chainId:o,chainType:c,transactionHash:d});/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:t}),/*#__PURE__*/n(ie,{children:[/*#__PURE__*/e(ne,{}),/*#__PURE__*/e(oe,{children:f}),/*#__PURE__*/e(te,{children:"Please try again."}),/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Error message"}),/*#__PURE__*/e(pe,{$clickable:!1,children:g})]}),d&&/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Transaction hash"}),/*#__PURE__*/n(me,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e("u",{children:/*#__PURE__*/e("a",{href:y,children:"block explorer"})}),"."]}),/*#__PURE__*/n(pe,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(d),u(!0)},children:[d,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(de,{onClick:()=>l({resetNonce:!!d}),children:"Retry transaction"})]}),/*#__PURE__*/e(p,{})]})};let ie=/*#__PURE__*/l.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),oe=/*#__PURE__*/l.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;"]),te=/*#__PURE__*/l.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;"]),ae=/*#__PURE__*/l.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),le=/*#__PURE__*/l(F).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),ce=/*#__PURE__*/l.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;"]),de=/*#__PURE__*/l(d).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/l.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),he=/*#__PURE__*/l.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),me=/*#__PURE__*/l.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;"]),pe=/*#__PURE__*/l.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 }")),ue=/*#__PURE__*/l(D).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),fe=/*#__PURE__*/l(O).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),ge=({clicked:n})=>/*#__PURE__*/e(n?fe:ue,{});export{Q as S,re as T,Y as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as a,useEffect as i}from"react";import{M as o,B as l}from"./ModalHeader-CxHK1IKF.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as s}from"./FundWalletMethodHeader-RY6-H-Ry.mjs";import{C as m}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as c}from"./context-B4VZqX5H.mjs";import{v as d,a8 as u,U as h}from"./useActiveWallet-Bj-s666H.mjs";import{u as y}from"./internal-context-DLZicboG.mjs";import{a as g}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u as f}from"./useWallets-DuxHKVvE.mjs";import{t as C,W as w}from"./WalletButtonList-C1OqZHCA.mjs";import{I as T}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"lucide-react";import"./index-CCrVHfyv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";const j={component:()=>{let m,{connectors:h}=y(),{setModalData:T,data:j,navigate:W}=g(),S=c(),{wallets:x}=f(),D=h.filter(d).flatMap((e=>e.wallets)),[F,k]=a("default"),M="solana"===j?.funding?.chainType,b=!!j?.funding?.crossChainBridgingEnabled;m="ethereum"===j?.funding?.chainType?j.funding.erc20Address&&!j.funding.isUSDC?"ethereum-only":b&&!j.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":b&&!j.funding?.isUSDC?"ethereum-and-solana":"solana-only";let E=x.filter((e=>"privy"!==e.walletClientType)),A=E.map((e=>e.walletClientType)),I=D.filter((e=>"privy"!==e.walletClientType)),L=I.map((e=>e.walletClientType)),B=[],H={...j.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let U=({wallet:e,walletChainType:t})=>{T({...j,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>W(q({destChainType:M?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),W("FundingAmountEditScreen")};"solana-only"!==m&&B.push(...E.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"ethereum"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),"ethereum-only"!==m&&B.push(...I.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"solana"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),B.push(...C({walletList:S.appearance.walletList.filter((e=>!E.some((t=>t.walletClientType===e))&&!I.some((t=>t.walletClientType===e)))),walletChainType:m,connectors:h,connectOnly:!0,ignore:[...S.appearance.walletList,...A,...L],walletConnectEnabled:S.externalWallets.walletConnect.enabled}));let P=/*#__PURE__*/e(w,{text:"More wallets",onClick:()=>k("overflow")}),q=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===t?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===t?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return i((()=>{T({...j,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?E.find((n=>n.address===e&&n.walletClientType===t)):I.find((n=>n.address===e&&n.walletClientType===t));return T({...j,funding:{...H,connectedWallet:i,onContinueWithExternalWallet:()=>{W(q({destChainType:M?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/t(n,"overflow"===F?{children:[/*#__PURE__*/e(o,{backFn:()=>k("default")},"header"),/*#__PURE__*/t(u,{children:[/*#__PURE__*/e(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),B]}),/*#__PURE__*/e(l,{})]}:{children:[/*#__PURE__*/e(s,{}),/*#__PURE__*/e(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/t(u,{children:[B.length>4?B.slice(0,3):B,B.length>4&&P]}),/*#__PURE__*/e(l,{})]})}};let v=({onClick:n,icon:a,name:i,chainType:o})=>/*#__PURE__*/t(h,{onClick:n,children:[/*#__PURE__*/e(T,{style:{width:20},children:/*#__PURE__*/e("img",{src:a})}),i,/*#__PURE__*/e(m,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/e(m,{color:"gray",children:"Solana"})]});export{j as TransferFromWalletScreen,j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-CxHK1IKF.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-RY6-H-Ry.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-C1iw9r70.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-Bj-s666H.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:C,isErc20Flow:x,totalPriceInNativeCurrency:T,totalPriceInUsd:v,gasPriceInNativeCurrency:B,gasPriceInUsd:P})=>{let k=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:k?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${C?"Bridging":"Confirming"} with ${I}`}),!C&&!x&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),B&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:P||B})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{Turnstile as r}from"@marsidev/react-turnstile";const t=({delayedExecution:t,captchaContext:o,...n})=>{let{appId:s,setError:a,setToken:i,setExecuting:c,siteKey:p,ref:u}=o;/*#__PURE__*/return e(r,{...n,ref:u,siteKey:p??"",options:{action:s,size:"invisible",...t?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{n.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:e=>{n.onError?.(e),a("Captcha failed"),c(!1)},onSuccess:e=>{n.onSuccess?.(e),i(e),c(!1)},onExpire:e=>{n.onExpire?.(e);try{u.current?.reset(),a(void 0),i(void 0)}catch(e){a("expired_and_failed_reset")}}})};export{t as TurnstileWrapper,t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-B4VZqX5H.mjs";import{a as l}from"./index-CCrVHfyv.mjs";import{u as d}from"./internal-context-DLZicboG.mjs";import{u as c,a as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{a1 as u,V as h}from"./useActiveWallet-Bj-s666H.mjs";import{E as j,P as v}from"./Button-OlK_6fKk.mjs";import{I as f,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-pthdsODa.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"./prepareFundingModalData-CndHQFiM.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,f]=m(""),[g,w]=m(""),[k,E]=m(!1),{authenticated:A,user:C}=c(),{initUpdateEmail:x}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||A?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");E(!0);try{await x({oldAddress:C.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}E(!1)})(U):(M({captchaModalData:{callback:e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");return x({oldAddress:C.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(S,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>f(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(j,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(v,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=f,S=g;const E=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),A={component:()=>/*#__PURE__*/t(E,{})};export{A as UpdateEmailScreen,E as UpdateEmailScreenView,A as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-kW8tUq0-.mjs";import{u as i}from"./internal-context-DLZicboG.mjs";import{a as n,u as m}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as a}from"./ScreenLayout-pthdsODa.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-B4VZqX5H.mjs";import"tinycolor2";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Button-OlK_6fKk.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:p}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await p(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
|
package/dist/esm/{UserLimitReachedScreen-DXDqdBpt.mjs → UserLimitReachedScreen-68Vv3bFU.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as e}from"./ScreenLayout-pthdsODa.mjs";import"viem";import"react";import"./context-B4VZqX5H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-DLZicboG.mjs";import"ofetch";import"./Button-OlK_6fKk.mjs";import"styled-components";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const i=({style:o,...e})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...o},...e,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:o="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,jsx as n}from"react/jsx-runtime";import{Wallet as t}from"lucide-react";import{U as l,V as a,Y as o,F as c,Q as i,n as r,T as s}from"./useActiveWallet-Bj-s666H.mjs";import{l as p,m as d,n as y}from"./index-CCrVHfyv.mjs";import{isMobile as w}from"react-device-detect";import{styled as m}from"styled-components";import{I as h}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{C as f}from"./Chip-Bsgj4Yc-.mjs";import{u}from"./internal-context-DLZicboG.mjs";import{a as T}from"./get-is-unified-wallet-DXko-EzF.mjs";const C=({onClick:c,text:i})=>/*#__PURE__*/e(l,{onClick:c,children:[/*#__PURE__*/n(a,{children:/*#__PURE__*/n(t,{})}),/*#__PURE__*/n(o,{children:i})]}),_=({provider:t,displayName:l,logo:a,connectOnly:o,connector:d})=>{let y,{navigate:m,setModalData:f}=T(),{connectWallet:C}=u(),_=c(),x=i(t),b="wallet_connect_v2"===d.connectorType?t:d.walletClientType,O=window.matchMedia("(display-mode: standalone)").matches,W=r({connectorType:d.connectorType,walletClientType:b});y=W&&W.chainTypes.includes(d.chainType)?()=>{W.isInstalled||"solana"===d.chainType&&"isInstalled"in d&&d.isInstalled?(C(d,b),m(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):w?(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("WalletInterstitialScreen")):(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("InstallWalletScreen"))}:"coinbase_wallet"!==d.connectorType||"eoaOnly"!==d.coinbaseWalletConfig.preference?.options||!w||O||s()?()=>{(!p(window.navigator.userAgent)||event?.isTrusted)&&(C(d,b),o?"wallet_connect_v2"===d.connectorType?(f((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),m("ConnectOnlyLandingScreen")):m("ConnectOnlyStatusScreen"):m("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let j=l||x?.metadata?.shortName||x?.name||d.walletClientType;/*#__PURE__*/return e(g,{onClick:y,children:[/*#__PURE__*/n(h,{icon:a||x?.image_url?.md,name:j}),/*#__PURE__*/n("span",{children:j}),/*#__PURE__*/e($,{id:"chip-container",children:[_?.walletClientType===b&&_?.chainType===d.chainType?/*#__PURE__*/n(v,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===d.chainType&&/*#__PURE__*/n(v,{color:"gray",children:"Solana"})]})]})};let g=/*#__PURE__*/m(l).withConfig({displayName:"ConnectWalletButton",componentId:"sc-5fe2f19b-0"})(["> span{color:var(--privy-color-foreground);}> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),v=/*#__PURE__*/m(f).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),$=/*#__PURE__*/m.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const x=["coinbase_wallet","base_account"];let b=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance","kraken_wallet"];const O=["safe"],W=["phantom","backpack","solflare","jupiter","universal_profile"],j=({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:c,forceWallet:i})=>{let r=[],s=[],p=[],w=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=w.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,h]of(i?[i.wallet]:e).entries()){if("detected_ethereum_wallets"===h)for(let[e,t]of w.filter((({chainType:e,connectorType:n,walletClientType:t})=>"solana"!==e&&("uniswap_wallet_extension"===t||"uniswap_extension"===t?!o.includes("uniswap"):"crypto.com_wallet_extension"===t||"crypto.com_onchain"===t?!o.includes("cryptocom"):"injected"===n&&!o.includes(t)))).entries()){let{walletClientType:o,walletBranding:c,chainType:i}=t;("unknown"===o?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:o,logo:c.icon,displayName:c.name,connector:t},`${l}-${h}-${o}-${i}-${e}`))}if("detected_solana_wallets"===h)for(let[e,c]of w.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:i}=c;("unknown"===t?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:c},`${l}-${h}-${t}-${i}-${e}`))}if(W.includes(h)){let e=w.find((e=>"injected"===e.connectorType&&e.walletClientType===h||e.connectorType===h));if(e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(b.includes(h)){let e=w.find((e=>"uniswap"===h?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===h?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===h));if(c&&!e&&(e=m),e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(x.includes(h)){let e=w.find((({connectorType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?d:y},`${l}-${h}`))}else if(O.includes(h))m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m},`${l}-${h}`));else if("wallet_connect"===h)m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${h}`));else if(h===i?.wallet){let t="ethereum"===i.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===i.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=w.find((({walletClientType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${h}`))}}}return[...s,...r,...p]};export{C as W,j as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{Check as i,Copy as r}from"lucide-react";import{useState as n,useEffect as s}from"react";import{styled as a}from"styled-components";import{S as d}from"./Button-
|
|
1
|
+
import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{Check as i,Copy as r}from"lucide-react";import{useState as n,useEffect as s}from"react";import{styled as a}from"styled-components";import{S as d}from"./Button-OlK_6fKk.mjs";import{E as m}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as l}from"./LabelXs-BOisBtqT.mjs";import{A as c}from"./Address-C1iw9r70.mjs";import{B as p}from"./shared-CtYf3O54.mjs";let f=/*#__PURE__*/a(p).withConfig({displayName:"StyledBox",componentId:"sc-4010d8f3-0"})(["&&{padding:0.75rem;height:56px;}"]),h=/*#__PURE__*/a.div.withConfig({displayName:"WalletContent",componentId:"sc-4010d8f3-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;"]),g=/*#__PURE__*/a.div.withConfig({displayName:"AddressContainer",componentId:"sc-4010d8f3-2"})(["display:flex;flex-direction:column;gap:0;"]),y=/*#__PURE__*/a.div.withConfig({displayName:"BalanceText",componentId:"sc-4010d8f3-3"})(["font-size:12px;line-height:1rem;color:var(--privy-color-foreground-3);"]),C=/*#__PURE__*/a(l).withConfig({displayName:"TitleLabel",componentId:"sc-4010d8f3-4"})(["text-align:left;margin-bottom:0.5rem;"]),u=/*#__PURE__*/a(m).withConfig({displayName:"StyledErrorMessage",componentId:"sc-4010d8f3-5"})(["margin-top:0.25rem;"]),w=/*#__PURE__*/a(d).withConfig({displayName:"CopyButton",componentId:"sc-4010d8f3-6"})(["&&{gap:0.375rem;font-size:14px;}"]);const x=({errMsg:a,balance:d,address:m,className:l,title:p,showCopyButton:x=!1})=>{let[v,N]=n(!1);return s((()=>{if(v){let e=setTimeout((()=>N(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e("div",{children:[p&&/*#__PURE__*/o(C,{children:p}),/*#__PURE__*/o(f,{className:l,$state:a?"error":void 0,children:/*#__PURE__*/e(h,{children:[/*#__PURE__*/e(g,{children:[/*#__PURE__*/o(c,{address:m,showCopyIcon:!1}),void 0!==d&&/*#__PURE__*/o(y,{children:d})]}),x&&/*#__PURE__*/o(w,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(m).then((()=>N(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/o(i,{size:14})]}:{children:["Copy",/*#__PURE__*/o(r,{size:14})]})})]})}),a&&/*#__PURE__*/o(u,{children:a})]})};export{x as W};
|
package/dist/esm/{WalletInterstitialScreen-CKiSWjpa.mjs → WalletInterstitialScreen-Du_L0CK7.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{u as o,a as i}from"./get-is-unified-wallet-
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{u as o,a as i}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as n}from"./ScreenLayout-pthdsODa.mjs";import"viem";import"./context-B4VZqX5H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-DLZicboG.mjs";import"ofetch";import"./Button-OlK_6fKk.mjs";import"styled-components";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const r=({title:e,subtitle:o,buttonText:i,buttonHref:r,isLoading:l=!1,helpText:a,onButtonClick:m})=>/*#__PURE__*/t(n,{title:e,subtitle:o,primaryCta:{label:i,onClick:()=>{r&&window.open(r,"_self"),m?.()},disabled:l},helpText:a,watermark:!0}),l={component:()=>{let{ready:n}=o(),{data:l}=i(),[a,m]=e(!1);if(!l?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:s,connectOnly:c,chainType:p}=l.installWalletModalData,u=s.getMobileRedirect({useUniversalLink:!a,isSolana:"solana"===p,connectOnly:c}),d=s.name.replace(/ wallet/gi,""),h={title:`Redirecting to ${d} Mobile Wallet`,description:`We'll take you to the ${d} Mobile Wallet app to continue your login experience.`,footnote:""};return n&&(h.description=`For the best experience, we'll automatically log you into the ${d} Mobile Wallet in-app browser.`,h.footnote="You can always return here to login via other methods."),a&&(h.title="Still here?",h.description=`You may need to install the ${s.name} mobile app.`,h.footnote=`Once you're done, you can connect with ${s.name} wallet to complete the login.`),/*#__PURE__*/t(r,{title:h.title,subtitle:h.description,buttonText:a?"Go to App Store":"Continue",buttonHref:u,isLoading:n&&!u,helpText:h.footnote||void 0,onButtonClick:()=>{setTimeout((()=>m(!0)),1e3)}})}};export{l as WalletInterstitialScreen,r as WalletInterstitialScreenView,l as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{styled as n}from"styled-components";import{formatUnits as o}from"viem";import{s as r,a,g as s,b as c}from"./ethers-
|
|
1
|
+
import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{styled as n}from"styled-components";import{formatUnits as o}from"viem";import{s as r,a,g as s,b as c}from"./ethers-oRuqwv5W.mjs";import{g as l}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as d}from"./transaction-CnfuREWo.mjs";import{D as m}from"./useActiveWallet-Bj-s666H.mjs";const p=({weiQuantities:t,tokenPrice:i,tokenSymbol:n})=>{let o=r(t),c=i?a(o,i):void 0,l=s(o,n);/*#__PURE__*/return e(y,{children:c||l})},h=({weiQuantities:n,tokenPrice:o,tokenSymbol:c})=>{let l=r(n),d=o?a(l,o):void 0,m=s(l,c);/*#__PURE__*/return e(y,{children:d?/*#__PURE__*/i(t,{children:[/*#__PURE__*/e(g,{children:"USD"}),"<$0.01"===d?
|
|
2
2
|
/*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):d]}):m})},f=({quantities:n,tokenPrice:r,tokenSymbol:a="SOL",tokenDecimals:s=9})=>{let c=n.reduce(((e,t)=>e+t),0n),m=r&&"SOL"===a&&9===s?l(c,r):void 0,p="SOL"===a&&9===s?d(c):`${o(c,s)} ${a}`;/*#__PURE__*/return e(y,{children:m?/*#__PURE__*/e(t,{children:"<$0.01"===m?
|
|
3
|
-
/*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):m}):p})};let y=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-3cd56c8a-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),g=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-3cd56c8a-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),u=/*#__PURE__*/n.span.withConfig({displayName:"TinyLessThan",componentId:"sc-3cd56c8a-2"})(["font-size:10px;"]),x=/*#__PURE__*/n.span.withConfig({displayName:"FlexCenter",componentId:"sc-3cd56c8a-3"})(["display:flex;align-items:center;"]);function S(e,t){return`https://explorer.solana.com/account/${e}?chain=${t}`}const
|
|
3
|
+
/*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):m}):p})};let y=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-3cd56c8a-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),g=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-3cd56c8a-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),u=/*#__PURE__*/n.span.withConfig({displayName:"TinyLessThan",componentId:"sc-3cd56c8a-2"})(["font-size:10px;"]),x=/*#__PURE__*/n.span.withConfig({displayName:"FlexCenter",componentId:"sc-3cd56c8a-3"})(["display:flex;align-items:center;"]);function S(e,t){return`https://explorer.solana.com/account/${e}?chain=${t}`}const k=t=>/*#__PURE__*/e(w,{href:"ethereum"===t.chainType?c(t.chainId,t.walletAddress):S(t.walletAddress,t.chainId),target:"_blank",children:m(t.walletAddress)});let w=/*#__PURE__*/n.a.withConfig({displayName:"StyledLink",componentId:"sc-dd6c0f9f-0"})(["&:hover{text-decoration:underline;}"]);export{p as H,h as P,f as S,k as W};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as a}from"@abstract-foundation/agw-client/actions";import{hexToNumber as n,createWalletClient as t,custom as r,http as s}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as o,zksync as c}from"viem/chains";import{u as d,a as l,b as m,d as p}from"./get-is-unified-wallet-
|
|
1
|
+
import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as a}from"@abstract-foundation/agw-client/actions";import{hexToNumber as n,createWalletClient as t,custom as r,http as s}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as o,zksync as c}from"viem/chains";import{u as d,a as l,b as m,d as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u}from"./context-B4VZqX5H.mjs";import{u as g}from"./internal-context-DLZicboG.mjs";import{u as y,g as f}from"./useWallets-DuxHKVvE.mjs";import{a as h}from"./getPublicClient-C_l_ocJu.mjs";import{g as v}from"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import{c as I}from"./smart-wallets-B3-1-dnO.mjs";import"react/jsx-runtime";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=d(),{hideWalletUIs:S,openPrivyModal:w,chains:P,appId:W,rpcConfig:b,client:C}=g(),F=u(),{wallets:M}=y(),{setModalData:_}=l(),x=m(T),A=!!x&&p(x),q=async(a=o.id)=>{let d=v(M);if(!d)throw Error("No connected wallet found");let l="string"==typeof a?n(a):a;if(![o.id,2741,c.id].includes(l))throw Error("Error, only Abstract and ZKSync Era chains are supported");let m=P.find((e=>e.id===l));if(!m)throw Error("Chain not configured");await d.switchChain(m.id);let p=await d.getEthereumProvider(),u=t({account:d.address,transport:r(p)}),g=i({address:d.address,signMessage:u.signMessage,signTransaction:u.signTransaction,signTypedData:u.signTypedData});return await e({chain:m,transport:s(h(m,b,W)),publicTransport:s(h(m,b,W)),signer:g})};return{signMessage:async({message:e},a)=>{let n=await q(a);return new Promise((async(a,t)=>{let{entropyId:r,entropyIdVerifier:s}=f(T);S.current=!0,_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>n.signMessage({message:e}),onSuccess:e=>a(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},signTypedData:async(e,a)=>{let n=await q(a);return new Promise((async(a,t)=>{S.current=!0;let{entropyId:r,entropyIdVerifier:s}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>n.signTypedData(e),onSuccess:e=>a(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},sendTransaction:async e=>{let n=await q(e.chainId),t=[],r="calls"in e&&void 0!==e.calls;return t=r?[...e.calls]:[e],new Promise((async(s,i)=>{S.current=!0;let{entropyId:o,entropyIdVerifier:c}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:o,entropyIdVerifier:c,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:I({calls:t,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:c,transactingWalletAddress:n.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=r?a(n.account.address,e):e;return await n.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!C)throw Error("Privy client not found");let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return await C.scanTransaction({metadata:{domain:F.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:s.from,to:s.to,value:s.value?.toString(),gas:s.gas?.toString(),gasPrice:s.gasPrice?.toString(),nonce:s.nonce?.toString(),data:s.data,eip_712_meta:{paymaster_params:{paymaster:s.paymaster,paymaster_input:s.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>r?n.sendTransactionBatch(e):n.sendTransaction(e),onSuccess:e=>s(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},signTransaction:async e=>{let n=await q(e.chainId),t=[],r="calls"in e&&void 0!==e.calls;return t=r?[...e.calls]:[e],new Promise((async(s,i)=>{S.current=!0;let{entropyId:o,entropyIdVerifier:c}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:o,entropyIdVerifier:c,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:I({calls:t,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:c,transactingWalletAddress:n.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=r?a(n.account.address,e):e;return await n.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!C)throw Error("Privy client not found");let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return await C.scanTransaction({metadata:{domain:F.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:s.from,to:s.to,value:s.value?.toString(),gas:s.gas?.toString(),gasPrice:s.gasPrice?.toString(),nonce:s.nonce?.toString(),data:s.data,eip_712_meta:{paymaster_params:{paymaster:s.paymaster,paymaster_input:s.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return n.signTransaction(s)},onSuccess:e=>s(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))}}}export{T as useAbstractSmartWallets};
|