@privy-io/react-auth 3.13.0 → 3.13.1-beta-20260202140759

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 (363) hide show
  1. package/dist/cjs/AccountNotFoundScreen-DopQJydk.js +1 -0
  2. package/dist/cjs/{Address-aEAhUJFV.js → Address-C0i_Lgxz.js} +1 -1
  3. package/dist/cjs/AffirmativeConsentScreen-DrfsiAOF.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-B4F7MdmW.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-BImVaE8G.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-Bld2VoQo.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CK2PMVQH.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-mc4TfLdK.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-BHTmPSzt.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-CE2o-1QO.js → BridgeNetworkSelectionView-BTW55LDI.js} +1 -1
  11. package/dist/cjs/CaptchaScreen-C4OKrOJj.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-DuBusEzK.js +16 -0
  13. package/dist/cjs/{ConnectEmailForm-D-TxBaE5.js → ConnectEmailForm-BAtI_Su2.js} +1 -1
  14. package/dist/cjs/ConnectLedgerScreen-Cxy5kYQy.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-UHxAPPxv.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-D7hEyOkF.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-DCXEsisd.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-DK6jm19G.js → ConnectPhoneForm-IaeAlSaT.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-1cBOsYe3.js → ConnectWalletView-I7l3i_Tn.js} +1 -1
  20. package/dist/cjs/ConnectionStatusScreen-B5eG6O0t.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BHfk_dqk.js +1 -0
  22. package/dist/cjs/{CustomLandingScreenView-C879x5ia.js → CustomLandingScreenView-ZdAEwrj3.js} +1 -1
  23. package/dist/cjs/DelegatedActionsConsentScreen-LeQ6Lxpc.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-C8v4E_cj.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-B1rrh4GO.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-Cem5Ix9r.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-BpjA7HGz.js → EmbeddedWalletKeyExportScreen-C9Et_UFA.js} +3 -3
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-tJoXkQEs.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-C2wVljgA.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-CG1oHF6a.js +1 -0
  31. package/dist/cjs/{EnrollTotp-D1jQjLxQ.js → EnrollTotp-BveYXBKW.js} +1 -1
  32. package/dist/cjs/ErrorScreen-Ckke6sz3.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-JBJeeu9F.js → FarcasterConnectStatusScreen-D5ziktAq.js} +3 -3
  34. package/dist/cjs/{FarcasterSignerStatusScreen-8DplKa45.js → FarcasterSignerStatusScreen-8edRjO2Y.js} +6 -6
  35. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DJEyYpCy.js +2 -0
  36. package/dist/cjs/{FundWalletMethodHeader-CW2KubxL.js → FundWalletMethodHeader-Dyg72x32.js} +1 -1
  37. package/dist/cjs/FundingEditAmountScreen-2vgGeOzZ.js +1 -0
  38. package/dist/cjs/FundingMethodSelectionScreen-D6K2RTnb.js +1 -0
  39. package/dist/cjs/InAppBrowserLoginNotPossible-DlH26fht.js +1 -0
  40. package/dist/cjs/InstallWalletScreen-D-aty_-m.js +1 -0
  41. package/dist/cjs/LandingScreen-C3ycf-sm.js +1 -0
  42. package/dist/cjs/{LinkConflictScreen-DKkFMAqc.js → LinkConflictScreen-tpqlaHKl.js} +2 -2
  43. package/dist/cjs/LinkEmailScreen-CVJ8MM6X.js +1 -0
  44. package/dist/cjs/{LinkPasskeyScreen-D-5RrGXJ.js → LinkPasskeyScreen-BVI23any.js} +1 -1
  45. package/dist/cjs/LinkPhoneScreen-COZH83MT.js +1 -0
  46. package/dist/cjs/LoginFailedScreen-B_f3bRu3.js +1 -0
  47. package/dist/cjs/ManualTransferScreen-DCjvNWqd.js +1 -0
  48. package/dist/cjs/MfaAuthEnrollmentFlowScreen-DN4ce0UG.js +1 -0
  49. package/dist/cjs/MfaAuthVerifyFlowScreen-c-lQ_fEz.js +1 -0
  50. package/dist/cjs/MfaEnrollmentFlowScreen-B6-EB6WE.js +1 -0
  51. package/dist/cjs/MfaVerifyFlowScreen-zbdZQoq2.js +1 -0
  52. package/dist/cjs/{ModalHeader-DmWqn83H.js → ModalHeader-Cy6QK4_e.js} +1 -1
  53. package/dist/cjs/MoonpayStatusScreen-BEtRocSA.js +16 -0
  54. package/dist/cjs/OAuthStatusScreen-FvgZmHXu.js +1 -0
  55. package/dist/cjs/PasskeySelectSignupOrLogin-DqSfSR6i.js +1 -0
  56. package/dist/cjs/PasskeyStatusScreen-DvA6G4hk.js +3 -0
  57. package/dist/cjs/PasswordRecoveryScreen-Befeqrad.js +20 -0
  58. package/dist/cjs/{QrCode-BG2PX4HL.js → QrCode-DuBadwvo.js} +1 -1
  59. package/dist/cjs/RecoveryOAuthStatusScreen-C6mVwtQH.js +1 -0
  60. package/dist/cjs/RecoveryPasswordCreateScreen-DzNiXRjH.js +1 -0
  61. package/dist/cjs/{RecoverySelectionScreen-qP99_3WR.js → RecoverySelectionScreen-CjnlE9el.js} +2 -2
  62. package/dist/cjs/{Screen-BnWlRqz4.js → Screen-edUQX_SB.js} +1 -1
  63. package/dist/cjs/{ScreenLayout-8Ho-PwHJ.js → ScreenLayout-DGTvokS8.js} +1 -1
  64. package/dist/cjs/{SetAutomaticRecoveryScreen-Dw8eXtFM.js → SetAutomaticRecoveryScreen-CrRjNWxq.js} +2 -2
  65. package/dist/cjs/{SetWalletPasswordForm-BtxQiQCF.js → SetWalletPasswordForm-DJeemCn9.js} +1 -1
  66. package/dist/cjs/SignRequestScreen-DHoZ6sz5.js +26 -0
  67. package/dist/cjs/{StandardSignAndSendTransactionScreen-BRCG_Otm.js → StandardSignAndSendTransactionScreen-CBLYn4pf.js} +1 -1
  68. package/dist/cjs/TelegramAuthScreen-D7mlDw-E.js +1 -0
  69. package/dist/cjs/{TransactionDetails-CB_SFjYb.js → TransactionDetails-CXgPk3J1.js} +1 -1
  70. package/dist/cjs/{TransactionErrorView-C6AwpMpC.js → TransactionErrorView-Deibl2Uf.js} +1 -1
  71. package/dist/cjs/{TransferFromWalletScreen-DDbM2aZ-.js → TransferFromWalletScreen-DSItFmOL.js} +2 -2
  72. package/dist/cjs/{TransferOrBridgeLoadingScreen-BdFZ-kHB.js → TransferOrBridgeLoadingScreen-CZY4tSPW.js} +1 -1
  73. package/dist/cjs/UpdateEmailScreen-Bcbi12kY.js +1 -0
  74. package/dist/cjs/UpdatePhoneScreen-lJE1r_mk.js +1 -0
  75. package/dist/cjs/UserLimitReachedScreen-CKsbmhwX.js +1 -0
  76. package/dist/cjs/{WalletInfoCard-BP4plvST.js → WalletInfoCard-BPFjUGT5.js} +1 -1
  77. package/dist/cjs/WalletInterstitialScreen-C-wi9rZH.js +1 -0
  78. package/dist/cjs/{WalletLink-Be-wt7BS.js → WalletLink-DQka9Syl.js} +1 -1
  79. package/dist/cjs/{WalletOverflowButton-DNXb1rWu.js → WalletOverflowButton-CT3ToLGt.js} +1 -1
  80. package/dist/cjs/abstract-smart-wallets.js +1 -1
  81. package/dist/cjs/{context-B5x3dsBc.js → context-BgcJR59W.js} +1 -1
  82. package/dist/cjs/{ethers-CcPcMmj-.js → ethers-CUHJ8mll.js} +1 -1
  83. package/dist/cjs/extended-chains.js +1 -1
  84. package/dist/cjs/get-entropy-details-for-user-Bh25VOwU.js +1 -0
  85. package/dist/cjs/{get-is-unified-wallet-huyBqM6I.js → get-is-unified-wallet-pvisKZtt.js} +1 -1
  86. package/dist/cjs/{index-C9h5dbsX.js → index-BgLmUrL3.js} +1 -1
  87. package/dist/cjs/index-C40Nmmja.js +174 -0
  88. package/dist/cjs/{index-Ddh08VH6.js → index-Y7m6JUJT.js} +1 -1
  89. package/dist/cjs/index.js +1 -1
  90. package/dist/cjs/internal.js +1 -1
  91. package/dist/cjs/{shared-B4PQQyG9.js → shared-BrkTXSb9.js} +1 -1
  92. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-Cwmd9p6v.js → shouldProceedtoEmbeddedWalletCreationFlow-ClGopOFu.js} +1 -1
  93. package/dist/cjs/smart-wallets-DhMgsCrP.js +1 -0
  94. package/dist/cjs/smart-wallets.js +1 -1
  95. package/dist/cjs/solana.js +1 -1
  96. package/dist/cjs/{styles-BYA0sdA8.js → styles-Dg1gwPet.js} +1 -1
  97. package/dist/cjs/{to-ui-error-kjcnhSmN.js → to-ui-error-Cj4nmAIy.js} +1 -1
  98. package/dist/cjs/ui.js +1 -1
  99. package/dist/cjs/use-export-wallet-BHqL5lkN.js +1 -0
  100. package/dist/cjs/use-export-wallet-CHdfox2p.js +1 -0
  101. package/dist/cjs/useActiveWallet-DQaSSN2M.js +185 -0
  102. package/dist/cjs/{useGetTokenPrice-XbJ2xnl_.js → useGetTokenPrice-Q-LRDLGC.js} +1 -1
  103. package/dist/cjs/{useI18n-CJec5B3S.js → useI18n-C-2tQwPP.js} +1 -1
  104. package/dist/cjs/usePrivy-DN8Ajdzm.js +1 -0
  105. package/dist/cjs/{useSolanaRpcClient-CN7MyWq4.js → useSolanaRpcClient-DAhvriV9.js} +1 -1
  106. package/dist/cjs/useWallets-DOb8xzgz.js +1 -0
  107. package/dist/dts/{events-context-CV9PiG6M.d.ts → events-context-uQF86xPo.d.mts} +1 -1
  108. package/dist/dts/{events-context-CV9PiG6M.d.mts → events-context-uQF86xPo.d.ts} +1 -1
  109. package/dist/dts/extended-chains.d.mts +1 -1
  110. package/dist/dts/extended-chains.d.ts +1 -1
  111. package/dist/dts/farcaster.d.mts +1 -1
  112. package/dist/dts/farcaster.d.ts +1 -1
  113. package/dist/dts/index.d.mts +4 -38
  114. package/dist/dts/index.d.ts +4 -38
  115. package/dist/dts/internal.d.mts +1 -1
  116. package/dist/dts/internal.d.ts +1 -1
  117. package/dist/dts/smart-wallets.d.mts +1 -1
  118. package/dist/dts/smart-wallets.d.ts +1 -1
  119. package/dist/dts/solana.d.mts +3 -3
  120. package/dist/dts/solana.d.ts +3 -3
  121. package/dist/dts/{types-xIUh0rN4.d.mts → types-DLEfLPEB.d.mts} +1 -1
  122. package/dist/dts/{types-xIUh0rN4.d.ts → types-DLEfLPEB.d.ts} +1 -1
  123. package/dist/dts/ui.d.mts +1 -1
  124. package/dist/dts/ui.d.ts +1 -1
  125. package/dist/esm/AccountNotFoundScreen-CVBAv1Mv.mjs +1 -0
  126. package/dist/esm/{Address-BuCMjci7.mjs → Address-BupZf8Rc.mjs} +1 -1
  127. package/dist/esm/AffirmativeConsentScreen-CFSY5nE4.mjs +6 -0
  128. package/dist/esm/AllowlistRejectionScreen-0Z0EYviP.mjs +1 -0
  129. package/dist/esm/AuthenticateWithWalletScreen-BdJYQ2JJ.mjs +1 -0
  130. package/dist/esm/AwaitingEvmToSolBridgingScreen-D9Ef3Dnt.mjs +2 -0
  131. package/dist/esm/AwaitingExternalEthereumTransferScreen-mj07gSaD.mjs +2 -0
  132. package/dist/esm/AwaitingPasswordlessCodeScreen-DE3g9VwQ.mjs +103 -0
  133. package/dist/esm/AwaitingSolToEvmBridgingScreen-CUKh2oVG.mjs +2 -0
  134. package/dist/esm/{BridgeNetworkSelectionView-0VRZoDMv.mjs → BridgeNetworkSelectionView-D8aRUIg2.mjs} +1 -1
  135. package/dist/esm/CaptchaScreen-Co8CjcuQ.mjs +1 -0
  136. package/dist/esm/CoinbaseOnrampStatusScreen-Da7VjKBi.mjs +16 -0
  137. package/dist/esm/ConnectEmailForm-D5UhENmm.mjs +3 -0
  138. package/dist/esm/ConnectLedgerScreen-JDfzYq9M.mjs +9 -0
  139. package/dist/esm/ConnectOnlyLandingScreen-C0j3-tOW.mjs +1 -0
  140. package/dist/esm/ConnectOnlyStatusScreen-D-gYePr8.mjs +1 -0
  141. package/dist/esm/ConnectOrCreateScreen-CqLbK7av.mjs +1 -0
  142. package/dist/esm/{ConnectPhoneForm-DMcfvHG9.mjs → ConnectPhoneForm-CQJPasTi.mjs} +1 -1
  143. package/dist/esm/{ConnectWalletView-rtAY2uds.mjs → ConnectWalletView-mIrd9fmT.mjs} +3 -3
  144. package/dist/esm/ConnectionStatusScreen-D8G_flGR.mjs +7 -0
  145. package/dist/esm/CrossAppAuthScreen-Btm1d-iO.mjs +1 -0
  146. package/dist/esm/{CustomLandingScreenView-Dt4TEi0A.mjs → CustomLandingScreenView-C2TNxHAb.mjs} +1 -1
  147. package/dist/esm/DelegatedActionsConsentScreen-DXwSOiLw.mjs +1 -0
  148. package/dist/esm/DelegatedActionsRevokeScreen-B7uTGw9J.mjs +1 -0
  149. package/dist/esm/EmbeddedWalletConnectingScreen-BioR068C.mjs +1 -0
  150. package/dist/esm/EmbeddedWalletCreatedScreen-Cq1thot_.mjs +1 -0
  151. package/dist/esm/{EmbeddedWalletKeyExportScreen-sjrAvCm3.mjs → EmbeddedWalletKeyExportScreen-CtEY8G7E.mjs} +2 -2
  152. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-ShyQ92Jq.mjs +1 -0
  153. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-qoWRlbPz.mjs +1 -0
  154. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BeN-dpqi.mjs +1 -0
  155. package/dist/esm/{EnrollTotp-DlnMoeNk.mjs → EnrollTotp-3j3Uj3wv.mjs} +1 -1
  156. package/dist/esm/ErrorScreen-BpG9IyOu.mjs +4 -0
  157. package/dist/esm/{FarcasterConnectStatusScreen-BLgCDUxR.mjs → FarcasterConnectStatusScreen-DadPWt5w.mjs} +4 -4
  158. package/dist/esm/FarcasterSignerStatusScreen-DyJNx88F.mjs +28 -0
  159. package/dist/esm/FundSolWalletWithExternalSolanaWallet-Dhp2jhkc.mjs +1 -0
  160. package/dist/esm/{FundWalletMethodHeader-Dujd1j7J.mjs → FundWalletMethodHeader-Cyn7MCWO.mjs} +1 -1
  161. package/dist/esm/FundingEditAmountScreen-D0KCT7EC.mjs +1 -0
  162. package/dist/esm/FundingMethodSelectionScreen-CrHLwmNP.mjs +1 -0
  163. package/dist/esm/InAppBrowserLoginNotPossible-CcbdJWpW.mjs +1 -0
  164. package/dist/esm/InstallWalletScreen-0udkV09c.mjs +1 -0
  165. package/dist/esm/LandingScreen-C7xCusAZ.mjs +1 -0
  166. package/dist/esm/{LinkConflictScreen-DOsLOvpT.mjs → LinkConflictScreen-B31exGN7.mjs} +4 -4
  167. package/dist/esm/LinkEmailScreen-DZf6HS1n.mjs +1 -0
  168. package/dist/esm/{LinkPasskeyScreen-jzRj6Yq0.mjs → LinkPasskeyScreen-Bl7uzJ8Q.mjs} +7 -7
  169. package/dist/esm/LinkPhoneScreen-DUIIaqp0.mjs +1 -0
  170. package/dist/esm/LoginFailedScreen-DsSbXSXA.mjs +1 -0
  171. package/dist/esm/ManualTransferScreen-B-Kkarxd.mjs +1 -0
  172. package/dist/esm/MfaAuthEnrollmentFlowScreen-D82inQR9.mjs +1 -0
  173. package/dist/esm/MfaAuthVerifyFlowScreen-Cw5rWozq.mjs +1 -0
  174. package/dist/esm/MfaEnrollmentFlowScreen-B3F6HEAl.mjs +1 -0
  175. package/dist/esm/MfaVerifyFlowScreen-DYuvXWXh.mjs +1 -0
  176. package/dist/esm/{ModalHeader-CSfzkWxZ.mjs → ModalHeader-Byy3j4Lh.mjs} +1 -1
  177. package/dist/esm/MoonpayStatusScreen-CBtEX6lf.mjs +16 -0
  178. package/dist/esm/OAuthStatusScreen-YCUnttYA.mjs +1 -0
  179. package/dist/esm/PasskeySelectSignupOrLogin-DuXG4uXH.mjs +1 -0
  180. package/dist/esm/PasskeyStatusScreen-DPvVVoC2.mjs +3 -0
  181. package/dist/esm/PasswordRecoveryScreen-IS0ckI65.mjs +20 -0
  182. package/dist/esm/{QrCode-BkoTqsec.mjs → QrCode-lPYtXNC_.mjs} +1 -1
  183. package/dist/esm/RecoveryOAuthStatusScreen-CJO3irqx.mjs +1 -0
  184. package/dist/esm/RecoveryPasswordCreateScreen-DZb7gDAd.mjs +1 -0
  185. package/dist/esm/{RecoverySelectionScreen-0YIfrkiv.mjs → RecoverySelectionScreen-CThvVB-J.mjs} +2 -2
  186. package/dist/esm/{Screen-5StC6JLQ.mjs → Screen-Ct4Lyoaf.mjs} +1 -1
  187. package/dist/esm/{ScreenLayout-C2Le_YIv.mjs → ScreenLayout-DOt2sB2J.mjs} +1 -1
  188. package/dist/esm/{SetAutomaticRecoveryScreen-BAAv--Sk.mjs → SetAutomaticRecoveryScreen-D1IKpF6a.mjs} +2 -2
  189. package/dist/esm/{SetWalletPasswordForm-lzuYpBex.mjs → SetWalletPasswordForm-CiQmt-HX.mjs} +1 -1
  190. package/dist/esm/{SignRequestScreen-YrG-iwWX.mjs → SignRequestScreen-DKJky_Un.mjs} +2 -2
  191. package/dist/esm/{StandardSignAndSendTransactionScreen-Csw3bRQ4.mjs → StandardSignAndSendTransactionScreen-CPKZQMPj.mjs} +2 -2
  192. package/dist/esm/TelegramAuthScreen-bIm5jFOU.mjs +1 -0
  193. package/dist/esm/{TransactionDetails-BMVu0qlz.mjs → TransactionDetails-DLLlKhs7.mjs} +1 -1
  194. package/dist/esm/{TransactionErrorView-C6AZ1RC0.mjs → TransactionErrorView-CSRxuGt5.mjs} +1 -1
  195. package/dist/esm/{TransferFromWalletScreen-BOOq-OqM.mjs → TransferFromWalletScreen-ClNSdttH.mjs} +4 -4
  196. package/dist/esm/{TransferOrBridgeLoadingScreen-gM_oel5i.mjs → TransferOrBridgeLoadingScreen-rWz1yK-a.mjs} +1 -1
  197. package/dist/esm/UpdateEmailScreen-mog8U9Vt.mjs +1 -0
  198. package/dist/esm/UpdatePhoneScreen-CLLjzpN7.mjs +1 -0
  199. package/dist/esm/UserLimitReachedScreen-Baf8QzFD.mjs +1 -0
  200. package/dist/esm/{WalletInfoCard-TfOxho0A.mjs → WalletInfoCard-BWAC4Crm.mjs} +1 -1
  201. package/dist/esm/WalletInterstitialScreen-chmHYyvD.mjs +1 -0
  202. package/dist/esm/{WalletLink-CZTmkBKu.mjs → WalletLink-cm_UqBHl.mjs} +1 -1
  203. package/dist/esm/{WalletOverflowButton-C0Ysaik4.mjs → WalletOverflowButton-CoHTrzr-.mjs} +1 -1
  204. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  205. package/dist/esm/context-BEE1GR3p.mjs +1 -0
  206. package/dist/esm/{ethers-DrSqg5wi.mjs → ethers-CzVYf1X2.mjs} +1 -1
  207. package/dist/esm/extended-chains.mjs +1 -1
  208. package/dist/esm/farcaster.mjs +1 -1
  209. package/dist/esm/{frame-uzTmvtww.mjs → frame-CjhCpycO.mjs} +1 -1
  210. package/dist/esm/get-entropy-details-for-user-DXl-F6zT.mjs +1 -0
  211. package/dist/esm/{get-is-unified-wallet-GcvxyU9r.mjs → get-is-unified-wallet-szLxUazm.mjs} +1 -1
  212. package/dist/esm/{getErc20Balance-D0MGUaOw.mjs → getErc20Balance-Bs6MYMo9.mjs} +1 -1
  213. package/dist/esm/{getErc20TokenInfo-CZJTqd4c.mjs → getErc20TokenInfo-Cymy79Tp.mjs} +1 -1
  214. package/dist/esm/{getPublicClient-B4uPLKn-.mjs → getPublicClient-BltMpU4i.mjs} +1 -1
  215. package/dist/esm/{index-BXKPenEy.mjs → index-21Khs68W.mjs} +1 -1
  216. package/dist/esm/index-BXdEd5-h.mjs +174 -0
  217. package/dist/esm/{index-tsoVOGEt.mjs → index-CXuTLe54.mjs} +1 -1
  218. package/dist/esm/index.mjs +1 -1
  219. package/dist/esm/{internal-context-Z-fyxadS.mjs → internal-context-C4ZqP8IF.mjs} +1 -1
  220. package/dist/esm/internal.mjs +1 -1
  221. package/dist/esm/{paths-3HW55qZg.mjs → paths-BzM95ysC.mjs} +1 -1
  222. package/dist/esm/reservoir-CB32KXxK.mjs +1 -0
  223. package/dist/esm/{shared-CQ6jg1BO.mjs → shared-CcT7geMr.mjs} +1 -1
  224. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs → shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs} +1 -1
  225. package/dist/esm/smart-wallets-CHETrkmZ.mjs +1 -0
  226. package/dist/esm/smart-wallets.mjs +1 -1
  227. package/dist/esm/solana.mjs +1 -1
  228. package/dist/esm/{styles-C3H3yhVT.mjs → styles-CVcwbZBK.mjs} +1 -1
  229. package/dist/esm/{to-ui-error-fYkDcQhz.mjs → to-ui-error-CymSkIi1.mjs} +2 -2
  230. package/dist/esm/ui.mjs +1 -1
  231. package/dist/esm/use-export-wallet-BghmI1bY.mjs +1 -0
  232. package/dist/esm/use-export-wallet-DmJRcrg3.mjs +1 -0
  233. package/dist/esm/{use-sign-with-user-signer-Do5Oi_rb.mjs → use-sign-with-user-signer-BYctG7hm.mjs} +1 -1
  234. package/dist/esm/useActiveWallet-CeJ_zia0.mjs +185 -0
  235. package/dist/esm/{useGetSolPrice-DwwjjGbd.mjs → useGetSolPrice-DaxM-vxD.mjs} +1 -1
  236. package/dist/esm/{useGetTokenPrice-YObgUU6L.mjs → useGetTokenPrice-BS8CeRfC.mjs} +1 -1
  237. package/dist/esm/{useI18n-VPW2SjZN.mjs → useI18n-BWqAKjsd.mjs} +1 -1
  238. package/dist/esm/usePrivy-DZkUhG2n.mjs +1 -0
  239. package/dist/esm/{useSolanaRpcClient-BTAchFxj.mjs → useSolanaRpcClient-D-Ekw787.mjs} +1 -1
  240. package/dist/esm/{useWalletBalance-BDrbQBDX.mjs → useWalletBalance-CCG99ZD8.mjs} +1 -1
  241. package/dist/esm/useWallets-CaOutpwQ.mjs +1 -0
  242. package/package.json +1 -1
  243. package/dist/cjs/AccountNotFoundScreen-DxO5LvIc.js +0 -1
  244. package/dist/cjs/AffirmativeConsentScreen-DfJW4zFz.js +0 -6
  245. package/dist/cjs/AllowlistRejectionScreen-CP01TiLV.js +0 -1
  246. package/dist/cjs/AuthenticateWithWalletScreen-CQw1iHsK.js +0 -1
  247. package/dist/cjs/AwaitingEvmToSolBridgingScreen-BzcvlEoa.js +0 -2
  248. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CF8PGODY.js +0 -2
  249. package/dist/cjs/AwaitingPasswordlessCodeScreen-BByZHkHQ.js +0 -103
  250. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DcalXeu-.js +0 -2
  251. package/dist/cjs/CaptchaScreen-anNodbfx.js +0 -1
  252. package/dist/cjs/CoinbaseOnrampStatusScreen-JGw8hfLn.js +0 -16
  253. package/dist/cjs/ConnectLedgerScreen-CwS0odD_.js +0 -9
  254. package/dist/cjs/ConnectOnlyLandingScreen-fpFbLO8Y.js +0 -1
  255. package/dist/cjs/ConnectOnlyStatusScreen-DziODgdH.js +0 -1
  256. package/dist/cjs/ConnectOrCreateScreen-D-V8KzJp.js +0 -1
  257. package/dist/cjs/ConnectionStatusScreen-D4NtHDFM.js +0 -7
  258. package/dist/cjs/CrossAppAuthScreen-BtEXDc88.js +0 -1
  259. package/dist/cjs/DelegatedActionsConsentScreen-CGnSYhkE.js +0 -1
  260. package/dist/cjs/DelegatedActionsRevokeScreen-Dd8u3U62.js +0 -1
  261. package/dist/cjs/EmbeddedWalletConnectingScreen-yIHjjIR2.js +0 -1
  262. package/dist/cjs/EmbeddedWalletCreatedScreen-CouqreWe.js +0 -1
  263. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-Cv8bAxPB.js +0 -1
  264. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-roXY9Gv8.js +0 -1
  265. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-9I5OZ38V.js +0 -1
  266. package/dist/cjs/ErrorScreen-DbETfzK4.js +0 -4
  267. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-CE1VdpiY.js +0 -2
  268. package/dist/cjs/FundingEditAmountScreen-Cjzgv7Q-.js +0 -1
  269. package/dist/cjs/FundingMethodSelectionScreen-Bje3JXwS.js +0 -1
  270. package/dist/cjs/InAppBrowserLoginNotPossible-DpFXJi29.js +0 -1
  271. package/dist/cjs/InstallWalletScreen-DP80Lixb.js +0 -1
  272. package/dist/cjs/LandingScreen-B_s7VUcj.js +0 -1
  273. package/dist/cjs/LinkEmailScreen-POTKFhXp.js +0 -1
  274. package/dist/cjs/LinkPhoneScreen-RWN6_lR0.js +0 -1
  275. package/dist/cjs/LoginFailedScreen-BGq1l-h2.js +0 -1
  276. package/dist/cjs/ManualTransferScreen-S07FPGso.js +0 -1
  277. package/dist/cjs/MfaAuthEnrollmentFlowScreen-Bnb9xLgu.js +0 -1
  278. package/dist/cjs/MfaAuthVerifyFlowScreen-Bn7NxwbP.js +0 -1
  279. package/dist/cjs/MfaEnrollmentFlowScreen-DixH-nyJ.js +0 -1
  280. package/dist/cjs/MfaVerifyFlowScreen-BtjZAo_J.js +0 -1
  281. package/dist/cjs/MoonpayStatusScreen-BAgiyXOW.js +0 -16
  282. package/dist/cjs/OAuthStatusScreen-RWYIpAEG.js +0 -1
  283. package/dist/cjs/PasskeySelectSignupOrLogin-DvUcmWfj.js +0 -1
  284. package/dist/cjs/PasskeyStatusScreen-CpL_C3--.js +0 -3
  285. package/dist/cjs/PasswordRecoveryScreen-FcFRBHq1.js +0 -20
  286. package/dist/cjs/RecoveryOAuthStatusScreen-AV5BAFgZ.js +0 -1
  287. package/dist/cjs/RecoveryPasswordCreateScreen-CvtuH2mp.js +0 -1
  288. package/dist/cjs/SignRequestScreen-B5xPIK1u.js +0 -26
  289. package/dist/cjs/TelegramAuthScreen-CjTMUNYb.js +0 -1
  290. package/dist/cjs/UpdateEmailScreen-BvzkGAlB.js +0 -1
  291. package/dist/cjs/UpdatePhoneScreen-e8rAhVvP.js +0 -1
  292. package/dist/cjs/UserLimitReachedScreen-x5P5FX13.js +0 -1
  293. package/dist/cjs/WalletInterstitialScreen-DrApzB6o.js +0 -1
  294. package/dist/cjs/index-BZqehL-Z.js +0 -174
  295. package/dist/cjs/smart-wallets-xoXme78U.js +0 -1
  296. package/dist/cjs/use-export-wallet-1gw5h-6F.js +0 -1
  297. package/dist/cjs/use-export-wallet-CedJPqOx.js +0 -1
  298. package/dist/cjs/useActiveWallet-4V55N-5C.js +0 -185
  299. package/dist/cjs/usePrivy-Tr-VZh0x.js +0 -1
  300. package/dist/cjs/useWallets-By_aiK-e.js +0 -1
  301. package/dist/cjs/useWallets-Ds2FjLWj.js +0 -1
  302. package/dist/esm/AccountNotFoundScreen-DvDKQEeR.mjs +0 -1
  303. package/dist/esm/AffirmativeConsentScreen-DmjKmR3p.mjs +0 -6
  304. package/dist/esm/AllowlistRejectionScreen-Dzgqqss9.mjs +0 -1
  305. package/dist/esm/AuthenticateWithWalletScreen-DqEYmKRq.mjs +0 -1
  306. package/dist/esm/AwaitingEvmToSolBridgingScreen-mM0yFabb.mjs +0 -2
  307. package/dist/esm/AwaitingExternalEthereumTransferScreen-B8RwfC4k.mjs +0 -2
  308. package/dist/esm/AwaitingPasswordlessCodeScreen-DiwMdkl1.mjs +0 -103
  309. package/dist/esm/AwaitingSolToEvmBridgingScreen-DDjqJpxK.mjs +0 -2
  310. package/dist/esm/CaptchaScreen-DRpV5XFL.mjs +0 -1
  311. package/dist/esm/CoinbaseOnrampStatusScreen-B5SpiCFR.mjs +0 -16
  312. package/dist/esm/ConnectEmailForm-CUfcb4US.mjs +0 -3
  313. package/dist/esm/ConnectLedgerScreen-D54DrxnP.mjs +0 -9
  314. package/dist/esm/ConnectOnlyLandingScreen-Cm10LiWd.mjs +0 -1
  315. package/dist/esm/ConnectOnlyStatusScreen-Bz7rafsR.mjs +0 -1
  316. package/dist/esm/ConnectOrCreateScreen-aeQK2RJ_.mjs +0 -1
  317. package/dist/esm/ConnectionStatusScreen-_g1A1Dg2.mjs +0 -7
  318. package/dist/esm/CrossAppAuthScreen-4oQDzYzy.mjs +0 -1
  319. package/dist/esm/DelegatedActionsConsentScreen-Cj9bU7Q1.mjs +0 -1
  320. package/dist/esm/DelegatedActionsRevokeScreen-DGFRARuM.mjs +0 -1
  321. package/dist/esm/EmbeddedWalletConnectingScreen-Cmt8I8TX.mjs +0 -1
  322. package/dist/esm/EmbeddedWalletCreatedScreen-Dj_JuLO5.mjs +0 -1
  323. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-BOS_pyDI.mjs +0 -1
  324. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-DulDjFpp.mjs +0 -1
  325. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BkwyRHPS.mjs +0 -1
  326. package/dist/esm/ErrorScreen-8UMMZ6is.mjs +0 -4
  327. package/dist/esm/FarcasterSignerStatusScreen-RHH68QtJ.mjs +0 -28
  328. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DVgX3EaM.mjs +0 -1
  329. package/dist/esm/FundingEditAmountScreen-D10JPLdP.mjs +0 -1
  330. package/dist/esm/FundingMethodSelectionScreen-BuWGEgge.mjs +0 -1
  331. package/dist/esm/InAppBrowserLoginNotPossible-TigdvlfS.mjs +0 -1
  332. package/dist/esm/InstallWalletScreen-DgyXxk_4.mjs +0 -1
  333. package/dist/esm/LandingScreen-C6rQCvI5.mjs +0 -1
  334. package/dist/esm/LinkEmailScreen-C7CpFuoA.mjs +0 -1
  335. package/dist/esm/LinkPhoneScreen-BKHv_Kdp.mjs +0 -1
  336. package/dist/esm/LoginFailedScreen-CJgWFc1S.mjs +0 -1
  337. package/dist/esm/ManualTransferScreen-CFNzuajf.mjs +0 -1
  338. package/dist/esm/MfaAuthEnrollmentFlowScreen-DflCQFD5.mjs +0 -1
  339. package/dist/esm/MfaAuthVerifyFlowScreen-D0KWDrSF.mjs +0 -1
  340. package/dist/esm/MfaEnrollmentFlowScreen-B5CTxsyW.mjs +0 -1
  341. package/dist/esm/MfaVerifyFlowScreen-Bds0d6wr.mjs +0 -1
  342. package/dist/esm/MoonpayStatusScreen-BgCvITlM.mjs +0 -16
  343. package/dist/esm/OAuthStatusScreen-B9LjQopq.mjs +0 -1
  344. package/dist/esm/PasskeySelectSignupOrLogin-BH-9DnYX.mjs +0 -1
  345. package/dist/esm/PasskeyStatusScreen-B0BMf34N.mjs +0 -3
  346. package/dist/esm/PasswordRecoveryScreen-BGO3xmU6.mjs +0 -20
  347. package/dist/esm/RecoveryOAuthStatusScreen-9ngTLe_q.mjs +0 -1
  348. package/dist/esm/RecoveryPasswordCreateScreen-BDCDfQzo.mjs +0 -1
  349. package/dist/esm/TelegramAuthScreen-CXnXpJTY.mjs +0 -1
  350. package/dist/esm/UpdateEmailScreen-B4u7SqtR.mjs +0 -1
  351. package/dist/esm/UpdatePhoneScreen-Dz75pT5l.mjs +0 -1
  352. package/dist/esm/UserLimitReachedScreen-BEQAxJvA.mjs +0 -1
  353. package/dist/esm/WalletInterstitialScreen-jHLFeLvC.mjs +0 -1
  354. package/dist/esm/context-bWeWAiND.mjs +0 -1
  355. package/dist/esm/index-DEtvMjrv.mjs +0 -174
  356. package/dist/esm/reservoir-0wfhnc0j.mjs +0 -1
  357. package/dist/esm/smart-wallets-wzmiQDh1.mjs +0 -1
  358. package/dist/esm/use-export-wallet-8amsQKG9.mjs +0 -1
  359. package/dist/esm/use-export-wallet-DyNNbsJn.mjs +0 -1
  360. package/dist/esm/useActiveWallet-CSq3KvGj.mjs +0 -185
  361. package/dist/esm/usePrivy-CvOp4eQ7.mjs +0 -1
  362. package/dist/esm/useWallets-izyyA2re.mjs +0 -1
  363. package/dist/esm/useWallets-yDa5ACXD.mjs +0 -1
@@ -1,103 +0,0 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import o from"@heroicons/react/20/solid/CheckIcon";import t from"@heroicons/react/24/outline/EnvelopeIcon";import i from"@heroicons/react/24/outline/PhoneIcon";import{useState as n,useEffect as a}from"react";import{isMobile as s}from"react-device-detect";import{styled as c}from"styled-components";import{H as l}from"./Layouts-BlFm53ED.mjs";import{L as d}from"./Link-DJ5gq9Di.mjs";import{u as p,q as m}from"./context-bWeWAiND.mjs";import{u,e as f,b as v,k as h}from"./internal-context-Z-fyxadS.mjs";import{a as y,u as g}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{s as x}from"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";import{S as b}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-DEtvMjrv.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const E=({contactMethod:c,authFlow:p,appName:m="Privy",whatsAppEnabled:u=!1,onBack:f,onCodeSubmit:v,onResend:h,errorMessage:y,success:g=!1,resendCountdown:x=0,onInvalidInput:E,onClearError:w})=>{let[A,T]=n(S);a((()=>{y||T(S)}),[y]);let k=async e=>{e.preventDefault();let r=e.currentTarget.value.replace(" ","");if(""===r)return;if(isNaN(Number(r)))return void E?.("Code should be numeric");w?.();let o=Number(e.currentTarget.name?.charAt(5)),t=[...r||[""]].slice(0,C-o),i=[...A.slice(0,o),...t,...A.slice(o+t.length)];T(i);let n=Math.min(Math.max(o+t.length,0),C-1);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${n}]`);e?.focus()}if(i.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${n}]`);e?.blur(),await(v?.(i.join("")))}};/*#__PURE__*/return e(b,{title:"Enter confirmation code",subtitle:/*#__PURE__*/r("span","email"===p?{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for an email from privy.io and enter your code below."]}:{children:["Please check ",/*#__PURE__*/e(M,{children:c})," for a",u?" WhatsApp":""," message from ",m," and enter your code below."]}),icon:"email"===p?t:i,onBack:f,showBack:!0,helpText:/*#__PURE__*/r(L,{children:[/*#__PURE__*/r("span",{children:["Didn't get ","email"===p?"an email":"a message","?"]}),x?/*#__PURE__*/r(R,{children:[/*#__PURE__*/e(o,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),/*#__PURE__*/e("span",{children:"Code sent"})]}):/*#__PURE__*/e(d,{as:"button",size:"sm",onClick:h,children:"Resend code"})]}),children:/*#__PURE__*/e(_,{children:/*#__PURE__*/e(l,{children:/*#__PURE__*/r(j,{children:[/*#__PURE__*/e("div",{children:A.map(((r,o)=>/*#__PURE__*/e("input",{name:`code-${o}`,type:"text",value:A[o],onChange:k,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(w?.(),T([...A.slice(0,e),"",...A.slice(e+1)]),e>0){let r=document.querySelector(`input[name=code-${e-1}]`);r?.focus()}})(o)},inputMode:"numeric",autoFocus:0===o,pattern:"[0-9]",className:`${g?"success":""} ${y?"fail":""}`,autoComplete:s?"one-time-code":"off"},o)))}),/*#__PURE__*/e(I,{$fail:!!y,$success:g,children:/*#__PURE__*/e("span",{children:"Invalid or expired verification code"===y?"Incorrect code":y||(g?"Success!":"")})})]})})})})};let C=6,S=Array(6).fill("");var w,A,T=((w=T||{})[w.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",w[w.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",w),k=((A=k||{})[A.EMAIL=0]="EMAIL",A[A.SMS=1]="SMS",A);const N={component:()=>{let{navigate:r,lastScreen:o,navigateBack:t,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=y(),c=p(),{closePrivyModal:l,resendEmailCode:d,resendSmsCode:b,getAuthMeta:C,loginWithCode:S,updateWallets:w,createAnalyticsEvent:A}=u(),{authenticated:T,logout:k,user:N}=g(),{whatsAppEnabled:_}=p(),[j,I]=n(!1),[L,R]=n(null),[M,D]=n(null),[O,P]=n(0);s.current=()=>null;let U=C()?.email?0:1,W=0===U?C()?.email||"":C()?.phoneNumber||"",$=m-500;a((()=>{if(O){let e=setTimeout((()=>{P(O-1)}),1e3);return()=>clearTimeout(e)}}),[O]),a((()=>{if(T&&j&&N){if(c?.legal.requireUsersAcceptTerms&&!N.hasAcceptedTerms){let e=setTimeout((()=>{r("AffirmativeConsentScreen")}),$);return()=>clearTimeout(e)}if(x(N,c.embeddedWallets)){let e=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),A({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),k()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),$);return()=>clearTimeout(e)}{w();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),m);return()=>clearTimeout(e)}}}),[T,j,N]),a((()=>{if(L&&0===M){let e=setTimeout((()=>{R(null),D(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[L,M]);/*#__PURE__*/return e(E,{contactMethod:W,authFlow:0===U?"email":"sms",appName:c?.name,whatsAppEnabled:_,onBack:()=>t(),onCodeSubmit:async e=>{try{await S(e),I(!0)}catch(e){if(e instanceof f&&e.privyErrorCode===v.INVALID_CREDENTIALS)R("Invalid or expired verification code"),D(0);else if(e instanceof f&&e.privyErrorCode===v.CANNOT_LINK_MORE_OF_TYPE)R(e.message);else{if(e instanceof f&&e.privyErrorCode===v.USER_LIMIT_REACHED)return console.error(new h(e).toString()),void r("UserLimitReachedScreen");if(e instanceof f&&e.privyErrorCode===v.USER_DOES_NOT_EXIST)return void r("AccountNotFoundScreen");if(e instanceof f&&e.privyErrorCode===v.LINKED_TO_ANOTHER_USER)return i({errorModalData:{error:e,previousScreen:o??"AwaitingPasswordlessCodeScreen"}}),void r("ErrorScreen",!1);if(e instanceof f&&e.privyErrorCode===v.DISALLOWED_PLUS_EMAIL)return i({inlineError:{error:e}}),void r("ConnectOrCreateScreen",!1);if(e instanceof f&&e.privyErrorCode===v.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return i({accountTransfer:{nonce:e.data?.data?.nonce,account:W,displayName:e.data?.data?.account?.displayName,linkMethod:0===U?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void r("LinkConflictScreen");R("Issue verifying code"),D(0)}}},onResend:async()=>{P(30),0===U?await d():await b()},errorMessage:L||void 0,success:j,resendCountdown:O,onInvalidInput:e=>{R(e),D(1)},onClearError:()=>{1===M&&(R(null),D(null))}})}};let _=c.div`
2
- display: flex;
3
- flex-direction: column;
4
- align-items: center;
5
- justify-content: center;
6
- margin: auto;
7
- gap: 16px;
8
- flex-grow: 1;
9
- width: 100%;
10
- `,j=c.div`
11
- display: flex;
12
- flex-direction: column;
13
- width: 100%;
14
- gap: 12px;
15
-
16
- > div:first-child {
17
- display: flex;
18
- justify-content: center;
19
- gap: 0.5rem;
20
- width: 100%;
21
- border-radius: var(--privy-border-radius-sm);
22
-
23
- > input {
24
- border: 1px solid var(--privy-color-foreground-4);
25
- background: var(--privy-color-background);
26
- border-radius: var(--privy-border-radius-sm);
27
- padding: 8px 10px;
28
- height: 48px;
29
- width: 40px;
30
- text-align: center;
31
- font-size: 18px;
32
- font-weight: 600;
33
- color: var(--privy-color-foreground);
34
- transition: all 0.2s ease;
35
- }
36
-
37
- > input:focus {
38
- border: 1px solid var(--privy-color-foreground);
39
- box-shadow: 0 0 0 1px var(--privy-color-foreground);
40
- }
41
-
42
- > input:invalid {
43
- border: 1px solid var(--privy-color-error);
44
- }
45
-
46
- > input.success {
47
- border: 1px solid var(--privy-color-border-success);
48
- background: var(--privy-color-success-bg);
49
- }
50
-
51
- > input.fail {
52
- border: 1px solid var(--privy-color-border-error);
53
- background: var(--privy-color-error-bg);
54
- animation: shake 180ms;
55
- animation-iteration-count: 2;
56
- }
57
- }
58
-
59
- @keyframes shake {
60
- 0% {
61
- transform: translate(1px, 0px);
62
- }
63
- 33% {
64
- transform: translate(-1px, 0px);
65
- }
66
- 67% {
67
- transform: translate(-1px, 0px);
68
- }
69
- 100% {
70
- transform: translate(1px, 0px);
71
- }
72
- }
73
- `,I=c.div`
74
- line-height: 20px;
75
- min-height: 20px;
76
- font-size: 14px;
77
- font-weight: 400;
78
- color: ${e=>e.$success?"var(--privy-color-success-dark)":e.$fail?"var(--privy-color-error-dark)":"transparent"};
79
- display: flex;
80
- justify-content: center;
81
- width: 100%;
82
- text-align: center;
83
- `,L=c.div`
84
- display: flex;
85
- gap: 8px;
86
- align-items: center;
87
- justify-content: center;
88
- width: 100%;
89
- color: var(--privy-color-foreground-2);
90
- `,R=c.div`
91
- display: flex;
92
- align-items: center;
93
- justify-content: center;
94
- border-radius: var(--privy-border-radius-sm);
95
- padding: 2px 8px;
96
- gap: 4px;
97
- background: var(--privy-color-background-2);
98
- color: var(--privy-color-foreground-2);
99
- `,M=c.span`
100
- font-weight: 500;
101
- word-break: break-all;
102
- color: var(--privy-color-foreground);
103
- `;export{N as AwaitingPasswordlessCodeScreen,E as AwaitingPasswordlessCodeScreenView,N as default};
@@ -1,2 +0,0 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as l}from"viem";import{ConnectedStandardSolanaWallet as c}from"@privy-io/js-sdk-core";import{b as d,c as m,R as u}from"./Layouts-BlFm53ED.mjs";import{B as p}from"./ModalHeader-CSfzkWxZ.mjs";import{C as f}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as h}from"./FundWalletMethodHeader-Dujd1j7J.mjs";import{N as g}from"./index-Dq_xe9dz.mjs";import{u as v,t as w}from"./context-bWeWAiND.mjs";import{u as I,a as C,b as y}from"./internal-context-Z-fyxadS.mjs";import{Q as T,a6 as j}from"./useActiveWallet-CSq3KvGj.mjs";import{a as S}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as b,t as N,d as F,a as U,b as E,u as x}from"./reservoir-0wfhnc0j.mjs";import{u as k}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as W}from"./usePrivy-CvOp4eQ7.mjs";import{T as R}from"./TransferOrBridgeLoadingScreen-gM_oel5i.mjs";import{t as L}from"./use-export-wallet-DyNNbsJn.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-izyyA2re.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Row-C9vrS4Zi.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Address-BuCMjci7.mjs";import"lucide-react";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"eventemitter3";const P={component:function(){let P=v(),{closePrivyModal:D,createAnalyticsEvent:B,connectors:$}=I(),{navigate:H,setModalData:M,data:O}=S(),_=v(),q=o(!1),Q=k(),[V,z]=a(!1),[G,X]=a(!1),[Y,J]=a(null),[K,Z]=a(),[ee,te]=a();if(!O?.funding||"ethereum"!==O.funding.chainType)throw Error("Invalid funding data");let{amount:ne,connectedWallet:re,chain:oe,solanaChain:ae,isUSDC:ie}=O.funding,se=O.funding.address,le=O.funding.erc20Address,ce=O.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,de=i((()=>"solana"===re?.type?re.provider:function({connectors:e,connectedWalletAddress:t}){let n=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),r=n?.wallet.accounts.find((e=>e.address===t));if(!n||!r)throw new C("Unable to find source wallet connector");return new c({wallet:n.wallet,account:r})}({connectors:$,connectedWalletAddress:re?.address||""})),[re,$]),me=i((()=>{let e=Q(W);if(!e)throw new C("Unable to load solana plugin");let t=P.solanaRpcs["solana:mainnet"];if(!t)throw new C("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),ue=T(L(de?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!de||!oe||q.current)return;let e=Q(W);if(!e)return void J(new C("Unable to solana plugin"));q.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(ne):l(ne),n=await b({isTestnet:!!oe.testnet,input:N({appId:_.id,amount:t.toString(),user:de.address,recipient:se,destinationChainId:oe.id,originChainId:E,originCurrency:ie?F:U,destinationCurrency:ie?le:void 0})}).catch(console.error);if(!n)return void J(new C(`Unable to fetch quotes for bridging. Wallet ${j(de.address)} does not have enough funds.`,void 0,y.INSUFFICIENT_BALANCE));let r=await e.createTransactionFromRelayQuote({quote:n,source:de.address,solanaClient:me});if(r)try{z(!0);let t=await e.simulateTransaction({solanaClient:me,tx:r});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void J(new C("Something went wrong",void 0,y.TRANSACTION_FAILURE))):void J(new C(`Wallet ${j(de?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${ce} are needed to complete the transaction.`,void 0,y.INSUFFICIENT_BALANCE));let{signature:o}=await de.signAndSendTransaction({chain:"solana:mainnet",transaction:r}),a=e.getAddressFromBuffer(o);Z(a),te("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void J(new C("Transaction was rejected by the user",void 0,y.TRANSACTION_FAILURE));J(new C("Something went wrong",void 0,y.TRANSACTION_FAILURE))}else J(new C(`Unable to select bridge option from quotes. Wallet ${j(de.address)} does not have enough funds.`,void 0,y.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),x({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){z(!1),X(!0),B({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:de.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:ne,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){z(!1),J(e)}}),s((()=>{if(!G)return;let e=setTimeout(D,w);return()=>clearTimeout(e)}),[G]),s((()=>{Y&&(M({funding:O?.funding,solanaFundingData:O?.solanaFundingData,sendTransaction:O?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),H("ErrorScreen",!1))}),[Y]),G?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(d,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(r,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(f,{title:"Success!",description:`You’ve successfully added ${ne} ${ce} to your ${_.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):V&&de?/*#__PURE__*/t(R,{walletClientType:L(de?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:V,isErc20Flow:!1,chainId:oe.id,chainName:oe.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
2
- /*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(g,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(p,{})]})}};export{P as AwaitingSolToEvmBridgingScreen,P as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as s,useEffect as a}from"react";import{a as n,C as c}from"./index-DEtvMjrv.mjs";import{a as m}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as u}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"./context-bWeWAiND.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const p=({status:o,title:s,description:a,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),g=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:g,title:s,subtitle:a,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:g,reset:y,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[C,f]=s(!0);a((()=>(j(setTimeout(f,1e3,!1)),()=>{v.current.forEach((e=>clearTimeout(e))),v.current=[]})),[]);let[b,w]=s(""),[k,R]=s("Checking that you are a human..."),[S,x]=s(!1),[I,T]=s(3),P=r?.captchaModalData,A=async e=>{try{await(P?.callback(e)),P?.onSuccessNavigateTo&&i(P?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(P?.onErrorNavigateTo||"ErrorScreen",!1)}};a((()=>{"success"===l?j(setTimeout((async()=>{let e=await g();!e||P?.userIntentRequired||A(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),a((()=>{if(!C)switch(l){case"success":w("Success!"),R("CAPTCHA passed successfully."),P?.userIntentRequired||setTimeout((()=>{x(!0),A(d)}),2e3);break;case"loading":w(""),R("Checking that you are a human...");break;case"error":w("Something went wrong"),R(I<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,C,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:k,userIntentRequired:P?.userIntentRequired,retriesRemaining:I,hasSelectedCta:S,onContinue:()=>{x(!0),A(d)},onRetry:async()=>{if(I<=0)return;T((e=>e-1)),y(),h();let e=await g();!e||P?.userIntentRequired||A(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
@@ -1,16 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{M as l,B as d,P as p}from"./ModalHeader-CSfzkWxZ.mjs";import{a as u}from"./Layouts-BlFm53ED.mjs";import{L as g,a7 as f}from"./useActiveWallet-CSq3KvGj.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as v}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{H as b}from"./index-DEtvMjrv.mjs";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:p,createAnalyticsEvent:u,client:g}=h(),[f,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:x}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===f||"pending-after-flow"===f){let e=setInterval((async()=>{if(k)try{let{status:e}=await g.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");x?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),u({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,x,f]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:f,onClickCta:p}),/*#__PURE__*/t(d,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(x,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(u,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(p,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(g,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(f,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=m.p`
2
- font-size: 1rem;
3
- color: var(--privy-color-foreground-3);
4
- margin-bottom: 1rem;
5
- display: flex;
6
- flex-direction: column;
7
- gap: 1rem;
8
- `,x=m.div`
9
- display: flex;
10
- flex-direction: column;
11
- align-items: center;
12
- justify-content: center;
13
- margin-left: 1.75rem;
14
- margin-right: 1.75rem;
15
- padding: 2rem 0;
16
- `;export{w as CoinbaseOnrampStatusScreen,w as default};
@@ -1,3 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as a}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-bWeWAiND.mjs";import{u as m,c,b as d}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./index-DEtvMjrv.mjs";import{u,a as h}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{F as g,a1 as f,V as E}from"./useActiveWallet-CSq3KvGj.mjs";import{E as S,P as y}from"./ModalHeader-CSfzkWxZ.mjs";import{C as b}from"./Chip-D2-wZOHJ.mjs";import{I as v,a as k}from"./EmailInputForm-Dgoii4vf.mjs";import{E as C}from"./ErrorMessage-D8VaAP5m.mjs";const j=/*#__PURE__*/t(((t,l)=>{let[E,v]=o(t.defaultValue||""),[k,j]=o(""),[A,T]=o(!1),{authenticated:L}=u(),{initLoginWithEmail:M}=m(),{navigate:D,setModalData:I,currentScreen:U,data:F}=h(),{enabled:N,token:W}=p(),[R,V]=o(!1),{accountType:$}=g(),_=s();n((()=>{!E&&_.disablePlusEmails&&F?.inlineError?.error instanceof c&&F?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!k&&j("Please enter a valid email address without a '+'."),k&&j("")}),[E]);let q=f(E),z=A||!q,H=()=>{var e;I({login:F?.login,inlineError:void 0}),!N||W||L?(e=W,T(!0),M({email:E,captchaToken:e,disableSignup:F?.login?.disableSignup,withPrivyUi:!0}).then((()=>{D("AwaitingPasswordlessCodeScreen")})).catch((e=>{I({errorModalData:{error:e,previousScreen:U||"LandingScreen"}}),D("ErrorScreen")})).finally((()=>{T(!1)}))):(I({captchaModalData:{callback:e=>M({email:E,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(w,{children:[k&&/*#__PURE__*/a(C,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:k}),/*#__PURE__*/e(x,{stacked:t.stacked,$error:!!k,children:[/*#__PURE__*/a(P,{children:/*#__PURE__*/a(i,{})}),/*#__PURE__*/a("input",{ref:l,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>V(!0),onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&H()},value:E,autoComplete:"email"}),"email"!==$||R?t.stacked?/*#__PURE__*/a("span",{}):/*#__PURE__*/a(S,{isSubmitting:A,onClick:H,disabled:z,children:"Submit"}):/*#__PURE__*/a(b,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/a(y,{loadingText:null,loading:A,disabled:z,onClick:H,style:{width:"100%"},children:"Submit"}):null]})}));let w=v,x=k,P=l(E)`
2
- display: inline-flex;
3
- `;export{j as C};
@@ -1,9 +0,0 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as n}from"./ScreenLayout-C2Le_YIv.mjs";import{G as m}from"./index-DEtvMjrv.mjs";import"viem";import"react";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";const s=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),p=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:p="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:p,subtitle:/*#__PURE__*/t(u,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(p,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=o.div`
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- gap: 8px;
6
- margin-bottom: var(--screen-space);
7
- `,u=o.span`
8
- white-space: pre-wrap;
9
- `;export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,p as ConnectLedgerScreenView,c as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-bWeWAiND.mjs";import{u as r,c as n,b as i}from"./internal-context-Z-fyxadS.mjs";import{a}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{i as c}from"./ConnectWalletView-rtAY2uds.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-BkoTqsec.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-VPW2SjZN.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),C=a(),u=s?.externalConnectWallet?.description,j=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),E=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:j.current,walletChainType:E.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{C("connectWallet","onError",i.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{C("connectWallet","onSuccess",{wallet:t});let o=s?.externalConnectWallet?.onCompleteNavigateTo;o?p(o({address:t.address,walletClientType:e?.walletClientType,walletChainType:e?.chainType})):m()},onConnectError:e=>{e instanceof n?(console.warn(e.cause?e.cause:e.message),C("connectWallet","onError",e.privyErrorCode||i.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),C("connectWallet","onError",i.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:u,app:d,connectOnly:!0})},isUnauthenticatedScreem:!0};export{m as ConnectOnlyLandingScreen,m as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as i}from"./use-export-wallet-DyNNbsJn.mjs";import{q as n}from"./context-bWeWAiND.mjs";import{Q as a}from"./useActiveWallet-CSq3KvGj.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as c}from"./ScreenLayout-C2Le_YIv.mjs";import{B as m}from"./index-DEtvMjrv.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-_g1A1Dg2.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./Link-DJ5gq9Di.mjs";import"./useI18n-VPW2SjZN.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:n,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:n,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===i.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:m,watermark:!0}),d={component:()=>{let i,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[C,h]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,R="switching_to_supported_chain"===j?.status;o((()=>{if(S){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=j.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&j.connector){let e=j.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:j.connector?.walletClientType,walletChainType:j.connector?.chainType}))}),n)}else e=setTimeout(v,n);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,h(p(e)))}),[j]);let T=j?.connector?.connectorType||"injected",W=j?.connector?.walletClientType||"unknown",B=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",E=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),M="Browser Extension"===B?B.toLowerCase():B;i=S?`Successfully connected with ${M}`:C?C.message:R?"Switching networks":`Waiting for ${M}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&C?_="Unable to connect wallet":C?_=C.detail:R?_="Switch your wallet to the requested network.":"metamask"===W&&r?_="Click to continue to open and connect MetaMask.":"metamask"===W?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===T?_="Open your mobile wallet app to continue":"coinbase_wallet"===T&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:B,walletLogo:E,success:S,errorMessage:C,title:i,subtitle:_,onRetry:()=>{b(k+1),h(void 0),j?.connectRetry()},onUseDifferentWallet:c,onBack:f===w?void 0:c,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-bWeWAiND.mjs";import{C as r,L as i}from"./CustomLandingScreenView-Dt4TEi0A.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-GcvxyU9r.mjs";import"viem";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-DEtvMjrv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ConnectWalletView-rtAY2uds.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-BkoTqsec.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-VPW2SjZN.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-CUfcb4US.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-DMcfvHG9.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-C0Ysaik4.mjs";import"./ScreenLayout-C2Le_YIv.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
@@ -1,7 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as l}from"react-device-detect";import{styled as c}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-DEtvMjrv.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as h}from"./context-bWeWAiND.mjs";import{u as S}from"./useI18n-VPW2SjZN.mjs";import{C as y,P as f,d as C}from"./use-export-wallet-DyNNbsJn.mjs";import{Q as b,k as v,T}from"./useActiveWallet-CSq3KvGj.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,k as A}from"./internal-context-Z-fyxadS.mjs";import{u as W,a as I}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";import{u as j}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-CvOp4eQ7.mjs";import{S as O}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-izyyA2re.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"tinycolor2";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>E(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const x=e=>e?.privyErrorCode===R.LINKED_TO_ANOTHER_USER?y.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?y.ERROR_TIMED_OUT:e?.privyErrorCode===R.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,M=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:l,connectSuccess:c,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:b,onCoinbaseReset:v,onDifferentWallet:T})=>{let{t:_}=S(),E=w?{label:"Use a different wallet",onClick:v,disabled:r}:l===y.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:c&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&l?.retryable&&h<2?{label:"Retry",onClick:b,disabled:!1}:r||l?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!l},primaryCta:E,onBack:f,watermark:!0,children:!c&&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,c]=a(!1),[g,f]=a(!1),[C,_]=a(void 0),{authenticated:E,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:H}=I(),X=w(),{t:z}=S(),{getAuthFlow:K,walletConnectionStatus:Q,closePrivyModal:Y,initLoginWithWallet:J,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=k(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[le,ce]=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=b(Q?.connector?.walletClientType||"unknown"),we=l&&"wallet_connect_v2"===Q?.connector?.connectorType||l&&"coinbase_wallet"===Q?.connector?.connectorType||l&&"base_account"===Q?.connector?.connectorType||l&&"injected"===Q?.connector?.connectorType&&"phantom"===Q?.connector?.walletClientType||l&&"solana_adapter"===Q?.connector?.connectorType&&"mobile_wallet_adapter"===Q.connector.walletClientType,he="connected"===Q?.status,Se="switching_to_supported_chain"===Q?.status;i((()=>{let e=K(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Q.connector?.chainType&&"phantom"===Q.connector?.walletClientType&&oe(U)&&void 0===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?J(Q.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>J(Q.connectedWallet,e,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&H?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),_(void 0);try{"wallet_connect_v2"===Q?.connector?.connectorType&&"metamask"===Q?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(X?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,X.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}$();let t=setTimeout((()=>Y({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==R.ALLOWLIST_REJECTED){if(e?.privyErrorCode===R.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==R.USER_DOES_NOT_EXIST)return e?.privyErrorCode===R.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:K()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:K()?.meta.walletClientType,chainId:K()?.meta.chainId,connectorType:K()?.meta.connectorType},linkMethod:K()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(x(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),c(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Q?.connectError&&ye(Q?.connectError)}),[Q]),((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&&Q?.connector instanceof m?Q.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Q?.connector instanceof m?Q.connector.fallbackUniversalRedirectUri:void 0;t&&ce(t)}),Q?.connector instanceof m&&!ae?500:null);let Ce=Q?.connector?.connectorType||"injected",be=Q?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Q?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Q?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===ve?ve.toLowerCase():ve;t=n?z("connectionStatus.successfullyConnected",{walletName:_e}):C?z("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=z("connectionStatus.checkOtherWindows");n?Ee=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:Se?Ee="Switch your wallet to the requested network.":he&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&l?Ee="Click continue to open and connect MetaMask.":"metamask"===be?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):H?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(M,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:le,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Q?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=c.p`
2
- text-align: center;
3
- color: var(--privy-color-foreground-2);
4
- font-size: 14px;
5
- line-height: 22px;
6
- margin: 16px 0;
7
- `;export{D as ConnectionStatusScreen,M as ConnectionStatusView,D as default,x as getErrorDetails};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-bWeWAiND.mjs";import{R as s}from"./index-DEtvMjrv.mjs";import{u as n,a as c,e as p,b as l}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{z as u}from"./useActiveWallet-CSq3KvGj.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";import{S as f}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-izyyA2re.mjs";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.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:g,onUserCloseViaDialogOrKeybindRef:y}=m(),{crossAppAuthFlow:A,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=u(),[C,I]=o({}),U=f?.crossAppAuth,T=new c(`There was an issue connecting your ${U?.name} account. Please try again.`),x=new s((async e=>{if(U?.popup)try{let t=await A({appId:e,popup:U.popup,action:U.action,disableSignup:U.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 g({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${U.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");U.popup&&U.popup.close(),I({error:T})}else I({error:T})}else I({error:T})})),k=()=>{C.data&&(j(),U?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return y.current=k,r((()=>{U?.appId?.length&&x.execute(U.appId)}),[U?.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(d(e,t.embeddedWallets)){let e=setTimeout((()=>{g({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${U?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(k,a);return()=>clearTimeout(o)}),[C.data]),U?.appId?/*#__PURE__*/e(h,{providerApp:{id:U?.appId,logoUrl:U?.logoUrl,name:U?.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 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as s,useEffect as i}from"react";import{W as a}from"./WalletInfoCard-TfOxho0A.mjs";import{u as n,r as c}from"./context-bWeWAiND.mjs";import{u as m,a as l}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as u}from"./ScreenLayout-C2Le_YIv.mjs";import"styled-components";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.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-BuCMjci7.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-5StC6JLQ.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"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=s(!1),[j,f]=s(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return i((()=>{if(!a&&!j)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:j,onAccept:async()=>{try{await g(),u(!0)}catch(e){f(e)}},onDecline:()=>{v()},onClose:v})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-bWeWAiND.mjs";import{u as c,a as m}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as p}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[f,y]=i(),{onRevoke:k,onSuccess:v,onError:w}=o.delegatedActions.revoke,h=async()=>{p?v():w(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(h,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await k(),d(!0)}catch(e){y(e)}},onDeny:()=>{h()},onClose:h})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -1 +0,0 @@
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-DEtvMjrv.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{u as l,a as c}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as m}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"./context-bWeWAiND.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.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}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:w,setModalData:f,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[C,g]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:T,isUnifiedWallet:W=!1}=w?.connectWallet,F=e=>{C||(g(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return F("User must be authenticated and have a Privy wallet before it can be connected");try{if(!W){if(!x||!P)return F("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:P})}k&&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 F("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:T}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:P}));t?.entropyId||F(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:T}}),h(A)}catch(e){F("An error has occurred, please try again.")}}else a(e)&&"privy"!==S&&"privy-v2"!==S?(f({...w,recoverWallet:{entropyId:x,entropyIdVerifier:P,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:S,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(S))):F(e)}})(),()=>clearTimeout(e)):void 0:F("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{F("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:C,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
@@ -1 +0,0 @@
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,c as s,d as c}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as m,r as a}from"./context-bWeWAiND.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{S as l}from"./ScreenLayout-C2Le_YIv.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.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}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=m(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:w}=j.createWallet,x=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):C(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:w})};return o((()=>{let e=setTimeout(x,a);return()=>clearTimeout(e)}),[]),f.current=x,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:x})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1 +0,0 @@
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-bWeWAiND.mjs";import{v as s,s as l,k as n,F as m,R as c}from"./index-DEtvMjrv.mjs";import{u as d,m as p}from"./internal-context-Z-fyxadS.mjs";import{a as u,u as h}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as y}from"./ScreenLayout-C2Le_YIv.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(y,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}),v={component:()=>{let{setModalData:t,navigate:y,data:v,onUserCloseViaDialogOrKeybindRef:C}=u(),g=a(),[j,f]=r(""),{embeddedWallets:b}=a(),{authenticated:S,user:x}=h(),{closePrivyModal:W,walletProxy:O,client:A}=d(),{onSuccess:k,onFailure:P,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:R}=v.createWallet,U="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[E,K]=r(null),{create:L}=s(),T=M??(!!x&&l(x,g.embeddedWallets.ethereum.createOnLogin)),F=R??(!!x&&n(x,g.embeddedWallets.solana.createOnLogin)),D=new c((async()=>{let e=await A.getAccessToken();if(x&&e&&O)try{let e,t=await i(x.id,"ethereum"),r=await i(x.id,"solana");if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:x,idempotencyKey:r});else{if(!T)return void W({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t})}K(e),y("EmbeddedWalletCreatedScreen")}catch(e){f(e.message)}}));return o((()=>S&&x?U?(t({...v,createWallet:{...v.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...v?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),y(m({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:b.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(y("LandingScreen"),void P(Error("User must be authenticated before creating a Privy wallet")))),[U,S]),C.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{E?(k(E),W({shouldCallAuthOnSuccess:I})):(P(new p("User wallet creation failed")),W({shouldCallAuthOnSuccess:!1}))}})}};export{v as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,v as default};
@@ -1 +0,0 @@
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"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as i}from"./context-bWeWAiND.mjs";import{u as n,o as d,m as c}from"./internal-context-Z-fyxadS.mjs";import{g as l}from"./useWallets-izyyA2re.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-lzuYpBex.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-CQ6jg1BO.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,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:A,user:I}=t(),{client:M,walletProxy:b,refreshSessionAndUser:j,closePrivyModal:C,createAnalyticsEvent:R}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=x.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,T="user-passcode"===D?.recoveryMethod;r((()=>{A||(P("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let L=()=>v?(N(v),void C({shouldCallAuthOnSuccess:!1})):O?(k(u),void C({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void C({shouldCallAuthOnSuccess:!1}));S.current=L;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:L},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:T,onPasswordGenerate:()=>_(p()),onPasswordChange:_,onSubmit:async()=>{O?(k(u),C({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&b)try{R({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await b.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void R({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"error setting password"}});let t=await j(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void R({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"wallet disconnected"}});w(s),R({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),R({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:L})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
@@ -1 +0,0 @@
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-Z-fyxadS.mjs";import{a}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as c}from"./ScreenLayout-C2Le_YIv.mjs";import"ofetch";import"react";import"viem";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const m=({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}),n={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:c}=a(),{onFailure:n}=t.setWalletPassword,l=()=>{n(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return c.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{n as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,n as default};
@@ -1,4 +0,0 @@
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-bWeWAiND.mjs";import{a as c,P as l}from"./index-DEtvMjrv.mjs";import{c as m,b as p,a as u,e as d}from"./internal-context-Z-fyxadS.mjs";import{a as T}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{R as g}from"./reservoir-0wfhnc0j.mjs";import{S as h}from"./ScreenLayout-C2Le_YIv.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const y=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:y})=>{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 u)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 d&&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(h,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:y,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(y,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
2
- color: var(--privy-color-accent) !important;
3
- font-weight: 600;
4
- `;export{f as ErrorScreen,y as ErrorScreenView,f as default};
@@ -1,28 +0,0 @@
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-BGTSFnT3.mjs";import{L as c}from"./useActiveWallet-CSq3KvGj.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-BkoTqsec.mjs";import{u as d,q as u}from"./context-bWeWAiND.mjs";import{u as g}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as h}from"./ScreenLayout-C2Le_YIv.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"./copy-Bx2Jwc5_.mjs";import"zustand";import"./use-export-wallet-DyNNbsJn.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const w=({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(k,{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(j,{children:[/*#__PURE__*/e(x,{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 k=n.div`
2
- margin-top: 24px;
3
- `,j=n.div`
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- gap: 24px;
8
- `,x=n.div`
9
- padding: 24px;
10
- position: relative;
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- min-height: 275px;
15
- `,C=n.div`
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- gap: 16px;
20
- `,b=n.div`
21
- font-size: 0.875rem;
22
- text-align: center;
23
- color: var(--privy-color-foreground-2);
24
- `,S=n.div`
25
- position: relative;
26
- width: 82px;
27
- height: 82px;
28
- `;const I={component:()=>{let{lastScreen:t,navigateBack:i,data:s}=f(),n=d(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=g(),[m,p]=r(void 0),[h,v]=r(!1),[y,k]=r(!1),j=o([]),x=s?.farcasterSigner;a((()=>{let e=Date.now(),t=setInterval((async()=>{if(!x?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===x.status&&(clearInterval(t),v(!1),k(!0),j.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(x?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),v(!1),k(!0),j.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u))):o>3e5?(clearInterval(t),p({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),p({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),j.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===x?.status?x.signer_approval_url:void 0;/*#__PURE__*/return e(w,{appName:n.name,loading:h,success:y,errorMessage:m,connectUri:C,onBack:t?i:void 0,onClose:c,onOpenFarcaster:()=>{C&&(window.location.href=C)}})}};export{I as FarcasterSignerStatusScreen,w as FarcasterSignerStatusView,I as default};
@@ -1 +0,0 @@
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-CSfzkWxZ.mjs";import{b as m,c,R as u,e as d}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-Dujd1j7J.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-Dq_xe9dz.mjs";import{L as I,V as w}from"./Value-tcJV9e0L.mjs";import{a as v,R as S}from"./Row-C9vrS4Zi.mjs";import{u as j,t as C}from"./context-bWeWAiND.mjs";import{u as y,a as L,b as x}from"./internal-context-Z-fyxadS.mjs";import{a as k}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as F,g as U}from"./useWallets-yDa5ACXD.mjs";import{u as T}from"./useGetTokenPrice-YObgUU6L.mjs";import{O as b}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as A}from"@solana-program/system";import{pipe as W,createTransactionMessage as P,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 _}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as q,f as z,s as Q,w as X}from"./useSolanaRpcClient-BTAchFxj.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{t as J}from"./use-export-wallet-DyNNbsJn.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-izyyA2re.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"./usePrivy-CvOp4eQ7.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";function K({rows:a}){/*#__PURE__*/return e(v,{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(w,{$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=j(),{closePrivyModal:w,createAnalyticsEvent:v}=y(),{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:ue,chain:de,sourceWalletData:pe,destinationAddress:fe,afterSuccessScreen:ge}=S.solanaFundingData,he=ee.find((e=>e.address===pe.address&&J(pe.walletClientType)===J(e.standardWallet.name))),Ie=q()(de),{tokenPrice:we,isTokenPriceLoading:ve}=T("solana");return r((()=>{if("preparing"!==te||ve||!he)return;let e="SOL"===ue?Z(ce):function(e){return BigInt(Math.floor(1e6*parseFloat(e)))}(ce);ie({amount:("SOL"===ue&&we?V(e,we):ce)??ce}),("SOL"===ue?async function({solanaClient:e,source:t,destination:a,amountInLamports:n}){let{value:o}=await e.rpc.getLatestBlockhash().send(),r={address:t},s=W(P({version:0}),(e=>D(r,e)),(e=>N(o,e)),(e=>O(A({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=_(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 u=$({payer:s,ata:l,owner:a,mint:o}),d=W(P({version:0}),(e=>D(s,e)),(e=>N(r,e)),(e=>c?.value?e:O(u,e)),(e=>O(R({source:i,destination:l,authority:s,amount:n}),e)),(e=>E(e)));return new Uint8Array(M().encode(d))}({solanaClient:Ie,source:he.address,destination:fe,amountInBaseUnits:e})).then(re).catch((e=>{ne("error"),me(e)}))}),[te,ce,ue,de,he,fe,ve,we]),r((()=>{"preparing"===te&&oe&&ae({tx:oe,solanaClient:Ie,amount:ce,asset:ue,tokenPrice:we}).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,ue,te,we]),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):w,C);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} ${ue} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/e(u,{}),/*#__PURE__*/e(i,{})]}:"preparing"===te||"loaded"===te||"sending"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(d,{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(de)},{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:de,sourceWallet:he}).then((e=>{ne("success"),v({eventName:b,payload:{provider:"external",status:"success",txHash:e,address:he.address,value:ce,chainType:"solana",clusterName:de,token:ue,destinationAddress:fe,destinationValue:ce,destinationChainType:"solana",destinationClusterName:de,destinationToken:ue}})})).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 +0,0 @@
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-CSfzkWxZ.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as m}from"./FundWalletMethodHeader-Dujd1j7J.mjs";import{N as a}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as p}from"./useGetTokenPrice-YObgUU6L.mjs";import{c as d}from"./ethers-DrSqg5wi.mjs";import{F as u,a as h,h as j,c as f,d as C}from"./styles-C3H3yhVT.mjs";import"styled-components";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.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"./useGetSolPrice-DwwjjGbd.mjs";import"./LinkPasskeyScreen-jzRj6Yq0.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-C2Le_YIv.mjs";import"./Screen-5StC6JLQ.mjs";const g={component:()=>{let{data:g,setModalData:v}=l(),y=g?.funding,x="solana"===y.chainType,k=r(null),{tokenPrice:D}=p(x?"solana":y.chain.id),S=x?void 0:y,T=!(!S?.erc20Address||S?.erc20ContractInfo),F=x?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",A=parseFloat(y.amount),I=!isNaN(A)&&A>0,L=D?d(y.amount,D):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(m,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:T?/*#__PURE__*/o(a,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>k.current?.focus(),children:[/*#__PURE__*/o(j,{ref:k,value:y.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&v({...g,funding:{...y,amount:e},solanaFundingData:g?.solanaFundingData?{...g.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:F})]}),!S?.erc20Address&&!(x&&y.isUSDC)&&/*#__PURE__*/o(C,{children:L&&I?`${L} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!I,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{g as FundingAmountEditScreen,g as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-CSfzkWxZ.mjs";import{t as h}from"./FundWalletMethodHeader-Dujd1j7J.mjs";import{E as p}from"./ErrorBanner-CQERa7bL.mjs";import{I as m}from"./InfoBanner-Dk1KghcK.mjs";import{u}from"./context-bWeWAiND.mjs";import{v as f,Q as g,U as y}from"./useActiveWallet-CSq3KvGj.mjs";import{a as C,u as v}from"./internal-context-Z-fyxadS.mjs";import{a as w}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as F}from"./useWallets-izyyA2re.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-CZJTqd4c.mjs";import{avalanche as S,arbitrum as W,polygon as x,optimism as I,base as j,mainnet as D,toCoinbaseAssetId as T,getCoinbaseOnRampUrl as k,chainToMoonpayCurrency as A,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as E}from"@privy-io/popup";import{a as U}from"./index-BXKPenEy.mjs";import{e as O,I as _,f as H,g as P}from"./styles-C3H3yhVT.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"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-jzRj6Yq0.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-C2Le_YIv.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const B=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),R=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function q(e){let n=N[e];if(!n)throw new C(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let N={[D.id]:"ethereum",[j.id]:"base",[I.id]:"optimism",[x.id]:"polygon",[W.id]:"arbitrum",[S.id]:"avacchain"};const Q=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=E();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?q(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?T(n.chain.id,"native-currency"):"SOL",h=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:p}=k({appId:e.getAppId(),input:h,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=p.toString();let m={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(m.usingDefaultFundingMethod=!1),t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),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:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:h.partner_user_id,popup:d}})}),5e3),r()})),$=async(e,n,t,a,i,o,r,c)=>{let d=E();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?A(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:h}=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:c,currencyCode:s,quoteCurrencyAmount:U(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}}),d.location=l;let p={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:p,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:h},funding:p,solanaFundingData:r?.solanaFundingData})}),8e3)};let K=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 X=()=>K("https://apple.com/apple-pay"),G=()=>K("https://google.com/pay"),J={component:()=>{let{wallets:r}=F(),{connectors:C}=v(),S=C.filter(f).flatMap((e=>e.wallets)),{navigate:W,data:x,setModalData:I}=w(),{client:j}=v(),D=u(),T=x?.funding,k=V(X),A=V(G),E="solana"===T.chainType,U=E?void 0:T,q=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",h=!!d||l&&z(Number(t.chain.id),l),p=!!d||l&&L(Number(t.chain.id),l),m=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&p&&m.push((()=>Q(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&h&&l&&m.push((()=>$(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&p&&(r=()=>Q(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:m,onFundWithExchange:r,onFundWithWallet:c}})(D,j,T,I,W,x)),[D,j,T,x,I,W]),N=E?S.find((({address:e})=>e===T.address)):r.find((({address:e})=>s(e)===s(T.address))),K=g(N?.walletClientType||"unknown"),J=K?.name||"wallet",Y=N&&"privy"!==N.walletClientType?J:D.name,Z=d((()=>T.uiConfig?.landing?.title?T.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[T.uiConfig?.landing?.title,Y]);c((()=>{if(T?.defaultFundingMethod&&T.usingDefaultFundingMethod)switch(I({funding:{...T,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),T?.defaultFundingMethod){case"card":q.onFundWithCard[0]&&q.onFundWithCard[0]();break;case"exchange":q.onFundWithExchange&&q.onFundWithExchange();break;case"wallet":q.onFundWithWallet&&q.onFundWithWallet();break;case"manual":W("ManualTransferScreen")}}),[]),c((()=>{U?.erc20Address&&!U.erc20ContractInfo&&b({address:U.erc20Address,chain:U.chain,rpcConfig:D.rpcConfig,privyAppId:D.id}).then((e=>{I({...x,funding:{...U,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[U?.erc20Address,U?.chain]);let ee=!(!U?.erc20Address||U?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(h,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(O,{children:[T.errorMessage&&/*#__PURE__*/e(p,{theme:D.appearance.palette.colorScheme,children:T.errorMessage}),q.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithCard[0],children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",k?/*#__PURE__*/e(B,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):A?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),q.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithExchange,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),q.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithWallet,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>W("ManualTransferScreen"),children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),T?.showAlternateFundingMethod&&q.onFundWithCard?.[1]&&/*#__PURE__*/e(m,{theme:D.appearance.palette.colorScheme,children:/*#__PURE__*/n(H,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(P,{onClick:q.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{J as FundingMethodSelectionScreen,J as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{ExternalLink as o}from"lucide-react";import{u as e}from"./internal-context-Z-fyxadS.mjs";import{S as r}from"./ScreenLayout-C2Le_YIv.mjs";import"ofetch";import"react";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-GcvxyU9r.mjs";import"viem";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/t(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:o,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=e();/*#__PURE__*/return t(i,{onClose:()=>o()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as o}from"react/jsx-runtime";import{L as r}from"./Link-DJ5gq9Di.mjs";import{T as i,a as l}from"./TodoList-CgrU7uwu.mjs";import{a}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as n}from"./ScreenLayout-C2Le_YIv.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const s=({walletName:a,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${a} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(o,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(r,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(l,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(r,{href:s,target:"_blank",children:[a," browser extension"]})]})}),/*#__PURE__*/t(l,{children:"Set up your first wallet"}),/*#__PURE__*/t(l,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:o}=a();if(!o?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:r}=o.installWalletModalData;/*#__PURE__*/return t(s,{walletName:r.name,installLink:r.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-bWeWAiND.mjs";import{C as r,L as i}from"./CustomLandingScreenView-Dt4TEi0A.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-CSfzkWxZ.mjs";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-GcvxyU9r.mjs";import"viem";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-DEtvMjrv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ConnectWalletView-rtAY2uds.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-BkoTqsec.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-VPW2SjZN.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-CUfcb4US.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-DMcfvHG9.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-C0Ysaik4.mjs";import"./ScreenLayout-C2Le_YIv.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!1}):/*#__PURE__*/t(i,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0};export{e as LandingScreen,e as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/EnvelopeIcon";import{C as i}from"./ConnectEmailForm-CUfcb4US.mjs";import{B as r}from"./Layouts-BlFm53ED.mjs";import{u as e}from"./context-bWeWAiND.mjs";import{S as m}from"./ScreenLayout-C2Le_YIv.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./index-DEtvMjrv.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-GcvxyU9r.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"tinycolor2";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(r,{children:/*#__PURE__*/t(i,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-DMcfvHG9.mjs";import{u as i}from"./context-bWeWAiND.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as a}from"./ScreenLayout-C2Le_YIv.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"./ModalHeader-CSfzkWxZ.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"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as i}from"./ScreenLayout-C2Le_YIv.mjs";import"ofetch";import"react";import"viem";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const n=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:n="Try again",secondaryCtaText:a="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:n,onClick:m},secondaryCta:{label:a,onClick:c},watermark:!0}),a={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(n,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{a as LoginFailedScreen,n as LoginFailedScreenView,a as default};
@@ -1 +0,0 @@
1
- import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useMemo as s}from"react";import{formatUnits as a}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c,B as d}from"./ModalHeader-CSfzkWxZ.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-BkoTqsec.mjs";import{t as u}from"./FundWalletMethodHeader-Dujd1j7J.mjs";import{I as f}from"./InfoBanner-Dk1KghcK.mjs";import{S as h}from"./Subtitle-CV-2yKE4.mjs";import{T as v}from"./Title-BnzYV3Is.mjs";import{W as g}from"./WalletInfoCard-TfOxho0A.mjs";import{u as j}from"./context-bWeWAiND.mjs";import{v as y,D as C}from"./useActiveWallet-CSq3KvGj.mjs";import{u as S}from"./internal-context-Z-fyxadS.mjs";import{a as I}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as T}from"./useWalletBalance-BDrbQBDX.mjs";import{u as b}from"./useWallets-izyyA2re.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{x as A,z as k}from"./index-DEtvMjrv.mjs";import{g as F}from"./getChainName-DjpPdUSc.mjs";import{g as D}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as U}from"./getErc20Balance-D0MGUaOw.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"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-BuCMjci7.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const x={component:()=>{let{wallets:k}=b(),{connectors:x}=S(),E=x.filter(y).flatMap((e=>e.wallets)),{data:$,setModalData:L,navigate:P,lastScreen:W}=I(),{rpcConfig:O,appId:R,createAnalyticsEvent:q,closePrivyModal:z}=S(),H=j(),[N,Q]=o(void 0),[X,Y]=o(!1),G=$?.funding,{reloadBalance:J}=T({rpcConfig:O,appId:R,address:"ethereum"===G.chainType?G.address:void 0,chain:"ethereum"===G.chainType?G.chain:void 0}),K="solana"===G.chainType,V=K?G.isUSDC?"USDC":"SOL":G.erc20Address?G.erc20ContractInfo?.symbol:G.chain.nativeCurrency.symbol,Z=K?E.find((({address:e})=>e===G.address)):k.find((({address:e})=>C(e)===C(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:W||"FundingMethodSelectionScreen"},funding:$?.funding,solanaFundingData:$?.solanaFundingData,sendTransaction:$?.sendTransaction}),P("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=H.solanaRpcs[G.chain];e?(G.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=o.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:G.address,mintAddress:D(G.chain)}):A({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);N&&r>N&&(Y(!0),q({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?a(r-N,6):a(r-N,9),token:G.isUSDC?"USDC":"SOL"}})),Q(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await U({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:O,appId:R});return e}})().then((e=>{N&&e>N&&(Y(!0),q({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:a(e-N,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),Q(e)})).catch((()=>Q(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[N]);let _=s((()=>null==N?"":G.isUSDC?n({amount:N,decimals:6}):K?M(N,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:N,decimals:G.erc20ContractInfo.decimals}):m({wei:N})),[N,K,G]),ee="ethereum"===G.chainType?G.chain.name:F(G.chain),re=s((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(v,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=s((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&D(G.chain)?`?spl-token=${D(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:B}),/*#__PURE__*/t(f,{theme:H.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(g,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>z({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let B=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{x as ManualTransferScreen,x as default};