@privy-io/react-auth 3.12.0 → 3.12.1-beta-20260129222736

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 (364) hide show
  1. package/dist/cjs/AccountNotFoundScreen-CvwC6yT4.js +1 -0
  2. package/dist/cjs/{Address-6qDWL5TN.js → Address-DLuP2x_5.js} +2 -2
  3. package/dist/cjs/AffirmativeConsentScreen-CrhHpJIl.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-C9DisX-N.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-B0VgWu8q.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-Bi_9PQ7B.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CtGjd9b2.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-Du5DTUHu.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-CV_xP4JF.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-DKA06V8u.js → BridgeNetworkSelectionView-C19AGc9H.js} +6 -6
  11. package/dist/cjs/CaptchaScreen-C7iLHHeQ.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-XHQ8dOpA.js +16 -0
  13. package/dist/cjs/{ConnectEmailForm-DZrCSv9t.js → ConnectEmailForm-h3tPoI4G.js} +1 -1
  14. package/dist/cjs/ConnectLedgerScreen-B4LtfSk5.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-CyuMbSMg.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-jOUGVKy8.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-D0CrcQ_S.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-BWSmRonl.js → ConnectPhoneForm-DuatDKeD.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-Bh1DK9t5.js → ConnectWalletView--gsCLvGp.js} +8 -8
  20. package/dist/cjs/ConnectionStatusScreen-BcbrfKI9.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-C5K_S48z.js +1 -0
  22. package/dist/cjs/{CustomLandingScreenView-DP1fJrBU.js → CustomLandingScreenView-StZ_yRGy.js} +3 -3
  23. package/dist/cjs/DelegatedActionsConsentScreen-BWp1I7xP.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-1cfiT1k4.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-ClAC2HXm.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-DZOyC1XZ.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-_4GMdJuo.js → EmbeddedWalletKeyExportScreen-B4OidTNt.js} +2 -2
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-BWb19zPz.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-BpSceG6F.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-C3uD-zGl.js +1 -0
  31. package/dist/cjs/{EnrollTotp-leOB_B4o.js → EnrollTotp-DXOQ92Bg.js} +7 -7
  32. package/dist/cjs/ErrorScreen-Ca3XKcKy.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-Bzmd4izn.js → FarcasterConnectStatusScreen-D5txkfHt.js} +6 -6
  34. package/dist/cjs/FarcasterSignerStatusScreen-DgkNomKJ.js +29 -0
  35. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-72S7di11.js +2 -0
  36. package/dist/cjs/{FundWalletMethodHeader-YwNCXAU_.js → FundWalletMethodHeader-CWW5VpOx.js} +1 -1
  37. package/dist/cjs/FundingEditAmountScreen-B0NyVMoY.js +1 -0
  38. package/dist/cjs/FundingMethodSelectionScreen-CNI0RNo7.js +1 -0
  39. package/dist/cjs/InAppBrowserLoginNotPossible-DulwvV6c.js +1 -0
  40. package/dist/cjs/InstallWalletScreen-DGqXUqL5.js +1 -0
  41. package/dist/cjs/LandingScreen-DJnCYsej.js +1 -0
  42. package/dist/cjs/{LinkConflictScreen-BCzS7Szr.js → LinkConflictScreen-CCpIoVFH.js} +2 -2
  43. package/dist/cjs/LinkEmailScreen-CbmbWy0A.js +1 -0
  44. package/dist/cjs/{LinkPasskeyScreen-o4qdrAL3.js → LinkPasskeyScreen-kbYgKEvh.js} +11 -11
  45. package/dist/cjs/LinkPhoneScreen-CPl7prX6.js +1 -0
  46. package/dist/cjs/LoginFailedScreen-B_S_MDGQ.js +1 -0
  47. package/dist/cjs/ManualTransferScreen-DRCNNQIx.js +1 -0
  48. package/dist/cjs/MfaAuthEnrollmentFlowScreen-DidF4v4i.js +1 -0
  49. package/dist/cjs/MfaAuthVerifyFlowScreen-CiIWaxe5.js +1 -0
  50. package/dist/cjs/MfaEnrollmentFlowScreen-D9q7Pm2b.js +1 -0
  51. package/dist/cjs/MfaVerifyFlowScreen-nhta_lwt.js +1 -0
  52. package/dist/cjs/{ModalHeader-C5O9gNUP.js → ModalHeader-MJIvqOQn.js} +1 -1
  53. package/dist/cjs/MoonpayStatusScreen-D4mvfrrO.js +16 -0
  54. package/dist/cjs/OAuthStatusScreen-BX78aDWF.js +1 -0
  55. package/dist/cjs/PasskeySelectSignupOrLogin-Dc5VcXgD.js +1 -0
  56. package/dist/cjs/PasskeyStatusScreen-C8zDLZtC.js +3 -0
  57. package/dist/cjs/PasswordRecoveryScreen-C-p9tQkF.js +20 -0
  58. package/dist/cjs/PrivyPluginContext-DsgaS6n9.js +1 -0
  59. package/dist/cjs/{QrCode-CLd3Ytk7.js → QrCode-CmGLmb4U.js} +1 -1
  60. package/dist/cjs/RecoveryOAuthStatusScreen-BEk1qz-9.js +1 -0
  61. package/dist/cjs/RecoveryPasswordCreateScreen-kurEzKju.js +1 -0
  62. package/dist/cjs/{RecoverySelectionScreen-Bw9_M6y0.js → RecoverySelectionScreen-g3W6i8D1.js} +2 -2
  63. package/dist/cjs/{Screen-BSwlHqPg.js → Screen-Dl-2NR2R.js} +4 -5
  64. package/dist/cjs/{ScreenLayout-BtVIYAso.js → ScreenLayout-CZexjGvo.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-SUOUjBk4.js → SetAutomaticRecoveryScreen-5SOYfazO.js} +2 -2
  66. package/dist/cjs/{SetWalletPasswordForm-Gkq-DskE.js → SetWalletPasswordForm-CORYNAig.js} +3 -3
  67. package/dist/cjs/{SignRequestScreen-BNcy6yU_.js → SignRequestScreen-BDWDopt-.js} +2 -2
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-z_EUNaeD.js → StandardSignAndSendTransactionScreen-BxGI9yOT.js} +2 -2
  69. package/dist/cjs/TelegramAuthScreen-DQgQP8nT.js +1 -0
  70. package/dist/cjs/{TransactionDetails-DYow9ihU.js → TransactionDetails-B9vDqM-f.js} +4 -4
  71. package/dist/cjs/{TransactionErrorView-yUMJqqF2.js → TransactionErrorView-poVXJ4DK.js} +7 -7
  72. package/dist/cjs/{TransferFromWalletScreen-Duk7CEcq.js → TransferFromWalletScreen-B6W7ML55.js} +2 -2
  73. package/dist/cjs/{TransferOrBridgeLoadingScreen-DuBLyfE1.js → TransferOrBridgeLoadingScreen-DOaFBoVa.js} +2 -2
  74. package/dist/cjs/UpdateEmailScreen-P2vgr8MG.js +1 -0
  75. package/dist/cjs/UpdatePhoneScreen-C_Au2OyY.js +1 -0
  76. package/dist/cjs/UserLimitReachedScreen-BMwVWooZ.js +1 -0
  77. package/dist/cjs/{WalletInfoCard-CHEynRZS.js → WalletInfoCard-CPUWxQfs.js} +1 -1
  78. package/dist/cjs/WalletInterstitialScreen-R1cSmCDR.js +1 -0
  79. package/dist/cjs/{WalletLink-CZLtiI7E.js → WalletLink-DtgmIeIx.js} +1 -1
  80. package/dist/cjs/{WalletOverflowButton-FlgoA77a.js → WalletOverflowButton-_kpl5IST.js} +1 -1
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/{context-BeSQM-Ma.js → context-BVLU-tYD.js} +1 -1
  83. package/dist/cjs/{ethers-XrYC9HG-.js → ethers-D6Dbymha.js} +1 -1
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/get-is-unified-wallet-CXggv1wa.js +1 -0
  86. package/dist/cjs/getEmbeddedConnectedWallet-C1vXXRY1.js +1 -0
  87. package/dist/cjs/getErc20Balance-CJvcxOe9.js +1 -0
  88. package/dist/cjs/{getErc20TokenInfo-DxDd_HN6.js → getErc20TokenInfo-DqY-nDYo.js} +1 -1
  89. package/dist/cjs/{index-0-2WrPDo.js → index-BF9t9wE_.js} +3 -3
  90. package/dist/cjs/index-Dq984Fi7.js +174 -0
  91. package/dist/cjs/{index-W2ZSukRW.js → index-DsvpCkrq.js} +1 -1
  92. package/dist/cjs/index.js +1 -1
  93. package/dist/cjs/internal.js +1 -1
  94. package/dist/cjs/{shared-BcueHfN-.js → shared-2UXrNGgN.js} +6 -6
  95. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-j6p9PEm-.js → shouldProceedtoEmbeddedWalletCreationFlow-wKHDOYL2.js} +1 -1
  96. package/dist/cjs/smart-wallets-NOwTquhw.js +1 -0
  97. package/dist/cjs/smart-wallets.js +1 -1
  98. package/dist/cjs/solana.js +1 -1
  99. package/dist/cjs/{styles-Csarwypj.js → styles-DC56SrYn.js} +4 -4
  100. package/dist/cjs/{to-ui-error-C4aac_aM.js → to-ui-error-B8N9wF4a.js} +2 -2
  101. package/dist/cjs/ui.js +14 -14
  102. package/dist/cjs/use-export-wallet-BmvX9OV-.js +1 -0
  103. package/dist/cjs/use-export-wallet-Bu1R636G.js +1 -0
  104. package/dist/cjs/{useActiveWallet-vlXeDPzp.js → useActiveWallet-C0_0HOZ9.js} +2 -2
  105. package/dist/cjs/{useGetTokenPrice-DJpJnTij.js → useGetTokenPrice-BqMAydh1.js} +1 -1
  106. package/dist/cjs/{useI18n-CnsBjm9v.js → useI18n-lYbeUUHb.js} +1 -1
  107. package/dist/cjs/usePrivy-DrdYrRZ_.js +1 -0
  108. package/dist/cjs/{useSolanaRpcClient-CYMWkK7E.js → useSolanaRpcClient-v9i37J6k.js} +1 -1
  109. package/dist/cjs/useWallets-D2MmNN1k.js +1 -0
  110. package/dist/cjs/{useWallets-DMyuB5aJ.js → useWallets-DHI-M9UM.js} +1 -1
  111. package/dist/dts/{events-context-DeukTtar.d.ts → events-context-CV9PiG6M.d.mts} +1 -1
  112. package/dist/dts/{events-context-DeukTtar.d.mts → events-context-CV9PiG6M.d.ts} +1 -1
  113. package/dist/dts/extended-chains.d.mts +1 -1
  114. package/dist/dts/extended-chains.d.ts +1 -1
  115. package/dist/dts/farcaster.d.mts +1 -1
  116. package/dist/dts/farcaster.d.ts +1 -1
  117. package/dist/dts/index.d.mts +58 -5
  118. package/dist/dts/index.d.ts +58 -5
  119. package/dist/dts/internal.d.mts +1 -1
  120. package/dist/dts/internal.d.ts +1 -1
  121. package/dist/dts/smart-wallets.d.mts +1 -1
  122. package/dist/dts/smart-wallets.d.ts +1 -1
  123. package/dist/dts/solana.d.mts +3 -3
  124. package/dist/dts/solana.d.ts +3 -3
  125. package/dist/dts/{types-FifkyCQc.d.mts → types-xIUh0rN4.d.mts} +43 -1
  126. package/dist/dts/{types-FifkyCQc.d.ts → types-xIUh0rN4.d.ts} +43 -1
  127. package/dist/dts/ui.d.mts +1 -1
  128. package/dist/dts/ui.d.ts +1 -1
  129. package/dist/esm/AccountNotFoundScreen-D87I7apb.mjs +1 -0
  130. package/dist/esm/{Address-QmAVCQtO.mjs → Address-DBfY9I-V.mjs} +2 -2
  131. package/dist/esm/AffirmativeConsentScreen-D16OZSmw.mjs +6 -0
  132. package/dist/esm/AllowlistRejectionScreen-JvRo0diS.mjs +1 -0
  133. package/dist/esm/AuthenticateWithWalletScreen-DDeFbi3u.mjs +1 -0
  134. package/dist/esm/AwaitingEvmToSolBridgingScreen-D-G-QBXt.mjs +2 -0
  135. package/dist/esm/AwaitingExternalEthereumTransferScreen-C2uzV8gi.mjs +2 -0
  136. package/dist/esm/AwaitingPasswordlessCodeScreen-C6ndKKq5.mjs +103 -0
  137. package/dist/esm/AwaitingSolToEvmBridgingScreen-DYYVMql3.mjs +2 -0
  138. package/dist/esm/{BridgeNetworkSelectionView-DQGcampg.mjs → BridgeNetworkSelectionView-Cjx8-IzN.mjs} +11 -11
  139. package/dist/esm/CaptchaScreen-CPAef6q_.mjs +1 -0
  140. package/dist/esm/CoinbaseOnrampStatusScreen-5d3RVBO4.mjs +16 -0
  141. package/dist/esm/ConnectEmailForm-BPjeSmPk.mjs +3 -0
  142. package/dist/esm/ConnectLedgerScreen-BK_mUJJI.mjs +9 -0
  143. package/dist/esm/ConnectOnlyLandingScreen-qCRi3yCR.mjs +1 -0
  144. package/dist/esm/ConnectOnlyStatusScreen-DJtqyGSa.mjs +1 -0
  145. package/dist/esm/ConnectOrCreateScreen-C5ZA94p5.mjs +1 -0
  146. package/dist/esm/{ConnectPhoneForm-BMtTIItD.mjs → ConnectPhoneForm-gCDafmIx.mjs} +1 -1
  147. package/dist/esm/{ConnectWalletView-BMjEKo1_.mjs → ConnectWalletView-C4bswOSc.mjs} +4 -4
  148. package/dist/esm/ConnectionStatusScreen-Cl93wmJu.mjs +7 -0
  149. package/dist/esm/CrossAppAuthScreen-Cty8_Ahn.mjs +1 -0
  150. package/dist/esm/{CustomLandingScreenView-BlDfJaDr.mjs → CustomLandingScreenView-CtWV0s2_.mjs} +4 -4
  151. package/dist/esm/DelegatedActionsConsentScreen-DK0-n7eC.mjs +1 -0
  152. package/dist/esm/DelegatedActionsRevokeScreen-Bs63J15E.mjs +1 -0
  153. package/dist/esm/EmbeddedWalletConnectingScreen-CNakW1x5.mjs +1 -0
  154. package/dist/esm/EmbeddedWalletCreatedScreen-BYKlkO28.mjs +1 -0
  155. package/dist/esm/EmbeddedWalletKeyExportScreen-CkjaBu62.mjs +40 -0
  156. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-BAZWMs_z.mjs +1 -0
  157. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-BXI5GhNt.mjs +1 -0
  158. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-8WX4n_ay.mjs +1 -0
  159. package/dist/esm/{EnrollTotp-DVLg14UT.mjs → EnrollTotp-CMppkqgm.mjs} +5 -5
  160. package/dist/esm/ErrorScreen-Big2etvs.mjs +4 -0
  161. package/dist/esm/{FarcasterConnectStatusScreen-CUO9DKCJ.mjs → FarcasterConnectStatusScreen-D7RZUwHm.mjs} +9 -9
  162. package/dist/esm/FarcasterSignerStatusScreen-CWuWkoF4.mjs +28 -0
  163. package/dist/esm/FundSolWalletWithExternalSolanaWallet-QzSbA2oo.mjs +1 -0
  164. package/dist/esm/{FundWalletMethodHeader-PIxwFzzh.mjs → FundWalletMethodHeader-vji6aDSN.mjs} +1 -1
  165. package/dist/esm/FundingEditAmountScreen-s9OZdLiy.mjs +1 -0
  166. package/dist/esm/FundingMethodSelectionScreen-BdEvfdJc.mjs +1 -0
  167. package/dist/esm/InAppBrowserLoginNotPossible-BDBIGEny.mjs +1 -0
  168. package/dist/esm/InstallWalletScreen-Dg9B6Qnm.mjs +1 -0
  169. package/dist/esm/LandingScreen-BVkfsda3.mjs +1 -0
  170. package/dist/esm/{LinkConflictScreen-B94e_-2N.mjs → LinkConflictScreen-7xtZJDDB.mjs} +3 -3
  171. package/dist/esm/LinkEmailScreen-Yjqv2tgJ.mjs +1 -0
  172. package/dist/esm/{LinkPasskeyScreen-DYfWSjKR.mjs → LinkPasskeyScreen-Dv9oGCVR.mjs} +1 -1
  173. package/dist/esm/LinkPhoneScreen-Cqf6I8DD.mjs +1 -0
  174. package/dist/esm/LoginFailedScreen-BWjivPRz.mjs +1 -0
  175. package/dist/esm/ManualTransferScreen-CmVkHC5K.mjs +1 -0
  176. package/dist/esm/MfaAuthEnrollmentFlowScreen-x-7wkWPc.mjs +1 -0
  177. package/dist/esm/MfaAuthVerifyFlowScreen-BCRn1A57.mjs +1 -0
  178. package/dist/esm/MfaEnrollmentFlowScreen-D9DED3dF.mjs +1 -0
  179. package/dist/esm/MfaVerifyFlowScreen-Cdu8dM2B.mjs +1 -0
  180. package/dist/esm/{ModalHeader-rCMpqA2a.mjs → ModalHeader-B7JiUyZG.mjs} +1 -1
  181. package/dist/esm/MoonpayStatusScreen-C42VxDI1.mjs +16 -0
  182. package/dist/esm/OAuthStatusScreen-BJoRrpcI.mjs +1 -0
  183. package/dist/esm/PasskeySelectSignupOrLogin-Dj1Z_dqZ.mjs +1 -0
  184. package/dist/esm/PasskeyStatusScreen-DgV-VxQU.mjs +3 -0
  185. package/dist/esm/PasswordRecoveryScreen-DLf3wdqx.mjs +20 -0
  186. package/dist/esm/PrivyPluginContext-2QN2dVUw.mjs +1 -0
  187. package/dist/esm/{QrCode-DjnQgnaZ.mjs → QrCode-D32W0rFB.mjs} +1 -1
  188. package/dist/esm/RecoveryOAuthStatusScreen-DA0EIZSq.mjs +1 -0
  189. package/dist/esm/RecoveryPasswordCreateScreen-DN3Xx4uG.mjs +1 -0
  190. package/dist/esm/RecoverySelectionScreen-8W7R6tWd.mjs +7 -0
  191. package/dist/esm/{Screen-CV2tt2Ap.mjs → Screen-DcqZvHom.mjs} +8 -9
  192. package/dist/esm/{ScreenLayout-DF3DCKOK.mjs → ScreenLayout-fGlkd51E.mjs} +1 -1
  193. package/dist/esm/{SetAutomaticRecoveryScreen-C6cFVbSx.mjs → SetAutomaticRecoveryScreen-CulFt8fI.mjs} +2 -2
  194. package/dist/esm/{SetWalletPasswordForm-ChA4tW4Y.mjs → SetWalletPasswordForm-DL7Siy6x.mjs} +4 -4
  195. package/dist/esm/SignRequestScreen-BpvOtDI4.mjs +26 -0
  196. package/dist/esm/{StandardSignAndSendTransactionScreen-D4OBsj5k.mjs → StandardSignAndSendTransactionScreen-C9ZKS0nz.mjs} +2 -2
  197. package/dist/esm/TelegramAuthScreen--uacrzGV.mjs +1 -0
  198. package/dist/esm/{TransactionDetails-BP142O9n.mjs → TransactionDetails-BJYUvpDT.mjs} +1 -1
  199. package/dist/esm/{TransactionErrorView-BwwGMqSj.mjs → TransactionErrorView-B0BIC9ro.mjs} +8 -8
  200. package/dist/esm/{TransferFromWalletScreen-BHH0YcI4.mjs → TransferFromWalletScreen-DrEg4Khy.mjs} +2 -2
  201. package/dist/esm/{TransferOrBridgeLoadingScreen-VLQTcf_6.mjs → TransferOrBridgeLoadingScreen-JVja_xjb.mjs} +1 -1
  202. package/dist/esm/UpdateEmailScreen-D_WM1VCn.mjs +1 -0
  203. package/dist/esm/UpdatePhoneScreen-ztnDFAV4.mjs +1 -0
  204. package/dist/esm/UserLimitReachedScreen-Bg0_GPm-.mjs +1 -0
  205. package/dist/esm/{WalletInfoCard-ChBHG5L5.mjs → WalletInfoCard-ClsfGrjn.mjs} +2 -2
  206. package/dist/esm/WalletInterstitialScreen-BIHDkMKZ.mjs +1 -0
  207. package/dist/esm/{WalletLink-CN4enmsE.mjs → WalletLink-BDeauVaR.mjs} +6 -6
  208. package/dist/esm/{WalletOverflowButton-B-nEN4GW.mjs → WalletOverflowButton-DMJ0BOTe.mjs} +1 -1
  209. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  210. package/dist/esm/context-UVzNo7-f.mjs +1 -0
  211. package/dist/esm/{ethers-BQ45eiVv.mjs → ethers-DFsoKesJ.mjs} +1 -1
  212. package/dist/esm/extended-chains.mjs +1 -1
  213. package/dist/esm/{get-is-unified-wallet-CNcx75Dp.mjs → get-is-unified-wallet-gEMK9zAN.mjs} +1 -1
  214. package/dist/esm/getEmbeddedConnectedWallet-pC2McXxQ.mjs +1 -0
  215. package/dist/esm/{getErc20Balance-DA4dGV9O.mjs → getErc20Balance-D0MGUaOw.mjs} +1 -1
  216. package/dist/esm/getErc20TokenInfo-CZJTqd4c.mjs +1 -0
  217. package/dist/esm/index-B2BfxLtd.mjs +174 -0
  218. package/dist/esm/{index-DoasOxbi.mjs → index-BwwizPYT.mjs} +1 -1
  219. package/dist/esm/{index-2knYP69D.mjs → index-njSRcD7r.mjs} +3 -3
  220. package/dist/esm/index.mjs +1 -1
  221. package/dist/esm/internal.mjs +1 -1
  222. package/dist/esm/{shared-DwO5pr5t.mjs → shared-DEutgj0-.mjs} +1 -1
  223. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs → shouldProceedtoEmbeddedWalletCreationFlow-DzY1kKF2.mjs} +1 -1
  224. package/dist/esm/smart-wallets-1REmVzqk.mjs +1 -0
  225. package/dist/esm/smart-wallets.mjs +1 -1
  226. package/dist/esm/solana.mjs +1 -1
  227. package/dist/esm/{styles-BNn7MnP1.mjs → styles-B0ZcCJkO.mjs} +15 -15
  228. package/dist/esm/{to-ui-error-CCqAdorW.mjs → to-ui-error-EcEpo27f.mjs} +2 -2
  229. package/dist/esm/ui.mjs +40 -40
  230. package/dist/esm/use-export-wallet-BYgD16yE.mjs +1 -0
  231. package/dist/esm/use-export-wallet-aRKrQFFh.mjs +1 -0
  232. package/dist/esm/{useActiveWallet-RZ4w-uGq.mjs → useActiveWallet-BXJJRlvj.mjs} +2 -2
  233. package/dist/esm/{useGetTokenPrice-DERdsrmf.mjs → useGetTokenPrice-Dng0EqD0.mjs} +1 -1
  234. package/dist/esm/{useI18n-Dk9y58cU.mjs → useI18n-CnQzCQ4x.mjs} +1 -1
  235. package/dist/esm/usePrivy-Bfd0Mlrx.mjs +1 -0
  236. package/dist/esm/{useSolanaRpcClient-B7UDPdLi.mjs → useSolanaRpcClient-BW09SdSK.mjs} +1 -1
  237. package/dist/esm/{useWalletBalance-CRXiZUj2.mjs → useWalletBalance-BDrbQBDX.mjs} +1 -1
  238. package/dist/esm/useWallets-BZEdWBgc.mjs +1 -0
  239. package/dist/esm/{useWallets-DlGuNtGR.mjs → useWallets-DeRPXypD.mjs} +1 -1
  240. package/package.json +6 -6
  241. package/dist/cjs/AccountNotFoundScreen-BBWWze9O.js +0 -1
  242. package/dist/cjs/AffirmativeConsentScreen-CCwAwjH1.js +0 -6
  243. package/dist/cjs/AllowlistRejectionScreen-DEMYbzGA.js +0 -1
  244. package/dist/cjs/AuthenticateWithWalletScreen-dBvBC7MB.js +0 -1
  245. package/dist/cjs/AwaitingEvmToSolBridgingScreen-D9NwI47L.js +0 -2
  246. package/dist/cjs/AwaitingExternalEthereumTransferScreen-D_0NulpI.js +0 -2
  247. package/dist/cjs/AwaitingPasswordlessCodeScreen-B4HAKL4-.js +0 -103
  248. package/dist/cjs/AwaitingSolToEvmBridgingScreen-CnuLLTC0.js +0 -2
  249. package/dist/cjs/CaptchaScreen-N-ueJQF3.js +0 -1
  250. package/dist/cjs/CoinbaseOnrampStatusScreen-06yaO6r4.js +0 -16
  251. package/dist/cjs/ConnectLedgerScreen-C7vGQocf.js +0 -9
  252. package/dist/cjs/ConnectOnlyLandingScreen-_9y9kOsT.js +0 -1
  253. package/dist/cjs/ConnectOnlyStatusScreen-mZHx4a7S.js +0 -1
  254. package/dist/cjs/ConnectOrCreateScreen-Cp4uExOd.js +0 -1
  255. package/dist/cjs/ConnectionStatusScreen-B27DUsGt.js +0 -7
  256. package/dist/cjs/CrossAppAuthScreen-BbLFbCdU.js +0 -1
  257. package/dist/cjs/DelegatedActionsConsentScreen-DzWruJOn.js +0 -1
  258. package/dist/cjs/DelegatedActionsRevokeScreen-D-TwUXyj.js +0 -1
  259. package/dist/cjs/EmbeddedWalletConnectingScreen-CYav4Mjb.js +0 -1
  260. package/dist/cjs/EmbeddedWalletCreatedScreen-m0t_c_AA.js +0 -1
  261. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B5-JBZRJ.js +0 -1
  262. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CITAy3i6.js +0 -1
  263. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DG5LKyjo.js +0 -1
  264. package/dist/cjs/ErrorScreen-xNDIVXx8.js +0 -4
  265. package/dist/cjs/FarcasterSignerStatusScreen-Cxoi54pp.js +0 -29
  266. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-BCyBv_xe.js +0 -2
  267. package/dist/cjs/FundingEditAmountScreen-CDlb4Acx.js +0 -1
  268. package/dist/cjs/FundingMethodSelectionScreen-DlPxjsJq.js +0 -1
  269. package/dist/cjs/InAppBrowserLoginNotPossible-Bdx0vKyA.js +0 -1
  270. package/dist/cjs/InstallWalletScreen-Cshn01eK.js +0 -1
  271. package/dist/cjs/LandingScreen-0FdwpJ9w.js +0 -1
  272. package/dist/cjs/LinkEmailScreen-B7rxdQso.js +0 -1
  273. package/dist/cjs/LinkPhoneScreen-DweFqlM1.js +0 -1
  274. package/dist/cjs/LoginFailedScreen-mHcvCBEz.js +0 -1
  275. package/dist/cjs/ManualTransferScreen-CfYgtyLD.js +0 -1
  276. package/dist/cjs/MfaAuthEnrollmentFlowScreen-D631h0XW.js +0 -1
  277. package/dist/cjs/MfaAuthVerifyFlowScreen-BZ3IyqAd.js +0 -1
  278. package/dist/cjs/MfaEnrollmentFlowScreen-_tNeX5lT.js +0 -1
  279. package/dist/cjs/MfaVerifyFlowScreen-D_7nkuBq.js +0 -1
  280. package/dist/cjs/MoonpayStatusScreen-DoFbZ_0d.js +0 -16
  281. package/dist/cjs/OAuthStatusScreen-BZY7BiP5.js +0 -1
  282. package/dist/cjs/PasskeySelectSignupOrLogin-C3k_ixTz.js +0 -1
  283. package/dist/cjs/PasskeyStatusScreen-BX-SOBDr.js +0 -3
  284. package/dist/cjs/PasswordRecoveryScreen-VZQDtt5v.js +0 -20
  285. package/dist/cjs/RecoveryOAuthStatusScreen-DKYx6ECd.js +0 -1
  286. package/dist/cjs/RecoveryPasswordCreateScreen-DP0xOBMA.js +0 -1
  287. package/dist/cjs/TelegramAuthScreen-DV8KYJMX.js +0 -1
  288. package/dist/cjs/UpdateEmailScreen-DRJv5CZs.js +0 -1
  289. package/dist/cjs/UpdatePhoneScreen-C3myqOv0.js +0 -1
  290. package/dist/cjs/UserLimitReachedScreen-l_e6Vhr0.js +0 -1
  291. package/dist/cjs/WalletInterstitialScreen-BgoDwKIp.js +0 -1
  292. package/dist/cjs/get-is-unified-wallet-BwdzQwn_.js +0 -1
  293. package/dist/cjs/getEmbeddedConnectedWallet-6TsVZJkD.js +0 -1
  294. package/dist/cjs/getErc20Balance-CN3JMVjF.js +0 -1
  295. package/dist/cjs/index-CzmnSRoa.js +0 -174
  296. package/dist/cjs/prepareFundingModalData-DDf6xLze.js +0 -1
  297. package/dist/cjs/smart-wallets-BBh3vgRq.js +0 -1
  298. package/dist/cjs/use-export-wallet-C9HWu0Dq.js +0 -1
  299. package/dist/cjs/usePrivy-Bx2PKTrU.js +0 -1
  300. package/dist/cjs/useWallets-BwB7ALB8.js +0 -1
  301. package/dist/esm/AccountNotFoundScreen-C6S8_GyN.mjs +0 -1
  302. package/dist/esm/AffirmativeConsentScreen-QfJBfI_f.mjs +0 -6
  303. package/dist/esm/AllowlistRejectionScreen-CX57yv4U.mjs +0 -1
  304. package/dist/esm/AuthenticateWithWalletScreen-CZJ-aWhZ.mjs +0 -1
  305. package/dist/esm/AwaitingEvmToSolBridgingScreen-C1CMtT4Y.mjs +0 -2
  306. package/dist/esm/AwaitingExternalEthereumTransferScreen-DX91STcF.mjs +0 -2
  307. package/dist/esm/AwaitingPasswordlessCodeScreen-BuExr50N.mjs +0 -103
  308. package/dist/esm/AwaitingSolToEvmBridgingScreen-Bm1i_2qW.mjs +0 -2
  309. package/dist/esm/CaptchaScreen-B-hFDb5f.mjs +0 -1
  310. package/dist/esm/CoinbaseOnrampStatusScreen-OHm2RUBv.mjs +0 -16
  311. package/dist/esm/ConnectEmailForm-Df5OtmDR.mjs +0 -3
  312. package/dist/esm/ConnectLedgerScreen-BHLYW-F3.mjs +0 -9
  313. package/dist/esm/ConnectOnlyLandingScreen-C6nzEwpN.mjs +0 -1
  314. package/dist/esm/ConnectOnlyStatusScreen-CremlXDY.mjs +0 -1
  315. package/dist/esm/ConnectOrCreateScreen-262UvCdD.mjs +0 -1
  316. package/dist/esm/ConnectionStatusScreen-mk5beBL7.mjs +0 -7
  317. package/dist/esm/CrossAppAuthScreen-BXjEJQv6.mjs +0 -1
  318. package/dist/esm/DelegatedActionsConsentScreen-ANmQe-9G.mjs +0 -1
  319. package/dist/esm/DelegatedActionsRevokeScreen-D9X7mWmI.mjs +0 -1
  320. package/dist/esm/EmbeddedWalletConnectingScreen-2g-RrIvW.mjs +0 -1
  321. package/dist/esm/EmbeddedWalletCreatedScreen-BXTAv4_-.mjs +0 -1
  322. package/dist/esm/EmbeddedWalletKeyExportScreen-DYVHVHOj.mjs +0 -40
  323. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CYyMoMFF.mjs +0 -1
  324. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-oT5ZcPQV.mjs +0 -1
  325. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BQcHDyuV.mjs +0 -1
  326. package/dist/esm/ErrorScreen-CLfeO5pd.mjs +0 -4
  327. package/dist/esm/FarcasterSignerStatusScreen-B135UOnV.mjs +0 -28
  328. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DO3ttgom.mjs +0 -1
  329. package/dist/esm/FundingEditAmountScreen-BRQb2ffL.mjs +0 -1
  330. package/dist/esm/FundingMethodSelectionScreen-DTt1Z5RI.mjs +0 -1
  331. package/dist/esm/InAppBrowserLoginNotPossible-DH96QD2c.mjs +0 -1
  332. package/dist/esm/InstallWalletScreen-PnK6VfrP.mjs +0 -1
  333. package/dist/esm/LandingScreen-D_EvjOHf.mjs +0 -1
  334. package/dist/esm/LinkEmailScreen-CT8gAQr3.mjs +0 -1
  335. package/dist/esm/LinkPhoneScreen-ccrKA6tf.mjs +0 -1
  336. package/dist/esm/LoginFailedScreen-BwgxhbMf.mjs +0 -1
  337. package/dist/esm/ManualTransferScreen-DgCG2P3B.mjs +0 -1
  338. package/dist/esm/MfaAuthEnrollmentFlowScreen-CNVUTOnE.mjs +0 -1
  339. package/dist/esm/MfaAuthVerifyFlowScreen-2nvvFipu.mjs +0 -1
  340. package/dist/esm/MfaEnrollmentFlowScreen-DfnIqNNU.mjs +0 -1
  341. package/dist/esm/MfaVerifyFlowScreen-BwerwBz5.mjs +0 -1
  342. package/dist/esm/MoonpayStatusScreen-D5fRCEb3.mjs +0 -16
  343. package/dist/esm/OAuthStatusScreen-DtLgYw89.mjs +0 -1
  344. package/dist/esm/PasskeySelectSignupOrLogin-QoPhmagh.mjs +0 -1
  345. package/dist/esm/PasskeyStatusScreen-DzjU3ZVT.mjs +0 -3
  346. package/dist/esm/PasswordRecoveryScreen-LZYGRBkP.mjs +0 -20
  347. package/dist/esm/RecoveryOAuthStatusScreen-DKfp8Udh.mjs +0 -1
  348. package/dist/esm/RecoveryPasswordCreateScreen-D4DI5Bom.mjs +0 -1
  349. package/dist/esm/RecoverySelectionScreen-B2V3518x.mjs +0 -7
  350. package/dist/esm/SignRequestScreen-BslfKJ1N.mjs +0 -26
  351. package/dist/esm/TelegramAuthScreen-BJq5f_Rq.mjs +0 -1
  352. package/dist/esm/UpdateEmailScreen-CMFBvYz5.mjs +0 -1
  353. package/dist/esm/UpdatePhoneScreen-DmhHcNq3.mjs +0 -1
  354. package/dist/esm/UserLimitReachedScreen-DNqgCf3B.mjs +0 -1
  355. package/dist/esm/WalletInterstitialScreen-RS89fm6t.mjs +0 -1
  356. package/dist/esm/context-LVpDfP2H.mjs +0 -1
  357. package/dist/esm/getEmbeddedConnectedWallet-CM6cDQCS.mjs +0 -1
  358. package/dist/esm/getErc20TokenInfo-CxatSwzi.mjs +0 -1
  359. package/dist/esm/index-DNz_w3-G.mjs +0 -174
  360. package/dist/esm/prepareFundingModalData-DjTxAoJ1.mjs +0 -1
  361. package/dist/esm/smart-wallets-9LKzbfWj.mjs +0 -1
  362. package/dist/esm/use-export-wallet-DllHf-2F.mjs +0 -1
  363. package/dist/esm/usePrivy-Dj52a5sp.mjs +0 -1
  364. package/dist/esm/useWallets-cSQYA-Jk.mjs +0 -1
@@ -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-DNz_w3-G.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{u as l,a as c}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as m}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"./context-LVpDfP2H.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.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-CV2tt2Ap.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:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=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 T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}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"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("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,d as c}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as a,r as n}from"./context-LVpDfP2H.mjs";import{u as m}from"./internal-context-Z-fyxadS.mjs";import{S as l}from"./ScreenLayout-DF3DCKOK.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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-CV2tt2Ap.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:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:y}=j.createWallet,S=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):C(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:y})};return o((()=>{let e=setTimeout(S,n);return()=>clearTimeout(e)}),[]),f.current=S,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:S})}};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-ChBHG5L5.mjs";import{u as s}from"./context-LVpDfP2H.mjs";import{u as p}from"./internal-context-Z-fyxadS.mjs";import{u as m,a as u}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as h}from"./ScreenLayout-DF3DCKOK.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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-QmAVCQtO.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s})=>/*#__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,watermark:!0,children:/*#__PURE__*/r(g,{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(f,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let g=a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 1.25rem;
5
- text-align: left;
6
- `,f=()=>/*#__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(b,{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(k,{children:"Loading..."}),m&&/*#__PURE__*/e(k,{children:"Loading..."})]})})}const I={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:d,clientAnalyticsId:c,client:h}=p(),g=s(),{data:f,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:I,appId:b,appClientId:k,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,chainType:T,address:W,isUnifiedWallet:P,imported:V}=f.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:W}})};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:W,accessToken:r,appConfigTheme:g.appearance.palette.colorScheme,onClose:S,isLoading:!r,exportButtonProps:r?{origin:I,appId:b,appClientId:k,clientAnalyticsId:c,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,isUnifiedWallet:P,imported:V,chainType:T}:void 0})}};let b=a.div`
23
- overflow: visible;
24
- position: relative;
25
- overflow: none;
26
- height: 44px;
27
- display: flex;
28
- gap: 12px;
29
- `,k=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{I as EmbeddedWalletKeyExportScreen,y as EmbeddedWalletKeyExportView,I 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-LVpDfP2H.mjs";import{v as s,s as l,k as n,F as m,R as c}from"./index-DNz_w3-G.mjs";import{u as d,m as p}from"./internal-context-Z-fyxadS.mjs";import{a as u,u as h}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as y}from"./ScreenLayout-DF3DCKOK.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(y,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),v={component:()=>{let{setModalData:t,navigate:y,data:v,onUserCloseViaDialogOrKeybindRef:g}=u(),C=a(),[j,f]=r(""),{embeddedWallets:b}=a(),{authenticated:S,user:x}=h(),{closePrivyModal:W,walletProxy:O,client:A}=d(),{onSuccess:k,onFailure:I,callAuthOnSuccessOnClose:M,shouldCreateEth:P,shouldCreateSol:R}=v.createWallet,U="legacy-embedded-wallets-only"===C.embeddedWallets.mode&&!0===C?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[E,F]=r(null),{create:K}=s(),L=P??(!!x&&l(x,C.embeddedWallets.ethereum.createOnLogin)),T=R??(!!x&&n(x,C.embeddedWallets.solana.createOnLogin)),D=new c((async()=>{let e=await A.getAccessToken();if(x&&e&&O)try{let e,t=await i(x.id,"ethereum"),r=await i(x.id,"solana");if(L&&T)e=await K({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t}),e=await K({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(T)e=await K({chainType:"solana",walletIndex:0,latestUser:x,idempotencyKey:r});else{if(!L)return void W({shouldCallAuthOnSuccess:M});e=await K({chainType:"ethereum",walletIndex:0,latestUser:x,idempotencyKey:t})}F(e),y("EmbeddedWalletCreatedScreen")}catch(e){f(e.message)}}));return o((()=>S&&x?U?(t({...v,createWallet:{...v.createWallet,shouldCreateEth:L,shouldCreateSol:T},recoverySelection:{...v?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:L,shouldCreateSol:T}}),y(m({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:b.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(y("LandingScreen"),void I(Error("User must be authenticated before creating a Privy wallet")))),[U,S]),g.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{E?(k(E),W({shouldCallAuthOnSuccess:M})):(I(new p("User wallet creation failed")),W({shouldCallAuthOnSuccess:!1}))}})}};export{v as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,v as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as i}from"./context-LVpDfP2H.mjs";import{u as n,o as d,m as c}from"./internal-context-Z-fyxadS.mjs";import{g as l}from"./useWallets-DlGuNtGR.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-ChA4tW4Y.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./shared-DwO5pr5t.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,M]=o(""),{authenticated:_,user:A}=t(),{client:I,walletProxy:j,refreshSessionAndUser:C,closePrivyModal:R,createAnalyticsEvent:b}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:D}=x.setWalletPassword,N=a(A),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===N?.recoveryMethod;r((()=>{_||(P("LandingScreen"),D(new d("User must be authenticated before setting a password on a Privy wallet")))}),[_]);let T=()=>v?(D(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(D(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>M(p()),onPasswordChange:M,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await I.getAccessToken();if(e&&A&&N?.address&&f&&j)try{b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(A);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await C(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:N.address,reason:e}})}})(),h(!1))},onClose:T})}};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-CNcx75Dp.mjs";import{S as n}from"./ScreenLayout-DF3DCKOK.mjs";import"ofetch";import"react";import"viem";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const c=({onClose:i,onProceed:s})=>/*#__PURE__*/e(n,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),m={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:n}=a(),{onFailure:m}=t.setWalletPassword,l=()=>{m(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return n.current=l,/*#__PURE__*/e(c,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{m as EmbeddedWalletPasswordUpdateSplashScreen,c as EmbeddedWalletPasswordUpdateSplashView,m 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-LVpDfP2H.mjs";import{a as c,P as l}from"./index-DNz_w3-G.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-CNcx75Dp.mjs";import{R as g}from"./reservoir-0wfhnc0j.mjs";import{S as h}from"./ScreenLayout-DF3DCKOK.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const y=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:y})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof 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(h,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:y,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(y,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
2
- color: var(--privy-color-accent) !important;
3
- font-weight: 600;
4
- `;export{f as ErrorScreen,y as ErrorScreenView,f as default};
@@ -1,28 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as a}from"react";import{isMobile as i,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-BGTSFnT3.mjs";import{L as c}from"./useActiveWallet-RZ4w-uGq.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-DjnQgnaZ.mjs";import{u as d,q as u}from"./context-LVpDfP2H.mjs";import{u as g}from"./internal-context-Z-fyxadS.mjs";import{a as h}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as f}from"./ScreenLayout-DF3DCKOK.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"./copy-Bx2Jwc5_.mjs";import"zustand";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"./ModalHeader-rCMpqA2a.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-CV2tt2Ap.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:h})=>/*#__PURE__*/e(f,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&&h?{label:"Open Farcaster app",onClick:h}: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(j,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:g,watermark:!0,children:/*#__PURE__*/t(w,{children:[/*#__PURE__*/e(x,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(S,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(b,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let j=n.div`
2
- margin-top: 24px;
3
- `,w=n.div`
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- gap: 24px;
8
- `,x=n.div`
9
- padding: 24px;
10
- position: relative;
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- min-height: 275px;
15
- `,C=n.div`
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- gap: 16px;
20
- `,b=n.div`
21
- font-size: 0.875rem;
22
- text-align: center;
23
- color: var(--privy-color-foreground-2);
24
- `,S=n.div`
25
- position: relative;
26
- width: 82px;
27
- height: 82px;
28
- `;const F={component:()=>{let{lastScreen:t,navigateBack:i,data:s}=h(),n=d(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=g(),[m,p]=r(void 0),[f,v]=r(!1),[y,j]=r(!1),w=o([]),x=s?.farcasterSigner;a((()=>{let e=Date.now(),t=setInterval((async()=>{if(!x?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===x.status&&(clearInterval(t),v(!1),j(!0),w.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(x?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),v(!1),j(!0),w.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),w.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===x?.status?x.signer_approval_url:void 0;/*#__PURE__*/return e(k,{appName:n.name,loading:f,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 t,jsxs as e,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-rCMpqA2a.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-PIxwFzzh.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 S,R as v}from"./Row-C9vrS4Zi.mjs";import{u as j,t as C}from"./context-LVpDfP2H.mjs";import{u as y,a as L,b as F}from"./internal-context-Z-fyxadS.mjs";import{a as x}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as k,g as U}from"./useWallets-cSQYA-Jk.mjs";import{u as T}from"./useGetTokenPrice-DERdsrmf.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 M,compileTransaction as O,getTransactionEncoder as E}from"@solana/kit";import{findAssociatedTokenPda as $,getCreateAssociatedTokenIdempotentInstruction as B,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as Q}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as _,f as z,s as X,w as Y}from"./useSolanaRpcClient-B7UDPdLi.mjs";import{g as q}from"./getChainName-DjpPdUSc.mjs";import{t as J}from"./prepareFundingModalData-DjTxAoJ1.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"./usePrivy-Dj52a5sp.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 t(S,{children:a.filter((t=>!!t)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/e(v,{children:[/*#__PURE__*/t(I,{children:a.label}),/*#__PURE__*/t(w,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(t){return BigInt(Math.floor(1e9*parseFloat(t)))}function tt(t){return+et.format(parseFloat(t.toString())/1e9)}let et=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function at({tx:t,solanaClient:e,amount:a,asset:n,tokenPrice:o}){if(!t)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:e,tx:t});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:e,tx:t}),s=function(t,e){let a=parseFloat(t.toString())/G*e;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:e,tx:t});return{amountInSol:a+" SOL",feeInSol:tt(o)+" SOL",totalInSol:tt(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:tt(await z({solanaClient:e,tx:t}))+" SOL"}}const nt={component:function(){let I=j(),{closePrivyModal:w,createAnalyticsEvent:S}=y(),{data:v,setModalData:G,navigate:z}=x(),{wallets:tt}=k(),[et,nt]=o("preparing"),[ot,rt]=o(),[st,it]=o(),[lt,mt]=o();if(!v?.solanaFundingData)throw Error("Funding config is missing");if(!v.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ct,asset:dt,chain:ut,sourceWalletData:pt,destinationAddress:ft,afterSuccessScreen:gt}=v.solanaFundingData,ht=tt.find((t=>t.address===pt.address&&J(pt.walletClientType)===J(t.standardWallet.name))),It=_()(ut),{tokenPrice:wt,isTokenPriceLoading:St}=T("solana");return r((()=>{if("preparing"!==et||St||!ht)return;let t="SOL"===dt?Z(ct):function(t){return BigInt(Math.floor(1e6*parseFloat(t)))}(ct);it({amount:("SOL"===dt&&wt?V(t,wt):ct)??ct}),("SOL"===dt?async function({solanaClient:t,source:e,destination:a,amountInLamports:n}){let{value:o}=await t.rpc.getLatestBlockhash().send(),r={address:e},s=b(P({version:0}),(t=>D(r,t)),(t=>N(o,t)),(t=>M(W({amount:n,source:r,destination:a}),t)),(t=>O(t)));return new Uint8Array(E().encode(s))}({solanaClient:It,source:ht.address,destination:ft,amountInLamports:t}):async function({solanaClient:t,source:e,destination:a,amountInBaseUnits:n}){let o=Q(t.chain),{value:r}=await t.rpc.getLatestBlockhash().send(),s={address:e},[i]=await $({mint:o,owner:e,tokenProgram:H}),[l]=await $({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([t.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),t.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${e}`);let d=B({payer:s,ata:l,owner:a,mint:o}),u=b(P({version:0}),(t=>D(s,t)),(t=>N(r,t)),(t=>c?.value?t:M(d,t)),(t=>M(R({source:i,destination:l,authority:s,amount:n}),t)),(t=>O(t)));return new Uint8Array(E().encode(u))}({solanaClient:It,source:ht.address,destination:ft,amountInBaseUnits:t})).then(rt).catch((t=>{nt("error"),mt(t)}))}),[et,ct,dt,ut,ht,ft,St,wt]),r((()=>{"preparing"===et&&ot&&at({tx:ot,solanaClient:It,amount:ct,asset:dt,tokenPrice:wt}).then((t=>{nt("loaded"),it({amount:t?.amountInUsd??t?.amountInUsdc??t?.amountInSol??ct,fee:t?.feeInUsd??t?.feeInSol,total:t?.totalInUsd??t?.totalInSol})})).catch((t=>{nt("error"),mt(t)}))}),[ot,ct,dt,et,wt]),r((()=>{"error"===et&&lt&&(G({errorModalData:{error:lt,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:v.solanaFundingData}),z("ErrorScreen",!1))}),[et,z]),r((()=>{if("success"!==et)return;let t=setTimeout(gt?()=>z(gt):w,C);return()=>clearTimeout(t)}),[et]),/*#__PURE__*/e(a,"success"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(m,{}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/t(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(p,{title:"Success!",description:`You’ve successfully added ${ct} ${dt} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(d,{}),/*#__PURE__*/t(i,{})]}:"preparing"===et||"loaded"===et||"sending"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(u,{style:{marginTop:"16px"},children:/*#__PURE__*/t(g,{icon:ht?.standardWallet.icon,name:ht?.standardWallet.name})}),/*#__PURE__*/t(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===et&&ht?`Confirming with ${ht.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/t(K,{rows:[{label:"Source",value:s(pt.address)},{label:"Destination",value:s(ft)},{label:"Network",value:q(ut)},{label:"Amount",value:st?.amount,isLoading:"preparing"===et},{label:"Estimated fee",value:st?.fee,isLoading:"preparing"===et},{label:"Total",value:st?.total,isLoading:"preparing"===et}]}),/*#__PURE__*/t(l,{style:{marginTop:"1rem"},loading:"preparing"===et||"sending"===et,onClick:function(){"loaded"===et&&ot&&ht&&(nt("sending"),async function({transaction:t,chain:e,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await X({solanaClient:n,tx:t});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,F.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:t,chain:e}).catch((t=>{throw new L("Transaction was rejected by the user",t,F.TRANSACTION_FAILURE)}))).signature);return await Y({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:It,transaction:ot,chain:ut,sourceWallet:ht}).then((t=>{nt("success"),S({eventName:A,payload:{provider:"external",status:"success",txHash:t,address:ht.address,value:ct,chainType:"solana",clusterName:ut,token:dt,destinationAddress:ft,destinationValue:ct,destinationChainType:"solana",destinationClusterName:ut,destinationToken:dt}})})).catch((t=>{nt("error"),mt(t)})))},children:"Confirm"}),/*#__PURE__*/t(i,{})]}:{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(h,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(i,{})]})}};export{nt as FundSolWalletWithExternalSolanaWallet,nt as default};
@@ -1 +0,0 @@
1
- import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-rCMpqA2a.mjs";import{F as a}from"./Layouts-BlFm53ED.mjs";import{t as m}from"./FundWalletMethodHeader-PIxwFzzh.mjs";import{N as s}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as p}from"./useGetTokenPrice-DERdsrmf.mjs";import{c as d}from"./ethers-BQ45eiVv.mjs";import{F as u,a as h,h as j,c as f,d as C}from"./styles-BNn7MnP1.mjs";import"styled-components";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./useGetSolPrice-DwwjjGbd.mjs";import"./LinkPasskeyScreen-DYfWSjKR.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";const g={component:()=>{let{data:g,setModalData:v}=l(),y=g?.funding,k="solana"===y.chainType,S=r(null),{tokenPrice:x}=p(k?"solana":y.chain.id),D=k?void 0:y,F=!(!D?.erc20Address||D?.erc20ContractInfo),T=k?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",M=parseFloat(y.amount),A=!isNaN(M)&&M>0,I=x?d(y.amount,x):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(m,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(a,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:F?/*#__PURE__*/o(s,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>S.current?.focus(),children:[/*#__PURE__*/o(j,{ref:S,value:y.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&v({...g,funding:{...y,amount:e},solanaFundingData:g?.solanaFundingData?{...g.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:T})]}),!D?.erc20Address&&!(k&&y.isUSDC)&&/*#__PURE__*/o(C,{children:I&&A?`${I} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!A,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{g as FundingAmountEditScreen,g as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-rCMpqA2a.mjs";import{t as h}from"./FundWalletMethodHeader-PIxwFzzh.mjs";import{E as p}from"./ErrorBanner-CQERa7bL.mjs";import{I as m}from"./InfoBanner-Dk1KghcK.mjs";import{u}from"./context-LVpDfP2H.mjs";import{v as f,Q as g,U as y}from"./useActiveWallet-RZ4w-uGq.mjs";import{a as C,u as v}from"./internal-context-Z-fyxadS.mjs";import{a as w}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as F}from"./useWallets-DlGuNtGR.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-CxatSwzi.mjs";import{avalanche as S,arbitrum as W,polygon as x,optimism as I,base as j,mainnet as D,toCoinbaseAssetId as T,getCoinbaseOnRampUrl as k,chainToMoonpayCurrency as A,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as E}from"@privy-io/popup";import{a as U}from"./index-DoasOxbi.mjs";import{e as O,I as _,f as H,g as P}from"./styles-BNn7MnP1.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-DYfWSjKR.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const B=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),R=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function q(e){let n=N[e];if(!n)throw new C(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let N={[D.id]:"ethereum",[j.id]:"base",[I.id]:"optimism",[x.id]:"polygon",[W.id]:"arbitrum",[S.id]:"avacchain"};const Q=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=E();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?q(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?T(n.chain.id,"native-currency"):"SOL",h=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:p}=k({appId:e.getAppId(),input:h,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=p.toString();let m={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(m.usingDefaultFundingMethod=!1),t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:h.partner_user_id,popup:d}})}),5e3),r()})),$=async(e,n,t,a,i,o,r,c)=>{let d=E();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?A(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:h}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:U(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),d.location=l;let p={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:p,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:h},funding:p,solanaFundingData:r?.solanaFundingData})}),8e3)};let J=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const X=()=>J("https://apple.com/apple-pay"),G=()=>J("https://google.com/pay"),K={component:()=>{let{wallets:r}=F(),{connectors:C}=v(),S=C.filter(f).flatMap((e=>e.wallets)),{navigate:W,data:x,setModalData:I}=w(),{client:j}=v(),D=u(),T=x?.funding,k=V(X),A=V(G),E="solana"===T.chainType,U=E?void 0:T,q=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",h=!!d||l&&z(Number(t.chain.id),l),p=!!d||l&&L(Number(t.chain.id),l),m=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&p&&m.push((()=>Q(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&h&&l&&m.push((()=>$(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&p&&(r=()=>Q(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:m,onFundWithExchange:r,onFundWithWallet:c}})(D,j,T,I,W,x)),[D,j,T,x,I,W]),N=E?S.find((({address:e})=>e===T.address)):r.find((({address:e})=>s(e)===s(T.address))),J=g(N?.walletClientType||"unknown"),K=J?.name||"wallet",Y=N&&"privy"!==N.walletClientType?K:D.name,Z=d((()=>T.uiConfig?.landing?.title?T.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[T.uiConfig?.landing?.title,Y]);c((()=>{if(T?.defaultFundingMethod&&T.usingDefaultFundingMethod)switch(I({funding:{...T,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),T?.defaultFundingMethod){case"card":q.onFundWithCard[0]&&q.onFundWithCard[0]();break;case"exchange":q.onFundWithExchange&&q.onFundWithExchange();break;case"wallet":q.onFundWithWallet&&q.onFundWithWallet();break;case"manual":W("ManualTransferScreen")}}),[]),c((()=>{U?.erc20Address&&!U.erc20ContractInfo&&b({address:U.erc20Address,chain:U.chain,rpcConfig:D.rpcConfig,privyAppId:D.id}).then((e=>{I({...x,funding:{...U,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[U?.erc20Address,U?.chain]);let ee=!(!U?.erc20Address||U?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(h,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(O,{children:[T.errorMessage&&/*#__PURE__*/e(p,{theme:D.appearance.palette.colorScheme,children:T.errorMessage}),q.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithCard[0],children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",k?/*#__PURE__*/e(B,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):A?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),q.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithExchange,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),q.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:q.onFundWithWallet,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>W("ManualTransferScreen"),children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),T?.showAlternateFundingMethod&&q.onFundWithCard?.[1]&&/*#__PURE__*/e(m,{theme:D.appearance.palette.colorScheme,children:/*#__PURE__*/n(H,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(P,{onClick:q.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{K as FundingMethodSelectionScreen,K as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{ExternalLink as o}from"lucide-react";import{u as e}from"./internal-context-Z-fyxadS.mjs";import{S as r}from"./ScreenLayout-DF3DCKOK.mjs";import"ofetch";import"react";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./get-is-unified-wallet-CNcx75Dp.mjs";import"./useWallets-DlGuNtGR.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/t(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:o,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=e();/*#__PURE__*/return t(i,{onClose:()=>o()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{L as o}from"./Link-DJ5gq9Di.mjs";import{T as i,a}from"./TodoList-CgrU7uwu.mjs";import{a as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as n}from"./ScreenLayout-DF3DCKOK.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const s=({walletName:l,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let h=m||`Create a ${l} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(o,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(a,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(o,{href:s,target:"_blank",children:[l," browser extension"]})]})}),/*#__PURE__*/t(a,{children:"Set up your first wallet"}),/*#__PURE__*/t(a,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:r}=l();if(!r?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:o}=r.installWalletModalData;/*#__PURE__*/return t(s,{walletName:o.name,installLink:o.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-LVpDfP2H.mjs";import{C as r,L as i}from"./CustomLandingScreenView-BlDfJaDr.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-rCMpqA2a.mjs";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./get-is-unified-wallet-CNcx75Dp.mjs";import"./useWallets-DlGuNtGR.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-DNz_w3-G.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-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ConnectWalletView-BMjEKo1_.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-DjnQgnaZ.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-Dk9y58cU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-Df5OtmDR.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-BMtTIItD.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-B-nEN4GW.mjs";import"./ScreenLayout-DF3DCKOK.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!1}):/*#__PURE__*/t(i,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0};export{e as LandingScreen,e as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/EnvelopeIcon";import{C as r}from"./ConnectEmailForm-Df5OtmDR.mjs";import{B as i}from"./Layouts-BlFm53ED.mjs";import{u as e}from"./context-LVpDfP2H.mjs";import{S as m}from"./ScreenLayout-DF3DCKOK.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./index-DNz_w3-G.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-CNcx75Dp.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"tinycolor2";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(i,{children:/*#__PURE__*/t(r,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-BMtTIItD.mjs";import{u as i}from"./context-LVpDfP2H.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as a}from"./ScreenLayout-DF3DCKOK.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"./ModalHeader-rCMpqA2a.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as i}from"./ScreenLayout-DF3DCKOK.mjs";import"ofetch";import"react";import"viem";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const a=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:a="Try again",secondaryCtaText:n="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:a,onClick:m},secondaryCta:{label:n,onClick:c},watermark:!0}),n={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(a,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{n as LoginFailedScreen,a as LoginFailedScreenView,n as default};
@@ -1 +0,0 @@
1
- import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useMemo as a}from"react";import{formatUnits as s}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c,B as d}from"./ModalHeader-rCMpqA2a.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-DjnQgnaZ.mjs";import{t as u}from"./FundWalletMethodHeader-PIxwFzzh.mjs";import{I as f}from"./InfoBanner-Dk1KghcK.mjs";import{S as h}from"./Subtitle-CV-2yKE4.mjs";import{T as g}from"./Title-BnzYV3Is.mjs";import{W as v}from"./WalletInfoCard-ChBHG5L5.mjs";import{u as j}from"./context-LVpDfP2H.mjs";import{v as y,D as C}from"./useActiveWallet-RZ4w-uGq.mjs";import{u as S}from"./internal-context-Z-fyxadS.mjs";import{a as I}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as b}from"./useWalletBalance-CRXiZUj2.mjs";import{u as T}from"./useWallets-DlGuNtGR.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{x as A,z as k}from"./index-DNz_w3-G.mjs";import{g as D}from"./getChainName-DjpPdUSc.mjs";import{g as F}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as U}from"./getErc20Balance-DA4dGV9O.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-QmAVCQtO.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const B={component:()=>{let{wallets:k}=T(),{connectors:B}=S(),E=B.filter(y).flatMap((e=>e.wallets)),{data:$,setModalData:L,navigate:W,lastScreen:O}=I(),{rpcConfig:P,appId:z,createAnalyticsEvent:Q,closePrivyModal:R}=S(),q=j(),[H,N]=o(void 0),[X,Y]=o(!1),G=$?.funding,{reloadBalance:J}=b({rpcConfig:P,appId:z,address:"ethereum"===G.chainType?G.address:void 0,chain:"ethereum"===G.chainType?G.chain:void 0}),K="solana"===G.chainType,V=K?G.isUSDC?"USDC":"SOL":G.erc20Address?G.erc20ContractInfo?.symbol:G.chain.nativeCurrency.symbol,Z=K?E.find((({address:e})=>e===G.address)):k.find((({address:e})=>C(e)===C(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:O||"FundingMethodSelectionScreen"},funding:$?.funding,solanaFundingData:$?.solanaFundingData,sendTransaction:$?.sendTransaction}),W("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=q.solanaRpcs[G.chain];e?(G.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),i=o.value[0]?.account;return i?BigInt(i.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:G.address,mintAddress:F(G.chain)}):A({rpc:e.rpc,address:G.address})).then((e=>{let r=BigInt(e);H&&r>H&&(Y(!0),Q({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-H,6):s(r-H,9),token:G.isUSDC?"USDC":"SOL"}})),N(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await U({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:P,appId:z});return e}})().then((e=>{H&&e>H&&(Y(!0),Q({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-H,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),N(e)})).catch((()=>N(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[H]);let _=a((()=>null==H?"":G.isUSDC?n({amount:H,decimals:6}):K?M(H,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:H,decimals:G.erc20ContractInfo.decimals}):m({wei:H})),[H,K,G]),ee="ethereum"===G.chainType?G.chain.name:D(G.chain),re=a((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(g,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=a((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&F(G.chain)?`?spl-token=${F(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:x}),/*#__PURE__*/t(f,{theme:q.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(v,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>R({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let x=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{B as ManualTransferScreen,B as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{M as a,b as s,P as m}from"./ModalHeader-rCMpqA2a.mjs";import{L as l}from"./useActiveWallet-RZ4w-uGq.mjs";import{u as c}from"./context-LVpDfP2H.mjs";import{u as p,a as u}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-DVLg14UT.mjs";import{A as v,C as j,I as k,T as g,S as C,B as M}from"./PinInput-3SLvbnQa.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"tinycolor2";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-CLfeO5pd.mjs";import"lucide-react";import"./index-DNz_w3-G.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-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-0wfhnc0j.mjs";import"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-DYfWSjKR.mjs";import"./TodoList-CgrU7uwu.mjs";import"./CopyToClipboard-BGTSFnT3.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-DjnQgnaZ.mjs";import"qrcode";const w={component:()=>{let{user:w,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:S}=u(),A=c(),[E,R]=n(null),[P,F]=n(null),[T,x]=n(null),[L,B]=n(!1),[U,W]=n(!1),[D,O]=n(),X=async()=>{D?$(D):w?await H({user:w}):$(Error("Must be logged in to manage MFA")),setTimeout((()=>{R(null),F(null)}),500)};if(S.current=X,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:$,onSuccess:H,onBack:K,mfaMethods:Q,verify:q,generateTotpSecret:z,enrollTotp:J,unenrollTotp:N,enrollPasskey:V}=I.mfaEnroll,_=w?.mfaMethods.includes("sms"),G=w?.mfaMethods.includes("totp"),Y=w?.mfaMethods.includes("passkey"),Z=!!w?.phone,ee=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){R(null),F(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await V(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),B(!1)}}if(!b||!w||!A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(a,{onClose:X,backFn:K},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(l,{})}),/*#__PURE__*/t(s,{})]});if("sms"===E)return null;if("totp"===E)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(a,{backFn:oe,onClose:X},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(C,{children:["MFA adds an extra layer of security to your ",A?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await N();return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(s,{})]});if("passkey"===E){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(a,{backFn:oe,onClose:X},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(C,{children:i?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V([]);return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(s,{})]})}return 0!==Q.length||_||G||Y?"sms"===P?null:"totp"===P&&T?/*#__PURE__*/t(h,{onClose:X,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await J(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),R(null)}}(e.mfaCode),error:D,totpInfo:{...T,appName:A?.name||"Privy"}}):"passkey"===P?/*#__PURE__*/t(y,{onReset:oe,onClose:X,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:w.mfaMethods,appMfaMethods:A.mfa.methods,userHasAuthSms:Z,backFn:K,handleSelectMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}return"totp"===e?(F(e),x(null),void z().then((({totpSecret:e,totpAuthUrl:o})=>{x({authUrl:o,secret:e})})).catch((()=>{x(null),oe()}))):"passkey"===e&&1===ee.length?await te():void F(e)},isTotpLoading:"totp"===P&&!T,isPasskeyLoading:L,error:D,onClose:X,setRemovingMfaMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}R(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(a,{onClose:X,backFn:K},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[A?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(m,{onClick:X,children:"Close"})}),/*#__PURE__*/t(s,{})]})}};export{w as MfaAuthEnrollmentFlowScreen,w as default};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useState as e,useEffect as t,useRef as r}from"react";import{u as i}from"./context-LVpDfP2H.mjs";import{u as s,a as m}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{V as n,a,b as c,t as p}from"./to-ui-error-CCqAdorW.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-DERdsrmf.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./index-DNz_w3-G.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-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./TransactionDetails-BP142O9n.mjs";import"./WalletLink-CN4enmsE.mjs";import"./ethers-BQ45eiVv.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const l={component:()=>{let{user:l}=s(),u=i(),d=l?.mfaMethods.filter((o=>"passkey"!==o||!u.globalDisablePasskeys))??[],{data:h}=m(),[f,j]=e(d[0]),[v,y]=e(!1),[k,g]=e(),[w,C]=e();if(t((()=>{j(d[0])}),[d]),!h?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:b,onSuccess:I,generateOptions:M,verifyTotpCode:S,verifyPasskey:P,verifySmsCode:x,sendSmsCode:A}=h.mfaVerify,E=async o=>{if("passkey"!==o)try{j(o),"sms"===o&&(j(o),await A()),"totp"===o&&j(o)}catch(o){console.error(o)}else try{j(o);let e=await M();if(!e)throw Error("something went wrong");g(e),await P(e),y(!0),C(void 0),I()}catch(o){C(p(o))}},B=async o=>{C(void 0);try{if(!o||!f)return;if("passkey"===f){if(!k)throw Error("Missing passkey challenge");await P(k)}else"sms"===f?await x(o):"totp"===f&&await S(o);C(void 0),y(!0),I()}catch(o){throw p(o).error}},F=()=>{w||!v?b(w?.error??Error("Canceled MFA verification.")):I()},L=r(!1);return t((()=>{!L.current&&f&&(L.current=!0,E(f).finally((()=>{L.current=!1})))}),[open]),l?"passkey"===f?/*#__PURE__*/o(n,{account:l.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,e)=>e.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:w?.isBlocking??!1,error:w?.error,onClose:F,onBack:()=>{j(void 0),C(void 0)},handleSubmit:()=>B(k).catch(C)}):"sms"===f||"totp"===f?/*#__PURE__*/o(a,{selectedMethod:f,submitSuccess:v,hasBlockingError:w?.isBlocking??!1,handleSubmitCode:B,onClose:F,onBack:d.length>1?()=>j(void 0):void 0}):/*#__PURE__*/o(c,{mfaMethods:d,onSelect:E,handleClose:F}):null}};export{l as MfaAuthVerifyFlowScreen,l as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import n from"@heroicons/react/24/outline/ShieldCheckIcon";import i from"@heroicons/react/24/solid/CheckBadgeIcon";import l from"@heroicons/react/24/solid/IdentificationIcon";import{useState as a,useEffect as s}from"react";import{M as c,b as m,P as d,S as h}from"./ModalHeader-rCMpqA2a.mjs";import{L as u}from"./useActiveWallet-RZ4w-uGq.mjs";import{u as p}from"./context-LVpDfP2H.mjs";import{u as f}from"./internal-context-Z-fyxadS.mjs";import{a as y,u as v}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-DNz_w3-G.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-DVLg14UT.mjs";import F from"@heroicons/react/24/outline/CheckCircleIcon";import P from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-BMtTIItD.mjs";import{I as W,T,S as B,C as L,a as A,B as N,N as U,A as O,L as D,b as $,c as X}from"./PinInput-3SLvbnQa.mjs";import{ErrorScreenView as Y}from"./ErrorScreen-CLfeO5pd.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-DYfWSjKR.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"./CopyToClipboard-BGTSFnT3.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-DjnQgnaZ.mjs";import"qrcode";import"./reservoir-0wfhnc0j.mjs";const q=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,h]=a(""),[u,f]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=y(),D=p();function $(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(Y,{allowlistConfig:D.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(c,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(T,{children:"Set up SMS verification"}),/*#__PURE__*/o(B,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(L,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),h(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(A,{children:["By providing your mobile number, you agree to receive text messages from ",D?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(m,{})]}:u?{children:[/*#__PURE__*/e(c,{onClose:$},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(T,{children:"SMS verification added"}),/*#__PURE__*/o(B,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:$,children:"Done"})}),/*#__PURE__*/e(m,{})]}:{children:[/*#__PURE__*/e(c,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(T,{children:"Enter enrollment code"}),/*#__PURE__*/o(L,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),f(!0)}catch(e){if(w(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(k(e))throw Error("The code you entered is not valid");if(g(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw j(e)?Error("Verification canceled"):Error("Unknown error")}}}),/*#__PURE__*/o(B,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(m,{})]})},H={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,F]=a(null),{unenrollWithSms:P,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:A,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:Y,initEnrollmentWithTotp:H}=C(),{data:K,onUserCloseViaDialogOrKeybindRef:Q}=y(),V=p(),{closePrivyModal:z}=f(),{promptMfa:J}=b(),[_,G]=a(!1),[Z,ee]=a(null),[oe,re]=a(null),te=()=>{z({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{F(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();Q.current=te;let se=w?.mfaMethods.includes("sms"),ce=!!w?.phone,me=w?.mfaMethods.includes("totp"),de=w?.mfaMethods.includes("passkey"),he=se||me||de,ue=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){F(null),ee(null)}async function fe(e=ue){ie(!0);try{return await U(),await Y({credentialIds:e},{removeForLogin:K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),K?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&G(!0)}),[he]),!g||!w||!V/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(L,{children:/*#__PURE__*/e(u,{})}),/*#__PURE__*/e(m,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(T,{children:"Remove SMS verification?"}),/*#__PURE__*/o(B,{children:["MFA adds an extra layer of security to your ",V?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){F(null);try{await P()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(T,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(B,{children:["MFA adds an extra layer of security to your ",V?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){F(null);try{await R()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("passkey"===j){let n=K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(T,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(B,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){F(null);try{await x({removeForLogin:K?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]})}if(0===K.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(T,{children:"Add more security"}),/*#__PURE__*/o(B,{children:[V?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:te,children:"Close"})}),/*#__PURE__*/e(m,{})]});let ye=!he&&!_;return ye?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(T,{children:"Transaction Protection"}),/*#__PURE__*/e(B,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/o($,{children:[/*#__PURE__*/e(X,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",V?.name," wallet."]}),/*#__PURE__*/o($,{children:[/*#__PURE__*/e(X,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(d,{onClick:()=>G(!0),children:"Continue"}),/*#__PURE__*/e(h,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(m,{})]}):"sms"===Z?/*#__PURE__*/e(q,{appName:V?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===Z&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await A({mfaCode:e}),K?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{F(null)}}(e),totpInfo:{...oe,appName:V?.name||"Privy"}}):"passkey"===Z?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:fe}):/*#__PURE__*/e(I,{showIntro:ye,userMfaMethods:w.mfaMethods,appMfaMethods:V.mfa.methods,userHasAuthSms:ce,backFn:function(){G(!1)},handleSelectMethod:async function(e){try{await J()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void H().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await fe():void ee(e)},isTotpLoading:"totp"===Z&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await J()}catch(e){return void ae(e)}F(e)}})}};export{H as MfaEnrollmentFlowScreen,H as default};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useState as t,useEffect as e,useRef as r}from"react";import{u as i}from"./context-LVpDfP2H.mjs";import{u as s}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as n}from"./index-DNz_w3-G.mjs";import{V as m,a as c,b as a,t as l}from"./to-ui-error-CCqAdorW.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-rCMpqA2a.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"./ScreenLayout-DF3DCKOK.mjs";import"./Screen-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-DERdsrmf.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./TransactionDetails-BP142O9n.mjs";import"./WalletLink-CN4enmsE.mjs";import"./ethers-BQ45eiVv.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p=({onClose:p})=>{let{user:u}=s(),d=i(),h=u?.mfaMethods.filter((o=>"passkey"!==o||!d.globalDisablePasskeys))??[],[j,f]=t(h[0]??null),{init:v,cancel:y,submit:k}=n(),[g,b]=t(!1),[w,I]=t(null),[C,S]=t();e((()=>{f(h[0]??null)}),[h]);let M=r(!1);async function P(o){S(void 0);try{if(!o||!j)return;await k(j,o),b(!0),S(void 0),p()}catch(o){throw l(o).error}}async function x(o){if("passkey"!==o)try{f(o),await v(o)}catch(o){console.error(o)}else try{f(o);let t=await v(o);if(!t)throw Error("something went wrong");I(t),await k(o,t),b(!0),S(void 0),p()}catch(o){S(l(o))}}e((()=>{!M.current&&j&&(M.current=!0,x(j).finally((()=>{M.current=!1})))}),[]);let B=()=>{f(null),S(void 0),y(),p()};return u?"passkey"===j?/*#__PURE__*/o(m,{account:u.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:g,hasBlockingError:C?.isBlocking??!1,error:C?.error,onClose:B,onBack:()=>{f(null),S(void 0)},handleSubmit:()=>P(w).catch(S)}):j?/*#__PURE__*/o(c,{submitSuccess:g,hasBlockingError:C?.isBlocking??!1,handleSubmitCode:P,selectedMethod:j,onClose:B,onBack:h.length>1?()=>f(null):void 0}):/*#__PURE__*/o(a,{mfaMethods:h,onSelect:x,handleClose:B}):null};export{p as MfaVerifyFlowScreen,p as default};
@@ -1,16 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as n}from"react";import{styled as a}from"styled-components";import{M as l,B as s,P as c}from"./ModalHeader-rCMpqA2a.mjs";import{a as m}from"./Layouts-BlFm53ED.mjs";import{L as d,a7 as u}from"./useActiveWallet-RZ4w-uGq.mjs";import{u as p}from"./context-LVpDfP2H.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as g}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{u as f}from"./index-DoasOxbi.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"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"tinycolor2";import"ofetch";import"./analytics-mkkvFRju.mjs";const y=({size:r=61,...o})=>/*#__PURE__*/t("svg",{width:r,height:r,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:/*#__PURE__*/e("g",{id:"moonpay_symbol_wht 2",children:[/*#__PURE__*/t("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),/*#__PURE__*/t("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});const v={component:()=>{let{data:o,setModalData:i,navigateBack:n}=g(),a=p(),{closePrivyModal:c}=h(),{externalTransactionId:m}=o?.moonpayStatus,d=f(m||null,a.fundingMethodConfig.moonpay.useSandbox??!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{let t={...o?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(t.usingDefaultFundingMethod=!1),i({funding:t,solanaFundingData:o?.solanaFundingData}),n()}}),/*#__PURE__*/t(C,{status:d,onClickCta:c}),/*#__PURE__*/t(s,{})]})}};let C=({status:o,onClickCta:i})=>{let{title:a,body:l,cta:s}=n((()=>(t=>{switch(t){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(j,{children:[/*#__PURE__*/t(w,{status:o}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t("h3",{children:a}),/*#__PURE__*/t(b,{children:l})]})]}),s&&/*#__PURE__*/t(c,{onClick:i,children:s})]})},w=({status:r})=>{if(!r||"pending"===r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(d,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(u,{color:r}),/*#__PURE__*/t(y,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let n=(e=>{switch(e){case"completed":return i;case"waitingAuthorization":return()=>/*#__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"}});default:return}})(r),a=(l=r)?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[l]:"var(--privy-color-foreground-4)";var l;/*#__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})})},b=a.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
- `,j=a.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{v as MoonpayStatusScreen,v as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import t,{useState as r,useEffect as o}from"react";import{i,u as a,a as n}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{A as s,T as m,I as c,S as l,a as d,L as p,b as u,D as h,G as v}from"./twitter-BoAxhlj6.mjs";import y from"@heroicons/react/24/outline/GlobeAltIcon";import{T as g,L as f}from"./twitch-5IOe4sIQ.mjs";import{u as E,q as T}from"./context-LVpDfP2H.mjs";import{b as A,u as S,k as w}from"./internal-context-Z-fyxadS.mjs";import{s as b}from"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";import{S as C}from"./ScreenLayout-DF3DCKOK.mjs";import{e as _}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{l as j}from"./index-DNz_w3-G.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-rCMpqA2a.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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-CV2tt2Ap.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-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const O=({style:t})=>/*#__PURE__*/e(y,{style:{color:"var(--privy-color-error)",...t}});let R={google:{name:"Google",component:v},discord:{name:"Discord",component:h},github:{name:"Github",component:u},linkedin:{name:"LinkedIn",component:p},twitter:{name:"Twitter",component:d},spotify:{name:"Spotify",component:l},instagram:{name:"Instagram",component:c},tiktok:{name:"Tiktok",component:m},line:{name:"LINE",component:f},twitch:{name:"Twitch",component:g},apple:{name:"Apple",component:s}},N=({iconUrl:e,...r})=>t.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},t.createElement("foreignObject",{x:"2",y:"2",width:"29",height:"28"},t.createElement("img",{src:e,width:"29",height:"28",style:{display:"block",objectFit:"contain",borderRadius:"4px"},alt:"Provider icon"})));const U=(e,r)=>{if(e in R)return R[e];if(i(e)&&r){let o=r.find((t=>t.provider===e));if(o)return{name:o.provider_display_name,component:e=>t.createElement(N,{...e,iconUrl:o.provider_icon_url})}}return{name:"Unknown",component:O}};function I(e,t,r){let o={detail:"",retryable:!1},i=_(t);if(e?.privyErrorCode===A.LINKED_TO_ANOTHER_USER&&(o.detail="This account has already been linked to another user."),e?.privyErrorCode===A.INVALID_CREDENTIALS&&(o.retryable=!0,o.detail="Something went wrong. Try again."),e.privyErrorCode===A.OAUTH_USER_DENIED&&(o.detail=`Retry and check ${i} to finish connecting your account.`,o.retryable=!0),e?.privyErrorCode===A.TOO_MANY_REQUESTS&&(o.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===A.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=U(t,r).name;o.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===A.OAUTH_ACCOUNT_SUSPENDED){let e=U(t,r).name;o.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE&&(o.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===A.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(o.detail="Something went wrong. Please try again."),o}const L=({providerName:t,ProviderLogo:r,success:o,errorMessage:i,onRetry:a})=>{let n=o?`Successfully connected with ${t}`:i?i.message:`Verifying connection to ${t}`;/*#__PURE__*/return e(C,{title:n,subtitle:o?"You're good to go!":i?i.detail:"Just a few moments more",icon:r,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!i},secondaryCta:i?.retryable&&a?{label:"Retry",onClick:a}:void 0,watermark:!0})},k={component:()=>{let{authenticated:t,logout:i,ready:s,user:m}=a(),{setModalData:c,navigate:l,resetNavigation:d}=n(),p=E(),{getAuthMeta:u,initLoginWithOAuth:h,loginWithOAuth:v,updateWallets:y,setReadyToTrue:g,closePrivyModal:f,createAnalyticsEvent:C}=S(),[_,O]=r(!1),[R,N]=r(void 0),k=u()?.provider||"google",{name:D,component:P}=U(k,p.customOAuthProviders);return o((()=>{v(k).then((()=>{O(!0),g(!0)})).catch((e=>{if(g(!1),e?.privyErrorCode===A.ALLOWLIST_REJECTED)return N(void 0),d(),void l("AllowlistRejectionScreen");if(e?.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new w(e).toString()),N(void 0),d(),void l("UserLimitReachedScreen");if(e?.privyErrorCode===A.USER_DOES_NOT_EXIST)return N(void 0),d(),void l("AccountNotFoundScreen");if(e?.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return N(void 0),d(),c({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:u()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void l("LinkConflictScreen");let{retryable:t,detail:r}=I(e,k,p.customOAuthProviders);N({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{j()}))}),[D,k]),o((()=>{if(s&&t&&_&&m){if(p?.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let e=setTimeout((()=>{l("AffirmativeConsentScreen")}),T);return()=>clearTimeout(e)}if(b(m,p.embeddedWallets)){let e=setTimeout((()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:k,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),l("EmbeddedWalletOnAccountCreateScreen")}),T);return()=>clearTimeout(e)}{let e=setTimeout((()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0})),T);return y(),()=>clearTimeout(e)}}}),[s,t,_,m]),/*#__PURE__*/e(L,{providerName:D,ProviderLogo:P,success:_,errorMessage:R,onRetry:R?.retryable?()=>{j(),h(k),N(void 0)}:void 0})},isShownBeforeReady:!0};export{k as OAuthStatusScreen,L as OAuthStatusScreenView,k as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{FingerprintIcon as e}from"lucide-react";import{a as o}from"./index-DNz_w3-G.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as r}from"./ScreenLayout-DF3DCKOK.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"./context-LVpDfP2H.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:o="Log in or create a new account?",subtitle:i="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:a,onLogin:s})=>/*#__PURE__*/t(r,{title:o,subtitle:i,icon:e,primaryCta:{label:"Create new account",onClick:a},secondaryCta:{label:"Log in with a passkey",onClick:s},watermark:!0}),n={component:()=>{let{enabled:e,token:r}=o(),{navigate:n,setModalData:p}=a(),{initSignupWithPasskey:c,initLoginWithPasskey:m}=i();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!r?(p({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:t=>c({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:r}),p({passkeyAuthModalData:{passkeySignupFlow:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!r?(p({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:t=>m({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await m({withPrivyUi:!0,captchaToken:r}),p({passkeyAuthModalData:{passkeySignupFlow:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
@@ -1,3 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{FingerprintIcon as r}from"lucide-react";import{useState as t,useRef as o,useEffect as s}from"react";import{styled as i}from"styled-components";import{u as a,q as n}from"./context-LVpDfP2H.mjs";import{c,b as m,u}from"./internal-context-Z-fyxadS.mjs";import{a as l,u as p}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs";import{S as y}from"./ScreenLayout-DF3DCKOK.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-DNz_w3-G.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-rCMpqA2a.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-CV2tt2Ap.mjs";import"./index-Dq_xe9dz.mjs";const h=({status:t,passkeySignupFlow:o=!1,error:s,onRetry:i})=>/*#__PURE__*/e(y,{title:(()=>{switch(t){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})(),subtitle:/*#__PURE__*/e(g,{children:(()=>{switch(t){case"loading":return o?"Please follow prompts to register your passkey.":"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof c){if(s.privyErrorCode===m.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(s.privyErrorCode===m.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()}),icon:r,iconVariant:"loading",iconLoadingStatus:{success:"success"===t,fail:"error"===t},primaryCta:"error"===t&&i?{label:"Retry",onClick:i}:"success"===t?{label:"Continue",disabled:!0}:void 0,watermark:!0}),f={component:()=>{let{data:r,setModalData:i,navigate:c}=l(),m=a(),{loginWithPasskey:y,signupWithPasskey:f,closePrivyModal:g,createAnalyticsEvent:v}=u(),{user:w,logout:k}=p(),{passkeySignupFlow:j}=r?.passkeyAuthModalData??{},S=n-500,[b,C]=t("loading"),[A,P]=t(null),E=o([]),W=e=>{E.current=[e,...E.current]};s((()=>()=>{E.current.forEach((e=>clearTimeout(e))),E.current=[]}),[]);let T=async()=>{C("loading");try{j?await f():await y(),C("success")}catch(e){P(e),C("error")}};return s((()=>{if("success"===b&&w){if(m?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms)return void W(setTimeout((()=>{c("AffirmativeConsentScreen")}),S));if(!d(w,m?.embeddedWallets))return void W(setTimeout((()=>{g({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),n));W(setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"PasskeyStatusScreen"}}),k()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,b]),s((()=>{T()}),[]),/*#__PURE__*/e(h,{status:b,passkeySignupFlow:j,error:A,onRetry:T})}};let g=i.span`
2
- white-space: pre-wrap;
3
- `;export{f as PasskeyStatusScreen,h as PasskeyStatusScreenView,f as default};
@@ -1,20 +0,0 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as o,useEffect as i}from"react";import{styled as a,css as s}from"styled-components";import{u as n,a as l,h as c}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{P as m}from"./ModalHeader-rCMpqA2a.mjs";import{S as d}from"./Layouts-BlFm53ED.mjs";import{P as p,a as u,I as h,H as y,S as v}from"./shared-DwO5pr5t.mjs";import{n as f}from"./index-DNz_w3-G.mjs";import{u as w,m as g}from"./internal-context-Z-fyxadS.mjs";import{S as j}from"./Screen-CV2tt2Ap.mjs";import"viem";import"./context-LVpDfP2H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.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/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./index-Dq_xe9dz.mjs";const b={component:()=>{let[a,s]=o(!0),{authenticated:m,user:b}=n(),{walletProxy:A,closePrivyModal:I,createAnalyticsEvent:P,client:S}=w(),{navigate:W,data:T,onUserCloseViaDialogOrKeybindRef:_}=l(),[E,M]=o(void 0),[R,H]=o(""),[U,F]=o(!1),{entropyId:N,entropyIdVerifier:O,onCompleteNavigateTo:V,onSuccess:$,onFailure:z}=T.recoverWallet,B=(e="User exited before their wallet could be recovered")=>{I({shouldCallAuthOnSuccess:!1}),z("string"==typeof e?new g(e):e)};_.current=B,i((()=>{if(!m)return B("User must be authenticated and have a Privy wallet before it can be recovered")}),[m]);/*#__PURE__*/return e(j,{children:[/*#__PURE__*/r(j.Header,{icon:t,title:"Enter your password",subtitle:"Please provision your account on this new device. To continue, enter your recovery password.",showClose:!0,onClose:B}),/*#__PURE__*/r(j.Body,{children:/*#__PURE__*/r(x,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(p,{children:[/*#__PURE__*/r(u,{type:a?"password":"text",onChange:e=>(e=>{e&&M(e)})(e.target.value),disabled:U,style:{paddingRight:"2.3rem"}}),/*#__PURE__*/r(h,{style:{right:"0.75rem"},children:a?/*#__PURE__*/r(y,{onClick:()=>s(!1)}):/*#__PURE__*/r(v,{onClick:()=>s(!0)})})]}),!!R&&/*#__PURE__*/r(k,{children:R})]})})}),/*#__PURE__*/e(j.Footer,{children:[/*#__PURE__*/r(j.HelpText,{children:/*#__PURE__*/e(d,{children:[/*#__PURE__*/r("h4",{children:"Why is this necessary?"}),/*#__PURE__*/r("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]})}),/*#__PURE__*/r(j.Actions,{children:/*#__PURE__*/r(C,{loading:U||!A,disabled:!E,onClick:async()=>{F(!0);let e=await S.getAccessToken(),r=c(b,N);if(!e||!r||null===E)return B("User must be authenticated and have a Privy wallet before it can be recovered");try{P({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r.address}}),await(A?.recover({accessToken:e,entropyId:N,entropyIdVerifier:O,recoveryPassword:E})),H(""),V?W(V):I({shouldCallAuthOnSuccess:!1}),$?.(r),P({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}})}catch(e){f(e)?H("Invalid recovery password, please try again."):H("An error has occurred, please try again.")}finally{F(!1)}},$hideAnimations:!N&&U,children:"Recover your account"})}),/*#__PURE__*/r(j.Watermark,{})]})]})}};let x=a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 1.5rem;
5
- `,k=a.div`
6
- line-height: 20px;
7
- height: 20px;
8
- font-size: 13px;
9
- color: var(--privy-color-error);
10
- text-align: left;
11
- margin-top: 0.5rem;
12
- `,C=a(m)`
13
- ${({$hideAnimations:e})=>e&&s`
14
- && {
15
- // Remove animations because the recoverWallet task on the iframe partially
16
- // blocks the renderer, so the animation stutters and doesn't look good
17
- transition: none;
18
- }
19
- `}
20
- `;export{b as PasswordRecoveryScreen,b as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as i}from"react";import{M as c,P as s,B as l}from"./ModalHeader-rCMpqA2a.mjs";import{C as n}from"./ScreenHeader-CHmc4-Lu.mjs";import{q as d}from"./context-LVpDfP2H.mjs";import{o as p,q as u,r as m,v as h,R as v,l as w}from"./index-DNz_w3-G.mjs";import{a as y,f,b as _,u as A}from"./internal-context-Z-fyxadS.mjs";import{a as E,u as g,g as C}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{a8 as b,a9 as R,aa as k}from"./paths-3HW55qZg.mjs";import{g as T}from"./useWallets-DlGuNtGR.mjs";import{a as O}from"./events-context-CI0iqAXA.mjs";import{A as N,G as S,R as I}from"./styles-BsotlekN.mjs";import"styled-components";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";async function M({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function o(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),o()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),o()))}window.addEventListener("message",a)}))}async function x({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new y("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new y("User denied confirmation during OAuth flow");try{return(await e.post(b,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(e){let t=f(e);if(t.privyErrorCode)throw new y(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new y("Invalid code during oauth flow.",void 0,_.OAUTH_USER_DENIED);throw new y("Invalid code during OAuth flow.",void 0,_.UNKNOWN_AUTH_ERROR)}}async function U({api:e,provider:t}){let r=p(),o=u(),a=await m(r);try{return"icloud"===t?{url:(await e.post(R,{client_type:"web"})).url}:{url:(await e.post(k,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw f(e)}}let j={"google-drive":{name:"Google Drive",component:S},icloud:{name:"iCloud",component:N}};const W={component:()=>{let{logout:p}=g(),{navigate:u,setModalData:m,data:f}=E(),{closePrivyModal:b,createAnalyticsEvent:R}=A(),{execute:k}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=A(),{data:o}=E(),{user:a}=g(),i=O(),{create:c}=h();return{execute:async({provider:s,action:l,popup:n,shouldCreateEth:d,shouldCreateSol:p})=>{let u,m;if(!e)throw new y("Missing client");function h(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:s}}),new y("Recovery OAuth failed")}switch(s){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await U({api:e.api,provider:s});h(o);try{let a=await M({url:o,popup:n,provider:s});if(t=a.stateCode,r=a.authorizationCode,t!==i)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:s,storedStateCode:i??"",returnedStateCode:t??""}}),new y("Unexpected auth flow. This may be a phishing attempt.",void 0,_.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:s}}),new y("Recovery OAuth failed")}[u,m]=await Promise.all([e.getAccessToken(),x({api:e.api,provider:s,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await U({api:e.api,provider:s});h(t);let{ckWebAuthToken:r}=await M({url:t,popup:n,provider:s});m=r,u=await e.getAccessToken()}}if(!t)throw new y("Cannot connect to wallet proxy");if(!u)throw new y("Unable to authorize user");switch(l){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new y("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:s}}),await t.recover({accessToken:u,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:m}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:s}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),d&&p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await c({chainType:"solana",walletIndex:0,latestUser:t.user});else if(p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"solana",walletIndex:0,latestUser:a});else{if(!d)throw Error("Invalid args to create wallet");t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),i("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let o=C(a);if(!o)throw i("setWalletRecovery","onError",_.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}});let{entropyId:c,entropyIdVerifier:l}=T(a);await t.setRecovery({accessToken:u,entropyId:c,entropyIdVerifier:l,recoveryMethod:s,recoveryAccessToken:m});let n=C(await r());if(!n)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}}),i("setWalletRecovery","onSuccess",{method:s,wallet:n});break}default:throw new y("Unsupported recovery action")}}}})(),[N,S]=o(!1),{provider:W,action:D,isInAccountCreateFlow:P,shouldCreateEth:V,shouldCreateSol:L}=f?.recoveryOAuthStatus,[z,H]=o(void 0),[$,F]=o("create-wallet"===D);if("user-passcode"===W)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let B=j[W].name,G=j[W].component,K=f?.recoverWallet?.onCompleteNavigateTo,Y=new v((async(e="create-wallet")=>(F(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await k({provider:W,action:e,popup:r,shouldCreateEth:V,shouldCreateSol:L}),S(!0),t()}catch(t){H({message:`${"recover"===e?"Recovery":"Back up"} with ${B} unsuccessful`,detail:"recover"===D?`Please verify that you are selecting the ${B} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));a((()=>{"recover"!==D&&Y.execute(P?"create-wallet":"set-recovery")}),[]),a((()=>{if(!N)return;let e=setTimeout((()=>{P?(m({createWallet:{onSuccess:()=>{},onFailure:e=>{R({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),p()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),u("EmbeddedWalletCreatedScreen")):b({shouldCallAuthOnSuccess:!1})}),d);return()=>clearTimeout(e)}),[N]);let q=i((async()=>{await Y.execute("recover"),K?u(K):S(!0)}),[]),X="google-drive"===W?"Google Drive":"Apple iCloud",Q=N&&`Successfully ${"recover"===D?"recovered":"backed up"} with ${X}.`||z&&z.message||`${"recover"===D?"Recovering":"Backing up"} with ${X}...`,J=z?z.detail:"";/*#__PURE__*/return e(t,{children:[/*#__PURE__*/r(c,{}),$?/*#__PURE__*/r(t,{children:/*#__PURE__*/e(I,{children:[/*#__PURE__*/r(n,{title:Q,icon:/*#__PURE__*/r(G,{style:{width:"38px",height:"38px"}}),description:J}),z&&z?.retryable?/*#__PURE__*/r(s,{onClick:()=>{w(),H(void 0),"create-wallet"===D?Y.execute("create-wallet"):q()},disabled:!N&&!z?.retryable,children:"Try again"}):null]})}):/*#__PURE__*/e(I,{children:[/*#__PURE__*/r(n,{title:"Confirm it's really you",icon:/*#__PURE__*/r(G,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${X} where your account is backed up.`}),/*#__PURE__*/e(s,{onClick:q,children:["Confirm with ",X]})]}),/*#__PURE__*/r(l,{})]})}};export{W as RecoveryOAuthScreen,W as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as t}from"react";import{u as r}from"./context-LVpDfP2H.mjs";import{v as i,R as s}from"./index-DNz_w3-G.mjs";import{u as a,m as n}from"./internal-context-Z-fyxadS.mjs";import{a as c,u as l}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-ChA4tW4Y.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-RZ4w-uGq.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-DlGuNtGR.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"./ModalHeader-rCMpqA2a.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-DwO5pr5t.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{navigate:u,data:d,onUserCloseViaDialogOrKeybindRef:h}=c(),w=r(),[y,v]=o(""),[f,j]=o(!1),[g,C]=o(),[I,b]=o(null),{create:S}=i(),{authenticated:x,user:P}=l(),{closePrivyModal:A,isNewUserThisSession:M,initializeWalletProxy:U}=a(),{onSuccess:k,onFailure:E,callAuthOnSuccessOnClose:T,shouldCreateEth:O,shouldCreateSol:W}=d.createWallet,[D,L]=o(null),R=new s((async()=>{try{let e;if(O&&W)e=await S({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:P}),e=await S({chainType:"solana",walletIndex:0,latestUser:e.user});else if(W)e=await S({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"solana",walletIndex:0,latestUser:P});else{if(!O)throw Error("Invalid args to create wallet");e=await S({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:P})}L(e),M?u("EmbeddedWalletCreatedScreen"):(k(e),A({shouldCallAuthOnSuccess:T}))}catch(e){v(e.message)}}));t((()=>{I||U(3e4).then((e=>b(e)))}),[I]),t((()=>{if(!x||!P)return u("LandingScreen"),void E(Error("User must be authenticated before creating a Privy wallet"))}),[x]),h.current=()=>null;/*#__PURE__*/return e(m,{config:{initiatedBy:"automatic"},appName:w?.name||"privy",loading:!I,buttonLoading:f,buttonHideAnimations:!D&&f,isResettingPassword:!1,error:y,password:g||"",onClose:()=>{D&&"user-passcode"!==D.account.recoveryMethod?(E(new n("User created a wallet but failed to set a password for it")),A({shouldCallAuthOnSuccess:!1})):D?(k(D),A({shouldCallAuthOnSuccess:T})):(E(new n("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))},onPasswordChange:C,onPasswordGenerate:()=>C(p()),onSubmit:async()=>(j(!0),R.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>j(!1))))})}};export{u as EmbeddedWalletPasswordCreateScreen,u as default};
@@ -1,7 +0,0 @@
1
- import{jsxs as e,jsx as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/LockClosedIcon";import i from"@heroicons/react/24/outline/PencilSquareIcon";import s from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import{useState as c}from"react";import{styled as n}from"styled-components";import{a,u as l,g as p}from"./get-is-unified-wallet-CNcx75Dp.mjs";import{M as d,B as u,P as m}from"./ModalHeader-rCMpqA2a.mjs";import{C as h}from"./ScreenHeader-CHmc4-Lu.mjs";import{u as y}from"./context-LVpDfP2H.mjs";import{u as v}from"./internal-context-Z-fyxadS.mjs";import{w as g}from"./index-DNz_w3-G.mjs";import{R as f,A as w,G as C,a as j}from"./styles-BsotlekN.mjs";import{U as k}from"./useActiveWallet-RZ4w-uGq.mjs";import"viem";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DlGuNtGR.mjs";import"./prepareFundingModalData-DjTxAoJ1.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Dj52a5sp.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-B4uPLKn-.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"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";let S=n.div`
2
- width: 24px;
3
- height: 24px;
4
- display: flex;
5
- justify-content: center;
6
- align-items: center;
7
- `,A={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},b=({onClose:t})=>/*#__PURE__*/e(j,{children:[/*#__PURE__*/o(h,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/o(s,{width:48}),description:/*#__PURE__*/e(r,{children:[/*#__PURE__*/o("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/o("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/o(m,{onClick:t,children:"Select backup method"})]});const x={component:()=>{let[s,n]=c(!1),{navigate:m,lastScreen:j,navigateBack:x,setModalData:M,data:I,onUserCloseViaDialogOrKeybindRef:P}=a(),{user:O}=l(),{embeddedWallets:W}=y(),{closePrivyModal:R}=v(),F=p(O),D=null===F,{isInAccountCreateFlow:B,isResettingPassword:E,shouldCreateEth:G,shouldCreateSol:U}=I.recoverySelection,H=F&&"privy"!==F.recoveryMethod,L=H?/*#__PURE__*/e("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/o("strong",{children:A[F?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function Y(e){M({recoveryOAuthStatus:{provider:e,action:D?"create-wallet":"set-recovery",isInAccountCreateFlow:B,shouldCreateEth:G,shouldCreateSol:U}}),m("RecoveryOAuthScreen")}function q(){I?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),R({shouldCallAuthOnSuccess:I?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return P.current=q,/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(d,{onClose:q,backFn:s?()=>n(!1):j?x:void 0,infoFn:j||s?void 0:()=>n(!0)},"header"),s?/*#__PURE__*/o(b,{onClose:()=>n(!1)}):/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(h,{title:H?"Update backup method":"Secure your account",icon:/*#__PURE__*/o(t,{width:48}),description:L}),/*#__PURE__*/o(f,{children:W.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(F?.recoveryMethod||"")||e!==F?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":/*#__PURE__*/return e(k,{onClick:()=>Y("google-drive"),children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(C,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":/*#__PURE__*/return e(k,{onClick:()=>Y("icloud"),children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(w,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":/*#__PURE__*/return e(k,{onClick:()=>{m(g({isCreatingWallet:D,skipSplashScreen:!0}))},children:[/*#__PURE__*/o(S,{children:/*#__PURE__*/o(i,{style:{width:18}})}),E?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),/*#__PURE__*/o(u,{})]})}};export{x as RecoverySelectionScreen,x as default};