@privy-io/react-auth 3.16.0 → 3.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/dist/cjs/AccountNotFoundScreen-B_Ii7HuZ.js +1 -0
  2. package/dist/cjs/{Address-DTfphH3Q.js → Address-DVa7_frc.js} +1 -1
  3. package/dist/cjs/AffirmativeConsentScreen-B7KmE68B.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-O8KznddG.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-C8K-iZIK.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-cOTXpUAv.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-yMOq8AmY.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-lFFqycAd.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DmvP14kc.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-xdYr4mxx.js → BridgeNetworkSelectionView-pkX-b3EU.js} +3 -3
  11. package/dist/cjs/CaptchaScreen-C0GEjNbh.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-yT0aNgm6.js +16 -0
  13. package/dist/cjs/ConnectEmailForm-BBb0J8Qw.js +3 -0
  14. package/dist/cjs/ConnectLedgerScreen-DUt1xIAQ.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-DsDH4IPK.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-DHifzxdh.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-BUgdLxoo.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-BYX8kgCj.js → ConnectPhoneForm-Cz02aWfj.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-QyJORAZG.js → ConnectWalletView-CWInrfMx.js} +1 -1
  20. package/dist/cjs/ConnectionStatusScreen-BVrAip_u.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BlSprwdt.js +1 -0
  22. package/dist/cjs/{CustomLandingScreenView-Cx9QR2CX.js → CustomLandingScreenView-FFU4u8kB.js} +6 -6
  23. package/dist/cjs/DelegatedActionsConsentScreen-2K48Ywrm.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-AuQpKTzg.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-C4LTqs6h.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-C32Uofc9.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-wfa1ho1-.js → EmbeddedWalletKeyExportScreen-SnvHNrgu.js} +4 -4
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-osK2tW68.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DKWmdrJ6.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DqSEVO7w.js +1 -0
  31. package/dist/cjs/{EnrollTotp-BzmjXzYC.js → EnrollTotp-CXMhvYqd.js} +8 -8
  32. package/dist/cjs/ErrorScreen-CPJ98NuU.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-s3pS-ZH-.js → FarcasterConnectStatusScreen-D13iXt7h.js} +5 -5
  34. package/dist/cjs/FarcasterSignerStatusScreen-Bf_kP9J_.js +29 -0
  35. package/dist/cjs/FiatOnrampScreen-BV4GPQv0.js +97 -0
  36. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-85QbPj5Z.js +2 -0
  37. package/dist/cjs/FundWalletMethodHeader-CcRikV5C.js +1 -0
  38. package/dist/cjs/FundWithBankDepositScreen-CETUOydb.js +58 -0
  39. package/dist/cjs/FundingEditAmountScreen-ro3pfZTg.js +1 -0
  40. package/dist/cjs/FundingMethodSelectionScreen-ecxVf53z.js +1 -0
  41. package/dist/cjs/InAppBrowserLoginNotPossible-BaL0j2oh.js +1 -0
  42. package/dist/cjs/InstallWalletScreen-D8WdMq8Y.js +1 -0
  43. package/dist/cjs/LandingScreen-D3EKQEkC.js +1 -0
  44. package/dist/cjs/{LinkConflictScreen-DnHf7IMX.js → LinkConflictScreen-Ch0YDBOh.js} +3 -3
  45. package/dist/cjs/LinkEmailScreen-BiHRv43F.js +1 -0
  46. package/dist/cjs/{LinkPasskeyScreen-CTN6f7yX.js → LinkPasskeyScreen-BkAhVm_K.js} +12 -12
  47. package/dist/cjs/LinkPhoneScreen-SMbGlFFp.js +1 -0
  48. package/dist/cjs/LoginFailedScreen-gThOR4ql.js +1 -0
  49. package/dist/cjs/ManualTransferScreen-C6_MKYQa.js +1 -0
  50. package/dist/cjs/MfaAuthEnrollmentFlowScreen-BGwEDhYM.js +1 -0
  51. package/dist/cjs/MfaAuthVerifyFlowScreen-FkpTmQLM.js +1 -0
  52. package/dist/cjs/MfaEnrollmentFlowScreen-D68k3d6k.js +1 -0
  53. package/dist/cjs/MfaVerifyFlowScreen-DPiE_Oju.js +1 -0
  54. package/dist/cjs/{ModalHeader-CakS8Dcu.js → ModalHeader-DGIBNq1A.js} +1 -1
  55. package/dist/cjs/MoonpayStatusScreen-Bwey-ZFS.js +16 -0
  56. package/dist/cjs/OAuthStatusScreen-DCIvmlua.js +1 -0
  57. package/dist/cjs/PasskeySelectSignupOrLogin-BrsgZDWY.js +1 -0
  58. package/dist/cjs/PasskeyStatusScreen-CRdrwEDq.js +3 -0
  59. package/dist/cjs/PasswordRecoveryScreen-nT66Ca8q.js +20 -0
  60. package/dist/cjs/{QrCode-C-Mk5-26.js → QrCode-Di8xGbem.js} +1 -1
  61. package/dist/cjs/RecoveryOAuthStatusScreen-BC6heUn-.js +1 -0
  62. package/dist/cjs/RecoveryPasswordCreateScreen-D6M_6kN8.js +1 -0
  63. package/dist/cjs/{RecoverySelectionScreen-BAJ1nLeO.js → RecoverySelectionScreen-BDCnVnE6.js} +2 -2
  64. package/dist/cjs/{Screen-Dp9-H_S8.js → Screen-B1vrS1Ly.js} +1 -1
  65. package/dist/cjs/{ScreenLayout-DANQ0V5E.js → ScreenLayout-yf03MRVf.js} +1 -1
  66. package/dist/cjs/SelectSourceAsset-BzCWfa5L.js +112 -0
  67. package/dist/cjs/SetAutomaticRecoveryScreen-CVn23TKd.js +14 -0
  68. package/dist/cjs/{SetWalletPasswordForm-B7bBDQ8N.js → SetWalletPasswordForm-0S2ymSzL.js} +4 -4
  69. package/dist/cjs/{SignRequestScreen-BUvgSx9X.js → SignRequestScreen-CPgU7Wo3.js} +4 -4
  70. package/dist/cjs/{StandardSignAndSendTransactionScreen-CzfhyIDP.js → StandardSignAndSendTransactionScreen-C-E3j4dP.js} +2 -2
  71. package/dist/cjs/TelegramAuthScreen-DiYpzHoT.js +1 -0
  72. package/dist/cjs/{TransactionDetails-BlPOqfEn.js → TransactionDetails-CHdkf5Rb.js} +1 -1
  73. package/dist/cjs/{TransactionErrorView-BpXI1X_G.js → TransactionErrorView-D1Nh7N_d.js} +4 -4
  74. package/dist/cjs/{TransferFromWalletScreen-Ds1sknGn.js → TransferFromWalletScreen-h9tRPXBH.js} +2 -2
  75. package/dist/cjs/{TransferOrBridgeLoadingScreen-CAYUlR4u.js → TransferOrBridgeLoadingScreen-DQZIn6hw.js} +2 -2
  76. package/dist/cjs/UpdateEmailScreen-BY3xMHK8.js +1 -0
  77. package/dist/cjs/UpdatePhoneScreen-ChbBiqBC.js +1 -0
  78. package/dist/cjs/UserLimitReachedScreen-AJZpREqN.js +1 -0
  79. package/dist/cjs/{WalletInfoCard-CRZt0t3t.js → WalletInfoCard-BfZ3_ji-.js} +6 -6
  80. package/dist/cjs/WalletInterstitialScreen-DRz63LSO.js +1 -0
  81. package/dist/cjs/{WalletLink-Cx_Zda0m.js → WalletLink--xpsJ0_X.js} +5 -5
  82. package/dist/cjs/{WalletOverflowButton-cnlzyqcK.js → WalletOverflowButton-B81EzN7L.js} +1 -1
  83. package/dist/cjs/{WarningBanner-COl_Q0K3.js → WarningBanner-DUcGaIpZ.js} +1 -1
  84. package/dist/cjs/abstract-smart-wallets.js +1 -1
  85. package/dist/cjs/{context-BAmjgwZ7.js → context-DTLyrNSs.js} +1 -1
  86. package/dist/cjs/{ethers-D8g2mvSK.js → ethers-DkYZ2n_L.js} +1 -1
  87. package/dist/cjs/extended-chains.js +1 -1
  88. package/dist/cjs/{getErc20Balance-C6ZUC_1B.js → getErc20Balance-CZkdpSqJ.js} +1 -1
  89. package/dist/cjs/{getErc20TokenInfo-DprFN1Dj.js → getErc20TokenInfo-B7OUw6ca.js} +1 -1
  90. package/dist/cjs/{index-BohqOluI.js → index-BbTBzvbB.js} +5 -5
  91. package/dist/cjs/{index-DIKBRogK.js → index-DLnQPdlD.js} +2 -2
  92. package/dist/cjs/index-DVVwP01f.js +1 -0
  93. package/dist/cjs/index.js +1 -1
  94. package/dist/cjs/internal.js +1 -1
  95. package/dist/cjs/privy-context-CqCBaHHR.js +1 -0
  96. package/dist/cjs/{shared-C-w7sNT2.js → shared-BrHBD7Qj.js} +1 -1
  97. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DAiUXgPZ.js → shouldProceedtoEmbeddedWalletCreationFlow-By7HZi5X.js} +1 -1
  98. package/dist/cjs/smart-wallets-CXiwZqOu.js +1 -0
  99. package/dist/cjs/smart-wallets.js +1 -1
  100. package/dist/cjs/solana.js +1 -1
  101. package/dist/cjs/{styles-s2f3dL_6.js → styles-BU6XkGeI.js} +4 -4
  102. package/dist/cjs/{to-ui-error-CqnwRcKJ.js → to-ui-error-Bxoctv93.js} +1 -1
  103. package/dist/cjs/ui.js +1 -1
  104. package/dist/cjs/use-export-wallet-B4aMG55I.js +1 -0
  105. package/dist/cjs/use-export-wallet-CJFX3PX0.js +1 -0
  106. package/dist/cjs/{useActiveWallet-CYUR_x0A.js → useActiveWallet-DEJxYDtx.js} +1 -1
  107. package/dist/cjs/{useGetTokenPrice-X3dW0I3y.js → useGetTokenPrice-zMimik1y.js} +1 -1
  108. package/dist/cjs/{useI18n-BsableMs.js → useI18n-CttJorXw.js} +1 -1
  109. package/dist/cjs/usePrivy-B61TDDeF.js +1 -0
  110. package/dist/cjs/{useSolanaRpcClient-BhX1Bzre.js → useSolanaRpcClient-B5g3sWrW.js} +1 -1
  111. package/dist/cjs/{useWalletBalance-CcicA-jd.js → useWalletBalance-BD5uRFtG.js} +1 -1
  112. package/dist/cjs/useWallets-BsO73htS.js +1 -0
  113. package/dist/cjs/useWallets-CAFhVWLf.js +1 -0
  114. package/dist/dts/{events-context-DJ7XN_9I.d.mts → events-context-BXis4NRh.d.mts} +1 -1
  115. package/dist/dts/{events-context-DJ7XN_9I.d.ts → events-context-BXis4NRh.d.ts} +1 -1
  116. package/dist/dts/extended-chains.d.mts +1 -1
  117. package/dist/dts/extended-chains.d.ts +1 -1
  118. package/dist/dts/farcaster.d.mts +1 -1
  119. package/dist/dts/farcaster.d.ts +1 -1
  120. package/dist/dts/index.d.mts +41 -8
  121. package/dist/dts/index.d.ts +41 -8
  122. package/dist/dts/internal.d.mts +1 -1
  123. package/dist/dts/internal.d.ts +1 -1
  124. package/dist/dts/smart-wallets.d.mts +1 -1
  125. package/dist/dts/smart-wallets.d.ts +1 -1
  126. package/dist/dts/solana.d.mts +3 -3
  127. package/dist/dts/solana.d.ts +3 -3
  128. package/dist/dts/{types-CrwMc83t.d.mts → types-Bc9w_mgT.d.mts} +3 -2
  129. package/dist/dts/{types-CrwMc83t.d.ts → types-Bc9w_mgT.d.ts} +3 -2
  130. package/dist/dts/ui.d.mts +1 -1
  131. package/dist/dts/ui.d.ts +1 -1
  132. package/dist/esm/AccountNotFoundScreen-qafr9ivT.mjs +1 -0
  133. package/dist/esm/{Address-Cbulz6Wu.mjs → Address-B99EaiMb.mjs} +1 -1
  134. package/dist/esm/AffirmativeConsentScreen-CIqvK8m6.mjs +6 -0
  135. package/dist/esm/AllowlistRejectionScreen-DU4DWBPE.mjs +1 -0
  136. package/dist/esm/AuthenticateWithWalletScreen-XPD7DrVO.mjs +1 -0
  137. package/dist/esm/AwaitingEvmToSolBridgingScreen-DD0jtqOa.mjs +2 -0
  138. package/dist/esm/AwaitingExternalEthereumTransferScreen-DzTmic9m.mjs +2 -0
  139. package/dist/esm/AwaitingPasswordlessCodeScreen-7QOTS6b-.mjs +103 -0
  140. package/dist/esm/AwaitingSolToEvmBridgingScreen-DYZZooDp.mjs +2 -0
  141. package/dist/esm/{BridgeNetworkSelectionView-nrYQOGZA.mjs → BridgeNetworkSelectionView-CmMVzAX5.mjs} +5 -5
  142. package/dist/esm/CaptchaScreen-DhwS3FJh.mjs +1 -0
  143. package/dist/esm/CoinbaseOnrampStatusScreen-CTrA4xKy.mjs +16 -0
  144. package/dist/esm/ConnectEmailForm-yaDsKJmn.mjs +3 -0
  145. package/dist/esm/ConnectLedgerScreen-O8ZnkCDn.mjs +9 -0
  146. package/dist/esm/ConnectOnlyLandingScreen-BUO28erJ.mjs +1 -0
  147. package/dist/esm/ConnectOnlyStatusScreen-Dy6oAk17.mjs +1 -0
  148. package/dist/esm/ConnectOrCreateScreen-H52RmK3k.mjs +1 -0
  149. package/dist/esm/{ConnectPhoneForm-D8SHd_ge.mjs → ConnectPhoneForm-SXho-ZCl.mjs} +1 -1
  150. package/dist/esm/{ConnectWalletView-By6eXfKl.mjs → ConnectWalletView-mm5nV3qj.mjs} +1 -1
  151. package/dist/esm/ConnectionStatusScreen-XXeNlflJ.mjs +7 -0
  152. package/dist/esm/CrossAppAuthScreen-bAev2vFm.mjs +1 -0
  153. package/dist/esm/{CustomLandingScreenView-Co0nHKPw.mjs → CustomLandingScreenView-e-NPZniC.mjs} +4 -4
  154. package/dist/esm/DelegatedActionsConsentScreen-C2uGvUf3.mjs +1 -0
  155. package/dist/esm/DelegatedActionsRevokeScreen-DIURa5L6.mjs +1 -0
  156. package/dist/esm/EmbeddedWalletConnectingScreen-CznyXfNg.mjs +1 -0
  157. package/dist/esm/EmbeddedWalletCreatedScreen-Vch95Jje.mjs +1 -0
  158. package/dist/esm/EmbeddedWalletKeyExportScreen-kW2-IWjW.mjs +40 -0
  159. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-DtrWxrnI.mjs +1 -0
  160. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-QLodnJ1t.mjs +1 -0
  161. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-B0gtNXG6.mjs +1 -0
  162. package/dist/esm/{EnrollTotp-nZPSS3Ux.mjs → EnrollTotp-Du2Tjgrx.mjs} +5 -5
  163. package/dist/esm/ErrorScreen-P5oZf9cz.mjs +4 -0
  164. package/dist/esm/{FarcasterConnectStatusScreen-BdwUuSkv.mjs → FarcasterConnectStatusScreen-dpPMJ4I7.mjs} +8 -8
  165. package/dist/esm/FarcasterSignerStatusScreen-COkxl1bH.mjs +28 -0
  166. package/dist/esm/FiatOnrampScreen-Ci0mAJY4.mjs +97 -0
  167. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DW0tS4tS.mjs +1 -0
  168. package/dist/esm/FundWalletMethodHeader-D38FBVVM.mjs +1 -0
  169. package/dist/esm/FundWithBankDepositScreen-Dk_IouhM.mjs +58 -0
  170. package/dist/esm/FundingEditAmountScreen-BLsQoL4e.mjs +1 -0
  171. package/dist/esm/FundingMethodSelectionScreen-OlDe5HS2.mjs +1 -0
  172. package/dist/esm/InAppBrowserLoginNotPossible-BV3tTire.mjs +1 -0
  173. package/dist/esm/InstallWalletScreen-BMmSUe34.mjs +1 -0
  174. package/dist/esm/LandingScreen-B83IEgoc.mjs +1 -0
  175. package/dist/esm/{LinkConflictScreen-DNGVg8dW.mjs → LinkConflictScreen-DNiusVkA.mjs} +3 -3
  176. package/dist/esm/LinkEmailScreen-1OEkvtrp.mjs +1 -0
  177. package/dist/esm/{LinkPasskeyScreen-CTYGeo1r.mjs → LinkPasskeyScreen-CHPataTs.mjs} +5 -5
  178. package/dist/esm/LinkPhoneScreen-DiwKH2Mt.mjs +1 -0
  179. package/dist/esm/LoginFailedScreen-CDmqpAN2.mjs +1 -0
  180. package/dist/esm/ManualTransferScreen-DyN3_kBX.mjs +1 -0
  181. package/dist/esm/MfaAuthEnrollmentFlowScreen-BNV7WReW.mjs +1 -0
  182. package/dist/esm/MfaAuthVerifyFlowScreen-B-ukVyrA.mjs +1 -0
  183. package/dist/esm/MfaEnrollmentFlowScreen-COe5FpFP.mjs +1 -0
  184. package/dist/esm/MfaVerifyFlowScreen-DCIPle0Z.mjs +1 -0
  185. package/dist/esm/{ModalHeader-DfHxv9fE.mjs → ModalHeader-DpkEBdQv.mjs} +1 -1
  186. package/dist/esm/MoonpayStatusScreen-_owltgjZ.mjs +16 -0
  187. package/dist/esm/OAuthStatusScreen-KZmCHc_b.mjs +1 -0
  188. package/dist/esm/PasskeySelectSignupOrLogin-CQ_DHbaT.mjs +1 -0
  189. package/dist/esm/PasskeyStatusScreen-eu3lPB6M.mjs +3 -0
  190. package/dist/esm/PasswordRecoveryScreen-DndhFHx6.mjs +20 -0
  191. package/dist/esm/{QrCode-D4XZQrgi.mjs → QrCode-D-J14re9.mjs} +1 -1
  192. package/dist/esm/RecoveryOAuthStatusScreen-CwCRvxCX.mjs +1 -0
  193. package/dist/esm/RecoveryPasswordCreateScreen-DrRcz4CY.mjs +1 -0
  194. package/dist/esm/{RecoverySelectionScreen-DVBTi436.mjs → RecoverySelectionScreen-CPHkQlGF.mjs} +2 -2
  195. package/dist/esm/{Screen-CDEd4p2a.mjs → Screen-B0u1eY7p.mjs} +3 -3
  196. package/dist/esm/{ScreenLayout-BdRrZJd_.mjs → ScreenLayout-CyK-vOMq.mjs} +1 -1
  197. package/dist/esm/SelectSourceAsset-ac3FApgI.mjs +112 -0
  198. package/dist/esm/{SetAutomaticRecoveryScreen-DBcSNU6R.mjs → SetAutomaticRecoveryScreen-DLY7WHVZ.mjs} +2 -2
  199. package/dist/esm/{SetWalletPasswordForm-DdWjdu2s.mjs → SetWalletPasswordForm-CQWh647N.mjs} +4 -4
  200. package/dist/esm/SignRequestScreen-BYHN19dO.mjs +26 -0
  201. package/dist/esm/{StandardSignAndSendTransactionScreen-DIJRS8NR.mjs → StandardSignAndSendTransactionScreen-5sT-AMvv.mjs} +2 -2
  202. package/dist/esm/TelegramAuthScreen-DATrHQkr.mjs +1 -0
  203. package/dist/esm/{TransactionDetails-Ce_Cnzo2.mjs → TransactionDetails-D9GBw9C3.mjs} +4 -4
  204. package/dist/esm/{TransactionErrorView-JiZmO7NJ.mjs → TransactionErrorView-3qTJ_97m.mjs} +5 -5
  205. package/dist/esm/{TransferFromWalletScreen-ad5b7GV7.mjs → TransferFromWalletScreen-w3c3g8ys.mjs} +2 -2
  206. package/dist/esm/{TransferOrBridgeLoadingScreen-Cwzefd9j.mjs → TransferOrBridgeLoadingScreen-koaJdk-2.mjs} +1 -1
  207. package/dist/esm/UpdateEmailScreen-BKTgKvoR.mjs +1 -0
  208. package/dist/esm/UpdatePhoneScreen-z7-7NbIO.mjs +1 -0
  209. package/dist/esm/UserLimitReachedScreen-BK77vZJo.mjs +1 -0
  210. package/dist/esm/{WalletInfoCard-D2dCT7_H.mjs → WalletInfoCard-hC5PhrNs.mjs} +1 -1
  211. package/dist/esm/WalletInterstitialScreen-DzDGk-y-.mjs +1 -0
  212. package/dist/esm/{WalletLink-DNraFqEC.mjs → WalletLink-sGQdBvAh.mjs} +1 -1
  213. package/dist/esm/{WalletOverflowButton-Cn_nKCBf.mjs → WalletOverflowButton-BrrkHpeZ.mjs} +1 -1
  214. package/dist/esm/{WarningBanner-c8L53pJ2.mjs → WarningBanner-D5LqDt95.mjs} +2 -2
  215. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  216. package/dist/esm/{context-Cw2-86-G.mjs → context-Bj4czVEP.mjs} +1 -1
  217. package/dist/esm/{ethers-5oa3ZKLD.mjs → ethers-BozrzoVi.mjs} +1 -1
  218. package/dist/esm/extended-chains.mjs +1 -1
  219. package/dist/esm/{getErc20Balance-sCX8nL1s.mjs → getErc20Balance-NThD2gHO.mjs} +1 -1
  220. package/dist/esm/{getErc20TokenInfo-CwiO-mOs.mjs → getErc20TokenInfo-BtdscGyJ.mjs} +1 -1
  221. package/dist/esm/index-CuKtz_xL.mjs +12 -0
  222. package/dist/esm/index-DQp_5KKJ.mjs +174 -0
  223. package/dist/esm/index-Ds8yBPhi.mjs +1 -0
  224. package/dist/esm/index.mjs +1 -1
  225. package/dist/esm/internal.mjs +1 -1
  226. package/dist/esm/privy-context-DICqtyyT.mjs +1 -0
  227. package/dist/esm/{shared-Bw0pXSOO.mjs → shared-zCv-_9Pa.mjs} +1 -1
  228. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs → shouldProceedtoEmbeddedWalletCreationFlow-DLpCU-0h.mjs} +1 -1
  229. package/dist/esm/smart-wallets-B8GvSECb.mjs +1 -0
  230. package/dist/esm/smart-wallets.mjs +1 -1
  231. package/dist/esm/solana.mjs +1 -1
  232. package/dist/esm/{styles-D5Jf27-u.mjs → styles-pSKfqjN3.mjs} +15 -15
  233. package/dist/esm/{to-ui-error-DnDY_33E.mjs → to-ui-error-KRq5_d4z.mjs} +2 -2
  234. package/dist/esm/ui.mjs +1 -1
  235. package/dist/esm/use-export-wallet-D1P_g8O0.mjs +1 -0
  236. package/dist/esm/use-export-wallet-DVyBljMT.mjs +1 -0
  237. package/dist/esm/{useActiveWallet-CwS7ik68.mjs → useActiveWallet-DMrO7evY.mjs} +1 -1
  238. package/dist/esm/useGetTokenPrice-N5ZX6Yun.mjs +1 -0
  239. package/dist/esm/{useI18n-bIQlZhkW.mjs → useI18n-BiiKgmqw.mjs} +1 -1
  240. package/dist/esm/usePrivy-DDB15S8o.mjs +1 -0
  241. package/dist/esm/{useSolanaRpcClient-C2WlA-Ah.mjs → useSolanaRpcClient-B--BKNG3.mjs} +1 -1
  242. package/dist/esm/{useWalletBalance-DopZXXwh.mjs → useWalletBalance-C0WFIwSX.mjs} +1 -1
  243. package/dist/esm/useWallets-CJvLEQqE.mjs +1 -0
  244. package/dist/esm/useWallets-CS_W9ciB.mjs +1 -0
  245. package/package.json +5 -5
  246. package/dist/cjs/AccountNotFoundScreen-Bqh-CYrp.js +0 -1
  247. package/dist/cjs/AffirmativeConsentScreen-uogZ44HQ.js +0 -6
  248. package/dist/cjs/AllowlistRejectionScreen-3OKwgh23.js +0 -1
  249. package/dist/cjs/AuthenticateWithWalletScreen-DXy5TnZj.js +0 -1
  250. package/dist/cjs/AwaitingEvmToSolBridgingScreen-DR1RiU-S.js +0 -2
  251. package/dist/cjs/AwaitingExternalEthereumTransferScreen-DgQ9z_ck.js +0 -2
  252. package/dist/cjs/AwaitingPasswordlessCodeScreen-Bah7kXAV.js +0 -103
  253. package/dist/cjs/AwaitingSolToEvmBridgingScreen-HSwPZmzZ.js +0 -2
  254. package/dist/cjs/CaptchaScreen-BLoD3u63.js +0 -1
  255. package/dist/cjs/CoinbaseOnrampStatusScreen-CoSS2KfY.js +0 -16
  256. package/dist/cjs/ConnectEmailForm-BjXzo_T8.js +0 -3
  257. package/dist/cjs/ConnectLedgerScreen-Brfd_c8H.js +0 -9
  258. package/dist/cjs/ConnectOnlyLandingScreen-C41qgoJf.js +0 -1
  259. package/dist/cjs/ConnectOnlyStatusScreen-DPsh3aXI.js +0 -1
  260. package/dist/cjs/ConnectOrCreateScreen-Dpv9J_eC.js +0 -1
  261. package/dist/cjs/ConnectionStatusScreen-DfKCyYnE.js +0 -7
  262. package/dist/cjs/CrossAppAuthScreen-CAmbPQb0.js +0 -1
  263. package/dist/cjs/DelegatedActionsConsentScreen-DOvRMKf-.js +0 -1
  264. package/dist/cjs/DelegatedActionsRevokeScreen-5ecaxQ0D.js +0 -1
  265. package/dist/cjs/EmbeddedWalletConnectingScreen-B31DzW7n.js +0 -1
  266. package/dist/cjs/EmbeddedWalletCreatedScreen-BXEozrA_.js +0 -1
  267. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-DSrn-F5R.js +0 -1
  268. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DGlv7LlS.js +0 -1
  269. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-Byr5dLg5.js +0 -1
  270. package/dist/cjs/ErrorScreen-DJwJwrGn.js +0 -4
  271. package/dist/cjs/FarcasterSignerStatusScreen--CVrZRE9.js +0 -29
  272. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-3Fn4CnSA.js +0 -2
  273. package/dist/cjs/FundWalletMethodHeader-D2fapeXN.js +0 -1
  274. package/dist/cjs/FundWithBankDepositScreen-DUQAuyf5.js +0 -176
  275. package/dist/cjs/FundingEditAmountScreen-B3wEw9xm.js +0 -1
  276. package/dist/cjs/FundingMethodSelectionScreen-ChQNeyi6.js +0 -1
  277. package/dist/cjs/InAppBrowserLoginNotPossible-XFkxHwKR.js +0 -1
  278. package/dist/cjs/InstallWalletScreen-Cp3ZRRYf.js +0 -1
  279. package/dist/cjs/LandingScreen-DwFs0lRf.js +0 -1
  280. package/dist/cjs/LinkEmailScreen-_sfK6ECC.js +0 -1
  281. package/dist/cjs/LinkPhoneScreen-BjMfF3Kz.js +0 -1
  282. package/dist/cjs/LoginFailedScreen-BUnuwN-5.js +0 -1
  283. package/dist/cjs/ManualTransferScreen-D2hHGf6p.js +0 -1
  284. package/dist/cjs/MfaAuthEnrollmentFlowScreen-VFaXkogp.js +0 -1
  285. package/dist/cjs/MfaAuthVerifyFlowScreen-CVBdW4Cw.js +0 -1
  286. package/dist/cjs/MfaEnrollmentFlowScreen-DxkzCr5s.js +0 -1
  287. package/dist/cjs/MfaVerifyFlowScreen-AFZc7liT.js +0 -1
  288. package/dist/cjs/MoonpayStatusScreen-C66Eq4G4.js +0 -16
  289. package/dist/cjs/OAuthStatusScreen-NKl6SLvR.js +0 -1
  290. package/dist/cjs/PasskeySelectSignupOrLogin-D9VfPofR.js +0 -1
  291. package/dist/cjs/PasskeyStatusScreen-CBC-60D2.js +0 -3
  292. package/dist/cjs/PasswordRecoveryScreen-BSUhAJ63.js +0 -20
  293. package/dist/cjs/RecoveryOAuthStatusScreen-y2Z3cphT.js +0 -1
  294. package/dist/cjs/RecoveryPasswordCreateScreen-CoDYHaJk.js +0 -1
  295. package/dist/cjs/SetAutomaticRecoveryScreen-BLiDEmlE.js +0 -14
  296. package/dist/cjs/TelegramAuthScreen-BGB40HSe.js +0 -1
  297. package/dist/cjs/UpdateEmailScreen-Bgn5JxGJ.js +0 -1
  298. package/dist/cjs/UpdatePhoneScreen-DPAxfLv5.js +0 -1
  299. package/dist/cjs/UserLimitReachedScreen-BG8gj4ah.js +0 -1
  300. package/dist/cjs/WalletInterstitialScreen-CBH05HpE.js +0 -1
  301. package/dist/cjs/get-is-unified-wallet-DitrQ4hx.js +0 -1
  302. package/dist/cjs/index-CCY3tkwt.js +0 -1
  303. package/dist/cjs/smart-wallets-BtILJe_K.js +0 -1
  304. package/dist/cjs/use-export-wallet-C6DaLOxp.js +0 -1
  305. package/dist/cjs/use-export-wallet-eDTOzHRt.js +0 -1
  306. package/dist/cjs/usePrivy-CHcu9hX8.js +0 -1
  307. package/dist/cjs/useWallets-CbvzYOqg.js +0 -1
  308. package/dist/cjs/useWallets-Cy6axcvW.js +0 -1
  309. package/dist/esm/AccountNotFoundScreen-BSYd-8_2.mjs +0 -1
  310. package/dist/esm/AffirmativeConsentScreen-C_uGmdSa.mjs +0 -6
  311. package/dist/esm/AllowlistRejectionScreen-DBdNYwS-.mjs +0 -1
  312. package/dist/esm/AuthenticateWithWalletScreen-D-Aw0iYo.mjs +0 -1
  313. package/dist/esm/AwaitingEvmToSolBridgingScreen-BMr5CXgX.mjs +0 -2
  314. package/dist/esm/AwaitingExternalEthereumTransferScreen-aOEMTW-b.mjs +0 -2
  315. package/dist/esm/AwaitingPasswordlessCodeScreen-CjPJ7IMM.mjs +0 -103
  316. package/dist/esm/AwaitingSolToEvmBridgingScreen-xrFngED1.mjs +0 -2
  317. package/dist/esm/CaptchaScreen-BOKElE1r.mjs +0 -1
  318. package/dist/esm/CoinbaseOnrampStatusScreen-CTV5uUn3.mjs +0 -16
  319. package/dist/esm/ConnectEmailForm-Dp85JvZj.mjs +0 -3
  320. package/dist/esm/ConnectLedgerScreen-rxzesP5N.mjs +0 -9
  321. package/dist/esm/ConnectOnlyLandingScreen-CmImF7oZ.mjs +0 -1
  322. package/dist/esm/ConnectOnlyStatusScreen-Bo90w6P9.mjs +0 -1
  323. package/dist/esm/ConnectOrCreateScreen-Dc2VQF-B.mjs +0 -1
  324. package/dist/esm/ConnectionStatusScreen-C_fxSXJ2.mjs +0 -7
  325. package/dist/esm/CrossAppAuthScreen-DU0FD2ep.mjs +0 -1
  326. package/dist/esm/DelegatedActionsConsentScreen-Dr-DeIXC.mjs +0 -1
  327. package/dist/esm/DelegatedActionsRevokeScreen-kXOJxXu-.mjs +0 -1
  328. package/dist/esm/EmbeddedWalletConnectingScreen-tFedaOj3.mjs +0 -1
  329. package/dist/esm/EmbeddedWalletCreatedScreen-DCx4NdAp.mjs +0 -1
  330. package/dist/esm/EmbeddedWalletKeyExportScreen-CVflSsvz.mjs +0 -40
  331. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-vSzXa62f.mjs +0 -1
  332. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-B4szV9Hg.mjs +0 -1
  333. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BOBLnE_O.mjs +0 -1
  334. package/dist/esm/ErrorScreen-BGE6wldq.mjs +0 -4
  335. package/dist/esm/FarcasterSignerStatusScreen-C-crikPv.mjs +0 -28
  336. package/dist/esm/FundSolWalletWithExternalSolanaWallet-BX4gYmzv.mjs +0 -1
  337. package/dist/esm/FundWalletMethodHeader-CdXWChwL.mjs +0 -1
  338. package/dist/esm/FundWithBankDepositScreen-HyqTUpLq.mjs +0 -176
  339. package/dist/esm/FundingEditAmountScreen--ffFSUmf.mjs +0 -1
  340. package/dist/esm/FundingMethodSelectionScreen-Djr0jY03.mjs +0 -1
  341. package/dist/esm/InAppBrowserLoginNotPossible-D6wMCuzD.mjs +0 -1
  342. package/dist/esm/InstallWalletScreen-B6VSXUWR.mjs +0 -1
  343. package/dist/esm/LandingScreen-BV0xq-oc.mjs +0 -1
  344. package/dist/esm/LinkEmailScreen-CtMuCZvp.mjs +0 -1
  345. package/dist/esm/LinkPhoneScreen-2nnXZB2B.mjs +0 -1
  346. package/dist/esm/LoginFailedScreen-hHvIsH81.mjs +0 -1
  347. package/dist/esm/ManualTransferScreen-C0xJ3si8.mjs +0 -1
  348. package/dist/esm/MfaAuthEnrollmentFlowScreen-CznUpkq5.mjs +0 -1
  349. package/dist/esm/MfaAuthVerifyFlowScreen-DUmOZHGX.mjs +0 -1
  350. package/dist/esm/MfaEnrollmentFlowScreen-DeoSfYAS.mjs +0 -1
  351. package/dist/esm/MfaVerifyFlowScreen-JJ1crW_8.mjs +0 -1
  352. package/dist/esm/MoonpayStatusScreen-BIzQZK9f.mjs +0 -16
  353. package/dist/esm/OAuthStatusScreen-DhmaZBTY.mjs +0 -1
  354. package/dist/esm/PasskeySelectSignupOrLogin-BmiJnukl.mjs +0 -1
  355. package/dist/esm/PasskeyStatusScreen-BStwA1_J.mjs +0 -3
  356. package/dist/esm/PasswordRecoveryScreen-DyBDQADG.mjs +0 -20
  357. package/dist/esm/RecoveryOAuthStatusScreen-BfcxgkUL.mjs +0 -1
  358. package/dist/esm/RecoveryPasswordCreateScreen-CBfvjxht.mjs +0 -1
  359. package/dist/esm/SignRequestScreen-CxAuntSd.mjs +0 -26
  360. package/dist/esm/TelegramAuthScreen-BRDG8b6x.mjs +0 -1
  361. package/dist/esm/UpdateEmailScreen-C5lQJUiA.mjs +0 -1
  362. package/dist/esm/UpdatePhoneScreen-BwkzWVHl.mjs +0 -1
  363. package/dist/esm/UserLimitReachedScreen-ComDV9kj.mjs +0 -1
  364. package/dist/esm/WalletInterstitialScreen-riBB51NH.mjs +0 -1
  365. package/dist/esm/get-is-unified-wallet-CQc-E5dS.mjs +0 -1
  366. package/dist/esm/index-B5B9f4U9.mjs +0 -12
  367. package/dist/esm/index-Bvw5OxHl.mjs +0 -174
  368. package/dist/esm/index-yxF2V6XY.mjs +0 -1
  369. package/dist/esm/smart-wallets-Dl42tBUP.mjs +0 -1
  370. package/dist/esm/use-export-wallet-Bd5Sg5V-.mjs +0 -1
  371. package/dist/esm/use-export-wallet-NF9h_lS_.mjs +0 -1
  372. package/dist/esm/useGetTokenPrice-oI6b3gPZ.mjs +0 -1
  373. package/dist/esm/usePrivy-DAnfSvB5.mjs +0 -1
  374. package/dist/esm/useWallets-2_uCkhA8.mjs +0 -1
  375. package/dist/esm/useWallets-DpbBw4Vl.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-Cw2-86-G.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-CQc-E5dS.mjs";import{s as x}from"./shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs";import{S as E}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./index-Bvw5OxHl.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.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-DfHxv9fE.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-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const b=({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:b,onClearError:S})=>{let[w,T]=n(A);a((()=>{y||T(A)}),[y]);let k=async e=>{e.preventDefault();let r=e.currentTarget.value.replace(" ","");if(""===r)return;if(isNaN(Number(r)))return void b?.("Code should be numeric");S?.();let o=Number(e.currentTarget.name?.charAt(5)),t=[...r||[""]].slice(0,C-o),i=[...w.slice(0,o),...t,...w.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(E,{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(I,{children:[/*#__PURE__*/e("div",{children:w.map(((r,o)=>/*#__PURE__*/e("input",{name:`code-${o}`,type:"text",value:w[o],onChange:k,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(S?.(),T([...w.slice(0,e),"",...w.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(j,{$fail:!!y,$success:g,children:/*#__PURE__*/e("span",{children:"Invalid or expired verification code"===y?"Incorrect code":y||(g?"Success!":"")})})]})})})})};let C=6,A=Array(6).fill("");var S,w,T=((S=T||{})[S.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",S[S.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",S),k=((w=k||{})[w.EMAIL=0]="EMAIL",w[w.SMS=1]="SMS",w);const N={component:()=>{let{navigate:r,lastScreen:o,navigateBack:t,setModalData:i,onUserCloseViaDialogOrKeybindRef:s}=y(),c=p(),{closePrivyModal:l,resendEmailCode:d,resendSmsCode:E,getAuthMeta:C,loginWithCode:A,updateWallets:S,createAnalyticsEvent:w}=u(),{authenticated:T,logout:k,user:N}=g(),{whatsAppEnabled:_}=p(),[I,j]=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||"",F=m-500;a((()=>{if(O){let e=setTimeout((()=>{P(O-1)}),1e3);return()=>clearTimeout(e)}}),[O]),a((()=>{if(T&&I&&N){if(c?.legal.requireUsersAcceptTerms&&!N.hasAcceptedTerms){let e=setTimeout((()=>{r("AffirmativeConsentScreen")}),F);return()=>clearTimeout(e)}if(x(N,c.embeddedWallets)){let e=setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),k()},callAuthOnSuccessOnClose:!0}}),r("EmbeddedWalletOnAccountCreateScreen")}),F);return()=>clearTimeout(e)}{S();let e=setTimeout((()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0})),m);return()=>clearTimeout(e)}}}),[T,I,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(b,{contactMethod:W,authFlow:0===U?"email":"sms",appName:c?.name,whatsAppEnabled:_,onBack:()=>t(),onCodeSubmit:async e=>{try{await A(e),j(!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 E()},errorMessage:L||void 0,success:I,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
- `,I=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
- `,j=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,b 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 d}from"viem";import{ConnectedStandardSolanaWallet as l}from"@privy-io/js-sdk-core";import{b as c,c as m,R as u}from"./Layouts-BlFm53ED.mjs";import{B as p}from"./ModalHeader-DfHxv9fE.mjs";import{C as f}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as h}from"./FundWalletMethodHeader-CdXWChwL.mjs";import{N as g}from"./index-Dq_xe9dz.mjs";import{u as v,t as w}from"./context-Cw2-86-G.mjs";import{u as I,a as y,b as C}from"./internal-context-Z-fyxadS.mjs";import{z as T}from"./useActiveWallet-CwS7ik68.mjs";import{a as S}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{O as j}from"./analytics-mkkvFRju.mjs";import{g as A,t as b,d as N,a as F,b as U,u as E}from"./reservoir-0wfhnc0j.mjs";import{u as x}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as k}from"./usePrivy-DAnfSvB5.mjs";import{H as W,I as R}from"./use-export-wallet-Bd5Sg5V-.mjs";import{T as L}from"./TransferOrBridgeLoadingScreen-Cwzefd9j.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"./useWallets-2_uCkhA8.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";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-Cbulz6Wu.mjs";import"lucide-react";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";const P={component:function(){let P=v(),{closePrivyModal:B,createAnalyticsEvent:D,connectors:H}=I(),{navigate:$,setModalData:M,data:O}=S(),_=v(),q=o(!1),z=x(),[Q,V]=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,de=O.funding.erc20Address,le=O.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,ce=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 y("Unable to find source wallet connector");return new l({wallet:n.wallet,account:r})}({connectors:H,connectedWalletAddress:re?.address||""})),[re,H]),me=i((()=>{let e=z(k);if(!e)throw new y("Unable to load solana plugin");let t=P.solanaRpcs["solana:mainnet"];if(!t)throw new y("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(W(ce?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!ce||!oe||q.current)return;let e=z(k);if(!e)return void J(new y("Unable to solana plugin"));q.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(ne):d(ne),n=await A({isTestnet:!!oe.testnet,input:b({appId:_.id,amount:t.toString(),user:ce.address,recipient:se,destinationChainId:oe.id,originChainId:U,originCurrency:ie?N:F,destinationCurrency:ie?de:void 0})}).catch(console.error);if(!n)return void J(new y(`Unable to fetch quotes for bridging. Wallet ${R(ce.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE));let r=await e.createTransactionFromRelayQuote({quote:n,source:ce.address,solanaClient:me});if(r)try{V(!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 y("Something went wrong",void 0,C.TRANSACTION_FAILURE))):void J(new y(`Wallet ${R(ce?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${le} are needed to complete the transaction.`,void 0,C.INSUFFICIENT_BALANCE));let{signature:o}=await ce.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 y("Transaction was rejected by the user",void 0,C.TRANSACTION_FAILURE));J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))}else J(new y(`Unable to select bridge option from quotes. Wallet ${R(ce.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),E({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){V(!1),X(!0),D({eventName:j,payload:{provider:"external",status:"success",txHash:e,address:ce.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:ne,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){V(!1),J(e)}}),s((()=>{if(!G)return;let e=setTimeout(B,w);return()=>clearTimeout(e)}),[G]),s((()=>{Y&&(M({funding:O?.funding,solanaFundingData:O?.solanaFundingData,sendTransaction:O?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),$("ErrorScreen",!1))}),[Y]),G?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(c,{}),/*#__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} ${le} to your ${_.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):Q&&ce?/*#__PURE__*/t(L,{walletClientType:W(ce?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:Q,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-Bvw5OxHl.mjs";import{a as m}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as u}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"./context-Cw2-86-G.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.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"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.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]),y=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:y,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:y,reset:g,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[f,C]=s(!0);a((()=>(j(setTimeout(C,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),q=r?.captchaModalData,A=async e=>{try{await(q?.callback(e)),q?.onSuccessNavigateTo&&i(q?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(q?.onErrorNavigateTo||"ErrorScreen",!1)}};a((()=>{"success"===l?j(setTimeout((async()=>{let e=await y();!e||q?.userIntentRequired||A(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),a((()=>{if(!f)switch(l){case"success":w("Success!"),R("CAPTCHA passed successfully."),q?.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,f,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:k,userIntentRequired:q?.userIntentRequired,retriesRemaining:I,hasSelectedCta:S,onContinue:()=>{x(!0),A(d)},onRetry:async()=>{if(I<=0)return;T((e=>e-1)),g(),h();let e=await y();!e||q?.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-DfHxv9fE.mjs";import{a as u}from"./Layouts-BlFm53ED.mjs";import{L as g,O as f}from"./useActiveWallet-CwS7ik68.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as v}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{I as b}from"./index-Bvw5OxHl.mjs";import"./context-Cw2-86-G.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-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.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:I}=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");I?.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,I,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(I,{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
- `,I=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-Cw2-86-G.mjs";import{u as m,c,b as d}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./index-Bvw5OxHl.mjs";import{u,a as h}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{r as g,C as f}from"./useActiveWallet-CwS7ik68.mjs";import{B as E}from"./use-export-wallet-Bd5Sg5V-.mjs";import{E as S,P as y}from"./ModalHeader-DfHxv9fE.mjs";import{C as b}from"./Chip-D2-wZOHJ.mjs";import{I as v,a as C}from"./EmailInputForm-Dgoii4vf.mjs";import{E as k}from"./ErrorMessage-D8VaAP5m.mjs";const j=/*#__PURE__*/t(((t,l)=>{let[f,v]=o(t.defaultValue||""),[C,j]=o(""),[T,A]=o(!1),{authenticated:L}=u(),{initLoginWithEmail:M}=m(),{navigate:D,setModalData:I,currentScreen:U,data:N}=h(),{enabled:W,token:F}=p(),[R,$]=o(!1),{accountType:_}=g(),q=s();n((()=>{!f&&q.disablePlusEmails&&N?.inlineError?.error instanceof c&&N?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!C&&j("Please enter a valid email address without a '+'."),C&&j("")}),[f]);let B=E(f),H=T||!B,K=()=>{var e;I({login:N?.login,inlineError:void 0}),!W||F||L?(e=F,A(!0),M({email:f,captchaToken:e,disableSignup:N?.login?.disableSignup,withPrivyUi:!0}).then((()=>{D("AwaitingPasswordlessCodeScreen")})).catch((e=>{I({errorModalData:{error:e,previousScreen:U||"LandingScreen"}}),D("ErrorScreen")})).finally((()=>{A(!1)}))):(I({captchaModalData:{callback:e=>M({email:f,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(w,{children:[C&&/*#__PURE__*/a(k,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:C}),/*#__PURE__*/e(x,{stacked:t.stacked,$error:!!C,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:()=>$(!0),onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&K()},value:f,autoComplete:"email"}),"email"!==_||R?t.stacked?/*#__PURE__*/a("span",{}):/*#__PURE__*/a(S,{isSubmitting:T,onClick:K,disabled:H,children:"Submit"}):/*#__PURE__*/a(b,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/a(y,{loadingText:null,loading:T,disabled:H,onClick:K,style:{width:"100%"},children:"Submit"}):null]})}));let w=v,x=C,P=l(f)`
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-CQc-E5dS.mjs";import{S as n}from"./ScreenLayout-BdRrZJd_.mjs";import{H as m}from"./index-Bvw5OxHl.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.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-DAnfSvB5.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(d,{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
- `,d=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-Cw2-86-G.mjs";import{u as r,c as n,b as a}from"./internal-context-Z-fyxadS.mjs";import{a as i}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{i as c}from"./ConnectWalletView-By6eXfKl.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";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"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-D4XZQrgi.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-bIQlZhkW.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),u=i(),C=s?.externalConnectWallet?.description,E=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),j=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:E.current,walletChainType:j.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{u("connectWallet","onError",a.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{u("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),u("connectWallet","onError",e.privyErrorCode||a.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),u("connectWallet","onError",a.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:C,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-Bd5Sg5V-.mjs";import{q as n}from"./context-Cw2-86-G.mjs";import{z as a}from"./useActiveWallet-CwS7ik68.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as c}from"./ScreenLayout-BdRrZJd_.mjs";import{B as m}from"./index-Bvw5OxHl.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-C_fxSXJ2.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.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-DAnfSvB5.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-bIQlZhkW.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.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:v,closePrivyModal:j}=s(),[h,C]=t(void 0),[k,b]=t(0),x=a(v?.connector?.walletClientType||"unknown"),S="connected"===v?.status,R="switching_to_supported_chain"===v?.status;o((()=>{if(S){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=v.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&v.connector){let e=v.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:v.connector?.walletClientType,walletChainType:v.connector?.chainType}))}),n)}else e=setTimeout(j,n);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;v?.connectError&&(e=v?.connectError,C(p(e)))}),[v]);let T=v?.connector?.connectorType||"injected",W=v?.connector?.walletClientType||"unknown",E=x?.metadata?.shortName||x?.name||v?.connector?.walletBranding.name||"Browser Extension",B=x?.image_url?.md||v?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),M="Browser Extension"===E?E.toLowerCase():E;i=S?`Successfully connected with ${M}`:h?h.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&&h?_="Unable to connect wallet":h?_=h.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:E,walletLogo:B,success:S,errorMessage:h,title:i,subtitle:_,onRetry:()=>{b(k+1),C(void 0),v?.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-Cw2-86-G.mjs";import{C as r,L as i}from"./CustomLandingScreenView-Co0nHKPw.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./useWallets-2_uCkhA8.mjs";import"./get-is-unified-wallet-CQc-E5dS.mjs";import"@privy-io/are-addresses-equal";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-Bvw5OxHl.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-DAnfSvB5.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-By6eXfKl.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-D4XZQrgi.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-bIQlZhkW.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";import"./ConnectEmailForm-Dp85JvZj.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-D8SHd_ge.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-Cn_nKCBf.mjs";import"./ScreenLayout-BdRrZJd_.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-Bvw5OxHl.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as h}from"./context-Cw2-86-G.mjs";import{u as S}from"./useI18n-bIQlZhkW.mjs";import{C as y,P as f,w as C,k as v,y as b}from"./use-export-wallet-Bd5Sg5V-.mjs";import{isHex as T,getAddress as _}from"viem";import{b as E,u as R,k}from"./internal-context-Z-fyxadS.mjs";import{z as A}from"./useActiveWallet-CwS7ik68.mjs";import{u as W,a as I}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs";import{u as j}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-DAnfSvB5.mjs";import{S as O}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-2_uCkhA8.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"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"tinycolor2";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>T(e,{strict:!0}))).map((e=>_(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const M=e=>e?.privyErrorCode===E.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===E.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,x=({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:v,onCoinbaseReset:b,onDifferentWallet:T})=>{let{t:_}=S(),E=w?{label:"Use a different wallet",onClick:b,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:v,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(F,{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,T]=a(void 0),{authenticated:_,logout:O}=W(),{navigate:D,navigateBack:F,lastScreen:B,currentScreen:P,setModalData:q,data:z}=I(),H=w(),{t:X}=S(),{getAuthFlow:K,walletConnectionStatus:Y,closePrivyModal:Q,initLoginWithWallet:J,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=R(),{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=A(Y?.connector?.walletClientType||"unknown"),we=l&&"wallet_connect_v2"===Y?.connector?.connectorType||l&&"coinbase_wallet"===Y?.connector?.connectorType||l&&"base_account"===Y?.connector?.connectorType||l&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||l&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=K(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===z?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||_?J(Y.connectedWallet,pe,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>J(Y.connectedWallet,e,z?.login?.disableSignup,z?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&z?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),T(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.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(H?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,H.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((()=>Q({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==E.ALLOWLIST_REJECTED){if(e?.privyErrorCode===E.USER_LIMIT_REACHED)return console.error(new k(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==E.USER_DOES_NOT_EXIST)return e?.privyErrorCode===E.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account: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 T(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),c(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((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&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&ce(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",ve=Y?.connector?.walletClientType||"unknown",be=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===be?be.toLowerCase():be;t=n?X("connectionStatus.successfullyConnected",{walletName:_e}):C?X("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=X("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail: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"===ve&&l?Ee="Click continue to open and connect MetaMask.":"metamask"===ve?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?b()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):z?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===ve&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{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:B&&P!==B?F:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),T(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:F})}};let F=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,x as ConnectionStatusView,D as default,M 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-Cw2-86-G.mjs";import{R as s}from"./index-Bvw5OxHl.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-CQc-E5dS.mjs";import{n as d}from"./useActiveWallet-CwS7ik68.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-BkTDxfME.mjs";import{S as f}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-2_uCkhA8.mjs";import"viem";import"./use-export-wallet-Bd5Sg5V-.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-DAnfSvB5.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"./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"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:y,onUserCloseViaDialogOrKeybindRef:g}=m(),{crossAppAuthFlow:A,updateWallets:j,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),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 y({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 g.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(u(e,t.embeddedWallets)){let e=setTimeout((()=>{y({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${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-D2dCT7_H.mjs";import{u as n,r as c}from"./context-Cw2-86-G.mjs";import{u as m,a as l}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as u}from"./ScreenLayout-BdRrZJd_.mjs";import"styled-components";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-Cbulz6Wu.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-CDEd4p2a.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"})}),f={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=s(!1),[f,j]=s(),{address:y,onDelegate:h,onSuccess:w,onError:g}=t.delegatedActions.consent,v=async()=>{a?w():g(f??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return i((()=>{if(!a&&!f)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,f]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:f,onAccept:async()=>{try{await h(),u(!0)}catch(e){j(e)}},onDecline:()=>{v()},onClose:v})}};export{f as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,f 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-Cw2-86-G.mjs";import{u as c,a as m}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as p}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[y,f]=i(),{onRevoke:v,onSuccess:k,onError:w}=o.delegatedActions.revoke,h=async()=>{p?k():w(y??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!y)return;let e=setTimeout(h,a);return()=>clearTimeout(e)}),[p,y]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:y,onRevoke:async()=>{try{await v(),d(!0)}catch(e){f(e)}},onDeny:()=>{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-Bvw5OxHl.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{u as l,a as c}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as m}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"./context-Cw2-86-G.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.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"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.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()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:F,isUnifiedWallet:T=!1}=w?.connectWallet,W=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return W("User must be authenticated and have a Privy wallet before it can be connected");try{if(!T){if(!x||!P)return W("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 W("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:F}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:P}));t?.entropyId||W(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F}}),h(A)}catch(e){W("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))):W(e)}})(),()=>clearTimeout(e)):void 0:W("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{W("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
@@ -1 +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,e as c}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as a,r as n}from"./context-Cw2-86-G.mjs";import{u as m}from"./internal-context-Z-fyxadS.mjs";import{S as l}from"./ScreenLayout-BdRrZJd_.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=m(),{data:f,onUserCloseViaDialogOrKeybindRef:j}=i(),h=a(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:w}=f.createWallet,x=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:w})};o((()=>{let e=setTimeout(x,n);return()=>clearTimeout(e)}),[]),j.current=x;let A=p&&!((t?.linkedAccounts?.length??0)>1);/*#__PURE__*/return e(u,{title:A?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:A?"You've successfully created an account.":"Your account is secured.",onClose:x})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1,40 +0,0 @@
1
- import{jsx as e,jsxs as r,Fragment as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as d}from"./WarningBanner-c8L53pJ2.mjs";import{W as c}from"./WalletInfoCard-D2dCT7_H.mjs";import{u as s}from"./context-Cw2-86-G.mjs";import{u as p}from"./internal-context-Z-fyxadS.mjs";import{u as m,a as u}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as h}from"./ScreenLayout-BdRrZJd_.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-Cbulz6Wu.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s,onBack:p})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/r(t,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,onBack:p,showBack:!!p,watermark:!0,children:/*#__PURE__*/r(f,{children:[/*#__PURE__*/e(d,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let f=a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 1.25rem;
5
- text-align: left;
6
- `,g=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=a.div`
7
- display: flex;
8
- gap: 12px;
9
- height: 44px;
10
- `,x=a.div`
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- width: 100%;
15
- height: 100%;
16
- font-size: 16px;
17
- font-weight: 500;
18
- border-radius: var(--privy-border-radius-md);
19
- background-color: var(--privy-color-background-2);
20
- color: var(--privy-color-foreground-3);
21
- `;function w(t){let[a,d]=o(t.dimensions.width),[c,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();d(e)}let e=getComputedStyle(document.documentElement);s({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let m="ethereum"===t.chainType&&!t.imported&&!t.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
22
- /*#__PURE__*/r(I,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...c}:{v:"1",entropy_id:t.entropyId,entropy_id_verifier:t.entropyIdVerifier,hd_wallet_index:t.hdWalletIndex,chain_type:t.chainType,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...c},hash:{token:t.accessToken}})}),/*#__PURE__*/e(b,{children:"Loading..."}),m&&/*#__PURE__*/e(b,{children:"Loading..."})]})})}const k={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:d,clientAnalyticsId:c,client:h}=p(),f=s(),{data:g,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:k,appId:I,appClientId:b,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,chainType:T,address:V,isUnifiedWallet:W,imported:B,showBackButton:P}=g.keyExport,L=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},S=()=>{l({shouldCallAuthOnSuccess:!1}),w(),d({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:V}})};return i((()=>{if(!n)return L("User must be authenticated before exporting their wallet");h.getAccessToken().then(t).catch(L)}),[n,a]),v.current=S,/*#__PURE__*/e(y,{address:V,accessToken:r,appConfigTheme:f.appearance.palette.colorScheme,onClose:S,isLoading:!r,onBack:P?S:void 0,exportButtonProps:r?{origin:k,appId:I,appClientId:b,clientAnalyticsId:c,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,isUnifiedWallet:W,imported:B,chainType:T}:void 0})}};let I=a.div`
23
- overflow: visible;
24
- position: relative;
25
- overflow: none;
26
- height: 44px;
27
- display: flex;
28
- gap: 12px;
29
- `,b=a.div`
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
- width: 100%;
34
- height: 100%;
35
- font-size: 16px;
36
- font-weight: 500;
37
- border-radius: var(--privy-border-radius-md);
38
- background-color: var(--privy-color-background-2);
39
- color: var(--privy-color-foreground-3);
40
- `;export{k as EmbeddedWalletKeyExportScreen,y as EmbeddedWalletKeyExportView,k 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-Cw2-86-G.mjs";import{F as s,s as l,k as n,v as m,G as c,R as d}from"./index-Bvw5OxHl.mjs";import{u as p,m as u}from"./internal-context-Z-fyxadS.mjs";import{a as h,u as y}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as w}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as v}from"./ScreenLayout-BdRrZJd_.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const C=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(v,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),g={component:()=>{let{setModalData:t,navigate:v,data:g,onUserCloseViaDialogOrKeybindRef:f}=h(),j=a(),[b,S]=r(""),{embeddedWallets:x}=a(),{authenticated:W,user:O}=y(),{closePrivyModal:A,walletProxy:k,client:I}=p(),{onSuccess:P,onFailure:M,callAuthOnSuccessOnClose:R,shouldCreateEth:U,shouldCreateSol:E}=g.createWallet,K=w(),F=O?K(s)?.shouldCreateWallet({user:O}):void 0,L=!!O&&l(O,j.embeddedWallets.ethereum.createOnLogin,F),T=!!O&&n(O,j.embeddedWallets.solana.createOnLogin,F),V="legacy-embedded-wallets-only"===j.embeddedWallets.mode&&!0===j?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[q,D]=r(null),{create:z}=m(),G=U??L,H=E??T,Q=new d((async()=>{let e=await I.getAccessToken();if(O&&e&&k)try{let e,t=await i(O.id,"ethereum"),r=await i(O.id,"solana");if(G&&H)e=await z({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t}),e=await z({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(H)e=await z({chainType:"solana",walletIndex:0,latestUser:O,idempotencyKey:r});else{if(!G)return void A({shouldCallAuthOnSuccess:R});e=await z({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t})}D(e),v("EmbeddedWalletCreatedScreen")}catch(e){S(e.message)}}));return o((()=>W&&O?V?(t({...g,createWallet:{...g.createWallet,shouldCreateEth:G,shouldCreateSol:H},recoverySelection:{...g?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:G,shouldCreateSol:H}}),v(c({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:x.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void Q.execute():(v("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet")))),[V,W]),f.current=()=>null/*#__PURE__*/,e(C,{errorMessage:b||void 0,onClose:()=>{q?(P(q),A({shouldCallAuthOnSuccess:R})):(M(new u("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))}})}};export{g as EmbeddedWalletOnAccountCreateScreen,C as EmbeddedWalletOnAccountCreateView,g 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-CQc-E5dS.mjs";import{u as i}from"./context-Cw2-86-G.mjs";import{u as n,o as d,m as c}from"./internal-context-Z-fyxadS.mjs";import{g as l}from"./useWallets-2_uCkhA8.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-DdWjdu2s.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-DfHxv9fE.mjs";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./shared-Bw0pXSOO.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:R,refreshSessionAndUser:b,closePrivyModal:j,createAnalyticsEvent:C}=n(),{navigate:x,data:P,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=P.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,T="user-passcode"===D?.recoveryMethod;r((()=>{A||(x("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let L=()=>v?(N(v),void j({shouldCallAuthOnSuccess:!1})):O?(k(u),void j({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void j({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),j({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&R)try{C({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 R.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void C({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 b(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"wallet disconnected"}});w(s),C({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")),C({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-CQc-E5dS.mjs";import{S as c}from"./ScreenLayout-BdRrZJd_.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-Cw2-86-G.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-DfHxv9fE.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-CDEd4p2a.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-Cw2-86-G.mjs";import{a as c,P as l}from"./index-Bvw5OxHl.mjs";import{c as m,b as p,a as d,e as u}from"./internal-context-Z-fyxadS.mjs";import{a as T}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{R as g}from"./reservoir-0wfhnc0j.mjs";import{S as y}from"./ScreenLayout-BdRrZJd_.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DAnfSvB5.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"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";const h=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:h})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof d)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof u&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:s.errorTitle||"You don't have access to this app",detail:s.errorDetail||"Have you been invited?",ctaText:s.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,s);/*#__PURE__*/return t(y,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:h,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(h,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
2
- color: var(--privy-color-accent) !important;
3
- font-weight: 600;
4
- `;export{f as ErrorScreen,h 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-DSTf_eKU.mjs";import{L as c}from"./useActiveWallet-CwS7ik68.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-D4XZQrgi.mjs";import{u as d,q as u}from"./context-Cw2-86-G.mjs";import{u as g}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{S as h}from"./ScreenLayout-BdRrZJd_.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./use-export-wallet-Bd5Sg5V-.mjs";import"./useWallets-2_uCkhA8.mjs";import"viem";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-DfHxv9fE.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-CDEd4p2a.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:a,errorMessage:n,connectUri:d,onBack:u,onClose:g,onOpenFarcaster:f})=>/*#__PURE__*/e(h,i||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},primaryCta:d&&f?{label:"Open Farcaster app",onClick:f}:void 0,onBack:u,onClose:g,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},onBack:u,onClose:g,watermark:!0,children:d&&i&&/*#__PURE__*/e(w,{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(x,{children:[/*#__PURE__*/e(j,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(b,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(S,{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 w=n.div`
2
- margin-top: 24px;
3
- `,x=n.div`
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- gap: 24px;
8
- `,j=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
- `,S=n.div`
21
- font-size: 0.875rem;
22
- text-align: center;
23
- color: var(--privy-color-foreground-2);
24
- `,b=n.div`
25
- position: relative;
26
- width: 82px;
27
- height: 82px;
28
- `;const F={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,w]=r(!1),x=o([]),j=s?.farcasterSigner;a((()=>{let e=Date.now(),t=setInterval((async()=>{if(!j?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===j.status&&(clearInterval(t),v(!1),w(!0),x.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(j?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),v(!1),w(!0),x.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),x.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===j?.status?j.signer_approval_url:void 0;/*#__PURE__*/return e(k,{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{F as FarcasterSignerStatusScreen,k as FarcasterSignerStatusView,F 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-DfHxv9fE.mjs";import{b as m,c,R as d,e as u}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-CdXWChwL.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 y}from"./context-Cw2-86-G.mjs";import{u as C,a as L,b as x}from"./internal-context-Z-fyxadS.mjs";import{a as F}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{u as k,g as U}from"./useWallets-DpbBw4Vl.mjs";import{u as T}from"./useGetTokenPrice-oI6b3gPZ.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as W}from"@solana-program/system";import{pipe as b,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-C2WlA-Ah.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{H as J}from"./use-export-wallet-Bd5Sg5V-.mjs";import"styled-components";import"./useActiveWallet-CwS7ik68.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./useWallets-2_uCkhA8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./usePrivy-DAnfSvB5.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}=C(),{data:S,setModalData:G,navigate:z}=F(),{wallets:ee}=k(),[te,ne]=o("preparing"),[oe,re]=o(),[se,ie]=o(),[le,me]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ce,asset:de,chain:ue,sourceWalletData:pe,destinationAddress:fe,afterSuccessScreen:ge}=S.solanaFundingData,he=ee.find((e=>e.address===pe.address&&J(pe.walletClientType)===J(e.standardWallet.name))),Ie=q()(ue),{tokenPrice:we,isTokenPriceLoading:ve}=T("solana");return r((()=>{if("preparing"!==te||ve||!he)return;let e="SOL"===de?Z(ce):function(e){return BigInt(Math.floor(1e6*parseFloat(e)))}(ce);ie({amount:("SOL"===de&&we?V(e,we):ce)??ce}),("SOL"===de?async function({solanaClient:e,source:t,destination:a,amountInLamports:n}){let{value:o}=await e.rpc.getLatestBlockhash().send(),r={address:t},s=b(P({version:0}),(e=>D(r,e)),(e=>N(o,e)),(e=>O(W({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 d=$({payer:s,ata:l,owner:a,mint:o}),u=b(P({version:0}),(e=>D(s,e)),(e=>N(r,e)),(e=>c?.value?e:O(d,e)),(e=>O(R({source:i,destination:l,authority:s,amount:n}),e)),(e=>E(e)));return new Uint8Array(M().encode(u))}({solanaClient:Ie,source:he.address,destination:fe,amountInBaseUnits:e})).then(re).catch((e=>{ne("error"),me(e)}))}),[te,ce,de,ue,he,fe,ve,we]),r((()=>{"preparing"===te&&oe&&ae({tx:oe,solanaClient:Ie,amount:ce,asset:de,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,de,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,y);return()=>clearTimeout(e)}),[te]),/*#__PURE__*/t(a,"success"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(m,{}),/*#__PURE__*/t(c,{children:[/*#__PURE__*/e(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/e(p,{title:"Success!",description:`You’ve successfully added ${ce} ${de} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/e(d,{}),/*#__PURE__*/e(i,{})]}:"preparing"===te||"loaded"===te||"sending"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(u,{style:{marginTop:"16px"},children:/*#__PURE__*/e(g,{icon:he?.standardWallet.icon,name:he?.standardWallet.name})}),/*#__PURE__*/e(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===te&&he?`Confirming with ${he.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/e(K,{rows:[{label:"Source",value:s(pe.address)},{label:"Destination",value:s(fe)},{label:"Network",value:Y(ue)},{label:"Amount",value:se?.amount,isLoading:"preparing"===te},{label:"Estimated fee",value:se?.fee,isLoading:"preparing"===te},{label:"Total",value:se?.total,isLoading:"preparing"===te}]}),/*#__PURE__*/e(l,{style:{marginTop:"1rem"},loading:"preparing"===te||"sending"===te,onClick:function(){"loaded"===te&&oe&&he&&(ne("sending"),async function({transaction:e,chain:t,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:e});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:e,chain:t}).catch((e=>{throw new L("Transaction was rejected by the user",e,x.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:Ie,transaction:oe,chain:ue,sourceWallet:he}).then((e=>{ne("success"),v({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:he.address,value:ce,chainType:"solana",clusterName:ue,token:de,destinationAddress:fe,destinationValue:ce,destinationChainType:"solana",destinationClusterName:ue,destinationToken:de}})})).catch((e=>{ne("error"),me(e)})))},children:"Confirm"}),/*#__PURE__*/e(i,{})]}:{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(h,{}),/*#__PURE__*/e("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/e(i,{})]})}};export{ne as FundSolWalletWithExternalSolanaWallet,ne as default};
@@ -1 +0,0 @@
1
- import{jsx as n}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-CQc-E5dS.mjs";import{M as a}from"./ModalHeader-DfHxv9fE.mjs";function t({title:t}){let{currentScreen:i,navigateBack:r,navigate:d,data:o,setModalData:u}=e();/*#__PURE__*/return n(a,{title:t,backFn:"ManualTransferScreen"===i?r:i===o?.funding?.methodScreen?o.funding.comingFromSendTransactionScreen?()=>d("SendTransactionScreen"):void 0:o?.funding?.methodScreen?()=>{let n=o.funding;n.usingDefaultFundingMethod&&(n.usingDefaultFundingMethod=!1),u({funding:n,solanaFundingData:o?.solanaFundingData}),d(n.methodScreen)}:void 0})}export{t};