@privy-io/react-auth 3.19.0 → 3.19.1-snapshot-20260407143448

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.
Files changed (251) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-SsWHrdYE.js → AccountNotFoundScreen-BWyIlMZy.js} +1 -1
  2. package/dist/cjs/{Address-iycC7llp.js → Address-BVvyYmRz.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-WNhpSCGi.js → AffirmativeConsentScreen-h8CsIfDO.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-B_YmLFLH.js → AllowlistRejectionScreen-BDfIDLdF.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-W9B_xuW1.js → AuthenticateWithWalletScreen-CAewsRnB.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-CiwL7LcA.js → AwaitingEvmToSolBridgingScreen-D_L_XtLG.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-DYhCX2B7.js → AwaitingExternalEthereumTransferScreen-DLXzQiKL.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-BgMm2oql.js → AwaitingPasswordlessCodeScreen-C9iGHOwN.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-xE2Ivbu8.js → AwaitingSolToEvmBridgingScreen-BsBzEcRA.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-dTXi9WId.js → BridgeNetworkSelectionView-BBjOMDgf.js} +1 -1
  11. package/dist/cjs/{CaptchaScreen-C9UnN57O.js → CaptchaScreen-B4yT1Odr.js} +1 -1
  12. package/dist/cjs/{CoinbaseOnrampStatusScreen-A_KP9ZVh.js → CoinbaseOnrampStatusScreen-DkXb3NZC.js} +1 -1
  13. package/dist/cjs/{ConnectEmailForm-C8fmK8xT.js → ConnectEmailForm-CaXwBGPI.js} +1 -1
  14. package/dist/cjs/{ConnectLedgerScreen-Cs9nP7S2.js → ConnectLedgerScreen-UdXev1Ri.js} +1 -1
  15. package/dist/cjs/{ConnectOnlyLandingScreen--jqUYCWy.js → ConnectOnlyLandingScreen-Bp7rEz0D.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyStatusScreen-Dko5naBk.js → ConnectOnlyStatusScreen-BZmPHSjH.js} +1 -1
  17. package/dist/cjs/{ConnectOrCreateScreen-W7oTt7SU.js → ConnectOrCreateScreen-lJni3qXb.js} +1 -1
  18. package/dist/cjs/{ConnectPhoneForm-ZgGd_1N7.js → ConnectPhoneForm-BdG4Q_oO.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-DwqKpWZW.js → ConnectWalletView-D9XwAg7L.js} +1 -1
  20. package/dist/cjs/{ConnectionStatusScreen-DqTzyQkX.js → ConnectionStatusScreen-ZVxvJX16.js} +1 -1
  21. package/dist/cjs/{CrossAppAuthScreen-QmvRtcUx.js → CrossAppAuthScreen-BxleI7Mc.js} +1 -1
  22. package/dist/cjs/{CustomLandingScreenView-3sRiTxzr.js → CustomLandingScreenView-ChA99vC8.js} +1 -1
  23. package/dist/cjs/{DelegatedActionsConsentScreen-DgvDevuK.js → DelegatedActionsConsentScreen-CvxEa010.js} +1 -1
  24. package/dist/cjs/{DelegatedActionsRevokeScreen-BzfeoGlg.js → DelegatedActionsRevokeScreen-DeQ_TQSx.js} +1 -1
  25. package/dist/cjs/{EmbeddedWalletConnectingScreen-B1YKEWJJ.js → EmbeddedWalletConnectingScreen-EMK27Eb9.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletCreatedScreen-Fngy_Z7Z.js → EmbeddedWalletCreatedScreen-Ch0e7TuY.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-B_8UQSK5.js → EmbeddedWalletKeyExportScreen-CtIrk1FC.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-ByXaeqs_.js → EmbeddedWalletOnAccountCreateScreen-CYO96IXl.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-D3_g6Z9E.js → EmbeddedWalletPasswordUpdateScreen-BBku5o41.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-BTTzo0Nh.js → EmbeddedWalletPasswordUpdateSplashScreen-AEnxs2MI.js} +1 -1
  31. package/dist/cjs/{EnrollTotp-C-oJNOLO.js → EnrollTotp-sRABmxqI.js} +1 -1
  32. package/dist/cjs/{ErrorScreen-BOIQ9Iwp.js → ErrorScreen-CqJCDxiJ.js} +1 -1
  33. package/dist/cjs/{FarcasterConnectStatusScreen-7dcgDoLO.js → FarcasterConnectStatusScreen-DwX06IUu.js} +1 -1
  34. package/dist/cjs/{FarcasterSignerStatusScreen-DEnUiPDy.js → FarcasterSignerStatusScreen-U9ac3DZD.js} +1 -1
  35. package/dist/cjs/{FiatOnrampScreen-DfMbEpLz.js → FiatOnrampScreen-COgrnis6.js} +1 -1
  36. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-C8KT2C2P.js +2 -0
  37. package/dist/cjs/{FundWalletMethodHeader-B67kqHX4.js → FundWalletMethodHeader-DOOSswvq.js} +1 -1
  38. package/dist/cjs/{FundWithBankDepositScreen-BN8xfFpA.js → FundWithBankDepositScreen-DAXboO91.js} +1 -1
  39. package/dist/cjs/{FundingEditAmountScreen-CqOb6_T5.js → FundingEditAmountScreen-yhpQH4WE.js} +1 -1
  40. package/dist/cjs/{FundingMethodSelectionScreen-fJFztK4M.js → FundingMethodSelectionScreen-C9z0Sxqy.js} +1 -1
  41. package/dist/cjs/{InAppBrowserLoginNotPossible-bnagQikv.js → InAppBrowserLoginNotPossible-BYhJcG4W.js} +1 -1
  42. package/dist/cjs/{InstallWalletScreen-CyqS0szB.js → InstallWalletScreen-0FFwLxFW.js} +1 -1
  43. package/dist/cjs/{LandingScreen-DqGmFN52.js → LandingScreen-TgpedvBn.js} +1 -1
  44. package/dist/cjs/{LinkConflictScreen-Hv8E3W_9.js → LinkConflictScreen-Bc1msWyJ.js} +1 -1
  45. package/dist/cjs/{LinkEmailScreen-DE4uz-zi.js → LinkEmailScreen-Dp9f2MEf.js} +1 -1
  46. package/dist/cjs/{LinkPasskeyScreen-DINSv2Cw.js → LinkPasskeyScreen-BJEhcAUm.js} +1 -1
  47. package/dist/cjs/{LinkPhoneScreen-D5yRjzap.js → LinkPhoneScreen-JvE3LWsy.js} +1 -1
  48. package/dist/cjs/{LoginFailedScreen-CDk-pwn7.js → LoginFailedScreen-CZkhYomc.js} +1 -1
  49. package/dist/cjs/{ManualTransferScreen-CAvGP4Cw.js → ManualTransferScreen-aLDrDY-D.js} +1 -1
  50. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-aiaV-0Uv.js → MfaAuthEnrollmentFlowScreen-5dWmCJjg.js} +1 -1
  51. package/dist/cjs/{MfaAuthVerifyFlowScreen-DIoi2WYi.js → MfaAuthVerifyFlowScreen-DWRc_8KJ.js} +1 -1
  52. package/dist/cjs/{MfaEnrollmentFlowScreen-BlxwptKt.js → MfaEnrollmentFlowScreen-D_-GQBNx.js} +1 -1
  53. package/dist/cjs/{MfaVerifyFlowScreen-C-ePxfd_.js → MfaVerifyFlowScreen-PiaoQsWu.js} +1 -1
  54. package/dist/cjs/{ModalHeader-DPbDMuHf.js → ModalHeader-DqaDbQu5.js} +1 -1
  55. package/dist/cjs/MoonpayStatusScreen-HIv5rYKz.js +16 -0
  56. package/dist/cjs/{OAuthStatusScreen-CfoejRJG.js → OAuthStatusScreen-DOdP_jml.js} +1 -1
  57. package/dist/cjs/{PasskeySelectSignupOrLogin-DD9fXb4k.js → PasskeySelectSignupOrLogin-QCRvPbcZ.js} +1 -1
  58. package/dist/cjs/{PasskeyStatusScreen-CsCma4vU.js → PasskeyStatusScreen-DTAdemdG.js} +1 -1
  59. package/dist/cjs/{PasswordRecoveryScreen-BVfmQnjY.js → PasswordRecoveryScreen-DrdG9axV.js} +1 -1
  60. package/dist/cjs/{QrCode-yq7Uuy-I.js → QrCode-BVjP_DD1.js} +1 -1
  61. package/dist/cjs/{RecoveryOAuthStatusScreen-Wl9S8ozk.js → RecoveryOAuthStatusScreen-DUvFVmF5.js} +1 -1
  62. package/dist/cjs/{RecoveryPasswordCreateScreen-CpR3nq4k.js → RecoveryPasswordCreateScreen-BllkOhbb.js} +1 -1
  63. package/dist/cjs/{RecoverySelectionScreen-B8v3KJ2t.js → RecoverySelectionScreen-D13QdsXP.js} +1 -1
  64. package/dist/cjs/{Screen-D89lHgLy.js → Screen-pYCYhsO6.js} +1 -1
  65. package/dist/cjs/{ScreenLayout-eROlbyur.js → ScreenLayout-iu6jSYKG.js} +1 -1
  66. package/dist/cjs/{SelectSourceAsset-CTMxHLfc.js → SelectSourceAsset-EITsrqrG.js} +1 -1
  67. package/dist/cjs/{SetAutomaticRecoveryScreen-DylnsIct.js → SetAutomaticRecoveryScreen-h-k863n-.js} +1 -1
  68. package/dist/cjs/{SetWalletPasswordForm-DmJ0uNSz.js → SetWalletPasswordForm-By21GH5z.js} +1 -1
  69. package/dist/cjs/{SignRequestScreen-C97g_YOw.js → SignRequestScreen-CybkR9i6.js} +1 -1
  70. package/dist/cjs/{StandardSignAndSendTransactionScreen-BYoCNZDU.js → StandardSignAndSendTransactionScreen-DkD2a-Sq.js} +1 -1
  71. package/dist/cjs/{TelegramAuthScreen-V8PX-ZDY.js → TelegramAuthScreen-87AdiU6q.js} +1 -1
  72. package/dist/cjs/{TransactionDetails-DaptZw5I.js → TransactionDetails-jGQRjvWY.js} +1 -1
  73. package/dist/cjs/{TransactionErrorView-DMlS9soP.js → TransactionErrorView-DhIq8lCF.js} +1 -1
  74. package/dist/cjs/{TransferFromWalletScreen-D3mttpMw.js → TransferFromWalletScreen-BHmamWop.js} +1 -1
  75. package/dist/cjs/{TransferOrBridgeLoadingScreen-yeJf3CeN.js → TransferOrBridgeLoadingScreen-AkBF5sm5.js} +1 -1
  76. package/dist/cjs/{UpdateEmailScreen-HWXa5jkm.js → UpdateEmailScreen-B20VQiqQ.js} +1 -1
  77. package/dist/cjs/{UpdatePhoneScreen-Di0EhXEh.js → UpdatePhoneScreen-DNs_Ia7v.js} +1 -1
  78. package/dist/cjs/{UserLimitReachedScreen-r2nJEw-F.js → UserLimitReachedScreen-BeZkQaw5.js} +1 -1
  79. package/dist/cjs/{WalletInfoCard-BSEQ9ZuG.js → WalletInfoCard-FIZHC1bl.js} +1 -1
  80. package/dist/cjs/{WalletInterstitialScreen-B0b7c8C-.js → WalletInterstitialScreen-Jf3iPsBO.js} +1 -1
  81. package/dist/cjs/{WalletLink-px9-j0UX.js → WalletLink-BvsTkAaO.js} +1 -1
  82. package/dist/cjs/{WalletOverflowButton-B_wfC2G0.js → WalletOverflowButton-BwgNPF_q.js} +1 -1
  83. package/dist/cjs/abstract-smart-wallets.js +1 -1
  84. package/dist/cjs/{context-BAKveOwC.js → context-1bziXj8_.js} +1 -1
  85. package/dist/cjs/{ethers-BN940lEL.js → ethers-Ba7ZH_1L.js} +1 -1
  86. package/dist/cjs/extended-chains.js +1 -1
  87. package/dist/cjs/{get-entropy-details-for-user-znf4PAFl.js → get-entropy-details-for-user-CH_jyctO.js} +1 -1
  88. package/dist/cjs/{getErc20Balance-C2HeX0xC.js → getErc20Balance-mafpLhNk.js} +1 -1
  89. package/dist/cjs/{getErc20TokenInfo-BdVxKc8i.js → getErc20TokenInfo-CV7NZioW.js} +1 -1
  90. package/dist/cjs/{index-C18QAA2m.js → index-DGxzccne.js} +1 -1
  91. package/dist/cjs/{index-B--7o13p.js → index-DLIbItLP.js} +3 -3
  92. package/dist/cjs/{index-CRJX6e_s.js → index-b8F5hLWr.js} +1 -1
  93. package/dist/cjs/index.js +1 -1
  94. package/dist/cjs/internal.js +1 -1
  95. package/dist/cjs/{privy-context-BvJtlB2I.js → privy-context-SvAE0BIC.js} +1 -1
  96. package/dist/cjs/{shared-BsPOVf62.js → shared-CIv1M9MX.js} +1 -1
  97. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-qEV52R11.js → shouldProceedtoEmbeddedWalletCreationFlow-B11OuXrn.js} +1 -1
  98. package/dist/cjs/{smart-wallets-qun8sdo4.js → smart-wallets-DiY1bFwb.js} +1 -1
  99. package/dist/cjs/smart-wallets.js +1 -1
  100. package/dist/cjs/solana.js +1 -1
  101. package/dist/cjs/{styles-yjRZwXww.js → styles-DyH-bSt5.js} +1 -1
  102. package/dist/cjs/{to-ui-error-1m54Wswj.js → to-ui-error-DcVWkXIj.js} +1 -1
  103. package/dist/cjs/ui.js +1 -1
  104. package/dist/cjs/{use-export-wallet-CobU4v_Q.js → use-export-wallet-CUoey4sh.js} +1 -1
  105. package/dist/cjs/{use-export-wallet-BU92CTDl.js → use-export-wallet-Dj5_spw1.js} +1 -1
  106. package/dist/cjs/{useActiveWallet-BBx2W_rS.js → useActiveWallet-WtleaD87.js} +1 -1
  107. package/dist/cjs/{useGetTokenPrice-B5WCAcBp.js → useGetTokenPrice-DSGgFeDS.js} +1 -1
  108. package/dist/cjs/{useI18n-DIxsjQ9B.js → useI18n-SzIz873c.js} +1 -1
  109. package/dist/cjs/{usePrivy-uhb6CtaO.js → usePrivy-Bff5gChJ.js} +1 -1
  110. package/dist/cjs/useSolanaRpcClient-DAvMki39.js +1 -0
  111. package/dist/cjs/{useWalletBalance-D-Du820J.js → useWalletBalance-BVLbFf45.js} +1 -1
  112. package/dist/cjs/{useWallets-C7PkfsPn.js → useWallets-CpOI2iCN.js} +1 -1
  113. package/dist/dts/{events-context-B-xMLvZ9.d.mts → events-context-Bp5bVzxe.d.mts} +1 -1
  114. package/dist/dts/{events-context-B-xMLvZ9.d.ts → events-context-Bp5bVzxe.d.ts} +1 -1
  115. package/dist/dts/extended-chains.d.mts +1 -1
  116. package/dist/dts/extended-chains.d.ts +1 -1
  117. package/dist/dts/farcaster.d.mts +1 -1
  118. package/dist/dts/farcaster.d.ts +1 -1
  119. package/dist/dts/index.d.mts +4 -4
  120. package/dist/dts/index.d.ts +4 -4
  121. package/dist/dts/internal.d.mts +1 -1
  122. package/dist/dts/internal.d.ts +1 -1
  123. package/dist/dts/smart-wallets.d.mts +1 -1
  124. package/dist/dts/smart-wallets.d.ts +1 -1
  125. package/dist/dts/solana.d.mts +3 -3
  126. package/dist/dts/solana.d.ts +3 -3
  127. package/dist/dts/{types-CHmbtLnY.d.mts → types-fyOk1PXO.d.mts} +20 -2
  128. package/dist/dts/{types-CHmbtLnY.d.ts → types-fyOk1PXO.d.ts} +20 -2
  129. package/dist/dts/ui.d.mts +1 -1
  130. package/dist/dts/ui.d.ts +1 -1
  131. package/dist/esm/{AccountNotFoundScreen-C5OtLX5Z.mjs → AccountNotFoundScreen-D4jKfIhp.mjs} +1 -1
  132. package/dist/esm/{Address-DjnW56Bj.mjs → Address-DNZDRjT4.mjs} +1 -1
  133. package/dist/esm/{AffirmativeConsentScreen-C5riWiqL.mjs → AffirmativeConsentScreen-DSdtTlge.mjs} +1 -1
  134. package/dist/esm/{AllowlistRejectionScreen-Doq-C6CE.mjs → AllowlistRejectionScreen-cxUUXxYQ.mjs} +1 -1
  135. package/dist/esm/{AuthenticateWithWalletScreen-edkTE-4O.mjs → AuthenticateWithWalletScreen-DeimW7wg.mjs} +1 -1
  136. package/dist/esm/{AwaitingEvmToSolBridgingScreen-253OZL8g.mjs → AwaitingEvmToSolBridgingScreen-ZCAyJAuk.mjs} +1 -1
  137. package/dist/esm/{AwaitingExternalEthereumTransferScreen-cE8_H5Kl.mjs → AwaitingExternalEthereumTransferScreen-DzCDTaAp.mjs} +1 -1
  138. package/dist/esm/{AwaitingPasswordlessCodeScreen-BO10KeAt.mjs → AwaitingPasswordlessCodeScreen-D0EWuW9Q.mjs} +1 -1
  139. package/dist/esm/{AwaitingSolToEvmBridgingScreen-Bd5UKwsG.mjs → AwaitingSolToEvmBridgingScreen-CavUbXjQ.mjs} +1 -1
  140. package/dist/esm/{BridgeNetworkSelectionView-DB46VHVa.mjs → BridgeNetworkSelectionView-pGPy5Vuv.mjs} +1 -1
  141. package/dist/esm/{CaptchaScreen-DUfGAYog.mjs → CaptchaScreen-Bq8Vfaot.mjs} +1 -1
  142. package/dist/esm/{CoinbaseOnrampStatusScreen-DCHBF8oF.mjs → CoinbaseOnrampStatusScreen-2Jk9s47K.mjs} +1 -1
  143. package/dist/esm/{ConnectEmailForm-BC_yo8km.mjs → ConnectEmailForm-B38hdD5V.mjs} +1 -1
  144. package/dist/esm/{ConnectLedgerScreen-Bjrbf9wS.mjs → ConnectLedgerScreen-CkOoJ-iP.mjs} +1 -1
  145. package/dist/esm/{ConnectOnlyLandingScreen-CHhG02AT.mjs → ConnectOnlyLandingScreen-DSHXcRJM.mjs} +1 -1
  146. package/dist/esm/{ConnectOnlyStatusScreen-SGdKkp-M.mjs → ConnectOnlyStatusScreen-CfRdmRvJ.mjs} +1 -1
  147. package/dist/esm/{ConnectOrCreateScreen-C-8_VCIH.mjs → ConnectOrCreateScreen-BJFiRPVb.mjs} +1 -1
  148. package/dist/esm/{ConnectPhoneForm-BJKq4xj_.mjs → ConnectPhoneForm-DaQVxnbH.mjs} +1 -1
  149. package/dist/esm/{ConnectWalletView-CXu3Gw6w.mjs → ConnectWalletView-DEU5ELeM.mjs} +1 -1
  150. package/dist/esm/{ConnectionStatusScreen-CcPx0tPf.mjs → ConnectionStatusScreen-Cwub1gv8.mjs} +1 -1
  151. package/dist/esm/{CrossAppAuthScreen-jj8MELYk.mjs → CrossAppAuthScreen-5cIVCqTP.mjs} +1 -1
  152. package/dist/esm/{CustomLandingScreenView-bamwAqeL.mjs → CustomLandingScreenView-CYZgDKaW.mjs} +1 -1
  153. package/dist/esm/{DelegatedActionsConsentScreen-C8vuydg_.mjs → DelegatedActionsConsentScreen-BTCUbgrW.mjs} +1 -1
  154. package/dist/esm/{DelegatedActionsRevokeScreen-CX3fQC0_.mjs → DelegatedActionsRevokeScreen-DsHKVpSE.mjs} +1 -1
  155. package/dist/esm/{EmbeddedWalletConnectingScreen-T95TUkFg.mjs → EmbeddedWalletConnectingScreen-DlD0Ht6e.mjs} +1 -1
  156. package/dist/esm/{EmbeddedWalletCreatedScreen-CGs6ATdZ.mjs → EmbeddedWalletCreatedScreen-BNA69R2m.mjs} +1 -1
  157. package/dist/esm/{EmbeddedWalletKeyExportScreen-DSuDdWjx.mjs → EmbeddedWalletKeyExportScreen-xCreRjZ4.mjs} +1 -1
  158. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-CTV4Mo3e.mjs → EmbeddedWalletOnAccountCreateScreen-CR_6PVAp.mjs} +1 -1
  159. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-B1anqUGL.mjs → EmbeddedWalletPasswordUpdateScreen-C-Fz_QTt.mjs} +1 -1
  160. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-CIh8X6ji.mjs → EmbeddedWalletPasswordUpdateSplashScreen-Brsd3Uh1.mjs} +1 -1
  161. package/dist/esm/{EnrollTotp-CzAUPBBL.mjs → EnrollTotp-DeDrAsBZ.mjs} +1 -1
  162. package/dist/esm/{ErrorScreen-D_oZv5-L.mjs → ErrorScreen-DyTJlphB.mjs} +1 -1
  163. package/dist/esm/{FarcasterConnectStatusScreen-B8KI1d_Z.mjs → FarcasterConnectStatusScreen-DwzIj9YE.mjs} +1 -1
  164. package/dist/esm/{FarcasterSignerStatusScreen-D03jhZYX.mjs → FarcasterSignerStatusScreen-BtTzLzzh.mjs} +1 -1
  165. package/dist/esm/{FiatOnrampScreen-Du45zPAv.mjs → FiatOnrampScreen-AQrY31wy.mjs} +1 -1
  166. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DC9NrzS6.mjs +1 -0
  167. package/dist/esm/{FundWalletMethodHeader-DI7zmHzS.mjs → FundWalletMethodHeader-C0hiX5KZ.mjs} +1 -1
  168. package/dist/esm/{FundWithBankDepositScreen-C13Zljni.mjs → FundWithBankDepositScreen-nkFpjMQN.mjs} +1 -1
  169. package/dist/esm/{FundingEditAmountScreen-BBpobzZI.mjs → FundingEditAmountScreen-BJNdvcql.mjs} +1 -1
  170. package/dist/esm/{FundingMethodSelectionScreen-CPdqedYS.mjs → FundingMethodSelectionScreen-Bm4959al.mjs} +1 -1
  171. package/dist/esm/{InAppBrowserLoginNotPossible-C1G59clA.mjs → InAppBrowserLoginNotPossible-C7RnCsf4.mjs} +1 -1
  172. package/dist/esm/{InstallWalletScreen-C-ei-NFv.mjs → InstallWalletScreen-DO2E5WGZ.mjs} +1 -1
  173. package/dist/esm/{LandingScreen-CQ45HDbl.mjs → LandingScreen-CVqZPwav.mjs} +1 -1
  174. package/dist/esm/{LinkConflictScreen-DqXwl3Eg.mjs → LinkConflictScreen-BWXMY5eN.mjs} +1 -1
  175. package/dist/esm/{LinkEmailScreen-CYbgRIbn.mjs → LinkEmailScreen-DQheQ_BN.mjs} +1 -1
  176. package/dist/esm/{LinkPasskeyScreen-BQhZsrBK.mjs → LinkPasskeyScreen-Cb3jUPfS.mjs} +1 -1
  177. package/dist/esm/{LinkPhoneScreen-ClKxo5cr.mjs → LinkPhoneScreen-CKqIYo2a.mjs} +1 -1
  178. package/dist/esm/{LoginFailedScreen-BJ4M6Kn-.mjs → LoginFailedScreen-DjoKBEw8.mjs} +1 -1
  179. package/dist/esm/{ManualTransferScreen-C9qPhAAZ.mjs → ManualTransferScreen-BiqXCID2.mjs} +1 -1
  180. package/dist/esm/{MfaAuthEnrollmentFlowScreen-mbqTiHql.mjs → MfaAuthEnrollmentFlowScreen-_rQBoaEN.mjs} +1 -1
  181. package/dist/esm/{MfaAuthVerifyFlowScreen-DgphGRo7.mjs → MfaAuthVerifyFlowScreen-D5TAGR4D.mjs} +1 -1
  182. package/dist/esm/{MfaEnrollmentFlowScreen-BjYhGDOo.mjs → MfaEnrollmentFlowScreen-3nllUaw4.mjs} +1 -1
  183. package/dist/esm/{MfaVerifyFlowScreen-DRc1xPzc.mjs → MfaVerifyFlowScreen-DvN2oUrJ.mjs} +1 -1
  184. package/dist/esm/{ModalHeader-BxZPF7qd.mjs → ModalHeader-BjJu3vXN.mjs} +1 -1
  185. package/dist/esm/MoonpayStatusScreen-9iyFs5E0.mjs +16 -0
  186. package/dist/esm/{OAuthStatusScreen-C7AflQnS.mjs → OAuthStatusScreen-DG5ViNiC.mjs} +1 -1
  187. package/dist/esm/{PasskeySelectSignupOrLogin-Bbx2Drep.mjs → PasskeySelectSignupOrLogin-OgiO1ox5.mjs} +1 -1
  188. package/dist/esm/{PasskeyStatusScreen-CA7_egXn.mjs → PasskeyStatusScreen-_dMpb7cN.mjs} +1 -1
  189. package/dist/esm/{PasswordRecoveryScreen-BuXptYA9.mjs → PasswordRecoveryScreen-I7wjYVZ4.mjs} +1 -1
  190. package/dist/esm/{QrCode-DoSGd0gd.mjs → QrCode-Cusp19gh.mjs} +1 -1
  191. package/dist/esm/{RecoveryOAuthStatusScreen-g1unBUdr.mjs → RecoveryOAuthStatusScreen-B7oS_cbq.mjs} +1 -1
  192. package/dist/esm/{RecoveryPasswordCreateScreen-DJZV0PyW.mjs → RecoveryPasswordCreateScreen-BUOinFgC.mjs} +1 -1
  193. package/dist/esm/{RecoverySelectionScreen-CP89GXeT.mjs → RecoverySelectionScreen-B-vS5XgG.mjs} +1 -1
  194. package/dist/esm/{Screen-Cce_5_X_.mjs → Screen-SvdZ-LWF.mjs} +1 -1
  195. package/dist/esm/{ScreenLayout-CHf1S-9L.mjs → ScreenLayout-BCqpEJQ7.mjs} +1 -1
  196. package/dist/esm/{SelectSourceAsset-QWi9hDN9.mjs → SelectSourceAsset-ZEvKC1Ve.mjs} +1 -1
  197. package/dist/esm/{SetAutomaticRecoveryScreen-B0MtWhUx.mjs → SetAutomaticRecoveryScreen-Dkelc23Q.mjs} +1 -1
  198. package/dist/esm/{SetWalletPasswordForm-BXbILvyT.mjs → SetWalletPasswordForm-DscoDMvl.mjs} +1 -1
  199. package/dist/esm/{SignRequestScreen-D_YVDOBu.mjs → SignRequestScreen-C3cghydG.mjs} +1 -1
  200. package/dist/esm/{StandardSignAndSendTransactionScreen-AliHQit_.mjs → StandardSignAndSendTransactionScreen-Ca7tR7Fr.mjs} +1 -1
  201. package/dist/esm/{TelegramAuthScreen-DWjN9i1k.mjs → TelegramAuthScreen-CULrVgK1.mjs} +1 -1
  202. package/dist/esm/{TransactionDetails-8XGJZ0Ge.mjs → TransactionDetails-Bryhep1p.mjs} +1 -1
  203. package/dist/esm/{TransactionErrorView-D9VQgKHy.mjs → TransactionErrorView-Bs1Z8fKU.mjs} +1 -1
  204. package/dist/esm/{TransferFromWalletScreen-CPcbM8ct.mjs → TransferFromWalletScreen-CszCJNAR.mjs} +1 -1
  205. package/dist/esm/{TransferOrBridgeLoadingScreen-tI8x9TKA.mjs → TransferOrBridgeLoadingScreen-5HSNA7cy.mjs} +1 -1
  206. package/dist/esm/{UpdateEmailScreen-DTJvoOp1.mjs → UpdateEmailScreen-CmvQDGHw.mjs} +1 -1
  207. package/dist/esm/{UpdatePhoneScreen-B0uTQUE2.mjs → UpdatePhoneScreen-Bt3xAd7b.mjs} +1 -1
  208. package/dist/esm/{UserLimitReachedScreen-2MyKh-yy.mjs → UserLimitReachedScreen-gQmkPqak.mjs} +1 -1
  209. package/dist/esm/{WalletInfoCard-D5bstd0h.mjs → WalletInfoCard-B9C443zO.mjs} +1 -1
  210. package/dist/esm/{WalletInterstitialScreen-DwXL1Xbn.mjs → WalletInterstitialScreen-DxD4BNlw.mjs} +1 -1
  211. package/dist/esm/{WalletLink-DbseEfVp.mjs → WalletLink-BRPvN_Ge.mjs} +1 -1
  212. package/dist/esm/{WalletOverflowButton-rYLbxS3a.mjs → WalletOverflowButton-CNeN_KRh.mjs} +1 -1
  213. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  214. package/dist/esm/context-BUwBcpKH.mjs +1 -0
  215. package/dist/esm/{ethers-CljtMjlx.mjs → ethers-XeIOsY27.mjs} +1 -1
  216. package/dist/esm/extended-chains.mjs +1 -1
  217. package/dist/esm/{get-entropy-details-for-user-CgVPjq_6.mjs → get-entropy-details-for-user-CtWtyeW2.mjs} +1 -1
  218. package/dist/esm/{getErc20Balance-Bak89VUo.mjs → getErc20Balance-CfP3E_FD.mjs} +1 -1
  219. package/dist/esm/{getErc20TokenInfo-PgoronUM.mjs → getErc20TokenInfo-DejTdZEb.mjs} +1 -1
  220. package/dist/esm/{index-DehjclA2.mjs → index-A4Wgt-a2.mjs} +1 -1
  221. package/dist/esm/index-B6S3lSSv.mjs +174 -0
  222. package/dist/esm/{index-Ch8BunPr.mjs → index-CMocHE39.mjs} +1 -1
  223. package/dist/esm/index.mjs +1 -1
  224. package/dist/esm/internal.mjs +1 -1
  225. package/dist/esm/{privy-context-v-TMVBdt.mjs → privy-context-J4QWzKzm.mjs} +1 -1
  226. package/dist/esm/{shared-BwdRCoW3.mjs → shared-DsSPUHwx.mjs} +1 -1
  227. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-eFXUIOL2.mjs → shouldProceedtoEmbeddedWalletCreationFlow-JWl-fGfc.mjs} +1 -1
  228. package/dist/esm/{smart-wallets-CUCYKFEU.mjs → smart-wallets-hf-gR2yh.mjs} +1 -1
  229. package/dist/esm/smart-wallets.mjs +1 -1
  230. package/dist/esm/solana.mjs +1 -1
  231. package/dist/esm/{styles-BHXHIG4L.mjs → styles-BqPGTaeJ.mjs} +1 -1
  232. package/dist/esm/{to-ui-error-BxE1Clcw.mjs → to-ui-error-CTF4gGOY.mjs} +1 -1
  233. package/dist/esm/ui.mjs +1 -1
  234. package/dist/esm/{use-export-wallet-C3yKuILk.mjs → use-export-wallet-Bf21khnq.mjs} +1 -1
  235. package/dist/esm/{use-export-wallet-CjuVPfu7.mjs → use-export-wallet-CxU_4sqK.mjs} +1 -1
  236. package/dist/esm/{useActiveWallet-CLfuK4Fv.mjs → useActiveWallet-Bf9rjEyz.mjs} +1 -1
  237. package/dist/esm/{useGetTokenPrice-B5d8vo-7.mjs → useGetTokenPrice-BzPC_Zwu.mjs} +1 -1
  238. package/dist/esm/{useI18n-B7zlT24x.mjs → useI18n-CcO2IW8I.mjs} +1 -1
  239. package/dist/esm/{usePrivy-B1AsvC0i.mjs → usePrivy-BbUQp4Qe.mjs} +1 -1
  240. package/dist/esm/useSolanaRpcClient-DeqZtFN0.mjs +1 -0
  241. package/dist/esm/{useWalletBalance-DebUrdhO.mjs → useWalletBalance-BHV_nqCT.mjs} +1 -1
  242. package/dist/esm/{useWallets-CGkwKA_6.mjs → useWallets-CoHocloI.mjs} +1 -1
  243. package/package.json +3 -3
  244. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-CKsy-0RU.js +0 -2
  245. package/dist/cjs/MoonpayStatusScreen-DuiX8J3j.js +0 -16
  246. package/dist/cjs/useSolanaRpcClient-mGXfNcZ-.js +0 -1
  247. package/dist/esm/FundSolWalletWithExternalSolanaWallet-FbcRItfz.mjs +0 -1
  248. package/dist/esm/MoonpayStatusScreen-d57zC4KR.mjs +0 -16
  249. package/dist/esm/context-BDvZRT56.mjs +0 -1
  250. package/dist/esm/index-t8luNMU8.mjs +0 -174
  251. package/dist/esm/useSolanaRpcClient-PuydY50L.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-t8luNMU8.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as y}from"./context-BDvZRT56.mjs";import{u as h}from"./useI18n-B7zlT24x.mjs";import{C as S,P as f,w as C,n as v,y as b}from"./use-export-wallet-C3yKuILk.mjs";import{isHex as T,getAddress as _}from"viem";import{c as E,u as R,k}from"./internal-context-C4ZqP8IF.mjs";import{z as A}from"./useActiveWallet-CLfuK4Fv.mjs";import{u as L,a as W}from"./privy-context-v-TMVBdt.mjs";import{s as I}from"./shouldProceedtoEmbeddedWalletCreationFlow-eFXUIOL2.mjs";import{u as j}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-B1AsvC0i.mjs";import{S as O}from"./ScreenLayout-CHf1S-9L.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"zustand";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"mipd";import"viem/utils";import"@privy-io/popup";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"tinycolor2";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>T(e,{strict:!0}))).map((e=>_(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const x=e=>e?.privyErrorCode===E.LINKED_TO_ANOTHER_USER?S.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?S.ERROR_TIMED_OUT:e?.privyErrorCode===E.CANNOT_LINK_MORE_OF_TYPE?S.ERROR_USER_LIMIT_REACHED:S.ERROR_WALLET_CONNECTION,M=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:y,onBack:f,onSign:C,onRetry:v,onCoinbaseReset:b,onDifferentWallet:T})=>{let{t:_}=h(),E=w?{label:"Use a different wallet",onClick:b,disabled:r}:c===S.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&y<2?{label:"Retry",onClick:v,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:E,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,T]=a(void 0),{authenticated:_,logout:O}=L(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:z}=W(),H=w(),{t:X}=h(),{getAuthFlow:Y,walletConnectionStatus:K,closePrivyModal:Q,initLoginWithWallet:V,loginWithWallet:G,updateWallets:J,createAnalyticsEvent:$}=R(),{walletConnectors:Z}=L(),[ee,te]=a(0),{user:ne}=L(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=A(K?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===K?.connector?.connectorType||c&&"coinbase_wallet"===K?.connector?.connectorType||c&&"base_account"===K?.connector?.connectorType||c&&"injected"===K?.connector?.connectorType&&"phantom"===K?.connector?.walletClientType||c&&"solana_adapter"===K?.connector?.connectorType&&"mobile_wallet_adapter"===K.connector.walletClientType,ye="connected"===K?.status,he="switching_to_supported_chain"===K?.status;i((()=>{let e=Y(),t=e instanceof p||e instanceof d?e:void 0;ye&&"solana"===K.connector?.chainType&&"phantom"===K.connector?.walletClientType&&oe(U)&&void 0===z?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(ye&&!t&&(!ue||pe||_?V(K.connectedWallet,pe,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>V(K.connectedWallet,e,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&z?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&ye&&!t.preparedMessage?t.buildMessage():t&&!we&&ye&&(g||(async()=>{f(!0),T(void 0);try{"wallet_connect_v2"===K?.connector?.connectorType&&"metamask"===K?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,ye,se]),i((()=>{if(ne&&n){let e=y-500;if(H?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(I(ne,H.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),$({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}J();let t=setTimeout((()=>Q({shouldCallAuthOnSuccess:!0,isSuccess:!0})),y);return()=>clearTimeout(t)}}),[ne,n]);let Se=e=>{if(e?.privyErrorCode!==E.ALLOWLIST_REJECTED){if(e?.privyErrorCode===E.USER_LIMIT_REACHED)return console.error(new k(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==E.USER_DOES_NOT_EXIST)return e?.privyErrorCode===E.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:Y()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Y()?.meta.walletClientType,chainId:Y()?.meta.chainId,connectorType:Y()?.meta.connectorType},linkMethod:Y()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void T(x(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await G(),l(!0)}catch(e){Se(e)}finally{f(!1)}}i((()=>{K?.connectError&&Se(K?.connectError)}),[K]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&K?.connector instanceof m?K.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&K?.connector instanceof m?K.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),K?.connector instanceof m&&!ae?500:null);let Ce=K?.connector?.connectorType||"injected",ve=K?.connector?.walletClientType||"unknown",be=ge?.metadata?.shortName||ge?.name||K?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||K?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===be?be.toLowerCase():be;t=n?X("connectionStatus.successfullyConnected",{walletName:_e}):C?X("connectionStatus.errorTitle",{errorMessage:C.message}):he?"Switching networks":ye?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=X("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:he?Ee="Switch your wallet to the requested network.":ye&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===ve&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===ve?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?b()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):z?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===ve&&(N(ne)||C===S.ERROR_USER_EXISTS);/*#__PURE__*/return e(M,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:ye,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),T(void 0),ye?(f(!0),fe()):K?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=l.p`
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-B6S3lSSv.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as y}from"./context-BUwBcpKH.mjs";import{u as h}from"./useI18n-CcO2IW8I.mjs";import{C as S,P as f,w as C,n as v,y as b}from"./use-export-wallet-Bf21khnq.mjs";import{isHex as T,getAddress as _}from"viem";import{c as E,u as R,k}from"./internal-context-C4ZqP8IF.mjs";import{z as A}from"./useActiveWallet-Bf9rjEyz.mjs";import{u as L,a as W}from"./privy-context-J4QWzKzm.mjs";import{s as I}from"./shouldProceedtoEmbeddedWalletCreationFlow-JWl-fGfc.mjs";import{u as j}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-BbUQp4Qe.mjs";import{S as O}from"./ScreenLayout-BCqpEJQ7.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"zustand";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"mipd";import"viem/utils";import"@privy-io/popup";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"tinycolor2";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>T(e,{strict:!0}))).map((e=>_(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const x=e=>e?.privyErrorCode===E.LINKED_TO_ANOTHER_USER?S.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?S.ERROR_TIMED_OUT:e?.privyErrorCode===E.CANNOT_LINK_MORE_OF_TYPE?S.ERROR_USER_LIMIT_REACHED:S.ERROR_WALLET_CONNECTION,M=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:y,onBack:f,onSign:C,onRetry:v,onCoinbaseReset:b,onDifferentWallet:T})=>{let{t:_}=h(),E=w?{label:"Use a different wallet",onClick:b,disabled:r}:c===S.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&y<2?{label:"Retry",onClick:v,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:E,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,T]=a(void 0),{authenticated:_,logout:O}=L(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:z}=W(),H=w(),{t:X}=h(),{getAuthFlow:Y,walletConnectionStatus:K,closePrivyModal:Q,initLoginWithWallet:V,loginWithWallet:G,updateWallets:J,createAnalyticsEvent:$}=R(),{walletConnectors:Z}=L(),[ee,te]=a(0),{user:ne}=L(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=A(K?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===K?.connector?.connectorType||c&&"coinbase_wallet"===K?.connector?.connectorType||c&&"base_account"===K?.connector?.connectorType||c&&"injected"===K?.connector?.connectorType&&"phantom"===K?.connector?.walletClientType||c&&"solana_adapter"===K?.connector?.connectorType&&"mobile_wallet_adapter"===K.connector.walletClientType,ye="connected"===K?.status,he="switching_to_supported_chain"===K?.status;i((()=>{let e=Y(),t=e instanceof p||e instanceof d?e:void 0;ye&&"solana"===K.connector?.chainType&&"phantom"===K.connector?.walletClientType&&oe(U)&&void 0===z?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(ye&&!t&&(!ue||pe||_?V(K.connectedWallet,pe,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>V(K.connectedWallet,e,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&z?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&ye&&!t.preparedMessage?t.buildMessage():t&&!we&&ye&&(g||(async()=>{f(!0),T(void 0);try{"wallet_connect_v2"===K?.connector?.connectorType&&"metamask"===K?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,ye,se]),i((()=>{if(ne&&n){let e=y-500;if(H?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(I(ne,H.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),$({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}J();let t=setTimeout((()=>Q({shouldCallAuthOnSuccess:!0,isSuccess:!0})),y);return()=>clearTimeout(t)}}),[ne,n]);let Se=e=>{if(e?.privyErrorCode!==E.ALLOWLIST_REJECTED){if(e?.privyErrorCode===E.USER_LIMIT_REACHED)return console.error(new k(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==E.USER_DOES_NOT_EXIST)return e?.privyErrorCode===E.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:Y()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Y()?.meta.walletClientType,chainId:Y()?.meta.chainId,connectorType:Y()?.meta.connectorType},linkMethod:Y()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void T(x(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await G(),l(!0)}catch(e){Se(e)}finally{f(!1)}}i((()=>{K?.connectError&&Se(K?.connectError)}),[K]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&K?.connector instanceof m?K.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&K?.connector instanceof m?K.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),K?.connector instanceof m&&!ae?500:null);let Ce=K?.connector?.connectorType||"injected",ve=K?.connector?.walletClientType||"unknown",be=ge?.metadata?.shortName||ge?.name||K?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||K?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===be?be.toLowerCase():be;t=n?X("connectionStatus.successfullyConnected",{walletName:_e}):C?X("connectionStatus.errorTitle",{errorMessage:C.message}):he?"Switching networks":ye?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=X("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:he?Ee="Switch your wallet to the requested network.":ye&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===ve&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===ve?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?b()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):z?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===ve&&(N(ne)||C===S.ERROR_USER_EXISTS);/*#__PURE__*/return e(M,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:ye,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),T(void 0),ye?(f(!0),fe()):K?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=l.p`
2
2
  text-align: center;
3
3
  color: var(--privy-color-foreground-2);
4
4
  font-size: 14px;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-BDvZRT56.mjs";import{R as s}from"./index-t8luNMU8.mjs";import{u as n,b as c,e as p,c as l}from"./internal-context-C4ZqP8IF.mjs";import{a as m}from"./privy-context-v-TMVBdt.mjs";import{o as d}from"./useActiveWallet-CLfuK4Fv.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-eFXUIOL2.mjs";import{S as f}from"./ScreenLayout-CHf1S-9L.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"viem";import"zustand";import"viem/utils";import"@coinbase/wallet-sdk";import"react-device-detect";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"styled-components";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:y,onUserCloseViaDialogOrKeybindRef:g}=m(),{crossAppAuthFlow:A,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),x=f?.crossAppAuth,T=new c(`There was an issue connecting your ${x?.name} account. Please try again.`),U=new s((async e=>{if(x?.popup)try{let t=await A({appId:e,popup:x.popup,action:x.action,disableSignup:x.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return y({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${x.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");x.popup&&x.popup.close(),I({error:T})}else I({error:T})}else I({error:T})})),k=()=>{C.data&&(j(),x?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),x?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return g.current=k,r((()=>{x?.appId?.length&&U.execute(x.appId)}),[x?.appId]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{y({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${x?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(k,a);return()=>clearTimeout(o)}),[C.data]),x?.appId?/*#__PURE__*/e(h,{providerApp:{id:x?.appId,logoUrl:x?.logoUrl,name:x?.name},success:!!C.data,error:C.error,onClose:k}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-BUwBcpKH.mjs";import{R as s}from"./index-B6S3lSSv.mjs";import{u as n,b as c,e as p,c as l}from"./internal-context-C4ZqP8IF.mjs";import{a as m}from"./privy-context-J4QWzKzm.mjs";import{o as d}from"./useActiveWallet-Bf9rjEyz.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-JWl-fGfc.mjs";import{S as f}from"./ScreenLayout-BCqpEJQ7.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"viem";import"zustand";import"viem/utils";import"@coinbase/wallet-sdk";import"react-device-detect";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"styled-components";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:y,onUserCloseViaDialogOrKeybindRef:g}=m(),{crossAppAuthFlow:A,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),x=f?.crossAppAuth,T=new c(`There was an issue connecting your ${x?.name} account. Please try again.`),U=new s((async e=>{if(x?.popup)try{let t=await A({appId:e,popup:x.popup,action:x.action,disableSignup:x.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return y({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${x.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");x.popup&&x.popup.close(),I({error:T})}else I({error:T})}else I({error:T})})),k=()=>{C.data&&(j(),x?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),x?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return g.current=k,r((()=>{x?.appId?.length&&U.execute(x.appId)}),[x?.appId]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{y({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${x?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(k,a);return()=>clearTimeout(o)}),[C.data]),x?.appId?/*#__PURE__*/e(h,{providerApp:{id:x?.appId,logoUrl:x?.logoUrl,name:x?.name},success:!!C.data,error:C.error,onClose:k}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-BxZPF7qd.mjs";import{u}from"./context-BDvZRT56.mjs";import{A as g,C as m,B as f,H as y,r as w,D as v,F as C,G as b,s as k,I as S,f as T,J as M,K as x}from"./useActiveWallet-CLfuK4Fv.mjs";import{u as A}from"./internal-context-C4ZqP8IF.mjs";import{u as L,a as W,i as I}from"./privy-context-v-TMVBdt.mjs";import{a as E,t as P}from"./index-t8luNMU8.mjs";import{u as N,b as j,c as D}from"./ConnectWalletView-CXu3Gw6w.mjs";import{z as O}from"./use-export-wallet-C3yKuILk.mjs";import{Mail as R,Smartphone as V,UserCircle as _}from"lucide-react";import{C as F}from"./ConnectEmailForm-BC_yo8km.mjs";import{C as U}from"./Chip-D2-wZOHJ.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as B}from"./Link-DJ5gq9Di.mjs";import{C as q}from"./ConnectPhoneForm-BJKq4xj_.mjs";import{T as K,a as J,I as Q,S as Y,L as Z,G as X,b as ee,D as te,A as ie}from"./twitter-BoAxhlj6.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-rYLbxS3a.mjs";import{S as oe}from"./ScreenLayout-CHf1S-9L.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=c.div`
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-BjJu3vXN.mjs";import{u}from"./context-BUwBcpKH.mjs";import{A as g,C as m,B as f,H as y,r as w,D as v,F as C,G as b,s as k,I as S,f as T,J as M,K as x}from"./useActiveWallet-Bf9rjEyz.mjs";import{u as A}from"./internal-context-C4ZqP8IF.mjs";import{u as L,a as W,i as I}from"./privy-context-J4QWzKzm.mjs";import{a as E,t as P}from"./index-B6S3lSSv.mjs";import{u as N,b as j,c as D}from"./ConnectWalletView-DEU5ELeM.mjs";import{z as O}from"./use-export-wallet-Bf21khnq.mjs";import{Mail as R,Smartphone as V,UserCircle as _}from"lucide-react";import{C as F}from"./ConnectEmailForm-B38hdD5V.mjs";import{C as U}from"./Chip-D2-wZOHJ.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as B}from"./Link-DJ5gq9Di.mjs";import{C as q}from"./ConnectPhoneForm-DaQVxnbH.mjs";import{T as K,a as J,I as Q,S as Y,L as Z,G as X,b as ee,D as te,A as ie}from"./twitter-BoAxhlj6.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-CNeN_KRh.mjs";import{S as oe}from"./ScreenLayout-BCqpEJQ7.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=c.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  align-items: center;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as s,useEffect as i}from"react";import{W as a}from"./WalletInfoCard-D5bstd0h.mjs";import{u as n,r as c}from"./context-BDvZRT56.mjs";import{u as m,b as l}from"./internal-context-C4ZqP8IF.mjs";import{a as p}from"./privy-context-v-TMVBdt.mjs";import{S as u}from"./ScreenLayout-CHf1S-9L.mjs";import"styled-components";import"./ModalHeader-BxZPF7qd.mjs";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-DjnW56Bj.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const d=({appName:s,address:i,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${s}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${s} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:i,title:"Wallet"})}),y={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=s(!1),[y,f]=s(),{address:j,onDelegate:h,onSuccess:g,onError:v}=t.delegatedActions.consent,w=async()=>{a?g():v(y??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return i((()=>{if(!a&&!y)return;let e=setTimeout(w,c);return()=>clearTimeout(e)}),[a,y]),/*#__PURE__*/e(d,{appName:o.name,address:j,success:a,error:y,onAccept:async()=>{try{await h(),u(!0)}catch(e){f(e)}},onDecline:()=>{w()},onClose:w})}};export{y as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,y as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as s,useEffect as i}from"react";import{W as a}from"./WalletInfoCard-B9C443zO.mjs";import{u as n,r as c}from"./context-BUwBcpKH.mjs";import{u as m,b as l}from"./internal-context-C4ZqP8IF.mjs";import{a as p}from"./privy-context-J4QWzKzm.mjs";import{S as u}from"./ScreenLayout-BCqpEJQ7.mjs";import"styled-components";import"./ModalHeader-BjJu3vXN.mjs";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-DNZDRjT4.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const d=({appName:s,address:i,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${s}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${s} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:i,title:"Wallet"})}),y={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=s(!1),[y,f]=s(),{address:j,onDelegate:h,onSuccess:g,onError:v}=t.delegatedActions.consent,w=async()=>{a?g():v(y??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return i((()=>{if(!a&&!y)return;let e=setTimeout(w,c);return()=>clearTimeout(e)}),[a,y]),/*#__PURE__*/e(d,{appName:o.name,address:j,success:a,error:y,onAccept:async()=>{try{await h(),u(!0)}catch(e){f(e)}},onDecline:()=>{w()},onClose:w})}};export{y as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,y as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-BDvZRT56.mjs";import{u as c,b as m}from"./internal-context-C4ZqP8IF.mjs";import{a as l}from"./privy-context-v-TMVBdt.mjs";import{S as p}from"./ScreenLayout-CHf1S-9L.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-BxZPF7qd.mjs";import"styled-components";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[y,f]=i(),{onRevoke:v,onSuccess:k,onError:h}=o.delegatedActions.revoke,j=async()=>{p?k():h(y??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!y)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,y]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:y,onRevoke:async()=>{try{await v(),d(!0)}catch(e){f(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-BUwBcpKH.mjs";import{u as c,b as m}from"./internal-context-C4ZqP8IF.mjs";import{a as l}from"./privy-context-J4QWzKzm.mjs";import{S as p}from"./ScreenLayout-BCqpEJQ7.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-BjJu3vXN.mjs";import"styled-components";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[y,f]=i(),{onRevoke:v,onSuccess:k,onError:h}=o.delegatedActions.revoke,j=async()=>{p?k():h(y??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!y)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,y]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:y,onRevoke:async()=>{try{await v(),d(!0)}catch(e){f(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-t8luNMU8.mjs";import{u as s}from"./internal-context-C4ZqP8IF.mjs";import{u as c,a as l}from"./privy-context-v-TMVBdt.mjs";import{S as m}from"./ScreenLayout-CHf1S-9L.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"./context-BDvZRT56.mjs";import"tinycolor2";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=c(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=l(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:x,entropyId:k,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:F,isUnifiedWallet:T=!1}=f?.connectWallet,M=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return M("User must be authenticated and have a Privy wallet before it can be connected");try{if(!T){if(!k||!P)return M("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:k,entropyIdVerifier:P})}x&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===S){let e=await d.getAccessToken();if(!e)return M("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:F}});let t=await(v?.recover({accessToken:e,entropyId:k,entropyIdVerifier:P}));t?.entropyId||M(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F}}),h(A)}catch(e){M("An error has occurred, please try again.")}}else a(e)&&"privy"!==S&&"privy-v2"!==S?(w({...f,recoverWallet:{entropyId:k,entropyIdVerifier:P,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:S,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(S))):M(e)}})(),()=>clearTimeout(e)):void 0:M("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{M("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-B6S3lSSv.mjs";import{u as s}from"./internal-context-C4ZqP8IF.mjs";import{u as c,a as l}from"./privy-context-J4QWzKzm.mjs";import{S as m}from"./ScreenLayout-BCqpEJQ7.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"./context-BUwBcpKH.mjs";import"tinycolor2";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=c(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=l(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:x,entropyId:k,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:F,isUnifiedWallet:T=!1}=f?.connectWallet,M=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return M("User must be authenticated and have a Privy wallet before it can be connected");try{if(!T){if(!k||!P)return M("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:k,entropyIdVerifier:P})}x&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===S){let e=await d.getAccessToken();if(!e)return M("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:F}});let t=await(v?.recover({accessToken:e,entropyId:k,entropyIdVerifier:P}));t?.entropyId||M(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F}}),h(A)}catch(e){M("An error has occurred, please try again.")}}else a(e)&&"privy"!==S&&"privy-v2"!==S?(w({...f,recoverWallet:{entropyId:k,entropyIdVerifier:P,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:S,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(S))):M(e)}})(),()=>clearTimeout(e)):void 0:M("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{M("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,d as s,f as c}from"./privy-context-v-TMVBdt.mjs";import{u as n,r as a}from"./context-BDvZRT56.mjs";import{u as m}from"./internal-context-C4ZqP8IF.mjs";import{S as l}from"./ScreenLayout-CHf1S-9L.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-BxZPF7qd.mjs";import"styled-components";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=m(),{data:f,onUserCloseViaDialogOrKeybindRef:j}=i(),h=n(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:x}=f.createWallet,A=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:x})};o((()=>{let e=setTimeout(A,a);return()=>clearTimeout(e)}),[]),j.current=A;let S=p&&!((t?.linkedAccounts?.length??0)>1);/*#__PURE__*/return e(u,{title:S?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:S?"You've successfully created an account.":"Your account is secured.",onClose:A})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,d as s,f as c}from"./privy-context-J4QWzKzm.mjs";import{u as n,r as a}from"./context-BUwBcpKH.mjs";import{u as m}from"./internal-context-C4ZqP8IF.mjs";import{S as l}from"./ScreenLayout-BCqpEJQ7.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-BjJu3vXN.mjs";import"styled-components";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=m(),{data:f,onUserCloseViaDialogOrKeybindRef:j}=i(),h=n(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:x}=f.createWallet,A=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:x})};o((()=>{let e=setTimeout(A,a);return()=>clearTimeout(e)}),[]),j.current=A;let S=p&&!((t?.linkedAccounts?.length??0)>1);/*#__PURE__*/return e(u,{title:S?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:S?"You've successfully created an account.":"Your account is secured.",onClose:A})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as s}from"./WarningBanner-D5LqDt95.mjs";import{W as c}from"./WalletInfoCard-D5bstd0h.mjs";import{u as d}from"./context-BDvZRT56.mjs";import{u as p}from"./internal-context-C4ZqP8IF.mjs";import{u as m,a as u}from"./privy-context-v-TMVBdt.mjs";import{S as h}from"./ScreenLayout-CHf1S-9L.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-BxZPF7qd.mjs";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-DjnW56Bj.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,exportButtonProps:l,onBack:d})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/t(r,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:d,showBack:!!d,watermark:!0,children:/*#__PURE__*/t(f,{children:[/*#__PURE__*/e(s,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:i&&l&&/*#__PURE__*/e(g,{accessToken:i,dimensions:{height:"44px"},...l})})]})});let f=a.div`
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as s}from"./WarningBanner-D5LqDt95.mjs";import{W as c}from"./WalletInfoCard-B9C443zO.mjs";import{u as d}from"./context-BUwBcpKH.mjs";import{u as p}from"./internal-context-C4ZqP8IF.mjs";import{u as m,a as u}from"./privy-context-J4QWzKzm.mjs";import{S as h}from"./ScreenLayout-BCqpEJQ7.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-BjJu3vXN.mjs";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-DNZDRjT4.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,exportButtonProps:l,onBack:d})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/t(r,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:d,showBack:!!d,watermark:!0,children:/*#__PURE__*/t(f,{children:[/*#__PURE__*/e(s,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:i&&l&&/*#__PURE__*/e(g,{accessToken:i,dimensions:{height:"44px"},...l})})]})});let f=a.div`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  gap: 1.25rem;
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{generateWalletIdempotencyKey as i}from"@privy-io/js-sdk-core";import{u as a}from"./context-BDvZRT56.mjs";import{F as s,s as l,k as n,v as m,G as c,R as d}from"./index-t8luNMU8.mjs";import{u as p,m as u}from"./internal-context-C4ZqP8IF.mjs";import{a as y,u as h}from"./privy-context-v-TMVBdt.mjs";import{u as w}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as v}from"./ScreenLayout-CHf1S-9L.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const C=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(v,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),f={component:()=>{let{setModalData:t,navigate:v,data:f,onUserCloseViaDialogOrKeybindRef:g}=y(),j=a(),[b,x]=r(""),{embeddedWallets:S}=a(),{authenticated:W,user:O}=h(),{closePrivyModal:A,walletProxy:k,client:I}=p(),{onSuccess:P,onFailure:M,callAuthOnSuccessOnClose:R,shouldCreateEth:U,shouldCreateSol:E}=f.createWallet,L=w(),F=O?L(s)?.shouldCreateWallet({user:O}):void 0,K=!!O&&l(O,j.embeddedWallets.ethereum.createOnLogin,F),T=!!O&&n(O,j.embeddedWallets.solana.createOnLogin,F),V="legacy-embedded-wallets-only"===j.embeddedWallets.mode&&!0===j?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[q,D]=r(null),{create:G}=m(),z=U??K,H=E??T,Q=new d((async()=>{let e=await I.getAccessToken();if(O&&e&&k)try{let e,t=await i(O.id,"ethereum"),r=await i(O.id,"solana");if(z&&H)e=await G({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t}),e=await G({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(H)e=await G({chainType:"solana",walletIndex:0,latestUser:O,idempotencyKey:r});else{if(!z)return void A({shouldCallAuthOnSuccess:R});e=await G({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t})}D(e),v("EmbeddedWalletCreatedScreen")}catch(e){x(e.message)}}));return o((()=>W&&O?V?(t({...f,createWallet:{...f.createWallet,shouldCreateEth:z,shouldCreateSol:H},recoverySelection:{...f?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:z,shouldCreateSol:H}}),v(c({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:S.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void Q.execute():(v("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet")))),[V,W]),g.current=()=>null/*#__PURE__*/,e(C,{errorMessage:b||void 0,onClose:()=>{q?(P(q),A({shouldCallAuthOnSuccess:R})):(M(new u("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))}})}};export{f as EmbeddedWalletOnAccountCreateScreen,C as EmbeddedWalletOnAccountCreateView,f as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{generateWalletIdempotencyKey as i}from"@privy-io/js-sdk-core";import{u as a}from"./context-BUwBcpKH.mjs";import{F as s,s as l,k as n,v as m,G as c,R as d}from"./index-B6S3lSSv.mjs";import{u as p,m as u}from"./internal-context-C4ZqP8IF.mjs";import{a as y,u as h}from"./privy-context-J4QWzKzm.mjs";import{u as w}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as v}from"./ScreenLayout-BCqpEJQ7.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"react-device-detect";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const C=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(v,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),f={component:()=>{let{setModalData:t,navigate:v,data:f,onUserCloseViaDialogOrKeybindRef:g}=y(),j=a(),[b,x]=r(""),{embeddedWallets:S}=a(),{authenticated:W,user:O}=h(),{closePrivyModal:A,walletProxy:k,client:I}=p(),{onSuccess:P,onFailure:M,callAuthOnSuccessOnClose:R,shouldCreateEth:U,shouldCreateSol:E}=f.createWallet,L=w(),F=O?L(s)?.shouldCreateWallet({user:O}):void 0,K=!!O&&l(O,j.embeddedWallets.ethereum.createOnLogin,F),T=!!O&&n(O,j.embeddedWallets.solana.createOnLogin,F),V="legacy-embedded-wallets-only"===j.embeddedWallets.mode&&!0===j?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[q,D]=r(null),{create:G}=m(),z=U??K,H=E??T,Q=new d((async()=>{let e=await I.getAccessToken();if(O&&e&&k)try{let e,t=await i(O.id,"ethereum"),r=await i(O.id,"solana");if(z&&H)e=await G({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t}),e=await G({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(H)e=await G({chainType:"solana",walletIndex:0,latestUser:O,idempotencyKey:r});else{if(!z)return void A({shouldCallAuthOnSuccess:R});e=await G({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t})}D(e),v("EmbeddedWalletCreatedScreen")}catch(e){x(e.message)}}));return o((()=>W&&O?V?(t({...f,createWallet:{...f.createWallet,shouldCreateEth:z,shouldCreateSol:H},recoverySelection:{...f?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:z,shouldCreateSol:H}}),v(c({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:S.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void Q.execute():(v("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet")))),[V,W]),g.current=()=>null/*#__PURE__*/,e(C,{errorMessage:b||void 0,onClose:()=>{q?(P(q),A({shouldCallAuthOnSuccess:R})):(M(new u("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))}})}};export{f as EmbeddedWalletOnAccountCreateScreen,C as EmbeddedWalletOnAccountCreateView,f as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./privy-context-v-TMVBdt.mjs";import{u as i}from"./context-BDvZRT56.mjs";import{u as n,o as d,m as c}from"./internal-context-C4ZqP8IF.mjs";import{b as l}from"./get-entropy-details-for-user-CgVPjq_6.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-BXbILvyT.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"zustand";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-BxZPF7qd.mjs";import"./useActiveWallet-CLfuK4Fv.mjs";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.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"./shared-BwdRCoW3.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let[u,y]=o(null),[w,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:A,user:I}=t(),{client:M,walletProxy:j,refreshSessionAndUser:b,closePrivyModal:R,createAnalyticsEvent:x}=n(),{navigate:C,data:P,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=P.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===D?.recoveryMethod;r((()=>{A||(C("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let T=()=>v?(N(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:w,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>_(p()),onPasswordChange:_,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&j)try{x({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void x({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await b(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void x({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});y(s),x({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),x({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./privy-context-J4QWzKzm.mjs";import{u as i}from"./context-BUwBcpKH.mjs";import{u as n,o as d,m as c}from"./internal-context-C4ZqP8IF.mjs";import{b as l}from"./get-entropy-details-for-user-CtWtyeW2.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-DscoDMvl.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"zustand";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-BjJu3vXN.mjs";import"./useActiveWallet-Bf9rjEyz.mjs";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.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"./shared-DsSPUHwx.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let[u,y]=o(null),[w,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:A,user:I}=t(),{client:M,walletProxy:j,refreshSessionAndUser:b,closePrivyModal:R,createAnalyticsEvent:x}=n(),{navigate:C,data:P,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=P.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===D?.recoveryMethod;r((()=>{A||(C("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let T=()=>v?(N(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:w,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>_(p()),onPasswordChange:_,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&j)try{x({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void x({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await b(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void x({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});y(s),x({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),x({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-C4ZqP8IF.mjs";import{a}from"./privy-context-v-TMVBdt.mjs";import{S as c}from"./ScreenLayout-CHf1S-9L.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-BDvZRT56.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-BxZPF7qd.mjs";import"styled-components";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const n=({onClose:i,onProceed:s})=>/*#__PURE__*/e(c,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),m={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:c}=a(),{onFailure:m}=t.setWalletPassword,l=()=>{m(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return c.current=l,/*#__PURE__*/e(n,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{m as EmbeddedWalletPasswordUpdateSplashScreen,n as EmbeddedWalletPasswordUpdateSplashView,m as default};
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-C4ZqP8IF.mjs";import{a}from"./privy-context-J4QWzKzm.mjs";import{S as c}from"./ScreenLayout-BCqpEJQ7.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-BUwBcpKH.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-BjJu3vXN.mjs";import"styled-components";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const n=({onClose:i,onProceed:s})=>/*#__PURE__*/e(c,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),m={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:c}=a(),{onFailure:m}=t.setWalletPassword,l=()=>{m(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return c.current=l,/*#__PURE__*/e(n,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{m as EmbeddedWalletPasswordUpdateSplashScreen,n as EmbeddedWalletPasswordUpdateSplashView,m as default};
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{styled as o}from"styled-components";import i from"@heroicons/react/24/outline/ChevronRightIcon";import n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import s from"@heroicons/react/24/outline/FingerPrintIcon";import a from"@heroicons/react/24/outline/MinusCircleIcon";import l from"@heroicons/react/24/outline/PhoneIcon";import C from"@heroicons/react/24/outline/ShieldCheckIcon";import{A as c,L as d}from"./useActiveWallet-CLfuK4Fv.mjs";import{M as h,b as m,P as p}from"./ModalHeader-BxZPF7qd.mjs";import{C as u}from"./Chip-D2-wZOHJ.mjs";import{I as y,T as f,S as g,E as k,M as w,d as v,e as b,f as M,g as x,R as Z,a as j,A as L,F as E,L as I,b as S,c as P,C as T,N as A}from"./PinInput-3SLvbnQa.mjs";import R from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import W from"@heroicons/react/24/outline/ClockIcon";import{useState as F,useMemo as B}from"react";import{u as z}from"./context-BDvZRT56.mjs";import{u as U}from"./internal-context-C4ZqP8IF.mjs";import{u as $}from"./privy-context-v-TMVBdt.mjs";import{ErrorScreenView as N}from"./ErrorScreen-D_oZv5-L.mjs";import{DoubleIconWrapper as O}from"./LinkPasskeyScreen-BQhZsrBK.mjs";import{C as D}from"./CopyToClipboard-DSTf_eKU.mjs";import{C as V}from"./Layouts-BlFm53ED.mjs";import{C as _}from"./Column-C2X2MHYX.mjs";import{L as q}from"./LabelXs-oqZNqbm_.mjs";import{S as H}from"./Subtitle-CV-2yKE4.mjs";import{T as Q}from"./Title-BnzYV3Is.mjs";import{B as Y}from"./shared-FM0rljBt.mjs";import{f as X,g as G,h as J,i as K}from"./index-t8luNMU8.mjs";import ee from"@heroicons/react/24/solid/ShieldCheckIcon";import{Q as re}from"./QrCode-DoSGd0gd.mjs";const te=t=>/*#__PURE__*/e(oe,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...t,children:[/*#__PURE__*/r("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),/*#__PURE__*/r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let oe=o.svg`
1
+ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{styled as o}from"styled-components";import i from"@heroicons/react/24/outline/ChevronRightIcon";import n from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import s from"@heroicons/react/24/outline/FingerPrintIcon";import a from"@heroicons/react/24/outline/MinusCircleIcon";import l from"@heroicons/react/24/outline/PhoneIcon";import C from"@heroicons/react/24/outline/ShieldCheckIcon";import{A as c,L as d}from"./useActiveWallet-Bf9rjEyz.mjs";import{M as h,b as m,P as p}from"./ModalHeader-BjJu3vXN.mjs";import{C as u}from"./Chip-D2-wZOHJ.mjs";import{I as y,T as f,S as g,E as k,M as w,d as v,e as b,f as M,g as x,R as Z,a as j,A as L,F as E,L as I,b as S,c as P,C as T,N as A}from"./PinInput-3SLvbnQa.mjs";import R from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import W from"@heroicons/react/24/outline/ClockIcon";import{useState as F,useMemo as B}from"react";import{u as z}from"./context-BUwBcpKH.mjs";import{u as U}from"./internal-context-C4ZqP8IF.mjs";import{u as $}from"./privy-context-J4QWzKzm.mjs";import{ErrorScreenView as N}from"./ErrorScreen-DyTJlphB.mjs";import{DoubleIconWrapper as O}from"./LinkPasskeyScreen-Cb3jUPfS.mjs";import{C as D}from"./CopyToClipboard-DSTf_eKU.mjs";import{C as V}from"./Layouts-BlFm53ED.mjs";import{C as _}from"./Column-C2X2MHYX.mjs";import{L as q}from"./LabelXs-oqZNqbm_.mjs";import{S as H}from"./Subtitle-CV-2yKE4.mjs";import{T as Q}from"./Title-BnzYV3Is.mjs";import{B as Y}from"./shared-FM0rljBt.mjs";import{f as X,g as G,h as J,i as K}from"./index-B6S3lSSv.mjs";import ee from"@heroicons/react/24/solid/ShieldCheckIcon";import{Q as re}from"./QrCode-Cusp19gh.mjs";const te=t=>/*#__PURE__*/e(oe,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...t,children:[/*#__PURE__*/r("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),/*#__PURE__*/r("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let oe=o.svg`
2
2
  height: 90px;
3
3
  width: 90px;
4
4
 
@@ -1,4 +1,4 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{AlertTriangle as i,Phone as a,Lock as o}from"lucide-react";import{styled as n}from"styled-components";import{u as s}from"./context-BDvZRT56.mjs";import{a as c,P as l}from"./index-t8luNMU8.mjs";import{g as m,c as p,b as d,e as u}from"./internal-context-C4ZqP8IF.mjs";import{a as T}from"./privy-context-v-TMVBdt.mjs";import{R as g}from"./reservoir-DGil2p_K.mjs";import{S as y}from"./ScreenLayout-CHf1S-9L.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const h=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:h})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof d)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof u&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:s.errorTitle||"You don't have access to this app",detail:s.errorDetail||"Have you been invited?",ctaText:s.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,s);/*#__PURE__*/return t(y,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:h,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(h,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
1
+ import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{AlertTriangle as i,Phone as a,Lock as o}from"lucide-react";import{styled as n}from"styled-components";import{u as s}from"./context-BUwBcpKH.mjs";import{a as c,P as l}from"./index-B6S3lSSv.mjs";import{g as m,c as p,b as d,e as u}from"./internal-context-C4ZqP8IF.mjs";import{a as T}from"./privy-context-J4QWzKzm.mjs";import{R as g}from"./reservoir-DGil2p_K.mjs";import{S as y}from"./ScreenLayout-BCqpEJQ7.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const h=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:h})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof d)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof u&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:s.errorTitle||"You don't have access to this app",detail:s.errorDetail||"Have you been invited?",ctaText:s.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,s);/*#__PURE__*/return t(y,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:h,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(h,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
2
2
  color: var(--privy-color-accent) !important;
3
3
  font-weight: 600;
4
4
  `;export{f as ErrorScreen,h as ErrorScreenView,f as default};
@@ -1,4 +1,4 @@
1
- import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as a}from"react";import{isMobile as n,isIOS as s}from"react-device-detect";import{styled as l}from"styled-components";import{L as c}from"./useActiveWallet-CLfuK4Fv.mjs";import{O as d}from"./OpenLink-DZHy38vr.mjs";import{Q as m}from"./QrCode-DoSGd0gd.mjs";import{Check as p,Copy as u}from"lucide-react";import{S as h}from"./ModalHeader-BxZPF7qd.mjs";import{L as v}from"./LabelXs-oqZNqbm_.mjs";import{u as f,q as g}from"./context-BDvZRT56.mjs";import{u as y,c as b,k as w}from"./internal-context-C4ZqP8IF.mjs";import{u as x,a as C}from"./privy-context-v-TMVBdt.mjs";import{s as S}from"./shouldProceedtoEmbeddedWalletCreationFlow-eFXUIOL2.mjs";import{S as k}from"./ScreenLayout-CHf1S-9L.mjs";import{F as E}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-t8luNMU8.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";let j=l.div`
1
+ import{jsxs as e,jsx as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as a}from"react";import{isMobile as n,isIOS as s}from"react-device-detect";import{styled as l}from"styled-components";import{L as c}from"./useActiveWallet-Bf9rjEyz.mjs";import{O as d}from"./OpenLink-DZHy38vr.mjs";import{Q as m}from"./QrCode-Cusp19gh.mjs";import{Check as p,Copy as u}from"lucide-react";import{S as h}from"./ModalHeader-BjJu3vXN.mjs";import{L as v}from"./LabelXs-oqZNqbm_.mjs";import{u as f,q as g}from"./context-BUwBcpKH.mjs";import{u as y,c as b,k as w}from"./internal-context-C4ZqP8IF.mjs";import{u as x,a as C}from"./privy-context-J4QWzKzm.mjs";import{s as S}from"./shouldProceedtoEmbeddedWalletCreationFlow-JWl-fGfc.mjs";import{S as k}from"./ScreenLayout-BCqpEJQ7.mjs";import{F as E}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-B6S3lSSv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@privy-io/popup";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";let j=l.div`
2
2
  width: 100%;
3
3
  `,T=l.div`
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as a}from"react";import{isMobile as i,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-DSTf_eKU.mjs";import{L as c}from"./useActiveWallet-CLfuK4Fv.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-DoSGd0gd.mjs";import{u as d,q as u}from"./context-BDvZRT56.mjs";import{u as g}from"./internal-context-C4ZqP8IF.mjs";import{a as f}from"./privy-context-v-TMVBdt.mjs";import{S as h}from"./ScreenLayout-CHf1S-9L.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:a,errorMessage:n,connectUri:d,onBack:u,onClose:g,onOpenFarcaster:f})=>/*#__PURE__*/e(h,i||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},primaryCta:d&&f?{label:"Open Farcaster app",onClick:f}:void 0,onBack:u,onClose:g,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},onBack:u,onClose:g,watermark:!0,children:d&&i&&/*#__PURE__*/e(x,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:g,watermark:!0,children:/*#__PURE__*/t(w,{children:[/*#__PURE__*/e(j,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(S,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(b,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let x=n.div`
1
+ import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as a}from"react";import{isMobile as i,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-DSTf_eKU.mjs";import{L as c}from"./useActiveWallet-Bf9rjEyz.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-Cusp19gh.mjs";import{u as d,q as u}from"./context-BUwBcpKH.mjs";import{u as g}from"./internal-context-C4ZqP8IF.mjs";import{a as f}from"./privy-context-J4QWzKzm.mjs";import{S as h}from"./ScreenLayout-BCqpEJQ7.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:a,errorMessage:n,connectUri:d,onBack:u,onClose:g,onOpenFarcaster:f})=>/*#__PURE__*/e(h,i||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},primaryCta:d&&f?{label:"Open Farcaster app",onClick:f}:void 0,onBack:u,onClose:g,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},onBack:u,onClose:g,watermark:!0,children:d&&i&&/*#__PURE__*/e(x,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:g,watermark:!0,children:/*#__PURE__*/t(w,{children:[/*#__PURE__*/e(j,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(S,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(b,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let x=n.div`
2
2
  margin-top: 24px;
3
3
  `,w=n.div`
4
4
  display: flex;
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{a as r}from"./privy-context-v-TMVBdt.mjs";import{L as s,M as i,N as n,O as a,Q as l,T as c}from"./index-t8luNMU8.mjs";import{trigger as d}from"@privy-io/popup";import{p as u,A as m,C as p,S as h}from"./SelectSourceAsset-QWi9hDN9.mjs";import{S as g}from"./ScreenLayout-CHf1S-9L.mjs";import{XCircle as y,Check as C,AlertTriangle as v,ChevronRight as f,CreditCard as w,Wallet as A,Building as P,Smartphone as E,Landmark as b}from"lucide-react";import{styled as S}from"styled-components";import{G as _,A as x}from"./GooglePay-DA-Ff7zK.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-BDvZRT56.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const[k,L]=((e,t=750)=>{let o;return[(...r)=>{o&&clearTimeout(o),o=setTimeout((()=>{e(...r)}),t)},()=>{o&&clearTimeout(o)}]})((async(e,t)=>{s({isLoading:!0});try{let{getQuotes:o}=i(),r=await o({source:{asset:t.source.selectedAsset.toUpperCase(),amount:e},destination:{asset:t.destination.asset.toUpperCase(),chain:t.destination.chain,address:t.destination.address},environment:t.environment}),a=r.quotes??[],l=r.provider_errors,c=n(a,e);s({localQuotes:a,localSelectedQuote:a[0]??null,isLoading:!1,quotesWarning:c,quotesErrors:l??null})}catch{s({localQuotes:[],localSelectedQuote:null,quotesWarning:"provider_errors",quotesErrors:null})}})),j=e=>{s({amount:e});let{opts:t}=i();k(e,t)},q=async()=>{let{error:e,state:t,onFailure:o,onSuccess:r}=i();L(),e?o(e):"provider-success"===t.status?await r({status:"confirmed"}):"provider-confirming"===t.status?await r({status:"submitted"}):o(Error("User exited flow"))},R=async()=>{let e,t=a();if(!t)return;let o=d();if(!o)return void s({state:{status:"provider-error"},error:Error("Unable to open payment window")});s({isLoading:!0});let{opts:r,amount:n,getProviderUrl:l,getStatus:c,controller:m}=i(),p=()=>{try{o.closed||o.close()}catch{}};m.current=new AbortController;try{let s=await l({source:{asset:r.source.selectedAsset.toUpperCase(),amount:n||"0"},destination:{asset:r.destination.asset.toUpperCase(),chain:r.destination.chain,address:r.destination.address},provider:t.provider,sub_provider:t.sub_provider??void 0,payment_method:t.payment_method,redirect_url:window.location.origin});o.location.href=s.url,e=s.session_id}catch(e){return p(),void s({state:{status:"provider-error"},isLoading:!1,error:Error("Unable to start payment session")})}s({isLoading:!1}),s({state:{status:"provider-confirming"}});let h=await u({operation:()=>c({session_id:e,provider:t.provider}),until:e=>"completed"===e.status||"failed"===e.status||"cancelled"===e.status,delay:0,interval:2e3,attempts:60,signal:m.current.signal});if("aborted"!==h.status){if("max_attempts"===h.status)return p(),h.error?(console.error(h.error),void s({state:{status:"select-amount"},isLoading:!1,error:Error("Unable to check payment status. Please try again.")})):void s({state:{status:"provider-error"},error:Error("Could not confirm payment status yet.")});"completed"===h.result?.status?(p(),s({state:{status:"provider-success"}})):(p(),s({state:{status:"provider-error"},error:Error(`Transaction ${h.result?.status??"failed"}`)}))}},T=()=>{let e=l();e&&e.length>0&&s({state:{status:"select-payment-method",quotes:e}})},z=()=>{s({state:{status:"select-source-asset"}})},I=()=>{s({error:null,state:{status:"select-amount"}})},Q=e=>{s({localSelectedQuote:e,state:{status:"select-amount"}})},D=e=>{let{opts:t,amount:o}=i(),r={...t,source:{...t.source,selectedAsset:e}};s({opts:r,state:{status:"select-amount"}}),k(o,r)},U=({onClose:t})=>/*#__PURE__*/e(g,{showClose:!0,onClose:t,iconVariant:"loading",title:"Processing transaction",subtitle:"Your purchase is in progress. You can leave this screen — we’ll notify you when it’s complete.",primaryCta:{label:"Done",onClick:t},watermark:!0}),G=({onClose:t,onRetry:o})=>/*#__PURE__*/e(g,{showClose:!0,onClose:t,icon:y,iconVariant:"error",title:"Something went wrong",subtitle:"We couldn't complete your transaction. Please try again.",primaryCta:{label:"Try again",onClick:o},secondaryCta:{label:"Close",onClick:t},watermark:!0}),M=({onClose:t})=>/*#__PURE__*/e(g,{showClose:!0,onClose:t,icon:C,iconVariant:"success",title:"Transaction confirmed",subtitle:"Your purchase is processing. Funds should arrive in your wallet within a few minutes.",primaryCta:{label:"Done",onClick:t},watermark:!0});let W={CREDIT_DEBIT_CARD:"card",APPLE_PAY:"Apple Pay",GOOGLE_PAY:"Google Pay",BANK_TRANSFER:"bank deposit",ACH:"bank deposit",SEPA:"bank deposit",PIX:"PIX"},Y={CREDIT_DEBIT_CARD:/*#__PURE__*/e(w,{size:14}),APPLE_PAY:/*#__PURE__*/e(E,{size:14}),GOOGLE_PAY:/*#__PURE__*/e(E,{size:14}),BANK_TRANSFER:/*#__PURE__*/e(P,{size:14}),ACH:/*#__PURE__*/e(P,{size:14}),SEPA:/*#__PURE__*/e(P,{size:14}),PIX:/*#__PURE__*/e(A,{size:14})},B=t=>Y[t]??/*#__PURE__*/e(w,{size:14});const O=({opts:r,onClose:s,onEditSourceAsset:i,onEditPaymentMethod:n,onContinue:a,onAmountChange:l,amount:c,selectedQuote:d,quotesWarning:u,quotesErrors:h,quotesCount:y,isLoading:C})=>{/*#__PURE__*/return t(g,{showClose:!0,onClose:s,headerTitle:`Buy ${r.destination.asset.toLocaleUpperCase()}`,primaryCta:{label:"Continue",onClick:a,loading:C,disabled:!d},helpText:u?/*#__PURE__*/t(N,{children:[/*#__PURE__*/e(v,{size:16,strokeWidth:2}),/*#__PURE__*/e(F,{children:/*#__PURE__*/t(o,"amount_too_low"===u?{children:[/*#__PURE__*/e(X,{children:"Amount too low"}),/*#__PURE__*/e(H,{children:"Please choose a higher amount to continue."})]}:{children:[/*#__PURE__*/e(X,{children:"Unable to get quotes"}),/*#__PURE__*/e(H,{children:h?.[0]?.error??"Something went wrong. Please try again."})]})})]}):d&&y>1?/*#__PURE__*/t(K,{onClick:n,children:[B(d.payment_method),/*#__PURE__*/t("span",{children:["Pay with ",(w=d.payment_method,W[w]??w.replace(/_/g," ").toLowerCase().replace(/^\w/,(e=>e.toUpperCase())))]}),/*#__PURE__*/e(f,{size:14})]}):null,watermark:!0,children:[/*#__PURE__*/e(m,{currency:r.source.selectedAsset,value:c,onChange:l,inputMode:"decimal",autoFocus:!0}),/*#__PURE__*/e(p,{selectedAsset:r.source.selectedAsset,onEditSourceAsset:i})]});var w};let N=S.div`
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{a as r}from"./privy-context-J4QWzKzm.mjs";import{L as s,M as i,N as n,O as a,Q as l,T as c}from"./index-B6S3lSSv.mjs";import{trigger as d}from"@privy-io/popup";import{p as u,A as m,C as p,S as h}from"./SelectSourceAsset-ZEvKC1Ve.mjs";import{S as g}from"./ScreenLayout-BCqpEJQ7.mjs";import{XCircle as y,Check as C,AlertTriangle as v,ChevronRight as f,CreditCard as w,Wallet as A,Building as P,Smartphone as E,Landmark as b}from"lucide-react";import{styled as S}from"styled-components";import{G as _,A as x}from"./GooglePay-DA-Ff7zK.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-BUwBcpKH.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const[k,L]=((e,t=750)=>{let o;return[(...r)=>{o&&clearTimeout(o),o=setTimeout((()=>{e(...r)}),t)},()=>{o&&clearTimeout(o)}]})((async(e,t)=>{s({isLoading:!0});try{let{getQuotes:o}=i(),r=await o({source:{asset:t.source.selectedAsset.toUpperCase(),amount:e},destination:{asset:t.destination.asset.toUpperCase(),chain:t.destination.chain,address:t.destination.address},environment:t.environment}),a=r.quotes??[],l=r.provider_errors,c=n(a,e);s({localQuotes:a,localSelectedQuote:a[0]??null,isLoading:!1,quotesWarning:c,quotesErrors:l??null})}catch{s({localQuotes:[],localSelectedQuote:null,quotesWarning:"provider_errors",quotesErrors:null})}})),j=e=>{s({amount:e});let{opts:t}=i();k(e,t)},q=async()=>{let{error:e,state:t,onFailure:o,onSuccess:r}=i();L(),e?o(e):"provider-success"===t.status?await r({status:"confirmed"}):"provider-confirming"===t.status?await r({status:"submitted"}):o(Error("User exited flow"))},R=async()=>{let e,t=a();if(!t)return;let o=d();if(!o)return void s({state:{status:"provider-error"},error:Error("Unable to open payment window")});s({isLoading:!0});let{opts:r,amount:n,getProviderUrl:l,getStatus:c,controller:m}=i(),p=()=>{try{o.closed||o.close()}catch{}};m.current=new AbortController;try{let s=await l({source:{asset:r.source.selectedAsset.toUpperCase(),amount:n||"0"},destination:{asset:r.destination.asset.toUpperCase(),chain:r.destination.chain,address:r.destination.address},provider:t.provider,sub_provider:t.sub_provider??void 0,payment_method:t.payment_method,redirect_url:window.location.origin});o.location.href=s.url,e=s.session_id}catch(e){return p(),void s({state:{status:"provider-error"},isLoading:!1,error:Error("Unable to start payment session")})}s({isLoading:!1}),s({state:{status:"provider-confirming"}});let h=await u({operation:()=>c({session_id:e,provider:t.provider}),until:e=>"completed"===e.status||"failed"===e.status||"cancelled"===e.status,delay:0,interval:2e3,attempts:60,signal:m.current.signal});if("aborted"!==h.status){if("max_attempts"===h.status)return p(),h.error?(console.error(h.error),void s({state:{status:"select-amount"},isLoading:!1,error:Error("Unable to check payment status. Please try again.")})):void s({state:{status:"provider-error"},error:Error("Could not confirm payment status yet.")});"completed"===h.result?.status?(p(),s({state:{status:"provider-success"}})):(p(),s({state:{status:"provider-error"},error:Error(`Transaction ${h.result?.status??"failed"}`)}))}},T=()=>{let e=l();e&&e.length>0&&s({state:{status:"select-payment-method",quotes:e}})},z=()=>{s({state:{status:"select-source-asset"}})},I=()=>{s({error:null,state:{status:"select-amount"}})},Q=e=>{s({localSelectedQuote:e,state:{status:"select-amount"}})},D=e=>{let{opts:t,amount:o}=i(),r={...t,source:{...t.source,selectedAsset:e}};s({opts:r,state:{status:"select-amount"}}),k(o,r)},U=({onClose:t})=>/*#__PURE__*/e(g,{showClose:!0,onClose:t,iconVariant:"loading",title:"Processing transaction",subtitle:"Your purchase is in progress. You can leave this screen — we’ll notify you when it’s complete.",primaryCta:{label:"Done",onClick:t},watermark:!0}),G=({onClose:t,onRetry:o})=>/*#__PURE__*/e(g,{showClose:!0,onClose:t,icon:y,iconVariant:"error",title:"Something went wrong",subtitle:"We couldn't complete your transaction. Please try again.",primaryCta:{label:"Try again",onClick:o},secondaryCta:{label:"Close",onClick:t},watermark:!0}),M=({onClose:t})=>/*#__PURE__*/e(g,{showClose:!0,onClose:t,icon:C,iconVariant:"success",title:"Transaction confirmed",subtitle:"Your purchase is processing. Funds should arrive in your wallet within a few minutes.",primaryCta:{label:"Done",onClick:t},watermark:!0});let W={CREDIT_DEBIT_CARD:"card",APPLE_PAY:"Apple Pay",GOOGLE_PAY:"Google Pay",BANK_TRANSFER:"bank deposit",ACH:"bank deposit",SEPA:"bank deposit",PIX:"PIX"},Y={CREDIT_DEBIT_CARD:/*#__PURE__*/e(w,{size:14}),APPLE_PAY:/*#__PURE__*/e(E,{size:14}),GOOGLE_PAY:/*#__PURE__*/e(E,{size:14}),BANK_TRANSFER:/*#__PURE__*/e(P,{size:14}),ACH:/*#__PURE__*/e(P,{size:14}),SEPA:/*#__PURE__*/e(P,{size:14}),PIX:/*#__PURE__*/e(A,{size:14})},B=t=>Y[t]??/*#__PURE__*/e(w,{size:14});const O=({opts:r,onClose:s,onEditSourceAsset:i,onEditPaymentMethod:n,onContinue:a,onAmountChange:l,amount:c,selectedQuote:d,quotesWarning:u,quotesErrors:h,quotesCount:y,isLoading:C})=>{/*#__PURE__*/return t(g,{showClose:!0,onClose:s,headerTitle:`Buy ${r.destination.asset.toLocaleUpperCase()}`,primaryCta:{label:"Continue",onClick:a,loading:C,disabled:!d},helpText:u?/*#__PURE__*/t(N,{children:[/*#__PURE__*/e(v,{size:16,strokeWidth:2}),/*#__PURE__*/e(F,{children:/*#__PURE__*/t(o,"amount_too_low"===u?{children:[/*#__PURE__*/e(X,{children:"Amount too low"}),/*#__PURE__*/e(H,{children:"Please choose a higher amount to continue."})]}:{children:[/*#__PURE__*/e(X,{children:"Unable to get quotes"}),/*#__PURE__*/e(H,{children:h?.[0]?.error??"Something went wrong. Please try again."})]})})]}):d&&y>1?/*#__PURE__*/t(K,{onClick:n,children:[B(d.payment_method),/*#__PURE__*/t("span",{children:["Pay with ",(w=d.payment_method,W[w]??w.replace(/_/g," ").toLowerCase().replace(/^\w/,(e=>e.toUpperCase())))]}),/*#__PURE__*/e(f,{size:14})]}):null,watermark:!0,children:[/*#__PURE__*/e(m,{currency:r.source.selectedAsset,value:c,onChange:l,inputMode:"decimal",autoFocus:!0}),/*#__PURE__*/e(p,{selectedAsset:r.source.selectedAsset,onEditSourceAsset:i})]});var w};let N=S.div`
2
2
  display: flex;
3
3
  align-items: flex-start;
4
4
  gap: 0.5rem;
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as s}from"@privy-io/js-sdk-core";import{B as i,P as l}from"./ModalHeader-BjJu3vXN.mjs";import{b as m,c,R as d,e as u}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-C0hiX5KZ.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-Dq_xe9dz.mjs";import{L as I,V as v}from"./Value-tcJV9e0L.mjs";import{a as w,R as S}from"./Row-C9vrS4Zi.mjs";import{u as y,t as j}from"./context-BUwBcpKH.mjs";import{u as C,b as L,c as x}from"./internal-context-C4ZqP8IF.mjs";import{a as k}from"./privy-context-J4QWzKzm.mjs";import{u as F,g as U}from"./useWallets-CoHocloI.mjs";import{u as T}from"./useGetTokenPrice-BzPC_Zwu.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as b}from"@solana-program/system";import{pipe as P,createTransactionMessage as W,setTransactionMessageFeePayerSigner as D,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as O,compileTransaction as E,getTransactionEncoder as M}from"@solana/kit";import{findAssociatedTokenPda as B,getCreateAssociatedTokenIdempotentInstruction as $,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as q}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as _,f as z,s as Q,w as X}from"./useSolanaRpcClient-DeqZtFN0.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{H as J}from"./use-export-wallet-Bf21khnq.mjs";import"styled-components";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./usePrivy-BbUQp4Qe.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"@privy-io/encoding";import"./useGetSolPrice-DaxM-vxD.mjs";import"./PrivyPluginContext-2QN2dVUw.mjs";function K({rows:a}){/*#__PURE__*/return e(w,{children:a.filter((e=>!!e)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/t(S,{children:[/*#__PURE__*/e(I,{children:a.label}),/*#__PURE__*/e(v,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(e){return BigInt(Math.floor(1e9*parseFloat(e)))}function ee(e){return+te.format(parseFloat(e.toString())/1e9)}let te=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function ae({tx:e,solanaClient:t,amount:a,asset:n,tokenPrice:o}){if(!e)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:t,tx:e});return{amountInUsd:r,feeInUsd:o?V(s,o):void 0,totalInUsd:V(n+s,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:t,tx:e}),s=function(e,t){let a=parseFloat(e.toString())/G*t;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:V(r,o),totalInUsd:"$"+(parseFloat(a)+s).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:t,tx:e});return{amountInSol:a+" SOL",feeInSol:ee(o)+" SOL",totalInSol:ee(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:ee(await z({solanaClient:t,tx:e}))+" SOL"}}const ne={component:function(){let I=y(),{closePrivyModal:v,createAnalyticsEvent:w}=C(),{data:S,setModalData:G,navigate:z}=k(),{wallets:ee}=F(),[te,ne]=o("preparing"),[oe,re]=o(),[se,ie]=o(),[le,me]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ce,asset:de,chain:ue,sourceWalletData:pe,destinationAddress:fe,afterSuccessScreen:ge}=S.solanaFundingData,he=ee.find((e=>e.address===pe.address&&J(pe.walletClientType)===J(e.standardWallet.name))),Ie=_()(ue),{tokenPrice:ve,isTokenPriceLoading:we}=T("solana");return r((()=>{if("preparing"!==te||we||!he)return;let e="SOL"===de?Z(ce):function(e){return BigInt(Math.floor(1e6*parseFloat(e)))}(ce);ie({amount:("SOL"===de&&ve?V(e,ve):ce)??ce}),("SOL"===de?async function({solanaClient:e,source:t,destination:a,amountInLamports:n}){let{value:o}=await e.rpc.getLatestBlockhash().send(),r={address:t},s=P(W({version:0}),(e=>D(r,e)),(e=>N(o,e)),(e=>O(b({amount:n,source:r,destination:a}),e)),(e=>E(e)));return new Uint8Array(M().encode(s))}({solanaClient:Ie,source:he.address,destination:fe,amountInLamports:e}):async function({solanaClient:e,source:t,destination:a,amountInBaseUnits:n}){let o=q(e.chain),{value:r}=await e.rpc.getLatestBlockhash().send(),s={address:t},[i]=await B({mint:o,owner:t,tokenProgram:H}),[l]=await B({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([e.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${t}`);let d=$({payer:s,ata:l,owner:a,mint:o}),u=P(W({version:0}),(e=>D(s,e)),(e=>N(r,e)),(e=>c?.value?e:O(d,e)),(e=>O(R({source:i,destination:l,authority:s,amount:n}),e)),(e=>E(e)));return new Uint8Array(M().encode(u))}({solanaClient:Ie,source:he.address,destination:fe,amountInBaseUnits:e})).then(re).catch((e=>{ne("error"),me(e)}))}),[te,ce,de,ue,he,fe,we,ve]),r((()=>{"preparing"===te&&oe&&ae({tx:oe,solanaClient:Ie,amount:ce,asset:de,tokenPrice:ve}).then((e=>{ne("loaded"),ie({amount:e?.amountInUsd??e?.amountInUsdc??e?.amountInSol??ce,fee:e?.feeInUsd??e?.feeInSol,total:e?.totalInUsd??e?.totalInSol})})).catch((e=>{ne("error"),me(e)}))}),[oe,ce,de,te,ve]),r((()=>{"error"===te&&le&&(G({errorModalData:{error:le,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:S.solanaFundingData}),z("ErrorScreen",!1))}),[te,z]),r((()=>{if("success"!==te)return;let e=setTimeout(ge?()=>z(ge):v,j);return()=>clearTimeout(e)}),[te]),/*#__PURE__*/t(a,"success"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(m,{}),/*#__PURE__*/t(c,{children:[/*#__PURE__*/e(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/e(p,{title:"Success!",description:`You’ve successfully added ${ce} ${de} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/e(d,{}),/*#__PURE__*/e(i,{})]}:"preparing"===te||"loaded"===te||"sending"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(u,{style:{marginTop:"16px"},children:/*#__PURE__*/e(g,{icon:he?.standardWallet.icon,name:he?.standardWallet.name})}),/*#__PURE__*/e(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===te&&he?`Confirming with ${he.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/e(K,{rows:[{label:"Source",value:s(pe.address)},{label:"Destination",value:s(fe)},{label:"Network",value:Y(ue)},{label:"Amount",value:se?.amount,isLoading:"preparing"===te},{label:"Estimated fee",value:se?.fee,isLoading:"preparing"===te},{label:"Total",value:se?.total,isLoading:"preparing"===te}]}),/*#__PURE__*/e(l,{style:{marginTop:"1rem"},loading:"preparing"===te||"sending"===te,onClick:function(){"loaded"===te&&oe&&he&&(ne("sending"),async function({transaction:e,chain:t,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:e});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:e,chain:t}).catch((e=>{throw new L("Transaction was rejected by the user",e,x.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:Ie,transaction:oe,chain:ue,sourceWallet:he}).then((e=>{ne("success"),w({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:he.address,value:ce,chainType:"solana",clusterName:ue,token:de,destinationAddress:fe,destinationValue:ce,destinationChainType:"solana",destinationClusterName:ue,destinationToken:de}})})).catch((e=>{ne("error"),me(e)})))},children:"Confirm"}),/*#__PURE__*/e(i,{})]}:{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(h,{}),/*#__PURE__*/e("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/e(i,{})]})}};export{ne as FundSolWalletWithExternalSolanaWallet,ne as default};
@@ -1 +1 @@
1
- import{jsx as n}from"react/jsx-runtime";import{a as e}from"./privy-context-v-TMVBdt.mjs";import{M as a}from"./ModalHeader-BxZPF7qd.mjs";function t({title:t}){let{currentScreen:r,navigateBack:i,navigate:o,data:d,setModalData:u}=e();/*#__PURE__*/return n(a,{title:t,backFn:"ManualTransferScreen"===r?i:r===d?.funding?.methodScreen?d.funding.comingFromSendTransactionScreen?()=>o("SendTransactionScreen"):void 0:d?.funding?.methodScreen?()=>{let n=d.funding;n.usingDefaultFundingMethod&&(n.usingDefaultFundingMethod=!1),u({funding:n,solanaFundingData:d?.solanaFundingData}),o(n.methodScreen)}:void 0})}export{t};
1
+ import{jsx as n}from"react/jsx-runtime";import{a as e}from"./privy-context-J4QWzKzm.mjs";import{M as a}from"./ModalHeader-BjJu3vXN.mjs";function t({title:t}){let{currentScreen:r,navigateBack:i,navigate:o,data:d,setModalData:u}=e();/*#__PURE__*/return n(a,{title:t,backFn:"ManualTransferScreen"===r?i:r===d?.funding?.methodScreen?d.funding.comingFromSendTransactionScreen?()=>o("SendTransactionScreen"):void 0:d?.funding?.methodScreen?()=>{let n=d.funding;n.usingDefaultFundingMethod&&(n.usingDefaultFundingMethod=!1),u({funding:n,solanaFundingData:d?.solanaFundingData}),o(n.methodScreen)}:void 0})}export{t};
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useRef as s,useCallback as i}from"react";import{trigger as a}from"@privy-io/popup";import{u as n,a as c}from"./privy-context-v-TMVBdt.mjs";import{p as l,A as u,C as d,S as m}from"./SelectSourceAsset-QWi9hDN9.mjs";import{isMobile as p}from"react-device-detect";import{styled as y}from"styled-components";import{a as f}from"./CopyableText-BCytXyJL.mjs";import{J as h}from"./index-t8luNMU8.mjs";import{S as g}from"./ScreenLayout-CHf1S-9L.mjs";import{XCircle as v,Hourglass as C,UserCheck as w,Check as b}from"lucide-react";import{I as k}from"./InfoBanner-DkQEPd77.mjs";import"@privy-io/are-addresses-equal";import"./context-BDvZRT56.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"viem";import"zustand";import"eventemitter3";import"viem/utils";import"uuid";import"jose";import"./useActiveWallet-CLfuK4Fv.mjs";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-B1AsvC0i.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BxZPF7qd.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";import"@heroicons/react/24/outline/InformationCircleIcon";const j=e=>{try{return e.location.origin}catch{return}},x=({data:r,onClose:o})=>/*#__PURE__*/e(g,{showClose:!0,onClose:o,title:"Initiate bank transfer",subtitle:"Use the details below to complete a bank transfer from your bank.",primaryCta:{label:"Done",onClick:o},watermark:!1,footerText:"Exchange rates and fees are set when you authorize and determine the amount you receive. You'll see the applicable rates and fees for your transaction separately",children:/*#__PURE__*/e(A,{children:(h[r.deposit_instructions.asset]||[]).map((([o,s],i)=>{let a=r.deposit_instructions[o];if(!a||Array.isArray(a))return null;let n="asset"===o?a.toUpperCase():a,c=n.length>100?`${n.slice(0,9)}...${n.slice(-9)}`:n;/*#__PURE__*/return t(S,{children:[/*#__PURE__*/e(E,{children:s}),/*#__PURE__*/e(f,{value:n,includeChildren:p,children:/*#__PURE__*/e(U,{children:c})})]},i)}))})});let A=y.ol`
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useRef as s,useCallback as i}from"react";import{trigger as a}from"@privy-io/popup";import{u as n,a as c}from"./privy-context-J4QWzKzm.mjs";import{p as l,A as u,C as d,S as m}from"./SelectSourceAsset-ZEvKC1Ve.mjs";import{isMobile as p}from"react-device-detect";import{styled as y}from"styled-components";import{a as f}from"./CopyableText-BCytXyJL.mjs";import{J as h}from"./index-B6S3lSSv.mjs";import{S as g}from"./ScreenLayout-BCqpEJQ7.mjs";import{XCircle as v,Hourglass as C,UserCheck as w,Check as b}from"lucide-react";import{I as k}from"./InfoBanner-DkQEPd77.mjs";import"@privy-io/are-addresses-equal";import"./context-BUwBcpKH.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"viem";import"zustand";import"eventemitter3";import"viem/utils";import"uuid";import"jose";import"./useActiveWallet-Bf9rjEyz.mjs";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"./usePrivy-BbUQp4Qe.mjs";import"./paths-BzM95ysC.mjs";import"js-cookie";import"./PrivyPluginContext-2QN2dVUw.mjs";import"mipd";import"@scure/base";import"@headlessui/react";import"@privy-io/urls";import"@privy-io/ethereum";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./frame-CjhCpycO.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-BYctG7hm.mjs";import"./ModalHeader-BjJu3vXN.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";import"@heroicons/react/24/outline/InformationCircleIcon";const j=e=>{try{return e.location.origin}catch{return}},x=({data:r,onClose:o})=>/*#__PURE__*/e(g,{showClose:!0,onClose:o,title:"Initiate bank transfer",subtitle:"Use the details below to complete a bank transfer from your bank.",primaryCta:{label:"Done",onClick:o},watermark:!1,footerText:"Exchange rates and fees are set when you authorize and determine the amount you receive. You'll see the applicable rates and fees for your transaction separately",children:/*#__PURE__*/e(A,{children:(h[r.deposit_instructions.asset]||[]).map((([o,s],i)=>{let a=r.deposit_instructions[o];if(!a||Array.isArray(a))return null;let n="asset"===o?a.toUpperCase():a,c=n.length>100?`${n.slice(0,9)}...${n.slice(-9)}`:n;/*#__PURE__*/return t(S,{children:[/*#__PURE__*/e(E,{children:s}),/*#__PURE__*/e(f,{value:n,includeChildren:p,children:/*#__PURE__*/e(U,{children:c})})]},i)}))})});let A=y.ol`
2
2
  border-color: var(--privy-color-border-default);
3
3
  border-width: 1px;
4
4
  border-radius: var(--privy-border-radius-mdlg);
@@ -1 +1 @@
1
- import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-BxZPF7qd.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as a}from"./FundWalletMethodHeader-DI7zmHzS.mjs";import{N as m}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./privy-context-v-TMVBdt.mjs";import{u as p}from"./useGetTokenPrice-B5d8vo-7.mjs";import{c as d}from"./ethers-CljtMjlx.mjs";import{F as u,a as h,h as j,c as f,d as y}from"./styles-BHXHIG4L.mjs";import"styled-components";import"./context-BDvZRT56.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.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"@privy-io/are-addresses-equal";import"./useGetSolPrice-DaxM-vxD.mjs";import"./LinkPasskeyScreen-BQhZsrBK.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-CHf1S-9L.mjs";import"./Screen-Cce_5_X_.mjs";const v={component:()=>{let{data:v,setModalData:C}=l(),g=v?.funding,x="solana"===g.chainType,k=r(null),{tokenPrice:S}=p(x?"solana":g.chain.id),D=x?void 0:g,F=!(!D?.erc20Address||D?.erc20ContractInfo),T=x?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",L=parseFloat(g.amount),A=!isNaN(L)&&L>0,I=S?d(g.amount,S):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(a,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:F?/*#__PURE__*/o(m,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/o(j,{ref:k,value:g.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&C({...v,funding:{...g,amount:e},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:T})]}),!D?.erc20Address&&!(x&&g.isUSDC)&&/*#__PURE__*/o(y,{children:I&&A?`${I} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!A,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{v as FundingAmountEditScreen,v as default};
1
+ import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-BjJu3vXN.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as a}from"./FundWalletMethodHeader-C0hiX5KZ.mjs";import{N as m}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./privy-context-J4QWzKzm.mjs";import{u as p}from"./useGetTokenPrice-BzPC_Zwu.mjs";import{c as d}from"./ethers-XeIOsY27.mjs";import{F as u,a as h,h as j,c as f,d as y}from"./styles-BqPGTaeJ.mjs";import"styled-components";import"./context-BUwBcpKH.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./internal-context-C4ZqP8IF.mjs";import"ofetch";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.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"@privy-io/are-addresses-equal";import"./useGetSolPrice-DaxM-vxD.mjs";import"./LinkPasskeyScreen-Cb3jUPfS.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-BCqpEJQ7.mjs";import"./Screen-SvdZ-LWF.mjs";const v={component:()=>{let{data:v,setModalData:C}=l(),g=v?.funding,x="solana"===g.chainType,k=r(null),{tokenPrice:S}=p(x?"solana":g.chain.id),D=x?void 0:g,F=!(!D?.erc20Address||D?.erc20ContractInfo),T=x?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",L=parseFloat(g.amount),A=!isNaN(L)&&L>0,I=S?d(g.amount,S):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(a,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:F?/*#__PURE__*/o(m,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/o(j,{ref:k,value:g.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&C({...v,funding:{...g,amount:e},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:T})]}),!D?.erc20Address&&!(x&&g.isUSDC)&&/*#__PURE__*/o(y,{children:I&&A?`${I} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!A,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{v as FundingAmountEditScreen,v as default};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import o from"@heroicons/react/24/outline/QrCodeIcon";import r from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as i,useEffect as d,useMemo as s}from"react";import{getAddress as c}from"viem/utils";import{B as l}from"./ModalHeader-BxZPF7qd.mjs";import{t as m}from"./FundWalletMethodHeader-DI7zmHzS.mjs";import{E as u}from"./ErrorBanner-CQERa7bL.mjs";import{I as p}from"./InfoBanner-DkQEPd77.mjs";import{A as h,G as f}from"./GooglePay-DA-Ff7zK.mjs";import{u as g}from"./context-BDvZRT56.mjs";import{c as y,z as C,A as w}from"./useActiveWallet-CLfuK4Fv.mjs";import{b as F,u as v}from"./internal-context-C4ZqP8IF.mjs";import{a as b}from"./privy-context-v-TMVBdt.mjs";import{u as S}from"./get-entropy-details-for-user-CgVPjq_6.mjs";import{W}from"./WalletCards-DH1rqayz.mjs";import{g as I}from"./getErc20TokenInfo-PgoronUM.mjs";import{monadMainnet as M,avalanche as j,arbitrum as x,polygon as T,optimism as D,base as k,mainnet as A,toCoinbaseAssetId as E,getCoinbaseOnRampUrl as O,chainToMoonpayCurrency as U,isSupportedChainIdForMoonpay as _,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as P}from"@privy-io/popup";import{a as R}from"./index-Ch8BunPr.mjs";import{e as q,I as z,f as N,g as B}from"./styles-BHXHIG4L.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"viem";import"./use-export-wallet-C3yKuILk.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-BQhZsrBK.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-CHf1S-9L.mjs";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const G=e=>{let[n,t]=i();return d((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function H(e){let n=Q[e];if(!n)throw new F(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let Q={[A.id]:"ethereum",[k.id]:"base",[D.id]:"optimism",[T.id]:"polygon",[x.id]:"arbitrum",[j.id]:"avacchain",[M.id]:"monad"};const $=(e,n,t,a,o,r)=>new Promise((async(i,d)=>{let s=P();if(!s)return void d(Error("Unable to initialize flow"));let c="ethereum"===n.chainType?H(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?E(n.chain.id,"native-currency"):"SOL",m=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[c]}],assets:[l]}),{url:u}=O({appId:e.getAppId(),input:m,amount:n.amount,blockchain:c,asset:l,experience:r});s.location=u.toString();let p={...o?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),t({funding:p,solanaFundingData:o?.solanaFundingData,coinbaseOnrampStatus:{popup:s}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:p,solanaFundingData:o?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:m.partner_user_id,popup:s}})}),5e3),i()})),X=async(e,n,t,a,o,r,i,d)=>{let s=P();if(!s)throw Error("Unable to initialize flow");let c="ethereum"===n.chainType?U(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:m}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:d,currencyCode:c,quoteCurrencyAmount:R(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),s.location=l;let u={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1),o({moonpayStatus:{},funding:u,solanaFundingData:i?.solanaFundingData}),r("MoonpayStatusScreen"),setTimeout((()=>{o({moonpayStatus:{externalTransactionId:m},funding:u,solanaFundingData:i?.solanaFundingData})}),8e3)};let J=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const K=()=>J("https://apple.com/apple-pay"),V=()=>J("https://google.com/pay"),Y={component:()=>{let{wallets:i}=S(),{connectors:F}=v(),M=F.filter(y).flatMap((e=>e.wallets)),{navigate:j,data:x,setModalData:T}=b(),{client:D}=v(),k=g(),A=x?.funding,E=G(K),O=G(V),U="solana"===A.chainType,P=U?void 0:A,R=s((()=>((e,n,t,a,o,r)=>{let i,d,s="solana"===t.chainType,c=s?void 0:t,l=t.isUSDC?"USDC":c?.erc20Address?void 0:"native-currency",m=!!s||l&&_(Number(t.chain.id),l),u=!!s||l&&L(Number(t.chain.id),l),p=[];for(let i of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===i.method&&"coinbase"===i.provider&&u&&p.push((()=>$(n,t,a,o,r,"buy"))),"card"===i.method&&"moonpay"===i.provider&&m&&l&&p.push((()=>X(n,t,e,l,a,o,r,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&u&&(i=()=>$(n,t,a,o,r,"buy"));for(let e of r?.funding?.supportedOptions??[])"wallets"===e.method&&(d=()=>o("TransferFromWalletScreen"));return{onFundWithCard:p,onFundWithExchange:i,onFundWithWallet:d}})(k,D,A,T,j,x)),[k,D,A,x,T,j]),H=U?M.find((({address:e})=>e===A.address)):i.find((({address:e})=>c(e)===c(A.address))),Q=C(H?.walletClientType||"unknown"),J=Q?.name||"wallet",Y=H&&"privy"!==H.walletClientType?J:k.name,Z=s((()=>A.uiConfig?.landing?.title?A.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[A.uiConfig?.landing?.title,Y]);d((()=>{if(A?.defaultFundingMethod&&A.usingDefaultFundingMethod)switch(T({funding:{...A,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),A?.defaultFundingMethod){case"card":R.onFundWithCard[0]&&R.onFundWithCard[0]();break;case"exchange":R.onFundWithExchange&&R.onFundWithExchange();break;case"wallet":R.onFundWithWallet&&R.onFundWithWallet();break;case"manual":j("ManualTransferScreen")}}),[]),d((()=>{P?.erc20Address&&!P.erc20ContractInfo&&I({address:P.erc20Address,chain:P.chain,rpcConfig:k.rpcConfig,privyAppId:k.id}).then((e=>{T({...x,funding:{...P,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[P?.erc20Address,P?.chain]);let ee=!(!P?.erc20Address||P?.erc20ContractInfo);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(m,{}),/*#__PURE__*/t("h3",{children:Z}),/*#__PURE__*/e(q,{children:[A.errorMessage&&/*#__PURE__*/t(u,{theme:k.appearance.palette.colorScheme,children:A.errorMessage}),R.onFundWithCard?.[0]&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithCard[0],children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(a,{style:{width:24}})}),"Pay with card",E?/*#__PURE__*/t(h,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):O?/*#__PURE__*/t(f,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),R.onFundWithExchange&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithExchange,children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(r,{style:{width:24}})}),"Transfer from an exchange"]}),R.onFundWithWallet&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithWallet,children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(W,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/e(w,{disabled:ee,onClick:()=>j("ManualTransferScreen"),children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(o,{style:{width:24}})}),"Receive funds"]}),A?.showAlternateFundingMethod&&R.onFundWithCard?.[1]&&/*#__PURE__*/t(p,{theme:k.appearance.palette.colorScheme,children:/*#__PURE__*/e(N,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/t(B,{onClick:R.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/t(l,{})]})}};export{Y as FundingMethodSelectionScreen,Y as default};
1
+ import{jsxs as e,Fragment as n,jsx as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import o from"@heroicons/react/24/outline/QrCodeIcon";import r from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as i,useEffect as d,useMemo as s}from"react";import{getAddress as c}from"viem/utils";import{B as l}from"./ModalHeader-BjJu3vXN.mjs";import{t as m}from"./FundWalletMethodHeader-C0hiX5KZ.mjs";import{E as u}from"./ErrorBanner-CQERa7bL.mjs";import{I as p}from"./InfoBanner-DkQEPd77.mjs";import{A as h,G as f}from"./GooglePay-DA-Ff7zK.mjs";import{u as g}from"./context-BUwBcpKH.mjs";import{c as y,z as C,A as w}from"./useActiveWallet-Bf9rjEyz.mjs";import{b as F,u as v}from"./internal-context-C4ZqP8IF.mjs";import{a as b}from"./privy-context-J4QWzKzm.mjs";import{u as S}from"./get-entropy-details-for-user-CtWtyeW2.mjs";import{W}from"./WalletCards-DH1rqayz.mjs";import{g as I}from"./getErc20TokenInfo-DejTdZEb.mjs";import{monadMainnet as M,avalanche as j,arbitrum as x,polygon as T,optimism as D,base as k,mainnet as A,toCoinbaseAssetId as E,getCoinbaseOnRampUrl as O,chainToMoonpayCurrency as U,isSupportedChainIdForMoonpay as _,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as P}from"@privy-io/popup";import{a as R}from"./index-CMocHE39.mjs";import{e as q,I as z,f as N,g as B}from"./styles-BqPGTaeJ.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"viem";import"./use-export-wallet-Bf21khnq.mjs";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-Cb3jUPfS.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-BCqpEJQ7.mjs";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const G=e=>{let[n,t]=i();return d((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function H(e){let n=Q[e];if(!n)throw new F(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let Q={[A.id]:"ethereum",[k.id]:"base",[D.id]:"optimism",[T.id]:"polygon",[x.id]:"arbitrum",[j.id]:"avacchain",[M.id]:"monad"};const $=(e,n,t,a,o,r)=>new Promise((async(i,d)=>{let s=P();if(!s)return void d(Error("Unable to initialize flow"));let c="ethereum"===n.chainType?H(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?E(n.chain.id,"native-currency"):"SOL",m=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[c]}],assets:[l]}),{url:u}=O({appId:e.getAppId(),input:m,amount:n.amount,blockchain:c,asset:l,experience:r});s.location=u.toString();let p={...o?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),t({funding:p,solanaFundingData:o?.solanaFundingData,coinbaseOnrampStatus:{popup:s}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:p,solanaFundingData:o?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:m.partner_user_id,popup:s}})}),5e3),i()})),X=async(e,n,t,a,o,r,i,d)=>{let s=P();if(!s)throw Error("Unable to initialize flow");let c="ethereum"===n.chainType?U(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:m}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:d,currencyCode:c,quoteCurrencyAmount:R(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),s.location=l;let u={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(u.usingDefaultFundingMethod=!1),o({moonpayStatus:{},funding:u,solanaFundingData:i?.solanaFundingData}),r("MoonpayStatusScreen"),setTimeout((()=>{o({moonpayStatus:{externalTransactionId:m},funding:u,solanaFundingData:i?.solanaFundingData})}),8e3)};let J=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const K=()=>J("https://apple.com/apple-pay"),V=()=>J("https://google.com/pay"),Y={component:()=>{let{wallets:i}=S(),{connectors:F}=v(),M=F.filter(y).flatMap((e=>e.wallets)),{navigate:j,data:x,setModalData:T}=b(),{client:D}=v(),k=g(),A=x?.funding,E=G(K),O=G(V),U="solana"===A.chainType,P=U?void 0:A,R=s((()=>((e,n,t,a,o,r)=>{let i,d,s="solana"===t.chainType,c=s?void 0:t,l=t.isUSDC?"USDC":c?.erc20Address?void 0:"native-currency",m=!!s||l&&_(Number(t.chain.id),l),u=!!s||l&&L(Number(t.chain.id),l),p=[];for(let i of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===i.method&&"coinbase"===i.provider&&u&&p.push((()=>$(n,t,a,o,r,"buy"))),"card"===i.method&&"moonpay"===i.provider&&m&&l&&p.push((()=>X(n,t,e,l,a,o,r,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&u&&(i=()=>$(n,t,a,o,r,"buy"));for(let e of r?.funding?.supportedOptions??[])"wallets"===e.method&&(d=()=>o("TransferFromWalletScreen"));return{onFundWithCard:p,onFundWithExchange:i,onFundWithWallet:d}})(k,D,A,T,j,x)),[k,D,A,x,T,j]),H=U?M.find((({address:e})=>e===A.address)):i.find((({address:e})=>c(e)===c(A.address))),Q=C(H?.walletClientType||"unknown"),J=Q?.name||"wallet",Y=H&&"privy"!==H.walletClientType?J:k.name,Z=s((()=>A.uiConfig?.landing?.title?A.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[A.uiConfig?.landing?.title,Y]);d((()=>{if(A?.defaultFundingMethod&&A.usingDefaultFundingMethod)switch(T({funding:{...A,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),A?.defaultFundingMethod){case"card":R.onFundWithCard[0]&&R.onFundWithCard[0]();break;case"exchange":R.onFundWithExchange&&R.onFundWithExchange();break;case"wallet":R.onFundWithWallet&&R.onFundWithWallet();break;case"manual":j("ManualTransferScreen")}}),[]),d((()=>{P?.erc20Address&&!P.erc20ContractInfo&&I({address:P.erc20Address,chain:P.chain,rpcConfig:k.rpcConfig,privyAppId:k.id}).then((e=>{T({...x,funding:{...P,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[P?.erc20Address,P?.chain]);let ee=!(!P?.erc20Address||P?.erc20ContractInfo);/*#__PURE__*/return e(n,{children:[/*#__PURE__*/t(m,{}),/*#__PURE__*/t("h3",{children:Z}),/*#__PURE__*/e(q,{children:[A.errorMessage&&/*#__PURE__*/t(u,{theme:k.appearance.palette.colorScheme,children:A.errorMessage}),R.onFundWithCard?.[0]&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithCard[0],children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(a,{style:{width:24}})}),"Pay with card",E?/*#__PURE__*/t(h,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):O?/*#__PURE__*/t(f,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),R.onFundWithExchange&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithExchange,children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(r,{style:{width:24}})}),"Transfer from an exchange"]}),R.onFundWithWallet&&/*#__PURE__*/e(w,{disabled:ee,onClick:R.onFundWithWallet,children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(W,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/e(w,{disabled:ee,onClick:()=>j("ManualTransferScreen"),children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(o,{style:{width:24}})}),"Receive funds"]}),A?.showAlternateFundingMethod&&R.onFundWithCard?.[1]&&/*#__PURE__*/t(p,{theme:k.appearance.palette.colorScheme,children:/*#__PURE__*/e(N,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/t(B,{onClick:R.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/t(l,{})]})}};export{Y as FundingMethodSelectionScreen,Y as default};
@@ -1 +1 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ExternalLink as t}from"lucide-react";import{u as e}from"./internal-context-C4ZqP8IF.mjs";import{S as r}from"./ScreenLayout-CHf1S-9L.mjs";import"ofetch";import"react";import"./ModalHeader-BxZPF7qd.mjs";import"styled-components";import"./context-BDvZRT56.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CLfuK4Fv.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-C3yKuILk.mjs";import"./get-entropy-details-for-user-CgVPjq_6.mjs";import"./privy-context-v-TMVBdt.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-Cce_5_X_.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/o(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:t,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:t}=e();/*#__PURE__*/return o(i,{onClose:()=>t()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
1
+ import{jsx as o}from"react/jsx-runtime";import{ExternalLink as t}from"lucide-react";import{u as e}from"./internal-context-C4ZqP8IF.mjs";import{S as r}from"./ScreenLayout-BCqpEJQ7.mjs";import"ofetch";import"react";import"./ModalHeader-BjJu3vXN.mjs";import"styled-components";import"./context-BUwBcpKH.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-Bf9rjEyz.mjs";import"zustand";import"viem";import"viem/utils";import"./use-export-wallet-Bf21khnq.mjs";import"./get-entropy-details-for-user-CtWtyeW2.mjs";import"./privy-context-J4QWzKzm.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-SvdZ-LWF.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/o(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:t,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:t}=e();/*#__PURE__*/return o(i,{onClose:()=>t()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};