@privy-io/react-auth 3.8.0 → 3.9.0-beta-20251212212932

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 (347) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-jSbfPu_e.js → AccountNotFoundScreen-C1W2fcyo.js} +1 -1
  2. package/dist/cjs/{Address-CZQd_MIA.js → Address-DGUdKafT.js} +1 -1
  3. package/dist/cjs/AffirmativeConsentScreen-D4OJpmEg.js +1 -0
  4. package/dist/cjs/{AllowlistRejectionScreen-B6roj0JU.js → AllowlistRejectionScreen-B7rDhjpU.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-BcBapHrq.js → AuthenticateWithWalletScreen-CtH28Vb7.js} +1 -1
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-DNo_etZr.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-B0mcg1q6.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-BgOZn2kl.js +1 -0
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DYS3lDs0.js → AwaitingSolToEvmBridgingScreen-Cegtmcyh.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-uivzU_Y9.js → BridgeNetworkSelectionView-DQ4AKZVL.js} +1 -1
  11. package/dist/cjs/{Button-nXApC2Jy.js → Button-QElvggxT.js} +1 -1
  12. package/dist/cjs/CaptchaScreen-KIwoUwV2.js +1 -0
  13. package/dist/cjs/CoinbaseOnrampStatusScreen-ClsWbyMu.js +1 -0
  14. package/dist/cjs/{ConnectEmailForm-BEv-7qU9.js → ConnectEmailForm-Cpvu7PEt.js} +1 -1
  15. package/dist/cjs/ConnectLedgerScreen-C9nw3QVj.js +1 -0
  16. package/dist/cjs/{ConnectOnlyLandingScreen-bOhkl0xJ.js → ConnectOnlyLandingScreen-BOuJ1H9w.js} +1 -1
  17. package/dist/cjs/ConnectOnlyStatusScreen-DK4bjLii.js +1 -0
  18. package/dist/cjs/ConnectOrCreateScreen-YCIhmLCW.js +1 -0
  19. package/dist/cjs/{ConnectPhoneForm-DK-bg2D5.js → ConnectPhoneForm-BhTwbwML.js} +1 -1
  20. package/dist/cjs/{ConnectWalletView-4vj7Sq7-.js → ConnectWalletView-OFVLgqsD.js} +1 -1
  21. package/dist/cjs/ConnectionStatusScreen-BmZIqpN7.js +1 -0
  22. package/dist/cjs/CrossAppAuthScreen-BeUpL_ke.js +1 -0
  23. package/dist/cjs/{CustomLandingScreenView-tt_NEfU6.js → CustomLandingScreenView-BMEITA7m.js} +2 -2
  24. package/dist/cjs/{DelegatedActionsConsentScreen-B5WlYn7z.js → DelegatedActionsConsentScreen-D7pwtlqL.js} +1 -1
  25. package/dist/cjs/DelegatedActionsRevokeScreen-CjM9Sioz.js +1 -0
  26. package/dist/cjs/EmbeddedWalletConnectingScreen-CNsU7jHP.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-PycFyIz6.js → EmbeddedWalletCreatedScreen-D3pPFl5h.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-BDTDQY1f.js → EmbeddedWalletKeyExportScreen-Cbxp8HfV.js} +2 -2
  29. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-BawUOKbB.js +1 -0
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js → EmbeddedWalletPasswordUpdateScreen-CXManbsF.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js → EmbeddedWalletPasswordUpdateSplashScreen-qQpsP_mz.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-DZ5fIrXr.js → EnrollTotp-CRTazMDP.js} +1 -1
  33. package/dist/cjs/ErrorScreen-Cyi-HnSe.js +1 -0
  34. package/dist/cjs/FarcasterConnectStatusScreen-CR6ZMxx9.js +2 -0
  35. package/dist/cjs/{FarcasterSignerStatusScreen-CDYkqsxz.js → FarcasterSignerStatusScreen-9YR9eiIc.js} +2 -2
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js → FundSolWalletWithExternalSolanaWallet-CQsAijyt.js} +1 -1
  37. package/dist/cjs/{FundWalletMethodHeader-zYWhBIiS.js → FundWalletMethodHeader-DSaZB2cG.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-BB7-k00c.js → FundingEditAmountScreen-CECyNIVY.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-BrV94GD2.js → FundingMethodSelectionScreen-2tZJu9S7.js} +1 -1
  40. package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +1 -0
  41. package/dist/cjs/{InAppBrowserLoginNotPossible-y8g07-kU.js → InAppBrowserLoginNotPossible-D0k0zJDX.js} +1 -1
  42. package/dist/cjs/{InstallWalletScreen-CmGi6mS1.js → InstallWalletScreen-CmP6yADd.js} +1 -1
  43. package/dist/cjs/LandingScreen-Cu2tjqig.js +1 -0
  44. package/dist/cjs/{LinkConflictScreen-BJXyOu2J.js → LinkConflictScreen-B0536MT6.js} +1 -1
  45. package/dist/cjs/LinkEmailScreen-CxvkEfct.js +1 -0
  46. package/dist/cjs/{LinkPasskeyScreen-Bw7Xs741.js → LinkPasskeyScreen-C5PJWoRd.js} +1 -1
  47. package/dist/cjs/{LinkPhoneScreen-C4JQblY3.js → LinkPhoneScreen-CAFdBxm2.js} +1 -1
  48. package/dist/cjs/{LoginFailedScreen-CGT-2B2h.js → LoginFailedScreen-COhVPqkq.js} +1 -1
  49. package/dist/cjs/ManualTransferScreen-DBf-aZcN.js +1 -0
  50. package/dist/cjs/MfaAuthEnrollmentFlowScreen-Gnjz9u3K.js +1 -0
  51. package/dist/cjs/MfaAuthVerifyFlowScreen-DEYm-6ZO.js +1 -0
  52. package/dist/cjs/MfaEnrollmentFlowScreen-DNN15QXI.js +1 -0
  53. package/dist/cjs/MfaVerifyFlowScreen-BxkXBdCC.js +1 -0
  54. package/dist/cjs/{ModalHeader-DbV81e3m.js → ModalHeader-BcLfp3ap.js} +1 -1
  55. package/dist/cjs/{MoonpayStatusScreen-yghPhz7v.js → MoonpayStatusScreen-CflXzPye.js} +1 -1
  56. package/dist/cjs/OAuthStatusScreen-CKAOb1-J.js +1 -0
  57. package/dist/cjs/PasskeySelectSignupOrLogin-CfiXMGxb.js +1 -0
  58. package/dist/cjs/PasskeyStatusScreen-DM5bpsYR.js +1 -0
  59. package/dist/cjs/PasswordRecoveryScreen-_VPOOzJe.js +1 -0
  60. package/dist/cjs/{QrCode-Ua_0cVUP.js → QrCode-D0s6bMSy.js} +1 -1
  61. package/dist/cjs/RecoveryOAuthStatusScreen-BvETyFFb.js +1 -0
  62. package/dist/cjs/RecoveryPasswordCreateScreen-BdTjGqc1.js +1 -0
  63. package/dist/cjs/RecoverySelectionScreen-CBpXYztT.js +1 -0
  64. package/dist/cjs/{Screen-65eQbiHD.js → Screen-BDXOD3ca.js} +1 -1
  65. package/dist/cjs/{ScreenLayout-B_60rKhZ.js → ScreenLayout-Bolj7ZKh.js} +1 -1
  66. package/dist/cjs/{SetAutomaticRecoveryScreen-DQolobOz.js → SetAutomaticRecoveryScreen-DpsqqlQy.js} +1 -1
  67. package/dist/cjs/{SetWalletPasswordForm-8g-lawop.js → SetWalletPasswordForm-D4BBkjST.js} +2 -2
  68. package/dist/cjs/{SignRequestScreen-BAgmmVVW.js → SignRequestScreen-CnKp7Qy1.js} +1 -1
  69. package/dist/cjs/StandardSignAndSendTransactionScreen-DqmwzL-5.js +1 -0
  70. package/dist/cjs/TelegramAuthScreen-BkWQJqdn.js +1 -0
  71. package/dist/cjs/{TransactionDetails-BefABtVQ.js → TransactionDetails-Da0Tpo_k.js} +1 -1
  72. package/dist/cjs/{TransactionErrorView-QKWh4urc.js → TransactionErrorView-DAmbVGy2.js} +2 -2
  73. package/dist/cjs/TransferFromWalletScreen-CFe0X_NF.js +1 -0
  74. package/dist/cjs/{TransferOrBridgeLoadingScreen-C6t1_cTP.js → TransferOrBridgeLoadingScreen-DF7kw9zr.js} +1 -1
  75. package/dist/cjs/TurnstileWrapper-qLN0G5m7.js +1 -0
  76. package/dist/cjs/UpdateEmailScreen-Kwl7tG4l.js +1 -0
  77. package/dist/cjs/{UpdatePhoneScreen-DefnuTEZ.js → UpdatePhoneScreen-44FR5anq.js} +1 -1
  78. package/dist/cjs/{UserLimitReachedScreen-B76r_-LC.js → UserLimitReachedScreen-ojZueqmT.js} +1 -1
  79. package/dist/cjs/WalletButtonList-DLB8T0RX.js +1 -0
  80. package/dist/cjs/{WalletInfoCard-CscdnrUV.js → WalletInfoCard-5UbicbMB.js} +1 -1
  81. package/dist/cjs/{WalletInterstitialScreen-CG1k3EvV.js → WalletInterstitialScreen-DAgZQaZB.js} +1 -1
  82. package/dist/cjs/{WalletLink-DF6dDjkz.js → WalletLink-B5xI6wVT.js} +1 -1
  83. package/dist/cjs/abstract-smart-wallets.js +1 -1
  84. package/dist/cjs/context-WcHVngsl.js +1 -0
  85. package/dist/cjs/{ethers-uj8IknV_.js → ethers-DbIujY7-.js} +1 -1
  86. package/dist/cjs/extended-chains.js +1 -1
  87. package/dist/cjs/farcaster.js +1 -1
  88. package/dist/cjs/{frame-bPqBJ8fS.js → frame-B14fp9oC.js} +1 -1
  89. package/dist/cjs/{get-is-unified-wallet-DmiciSes.js → get-is-unified-wallet-wZ72VTZL.js} +1 -1
  90. package/dist/cjs/{getErc20Balance-BZ5-OGfD.js → getErc20Balance-DknCauCO.js} +1 -1
  91. package/dist/cjs/{getErc20TokenInfo-HX7DgcWx.js → getErc20TokenInfo-CBduyYx4.js} +1 -1
  92. package/dist/cjs/{getPublicClient-EjAv8R2z.js → getPublicClient-CGlodIp_.js} +1 -1
  93. package/dist/cjs/index-DC9qNqKe.js +5 -0
  94. package/dist/cjs/index-DDm5kac-.js +1 -0
  95. package/dist/cjs/{index-Cuv6j_Y0.js → index-DZwAWF8d.js} +1 -1
  96. package/dist/cjs/index.js +1 -1
  97. package/dist/cjs/internal-context-NWsAL807.js +1 -0
  98. package/dist/cjs/internal.js +1 -1
  99. package/dist/cjs/prepareFundingModalData-CM8ukvbz.js +1 -0
  100. package/dist/cjs/{reservoir-3I-Vkf2B.js → reservoir-CQGyEBb7.js} +1 -1
  101. package/dist/cjs/{shared-CT5ocsPG.js → shared-CV6uFlbd.js} +1 -1
  102. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js → shouldProceedtoEmbeddedWalletCreationFlow-DemSlJUp.js} +1 -1
  103. package/dist/cjs/{smart-wallets-B7vHjGAW.js → smart-wallets-Lspn5i9s.js} +1 -1
  104. package/dist/cjs/smart-wallets.js +1 -1
  105. package/dist/cjs/solana.js +1 -1
  106. package/dist/cjs/{to-ui-error-a-xwbRKZ.js → to-ui-error-BJpQLLfd.js} +1 -1
  107. package/dist/cjs/ui.js +1 -1
  108. package/dist/cjs/{use-create-wallet-without-fallback-DSOJS4h0.js → use-create-wallet-without-fallback-CnS2odqx.js} +1 -1
  109. package/dist/cjs/{use-export-wallet-BRFTskbr.js → use-export-wallet-C5Fb5bFu.js} +1 -1
  110. package/dist/cjs/{use-sign-with-user-signer-On9f1Fag.js → use-sign-with-user-signer-BcAsQTGF.js} +1 -1
  111. package/dist/cjs/useActiveWallet-CXspRD1P.js +1 -0
  112. package/dist/cjs/{useGetSolPrice-eOpcFeNE.js → useGetSolPrice-C986iVoO.js} +1 -1
  113. package/dist/cjs/{useGetTokenPrice-EcT0H5rf.js → useGetTokenPrice-COGokVcE.js} +1 -1
  114. package/dist/cjs/{useI18n-hYSvbQCq.js → useI18n-Cs1I7xTm.js} +1 -1
  115. package/dist/cjs/usePrivy-DH2ITnCQ.js +1 -0
  116. package/dist/cjs/{useSolanaRpcClient-mfV88iJm.js → useSolanaRpcClient-CcJs2x9f.js} +1 -1
  117. package/dist/cjs/{useWalletBalance-CQAgfkRc.js → useWalletBalance-BVb8F3RO.js} +1 -1
  118. package/dist/cjs/{useWallets-TxPVNWGS.js → useWallets-BFvRErfm.js} +1 -1
  119. package/dist/cjs/{useWallets-h2xCj02C.js → useWallets-jLpT3nOf.js} +1 -1
  120. package/dist/dts/{events-context-CkFXl3uc.d.mts → events-context-D8iPaW-H.d.mts} +1 -1
  121. package/dist/dts/{events-context-CkFXl3uc.d.ts → events-context-D8iPaW-H.d.ts} +1 -1
  122. package/dist/dts/extended-chains.d.mts +1 -1
  123. package/dist/dts/extended-chains.d.ts +1 -1
  124. package/dist/dts/farcaster.d.mts +1 -1
  125. package/dist/dts/farcaster.d.ts +1 -1
  126. package/dist/dts/index.d.mts +17 -10
  127. package/dist/dts/index.d.ts +17 -10
  128. package/dist/dts/internal.d.mts +1 -1
  129. package/dist/dts/internal.d.ts +1 -1
  130. package/dist/dts/smart-wallets.d.mts +1 -1
  131. package/dist/dts/smart-wallets.d.ts +1 -1
  132. package/dist/dts/solana.d.mts +3 -3
  133. package/dist/dts/solana.d.ts +3 -3
  134. package/dist/dts/{types-BkkvIRg5.d.mts → types-diVZpIb-.d.mts} +60 -8
  135. package/dist/dts/{types-BkkvIRg5.d.ts → types-diVZpIb-.d.ts} +60 -8
  136. package/dist/dts/ui.d.mts +1 -1
  137. package/dist/dts/ui.d.ts +1 -1
  138. package/dist/esm/AccountNotFoundScreen-BzlsVk3E.mjs +1 -0
  139. package/dist/esm/{Address-DtXA0OPS.mjs → Address-yr-IopMB.mjs} +1 -1
  140. package/dist/esm/AffirmativeConsentScreen-DkgWeZ_J.mjs +1 -0
  141. package/dist/esm/{AllowlistRejectionScreen-BuH5iBJ3.mjs → AllowlistRejectionScreen-rYOJHwfe.mjs} +1 -1
  142. package/dist/esm/{AuthenticateWithWalletScreen-CKJqrLEm.mjs → AuthenticateWithWalletScreen-CkxHgH4i.mjs} +1 -1
  143. package/dist/esm/AwaitingEvmToSolBridgingScreen-BWZ-wh0M.mjs +2 -0
  144. package/dist/esm/AwaitingExternalEthereumTransferScreen-DbIN3EKS.mjs +2 -0
  145. package/dist/esm/AwaitingPasswordlessCodeScreen-C5zFT5_8.mjs +1 -0
  146. package/dist/esm/{AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs → AwaitingSolToEvmBridgingScreen-Cr4qsHWY.mjs} +1 -1
  147. package/dist/esm/{BridgeNetworkSelectionView-Bu0vi9_a.mjs → BridgeNetworkSelectionView-DvYzBNcx.mjs} +1 -1
  148. package/dist/esm/{Button-DJ-mtuuD.mjs → Button-BGdXsfbI.mjs} +1 -1
  149. package/dist/esm/CaptchaScreen-Cm9qqF-6.mjs +1 -0
  150. package/dist/esm/CoinbaseOnrampStatusScreen-CmX3D7il.mjs +1 -0
  151. package/dist/esm/{ConnectEmailForm-DUgOCS2V.mjs → ConnectEmailForm-Bth5xsJK.mjs} +1 -1
  152. package/dist/esm/ConnectLedgerScreen-ISKD8Msf.mjs +1 -0
  153. package/dist/esm/{ConnectOnlyLandingScreen-BVkcUaO6.mjs → ConnectOnlyLandingScreen-Bm8VrsST.mjs} +1 -1
  154. package/dist/esm/ConnectOnlyStatusScreen-2kQJ9RM2.mjs +1 -0
  155. package/dist/esm/ConnectOrCreateScreen-BCwMWyuI.mjs +1 -0
  156. package/dist/esm/{ConnectPhoneForm-CbuSfwAI.mjs → ConnectPhoneForm-DBvRusd4.mjs} +1 -1
  157. package/dist/esm/ConnectWalletView-6VokbyOr.mjs +1 -0
  158. package/dist/esm/ConnectionStatusScreen-CdTfe93C.mjs +1 -0
  159. package/dist/esm/CrossAppAuthScreen-BTo6-pn-.mjs +1 -0
  160. package/dist/esm/CustomLandingScreenView-BNZtDY8q.mjs +2 -0
  161. package/dist/esm/DelegatedActionsConsentScreen-DKTTJRC4.mjs +1 -0
  162. package/dist/esm/{DelegatedActionsRevokeScreen-B-xLCB1j.mjs → DelegatedActionsRevokeScreen-Bc0pjFZb.mjs} +1 -1
  163. package/dist/esm/EmbeddedWalletConnectingScreen-BRHQSNLs.mjs +1 -0
  164. package/dist/esm/EmbeddedWalletCreatedScreen-CVkkyV1q.mjs +1 -0
  165. package/dist/esm/{EmbeddedWalletKeyExportScreen-DX22sVNh.mjs → EmbeddedWalletKeyExportScreen-souOGCpG.mjs} +2 -2
  166. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-pATMOIdC.mjs +1 -0
  167. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs → EmbeddedWalletPasswordUpdateScreen-B_2nRtJK.mjs} +1 -1
  168. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs → EmbeddedWalletPasswordUpdateSplashScreen-DC0m1YqY.mjs} +1 -1
  169. package/dist/esm/{EnrollTotp-BzAm1Ya4.mjs → EnrollTotp-DBtXbrmN.mjs} +1 -1
  170. package/dist/esm/ErrorScreen-BT6kRegh.mjs +1 -0
  171. package/dist/esm/FarcasterConnectStatusScreen-DeX21V2U.mjs +1 -0
  172. package/dist/esm/{FarcasterSignerStatusScreen-DIfmv7Ft.mjs → FarcasterSignerStatusScreen-DjDF7M3x.mjs} +1 -1
  173. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs → FundSolWalletWithExternalSolanaWallet-CQCuKKUv.mjs} +1 -1
  174. package/dist/esm/{FundWalletMethodHeader-CbTaIDLQ.mjs → FundWalletMethodHeader-CuTZ50v9.mjs} +1 -1
  175. package/dist/esm/FundingEditAmountScreen-DA3nETVC.mjs +1 -0
  176. package/dist/esm/{FundingMethodSelectionScreen-fBauGI0K.mjs → FundingMethodSelectionScreen-Cl2Q20C1.mjs} +1 -1
  177. package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +1 -0
  178. package/dist/esm/{InAppBrowserLoginNotPossible-DBhsoAkw.mjs → InAppBrowserLoginNotPossible-DNAwsnTl.mjs} +1 -1
  179. package/dist/esm/{InstallWalletScreen-CEcl2LHj.mjs → InstallWalletScreen-CWnE7vnq.mjs} +1 -1
  180. package/dist/esm/LandingScreen-DxyFLgbb.mjs +1 -0
  181. package/dist/esm/{LinkConflictScreen-Bg9QTrJX.mjs → LinkConflictScreen-mdWjrw4c.mjs} +1 -1
  182. package/dist/esm/LinkEmailScreen-DIPP5Qni.mjs +1 -0
  183. package/dist/esm/{LinkPasskeyScreen-CNFL2N09.mjs → LinkPasskeyScreen-ThpOshKf.mjs} +1 -1
  184. package/dist/esm/{LinkPhoneScreen-DnPAvact.mjs → LinkPhoneScreen-rAq6W4BG.mjs} +1 -1
  185. package/dist/esm/{LoginFailedScreen-CkxfR75o.mjs → LoginFailedScreen-BXxeN2zX.mjs} +1 -1
  186. package/dist/esm/ManualTransferScreen-Lvm8KD2W.mjs +1 -0
  187. package/dist/esm/MfaAuthEnrollmentFlowScreen-CO2wD8m4.mjs +1 -0
  188. package/dist/esm/MfaAuthVerifyFlowScreen-BJ6-SZiF.mjs +1 -0
  189. package/dist/esm/MfaEnrollmentFlowScreen-B3urEFgN.mjs +1 -0
  190. package/dist/esm/MfaVerifyFlowScreen-Ds1oHXcL.mjs +1 -0
  191. package/dist/esm/{ModalHeader-D7WajfD8.mjs → ModalHeader-QHPmjFNo.mjs} +1 -1
  192. package/dist/esm/{MoonpayStatusScreen-CBc4DLDR.mjs → MoonpayStatusScreen-CZG4vGlx.mjs} +1 -1
  193. package/dist/esm/OAuthStatusScreen-Ds4YHlqV.mjs +1 -0
  194. package/dist/esm/PasskeySelectSignupOrLogin-BjefL5Sg.mjs +1 -0
  195. package/dist/esm/PasskeyStatusScreen-DsgPquPG.mjs +1 -0
  196. package/dist/esm/PasswordRecoveryScreen-CEytJb4j.mjs +1 -0
  197. package/dist/esm/{QrCode-zzqjquVm.mjs → QrCode-DYm8DzfO.mjs} +1 -1
  198. package/dist/esm/RecoveryOAuthStatusScreen-DRKjGnJC.mjs +1 -0
  199. package/dist/esm/RecoveryPasswordCreateScreen-DSvqTOh4.mjs +1 -0
  200. package/dist/esm/RecoverySelectionScreen-hH9LThp9.mjs +1 -0
  201. package/dist/esm/{Screen-dwi2CitY.mjs → Screen-CWSnJQQ_.mjs} +1 -1
  202. package/dist/esm/{ScreenLayout-Dmrhdwtt.mjs → ScreenLayout-CUnsRpZP.mjs} +1 -1
  203. package/dist/esm/{SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs → SetAutomaticRecoveryScreen-Df5GT1nk.mjs} +1 -1
  204. package/dist/esm/{SetWalletPasswordForm-ZtRqoZYj.mjs → SetWalletPasswordForm-DVIMtdiG.mjs} +2 -2
  205. package/dist/esm/{SignRequestScreen-DdAK4SlJ.mjs → SignRequestScreen-CxefKveW.mjs} +1 -1
  206. package/dist/esm/StandardSignAndSendTransactionScreen-jFi5e18-.mjs +1 -0
  207. package/dist/esm/TelegramAuthScreen-BVJcbU6W.mjs +1 -0
  208. package/dist/esm/{TransactionDetails-fgHkAnf9.mjs → TransactionDetails-Bc22QvDx.mjs} +3 -3
  209. package/dist/esm/{TransactionErrorView-Dgp1KSy5.mjs → TransactionErrorView-C1vRGAqn.mjs} +2 -2
  210. package/dist/esm/TransferFromWalletScreen-Be38QQ4h.mjs +1 -0
  211. package/dist/esm/{TransferOrBridgeLoadingScreen-D3vBwM_o.mjs → TransferOrBridgeLoadingScreen-CwlvhVb6.mjs} +1 -1
  212. package/dist/esm/TurnstileWrapper-Co-t5mTh.mjs +1 -0
  213. package/dist/esm/UpdateEmailScreen-B5J0E6kb.mjs +1 -0
  214. package/dist/esm/{UpdatePhoneScreen-Byn7UW7u.mjs → UpdatePhoneScreen-C1HOHXOX.mjs} +1 -1
  215. package/dist/esm/{UserLimitReachedScreen-DXDqdBpt.mjs → UserLimitReachedScreen-D-zVOlb8.mjs} +1 -1
  216. package/dist/esm/WalletButtonList-8WEh4_jp.mjs +1 -0
  217. package/dist/esm/{WalletInfoCard-DAv0WFcc.mjs → WalletInfoCard-MF3MtEmQ.mjs} +1 -1
  218. package/dist/esm/{WalletInterstitialScreen-CKiSWjpa.mjs → WalletInterstitialScreen-1gCTcafs.mjs} +1 -1
  219. package/dist/esm/{WalletLink-CjuEskpb.mjs → WalletLink-YnR_-97O.mjs} +2 -2
  220. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  221. package/dist/esm/context-DiNfuFGT.mjs +1 -0
  222. package/dist/esm/{ethers-CpMSCMOg.mjs → ethers-DIoYcpjG.mjs} +1 -1
  223. package/dist/esm/extended-chains.mjs +1 -1
  224. package/dist/esm/farcaster.mjs +1 -1
  225. package/dist/esm/{frame-BMa3kyjk.mjs → frame-CwE9r3cT.mjs} +1 -1
  226. package/dist/esm/{get-is-unified-wallet-DymQMSJy.mjs → get-is-unified-wallet-K0mTk9yp.mjs} +1 -1
  227. package/dist/esm/{getErc20Balance-Dtau1386.mjs → getErc20Balance-CaKjNAs9.mjs} +1 -1
  228. package/dist/esm/getErc20TokenInfo-BFoeg5F6.mjs +1 -0
  229. package/dist/esm/{getPublicClient-IxRndou_.mjs → getPublicClient-A9RSftUZ.mjs} +1 -1
  230. package/dist/esm/index-BWOKHYTy.mjs +1 -0
  231. package/dist/esm/{index-DdlRJsoj.mjs → index-CFRKlMDE.mjs} +1 -1
  232. package/dist/esm/index-lYmwKGIx.mjs +5 -0
  233. package/dist/esm/index.mjs +1 -1
  234. package/dist/esm/{internal-context-Cvo1WmWN.mjs → internal-context-e-Eni5bG.mjs} +1 -1
  235. package/dist/esm/internal.mjs +1 -1
  236. package/dist/esm/prepareFundingModalData-WE6JA8F4.mjs +1 -0
  237. package/dist/esm/{reservoir-B0V48m2I.mjs → reservoir-kvLjIrEo.mjs} +1 -1
  238. package/dist/esm/{shared-DsP7M4P5.mjs → shared-MHIQ423d.mjs} +1 -1
  239. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CqO4vU4u.mjs +1 -0
  240. package/dist/esm/{smart-wallets-Cbhn7qlU.mjs → smart-wallets-D5JfcVKT.mjs} +1 -1
  241. package/dist/esm/smart-wallets.mjs +1 -1
  242. package/dist/esm/solana.mjs +1 -1
  243. package/dist/esm/{to-ui-error-B3m2hl6e.mjs → to-ui-error-BRKruPsR.mjs} +1 -1
  244. package/dist/esm/ui.mjs +2 -2
  245. package/dist/esm/{use-create-wallet-without-fallback-DodUf3VP.mjs → use-create-wallet-without-fallback-CHBqJaDR.mjs} +1 -1
  246. package/dist/esm/{use-export-wallet-CWslDKqf.mjs → use-export-wallet-BrdknVyy.mjs} +1 -1
  247. package/dist/esm/{use-sign-with-user-signer-LJ6ROduD.mjs → use-sign-with-user-signer-eEm9Olt_.mjs} +1 -1
  248. package/dist/esm/useActiveWallet-CP0uCd2v.mjs +1 -0
  249. package/dist/esm/{useGetSolPrice-Bi0pPiUW.mjs → useGetSolPrice-Cfm8o9C5.mjs} +1 -1
  250. package/dist/esm/{useGetTokenPrice-B4XVfxeD.mjs → useGetTokenPrice-CSolUboj.mjs} +1 -1
  251. package/dist/esm/{useI18n-ByKvnaXP.mjs → useI18n-CWj3uwjJ.mjs} +1 -1
  252. package/dist/esm/usePrivy-B07VkOGc.mjs +1 -0
  253. package/dist/esm/{useSolanaRpcClient-DjD2ma5c.mjs → useSolanaRpcClient-Cj4b2UVF.mjs} +1 -1
  254. package/dist/esm/{useWalletBalance-Xca4-c_r.mjs → useWalletBalance-CkNw6kj0.mjs} +1 -1
  255. package/dist/esm/{useWallets-CQMJYOF9.mjs → useWallets-D4Q4lJPh.mjs} +1 -1
  256. package/dist/esm/{useWallets-BplPx0Pz.mjs → useWallets-DltUT6WJ.mjs} +1 -1
  257. package/package.json +10 -9
  258. package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +0 -1
  259. package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +0 -2
  260. package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +0 -2
  261. package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +0 -1
  262. package/dist/cjs/CaptchaScreen-025syTLo.js +0 -1
  263. package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +0 -1
  264. package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +0 -1
  265. package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +0 -1
  266. package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +0 -1
  267. package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +0 -1
  268. package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +0 -1
  269. package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +0 -1
  270. package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +0 -1
  271. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +0 -1
  272. package/dist/cjs/ErrorScreen-Cob9AO30.js +0 -1
  273. package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +0 -2
  274. package/dist/cjs/LandingScreen-B9jb8n_d.js +0 -1
  275. package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +0 -1
  276. package/dist/cjs/ManualTransferScreen-DPz98CSt.js +0 -1
  277. package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +0 -1
  278. package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +0 -1
  279. package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +0 -1
  280. package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +0 -1
  281. package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +0 -1
  282. package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +0 -1
  283. package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +0 -1
  284. package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +0 -1
  285. package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +0 -1
  286. package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +0 -1
  287. package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +0 -1
  288. package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +0 -1
  289. package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +0 -1
  290. package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +0 -1
  291. package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +0 -1
  292. package/dist/cjs/WalletButtonList-bICzXZXM.js +0 -1
  293. package/dist/cjs/context-JUEgi5-6.js +0 -1
  294. package/dist/cjs/index-BNNk54gK.js +0 -1
  295. package/dist/cjs/index-DvDeCr_m.js +0 -5
  296. package/dist/cjs/internal-context-VDPFkIXN.js +0 -1
  297. package/dist/cjs/prepareFundingModalData-BVlyr8l5.js +0 -1
  298. package/dist/cjs/useActiveWallet-DcxqWAsq.js +0 -1
  299. package/dist/cjs/usePrivy-CXPeoT5g.js +0 -1
  300. package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +0 -1
  301. package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +0 -1
  302. package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +0 -2
  303. package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +0 -2
  304. package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +0 -1
  305. package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +0 -1
  306. package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +0 -1
  307. package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +0 -1
  308. package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +0 -1
  309. package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +0 -1
  310. package/dist/esm/ConnectWalletView-DVDOSzi0.mjs +0 -1
  311. package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +0 -1
  312. package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +0 -1
  313. package/dist/esm/CustomLandingScreenView-DWt9lv8W.mjs +0 -2
  314. package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +0 -1
  315. package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +0 -1
  316. package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +0 -1
  317. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +0 -1
  318. package/dist/esm/ErrorScreen-DFAo4S7A.mjs +0 -1
  319. package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +0 -1
  320. package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +0 -1
  321. package/dist/esm/LandingScreen-BvRIrtFN.mjs +0 -1
  322. package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +0 -1
  323. package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +0 -1
  324. package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +0 -1
  325. package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +0 -1
  326. package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +0 -1
  327. package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +0 -1
  328. package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +0 -1
  329. package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +0 -1
  330. package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +0 -1
  331. package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +0 -1
  332. package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +0 -1
  333. package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +0 -1
  334. package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +0 -1
  335. package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +0 -1
  336. package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +0 -1
  337. package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +0 -1
  338. package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +0 -1
  339. package/dist/esm/WalletButtonList-CGloXTN0.mjs +0 -1
  340. package/dist/esm/context-Cb5MFcME.mjs +0 -1
  341. package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +0 -1
  342. package/dist/esm/index-B_e8abKi.mjs +0 -1
  343. package/dist/esm/index-CI666IP9.mjs +0 -5
  344. package/dist/esm/prepareFundingModalData-BUyu5Vhr.mjs +0 -1
  345. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +0 -1
  346. package/dist/esm/useActiveWallet-hrZcON-K.mjs +0 -1
  347. package/dist/esm/usePrivy-D3OPY7tm.mjs +0 -1
@@ -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{u as a}from"./context-Cb5MFcME.mjs";import{k as i,l as s,D as l,R as n}from"./index-CI666IP9.mjs";import{u as m,k as c}from"./internal-context-Cvo1WmWN.mjs";import{u as d}from"./use-create-wallet-without-fallback-DodUf3VP.mjs";import{a as u,u as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as h}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(h,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}),y={component:()=>{let{setModalData:t,navigate:h,data:y,onUserCloseViaDialogOrKeybindRef:v}=u(),g=a(),[j,f]=r(""),{embeddedWallets:C}=a(),{authenticated:b,user:S}=p(),{closePrivyModal:x,walletProxy:W,client:k}=m(),{onSuccess:A,onFailure:O,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:P}=y.createWallet,R="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[U,E]=r(null),{create:L}=d(),T=M??(!!S&&i(S,g.embeddedWallets.ethereum.createOnLogin)),D=P??(!!S&&s(S,g.embeddedWallets.solana.createOnLogin)),F=new n((async()=>{let e=await k.getAccessToken();if(S&&e&&W)try{let e;if(T&&D)e=await L({chainType:"ethereum",walletIndex:0,latestUser:S}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(D)e=await L({chainType:"solana",walletIndex:0,latestUser:S});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:S})}E(e),h("EmbeddedWalletCreatedScreen")}catch(e){f(e.message)}}));return o((()=>b&&S?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:D},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:D}}),h(l({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:C.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void F.execute():(h("LandingScreen"),void O(Error("User must be authenticated before creating a Privy wallet")))),[R,b]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{U?(A(U),x({shouldCallAuthOnSuccess:I})):(O(new c("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
@@ -1 +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-Cb5MFcME.mjs";import{a as c,P as l}from"./index-CI666IP9.mjs";import{c as m,b as p,a as d,d as u}from"./internal-context-Cvo1WmWN.mjs";import{a as T}from"./get-is-unified-wallet-DymQMSJy.mjs";import{R as g}from"./reservoir-B0V48m2I.mjs";import{S as h}from"./ScreenLayout-Dmrhdwtt.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const 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=/*#__PURE__*/n.a.withConfig({displayName:"Link",componentId:"sc-506514cb-0"})(["color:var(--privy-color-accent) !important;font-weight:600;"]);export{f as ErrorScreen,y as ErrorScreenView,f as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as a}from"react";import{isMobile as n,isIOS as s}from"react-device-detect";import{styled as l}from"styled-components";import{L as c}from"./useActiveWallet-hrZcON-K.mjs";import{O as d}from"./OpenLink-BpeNYBKs.mjs";import{Q as m}from"./QrCode-zzqjquVm.mjs";import{Check as p,Copy as u}from"lucide-react";import{S as h}from"./Button-DJ-mtuuD.mjs";import{L as f}from"./LabelXs-BOisBtqT.mjs";import{u as g,q as v}from"./context-Cb5MFcME.mjs";import{u as y,b as C,i as w}from"./internal-context-Cvo1WmWN.mjs";import{u as b,a as x}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as S}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as T}from"./ScreenLayout-Dmrhdwtt.mjs";import{F as k}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";let E=/*#__PURE__*/l.div.withConfig({displayName:"Container",componentId:"sc-913deead-0"})(["width:100%;"]),I=/*#__PURE__*/l.div.withConfig({displayName:"InputContainer",componentId:"sc-913deead-1"})(["display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.75rem;height:56px;background:",";border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);&:hover{border-color:",";}"],(e=>e.$disabled?"var(--privy-color-background-2)":"var(--privy-color-background)"),(e=>e.$disabled?"var(--privy-color-foreground-4)":"var(--privy-color-foreground-3)")),j=/*#__PURE__*/l.div.withConfig({displayName:"TextContainer",componentId:"sc-913deead-2"})(["flex:1;min-width:0;display:flex;align-items:center;"]),A=/*#__PURE__*/l.span.withConfig({displayName:"Text",componentId:"sc-913deead-3"})(["display:block;font-size:16px;line-height:24px;color:",";overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;word-break:break-all;@media (min-width:441px){font-size:14px;line-height:20px;}"],(e=>e.$disabled?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)")),N=/*#__PURE__*/l(A).withConfig({displayName:"PlaceholderText",componentId:"sc-913deead-4"})(["color:var(--privy-color-foreground-3);font-style:italic;"]),L=/*#__PURE__*/l(f).withConfig({displayName:"TitleLabel",componentId:"sc-913deead-5"})(["margin-bottom:0.5rem;"]),F=/*#__PURE__*/l(h).withConfig({displayName:"CopyButton",componentId:"sc-913deead-6"})(["&&{gap:0.375rem;font-size:14px;flex-shrink:0;}"]);const O=({value:a,title:n,placeholder:s,className:l,showCopyButton:c=!0,truncate:d,maxLength:m=40,disabled:h=!1})=>{let[f,g]=o(!1),v=d&&a?((e,t,r)=>{if((e=e.startsWith("https://")?e.slice(8):e).length<=r)return e;if("middle"===t){let t=Math.ceil(r/2)-2,o=Math.floor(r/2)-1;return`${e.slice(0,t)}...${e.slice(-o)}`}return`${e.slice(0,r-3)}...`})(a,d,m):a;return i((()=>{if(f){let e=setTimeout((()=>g(!1)),3e3);return()=>clearTimeout(e)}}),[f]),/*#__PURE__*/e(E,{className:l,children:[n&&/*#__PURE__*/t(L,{children:n}),/*#__PURE__*/e(I,{$disabled:h,children:[/*#__PURE__*/t(j,{children:a?/*#__PURE__*/t(A,{$disabled:h,title:a,children:v}):/*#__PURE__*/t(N,{$disabled:h,children:s||"No value"})}),c&&a&&/*#__PURE__*/t(F,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(a).then((()=>g(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(r,f?{children:["Copied",/*#__PURE__*/t(p,{size:14})]}:{children:["Copy",/*#__PURE__*/t(u,{size:14})]})})]})]})},_=({connectUri:r,loading:o,success:i,errorMessage:a,onBack:l,onClose:p,onOpenFarcaster:u})=>/*#__PURE__*/t(T,n||o?s?{title:a?a.message:"Sign in with Farcaster",subtitle:a?a.detail:"To sign in with Farcaster, please open the Farcaster app.",icon:k,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},primaryCta:r&&u?{label:"Open Farcaster app",onClick:u}:void 0,onBack:l,onClose:p,watermark:!0}:{title:a?a.message:"Signing in with Farcaster",subtitle:a?a.detail:"This should only take a moment",icon:k,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!a},onBack:l,onClose:p,watermark:!0,children:r&&n&&/*#__PURE__*/t(M,{children:/*#__PURE__*/t(d,{text:"Take me to Farcaster",url:r,color:"#8a63d2"})})}:{title:"Sign in with Farcaster",subtitle:"Scan with your phone's camera to continue.",onBack:l,onClose:p,watermark:!0,children:/*#__PURE__*/e(U,{children:[/*#__PURE__*/t(W,{children:r?/*#__PURE__*/t(m,{url:r,size:275,squareLogoElement:k}):/*#__PURE__*/t(z,{children:/*#__PURE__*/t(c,{})})}),/*#__PURE__*/e(B,{children:[/*#__PURE__*/t(D,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),r&&/*#__PURE__*/t(O,{value:r,truncate:"end",maxLength:30,showCopyButton:!0,disabled:!0})]})]})}),R={component:()=>{let{authenticated:e,logout:r,ready:n,user:s}=b(),{lastScreen:l,navigate:c,navigateBack:d,setModalData:m}=x(),p=g(),{getAuthFlow:u,loginWithFarcaster:h,closePrivyModal:f,createAnalyticsEvent:T}=y(),[k,E]=o(void 0),[I,j]=o(!1),[A,N]=o(!1),L=a([]),F=u(),O=F?.meta.connectUri;return i((()=>{let e=Date.now(),t=setInterval((async()=>{let r=await F.pollForReady.execute(),o=Date.now()-e;if(r){clearInterval(t),j(!0);try{await h(),N(!0)}catch(e){let t={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===C.ALLOWLIST_REJECTED)return void c("AllowlistRejectionScreen");if(e?.privyErrorCode===C.USER_LIMIT_REACHED)return console.error(new w(e).toString()),void c("UserLimitReachedScreen");if(e?.privyErrorCode===C.USER_DOES_NOT_EXIST)return void c("AccountNotFoundScreen");if(e?.privyErrorCode===C.LINKED_TO_ANOTHER_USER)t.detail=e.message??"This account has already been linked to another user.";else{if(e?.privyErrorCode===C.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return m({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void c("LinkConflictScreen");e?.privyErrorCode===C.INVALID_CREDENTIALS?(t.retryable=!0,t.detail="Something went wrong. Try again."):e?.privyErrorCode===C.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again.")}E(t)}}else o>12e4&&(clearInterval(t),E({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(t),L.current.forEach((e=>clearTimeout(e)))}}),[]),i((()=>{if(n&&e&&A&&s){if(p?.legal.requireUsersAcceptTerms&&!s.hasAcceptedTerms){let e=setTimeout((()=>{c("AffirmativeConsentScreen")}),v);return()=>clearTimeout(e)}A&&(S(s,p.embeddedWallets)?L.current.push(setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),T({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),v)):L.current.push(setTimeout((()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0})),v)))}}),[A,n,e,s]),/*#__PURE__*/t(_,{connectUri:O,loading:I,success:A,errorMessage:k,onBack:l?d:void 0,onClose:f,onOpenFarcaster:()=>{O&&(window.location.href=O)}})}};let M=/*#__PURE__*/l.div.withConfig({displayName:"MobileLinkContainer",componentId:"sc-914339e1-0"})(["margin-top:24px;"]),U=/*#__PURE__*/l.div.withConfig({displayName:"ContentContainer",componentId:"sc-914339e1-1"})(["display:flex;flex-direction:column;align-items:center;gap:24px;"]),W=/*#__PURE__*/l.div.withConfig({displayName:"QrContainer",componentId:"sc-914339e1-2"})(["display:flex;align-items:center;justify-content:center;min-height:275px;"]),B=/*#__PURE__*/l.div.withConfig({displayName:"InstructionsContainer",componentId:"sc-914339e1-3"})(["display:flex;flex-direction:column;align-items:center;gap:16px;"]),D=/*#__PURE__*/l.div.withConfig({displayName:"InstructionText",componentId:"sc-914339e1-4"})(["font-size:0.875rem;text-align:center;color:var(--privy-color-foreground-2);"]),z=/*#__PURE__*/l.div.withConfig({displayName:"LoaderWrapper",componentId:"sc-914339e1-5"})(["position:relative;width:82px;height:82px;"]);export{R as FarcasterConnectStatusScreen,_ as FarcasterConnectStatusView,R as default};
@@ -1 +0,0 @@
1
- import{jsxs as t,Fragment as o,jsx as e}from"react/jsx-runtime";import{useRef as r}from"react";import{a as i}from"./Button-DJ-mtuuD.mjs";import{F as n}from"./Layouts-Bmf8DxNP.mjs";import{B as a}from"./ModalHeader-D7WajfD8.mjs";import{t as m}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{N as s}from"./index-CJMgUOnw.mjs";import{T as l}from"./Title-D0pfZff-.mjs";import{a as c}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as p}from"./useGetTokenPrice-B4XVfxeD.mjs";import{c as d}from"./ethers-CpMSCMOg.mjs";import{F as u,a as f,h,c as j,d as g}from"./styles-DY17fuAX.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.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-Bi0pPiUW.mjs";const v={component:()=>{let{data:v,setModalData:C}=c(),y=v?.funding,x="solana"===y.chainType,D=r(null),{tokenPrice:F}=p(x?"solana":y.chain.id),k=x?void 0:y,A=!(!k?.erc20Address||k?.erc20ContractInfo),T=x?y.isUSDC?"USDC":"SOL":y.erc20Address?y.erc20ContractInfo?.symbol:y.chain.nativeCurrency.symbol||"ETH",I=parseFloat(y.amount),M=!isNaN(I)&&I>0,S=F?d(y.amount,F):void 0;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(m,{}),/*#__PURE__*/e(l,{children:"Confirm or edit amount"}),/*#__PURE__*/t(n,{style:{marginTop:"32px"},children:[/*#__PURE__*/e(u,{children:A?/*#__PURE__*/e(s,{size:"50px"}):/*#__PURE__*/t(o,{children:[/*#__PURE__*/t(f,{onClick:()=>D.current?.focus(),children:[/*#__PURE__*/e(h,{ref:D,value:y.amount,onChange:t=>{let o=t.target.value;/^[0-9.]*$/.test(o)&&o.split(".").length-1<=1&&C({...v,funding:{...y,amount:o},solanaFundingData:v?.solanaFundingData?{...v.solanaFundingData,amount:o}:void 0})}}),/*#__PURE__*/e(j,{children:T})]}),!k?.erc20Address&&/*#__PURE__*/e(g,{children:S&&M?`${S} USD`:""})]})}),/*#__PURE__*/e(i,{style:{marginTop:"1rem"},disabled:!M,onClick:y.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/e(a,{})]})}};export{v as FundingAmountEditScreen,v as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-Cb5MFcME.mjs";import{C as r,L as i}from"./CustomLandingScreenView-DWt9lv8W.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-D7WajfD8.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"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./get-is-unified-wallet-DymQMSJy.mjs";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"lucide-react";import"./ConnectEmailForm-DUgOCS2V.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./farcaster-DPlSjvF5.mjs";import"./ConnectWalletView-DVDOSzi0.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./QrCode-zzqjquVm.mjs";import"qrcode";import"./useI18n-ByKvnaXP.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./Link-DwjLfHwW.mjs";import"./ConnectPhoneForm-CbuSfwAI.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletButtonList-CGloXTN0.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./ScreenLayout-Dmrhdwtt.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-DUgOCS2V.mjs";import{B as i}from"./Layouts-Bmf8DxNP.mjs";import{u as e}from"./context-Cb5MFcME.mjs";import{S as m}from"./ScreenLayout-Dmrhdwtt.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./index-CI666IP9.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-DymQMSJy.mjs";import"viem";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"tinycolor2";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const 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 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}from"./Button-DJ-mtuuD.mjs";import{F as d}from"./Layouts-Bmf8DxNP.mjs";import{B as l}from"./ModalHeader-D7WajfD8.mjs";import{Q as p}from"./QrCode-zzqjquVm.mjs";import{t as u}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{I as f}from"./InfoBanner-D6C6Bt8L.mjs";import{S as h}from"./Subtitle-DkvfP2Ev.mjs";import{T as g}from"./Title-D0pfZff-.mjs";import{W as v}from"./WalletInfoCard-DAv0WFcc.mjs";import{u as j}from"./context-Cb5MFcME.mjs";import{v as y,D as C}from"./useActiveWallet-hrZcON-K.mjs";import{u as S}from"./internal-context-Cvo1WmWN.mjs";import{a as I}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as b}from"./useWalletBalance-Xca4-c_r.mjs";import{u as T}from"./useWallets-BplPx0Pz.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{z as A,A as k}from"./index-CI666IP9.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 B}from"./getErc20Balance-Dtau1386.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-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-DtXA0OPS.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const U={component:()=>{let{wallets:k}=T(),{connectors:U}=S(),x=U.filter(y).flatMap((e=>e.wallets)),{data:E,setModalData:L,navigate:W,lastScreen:O}=I(),{rpcConfig:P,appId:Q,createAnalyticsEvent:z,closePrivyModal:H}=S(),N=j(),[R,q]=o(void 0),[X,Y]=o(!1),G=E?.funding,{reloadBalance:J}=b({rpcConfig:P,appId:Q,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?x.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:E?.funding,solanaFundingData:E?.solanaFundingData,sendTransaction:E?.sendTransaction}),W("ErrorScreen"),/*#__PURE__*/e(r,{});i((()=>{let e=K?async function(){if("solana"!==G.chainType)return;let e=N.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);R&&r>R&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?s(r-R,6):s(r-R,9),token:G.isUSDC?"USDC":"SOL"}})),q(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await B({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:P,appId:Q});return e}})().then((e=>{R&&e>R&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:s(e-R,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),q(e)})).catch((()=>q(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[R]);let _=a((()=>null==R?"":G.isUSDC?n({amount:R,decimals:6}):K?M(R,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:R,decimals:G.erc20ContractInfo.decimals}):m({wei:R})),[R,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(d,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:$}),/*#__PURE__*/t(f,{theme:N.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:()=>H({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(l,{})]})}};let $=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{U as ManualTransferScreen,U 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{P as a}from"./Button-DJ-mtuuD.mjs";import{L as s}from"./useActiveWallet-hrZcON-K.mjs";import{M as m,a as l}from"./ModalHeader-D7WajfD8.mjs";import{u as c}from"./context-Cb5MFcME.mjs";import{u as p,a as u}from"./get-is-unified-wallet-DymQMSJy.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-BzAm1Ya4.mjs";import{A as v,C as j,I as k,T as g,S as C,B as M}from"./PinInput-C3_MNxMt.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";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-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-DFAo4S7A.mjs";import"lucide-react";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-B0V48m2I.mjs";import"./ScreenLayout-Dmrhdwtt.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./LinkPasskeyScreen-CNFL2N09.mjs";import"./TodoList-Dn0Qu-vv.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-zzqjquVm.mjs";import"qrcode";const w={component:()=>{let{user:w,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:A}=u(),S=c(),[R,E]=n(null),[P,F]=n(null),[T,L]=n(null),[x,B]=n(!1),[W,U]=n(!1),[D,H]=n(),O=async()=>{D?Q(D):w?await $({user:w}):Q(Error("Must be logged in to manage MFA")),setTimeout((()=>{E(null),F(null)}),500)};if(A.current=O,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:Q,onSuccess:$,onBack:z,mfaMethods:X,verify:q,generateTotpSecret:K,enrollTotp:N,unenrollTotp:V,enrollPasskey:Z}=I.mfaEnroll,_=w?.mfaMethods.includes("sms"),G=w?.mfaMethods.includes("totp"),J=w?.mfaMethods.includes("passkey"),Y=!!w?.phone,ee=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){E(null),F(null),H(void 0)}async function te(e=ee){try{H(void 0),U(!0);let o=await Z(e);return await $({user:o})}catch(e){H(e)}finally{U(!1),B(!1)}}if(!b||!w||!S)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{onClose:O,backFn:z},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(s,{})}),/*#__PURE__*/t(l,{})]});if("sms"===R)return null;if("totp"===R)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:O},"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 ",S?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(a,{$warn:!0,onClick:async function(){try{H(void 0),U(!0);let e=await V();return await $({user:e})}catch(e){H(e)}finally{U(!1),E(null)}},loading:W,children:"Remove"})}),/*#__PURE__*/t(l,{})]});if("passkey"===R){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(m,{backFn:oe,onClose:O},"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(a,{$warn:!0,onClick:async function(){try{H(void 0),U(!0);let e=await Z([]);return await $({user:e})}catch(e){H(e)}finally{U(!1),E(null)}},loading:W,children:"Remove"})}),/*#__PURE__*/t(l,{})]})}return 0!==X.length||_||G||J?"sms"===P?null:"totp"===P&&T?/*#__PURE__*/t(h,{onClose:O,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{H(void 0),U(!0);let o=await N(e);return await $({user:o})}catch(e){H(e)}finally{U(!1),E(null)}}(e.mfaCode),error:D,totpInfo:{...T,appName:S?.name||"Privy"}}):"passkey"===P?/*#__PURE__*/t(y,{onReset:oe,onClose:O,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:w.mfaMethods,appMfaMethods:S.mfa.methods,userHasAuthSms:Y,backFn:z,handleSelectMethod:async function(e){H(void 0);try{await q()}catch(e){return void H(e)}return"totp"===e?(F(e),L(null),void K().then((({totpSecret:e,totpAuthUrl:o})=>{L({authUrl:o,secret:e})})).catch((()=>{L(null),oe()}))):"passkey"===e&&1===ee.length?await te():void F(e)},isTotpLoading:"totp"===P&&!T,isPasskeyLoading:x,error:D,onClose:O,setRemovingMfaMethod:async function(e){H(void 0);try{await q()}catch(e){return void H(e)}E(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(m,{onClose:O,backFn:z},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[S?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(M,{children:/*#__PURE__*/t(a,{onClick:O,children:"Close"})}),/*#__PURE__*/t(l,{})]})}};export{w as MfaAuthEnrollmentFlowScreen,w 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,a as s}from"./get-is-unified-wallet-DymQMSJy.mjs";import{V as m,a as n,b as a,t as c}from"./to-ui-error-B3m2hl6e.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.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-D7WajfD8.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"./ScreenLayout-Dmrhdwtt.mjs";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-B4XVfxeD.mjs";import"./useGetSolPrice-Bi0pPiUW.mjs";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./TransactionDetails-fgHkAnf9.mjs";import"./WalletLink-CjuEskpb.mjs";import"./ethers-CpMSCMOg.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p={component:()=>{let{user:p}=i(),{data:l}=s(),[u,d]=t(p?.mfaMethods[0]),[h,f]=t(!1),[j,v]=t(),[y,k]=t();if(e((()=>{d(p?.mfaMethods[0])}),[p?.mfaMethods]),!l?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:g,onSuccess:w,generateOptions:M,verifyTotpCode:C,verifyPasskey:I,verifySmsCode:S,sendSmsCode:b}=l.mfaVerify,P=async o=>{if("passkey"!==o)try{d(o),"sms"===o&&(d(o),await b()),"totp"===o&&d(o)}catch(o){console.error(o)}else try{d(o);let t=await M();if(!t)throw Error("something went wrong");v(t),await I(t),f(!0),k(void 0),w()}catch(o){k(c(o))}},x=async o=>{k(void 0);try{if(!o||!u)return;if("passkey"===u){if(!j)throw Error("Missing passkey challenge");await I(j)}else"sms"===u?await S(o):"totp"===u&&await C(o);k(void 0),f(!0),w()}catch(o){throw c(o).error}},A=()=>{y||!h?g(y?.error??Error("Canceled MFA verification.")):w()},E=r(!1);return e((()=>{!E.current&&u&&(E.current=!0,P(u).finally((()=>{E.current=!1})))}),[open]),p?"passkey"===u?/*#__PURE__*/o(m,{account:p.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:h,hasBlockingError:y?.isBlocking??!1,error:y?.error,onClose:A,onBack:()=>{d(void 0),k(void 0)},handleSubmit:()=>x(j).catch(k)}):"sms"===u||"totp"===u?/*#__PURE__*/o(n,{selectedMethod:u,submitSuccess:h,hasBlockingError:y?.isBlocking??!1,handleSubmitCode:x,onClose:A,onBack:p.mfaMethods.length>1?()=>d(void 0):void 0}):/*#__PURE__*/o(a,{user:p,onSelect:P,handleClose:A}):null}};export{p as MfaAuthVerifyFlowScreen,p 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{P as c,S as m}from"./Button-DJ-mtuuD.mjs";import{L as d}from"./useActiveWallet-hrZcON-K.mjs";import{M as h,a as u}from"./ModalHeader-D7WajfD8.mjs";import{u as p}from"./context-Cb5MFcME.mjs";import{u as f}from"./internal-context-Cvo1WmWN.mjs";import{a as y,u as v}from"./get-is-unified-wallet-DymQMSJy.mjs";import{d as C,f as k,g as w,h as g,i as j,u as b}from"./index-CI666IP9.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-BzAm1Ya4.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-CbuSfwAI.mjs";import{I as W,T as B,S as T,C as A,a as L,B as N,N as U,A as O,L as $,b as D,c as H}from"./PinInput-C3_MNxMt.mjs";import{ErrorScreenView as Q}from"./ErrorScreen-DFAo4S7A.mjs";import"styled-components";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.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-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-CNFL2N09.mjs";import"lucide-react";import"./TodoList-Dn0Qu-vv.mjs";import"./ScreenLayout-Dmrhdwtt.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./CopyToClipboard-DatKc59_.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-Bmf8DxNP.mjs";import"./Column-DQ5Vw9t1.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./shared-CtYf3O54.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-zzqjquVm.mjs";import"qrcode";import"./reservoir-B0V48m2I.mjs";const Y=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,m]=a(""),[d,f]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=y(),$=p();function D(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(Q,{allowlistConfig:$.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(h,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(B,{children:"Set up SMS verification"}),/*#__PURE__*/o(T,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),m(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(L,{children:["By providing your mobile number, you agree to receive text messages from ",$?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(u,{})]}:d?{children:[/*#__PURE__*/e(h,{onClose:D},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(B,{children:"SMS verification added"}),/*#__PURE__*/o(T,{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(c,{onClick:D,children:"Done"})}),/*#__PURE__*/e(u,{})]}:{children:[/*#__PURE__*/e(h,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(B,{children:"Enter enrollment code"}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),f(!0)}catch(e){if(k(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(w(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(T,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(u,{})]})},q={component:()=>{let{user:k,enrollInMfa:w,ready:g}=v(),[j,F]=a(null),{unenrollWithSms:P,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:L,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:Q,initEnrollmentWithTotp:q}=C(),{data:z,onUserCloseViaDialogOrKeybindRef:V}=y(),X=p(),{closePrivyModal:K}=f(),{promptMfa:Z}=b(),[_,G]=a(!1),[J,ee]=a(null),[oe,re]=a(null),te=()=>{K({shouldCallAuthOnSuccess:!0}),w(!1),setTimeout((()=>{F(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();V.current=te;let se=k?.mfaMethods.includes("sms"),ce=!!k?.phone,me=k?.mfaMethods.includes("totp"),de=k?.mfaMethods.includes("passkey"),he=se||me||de,ue=k?.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 Q({credentialIds:e},{removeForLogin:z?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),z?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&G(!0)}),[he]),!g||!k||!X/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(A,{children:/*#__PURE__*/e(d,{})}),/*#__PURE__*/e(u,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(B,{children:"Remove SMS verification?"}),/*#__PURE__*/o(T,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await P()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(B,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(T,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{$warn:!0,onClick:async function(){F(null);try{await R()}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]});if("passkey"===j){let n=z?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(B,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(T,{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(c,{$warn:!0,onClick:async function(){F(null);try{await x({removeForLogin:z?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){F(null)}},children:"Remove"})}),/*#__PURE__*/e(u,{})]})}if(0===z.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(B,{children:"Add more security"}),/*#__PURE__*/o(T,{children:[X?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(c,{onClick:te,children:"Close"})}),/*#__PURE__*/e(u,{})]});let ye=!he&&!_;return ye?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(h,{onClose:te},"header"),/*#__PURE__*/e(W,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(B,{children:"Transaction Protection"}),/*#__PURE__*/e(T,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o($,{children:[/*#__PURE__*/o(D,{children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",X?.name," wallet."]}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(c,{onClick:()=>G(!0),children:"Continue"}),/*#__PURE__*/e(m,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(u,{})]}):"sms"===J?/*#__PURE__*/e(Y,{appName:X?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===J&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await L({mfaCode:e}),z?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{F(null)}}(e),totpInfo:{...oe,appName:X?.name||"Privy"}}):"passkey"===J?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:fe}):/*#__PURE__*/e(I,{showIntro:ye,userMfaMethods:k.mfaMethods,appMfaMethods:X.mfa.methods,userHasAuthSms:ce,backFn:function(){G(!1)},handleSelectMethod:async function(e){try{await Z()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void q().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await fe():void ee(e)},isTotpLoading:"totp"===J&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await Z()}catch(e){return void ae(e)}F(e)}})}};export{q as MfaEnrollmentFlowScreen,q as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useState as o,useEffect as e,useRef as r}from"react";import{u as i}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as m}from"./index-CI666IP9.mjs";import{V as n,a as s,b as c,t as a}from"./to-ui-error-B3m2hl6e.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.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-D7WajfD8.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-Dmrhdwtt.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"./PinInput-C3_MNxMt.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-BrIQsdas.mjs";import"./useGetTokenPrice-B4XVfxeD.mjs";import"./useGetSolPrice-Bi0pPiUW.mjs";import"./TransactionDetails-fgHkAnf9.mjs";import"./WalletLink-CjuEskpb.mjs";import"./ethers-CpMSCMOg.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-Bmf8DxNP.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const p=({onClose:p})=>{let{user:l}=i(),[u,d]=o(l?.mfaMethods[0]??null),{init:h,cancel:j,submit:f}=m(),[v,y]=o(!1),[k,g]=o(null),[w,I]=o();e((()=>{d(l?.mfaMethods[0]??null)}),[l?.mfaMethods]);let b=r(!1);async function C(t){I(void 0);try{if(!t||!u)return;await f(u,t),y(!0),I(void 0),p()}catch(t){throw a(t).error}}async function M(t){if("passkey"!==t)try{d(t),await h(t)}catch(t){console.error(t)}else try{d(t);let o=await h(t);if(!o)throw Error("something went wrong");g(o),await f(t,o),y(!0),I(void 0),p()}catch(t){I(a(t))}}e((()=>{!b.current&&u&&(b.current=!0,M(u).finally((()=>{b.current=!1})))}),[]);let S=()=>{d(null),I(void 0),j(),p()};return l?"passkey"===u?/*#__PURE__*/t(n,{account:l.linkedAccounts.filter((t=>"passkey"===t.type&&t.enrolledInMfa)).sort(((t,o)=>o.firstVerifiedAt.valueOf()-t.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:w?.isBlocking??!1,error:w?.error,onClose:S,onBack:()=>{d(null),I(void 0)},handleSubmit:()=>C(k).catch(I)}):u?/*#__PURE__*/t(s,{submitSuccess:v,hasBlockingError:w?.isBlocking??!1,handleSubmitCode:C,selectedMethod:u,onClose:S,onBack:l.mfaMethods.length>1?()=>d(null):void 0}):/*#__PURE__*/t(c,{user:l,onSelect:M,handleClose:S}):null};export{p as MfaVerifyFlowScreen,p 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-DymQMSJy.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-6jomarO4.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 A}from"./context-Cb5MFcME.mjs";import{b as T,u as S,i as w}from"./internal-context-Cvo1WmWN.mjs";import{s as b}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as _}from"./ScreenLayout-Dmrhdwtt.mjs";import{e as C}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{s as j}from"./index-CI666IP9.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.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=C(t);if(e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER&&(o.detail="This account has already been linked to another user."),e?.privyErrorCode===T.INVALID_CREDENTIALS&&(o.retryable=!0,o.detail="Something went wrong. Try again."),e.privyErrorCode===T.OAUTH_USER_DENIED&&(o.detail=`Retry and check ${i} to finish connecting your account.`,o.retryable=!0),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(o.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===T.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===T.OAUTH_ACCOUNT_SUSPENDED){let e=U(t,r).name;o.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE&&(o.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===T.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(_,{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:_}=S(),[C,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===T.ALLOWLIST_REJECTED)return N(void 0),d(),void l("AllowlistRejectionScreen");if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new w(e).toString()),N(void 0),d(),void l("UserLimitReachedScreen");if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return N(void 0),d(),void l("AccountNotFoundScreen");if(e?.privyErrorCode===T.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&&C&&m){if(p?.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let e=setTimeout((()=>{l("AffirmativeConsentScreen")}),A);return()=>clearTimeout(e)}if(b(m,p.embeddedWallets)){let e=setTimeout((()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:k,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),l("EmbeddedWalletOnAccountCreateScreen")}),A);return()=>clearTimeout(e)}{let e=setTimeout((()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0})),A);return y(),()=>clearTimeout(e)}}}),[s,t,C,m]),/*#__PURE__*/e(L,{providerName:D,ProviderLogo:P,success:C,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 i}from"./index-CI666IP9.mjs";import{u as o}from"./internal-context-Cvo1WmWN.mjs";import{a as r}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as a}from"./ScreenLayout-Dmrhdwtt.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const s=({title:i="Log in or create a new account?",subtitle:o="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:r,onLogin:s})=>/*#__PURE__*/t(a,{title:i,subtitle:o,icon:e,primaryCta:{label:"Create new account",onClick:r},secondaryCta:{label:"Log in with a passkey",onClick:s},watermark:!0}),n={component:()=>{let{enabled:e,token:a}=i(),{navigate:n,setModalData:p}=r(),{initSignupWithPasskey:m,initLoginWithPasskey:c}=o();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:t=>m({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await m({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:t=>c({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
@@ -1 +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-Cb5MFcME.mjs";import{c,b as m,u}from"./internal-context-Cvo1WmWN.mjs";import{a as l,u as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as y}from"./ScreenLayout-Dmrhdwtt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const f=({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}),h={component:()=>{let{data:r,setModalData:i,navigate:c}=l(),m=a(),{loginWithPasskey:y,signupWithPasskey:h,closePrivyModal:g,createAnalyticsEvent:v}=u(),{user:w,logout:j}=p(),{passkeySignupFlow:k}=r?.passkeyAuthModalData??{},S=n-500,[b,A]=t("loading"),[C,P]=t(null),E=o([]),W=e=>{E.current=[e,...E.current]};s((()=>()=>{E.current.forEach((e=>clearTimeout(e))),E.current=[]}),[]);let T=async()=>{A("loading");try{k?await h():await y(),A("success")}catch(e){P(e),A("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"}}),j()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,b]),s((()=>{T()}),[]),/*#__PURE__*/e(f,{status:b,passkeySignupFlow:k,error:C,onRetry:T})}};let g=/*#__PURE__*/i.span.withConfig({displayName:"SubtitleText",componentId:"sc-5f92460f-0"})(["white-space:pre-wrap;"]);export{h as PasskeyStatusScreen,f as PasskeyStatusScreenView,h as default};
@@ -1 +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 s,css as a}from"styled-components";import{u as n,a as c,h as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{P as m}from"./Button-DJ-mtuuD.mjs";import{S as p}from"./Layouts-Bmf8DxNP.mjs";import{P as d,a as u,I as h,H as y,S as v}from"./shared-DsP7M4P5.mjs";import{r as f}from"./index-CI666IP9.mjs";import{u as w,k as g}from"./internal-context-Cvo1WmWN.mjs";import{S as j}from"./Screen-dwi2CitY.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const b={component:()=>{let[s,a]=o(!0),{authenticated:m,user:b}=n(),{walletProxy:A,closePrivyModal:k,createAnalyticsEvent:P,client:S}=w(),{navigate:N,data:E,onUserCloseViaDialogOrKeybindRef:M}=c(),[T,W]=o(void 0),[_,H]=o(""),[R,U]=o(!1),{entropyId:z,entropyIdVerifier:B,onCompleteNavigateTo:F,onSuccess:O,onFailure:V}=E.recoverWallet,$=(e="User exited before their wallet could be recovered")=>{k({shouldCallAuthOnSuccess:!1}),V("string"==typeof e?new g(e):e)};M.current=$,i((()=>{if(!m)return $("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:$}),/*#__PURE__*/r(j.Body,{children:/*#__PURE__*/r(x,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(d,{children:[/*#__PURE__*/r(u,{type:s?"password":"text",onChange:e=>(e=>{e&&W(e)})(e.target.value),disabled:R,style:{paddingRight:"2.3rem"}}),/*#__PURE__*/r(h,{style:{right:"0.75rem"},children:s?/*#__PURE__*/r(y,{onClick:()=>a(!1)}):/*#__PURE__*/r(v,{onClick:()=>a(!0)})})]}),!!_&&/*#__PURE__*/r(C,{children:_})]})})}),/*#__PURE__*/e(j.Footer,{children:[/*#__PURE__*/r(j.HelpText,{children:/*#__PURE__*/e(p,{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(I,{loading:R||!A,disabled:!T,onClick:async()=>{U(!0);let e=await S.getAccessToken(),r=l(b,z);if(!e||!r||null===T)return $("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:z,entropyIdVerifier:B,recoveryPassword:T})),H(""),F?N(F):k({shouldCallAuthOnSuccess:!1}),O?.(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{U(!1)}},$hideAnimations:!z&&R,children:"Recover your account"})}),/*#__PURE__*/r(j.Watermark,{})]})]})}};let x=/*#__PURE__*/s.div.withConfig({displayName:"Content",componentId:"sc-1247f710-0"})(["display:flex;flex-direction:column;gap:1.5rem;"]),C=/*#__PURE__*/s.div.withConfig({displayName:"ErrorMessage",componentId:"sc-1247f710-1"})(["line-height:20px;height:20px;font-size:13px;color:var(--privy-color-error);text-align:left;margin-top:0.5rem;"]),I=/*#__PURE__*/s(m).withConfig({displayName:"NoAnimationPrimaryButton",componentId:"sc-1247f710-2"})(["",""],(({$hideAnimations:e})=>e&&/*#__PURE__*/a(["&&{transition:none;}"])));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{P as c}from"./Button-DJ-mtuuD.mjs";import{M as s,B as l}from"./ModalHeader-D7WajfD8.mjs";import{C as n}from"./ScreenHeader-Biz1wq02.mjs";import{q as d}from"./context-Cb5MFcME.mjs";import{v as p,w as u,x as m,R as h,s as v}from"./index-CI666IP9.mjs";import{a as w,f as y,b as f,u as _}from"./internal-context-Cvo1WmWN.mjs";import{a as A,u as E,g}from"./get-is-unified-wallet-DymQMSJy.mjs";import{a8 as C,a9 as b,aa as R}from"./paths-3HW55qZg.mjs";import{g as k}from"./useWallets-BplPx0Pz.mjs";import{a as T}from"./events-context-CI0iqAXA.mjs";import{u as O}from"./use-create-wallet-without-fallback-DodUf3VP.mjs";import{A as N,G as S,R as I}from"./styles-BxA7nKxI.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";async function x({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 M({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new w("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new w("User denied confirmation during OAuth flow");try{return(await e.post(C,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(e){let t=y(e);if(t.privyErrorCode)throw new w(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new w("Invalid code during oauth flow.",void 0,f.OAUTH_USER_DENIED);throw new w("Invalid code during OAuth flow.",void 0,f.UNKNOWN_AUTH_ERROR)}}async function j({api:e,provider:t}){let r=p(),o=u(),a=await m(r);try{return"icloud"===t?{url:(await e.post(b,{client_type:"web"})).url}:{url:(await e.post(R,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw y(e)}}let U={"google-drive":{name:"Google Drive",component:S},icloud:{name:"iCloud",component:N}};const W={component:()=>{let{logout:p}=E(),{navigate:u,setModalData:m,data:y}=A(),{closePrivyModal:C,createAnalyticsEvent:b}=_(),{execute:R}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=_(),{data:o}=A(),{user:a}=E(),i=T(),{create:c}=O();return{execute:async({provider:s,action:l,popup:n,shouldCreateEth:d,shouldCreateSol:p})=>{let u,m;if(!e)throw new w("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 w("Recovery OAuth failed")}switch(s){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await j({api:e.api,provider:s});h(o);try{let a=await x({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 w("Unexpected auth flow. This may be a phishing attempt.",void 0,f.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:s}}),new w("Recovery OAuth failed")}[u,m]=await Promise.all([e.getAccessToken(),M({api:e.api,provider:s,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await j({api:e.api,provider:s});h(t);let{ckWebAuthToken:r}=await x({url:t,popup:n,provider:s});m=r,u=await e.getAccessToken()}}if(!t)throw new w("Cannot connect to wallet proxy");if(!u)throw new w("Unable to authorize user");switch(l){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new w("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",f.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=g(a);if(!o)throw i("setWalletRecovery","onError",f.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}=k(a);await t.setRecovery({accessToken:u,entropyId:c,entropyIdVerifier:l,recoveryMethod:s,recoveryAccessToken:m});let n=g(await r());if(!n)throw i("createWallet","onError",f.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 w("Unsupported recovery action")}}}})(),[N,S]=o(!1),{provider:W,action:D,isInAccountCreateFlow:P,shouldCreateEth:V,shouldCreateSol:L}=y?.recoveryOAuthStatus,[$,z]=o(void 0),[H,B]=o("create-wallet"===D);if("user-passcode"===W)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let F=U[W].name,G=U[W].component,K=y?.recoverWallet?.onCompleteNavigateTo,Y=new h((async(e="create-wallet")=>(B(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await R({provider:W,action:e,popup:r,shouldCreateEth:V,shouldCreateSol:L}),S(!0),t()}catch(t){z({message:`${"recover"===e?"Recovery":"Back up"} with ${F} unsuccessful`,detail:"recover"===D?`Please verify that you are selecting the ${F} 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=>{b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),p()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),u("EmbeddedWalletCreatedScreen")):C({shouldCallAuthOnSuccess:!1})}),d);return()=>clearTimeout(e)}),[N]);let X=i((async()=>{await Y.execute("recover"),K?u(K):S(!0)}),[]),q="google-drive"===W?"Google Drive":"Apple iCloud",Q=N&&`Successfully ${"recover"===D?"recovered":"backed up"} with ${q}.`||$&&$.message||`${"recover"===D?"Recovering":"Backing up"} with ${q}...`,J=$?$.detail:"";/*#__PURE__*/return e(t,{children:[/*#__PURE__*/r(s,{}),H?/*#__PURE__*/r(t,{children:/*#__PURE__*/e(I,{children:[/*#__PURE__*/r(n,{title:Q,icon:/*#__PURE__*/r(G,{style:{width:"38px",height:"38px"}}),description:J}),$&&$?.retryable?/*#__PURE__*/r(c,{onClick:()=>{v(),z(void 0),"create-wallet"===D?Y.execute("create-wallet"):X()},disabled:!N&&!$?.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 ${q} where your account is backed up.`}),/*#__PURE__*/e(c,{onClick:X,children:["Confirm with ",q]})]}),/*#__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 t,useEffect as o}from"react";import{u as r}from"./context-Cb5MFcME.mjs";import{R as i}from"./index-CI666IP9.mjs";import{u as s,k as a}from"./internal-context-Cvo1WmWN.mjs";import{u as n}from"./use-create-wallet-without-fallback-DodUf3VP.mjs";import{a as c,u as l}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-ZtRqoZYj.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-Bmf8DxNP.mjs";import"./ModalHeader-D7WajfD8.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-DsP7M4P5.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Button-DJ-mtuuD.mjs";import"./Checkbox-NmGCZeKL.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-Biz1wq02.mjs";const u={component:()=>{let{navigate:u,data:d,onUserCloseViaDialogOrKeybindRef:h}=c(),w=r(),[y,v]=t(""),[f,j]=t(!1),[g,C]=t(),[I,b]=t(null),{create:x}=n(),{authenticated:S,user:P}=l(),{closePrivyModal:A,isNewUserThisSession:k,initializeWalletProxy:M}=s(),{onSuccess:U,onFailure:E,callAuthOnSuccessOnClose:T,shouldCreateEth:O,shouldCreateSol:W}=d.createWallet,[D,L]=t(null),R=new i((async()=>{try{let e;if(O&&W)e=await x({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:P}),e=await x({chainType:"solana",walletIndex:0,latestUser:e.user});else if(W)e=await x({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"solana",walletIndex:0,latestUser:P});else{if(!O)throw Error("Invalid args to create wallet");e=await x({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:P})}L(e),k?u("EmbeddedWalletCreatedScreen"):(U(e),A({shouldCallAuthOnSuccess:T}))}catch(e){v(e.message)}}));o((()=>{I||M(3e4).then((e=>b(e)))}),[I]),o((()=>{if(!S||!P)return u("LandingScreen"),void E(Error("User must be authenticated before creating a Privy wallet"))}),[S]),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 a("User created a wallet but failed to set a password for it")),A({shouldCallAuthOnSuccess:!1})):D?(U(D),A({shouldCallAuthOnSuccess:T})):(E(new a("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 +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-DymQMSJy.mjs";import{P as d}from"./Button-DJ-mtuuD.mjs";import{M as m,B as u}from"./ModalHeader-D7WajfD8.mjs";import{C as h}from"./ScreenHeader-Biz1wq02.mjs";import{u as y}from"./context-Cb5MFcME.mjs";import{u as v}from"./internal-context-Cvo1WmWN.mjs";import{y as g}from"./index-CI666IP9.mjs";import{R as f,A as w,G as C,a as j}from"./styles-BxA7nKxI.mjs";import{U as k}from"./useActiveWallet-hrZcON-K.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-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-IxRndou_.mjs";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";let S=/*#__PURE__*/n.div.withConfig({displayName:"IconContainer",componentId:"sc-1c4e63fb-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),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(d,{onClick:t,children:"Select backup method"})]});const I={component:()=>{let[s,n]=c(!1),{navigate:d,lastScreen:j,navigateBack:I,setModalData:x,data:M,onUserCloseViaDialogOrKeybindRef:P}=a(),{user:O}=l(),{embeddedWallets:W}=y(),{closePrivyModal:R}=v(),F=p(O),B=null===F,{isInAccountCreateFlow:D,isResettingPassword:E,shouldCreateEth:G,shouldCreateSol:U}=M.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){x({recoveryOAuthStatus:{provider:e,action:B?"create-wallet":"set-recovery",isInAccountCreateFlow:D,shouldCreateEth:G,shouldCreateSol:U}}),d("RecoveryOAuthScreen")}function q(){M?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),R({shouldCallAuthOnSuccess:M?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return P.current=q,/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{onClose:q,backFn:s?()=>n(!1):j?I: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:()=>{d(g({isCreatingWallet:B,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{I as RecoverySelectionScreen,I as default};
@@ -1 +0,0 @@
1
- import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u}from"./context-Cb5MFcME.mjs";import{u as m}from"./internal-context-Cvo1WmWN.mjs";import{u as p}from"./useGetSolPrice-Bi0pPiUW.mjs";import{ErrorScreenView as f}from"./ErrorScreen-DFAo4S7A.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-DJ-mtuuD.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-D7WajfD8.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as A,R as I}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-CjuEskpb.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-hrZcON-K.mjs";import{T as $,a as L}from"./TransactionErrorView-Dgp1KSy5.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as _,getCompiledTransactionMessageDecoder as F,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as H,u as V}from"./useSolanaRpcClient-DjD2ma5c.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-IxRndou_.mjs";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-B0V48m2I.mjs";import"./ScreenLayout-Dmrhdwtt.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-CpMSCMOg.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-DtXA0OPS.mjs";import"./WalletInfoCard-DAv0WFcc.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(A,{children:[r?.action&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=F().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=H(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:A}=c(),I=V()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,H]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(A).find((t=>t.address===Y.address)):d(A),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:I,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,I,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await I.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:I.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:I.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await I.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,_(F().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==I.chain?"Solana":I.chain.replace("solana:",""),blockExplorerUrl:I.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(H(!0),U||!Y||!k||!A||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:I,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{H(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,q as i,C as a}from"./index-CI666IP9.mjs";import{u as s,q as n}from"./context-Cb5MFcME.mjs";import{u as m,b as l,i as c}from"./internal-context-Cvo1WmWN.mjs";import{u as d,a as u}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as g}from"./ScreenLayout-Dmrhdwtt.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const y=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(g,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:v,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},f={component:()=>{let{authenticated:g,logout:v,ready:f,user:h}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:S}=u(),T=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[L,k]=t(!1),[I,x]=t(void 0),D=o();async function N(){try{let e=await async function(){let e;if(!g){if(D.enabled&&"error"===D.status)throw new a(D.error,null,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),k(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return x(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void b("LinkConflictScreen");let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{N()}),[]),r((()=>{if(!(f&&g&&L&&h))return;if(T?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(h,T.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),b("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[f,g,L,h]);/*#__PURE__*/return e(y,{success:L,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),S?.telegramAuthModalData?.seamlessAuth||await C(void 0,S?.login?.disableSignup),await N()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{f as TelegramAuthScreen,y as TelegramAuthScreenView,f as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as a,useEffect as i}from"react";import{M as o,B as l}from"./ModalHeader-D7WajfD8.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as s}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{C as m}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as c}from"./context-Cb5MFcME.mjs";import{v as d,a8 as u,U as h}from"./useActiveWallet-hrZcON-K.mjs";import{u as y}from"./internal-context-Cvo1WmWN.mjs";import{a as f}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as g}from"./useWallets-BplPx0Pz.mjs";import{t as C,W as w}from"./WalletButtonList-CGloXTN0.mjs";import{I as T}from"./styles-DY17fuAX.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"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"lucide-react";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";const j={component:()=>{let m,{connectors:h}=y(),{setModalData:T,data:j,navigate:W}=f(),S=c(),{wallets:x}=g(),D=h.filter(d).flatMap((e=>e.wallets)),[F,k]=a("default"),M="solana"===j?.funding?.chainType,b=!!j?.funding?.crossChainBridgingEnabled;m="ethereum"===j?.funding?.chainType?j.funding.erc20Address&&!j.funding.isUSDC?"ethereum-only":b&&!j.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":b&&!j.funding?.isUSDC?"ethereum-and-solana":"solana-only";let E=x.filter((e=>"privy"!==e.walletClientType)),A=E.map((e=>e.walletClientType)),I=D.filter((e=>"privy"!==e.walletClientType)),L=I.map((e=>e.walletClientType)),B=[],H={...j.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let U=({wallet:e,walletChainType:t})=>{T({...j,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>W(z({destChainType:M?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),W("FundingAmountEditScreen")};"solana-only"!==m&&B.push(...E.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"ethereum"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),"ethereum-only"!==m&&B.push(...I.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"solana"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),B.push(...C({walletList:S.appearance.walletList.filter((e=>!E.some((t=>t.walletClientType===e))&&!I.some((t=>t.walletClientType===e)))),walletChainType:m,connectors:h,connectOnly:!0,ignore:[...S.appearance.walletList,...A,...L],walletConnectEnabled:S.externalWallets.walletConnect.enabled}));let P=/*#__PURE__*/e(w,{text:"More wallets",onClick:()=>k("overflow")}),z=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===t?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===t?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return i((()=>{T({...j,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?E.find((n=>n.address===e&&n.walletClientType===t)):I.find((n=>n.address===e&&n.walletClientType===t));return T({...j,funding:{...H,connectedWallet:i,onContinueWithExternalWallet:()=>{W(z({destChainType:M?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/t(n,"overflow"===F?{children:[/*#__PURE__*/e(o,{backFn:()=>k("default")},"header"),/*#__PURE__*/t(u,{children:[/*#__PURE__*/e(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),B]}),/*#__PURE__*/e(l,{})]}:{children:[/*#__PURE__*/e(s,{}),/*#__PURE__*/e(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/t(u,{children:[B.length>4?B.slice(0,3):B,B.length>4&&P]}),/*#__PURE__*/e(l,{})]})}};let v=({onClick:n,icon:a,name:i,chainType:o})=>/*#__PURE__*/t(h,{onClick:n,children:[/*#__PURE__*/e(T,{style:{width:20},children:/*#__PURE__*/e("img",{src:a})}),i,/*#__PURE__*/e(m,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/e(m,{color:"gray",children:"Solana"})]});export{j as TransferFromWalletScreen,j as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-Cb5MFcME.mjs";import{a as l}from"./index-CI666IP9.mjs";import{u as d}from"./internal-context-Cvo1WmWN.mjs";import{u as c,a as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{a1 as u,V as h}from"./useActiveWallet-hrZcON-K.mjs";import{E as f,P as j}from"./Button-DJ-mtuuD.mjs";import{I as v,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-Dmrhdwtt.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.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"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,v]=m(""),[g,w]=m(""),[k,S]=m(!1),{authenticated:A,user:x}=c(),{initUpdateEmail:C}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||A?(async e=>{if(!x?.email)throw Error("User is required to have an email address to update it.");S(!0);try{await C({oldAddress:x.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}S(!1)})(U):(M({captchaModalData:{callback:e=>{if(!x?.email)throw Error("User is required to have an email address to update it.");return C({oldAddress:x.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(E,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(f,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(j,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=v,E=g;const S=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),A={component:()=>/*#__PURE__*/t(S,{})};export{A as UpdateEmailScreen,S as UpdateEmailScreenView,A as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,jsx as n}from"react/jsx-runtime";import{Wallet as t}from"lucide-react";import{U as l,V as a,Y as o,F as c,Q as i,n as r,T as s}from"./useActiveWallet-hrZcON-K.mjs";import{m as p,n as d,o as y}from"./index-CI666IP9.mjs";import{isMobile as w}from"react-device-detect";import{styled as m}from"styled-components";import{I as h}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{C as f}from"./Chip-Bsgj4Yc-.mjs";import{u}from"./internal-context-Cvo1WmWN.mjs";import{a as T}from"./get-is-unified-wallet-DymQMSJy.mjs";const C=({onClick:c,text:i})=>/*#__PURE__*/e(l,{onClick:c,children:[/*#__PURE__*/n(a,{children:/*#__PURE__*/n(t,{})}),/*#__PURE__*/n(o,{children:i})]}),_=({provider:t,displayName:l,logo:a,connectOnly:o,connector:d})=>{let y,{navigate:m,setModalData:f}=T(),{connectWallet:C}=u(),_=c(),x=i(t),b="wallet_connect_v2"===d.connectorType?t:d.walletClientType,O=window.matchMedia("(display-mode: standalone)").matches,W=r({connectorType:d.connectorType,walletClientType:b});y=W&&W.chainTypes.includes(d.chainType)?()=>{W.isInstalled||"solana"===d.chainType&&"isInstalled"in d&&d.isInstalled?(C(d,b),m(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):w?(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("WalletInterstitialScreen")):(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("InstallWalletScreen"))}:"coinbase_wallet"!==d.connectorType||"eoaOnly"!==d.coinbaseWalletConfig.preference?.options||!w||O||s()?()=>{(!p(window.navigator.userAgent)||event?.isTrusted)&&(C(d,b),o?"wallet_connect_v2"===d.connectorType?(f((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),m("ConnectOnlyLandingScreen")):m("ConnectOnlyStatusScreen"):m("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let S=l||x?.metadata?.shortName||x?.name||d.walletClientType;/*#__PURE__*/return e(g,{onClick:y,children:[/*#__PURE__*/n(h,{icon:a||x?.image_url?.md,name:S}),/*#__PURE__*/n("span",{children:S}),/*#__PURE__*/e($,{id:"chip-container",children:[_?.walletClientType===b&&_?.chainType===d.chainType?/*#__PURE__*/n(v,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===d.chainType&&/*#__PURE__*/n(v,{color:"gray",children:"Solana"})]})]})};let g=/*#__PURE__*/m(l).withConfig({displayName:"ConnectWalletButton",componentId:"sc-5fe2f19b-0"})(["> span{color:var(--privy-color-foreground);}> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),v=/*#__PURE__*/m(f).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),$=/*#__PURE__*/m.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const x=["coinbase_wallet","base_account"];let b=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance"];const O=["safe"],W=["phantom","backpack","solflare","universal_profile"],S=({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:c,forceWallet:i})=>{let r=[],s=[],p=[],w=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=w.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,h]of(i?[i.wallet]:e).entries()){if("detected_ethereum_wallets"===h)for(let[e,t]of w.filter((({chainType:e,connectorType:n,walletClientType:t})=>"solana"!==e&&("uniswap_wallet_extension"===t||"uniswap_extension"===t?!o.includes("uniswap"):"crypto.com_wallet_extension"===t||"crypto.com_onchain"===t?!o.includes("cryptocom"):"injected"===n&&!o.includes(t)))).entries()){let{walletClientType:o,walletBranding:c,chainType:i}=t;("unknown"===o?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:o,logo:c.icon,displayName:c.name,connector:t},`${l}-${h}-${o}-${i}-${e}`))}if("detected_solana_wallets"===h)for(let[e,c]of w.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:i}=c;("unknown"===t?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:c},`${l}-${h}-${t}-${i}-${e}`))}if(W.includes(h)){let e=w.find((e=>"injected"===e.connectorType&&e.walletClientType===h||e.connectorType===h));if(e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(b.includes(h)){let e=w.find((e=>"uniswap"===h?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===h?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===h));if(c&&!e&&(e=m),e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(x.includes(h)){let e=w.find((({connectorType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?d:y},`${l}-${h}`))}else if(O.includes(h))m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m},`${l}-${h}`));else if("wallet_connect"===h)m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${h}`));else if(h===i?.wallet){let t="ethereum"===i.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===i.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=w.find((({walletClientType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${h}`))}}}return[...s,...r,...p]};export{C as W,S as t};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as n,useEffect as a,createContext as o,useContext as l}from"react";import{dedupeSupportedChains as r,DEFAULT_SUPPORTED_CHAINS as i,mainnet as c}from"@privy-io/js-sdk-core";import s from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.8.0",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",F="privy-id-token",C="privy-session",y="privy:caid",M=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,A="privy:state_code",x="privy:code_verifier",B="privy:headless_oauth",D="privy:oauth_disable_signup",W=e=>`privy:wallet:${e}`,S="privy:connections",H=12e4,L=1,I="0x1",O=3e4,U="https://api.moonpay.com/v1",q="https://api.moonpay.com/v1",P="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated",T={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let N=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","binance","binanceus","bitget_wallet"]),$=e=>N.has(e),z=(e,t,n)=>n.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($).filter(z):e?e.filter($).filter(z):T.appearance.walletList;function J(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:n})}function G(e,t){let n=e.getLuminance(),a=t.getLuminance();return(Math.max(n,a)+.05)/(Math.min(n,a)+.05)}function K(e,t){if(!e){let e=t?X:Z;return{accent:s(e.background.interactive),accentLight:s(e.background.interactive),accentHover:s(e.background["interactive-hover"]),accentDark:s(e.background["interactive-clicked"]),accentDarkest:s(e.background["interactive-disabled"])}}let n=s(e);return{accent:n,accentLight:J(n,.15),accentHover:J(n,.3),accentDark:J(n,-.06),accentDarkest:J(n,-.6)}}function V({backgroundTheme:e,accentHex:t}){let n,a;"light"===e?n=!1:"dark"===e?n=!0:(n=.5>=s(e).getLuminance(),a=s(e).toHslString());let o=n?"dark":"light",l=n?X:Z,{accent:r,accentLight:i,accentHover:c,accentDark:d,accentDarkest:u}=K(t,n),g=function(e){let t=s(Z.text.default),n=s(X.text.default),a=G(e,t),o=G(e,n),l=e.toHsl();return l.h>=220&&l.h<=300&&o>=3?X.text.default:a>o?Z.text.default:X.text.default}(r),h=s(g),f=G(r,s(l.background.default))>=3;return{colorScheme:o,background:a||l.background.default,background2:l.background.elevated,background3:l.background.interactive,foreground:l.text.default,foreground2:l.text.muted,foreground3:l.text.placeholder,foreground4:l.border.default,accent:r.toHslString(),accentLight:i.toHslString(),accentHover:c.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:l.background.success,successDark:l.text.success,successLight:l.background.success,error:l.text.error,errorLight:l.background.error,warn:l.background.warning,warnLight:l.background.warning,warningDark:l.text.warning,errorDark:l.text.error,successBg:l.background.success,errorBg:l.background.error,errorBgHover:l.background["error-hover"],warnBg:l.background.warning,infoBg:l.background.info,infoBgHover:l.background["info-hover"],borderDefault:l.border.default,borderHover:l.border["default-hover"],borderFocus:l.border.focused,borderError:l.border.error,borderSuccess:l.border.success,borderWarning:l.border.warning,borderInfo:l.border.info,borderInteractive:l.border.interactive,borderInteractiveHover:l.border["interactive-hover"],backgroundHover:l.background["default-hover"],backgroundClicked:l.background["default-clicked"],backgroundDisabled:l.background["default-disabled"],backgroundInteractive:l.background.interactive,backgroundInteractiveHover:l.background["interactive-hover"],backgroundInteractiveClicked:l.background["interactive-clicked"],backgroundInteractiveDisabled:l.background["interactive-disabled"],foregroundHover:l.text.default,foregroundClicked:l.text.default,foregroundDisabled:l.text["default-disabled"],foregroundInteractive:l.text.interactive,foregroundInteractiveHover:l.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?r.toHslString():l.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:l.icon.default,iconMuted:l.icon.muted,iconSubtle:l.icon.subtle,iconInverse:l.icon.inverse,iconSuccess:l.icon.success,iconWarning:l.icon.warning,iconError:l.icon.error,iconInteractive:l.icon.interactive,iconDefaultHover:l.icon["default-hover"],iconMutedHover:l.icon["muted-hover"],iconSubtleHover:l.icon["subtle-hover"],iconDefaultClicked:l.icon["default-clicked"],iconMutedClicked:l.icon["muted-clicked"],iconSubtleClicked:l.icon["subtle-clicked"],iconDefaultDisabled:l.icon["default-disabled"],iconMutedDisabled:l.icon["muted-disabled"],iconSubtleDisabled:l.icon["subtle-disabled"],iconErrorHover:l.icon["error-hover"],iconInteractiveHover:l.icon["interactive-hover"],iconErrorClicked:l.icon["error-clicked"],iconInteractiveClicked:l.icon["interactive-clicked"],iconMutedDisabledAlt:l.icon["muted-disabled"],iconSubtleDisabledAlt:l.icon["subtle-disabled"]}}const X={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},Z={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function Q(e,t,n,a,o){let l,s,d,u,g,h,f,p,_,b,m,v,w,k,F,C,y,M=n?console.warn:()=>{};t?.loginMethods?(l=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),F=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey")):(l=e.email_auth,s=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,F=e.apple_oauth,C=e.farcaster_auth,y=e.telegram_auth,d=e.passkey_auth),e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let E=[l,s].filter(Boolean),A=[g,h,f,k,m,v,p,_,w,F,C,y].filter(Boolean),x=[u].filter(Boolean),B=t?.loginMethods?.includes("passkey")??!1,D=e.passkeys_for_signup_enabled??!1,W=[d&&(D||B)].filter(Boolean);if(E.length+A.length+x.length+W.length===0)throw Error("You must enable at least one login method");let S=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;S&&0===x.length?(M("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):S||A.length+E.length!==0||(M("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let H=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&M("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((L.includes("wallet_connect_qr")||L.includes("wallet_connect"))&&L.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let I=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];for(let n of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(n)?console.warn(`Duplicated login method: ${n}`):t.push(n);for(let a of e.overflow??[])t.includes(a)||n.includes(a)?console.warn(`Duplicated login method: ${a}`):n.push(a);return{primary:t,overflow:n}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:q}=function({supportedChains:e,defaultChainFromConfig:t}){let n;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");n=r(e)}else n=[...i];let a=e?n[0]:c,o=t??a;if(!n.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),P=!!t?.defaultChain,j=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=j?"all-users":e.embedded_wallet_config.ethereum.create_on_login,N=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let $=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,z=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??T.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:V({backgroundTheme:t?.appearance?.theme??T.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:l,sms:s,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:F,farcaster:C,telegram:y},customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:I,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??T.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:U,defaultChain:q,intl:{defaultCountry:O,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captcha_enabled??T.captchaEnabled,captchaSiteKey:e.captcha_site_key,externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:H},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!j&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:j?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??R},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??N},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??a??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:j?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:$,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??T._render.standalone},fundingConfig:z,fundingMethodConfig:{...t?.fundingMethodConfig??T.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??T.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??T.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null}}}const ee={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_enabled:!1,captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let te=/*#__PURE__*/o({appConfig:Q(ee,void 0,!1),isServerConfigLoaded:!1});const ne=({children:o,client:l,legacyClient:r,clientConfig:i,appClientId:c})=>{let[s,d]=t(null),u=n((()=>Q(s??ee,i,!!s,"undefined"!=typeof window?window.location.origin:void 0,c)),[s,i,c]);return a((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:n,defaultChain:a,externalWallets:o,...l}=e;return{...l,...n?{supportedChains:n.map((e=>e.id))}:void 0,...a?{defaultChain:a.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let n=3735928559^t,a=1103547991^t;for(let t,o=0;o<e.length;o++)n=Math.imul(n^(t=e.charCodeAt(o)),2654435761),a=Math.imul(a^t,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(JSON.stringify(e)).toString(),n=`privy:sent:${s.id}:${t}`;localStorage.getItem(n)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))}),[i,s]),a((()=>{s||(async()=>{try{await l.initialize();let e=l.app.getConfig();e.custom_api_url&&r.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(te.Provider,{value:{appConfig:u,isServerConfigLoaded:!!s},children:o})},ae=()=>{let{appConfig:e}=l(te);return e},oe=()=>{let{isServerConfigLoaded:e}=l(te);return e};export{_ as C,d as D,B as H,k as I,q as M,D as O,w as P,m as R,A as S,p as V,O as W,x as a,S as b,oe as c,y as d,E as e,C as f,M as g,R as h,b as i,v as j,F as k,u as l,ne as m,H as n,W as o,I as p,g as q,h as r,L as s,f as t,ae as u,U as v,j as w,P as x};
@@ -1 +0,0 @@
1
- import{createPublicClient as t,http as e}from"viem";import{a}from"./getPublicClient-IxRndou_.mjs";const n=async({address:n,chain:s,rpcConfig:r,privyAppId:o})=>{try{let l=t({chain:s,transport:e(a(s,r,o))}),[m,c]=await Promise.all([l.readContract({abi:i,address:n,functionName:"symbol"}),l.readContract({abi:i,address:n,functionName:"decimals"})]);return{decimals:c,symbol:m}}catch(t){return console.log(t),null}};let i=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];export{n as g};