@privy-io/react-auth 3.10.0-beta-20251223041507 → 3.10.0
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-C7clL66d.js → AccountNotFoundScreen-CCyWlTJg.js} +1 -1
- package/dist/cjs/{Address-BdN5tzBx.js → Address-Dqfr__Us.js} +1 -1
- package/dist/cjs/{AffirmativeConsentScreen-nqY_Fe-R.js → AffirmativeConsentScreen-P0TvXw3I.js} +1 -1
- package/dist/cjs/{AllowlistRejectionScreen-re6ZG8Lh.js → AllowlistRejectionScreen-9DBD3cDT.js} +1 -1
- package/dist/cjs/AuthenticateWithWalletScreen-YAI3Rdk5.js +1 -0
- package/dist/cjs/{AwaitingEvmToSolBridgingScreen-BM3IBmq9.js → AwaitingEvmToSolBridgingScreen-UOemNgiP.js} +1 -1
- package/dist/cjs/{AwaitingExternalEthereumTransferScreen-B4XlcGzI.js → AwaitingExternalEthereumTransferScreen-CJehLUix.js} +1 -1
- package/dist/cjs/{AwaitingPasswordlessCodeScreen-DSbqJ8sw.js → AwaitingPasswordlessCodeScreen-D4jIGUIu.js} +1 -1
- package/dist/cjs/{AwaitingSolToEvmBridgingScreen-CwXoMm_a.js → AwaitingSolToEvmBridgingScreen-3prjU9eU.js} +1 -1
- package/dist/cjs/{BridgeNetworkSelectionView-C5hl7Cvq.js → BridgeNetworkSelectionView-DhE8OSNF.js} +1 -1
- package/dist/cjs/{Button-BdtKzmGp.js → Button-BXkfCTro.js} +1 -1
- package/dist/cjs/{CaptchaScreen-MMvbG1XU.js → CaptchaScreen-CJitGEVU.js} +1 -1
- package/dist/cjs/{CoinbaseOnrampStatusScreen-C13g-VeP.js → CoinbaseOnrampStatusScreen-4KCVPXSq.js} +1 -1
- package/dist/cjs/{ConnectEmailForm-BdLI53Fd.js → ConnectEmailForm-BbfI9mx4.js} +1 -1
- package/dist/cjs/{ConnectLedgerScreen-BnmjZTW8.js → ConnectLedgerScreen-Cquqbd_0.js} +1 -1
- package/dist/cjs/ConnectOnlyLandingScreen-_3c6hkf-.js +1 -0
- package/dist/cjs/{ConnectOnlyStatusScreen-DR659M9-.js → ConnectOnlyStatusScreen-DVV-_bsT.js} +1 -1
- package/dist/cjs/{ConnectOrCreateScreen-D6R6Ec06.js → ConnectOrCreateScreen-1tSJt9Vh.js} +1 -1
- package/dist/cjs/{ConnectPhoneForm-GsUfLBeN.js → ConnectPhoneForm-DebBPzTl.js} +1 -1
- package/dist/cjs/ConnectWalletView-B5NqKXNc.js +1 -0
- package/dist/cjs/{ConnectionStatusScreen-BdTKJ00Z.js → ConnectionStatusScreen-gIwTfC-i.js} +1 -1
- package/dist/cjs/{CrossAppAuthScreen-MjQpsKtB.js → CrossAppAuthScreen-Cs_HQNmA.js} +1 -1
- package/dist/cjs/{CustomLandingScreenView-CQhEjDH5.js → CustomLandingScreenView-KvzjPhN1.js} +2 -2
- package/dist/cjs/{DelegatedActionsConsentScreen-CFXpRnY2.js → DelegatedActionsConsentScreen-RTMmMNqK.js} +1 -1
- package/dist/cjs/{DelegatedActionsRevokeScreen-DZdidxUM.js → DelegatedActionsRevokeScreen-BqL1cJwX.js} +1 -1
- package/dist/cjs/{EmbeddedWalletConnectingScreen-DbMJXa_S.js → EmbeddedWalletConnectingScreen-DPqsA0eo.js} +1 -1
- package/dist/cjs/{EmbeddedWalletCreatedScreen-D6nEuVl0.js → EmbeddedWalletCreatedScreen-qq5vOQsX.js} +1 -1
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-DS5HJZhL.js → EmbeddedWalletKeyExportScreen-DdQfRwJI.js} +1 -1
- package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-XuCxKKiu.js → EmbeddedWalletOnAccountCreateScreen-CZqtNy72.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-B82XtLOT.js → EmbeddedWalletPasswordUpdateScreen-D-BBWYtp.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-hQeZx9F-.js → EmbeddedWalletPasswordUpdateSplashScreen-CWovcQ2k.js} +1 -1
- package/dist/cjs/{EnrollTotp-CDSds4bp.js → EnrollTotp-Cy02Mr_m.js} +1 -1
- package/dist/cjs/{ErrorScreen-C6W1-E6m.js → ErrorScreen-CFGSlbsW.js} +1 -1
- package/dist/cjs/{FarcasterConnectStatusScreen-DmABWqds.js → FarcasterConnectStatusScreen-DKg6JjVp.js} +2 -2
- package/dist/cjs/{FarcasterSignerStatusScreen-n5XqsgJH.js → FarcasterSignerStatusScreen-DTQOhzO9.js} +1 -1
- package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-CJDB0jUQ.js → FundSolWalletWithExternalSolanaWallet-CwMDKWEn.js} +2 -2
- package/dist/cjs/{FundWalletMethodHeader-uzk-ixZP.js → FundWalletMethodHeader-BGagZe1_.js} +1 -1
- package/dist/cjs/{FundingEditAmountScreen-Dm9R9JPI.js → FundingEditAmountScreen-FNlgv1bs.js} +1 -1
- package/dist/cjs/{FundingMethodSelectionScreen-iEpU1hs4.js → FundingMethodSelectionScreen-Cbo8nBzj.js} +1 -1
- package/dist/cjs/{InAppBrowserLoginNotPossible-Beb8qlZC.js → InAppBrowserLoginNotPossible-oNYiPE0R.js} +1 -1
- package/dist/cjs/{InstallWalletScreen-BIWgPJfK.js → InstallWalletScreen-8AY8j4Wj.js} +1 -1
- package/dist/cjs/{LandingScreen-D7OP1_yo.js → LandingScreen-Cz-WmQAy.js} +1 -1
- package/dist/cjs/{LinkConflictScreen-CX0CaiYv.js → LinkConflictScreen-BAXPDdwj.js} +1 -1
- package/dist/cjs/{LinkEmailScreen-B9k2kjn3.js → LinkEmailScreen-DvU88nAX.js} +1 -1
- package/dist/cjs/{LinkPasskeyScreen-DtKPxsUK.js → LinkPasskeyScreen-CgLhb8y2.js} +1 -1
- package/dist/cjs/{LinkPhoneScreen-CJYR_lfw.js → LinkPhoneScreen-DLcdT331.js} +1 -1
- package/dist/cjs/{LoginFailedScreen-BlAMh708.js → LoginFailedScreen-C3sTxb4O.js} +1 -1
- package/dist/cjs/{ManualTransferScreen-DbmalI1O.js → ManualTransferScreen-uxjcgZsd.js} +1 -1
- package/dist/cjs/{MfaAuthEnrollmentFlowScreen-C8TLvuYX.js → MfaAuthEnrollmentFlowScreen-DGM9d9sl.js} +1 -1
- package/dist/cjs/{MfaAuthVerifyFlowScreen-BAPSbY4D.js → MfaAuthVerifyFlowScreen-Dy6rChMo.js} +1 -1
- package/dist/cjs/{MfaEnrollmentFlowScreen-BbuKW8By.js → MfaEnrollmentFlowScreen-BUc2dRI1.js} +1 -1
- package/dist/cjs/{MfaVerifyFlowScreen-BDn-Sudi.js → MfaVerifyFlowScreen-FQMp0vOd.js} +1 -1
- package/dist/cjs/{ModalHeader-OWSWMCEF.js → ModalHeader-DRaJvD2v.js} +1 -1
- package/dist/cjs/{MoonpayStatusScreen-LPtLXxZw.js → MoonpayStatusScreen-CeQb57ZI.js} +1 -1
- package/dist/cjs/{OAuthStatusScreen-DzQX1znk.js → OAuthStatusScreen-2iZh0Hue.js} +1 -1
- package/dist/cjs/{PasskeySelectSignupOrLogin-iQFF1Hxe.js → PasskeySelectSignupOrLogin-B8axkY8n.js} +1 -1
- package/dist/cjs/{PasskeyStatusScreen-CZJcGz9v.js → PasskeyStatusScreen-DbbheHb2.js} +1 -1
- package/dist/cjs/{PasswordRecoveryScreen-DxDNndVU.js → PasswordRecoveryScreen-DVyOnBFP.js} +1 -1
- package/dist/cjs/{QrCode-C4hJtM22.js → QrCode-C2QE_BbM.js} +1 -1
- package/dist/cjs/{RecoveryOAuthStatusScreen-BnLWeDeU.js → RecoveryOAuthStatusScreen-CV1Ixabo.js} +1 -1
- package/dist/cjs/{RecoveryPasswordCreateScreen-ShjkS8Nf.js → RecoveryPasswordCreateScreen-DfYxuVKR.js} +1 -1
- package/dist/cjs/{RecoverySelectionScreen-C6S4JMZQ.js → RecoverySelectionScreen-BSOAplv6.js} +1 -1
- package/dist/cjs/{Screen-D7sTdyLl.js → Screen-BZ-J4FwQ.js} +1 -1
- package/dist/cjs/{ScreenLayout-BQP-gfLF.js → ScreenLayout-CfU_O3al.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-DWtJH_0r.js → SetAutomaticRecoveryScreen-G8MGWul7.js} +1 -1
- package/dist/cjs/{SetWalletPasswordForm-CcidPSjk.js → SetWalletPasswordForm-CXthXwRt.js} +2 -2
- package/dist/cjs/{SignRequestScreen-D9Wl7ftq.js → SignRequestScreen-Q9I_D1su.js} +1 -1
- package/dist/cjs/{StandardSignAndSendTransactionScreen-zYrTR6bp.js → StandardSignAndSendTransactionScreen-Dz1By2jK.js} +1 -1
- package/dist/cjs/{TelegramAuthScreen-CP6vsDtM.js → TelegramAuthScreen-BnHI0GwF.js} +1 -1
- package/dist/cjs/{TransactionDetails-DTH_TZpQ.js → TransactionDetails-Bg0E9A_6.js} +2 -2
- package/dist/cjs/{TransactionErrorView-BUDEmz2T.js → TransactionErrorView-CX1_GPGO.js} +1 -1
- package/dist/cjs/{TransferFromWalletScreen-CrOo6G6H.js → TransferFromWalletScreen-tMc9GAKg.js} +1 -1
- package/dist/cjs/{TransferOrBridgeLoadingScreen-DGvT2b_c.js → TransferOrBridgeLoadingScreen-mTz1kP-n.js} +1 -1
- package/dist/cjs/{UpdateEmailScreen-B1bG_2YL.js → UpdateEmailScreen-Cy7ySLq9.js} +1 -1
- package/dist/cjs/{UpdatePhoneScreen-B5Wl9kel.js → UpdatePhoneScreen-iIsFR8Yy.js} +1 -1
- package/dist/cjs/{UserLimitReachedScreen-BIPUsBl1.js → UserLimitReachedScreen-CKPB8s3w.js} +1 -1
- package/dist/cjs/{WalletInfoCard-BewbaIC_.js → WalletInfoCard-xuQPIB68.js} +1 -1
- package/dist/cjs/{WalletInterstitialScreen-Br5fazrn.js → WalletInterstitialScreen-B5Ou9Qat.js} +1 -1
- package/dist/cjs/{WalletLink-Da_ICG1G.js → WalletLink-CzKk6PGd.js} +1 -1
- package/dist/cjs/{WalletOverflowButton-CHPYVqpu.js → WalletOverflowButton-D_YhHdN5.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/{context-bxRrRk2e.js → context-CcgGREUw.js} +1 -1
- package/dist/cjs/{ethers-C1-7vvVS.js → ethers-CWRVqVsu.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/{get-is-unified-wallet-RpTO1Sce.js → get-is-unified-wallet-JejAvbr5.js} +1 -1
- package/dist/cjs/{index-CwJGaDuo.js → index-CWvayScJ.js} +1 -1
- package/dist/cjs/{index-BzsdDRPs.js → index-Cu3bv7vx.js} +1 -1
- package/dist/cjs/{index-DG6nzSst.js → index-iQcFLOcm.js} +5 -5
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{prepareFundingModalData-DSU36mVl.js → prepareFundingModalData-DkGmcQac.js} +1 -1
- package/dist/cjs/{shared-cL6fofyC.js → shared-C1pyT8u3.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DNSXSeaZ.js → shouldProceedtoEmbeddedWalletCreationFlow-BOgjAU1y.js} +1 -1
- package/dist/cjs/{smart-wallets-xKqtP8Ub.js → smart-wallets-C6CzRluM.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{to-ui-error-B3W7oUF5.js → to-ui-error-B_KfP469.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-create-wallet-without-fallback-D8LW9DKc.js → use-create-wallet-without-fallback-BieSNO71.js} +1 -1
- package/dist/cjs/{use-export-wallet-C2suPEqR.js → use-export-wallet-D1_Fnhnu.js} +1 -1
- package/dist/cjs/{useActiveWallet-hSS_Ajap.js → useActiveWallet-DTCrzsoG.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-oMgVfBGa.js → useGetTokenPrice-DoyKddna.js} +1 -1
- package/dist/cjs/{useI18n-D7JXe5tP.js → useI18n-JB8u7I8Q.js} +1 -1
- package/dist/cjs/{usePrivy-DX4q_wvG.js → usePrivy-CyUYnFHC.js} +1 -1
- package/dist/cjs/{useSolanaRpcClient-D0_ipP49.js → useSolanaRpcClient-BM36XRol.js} +1 -1
- package/dist/cjs/{useWallets-KrPOPwD6.js → useWallets-Cwi9URDf.js} +1 -1
- package/dist/cjs/{useWallets-_HUqLUqD.js → useWallets-ggeQUC3m.js} +1 -1
- package/dist/dts/{events-context-BYT6PpDG.d.ts → events-context-BTan6II8.d.mts} +1 -1
- package/dist/dts/{events-context-BYT6PpDG.d.mts → events-context-BTan6II8.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 +43 -32
- package/dist/dts/index.d.ts +43 -32
- 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-D7U23FgR.d.mts → types-B4eMcjTQ.d.mts} +2 -1
- package/dist/dts/{types-D7U23FgR.d.ts → types-B4eMcjTQ.d.ts} +2 -1
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/{AccountNotFoundScreen-m-ulnyRC.mjs → AccountNotFoundScreen-BzbvtCmu.mjs} +1 -1
- package/dist/esm/{Address-Bb7zLnoh.mjs → Address-BUmpXgsy.mjs} +1 -1
- package/dist/esm/{AffirmativeConsentScreen-BZiI7gaY.mjs → AffirmativeConsentScreen-CrZKQjas.mjs} +1 -1
- package/dist/esm/{AllowlistRejectionScreen-DYujQEMu.mjs → AllowlistRejectionScreen-DhhfJ6ai.mjs} +1 -1
- package/dist/esm/AuthenticateWithWalletScreen-BN0s1mtv.mjs +1 -0
- package/dist/esm/AwaitingEvmToSolBridgingScreen-C7mp2-Hy.mjs +2 -0
- package/dist/esm/{AwaitingExternalEthereumTransferScreen-QSi_jFuT.mjs → AwaitingExternalEthereumTransferScreen-EqM4Kcsu.mjs} +1 -1
- package/dist/esm/{AwaitingPasswordlessCodeScreen-CRZX91TB.mjs → AwaitingPasswordlessCodeScreen-NAVmxM9-.mjs} +1 -1
- package/dist/esm/{AwaitingSolToEvmBridgingScreen-C5nKj1yd.mjs → AwaitingSolToEvmBridgingScreen-dC9b-wlg.mjs} +2 -2
- package/dist/esm/{BridgeNetworkSelectionView-B-gh55-1.mjs → BridgeNetworkSelectionView-BXBCujiq.mjs} +1 -1
- package/dist/esm/{Button-BTB0FpvZ.mjs → Button-BCV6mjvS.mjs} +1 -1
- package/dist/esm/{CaptchaScreen-Y0vNrbk0.mjs → CaptchaScreen-CTRyyYc9.mjs} +1 -1
- package/dist/esm/{CoinbaseOnrampStatusScreen-qhDq6qtP.mjs → CoinbaseOnrampStatusScreen-BNmvm8Bl.mjs} +1 -1
- package/dist/esm/{ConnectEmailForm-eTN3xUik.mjs → ConnectEmailForm-DtLW0rv7.mjs} +1 -1
- package/dist/esm/{ConnectLedgerScreen-C-dhUpqp.mjs → ConnectLedgerScreen-BEhSz1FM.mjs} +1 -1
- package/dist/esm/ConnectOnlyLandingScreen-ZnI9ReZJ.mjs +1 -0
- package/dist/esm/{ConnectOnlyStatusScreen-C7OMszka.mjs → ConnectOnlyStatusScreen-1oCuFsd6.mjs} +1 -1
- package/dist/esm/ConnectOrCreateScreen-BOO4iaC6.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-DmGv_fDg.mjs → ConnectPhoneForm-OQSgPQxP.mjs} +1 -1
- package/dist/esm/ConnectWalletView-Cmm9Ulis.mjs +1 -0
- package/dist/esm/{ConnectionStatusScreen-4_pj5yk1.mjs → ConnectionStatusScreen-CZNBQeOQ.mjs} +1 -1
- package/dist/esm/{CrossAppAuthScreen-D8abJvV4.mjs → CrossAppAuthScreen-Bno8NQSa.mjs} +1 -1
- package/dist/esm/{CustomLandingScreenView-BYAB5iWk.mjs → CustomLandingScreenView-B_ZwsVad.mjs} +2 -2
- package/dist/esm/{DelegatedActionsConsentScreen-BPTr4yVf.mjs → DelegatedActionsConsentScreen-B0AwZEKc.mjs} +1 -1
- package/dist/esm/{DelegatedActionsRevokeScreen-NY7ZuJZA.mjs → DelegatedActionsRevokeScreen-D0mAKxDs.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletConnectingScreen-CnprUZbY.mjs → EmbeddedWalletConnectingScreen-9ADobSle.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletCreatedScreen-BlrNZpYf.mjs → EmbeddedWalletCreatedScreen-B7TnCst_.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletKeyExportScreen-Dd5N7zPF.mjs → EmbeddedWalletKeyExportScreen-Cmp2CUOa.mjs} +2 -2
- package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-h5zGIqOI.mjs → EmbeddedWalletOnAccountCreateScreen-vxaCVWy1.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-UJaVcH1p.mjs → EmbeddedWalletPasswordUpdateScreen-C4dNnXVI.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-CMyJVKRi.mjs → EmbeddedWalletPasswordUpdateSplashScreen-BPTp0nwT.mjs} +1 -1
- package/dist/esm/{EnrollTotp-D1Y019Iq.mjs → EnrollTotp-CMtBCJbR.mjs} +1 -1
- package/dist/esm/{ErrorScreen-KfzBkWlg.mjs → ErrorScreen-Yi-Rhs0v.mjs} +1 -1
- package/dist/esm/{FarcasterConnectStatusScreen-C18PKycv.mjs → FarcasterConnectStatusScreen-BfoDjDwg.mjs} +1 -1
- package/dist/esm/{FarcasterSignerStatusScreen-Crgxbwaw.mjs → FarcasterSignerStatusScreen-CsSFmDry.mjs} +1 -1
- package/dist/esm/{FundSolWalletWithExternalSolanaWallet-BsnoBDOC.mjs → FundSolWalletWithExternalSolanaWallet-BIk-6GIl.mjs} +1 -1
- package/dist/esm/{FundWalletMethodHeader-C6QXrL4P.mjs → FundWalletMethodHeader-CS84Ots9.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-CzbuYpdw.mjs +1 -0
- package/dist/esm/{FundingMethodSelectionScreen-BqxUw0Mf.mjs → FundingMethodSelectionScreen-DdZxdcVe.mjs} +1 -1
- package/dist/esm/{InAppBrowserLoginNotPossible-BIUZ9A4G.mjs → InAppBrowserLoginNotPossible-COUNBN1W.mjs} +1 -1
- package/dist/esm/{InstallWalletScreen-TAbe1EVV.mjs → InstallWalletScreen-BjprJkty.mjs} +1 -1
- package/dist/esm/LandingScreen-Dp4m_c2X.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-55SLx3hx.mjs → LinkConflictScreen-DMHPhlV7.mjs} +1 -1
- package/dist/esm/{LinkEmailScreen-Xzy79V-m.mjs → LinkEmailScreen-D7VTyZrH.mjs} +1 -1
- package/dist/esm/{LinkPasskeyScreen-D6FiejG9.mjs → LinkPasskeyScreen-B5LWH116.mjs} +1 -1
- package/dist/esm/{LinkPhoneScreen-sf2CMtqv.mjs → LinkPhoneScreen-DdRe154C.mjs} +1 -1
- package/dist/esm/{LoginFailedScreen-bwxW7s9F.mjs → LoginFailedScreen-CZnzwKpB.mjs} +1 -1
- package/dist/esm/{ManualTransferScreen-D__iGi-r.mjs → ManualTransferScreen-Bn2qhDAI.mjs} +1 -1
- package/dist/esm/{MfaAuthEnrollmentFlowScreen-C-bjwRJj.mjs → MfaAuthEnrollmentFlowScreen-CWMULcQb.mjs} +1 -1
- package/dist/esm/{MfaAuthVerifyFlowScreen-B9d5FlYJ.mjs → MfaAuthVerifyFlowScreen-B3Hw1YN-.mjs} +1 -1
- package/dist/esm/{MfaEnrollmentFlowScreen-CFLh4E-x.mjs → MfaEnrollmentFlowScreen-DcnqGJ3O.mjs} +1 -1
- package/dist/esm/{MfaVerifyFlowScreen-BpIzH2DY.mjs → MfaVerifyFlowScreen-BEt8Gfpb.mjs} +1 -1
- package/dist/esm/{ModalHeader-20vQXDeu.mjs → ModalHeader-BTru6YQw.mjs} +1 -1
- package/dist/esm/{MoonpayStatusScreen-CRNJ6piv.mjs → MoonpayStatusScreen-lYMS5etL.mjs} +1 -1
- package/dist/esm/{OAuthStatusScreen-DngcR9YB.mjs → OAuthStatusScreen-DEtT_t2P.mjs} +1 -1
- package/dist/esm/{PasskeySelectSignupOrLogin-Db_bv7rS.mjs → PasskeySelectSignupOrLogin-DgH-G2yO.mjs} +1 -1
- package/dist/esm/{PasskeyStatusScreen-Ckj7CcsN.mjs → PasskeyStatusScreen-BOac_MoC.mjs} +1 -1
- package/dist/esm/{PasswordRecoveryScreen-BX5mNuIA.mjs → PasswordRecoveryScreen-CT1bj8Gb.mjs} +1 -1
- package/dist/esm/{QrCode-C7So9kgj.mjs → QrCode-Oxn5GT3C.mjs} +1 -1
- package/dist/esm/{RecoveryOAuthStatusScreen-CH9_ywci.mjs → RecoveryOAuthStatusScreen-Ce6qiP-3.mjs} +1 -1
- package/dist/esm/{RecoveryPasswordCreateScreen-CVvb7FPI.mjs → RecoveryPasswordCreateScreen-jWT25C0X.mjs} +1 -1
- package/dist/esm/{RecoverySelectionScreen-Bhj-0m8Y.mjs → RecoverySelectionScreen-_u02vomS.mjs} +1 -1
- package/dist/esm/{Screen-BUPcYMtI.mjs → Screen-_0H_rCdH.mjs} +1 -1
- package/dist/esm/{ScreenLayout-6iIsKpRq.mjs → ScreenLayout-CNho46nP.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-BH63Ni6A.mjs → SetAutomaticRecoveryScreen-CUheSZ7h.mjs} +1 -1
- package/dist/esm/{SetWalletPasswordForm-BK0mdI5e.mjs → SetWalletPasswordForm-vaG_68V0.mjs} +2 -2
- package/dist/esm/{SignRequestScreen-BDw7xxk7.mjs → SignRequestScreen-BNC2mYtk.mjs} +1 -1
- package/dist/esm/{StandardSignAndSendTransactionScreen-DYM2d5Hk.mjs → StandardSignAndSendTransactionScreen-Ckxfv32q.mjs} +1 -1
- package/dist/esm/{TelegramAuthScreen-DT2RJ9om.mjs → TelegramAuthScreen-xobB3RHK.mjs} +1 -1
- package/dist/esm/{TransactionDetails-lKP8UN4t.mjs → TransactionDetails-BdW2lq_B.mjs} +3 -3
- package/dist/esm/{TransactionErrorView-CCIFQVpG.mjs → TransactionErrorView-RLIeHdul.mjs} +1 -1
- package/dist/esm/{TransferFromWalletScreen-I5s2zHDy.mjs → TransferFromWalletScreen-CLqyv8Ra.mjs} +1 -1
- package/dist/esm/{TransferOrBridgeLoadingScreen-B_NJD8Kh.mjs → TransferOrBridgeLoadingScreen-BY7Eot6x.mjs} +1 -1
- package/dist/esm/{UpdateEmailScreen-BD0-0Aj5.mjs → UpdateEmailScreen-BVzkFXeI.mjs} +1 -1
- package/dist/esm/{UpdatePhoneScreen-DnHd2jee.mjs → UpdatePhoneScreen-DZ_resri.mjs} +1 -1
- package/dist/esm/{UserLimitReachedScreen-xflcj6OH.mjs → UserLimitReachedScreen-CTmSitf0.mjs} +1 -1
- package/dist/esm/{WalletInfoCard-CpBKe1da.mjs → WalletInfoCard-COAfUoX0.mjs} +1 -1
- package/dist/esm/{WalletInterstitialScreen-D7r0v78D.mjs → WalletInterstitialScreen-tDCVxTFi.mjs} +1 -1
- package/dist/esm/{WalletLink-Cz8vvc1q.mjs → WalletLink-Cj92ni3W.mjs} +1 -1
- package/dist/esm/{WalletOverflowButton-0as7efhF.mjs → WalletOverflowButton-BT_VMZP5.mjs} +1 -1
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-DRLoVlsO.mjs +1 -0
- package/dist/esm/{ethers-CVqqoG3x.mjs → ethers-Bl5aM5Gz.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/{get-is-unified-wallet-DJwJGV0c.mjs → get-is-unified-wallet-gMDXpX6C.mjs} +1 -1
- package/dist/esm/{index-DZtcKggn.mjs → index-D9w4UYos.mjs} +1 -1
- package/dist/esm/{index-PcBcXwU-.mjs → index-DNmMGazz.mjs} +1 -1
- package/dist/esm/{index-DcaQ9VMZ.mjs → index-NL2cPmJD.mjs} +5 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{prepareFundingModalData-BHvIzv1P.mjs → prepareFundingModalData-BVTcQcmw.mjs} +1 -1
- package/dist/esm/{shared-BWmKXy6D.mjs → shared-D8TfUpfU.mjs} +1 -1
- package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-B6qJ8fhx.mjs → shouldProceedtoEmbeddedWalletCreationFlow-BI33jNSF.mjs} +1 -1
- package/dist/esm/{smart-wallets-BGPCB0ep.mjs → smart-wallets-9eof3eVL.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/to-ui-error-CYFXznYy.mjs +1 -0
- package/dist/esm/ui.mjs +1 -1
- package/dist/esm/{use-create-wallet-without-fallback-C_y-siw-.mjs → use-create-wallet-without-fallback-C0dI_RFZ.mjs} +1 -1
- package/dist/esm/{use-export-wallet-DapEzFil.mjs → use-export-wallet-B1YnjTpb.mjs} +1 -1
- package/dist/esm/{useActiveWallet-DDf-vaMZ.mjs → useActiveWallet-BeOB3HTh.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-2p261ACv.mjs → useGetTokenPrice-CDPxMEO-.mjs} +1 -1
- package/dist/esm/{useI18n-BRYVrLjs.mjs → useI18n-99pFPsz3.mjs} +1 -1
- package/dist/esm/{usePrivy-dzRKwB0-.mjs → usePrivy-BWtc2XF-.mjs} +1 -1
- package/dist/esm/{useSolanaRpcClient-7AG_puUr.mjs → useSolanaRpcClient-Brcjny8C.mjs} +1 -1
- package/dist/esm/{useWallets-B4MGwFyP.mjs → useWallets-D4IJeaog.mjs} +1 -1
- package/dist/esm/{useWallets-N0hQJNER.mjs → useWallets-kObl6ZLS.mjs} +1 -1
- package/package.json +3 -3
- package/dist/cjs/AuthenticateWithWalletScreen-xtyc2rtb.js +0 -1
- package/dist/cjs/ConnectOnlyLandingScreen-BDGZs0Ro.js +0 -1
- package/dist/cjs/ConnectWalletView-C7gK4cbO.js +0 -1
- package/dist/esm/AuthenticateWithWalletScreen-BJNgLR93.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-CTM7spSX.mjs +0 -2
- package/dist/esm/ConnectOnlyLandingScreen-BXCcG8rx.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-CsSyifOf.mjs +0 -1
- package/dist/esm/ConnectWalletView-BwcROWqJ.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-B_s1b9Zt.mjs +0 -1
- package/dist/esm/LandingScreen-Bdy5KSMA.mjs +0 -1
- package/dist/esm/context-CoegzSND.mjs +0 -1
- package/dist/esm/to-ui-error-Cc8LO7vH.mjs +0 -1
|
@@ -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 d}from"@privy-io/js-sdk-core";import{P as c,E as s}from"./Button-BTB0FpvZ.mjs";import{M as h,B as m,a as p}from"./ModalHeader-20vQXDeu.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-Bb7zLnoh.mjs";import{W as C}from"./WalletInfoCard-CpBKe1da.mjs";import{u as T}from"./context-CoegzSND.mjs";import{Y as S}from"./useActiveWallet-DDf-vaMZ.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-e-Eni5bG.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:d,$isLoading:c})=>{if(c)/*#__PURE__*/return e(R,{$isLoading:c});let s=i&&t&&d?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,d,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:c,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:c,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:d,functionName:c}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==d&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:c})]}),"mint"===c&&"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"===c&&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"===c&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===c||"transferFrom"===c||"safeTransferFrom"===c||"approve"===c?/*#__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"===c&&/*#__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"===c&&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"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&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"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&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:d,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:de,setIsScanDetailsOpen:ce,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&&!de&&/*#__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})]}),de&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>ce(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),d?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:d.message}):p&&0===ie?
|
|
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 d}from"@privy-io/js-sdk-core";import{P as c,E as s}from"./Button-BCV6mjvS.mjs";import{M as h,B as m,a as p}from"./ModalHeader-BTru6YQw.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-BUmpXgsy.mjs";import{W as C}from"./WalletInfoCard-COAfUoX0.mjs";import{u as T}from"./context-DRLoVlsO.mjs";import{Y as S}from"./useActiveWallet-BeOB3HTh.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-e-Eni5bG.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:d,$isLoading:c})=>{if(c)/*#__PURE__*/return e(R,{$isLoading:c});let s=i&&t&&d?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,d,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:c,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:c,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:d,functionName:c}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==d&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:c})]}),"mint"===c&&"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"===c&&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"===c&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===c||"transferFrom"===c||"safeTransferFrom"===c||"approve"===c?/*#__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"===c&&/*#__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"===c&&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"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&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"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&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:d,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:de,setIsScanDetailsOpen:ce,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&&!de&&/*#__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})]}),de&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>ce(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),d?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:d.message}):p&&0===ie?
|
|
2
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&&!d&&"warn"!==le&&"error"!==le),address:D,balance:G,errMsg:z||p||d||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(c,{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:[d({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:[d({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(c,{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(de,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:d,transactionHash:c})=>{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,d),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:d,transactionHash:c});/*#__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})]}),c&&/*#__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(c),u(!0)},children:[c,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(ce,{onClick:()=>l({resetNonce:!!c}),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);"]),de=/*#__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;"]),ce=/*#__PURE__*/l(c).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};
|
package/dist/esm/{TransferFromWalletScreen-I5s2zHDy.mjs → TransferFromWalletScreen-CLqyv8Ra.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{M as o,B as i}from"./ModalHeader-20vQXDeu.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as c}from"./FundWalletMethodHeader-C6QXrL4P.mjs";import{C as s}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as d}from"./context-CoegzSND.mjs";import{F as m,Q as y,n as u,T as h,U as w,v as f,a8 as T}from"./useActiveWallet-DDf-vaMZ.mjs";import{u as C}from"./internal-context-e-Eni5bG.mjs";import{a as g}from"./get-is-unified-wallet-DJwJGV0c.mjs";import{u as v}from"./useWallets-N0hQJNER.mjs";import{W as _}from"./WalletOverflowButton-0as7efhF.mjs";import{z as j,A as x,D as b}from"./index-DcaQ9VMZ.mjs";import{isMobile as S}from"react-device-detect";import{styled as W}from"styled-components";import{I as $}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{I as k}from"./styles-DY17fuAX.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"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"./prepareFundingModalData-BHvIzv1P.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"lucide-react";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-dzRKwB0-.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/WalletIcon";const O=({provider:t,displayName:l,logo:a,connectOnly:o,connector:i})=>{let r,{navigate:c,setModalData:s}=g(),{connectWallet:p}=C(),d=m(),w=y(t),f="wallet_connect_v2"===i.connectorType?t:i.walletClientType,T=window.matchMedia("(display-mode: standalone)").matches,v=u({connectorType:i.connectorType,walletClientType:f});r=v&&v.chainTypes.includes(i.chainType)?()=>{v.isInstalled||"solana"===i.chainType&&"isInstalled"in i&&i.isInstalled?(p(i,f),c(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):S?(s({installWalletModalData:{walletConfig:v,chainType:i.chainType,connectOnly:o}}),c("WalletInterstitialScreen")):(s({installWalletModalData:{walletConfig:v,chainType:i.chainType,connectOnly:o}}),c("InstallWalletScreen"))}:"coinbase_wallet"!==i.connectorType||"eoaOnly"!==i.coinbaseWalletConfig.preference?.options||!S||T||h()?()=>{(!j(window.navigator.userAgent)||event?.isTrusted)&&(p(i,f),o?"wallet_connect_v2"===i.connectorType?(s((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),c("ConnectOnlyLandingScreen")):c("ConnectOnlyStatusScreen"):c("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let _=l||w?.metadata?.shortName||w?.name||i.walletClientType;/*#__PURE__*/return e(I,{onClick:r,children:[/*#__PURE__*/n($,{icon:a||w?.image_url?.md,name:_}),/*#__PURE__*/n("span",{children:_}),/*#__PURE__*/e(M,{id:"chip-container",children:[d?.walletClientType===f&&d?.chainType===i.chainType?/*#__PURE__*/n(D,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===i.chainType&&/*#__PURE__*/n(D,{color:"gray",children:"Solana"})]})]})};let I=/*#__PURE__*/W(w).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;}}"]),D=/*#__PURE__*/W(s).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),M=/*#__PURE__*/W.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const F=["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 A=["safe"],E=["phantom","backpack","solflare","jupiter","universal_profile"],N={component:()=>{let s,{connectors:m}=C(),{setModalData:y,data:u,navigate:h}=g(),w=d(),{wallets:j}=v(),S=m.filter(f).flatMap((e=>e.wallets)),[W,$]=l("default"),k="solana"===u?.funding?.chainType,I=!!u?.funding?.crossChainBridgingEnabled;s="ethereum"===u?.funding?.chainType?u.funding.erc20Address&&!u.funding.isUSDC?"ethereum-only":I&&!u.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":I&&!u.funding?.isUSDC?"ethereum-and-solana":"solana-only";let D=j.filter((e=>"privy"!==e.walletClientType)),M=D.map((e=>e.walletClientType)),N=S.filter((e=>"privy"!==e.walletClientType)),U=N.map((e=>e.walletClientType)),z=[],H={...u.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let R=({wallet:e,walletChainType:n})=>{y({...u,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>h(P({destChainType:k?"solana":"ethereum",sourceChainType:n}))},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),h("FundingAmountEditScreen")};"solana-only"!==s&&z.push(...D.map(((e,t)=>/*#__PURE__*/n(L,{onClick:()=>R({wallet:e,walletChainType:"ethereum"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),"ethereum-only"!==s&&z.push(...N.map(((e,t)=>/*#__PURE__*/n(L,{onClick:()=>R({wallet:e,walletChainType:"solana"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),z.push(...(({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:i,forceWallet:r})=>{let c=[],s=[],p=[],d=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=d.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,y]of(r?[r.wallet]:e).entries()){if("detected_ethereum_wallets"===y)for(let[e,t]of d.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:i,chainType:r}=t;("unknown"===o?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:o,logo:i.icon,displayName:i.name,connector:t},`${l}-${y}-${o}-${r}-${e}`))}if("detected_solana_wallets"===y)for(let[e,i]of d.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:r}=i;("unknown"===t?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:i},`${l}-${y}-${t}-${r}-${e}`))}if(E.includes(y)){let e=d.find((e=>"injected"===e.connectorType&&e.walletClientType===y||e.connectorType===y));if(e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(B.includes(y)){let e=d.find((e=>"uniswap"===y?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===y?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===y));if(i&&!e&&(e=m),e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(F.includes(y)){let e=d.find((({connectorType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?x:b},`${l}-${y}`))}else if(A.includes(y))m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m},`${l}-${y}`));else if("wallet_connect"===y)m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${y}`));else if(y===r?.wallet){let t="ethereum"===r.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===r.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=d.find((({walletClientType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${y}`))}}}return[...s,...c,...p]})({walletList:w.appearance.walletList.filter((e=>!D.some((n=>n.walletClientType===e))&&!N.some((n=>n.walletClientType===e)))),walletChainType:s,connectors:m,connectOnly:!0,ignore:[...w.appearance.walletList,...M,...U],walletConnectEnabled:w.externalWallets.walletConnect.enabled}));let q=/*#__PURE__*/n(_,{text:"More wallets",onClick:()=>$("overflow")}),P=({sourceChainType:e,destChainType:n})=>"ethereum"===e&&"solana"===n?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===n?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===n?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return a((()=>{y({...u,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:n,walletChainType:t})=>{let l=t??"ethereum",a="ethereum"===l?D.find((t=>t.address===e&&t.walletClientType===n)):N.find((t=>t.address===e&&t.walletClientType===n));return y({...u,funding:{...H,connectedWallet:a,onContinueWithExternalWallet:()=>{h(P({destChainType:k?"solana":"ethereum",sourceChainType:l}))}},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:n||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/e(t,"overflow"===W?{children:[/*#__PURE__*/n(o,{backFn:()=>$("default")},"header"),/*#__PURE__*/e(T,{children:[/*#__PURE__*/n(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),z]}),/*#__PURE__*/n(i,{})]}:{children:[/*#__PURE__*/n(c,{}),/*#__PURE__*/n(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/e(T,{children:[z.length>4?z.slice(0,3):z,z.length>4&&q]}),/*#__PURE__*/n(i,{})]})}};let L=({onClick:t,icon:l,name:a,chainType:o})=>/*#__PURE__*/e(w,{onClick:t,children:[/*#__PURE__*/n(k,{style:{width:20},children:/*#__PURE__*/n("img",{src:l})}),a,/*#__PURE__*/n(s,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/n(s,{color:"gray",children:"Solana"})]});export{N as TransferFromWalletScreen,N as default};
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{useState as l,useEffect as a}from"react";import{M as o,B as i}from"./ModalHeader-BTru6YQw.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as c}from"./FundWalletMethodHeader-CS84Ots9.mjs";import{C as s}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as d}from"./context-DRLoVlsO.mjs";import{F as m,Q as y,n as u,T as h,U as w,v as f,a8 as T}from"./useActiveWallet-BeOB3HTh.mjs";import{u as C}from"./internal-context-e-Eni5bG.mjs";import{a as g}from"./get-is-unified-wallet-gMDXpX6C.mjs";import{u as v}from"./useWallets-kObl6ZLS.mjs";import{W as _}from"./WalletOverflowButton-BT_VMZP5.mjs";import{z as j,A as x,D as b}from"./index-NL2cPmJD.mjs";import{isMobile as S}from"react-device-detect";import{styled as W}from"styled-components";import{I as $}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{I as k}from"./styles-DY17fuAX.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"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"./prepareFundingModalData-BVTcQcmw.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"lucide-react";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BWtc2XF-.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/WalletIcon";const O=({provider:t,displayName:l,logo:a,connectOnly:o,connector:i})=>{let r,{navigate:c,setModalData:s}=g(),{connectWallet:p}=C(),d=m(),w=y(t),f="wallet_connect_v2"===i.connectorType?t:i.walletClientType,T=window.matchMedia("(display-mode: standalone)").matches,v=u({connectorType:i.connectorType,walletClientType:f});r=v&&v.chainTypes.includes(i.chainType)?()=>{v.isInstalled||"solana"===i.chainType&&"isInstalled"in i&&i.isInstalled?(p(i,f),c(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):S?(s({installWalletModalData:{walletConfig:v,chainType:i.chainType,connectOnly:o}}),c("WalletInterstitialScreen")):(s({installWalletModalData:{walletConfig:v,chainType:i.chainType,connectOnly:o}}),c("InstallWalletScreen"))}:"coinbase_wallet"!==i.connectorType||"eoaOnly"!==i.coinbaseWalletConfig.preference?.options||!S||T||h()?()=>{(!j(window.navigator.userAgent)||event?.isTrusted)&&(p(i,f),o?"wallet_connect_v2"===i.connectorType?(s((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),c("ConnectOnlyLandingScreen")):c("ConnectOnlyStatusScreen"):c("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let _=l||w?.metadata?.shortName||w?.name||i.walletClientType;/*#__PURE__*/return e(I,{onClick:r,children:[/*#__PURE__*/n($,{icon:a||w?.image_url?.md,name:_}),/*#__PURE__*/n("span",{children:_}),/*#__PURE__*/e(M,{id:"chip-container",children:[d?.walletClientType===f&&d?.chainType===i.chainType?/*#__PURE__*/n(D,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===i.chainType&&/*#__PURE__*/n(D,{color:"gray",children:"Solana"})]})]})};let I=/*#__PURE__*/W(w).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;}}"]),D=/*#__PURE__*/W(s).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),M=/*#__PURE__*/W.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const F=["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 A=["safe"],E=["phantom","backpack","solflare","jupiter","universal_profile"],N={component:()=>{let s,{connectors:m}=C(),{setModalData:y,data:u,navigate:h}=g(),w=d(),{wallets:j}=v(),S=m.filter(f).flatMap((e=>e.wallets)),[W,$]=l("default"),k="solana"===u?.funding?.chainType,I=!!u?.funding?.crossChainBridgingEnabled;s="ethereum"===u?.funding?.chainType?u.funding.erc20Address&&!u.funding.isUSDC?"ethereum-only":I&&!u.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":I&&!u.funding?.isUSDC?"ethereum-and-solana":"solana-only";let D=j.filter((e=>"privy"!==e.walletClientType)),M=D.map((e=>e.walletClientType)),N=S.filter((e=>"privy"!==e.walletClientType)),U=N.map((e=>e.walletClientType)),z=[],H={...u.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let R=({wallet:e,walletChainType:n})=>{y({...u,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>h(P({destChainType:k?"solana":"ethereum",sourceChainType:n}))},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),h("FundingAmountEditScreen")};"solana-only"!==s&&z.push(...D.map(((e,t)=>/*#__PURE__*/n(L,{onClick:()=>R({wallet:e,walletChainType:"ethereum"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),"ethereum-only"!==s&&z.push(...N.map(((e,t)=>/*#__PURE__*/n(L,{onClick:()=>R({wallet:e,walletChainType:"solana"}),icon:e.meta.icon,name:e.meta.name,chainType:e.type},t)))),z.push(...(({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:i,forceWallet:r})=>{let c=[],s=[],p=[],d=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=d.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,y]of(r?[r.wallet]:e).entries()){if("detected_ethereum_wallets"===y)for(let[e,t]of d.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:i,chainType:r}=t;("unknown"===o?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:o,logo:i.icon,displayName:i.name,connector:t},`${l}-${y}-${o}-${r}-${e}`))}if("detected_solana_wallets"===y)for(let[e,i]of d.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:r}=i;("unknown"===t?s:c).push(/*#__PURE__*/n(O,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:i},`${l}-${y}-${t}-${r}-${e}`))}if(E.includes(y)){let e=d.find((e=>"injected"===e.connectorType&&e.walletClientType===y||e.connectorType===y));if(e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(B.includes(y)){let e=d.find((e=>"uniswap"===y?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===y?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===y));if(i&&!e&&(e=m),e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${y}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=d.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e},`${y}-solana`))}}else if(F.includes(y)){let e=d.find((({connectorType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?x:b},`${l}-${y}`))}else if(A.includes(y))m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m},`${l}-${y}`));else if("wallet_connect"===y)m&&p.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${y}`));else if(y===r?.wallet){let t="ethereum"===r.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===r.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=d.find((({walletClientType:e})=>e===y));e&&c.push(/*#__PURE__*/n(O,{connectOnly:a,provider:y,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${y}`))}}}return[...s,...c,...p]})({walletList:w.appearance.walletList.filter((e=>!D.some((n=>n.walletClientType===e))&&!N.some((n=>n.walletClientType===e)))),walletChainType:s,connectors:m,connectOnly:!0,ignore:[...w.appearance.walletList,...M,...U],walletConnectEnabled:w.externalWallets.walletConnect.enabled}));let q=/*#__PURE__*/n(_,{text:"More wallets",onClick:()=>$("overflow")}),P=({sourceChainType:e,destChainType:n})=>"ethereum"===e&&"solana"===n?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===n?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===n?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return a((()=>{y({...u,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:n,walletChainType:t})=>{let l=t??"ethereum",a="ethereum"===l?D.find((t=>t.address===e&&t.walletClientType===n)):N.find((t=>t.address===e&&t.walletClientType===n));return y({...u,funding:{...H,connectedWallet:a,onContinueWithExternalWallet:()=>{h(P({destChainType:k?"solana":"ethereum",sourceChainType:l}))}},solanaFundingData:u?.solanaFundingData?{...u.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:n||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/e(t,"overflow"===W?{children:[/*#__PURE__*/n(o,{backFn:()=>$("default")},"header"),/*#__PURE__*/e(T,{children:[/*#__PURE__*/n(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),z]}),/*#__PURE__*/n(i,{})]}:{children:[/*#__PURE__*/n(c,{}),/*#__PURE__*/n(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/e(T,{children:[z.length>4?z.slice(0,3):z,z.length>4&&q]}),/*#__PURE__*/n(i,{})]})}};let L=({onClick:t,icon:l,name:a,chainType:o})=>/*#__PURE__*/e(w,{onClick:t,children:[/*#__PURE__*/n(k,{style:{width:20},children:/*#__PURE__*/n("img",{src:l})}),a,/*#__PURE__*/n(s,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/n(s,{color:"gray",children:"Solana"})]});export{N as TransferFromWalletScreen,N 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-BTru6YQw.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-CS84Ots9.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-BUmpXgsy.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-BeOB3HTh.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:x,isErc20Flow:C,totalPriceInNativeCurrency:T,totalPriceInUsd:k,gasPriceInNativeCurrency:v,gasPriceInUsd:B})=>{let P=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:P?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${x?"Bridging":"Confirming"} with ${I}`}),!x&&!C&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:k||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]})})]}),v&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:B||v})]})]}),/*#__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};
|
|
@@ -1 +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-
|
|
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-DRLoVlsO.mjs";import{a as l}from"./index-NL2cPmJD.mjs";import{u as d}from"./internal-context-e-Eni5bG.mjs";import{u as c,a as p}from"./get-is-unified-wallet-gMDXpX6C.mjs";import{a1 as u,V as h}from"./useActiveWallet-BeOB3HTh.mjs";import{E as j,P as v}from"./Button-BCV6mjvS.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-CNho46nP.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-kObl6ZLS.mjs";import"./prepareFundingModalData-BVTcQcmw.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BWtc2XF-.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-_0H_rCdH.mjs";import"./ModalHeader-BTru6YQw.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,S]=m(!1),{authenticated:A,user:C}=c(),{initUpdateEmail:x}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:D}=l(),U=n(),L=u(s)&&(U.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||D||A?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");S(!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")}S(!1)})(D):(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(E,{$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,E=g;const S=({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(S,{})};export{A as UpdateEmailScreen,S 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-OQSgPQxP.mjs";import{u as i}from"./internal-context-e-Eni5bG.mjs";import{a as n,u as m}from"./get-is-unified-wallet-gMDXpX6C.mjs";import{S as a}from"./ScreenLayout-CNho46nP.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-DRLoVlsO.mjs";import"tinycolor2";import"./useActiveWallet-BeOB3HTh.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BVTcQcmw.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-kObl6ZLS.mjs";import"./Button-BCV6mjvS.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-_0H_rCdH.mjs";import"./ModalHeader-BTru6YQw.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-xflcj6OH.mjs → UserLimitReachedScreen-CTmSitf0.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-gMDXpX6C.mjs";import{S as e}from"./ScreenLayout-CNho46nP.mjs";import"viem";import"react";import"./context-DRLoVlsO.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-BCV6mjvS.mjs";import"styled-components";import"./useActiveWallet-BeOB3HTh.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BVTcQcmw.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-kObl6ZLS.mjs";import"./Screen-_0H_rCdH.mjs";import"./ModalHeader-BTru6YQw.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};
|
|
@@ -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-BCV6mjvS.mjs";import{E as m}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as l}from"./LabelXs-BOisBtqT.mjs";import{A as c}from"./Address-BUmpXgsy.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-D7r0v78D.mjs → WalletInterstitialScreen-tDCVxTFi.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-gMDXpX6C.mjs";import{S as n}from"./ScreenLayout-CNho46nP.mjs";import"viem";import"./context-DRLoVlsO.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-BCV6mjvS.mjs";import"styled-components";import"./useActiveWallet-BeOB3HTh.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BVTcQcmw.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-kObl6ZLS.mjs";import"./Screen-_0H_rCdH.mjs";import"./ModalHeader-BTru6YQw.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-Bl5aM5Gz.mjs";import{g as l}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as d}from"./transaction-CnfuREWo.mjs";import{D as m}from"./useActiveWallet-BeOB3HTh.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
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{jsxs as r,jsx as e}from"react/jsx-runtime";import{Wallet as t}from"lucide-react";import{U as i,V as c,Y as o}from"./useActiveWallet-
|
|
1
|
+
import{jsxs as r,jsx as e}from"react/jsx-runtime";import{Wallet as t}from"lucide-react";import{U as i,V as c,Y as o}from"./useActiveWallet-BeOB3HTh.mjs";const l=({onClick:l,text:m})=>/*#__PURE__*/r(i,{onClick:l,children:[/*#__PURE__*/e(c,{children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(o,{children:m})]});export{l 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-gMDXpX6C.mjs";import{u}from"./context-DRLoVlsO.mjs";import{u as g}from"./internal-context-e-Eni5bG.mjs";import{u as y,g as f}from"./useWallets-kObl6ZLS.mjs";import{a as h}from"./getPublicClient-A9RSftUZ.mjs";import{g as I}from"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import{c as v}from"./smart-wallets-9eof3eVL.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=I(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:v({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:v({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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,createContext as o,useContext as r}from"react";import{dedupeSupportedChains as l,DEFAULT_SUPPORTED_CHAINS as i,mainnet as s}from"@privy-io/js-sdk-core";import c from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.10.0",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",y="privy-id-token",F="privy-session",C="privy:caid",M=e=>`privy:guest:${e}`,A=e=>`privy:cross-app:${e}`,E="privy:state_code",x="privy:code_verifier",B="privy:headless_oauth",D="privy:oauth_disable_signup",W=e=>`privy:wallet:${e}`,S="privy:connections",L=12e4,H=1,I="0x1",O=3e4,U="https://api.moonpay.com/v1",P="https://api.moonpay.com/v1",q="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated",T={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect","phantom"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let N=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet"]),$=e=>N.has(e),z=(e,t,a)=>a.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($).filter(z):e?e.filter($).filter(z):T.appearance.walletList;let G=/paymaster\.biconomy\.io\/api/i,J={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const V=(e,t)=>e&&G.test(e)?J:t&&t.policy_id?{policyId:t.policy_id}:void 0;function K(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function X(e,t){let a=e.getLuminance(),n=t.getLuminance();return(Math.max(a,n)+.05)/(Math.min(a,n)+.05)}function Z(e,t){if(!e){let e=t?ee:te;return{accent:c(e.background.interactive),accentLight:c(e.background.interactive),accentHover:c(e.background["interactive-hover"]),accentDark:c(e.background["interactive-clicked"]),accentDarkest:c(e.background["interactive-disabled"])}}let a=c(e);return{accent:a,accentLight:K(a,.15),accentHover:K(a,.3),accentDark:K(a,-.06),accentDarkest:K(a,-.6)}}function Q({backgroundTheme:e,accentHex:t}){let a,n;"light"===e?a=!1:"dark"===e?a=!0:(a=.5>=c(e).getLuminance(),n=c(e).toHslString());let o=a?"dark":"light",r=a?ee:te,{accent:l,accentLight:i,accentHover:s,accentDark:d,accentDarkest:u}=Z(t,a),g=function(e){let t=c(te.text.default),a=c(ee.text.default),n=X(e,t),o=X(e,a),r=e.toHsl();return r.h>=220&&r.h<=300&&o>=3?ee.text.default:n>o?te.text.default:ee.text.default}(l),h=c(g),f=X(l,c(r.background.default))>=3;return{colorScheme:o,background:n||r.background.default,background2:r.background.elevated,background3:r.background.interactive,foreground:r.text.default,foreground2:r.text.muted,foreground3:r.text.placeholder,foreground4:r.border.default,accent:l.toHslString(),accentLight:i.toHslString(),accentHover:s.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:r.background.success,successDark:r.text.success,successLight:r.background.success,error:r.text.error,errorLight:r.background.error,warn:r.background.warning,warnLight:r.background.warning,warningDark:r.text.warning,errorDark:r.text.error,successBg:r.background.success,errorBg:r.background.error,errorBgHover:r.background["error-hover"],warnBg:r.background.warning,infoBg:r.background.info,infoBgHover:r.background["info-hover"],borderDefault:r.border.default,borderHover:r.border["default-hover"],borderFocus:r.border.focused,borderError:r.border.error,borderSuccess:r.border.success,borderWarning:r.border.warning,borderInfo:r.border.info,borderInteractive:r.border.interactive,borderInteractiveHover:r.border["interactive-hover"],backgroundHover:r.background["default-hover"],backgroundClicked:r.background["default-clicked"],backgroundDisabled:r.background["default-disabled"],backgroundInteractive:r.background.interactive,backgroundInteractiveHover:r.background["interactive-hover"],backgroundInteractiveClicked:r.background["interactive-clicked"],backgroundInteractiveDisabled:r.background["interactive-disabled"],foregroundHover:r.text.default,foregroundClicked:r.text.default,foregroundDisabled:r.text["default-disabled"],foregroundInteractive:r.text.interactive,foregroundInteractiveHover:r.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?l.toHslString():r.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:r.icon.default,iconMuted:r.icon.muted,iconSubtle:r.icon.subtle,iconInverse:r.icon.inverse,iconSuccess:r.icon.success,iconWarning:r.icon.warning,iconError:r.icon.error,iconInteractive:r.icon.interactive,iconDefaultHover:r.icon["default-hover"],iconMutedHover:r.icon["muted-hover"],iconSubtleHover:r.icon["subtle-hover"],iconDefaultClicked:r.icon["default-clicked"],iconMutedClicked:r.icon["muted-clicked"],iconSubtleClicked:r.icon["subtle-clicked"],iconDefaultDisabled:r.icon["default-disabled"],iconMutedDisabled:r.icon["muted-disabled"],iconSubtleDisabled:r.icon["subtle-disabled"],iconErrorHover:r.icon["error-hover"],iconInteractiveHover:r.icon["interactive-hover"],iconErrorClicked:r.icon["error-clicked"],iconInteractiveClicked:r.icon["interactive-clicked"],iconMutedDisabledAlt:r.icon["muted-disabled"],iconSubtleDisabledAlt:r.icon["subtle-disabled"]}}const ee={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},te={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function ae(e,t,a,n,o){let r,c,d,u,g,h,f,p,_,b,m,v,w,k,y,F,C,M=a?console.warn:()=>{},A=[];if(t?.loginMethods)for(let e of(r=t.loginMethods.includes("email"),c=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),y=t.loginMethods.includes("apple"),F=t.loginMethods.includes("farcaster"),C=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey"),t.loginMethods))"string"==typeof e&&e.startsWith("privy:")&&A.push(e);else r=e.email_auth,c=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,y=e.apple_oauth,F=e.farcaster_auth,C=e.telegram_auth,d=e.passkey_auth;e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let E=[r,c].filter(Boolean),x=[g,h,f,k,m,v,p,_,w,y,F,C].filter(Boolean),B=[u].filter(Boolean),D=t?.loginMethods?.includes("passkey")??!1,W=e.passkeys_for_signup_enabled??!1,S=[d&&(W||D)].filter(Boolean);if(E.length+x.length+B.length+S.length+A.length===0)throw Error("You must enable at least one login method");let L=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;L&&0===B.length?(M("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),L=!1):L||x.length+E.length!==0||(M("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),L=!0);let H=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&M("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let I=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((I.includes("wallet_connect_qr")||I.includes("wallet_connect"))&&I.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let O=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let n of e.overflow??[])t.includes(n)||a.includes(n)?console.warn(`Duplicated login method: ${n}`):a.push(n);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),U=t?.intl?.defaultCountry??"US",{chains:P,defaultChain:q}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=l(e)}else a=[...i];let n=e?a[0]:s,o=t??n;if(!a.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),j=!!t?.defaultChain,R=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,N=R?"all-users":e.embedded_wallet_config.ethereum.create_on_login,$=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let z=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,G=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0,J=e.smart_wallet_config;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??T.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Q({backgroundTheme:t?.appearance?.theme??T.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:L?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:I,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:r,sms:c,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:y,farcaster:F,telegram:C},customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),crossAppProviders:A,disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:O,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??T.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:P,defaultChain:q,intl:{defaultCountry:U,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:j,captcha:{enabledProvider:e.enabled_captcha_provider??null,siteKey:e.captcha_site_key},externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:H},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!R&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:R?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??N},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??$},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??n??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:R?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:z,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??T._render.standalone},fundingConfig:G,fundingMethodConfig:{...t?.fundingMethodConfig??T.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??T.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??T.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null},smartWallets:J?.enabled?{enabled:J.enabled,smartWalletVersion:J.smart_wallet_version,smartWalletType:J.smart_wallet_type,configuredNetworks:J.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:V(e.paymaster_url,e.paymaster_context)})))}:{enabled:J?.enabled??!1}}}const ne={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let oe=/*#__PURE__*/o({appConfig:ae(ne,void 0,!1),isServerConfigLoaded:!1});const re=({children:o,client:r,legacyClient:l,clientConfig:i,appClientId:s})=>{let[c,d]=t(null),u=a((()=>ae(c??ne,i,!!c,"undefined"!=typeof window?window.location.origin:void 0,s)),[c,i,s]);return n((()=>{if(!c)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:n,externalWallets:o,...r}=e;return{...r,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let a=3735928559^t,n=1103547991^t;for(let t,o=0;o<e.length;o++)a=Math.imul(a^(t=e.charCodeAt(o)),2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${c.id}:${t}`;localStorage.getItem(a)||(l.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,c]),n((()=>{c||(async()=>{try{await r.initialize();let e=r.app.getConfig();e.custom_api_url&&l.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(oe.Provider,{value:{appConfig:u,isServerConfigLoaded:!!c},children:o})},le=()=>{let{appConfig:e}=r(oe);return e},ie=()=>{let{isServerConfigLoaded:e}=r(oe);return e};export{_ as C,d as D,B as H,k as I,P as M,D as O,w as P,m as R,E as S,p as V,O as W,x as a,S as b,ie as c,C as d,A as e,F as f,M as g,R as h,b as i,v as j,y as k,u as l,re as m,L as n,W as o,I as p,g as q,h as r,H as s,f as t,le as u,U as v,j as w,q as x};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatEther as e}from"viem";import{u as r}from"./internal-context-e-Eni5bG.mjs";import{a5 as t}from"./useActiveWallet-
|
|
1
|
+
import{formatEther as e}from"viem";import{u as r}from"./internal-context-e-Eni5bG.mjs";import{a5 as t}from"./useActiveWallet-BeOB3HTh.mjs";let a=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),s=e=>a.format(e);const n=(e,r)=>{let t=s(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},o=(r,t)=>{let a=s(t*parseFloat(e(r)));return"$0.00"===a?"<$0.01":a},c=(e,r,t=6,a=!1)=>`${i(e,t,a)} ${r}`,i=(r,t=6,a=!1)=>{let s=parseFloat(e(r)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return a?s:`${"0"===s?"<0.001":s}`},l=e=>e.reduce(((e,r)=>e+r),0n),m=(e,a)=>{let{chains:s}=r(),n=`https://etherscan.io/address/${a}`,o=`${t(e,s)}/address/${a}`;if(!o)return n;try{new URL(o)}catch{return n}return o};export{o as a,m as b,n as c,c as g,i as p,l as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useMemo as e}from"react";import{create as t,rawSign as r}from"@privy-io/js-sdk-core";import{u as a,a as i}from"./internal-context-e-Eni5bG.mjs";import{u as n,a as s,h as o,d,n as l}from"./get-is-unified-wallet-
|
|
1
|
+
import{useMemo as e}from"react";import{create as t,rawSign as r}from"@privy-io/js-sdk-core";import{u as a,a as i}from"./internal-context-e-Eni5bG.mjs";import{u as n,a as s,h as o,d,n as l}from"./get-is-unified-wallet-gMDXpX6C.mjs";import{u as c}from"./context-DRLoVlsO.mjs";import{u as p}from"./use-sign-with-user-signer-eEm9Olt_.mjs";import"ofetch";import"viem";import"react/jsx-runtime";import"tinycolor2";const u=()=>{let{refreshSessionAndUser:r,privy:i}=a();return e((()=>({async createWallet(e){let a=await t(i,{request:{chain_type:e.chainType}}),n=await r();if(!n)throw Error("User must be authenticated before creating a Privy wallet");return{user:n,wallet:a}}})),[r,i])};function m(){let{user:t,getAccessToken:r}=n(),{walletProxy:l,openModal:p,client:u}=a(),{setModalData:m}=s(),h=c();return e((()=>({exportWallet:e=>new Promise((async(a,n)=>{if(!t)return void n(new i("User must be authenticated before exporting their Privy wallet"));let s=o(t,e.address);s?"spark"===s.chainType&&d(s)?await r()?l?(m({connectWallet:{recoveryMethod:s.recoveryMethod,connectingWalletAddress:s.address,isUnifiedWallet:!0,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:n,shouldForceMFA:!0},keyExport:{appId:h.id,appClientId:h.appClientId,origin:u.apiUrl,address:s.address,hdWalletIndex:s.walletIndex,chainType:s.chainType,walletId:s.id,isUnifiedWallet:!0,imported:s.imported,onSuccess:a,onFailure:n}}),p("EmbeddedWalletConnectingScreen")):n(new i("Wallet not ready for export")):n(new i("Must have valid access token.")):n(Error("Export via extended-chains is only supported for unified stack wallets")):n(new i("User must have an embedded wallet."))}))})),[t,r,l,p,u,m,h])}const h=()=>{let{user:t}=n(),{privy:i}=a(),{signWithUserSigner:s}=p();return e((()=>({async signRawHash({address:e,chainType:a,hash:n}){if(!t)throw Error("User must be authenticated before signing");let o=l(t,a).filter((e=>d(e))).find((t=>t.address===e));if(!o)throw Error("Wallet not found");let c=await r(i,s,{wallet_id:o.id,params:{hash:n}});if(c.data&&"signature"in c.data&&"hex"===c.data.encoding)return{signature:c.data.signature};throw Error("Failed to sign")}})),[i,s,t])};export{u as useCreateWallet,m as useExportWallet,h as useSignRawHash};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getAddress as e}from"viem";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useContext as a,createContext as r,useState as s,useRef as l,useEffect as n}from"react";import{u}from"./context-CoegzSND.mjs";import{n as d}from"./internal-context-e-Eni5bG.mjs";function o(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}function c(e){return e?new Date(1e3*e):null}function p(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt?.getTime()??0)-(t.firstVerifiedAt?.getTime()??0))).find((e=>e.type===t))}const m=e=>e?f(e).find((e=>0===e.walletIndex))??null:null,f=e=>e?_(e,"ethereum"):[],_=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),y=e=>e?_(e,"solana"):[],h=e=>e?y(e).find((e=>0===e.walletIndex))??null:null,b=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)),k=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType)),g=(t,i)=>t===i||!(!t.startsWith("0x")||!i.startsWith("0x"))&&e(t)===e(i),v=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&g(e.address,t)))||null,A=(e,t)=>e.find((e=>g(e.address,t)))||null,j=e=>m(e)??h(e);function w(e){if(!e)return null;let t=function(e){let t=[];for(let i of e){let e=i.type;switch(i.type){case"wallet":let a={id:i.id,address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),chainType:i.chain_type,walletClientType:i.wallet_client_type,connectorType:i.connector_type,recoveryMethod:i.recovery_method,walletIndex:i.wallet_index,publicKey:i.public_key};t.push(a);break;case"smart_wallet":let r={address:i.address,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),smartWalletType:i.smart_wallet_type,smartWalletVersion:i.smart_wallet_version};t.push(r);break;case"cross_app":let s={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(s);break;case"email":let l={address:i.address,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(l);break;case"phone":let n={number:i.phoneNumber,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(n);break;case"google_oauth":let u={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(u);break;case"spotify_oauth":let d={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(d);break;case"instagram_oauth":let p={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(p);break;case"twitter_oauth":let m={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(m);break;case"discord_oauth":let f={subject:i.subject,username:i.username,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(f);break;case"github_oauth":let _={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(_);break;case"tiktok_oauth":let y={subject:i.subject,username:i.username,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(y);break;case"line_oauth":let h={subject:i.subject,name:i.name,email:i.email,profilePictureUrl:i.profile_picture_url,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(h);break;case"twitch_oauth":let b={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let k={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(k);break;case"apple_oauth":let g={subject:i.subject,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(g);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)});break;case"farcaster":let v={type:i.type,fid:i.fid,ownerAddress:i.owner_address,displayName:i.display_name,username:i.username,bio:i.bio,pfp:i.profile_picture_url,url:i.homepage_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(v);break;case"passkey":let A={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,publicKey:i.public_key,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(A);break;case"telegram":let j={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(j);break;default:if(o(i.type)){let e={type:i.type,subject:i.subject,name:i.name,username:i.username,email:i.email,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(e);break}console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=p(t,"wallet"),a=p(t,"smart_wallet"),r=p(t,"email"),s=p(t,"phone"),l=p(t,"google_oauth"),n=p(t,"twitter_oauth"),u=p(t,"discord_oauth"),d=p(t,"github_oauth"),m=p(t,"spotify_oauth"),f=p(t,"instagram_oauth"),_=p(t,"tiktok_oauth"),y=p(t,"line_oauth"),h=p(t,"twitch_oauth"),b=p(t,"linkedin_oauth"),k=p(t,"apple_oauth"),g=p(t,"farcaster"),v=p(t,"telegram"),A=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:c(t)})));return{id:e.id,createdAt:c(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:s&&{number:s?.number},wallet:i&&{id:i.id,address:i.address,chainType:i.chainType,walletClientType:i.walletClientType,connectorType:i.connectorType,recoveryMethod:i.recoveryMethod,imported:i.imported,delegated:i.delegated,walletIndex:i.walletIndex,publicKey:i.publicKey},smartWallet:a&&{address:a.address,smartWalletType:a.smartWalletType,smartWalletVersion:a.smartWalletVersion},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:u&&{subject:u.subject,username:u.username,email:u.email},github:d&&{subject:d.subject,username:d.username,name:d.name,email:d.email},spotify:m&&{subject:m.subject,email:m.email,name:m.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:_&&{subject:_.subject,username:_.username,name:_.name},line:y&&{subject:y.subject,name:y.name,email:y.email,profilePictureUrl:y.profilePictureUrl},twitch:h&&{subject:h.subject,username:h.username},linkedin:b&&{subject:b.subject,name:b.name,email:b.email,vanityName:b.vanityName},apple:k&&{subject:k.subject,email:k.email},farcaster:g&&{fid:g.fid,ownerAddress:g.ownerAddress,displayName:g.displayName,username:g.username,bio:g.bio,pfp:g.pfp,url:g.url,signerPublicKey:g.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},delegatedWallets:[],mfaMethods:A.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}function V({src:e,...i}){/*#__PURE__*/return t("img",{src:e,...i,style:{display:"none"}})}const T=/*#__PURE__*/r({currentScreen:null,lastScreen:null,navigate:d,navigateBack:d,resetNavigation:d,setModalData:d,onUserCloseViaDialogOrKeybindRef:void 0}),W=e=>{let a=u(),[r,d]=s(e.initialScreen),o=l(null);n((()=>{e.open||(o.current=null)}),[e.open]),n((()=>{o.current=null}),[e.initialScreen]);let c={data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(t,i=!0)=>{e.setInitialScreen(t),i&&d(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),d(null)},onUserCloseViaDialogOrKeybindRef:o};/*#__PURE__*/return i(T.Provider,{value:c,children:[("string"==typeof a.appearance.logo||"img"===a.appearance.logo?.type)&&/*#__PURE__*/t(V,{src:"string"==typeof a.appearance.logo?a.appearance.logo:a.appearance.logo.props.src}),e.children]})},P=()=>a(T),I=/*#__PURE__*/r({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:d,login:d,connectOrCreateWallet:d,linkEmail:d,linkPhone:d,linkFarcaster:d,linkWallet:d,startCrossAppAuthFlow:d,linkGoogle:d,linkTwitter:d,linkTwitch:d,linkDiscord:d,linkGithub:d,linkSpotify:d,linkInstagram:d,linkTelegram:d,linkTiktok:d,linkLine:d,linkLinkedIn:d,linkApple:d,linkPasskey:d,updateEmail:d,updatePhone:d,logout:d,getAccessToken:d,unlinkEmail:d,unlinkPhone:d,unlinkWallet:d,unlinkGoogle:d,unlinkTwitter:d,unlinkTwitch:d,unlinkDiscord:d,unlinkGithub:d,unlinkSpotify:d,unlinkInstagram:d,unlinkTiktok:d,unlinkLine:d,unlinkLinkedIn:d,unlinkApple:d,unlinkCrossAppAccount:d,unlinkFarcaster:d,unlinkTelegram:d,unlinkPasskey:d,signMessage:d,signTypedData:d,enrollInMfa:d,initEnrollmentWithSms:d,initEnrollmentWithTotp:d,initEnrollmentWithPasskey:d,promptMfa:d,init:d,submitEnrollmentWithSms:d,submitEnrollmentWithTotp:d,submitEnrollmentWithPasskey:d,unenroll:d,submit:d,cancel:d,sendTransaction:d,signTransaction:d,exportWallet:d,setWalletPassword:d,setWalletRecovery:d,requestFarcasterSignerFromWarpcast:d,getFarcasterSignerPublicKey:d,signFarcasterMessage:d,signMessageWithCrossAppWallet:d,signTypedDataWithCrossAppWallet:d,sendTransactionWithCrossAppWallet:d,signTransactionWithCrossAppWallet:d,isModalOpen:!1,mfaMethods:[]}),M=()=>a(I),S=e=>!!e.id&&"privy-v2"===e.recoveryMethod;export{W as M,I as P,P as a,m as b,h as c,S as d,f as e,b as f,j as g,v as h,o as i,k as j,A as k,w as l,g as m,_ as n,y as o,M as u};
|
|
1
|
+
import{getAddress as e}from"viem";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useContext as a,createContext as r,useState as s,useRef as l,useEffect as n}from"react";import{u}from"./context-DRLoVlsO.mjs";import{n as d}from"./internal-context-e-Eni5bG.mjs";function o(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}function c(e){return e?new Date(1e3*e):null}function p(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt?.getTime()??0)-(t.firstVerifiedAt?.getTime()??0))).find((e=>e.type===t))}const m=e=>e?f(e).find((e=>0===e.walletIndex))??null:null,f=e=>e?_(e,"ethereum"):[],_=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),y=e=>e?_(e,"solana"):[],h=e=>e?y(e).find((e=>0===e.walletIndex))??null:null,b=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)),k=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType)),g=(t,i)=>t===i||!(!t.startsWith("0x")||!i.startsWith("0x"))&&e(t)===e(i),v=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&g(e.address,t)))||null,A=(e,t)=>e.find((e=>g(e.address,t)))||null,j=e=>m(e)??h(e);function w(e){if(!e)return null;let t=function(e){let t=[];for(let i of e){let e=i.type;switch(i.type){case"wallet":let a={id:i.id,address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),chainType:i.chain_type,walletClientType:i.wallet_client_type,connectorType:i.connector_type,recoveryMethod:i.recovery_method,walletIndex:i.wallet_index,publicKey:i.public_key};t.push(a);break;case"smart_wallet":let r={address:i.address,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),smartWalletType:i.smart_wallet_type,smartWalletVersion:i.smart_wallet_version};t.push(r);break;case"cross_app":let s={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(s);break;case"email":let l={address:i.address,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(l);break;case"phone":let n={number:i.phoneNumber,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(n);break;case"google_oauth":let u={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(u);break;case"spotify_oauth":let d={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(d);break;case"instagram_oauth":let p={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(p);break;case"twitter_oauth":let m={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(m);break;case"discord_oauth":let f={subject:i.subject,username:i.username,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(f);break;case"github_oauth":let _={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(_);break;case"tiktok_oauth":let y={subject:i.subject,username:i.username,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(y);break;case"line_oauth":let h={subject:i.subject,name:i.name,email:i.email,profilePictureUrl:i.profile_picture_url,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(h);break;case"twitch_oauth":let b={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let k={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(k);break;case"apple_oauth":let g={subject:i.subject,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(g);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)});break;case"farcaster":let v={type:i.type,fid:i.fid,ownerAddress:i.owner_address,displayName:i.display_name,username:i.username,bio:i.bio,pfp:i.profile_picture_url,url:i.homepage_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(v);break;case"passkey":let A={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,publicKey:i.public_key,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(A);break;case"telegram":let j={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(j);break;default:if(o(i.type)){let e={type:i.type,subject:i.subject,name:i.name,username:i.username,email:i.email,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(e);break}console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=p(t,"wallet"),a=p(t,"smart_wallet"),r=p(t,"email"),s=p(t,"phone"),l=p(t,"google_oauth"),n=p(t,"twitter_oauth"),u=p(t,"discord_oauth"),d=p(t,"github_oauth"),m=p(t,"spotify_oauth"),f=p(t,"instagram_oauth"),_=p(t,"tiktok_oauth"),y=p(t,"line_oauth"),h=p(t,"twitch_oauth"),b=p(t,"linkedin_oauth"),k=p(t,"apple_oauth"),g=p(t,"farcaster"),v=p(t,"telegram"),A=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:c(t)})));return{id:e.id,createdAt:c(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:s&&{number:s?.number},wallet:i&&{id:i.id,address:i.address,chainType:i.chainType,walletClientType:i.walletClientType,connectorType:i.connectorType,recoveryMethod:i.recoveryMethod,imported:i.imported,delegated:i.delegated,walletIndex:i.walletIndex,publicKey:i.publicKey},smartWallet:a&&{address:a.address,smartWalletType:a.smartWalletType,smartWalletVersion:a.smartWalletVersion},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:u&&{subject:u.subject,username:u.username,email:u.email},github:d&&{subject:d.subject,username:d.username,name:d.name,email:d.email},spotify:m&&{subject:m.subject,email:m.email,name:m.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:_&&{subject:_.subject,username:_.username,name:_.name},line:y&&{subject:y.subject,name:y.name,email:y.email,profilePictureUrl:y.profilePictureUrl},twitch:h&&{subject:h.subject,username:h.username},linkedin:b&&{subject:b.subject,name:b.name,email:b.email,vanityName:b.vanityName},apple:k&&{subject:k.subject,email:k.email},farcaster:g&&{fid:g.fid,ownerAddress:g.ownerAddress,displayName:g.displayName,username:g.username,bio:g.bio,pfp:g.pfp,url:g.url,signerPublicKey:g.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},delegatedWallets:[],mfaMethods:A.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}function V({src:e,...i}){/*#__PURE__*/return t("img",{src:e,...i,style:{display:"none"}})}const T=/*#__PURE__*/r({currentScreen:null,lastScreen:null,navigate:d,navigateBack:d,resetNavigation:d,setModalData:d,onUserCloseViaDialogOrKeybindRef:void 0}),W=e=>{let a=u(),[r,d]=s(e.initialScreen),o=l(null);n((()=>{e.open||(o.current=null)}),[e.open]),n((()=>{o.current=null}),[e.initialScreen]);let c={data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(t,i=!0)=>{e.setInitialScreen(t),i&&d(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),d(null)},onUserCloseViaDialogOrKeybindRef:o};/*#__PURE__*/return i(T.Provider,{value:c,children:[("string"==typeof a.appearance.logo||"img"===a.appearance.logo?.type)&&/*#__PURE__*/t(V,{src:"string"==typeof a.appearance.logo?a.appearance.logo:a.appearance.logo.props.src}),e.children]})},P=()=>a(T),I=/*#__PURE__*/r({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:d,login:d,connectOrCreateWallet:d,linkEmail:d,linkPhone:d,linkFarcaster:d,linkWallet:d,startCrossAppAuthFlow:d,linkGoogle:d,linkTwitter:d,linkTwitch:d,linkDiscord:d,linkGithub:d,linkSpotify:d,linkInstagram:d,linkTelegram:d,linkTiktok:d,linkLine:d,linkLinkedIn:d,linkApple:d,linkPasskey:d,updateEmail:d,updatePhone:d,logout:d,getAccessToken:d,unlinkEmail:d,unlinkPhone:d,unlinkWallet:d,unlinkGoogle:d,unlinkTwitter:d,unlinkTwitch:d,unlinkDiscord:d,unlinkGithub:d,unlinkSpotify:d,unlinkInstagram:d,unlinkTiktok:d,unlinkLine:d,unlinkLinkedIn:d,unlinkApple:d,unlinkCrossAppAccount:d,unlinkFarcaster:d,unlinkTelegram:d,unlinkPasskey:d,signMessage:d,signTypedData:d,enrollInMfa:d,initEnrollmentWithSms:d,initEnrollmentWithTotp:d,initEnrollmentWithPasskey:d,promptMfa:d,init:d,submitEnrollmentWithSms:d,submitEnrollmentWithTotp:d,submitEnrollmentWithPasskey:d,unenroll:d,submit:d,cancel:d,sendTransaction:d,signTransaction:d,exportWallet:d,setWalletPassword:d,setWalletRecovery:d,requestFarcasterSignerFromWarpcast:d,getFarcasterSignerPublicKey:d,signFarcasterMessage:d,signMessageWithCrossAppWallet:d,signTypedDataWithCrossAppWallet:d,sendTransactionWithCrossAppWallet:d,signTransactionWithCrossAppWallet:d,isModalOpen:!1,mfaMethods:[]}),M=()=>a(I),S=e=>!!e.id&&"privy-v2"===e.recoveryMethod;export{W as M,I as P,P as a,m as b,h as c,S as d,f as e,b as f,j as g,v as h,o as i,k as j,A as k,w as l,g as m,_ as n,y as o,M as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ofetch as e}from"ofetch";import{useState as t,useRef as n,useEffect as a}from"react";import{M as r,v as o,w as i,x as u}from"./context-
|
|
1
|
+
import{ofetch as e}from"ofetch";import{useState as t,useRef as n,useEffect as a}from"react";import{M as r,v as o,w as i,x as u}from"./context-DRLoVlsO.mjs";import{u as s}from"./internal-context-e-Eni5bG.mjs";import{a as d}from"./get-is-unified-wallet-gMDXpX6C.mjs";import{O as c}from"./analytics-mkkvFRju.mjs";const m="moonpay";function l(e){return parseFloat(e)}function y(l,y=!1){let[f,g]=t(null),{createAnalyticsEvent:p}=s(),{data:h,navigate:v,setModalData:w}=d(),A=h?.funding,F=n(0);return a((()=>{let t=setInterval((async()=>{if(l)try{let[n]=await async function(t,n){return e(`${n?r:o}/transactions/ext/${t}`,{query:{apiKey:n?i:u}})}(l,y),a="waitingAuthorization"===n.status&&"credit_debit_card"===n.paymentMethod?"pending":n.status;if(["failed","completed","awaitingAuthorization"].includes(a)&&(p({eventName:c,payload:{status:a,provider:m,paymentMethod:n.paymentMethod,cardPaymentType:n.cardPaymentType,currency:n.currency?.code,baseCurrencyAmount:n.baseCurrencyAmount,quoteCurrencyAmount:n.quoteCurrencyAmount,feeAmount:n.feeAmount,extraFeeAmount:n.extraFeeAmount,networkFeeAmount:n.networkFeeAmount,isSandbox:y}}),clearInterval(t)),"failed"===a||"serviceFailure"===a)return w({funding:{...A,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."},solanaFundingData:h?.solanaFundingData}),void v("FundingMethodSelectionScreen");g(a)}catch(e){404!==e.response?.status&&(F.current+=1),F.current>=3&&(p({eventName:c,payload:{status:"serviceFailure",provider:m}}),clearInterval(t),w({funding:{...A,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."},solanaFundingData:h?.solanaFundingData}),v("FundingMethodSelectionScreen"))}}),3e3);return()=>clearInterval(t)}),[l,F]),f}export{l as a,y as u};
|