@privy-io/react-auth 3.15.0 → 3.16.0-beta-20260303155317

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 (374) hide show
  1. package/dist/cjs/AccountNotFoundScreen-vfuo7K3q.js +1 -0
  2. package/dist/cjs/{Address-Xt6eDzsN.js → Address-C2XO5YDn.js} +2 -2
  3. package/dist/cjs/AffirmativeConsentScreen-DDqJdDR5.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-bT87iLL0.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-fF9THkYv.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-DtlBt2Cl.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-Bc_wou1l.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-B0f3rdjx.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-CEi0IJTY.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-B-GFim4z.js → BridgeNetworkSelectionView-CEEgCj1m.js} +8 -8
  11. package/dist/cjs/CaptchaScreen-Dj6ymBPO.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-DcmUqAPX.js +16 -0
  13. package/dist/cjs/ConnectEmailForm-D-0Amqhf.js +3 -0
  14. package/dist/cjs/ConnectLedgerScreen-CRxctrk4.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-JFMrMqCK.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-DEFH7bgu.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-CEf0NGlE.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-B6TGW3Jk.js → ConnectPhoneForm-kY70TzuW.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-CTc3Uc5v.js → ConnectWalletView-DAxk2klb.js} +1 -1
  20. package/dist/cjs/ConnectionStatusScreen-C4a4QkqP.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BHWqG6zR.js +1 -0
  22. package/dist/cjs/CustomLandingScreenView-Cvi2ftR4.js +23 -0
  23. package/dist/cjs/DelegatedActionsConsentScreen-BmdAqKq1.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-DYQnCNQW.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-EXc14wEJ.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-D5PwFHC7.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-H0W0Seun.js → EmbeddedWalletKeyExportScreen-DszJVyOe.js} +2 -2
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-C4dBDzQV.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CJQBG3tr.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DISYQBGG.js +1 -0
  31. package/dist/cjs/{EnrollTotp-BbePRUGX.js → EnrollTotp-DmEXJI20.js} +8 -8
  32. package/dist/cjs/ErrorScreen-DBufYBAT.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-LPCbfVT6.js → FarcasterConnectStatusScreen-BHsQhnxe.js} +6 -6
  34. package/dist/cjs/FarcasterSignerStatusScreen-ClCsDFns.js +29 -0
  35. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DCdJwukp.js +2 -0
  36. package/dist/cjs/{FundWalletMethodHeader-BvRFQpAq.js → FundWalletMethodHeader-B1WvouQK.js} +1 -1
  37. package/dist/cjs/{FundWithBankDepositScreen-CW9fQXWW.js → FundWithBankDepositScreen-zihRVyvs.js} +4 -4
  38. package/dist/cjs/FundingEditAmountScreen-CLd-SUXK.js +1 -0
  39. package/dist/cjs/FundingMethodSelectionScreen-EKlcEwiq.js +1 -0
  40. package/dist/cjs/InAppBrowserLoginNotPossible-CzYTb-FD.js +1 -0
  41. package/dist/cjs/InstallWalletScreen-Bgkyz_sV.js +1 -0
  42. package/dist/cjs/LandingScreen-CfjCU0Nk.js +1 -0
  43. package/dist/cjs/{LinkConflictScreen-m-9_Aelz.js → LinkConflictScreen-B5l8Yj72.js} +3 -3
  44. package/dist/cjs/LinkEmailScreen-C8WgXvy5.js +1 -0
  45. package/dist/cjs/{LinkPasskeyScreen-BEr2kUd1.js → LinkPasskeyScreen-zZuixNSn.js} +4 -4
  46. package/dist/cjs/LinkPhoneScreen-Ce-gRgav.js +1 -0
  47. package/dist/cjs/LoginFailedScreen-z2hTJqor.js +1 -0
  48. package/dist/cjs/ManualTransferScreen-DvMhwqIJ.js +1 -0
  49. package/dist/cjs/MfaAuthEnrollmentFlowScreen-Dpg6VFt0.js +1 -0
  50. package/dist/cjs/MfaAuthVerifyFlowScreen-CMRoZXUS.js +1 -0
  51. package/dist/cjs/MfaEnrollmentFlowScreen-ihcEpQrd.js +1 -0
  52. package/dist/cjs/MfaVerifyFlowScreen-CilRXIV0.js +1 -0
  53. package/dist/cjs/{ModalHeader-GBAwOroa.js → ModalHeader-CyTOtcfZ.js} +1 -1
  54. package/dist/cjs/MoonpayStatusScreen-Nyj1xMTq.js +16 -0
  55. package/dist/cjs/OAuthStatusScreen-_TFqeHsJ.js +1 -0
  56. package/dist/cjs/PasskeySelectSignupOrLogin-Dp0-Ud_g.js +1 -0
  57. package/dist/cjs/PasskeyStatusScreen-C63gCtWy.js +3 -0
  58. package/dist/cjs/PasswordRecoveryScreen-Cwa1T4Li.js +20 -0
  59. package/dist/cjs/{QrCode-B3SMGhXR.js → QrCode-W7V5iJhH.js} +3 -3
  60. package/dist/cjs/RecoveryOAuthStatusScreen-ByS5mnB4.js +1 -0
  61. package/dist/cjs/RecoveryPasswordCreateScreen-BKEPFkp5.js +1 -0
  62. package/dist/cjs/{RecoverySelectionScreen-DvNHxJ5j.js → RecoverySelectionScreen-D1oBvaHv.js} +2 -2
  63. package/dist/cjs/{Screen-Pj2ZYdHC.js → Screen-CmJw2o9A.js} +1 -1
  64. package/dist/cjs/{ScreenLayout-BHHlzSio.js → ScreenLayout-DNsKsPML.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-DmszLf5G.js → SetAutomaticRecoveryScreen-IX9a3eUr.js} +2 -2
  66. package/dist/cjs/{SetWalletPasswordForm-H4Il8ttU.js → SetWalletPasswordForm-DfEhJ79E.js} +2 -2
  67. package/dist/cjs/{SignRequestScreen-DynNsz8H.js → SignRequestScreen-Dqx7elGz.js} +5 -5
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-BPzpZJ9p.js → StandardSignAndSendTransactionScreen-BdCYw0my.js} +3 -3
  69. package/dist/cjs/TelegramAuthScreen-DHvtkANm.js +1 -0
  70. package/dist/cjs/{TransactionDetails-hXvXoX9X.js → TransactionDetails-Bkf0lmfq.js} +1 -1
  71. package/dist/cjs/{TransactionErrorView-BRVtuUfe.js → TransactionErrorView-Ckrj9n7Y.js} +4 -4
  72. package/dist/cjs/TransferFromWalletScreen-4r3KTkpp.js +31 -0
  73. package/dist/cjs/{TransferOrBridgeLoadingScreen-CJZ5TtOk.js → TransferOrBridgeLoadingScreen-DlJ5lthW.js} +2 -2
  74. package/dist/cjs/UpdateEmailScreen-qiSXBq0X.js +1 -0
  75. package/dist/cjs/UpdatePhoneScreen-DysY1yM-.js +1 -0
  76. package/dist/cjs/UserLimitReachedScreen-De0w5MuT.js +1 -0
  77. package/dist/cjs/{WalletInfoCard-C9sF64jD.js → WalletInfoCard-CniJMC32.js} +6 -6
  78. package/dist/cjs/WalletInterstitialScreen-DyxheWue.js +1 -0
  79. package/dist/cjs/WalletLink-Vtuq8mBK.js +22 -0
  80. package/dist/cjs/{WalletOverflowButton-vu5a58lx.js → WalletOverflowButton-CkK93UsZ.js} +1 -1
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/{context-BUtefjlp.js → context-BVD9aHyL.js} +1 -1
  83. package/dist/cjs/ethers-0NnB0y-d.js +1 -0
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/{get-is-unified-wallet-DZz3zBvv.js → get-is-unified-wallet-3wKKPb8T.js} +1 -1
  86. package/dist/cjs/getErc20Balance-RxLpb74e.js +1 -0
  87. package/dist/cjs/getErc20TokenInfo-CwuidUyY.js +1 -0
  88. package/dist/cjs/{index-B2LlWVGv.js → index-BnLXb15t.js} +1 -1
  89. package/dist/cjs/index-CZcgFfXk.js +12 -0
  90. package/dist/cjs/index-DvDZFmbh.js +174 -0
  91. package/dist/cjs/index.js +1 -1
  92. package/dist/cjs/internal.js +1 -1
  93. package/dist/cjs/{shared-36UW-DIc.js → shared-TYGDmgn8.js} +1 -1
  94. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-CRa43-i7.js → shouldProceedtoEmbeddedWalletCreationFlow-vPg8Kr3c.js} +1 -1
  95. package/dist/cjs/smart-wallets-dvV25L_d.js +1 -0
  96. package/dist/cjs/smart-wallets.js +1 -1
  97. package/dist/cjs/solana.js +1 -1
  98. package/dist/cjs/{styles-g3kNpNZY.js → styles-CQ0az3cX.js} +4 -4
  99. package/dist/cjs/{to-ui-error-DaZr6PqV.js → to-ui-error-Csc1sILU.js} +2 -2
  100. package/dist/cjs/ui.js +9 -9
  101. package/dist/cjs/{use-export-wallet-Bln7maDs.js → use-export-wallet-CqCBNS7w.js} +1 -1
  102. package/dist/cjs/use-export-wallet-D-c4_YuN.js +1 -0
  103. package/dist/cjs/useActiveWallet-DiVVvDrc.js +185 -0
  104. package/dist/cjs/{useGetTokenPrice-62KL9-pY.js → useGetTokenPrice--7EaVoh2.js} +1 -1
  105. package/dist/cjs/{useI18n-CAzGX3fh.js → useI18n-BCObhUAf.js} +1 -1
  106. package/dist/cjs/usePrivy-C8r8d5n6.js +1 -0
  107. package/dist/cjs/{useSolanaRpcClient-CT_ce08U.js → useSolanaRpcClient-B5PLFTBV.js} +1 -1
  108. package/dist/cjs/useWalletBalance-B2tDjYdh.js +1 -0
  109. package/dist/cjs/useWallets-CYbllwnl.js +1 -0
  110. package/dist/cjs/{useWallets-7pxglx6q.js → useWallets-Ngfy6BRk.js} +1 -1
  111. package/dist/dts/{events-context-DpeYfJb8.d.mts → events-context-DJ7XN_9I.d.mts} +1 -1
  112. package/dist/dts/{events-context-DpeYfJb8.d.ts → events-context-DJ7XN_9I.d.ts} +1 -1
  113. package/dist/dts/extended-chains.d.mts +1 -1
  114. package/dist/dts/extended-chains.d.ts +1 -1
  115. package/dist/dts/farcaster.d.mts +1 -1
  116. package/dist/dts/farcaster.d.ts +1 -1
  117. package/dist/dts/index.d.mts +10 -4
  118. package/dist/dts/index.d.ts +10 -4
  119. package/dist/dts/internal.d.mts +1 -1
  120. package/dist/dts/internal.d.ts +1 -1
  121. package/dist/dts/smart-wallets.d.mts +1 -1
  122. package/dist/dts/smart-wallets.d.ts +1 -1
  123. package/dist/dts/solana.d.mts +3 -3
  124. package/dist/dts/solana.d.ts +3 -3
  125. package/dist/dts/{types-YrdexZMd.d.mts → types-CrwMc83t.d.mts} +10 -0
  126. package/dist/dts/{types-YrdexZMd.d.ts → types-CrwMc83t.d.ts} +10 -0
  127. package/dist/dts/ui.d.mts +1 -1
  128. package/dist/dts/ui.d.ts +1 -1
  129. package/dist/esm/AccountNotFoundScreen-DxCW4sYL.mjs +1 -0
  130. package/dist/esm/Address-gS9RaH_3.mjs +17 -0
  131. package/dist/esm/AffirmativeConsentScreen-BfAJLkHs.mjs +6 -0
  132. package/dist/esm/AllowlistRejectionScreen-CfIwm_KR.mjs +1 -0
  133. package/dist/esm/AuthenticateWithWalletScreen-CGMkVkqN.mjs +1 -0
  134. package/dist/esm/AwaitingEvmToSolBridgingScreen-BEhpNQue.mjs +2 -0
  135. package/dist/esm/AwaitingExternalEthereumTransferScreen-DXabkUmb.mjs +2 -0
  136. package/dist/esm/AwaitingPasswordlessCodeScreen-C8_6Jmdn.mjs +103 -0
  137. package/dist/esm/AwaitingSolToEvmBridgingScreen-DDeK6Ay4.mjs +2 -0
  138. package/dist/esm/BridgeNetworkSelectionView-BEkgkdcj.mjs +69 -0
  139. package/dist/esm/CaptchaScreen-AiG4L_WL.mjs +1 -0
  140. package/dist/esm/CoinbaseOnrampStatusScreen-B2Pe4vVR.mjs +16 -0
  141. package/dist/esm/ConnectEmailForm-xRPNNO6z.mjs +3 -0
  142. package/dist/esm/ConnectLedgerScreen-Op6Fai6R.mjs +9 -0
  143. package/dist/esm/ConnectOnlyLandingScreen-bnn4qrHH.mjs +1 -0
  144. package/dist/esm/ConnectOnlyStatusScreen-lSx84lvG.mjs +1 -0
  145. package/dist/esm/ConnectOrCreateScreen-CLmEnt_8.mjs +1 -0
  146. package/dist/esm/{ConnectPhoneForm-DTZTENXQ.mjs → ConnectPhoneForm-CyET5ztr.mjs} +1 -1
  147. package/dist/esm/{ConnectWalletView-DMLO1g28.mjs → ConnectWalletView-C7q7CJzF.mjs} +4 -4
  148. package/dist/esm/ConnectionStatusScreen-Day5J0Vy.mjs +7 -0
  149. package/dist/esm/CrossAppAuthScreen-CGctDoIE.mjs +1 -0
  150. package/dist/esm/{CustomLandingScreenView-JGe-GePA.mjs → CustomLandingScreenView-DDjvsORu.mjs} +6 -6
  151. package/dist/esm/DelegatedActionsConsentScreen-CziDKoEO.mjs +1 -0
  152. package/dist/esm/DelegatedActionsRevokeScreen-CGCYIB8S.mjs +1 -0
  153. package/dist/esm/EmbeddedWalletConnectingScreen-D5POWVph.mjs +1 -0
  154. package/dist/esm/EmbeddedWalletCreatedScreen-CBFugH74.mjs +1 -0
  155. package/dist/esm/{EmbeddedWalletKeyExportScreen-DdviAcYq.mjs → EmbeddedWalletKeyExportScreen-DvPo1Dqc.mjs} +3 -3
  156. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CiVZK25P.mjs +1 -0
  157. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-CK7LxxHa.mjs +1 -0
  158. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-Cqi_wMos.mjs +1 -0
  159. package/dist/esm/{EnrollTotp-COmXYzq5.mjs → EnrollTotp-KgOCncuG.mjs} +5 -5
  160. package/dist/esm/ErrorScreen-oC2GYZyz.mjs +4 -0
  161. package/dist/esm/{FarcasterConnectStatusScreen-BB7egF78.mjs → FarcasterConnectStatusScreen-BhZ_ibkr.mjs} +8 -8
  162. package/dist/esm/FarcasterSignerStatusScreen-LgZqqLIg.mjs +28 -0
  163. package/dist/esm/FundSolWalletWithExternalSolanaWallet-Bpbr58Rk.mjs +1 -0
  164. package/dist/esm/{FundWalletMethodHeader-DRH4o4R5.mjs → FundWalletMethodHeader-Cj0ejXEe.mjs} +1 -1
  165. package/dist/esm/{FundWithBankDepositScreen-wFJhtxMV.mjs → FundWithBankDepositScreen-D_Bvn9z-.mjs} +12 -12
  166. package/dist/esm/FundingEditAmountScreen-DHMuyuSU.mjs +1 -0
  167. package/dist/esm/FundingMethodSelectionScreen-ClAs5ybE.mjs +1 -0
  168. package/dist/esm/InAppBrowserLoginNotPossible-BTJOkFD8.mjs +1 -0
  169. package/dist/esm/InstallWalletScreen-MMyGad_h.mjs +1 -0
  170. package/dist/esm/LandingScreen-5Oa-RLB-.mjs +1 -0
  171. package/dist/esm/{LinkConflictScreen-CSZu5Mc7.mjs → LinkConflictScreen-CRUt3M0v.mjs} +3 -3
  172. package/dist/esm/LinkEmailScreen-BODpl3zv.mjs +1 -0
  173. package/dist/esm/{LinkPasskeyScreen-BfLq2-Q5.mjs → LinkPasskeyScreen-C8-qPCc0.mjs} +8 -8
  174. package/dist/esm/LinkPhoneScreen-BLeNeU6s.mjs +1 -0
  175. package/dist/esm/LoginFailedScreen-Db6M5P_W.mjs +1 -0
  176. package/dist/esm/ManualTransferScreen-B1K2GVns.mjs +1 -0
  177. package/dist/esm/MfaAuthEnrollmentFlowScreen-FPJhtPEX.mjs +1 -0
  178. package/dist/esm/MfaAuthVerifyFlowScreen-CWaZHYk3.mjs +1 -0
  179. package/dist/esm/MfaEnrollmentFlowScreen-BNsNSjMO.mjs +1 -0
  180. package/dist/esm/MfaVerifyFlowScreen-BiL-DDiE.mjs +1 -0
  181. package/dist/esm/{ModalHeader-JjfRejxC.mjs → ModalHeader-BO0_ew01.mjs} +6 -6
  182. package/dist/esm/MoonpayStatusScreen-CYJ55uJj.mjs +16 -0
  183. package/dist/esm/OAuthStatusScreen-CdyVmpfT.mjs +1 -0
  184. package/dist/esm/PasskeySelectSignupOrLogin-DknmFq5C.mjs +1 -0
  185. package/dist/esm/PasskeyStatusScreen-OJ7pdD7_.mjs +3 -0
  186. package/dist/esm/PasswordRecoveryScreen-B1gO8QHk.mjs +20 -0
  187. package/dist/esm/{QrCode-VCBMkqqq.mjs → QrCode-CkFpOhWR.mjs} +3 -3
  188. package/dist/esm/RecoveryOAuthStatusScreen-B-DJ0UpW.mjs +1 -0
  189. package/dist/esm/RecoveryPasswordCreateScreen-D4xjd6G2.mjs +1 -0
  190. package/dist/esm/{RecoverySelectionScreen-DfHkr07F.mjs → RecoverySelectionScreen-OaYDY3s0.mjs} +2 -2
  191. package/dist/esm/{Screen-DE3ldE_X.mjs → Screen-DEU9RkqZ.mjs} +3 -3
  192. package/dist/esm/{ScreenLayout-Ca6ml9wY.mjs → ScreenLayout-CBKj6lhP.mjs} +1 -1
  193. package/dist/esm/{SetAutomaticRecoveryScreen-Ol789UQM.mjs → SetAutomaticRecoveryScreen-CeCoPMb9.mjs} +2 -2
  194. package/dist/esm/{SetWalletPasswordForm-C2hZtfwu.mjs → SetWalletPasswordForm-DasvIAaE.mjs} +4 -4
  195. package/dist/esm/SignRequestScreen-DvMVqqRy.mjs +26 -0
  196. package/dist/esm/{StandardSignAndSendTransactionScreen-C8nW4u5b.mjs → StandardSignAndSendTransactionScreen-P41dVhUg.mjs} +3 -3
  197. package/dist/esm/TelegramAuthScreen-DDi3bZj8.mjs +1 -0
  198. package/dist/esm/{TransactionDetails-DkPozym_.mjs → TransactionDetails-TElXTRgE.mjs} +4 -4
  199. package/dist/esm/{TransactionErrorView-f1bQRoCZ.mjs → TransactionErrorView-nAvkCFbn.mjs} +7 -7
  200. package/dist/esm/{TransferFromWalletScreen-B8AzQgyG.mjs → TransferFromWalletScreen-DJHQToqB.mjs} +4 -4
  201. package/dist/esm/{TransferOrBridgeLoadingScreen-BKmOAmlN.mjs → TransferOrBridgeLoadingScreen-DfjuIpgw.mjs} +1 -1
  202. package/dist/esm/UpdateEmailScreen-BYYYeIGc.mjs +1 -0
  203. package/dist/esm/UpdatePhoneScreen-BK-lEzDy.mjs +1 -0
  204. package/dist/esm/UserLimitReachedScreen-DJ6LECFo.mjs +1 -0
  205. package/dist/esm/{WalletInfoCard-CuZCmvHw.mjs → WalletInfoCard-CvaU9hsg.mjs} +1 -1
  206. package/dist/esm/WalletInterstitialScreen-BBcEvRlE.mjs +1 -0
  207. package/dist/esm/{WalletLink-B12jNftF.mjs → WalletLink-CGTEPUiO.mjs} +5 -5
  208. package/dist/esm/{WalletOverflowButton-DJthXlpc.mjs → WalletOverflowButton-CYYzAWaD.mjs} +1 -1
  209. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  210. package/dist/esm/context-CE35zxmH.mjs +1 -0
  211. package/dist/esm/ethers-BQABFn4K.mjs +1 -0
  212. package/dist/esm/extended-chains.mjs +1 -1
  213. package/dist/esm/{get-is-unified-wallet-CMioBd5c.mjs → get-is-unified-wallet-Dy3_T-CK.mjs} +1 -1
  214. package/dist/esm/getErc20Balance-DsDepObC.mjs +1 -0
  215. package/dist/esm/{getErc20TokenInfo-1Q6w1Ibq.mjs → getErc20TokenInfo-CwIeNSfD.mjs} +1 -1
  216. package/dist/esm/{index-BAAWn9Kv.mjs → index-B5IXvf6Q.mjs} +3 -3
  217. package/dist/esm/{index-BpieExSM.mjs → index-BgDuUMhM.mjs} +1 -1
  218. package/dist/esm/index-CvRB3i5Y.mjs +174 -0
  219. package/dist/esm/index.mjs +1 -1
  220. package/dist/esm/internal.mjs +1 -1
  221. package/dist/esm/{shared-BcHk2XA3.mjs → shared-BU9j9DNx.mjs} +1 -1
  222. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BsPl2jCD.mjs → shouldProceedtoEmbeddedWalletCreationFlow-ifSse9fH.mjs} +1 -1
  223. package/dist/esm/smart-wallets-BfMsOCbS.mjs +1 -0
  224. package/dist/esm/smart-wallets.mjs +1 -1
  225. package/dist/esm/solana.mjs +1 -1
  226. package/dist/esm/{styles-Dr0J8BuN.mjs → styles-rdvIOTsj.mjs} +15 -15
  227. package/dist/esm/to-ui-error-D6Ur9EPb.mjs +4 -0
  228. package/dist/esm/ui.mjs +36 -36
  229. package/dist/esm/{use-export-wallet-CquCci1U.mjs → use-export-wallet-C8egaVlY.mjs} +1 -1
  230. package/dist/esm/use-export-wallet-CEsGQUX-.mjs +1 -0
  231. package/dist/esm/useActiveWallet-C-m0Q1tx.mjs +185 -0
  232. package/dist/esm/useGetTokenPrice-BPzXHAOr.mjs +1 -0
  233. package/dist/esm/{useI18n-BdIAB9oU.mjs → useI18n-D15_QND3.mjs} +1 -1
  234. package/dist/esm/usePrivy-BbA3ewrr.mjs +1 -0
  235. package/dist/esm/{useSolanaRpcClient-ign2YXAl.mjs → useSolanaRpcClient-BAT_UrqZ.mjs} +1 -1
  236. package/dist/esm/useWalletBalance-CCxr6ymL.mjs +1 -0
  237. package/dist/esm/{useWallets-DFA-9f9j.mjs → useWallets-C1MMwBpM.mjs} +1 -1
  238. package/dist/esm/useWallets-Ca4W6aLm.mjs +1 -0
  239. package/package.json +6 -6
  240. package/dist/cjs/AccountNotFoundScreen-tDR43oHW.js +0 -1
  241. package/dist/cjs/AffirmativeConsentScreen-BRBNsOWi.js +0 -6
  242. package/dist/cjs/AllowlistRejectionScreen-BHoYCH0v.js +0 -1
  243. package/dist/cjs/AuthenticateWithWalletScreen-CEggKX3g.js +0 -1
  244. package/dist/cjs/AwaitingEvmToSolBridgingScreen-BoYhV9tQ.js +0 -2
  245. package/dist/cjs/AwaitingExternalEthereumTransferScreen-Cz2k5mXb.js +0 -2
  246. package/dist/cjs/AwaitingPasswordlessCodeScreen-l9n3fNao.js +0 -103
  247. package/dist/cjs/AwaitingSolToEvmBridgingScreen-yuSZrlo8.js +0 -2
  248. package/dist/cjs/CaptchaScreen-BndC7zXe.js +0 -1
  249. package/dist/cjs/CoinbaseOnrampStatusScreen-BmZ1Zvaw.js +0 -16
  250. package/dist/cjs/ConnectEmailForm-Gz3TJQaS.js +0 -3
  251. package/dist/cjs/ConnectLedgerScreen-CTd4ew1b.js +0 -9
  252. package/dist/cjs/ConnectOnlyLandingScreen-BTm5z22a.js +0 -1
  253. package/dist/cjs/ConnectOnlyStatusScreen-JtIOf9tK.js +0 -1
  254. package/dist/cjs/ConnectOrCreateScreen-b6jwd3G9.js +0 -1
  255. package/dist/cjs/ConnectionStatusScreen-BlaYqHPV.js +0 -7
  256. package/dist/cjs/CrossAppAuthScreen-CLdpzOoL.js +0 -1
  257. package/dist/cjs/CustomLandingScreenView-C7uyw9AS.js +0 -23
  258. package/dist/cjs/DelegatedActionsConsentScreen-C66Qamby.js +0 -1
  259. package/dist/cjs/DelegatedActionsRevokeScreen-WnC6Ml_O.js +0 -1
  260. package/dist/cjs/EmbeddedWalletConnectingScreen-Lf8XU72H.js +0 -1
  261. package/dist/cjs/EmbeddedWalletCreatedScreen-DQjc2aO5.js +0 -1
  262. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-Cl21QlpI.js +0 -1
  263. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DyznRBRm.js +0 -1
  264. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-BzIflp1Z.js +0 -1
  265. package/dist/cjs/ErrorScreen-CkOQuqz_.js +0 -4
  266. package/dist/cjs/FarcasterSignerStatusScreen-BepAag3F.js +0 -29
  267. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-G5WWMpKM.js +0 -2
  268. package/dist/cjs/FundingEditAmountScreen-CVPt0UFO.js +0 -1
  269. package/dist/cjs/FundingMethodSelectionScreen-Bfs4t9ic.js +0 -1
  270. package/dist/cjs/InAppBrowserLoginNotPossible-AwBNR0cT.js +0 -1
  271. package/dist/cjs/InstallWalletScreen-B6Hbb2zf.js +0 -1
  272. package/dist/cjs/LandingScreen-B1FOnI7l.js +0 -1
  273. package/dist/cjs/LinkEmailScreen-Cbrn-OnF.js +0 -1
  274. package/dist/cjs/LinkPhoneScreen-jLla569a.js +0 -1
  275. package/dist/cjs/LoginFailedScreen-DbW_n3Ud.js +0 -1
  276. package/dist/cjs/ManualTransferScreen-DcMiPTb7.js +0 -1
  277. package/dist/cjs/MfaAuthEnrollmentFlowScreen-CVROFlbO.js +0 -1
  278. package/dist/cjs/MfaAuthVerifyFlowScreen-CzvKJxko.js +0 -1
  279. package/dist/cjs/MfaEnrollmentFlowScreen-BC4nUEqe.js +0 -1
  280. package/dist/cjs/MfaVerifyFlowScreen-BEIBzXix.js +0 -1
  281. package/dist/cjs/MoonpayStatusScreen-DTHwGL_G.js +0 -16
  282. package/dist/cjs/OAuthStatusScreen-1ErCNKnQ.js +0 -1
  283. package/dist/cjs/PasskeySelectSignupOrLogin-DajoZ9ZQ.js +0 -1
  284. package/dist/cjs/PasskeyStatusScreen-CbNToK-f.js +0 -3
  285. package/dist/cjs/PasswordRecoveryScreen-HSt33MHO.js +0 -20
  286. package/dist/cjs/RecoveryOAuthStatusScreen-C9roBryy.js +0 -1
  287. package/dist/cjs/RecoveryPasswordCreateScreen-D1zbL15z.js +0 -1
  288. package/dist/cjs/TelegramAuthScreen-DxF54ZK7.js +0 -1
  289. package/dist/cjs/TransferFromWalletScreen-B1iYTL4A.js +0 -31
  290. package/dist/cjs/UpdateEmailScreen-Ci24R0Wi.js +0 -1
  291. package/dist/cjs/UpdatePhoneScreen-C5s7Q1Uq.js +0 -1
  292. package/dist/cjs/UserLimitReachedScreen-DSozFkdB.js +0 -1
  293. package/dist/cjs/WalletInterstitialScreen-D2r6qjUr.js +0 -1
  294. package/dist/cjs/WalletLink-BHFIodVQ.js +0 -22
  295. package/dist/cjs/ethers-CjXeDhFm.js +0 -1
  296. package/dist/cjs/getErc20Balance-D2jXMvJ8.js +0 -1
  297. package/dist/cjs/getErc20TokenInfo-DxDd_HN6.js +0 -1
  298. package/dist/cjs/getPublicClient-BsmZyCGX.js +0 -1
  299. package/dist/cjs/index-BioFA041.js +0 -12
  300. package/dist/cjs/index-tQ5GebzM.js +0 -174
  301. package/dist/cjs/smart-wallets-DL8bKJhE.js +0 -1
  302. package/dist/cjs/use-export-wallet-BIBOLyrr.js +0 -1
  303. package/dist/cjs/useActiveWallet-CbC_e7T4.js +0 -185
  304. package/dist/cjs/usePrivy-Dl1Nx5y2.js +0 -1
  305. package/dist/cjs/useWalletBalance-DI8AY31i.js +0 -1
  306. package/dist/cjs/useWallets-CGZli1jq.js +0 -1
  307. package/dist/esm/AccountNotFoundScreen-CeH1-Vk6.mjs +0 -1
  308. package/dist/esm/Address-D-q_5it9.mjs +0 -17
  309. package/dist/esm/AffirmativeConsentScreen-CXITm_N9.mjs +0 -6
  310. package/dist/esm/AllowlistRejectionScreen-lgFXWCYE.mjs +0 -1
  311. package/dist/esm/AuthenticateWithWalletScreen-m06-fuCA.mjs +0 -1
  312. package/dist/esm/AwaitingEvmToSolBridgingScreen-CckTG9KA.mjs +0 -2
  313. package/dist/esm/AwaitingExternalEthereumTransferScreen-eF2GWu8M.mjs +0 -2
  314. package/dist/esm/AwaitingPasswordlessCodeScreen-BOBPSamI.mjs +0 -103
  315. package/dist/esm/AwaitingSolToEvmBridgingScreen-P3cpg0C5.mjs +0 -2
  316. package/dist/esm/BridgeNetworkSelectionView-C74EH50n.mjs +0 -69
  317. package/dist/esm/CaptchaScreen-B3Ykiq24.mjs +0 -1
  318. package/dist/esm/CoinbaseOnrampStatusScreen-w23Wg5d9.mjs +0 -16
  319. package/dist/esm/ConnectEmailForm-DQUiQNyc.mjs +0 -3
  320. package/dist/esm/ConnectLedgerScreen-CeefF4eo.mjs +0 -9
  321. package/dist/esm/ConnectOnlyLandingScreen-DsUmsQqW.mjs +0 -1
  322. package/dist/esm/ConnectOnlyStatusScreen-BWSDA11j.mjs +0 -1
  323. package/dist/esm/ConnectOrCreateScreen-2uZYB3jh.mjs +0 -1
  324. package/dist/esm/ConnectionStatusScreen-DC1viuqC.mjs +0 -7
  325. package/dist/esm/CrossAppAuthScreen-BBpfShQF.mjs +0 -1
  326. package/dist/esm/DelegatedActionsConsentScreen-BcanXrk2.mjs +0 -1
  327. package/dist/esm/DelegatedActionsRevokeScreen-CEToWbrk.mjs +0 -1
  328. package/dist/esm/EmbeddedWalletConnectingScreen-CTdp8K5o.mjs +0 -1
  329. package/dist/esm/EmbeddedWalletCreatedScreen-BEBjX0Mt.mjs +0 -1
  330. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-eKriq-Nq.mjs +0 -1
  331. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-BAlUIAfz.mjs +0 -1
  332. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-DX_WQZdd.mjs +0 -1
  333. package/dist/esm/ErrorScreen-V8ec2dKP.mjs +0 -4
  334. package/dist/esm/FarcasterSignerStatusScreen-DE_ssKid.mjs +0 -28
  335. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DAhHczol.mjs +0 -1
  336. package/dist/esm/FundingEditAmountScreen-kwQjuyb9.mjs +0 -1
  337. package/dist/esm/FundingMethodSelectionScreen-CbxUWw1v.mjs +0 -1
  338. package/dist/esm/InAppBrowserLoginNotPossible-BR9y7vrg.mjs +0 -1
  339. package/dist/esm/InstallWalletScreen-DkaJ2iZK.mjs +0 -1
  340. package/dist/esm/LandingScreen-BtCc-4_K.mjs +0 -1
  341. package/dist/esm/LinkEmailScreen-CMX1b5QU.mjs +0 -1
  342. package/dist/esm/LinkPhoneScreen-CGYAeavW.mjs +0 -1
  343. package/dist/esm/LoginFailedScreen-DpfFaY7V.mjs +0 -1
  344. package/dist/esm/ManualTransferScreen-D3CPPofR.mjs +0 -1
  345. package/dist/esm/MfaAuthEnrollmentFlowScreen-YWkK-71P.mjs +0 -1
  346. package/dist/esm/MfaAuthVerifyFlowScreen-BIGip6ll.mjs +0 -1
  347. package/dist/esm/MfaEnrollmentFlowScreen-XrdyfmmI.mjs +0 -1
  348. package/dist/esm/MfaVerifyFlowScreen-2H1EX_qQ.mjs +0 -1
  349. package/dist/esm/MoonpayStatusScreen-CqsI_vjN.mjs +0 -16
  350. package/dist/esm/OAuthStatusScreen-DB8OcP_K.mjs +0 -1
  351. package/dist/esm/PasskeySelectSignupOrLogin-DCaGA7kA.mjs +0 -1
  352. package/dist/esm/PasskeyStatusScreen-5cLO3m8F.mjs +0 -3
  353. package/dist/esm/PasswordRecoveryScreen-Bfqx2sWJ.mjs +0 -20
  354. package/dist/esm/RecoveryOAuthStatusScreen-CScuB-aG.mjs +0 -1
  355. package/dist/esm/RecoveryPasswordCreateScreen-BRb1syw7.mjs +0 -1
  356. package/dist/esm/SignRequestScreen-CUMcsLye.mjs +0 -26
  357. package/dist/esm/TelegramAuthScreen-jb192MAl.mjs +0 -1
  358. package/dist/esm/UpdateEmailScreen-deteEdyS.mjs +0 -1
  359. package/dist/esm/UpdatePhoneScreen-D3RSZlDk.mjs +0 -1
  360. package/dist/esm/UserLimitReachedScreen-QT4sbDev.mjs +0 -1
  361. package/dist/esm/WalletInterstitialScreen-DPTs9K3X.mjs +0 -1
  362. package/dist/esm/context-CcPjcQxY.mjs +0 -1
  363. package/dist/esm/ethers-VWEScvge.mjs +0 -1
  364. package/dist/esm/getErc20Balance-DA4dGV9O.mjs +0 -1
  365. package/dist/esm/getPublicClient-B4uPLKn-.mjs +0 -1
  366. package/dist/esm/index-DMvly1BH.mjs +0 -174
  367. package/dist/esm/smart-wallets-C245MBMI.mjs +0 -1
  368. package/dist/esm/to-ui-error-CmP4i4IC.mjs +0 -4
  369. package/dist/esm/use-export-wallet-BzM2a8Is.mjs +0 -1
  370. package/dist/esm/useActiveWallet-CHY4WQdQ.mjs +0 -185
  371. package/dist/esm/useGetTokenPrice-PWP-Uiot.mjs +0 -1
  372. package/dist/esm/usePrivy-DK1coOrO.mjs +0 -1
  373. package/dist/esm/useWalletBalance-CDyi5_iR.mjs +0 -1
  374. package/dist/esm/useWallets-rvM1mjSi.mjs +0 -1
@@ -1,2 +0,0 @@
1
- import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as l}from"viem";import{ConnectedStandardSolanaWallet as d}from"@privy-io/js-sdk-core";import{b as c,c as m,R as u}from"./Layouts-BlFm53ED.mjs";import{B as p}from"./ModalHeader-JjfRejxC.mjs";import{C as f}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as h}from"./FundWalletMethodHeader-DRH4o4R5.mjs";import{N as g}from"./index-Dq_xe9dz.mjs";import{u as v,t as w}from"./context-CcPjcQxY.mjs";import{u as I,a as y,b as C}from"./internal-context-Z-fyxadS.mjs";import{Q as T,a6 as j}from"./useActiveWallet-CHY4WQdQ.mjs";import{a as S}from"./get-is-unified-wallet-CMioBd5c.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as b,t as N,d as F,a as U,b as E,u as x}from"./reservoir-0wfhnc0j.mjs";import{u as k}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as W}from"./usePrivy-DK1coOrO.mjs";import{T as R}from"./TransferOrBridgeLoadingScreen-BKmOAmlN.mjs";import{t as L}from"./use-export-wallet-BzM2a8Is.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-rvM1mjSi.mjs";import"@privy-io/are-addresses-equal";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Row-C9vrS4Zi.mjs";import"./Value-tcJV9e0L.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./Address-D-q_5it9.mjs";import"lucide-react";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"eventemitter3";const P={component:function(){let P=v(),{closePrivyModal:B,createAnalyticsEvent:D,connectors:$}=I(),{navigate:H,setModalData:M,data:q}=S(),O=v(),_=o(!1),Q=k(),[G,V]=a(!1),[z,X]=a(!1),[Y,J]=a(null),[K,Z]=a(),[ee,te]=a();if(!q?.funding||"ethereum"!==q.funding.chainType)throw Error("Invalid funding data");let{amount:ne,connectedWallet:re,chain:oe,solanaChain:ae,isUSDC:ie}=q.funding,se=q.funding.address,le=q.funding.erc20Address,de=q.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,ce=i((()=>"solana"===re?.type?re.provider:function({connectors:e,connectedWalletAddress:t}){let n=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),r=n?.wallet.accounts.find((e=>e.address===t));if(!n||!r)throw new y("Unable to find source wallet connector");return new d({wallet:n.wallet,account:r})}({connectors:$,connectedWalletAddress:re?.address||""})),[re,$]),me=i((()=>{let e=Q(W);if(!e)throw new y("Unable to load solana plugin");let t=P.solanaRpcs["solana:mainnet"];if(!t)throw new y("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),ue=T(L(ce?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!ce||!oe||_.current)return;let e=Q(W);if(!e)return void J(new y("Unable to solana plugin"));_.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(ne):l(ne),n=await b({isTestnet:!!oe.testnet,input:N({appId:O.id,amount:t.toString(),user:ce.address,recipient:se,destinationChainId:oe.id,originChainId:E,originCurrency:ie?F:U,destinationCurrency:ie?le:void 0})}).catch(console.error);if(!n)return void J(new y(`Unable to fetch quotes for bridging. Wallet ${j(ce.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE));let r=await e.createTransactionFromRelayQuote({quote:n,source:ce.address,solanaClient:me});if(r)try{V(!0);let t=await e.simulateTransaction({solanaClient:me,tx:r});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))):void J(new y(`Wallet ${j(ce?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${de} are needed to complete the transaction.`,void 0,C.INSUFFICIENT_BALANCE));let{signature:o}=await ce.signAndSendTransaction({chain:"solana:mainnet",transaction:r}),a=e.getAddressFromBuffer(o);Z(a),te("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void J(new y("Transaction was rejected by the user",void 0,C.TRANSACTION_FAILURE));J(new y("Something went wrong",void 0,C.TRANSACTION_FAILURE))}else J(new y(`Unable to select bridge option from quotes. Wallet ${j(ce.address)} does not have enough funds.`,void 0,C.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),x({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){V(!1),X(!0),D({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:ce.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:ne,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){V(!1),J(e)}}),s((()=>{if(!z)return;let e=setTimeout(B,w);return()=>clearTimeout(e)}),[z]),s((()=>{Y&&(M({funding:q?.funding,solanaFundingData:q?.solanaFundingData,sendTransaction:q?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),H("ErrorScreen",!1))}),[Y]),z?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(c,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(r,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(f,{title:"Success!",description:`You’ve successfully added ${ne} ${de} to your ${O.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):G&&ce?/*#__PURE__*/t(R,{walletClientType:L(ce?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:G,isErc20Flow:!1,chainId:oe.id,chainName:oe.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
2
- /*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(g,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(p,{})]})}};export{P as AwaitingSolToEvmBridgingScreen,P as default};
@@ -1,69 +0,0 @@
1
- import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as a,formatWalletAddress as o}from"@privy-io/js-sdk-core";import{a as i}from"./getPublicClient-B4uPLKn-.mjs";import{g as n}from"./getErc20Balance-DA4dGV9O.mjs";import{jsx as t,jsxs as s,Fragment as c}from"react/jsx-runtime";import{useRef as m}from"react";import{c as l,B as d}from"./ModalHeader-JjfRejxC.mjs";import{b as h,R as p}from"./Layouts-BlFm53ED.mjs";import{t as u}from"./FundWalletMethodHeader-DRH4o4R5.mjs";import{R as f}from"./Row-C9vrS4Zi.mjs";import{E as g}from"./ErrorMessage-D8VaAP5m.mjs";import{V as b,L as y}from"./Value-tcJV9e0L.mjs";import{S as v}from"./Subtitle-CV-2yKE4.mjs";import{T as j}from"./Title-BnzYV3Is.mjs";import w from"@heroicons/react/24/outline/WalletIcon";import{styled as C}from"styled-components";import{g as x}from"./getChainName-DjpPdUSc.mjs";import{C as k}from"./Chip-D2-wZOHJ.mjs";import{N}from"./NetworkIcon-B48ilzF8.mjs";import{B as T,a as B}from"./shared-FM0rljBt.mjs";import{Menu as $,MenuButton as A,MenuItems as I,MenuItem as S}from"@headlessui/react";import E from"@heroicons/react/24/outline/ChevronDownIcon";import{f as F}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{g as P}from"./ethers-VWEScvge.mjs";import{F as M,a as L,b as R,c as U,d as W}from"./styles-Dr0J8BuN.mjs";const H=({chains:o,appId:t,address:s,rpcConfig:c,includeUsdc:m})=>Promise.all(o.map((async o=>{let l=e({chain:o,transport:r(i(o,c,t))}),d=await l.getBalance({address:s}).catch((()=>0n)),h=null,p=a[o.id];if(m&&p){let{balance:e}=await n({address:s,chain:o,rpcConfig:c,appId:t,erc20Address:p});h=e}return{balance:d,erc20Balance:h,erc20Address:p,chain:o}}))),Q=({balance:e,className:r,chain:a})=>/*#__PURE__*/t(T,{className:r,$state:void 0,children:/*#__PURE__*/t(V,{balance:e,chain:a})}),V=({balance:e,chain:r})=>/*#__PURE__*/s(c,{children:[/*#__PURE__*/s(q,{children:[/*#__PURE__*/t(D,{chainId:"object"==typeof r?r.id:"solana"}),/*#__PURE__*/t(b,{children:"object"==typeof r?r.name:x(r)})]}),/*#__PURE__*/s(k,{isLoading:!1,isPulsing:!1,color:"gray",children:[/*#__PURE__*/t(z,{children:/*#__PURE__*/t(w,{})}),e]})]});let q=C.div`
2
- display: flex;
3
- align-items: center;
4
- `,z=C.div`
5
- height: 0.75rem;
6
- width: 0.75rem;
7
- margin-right: 0.2rem;
8
- `,D=C(N)`
9
- height: 1.25rem;
10
- width: 1.25rem;
11
- display: inline-block;
12
- margin-right: 0.5rem;
13
- border-radius: 4px;
14
- `;const O=({options:e,onSelect:r,selected:a,className:o})=>/*#__PURE__*/s($,{as:Y,children:[/*#__PURE__*/s(A,{as:X,children:[/*#__PURE__*/t(V,{balance:a.balance,chain:a.chain}),/*#__PURE__*/t(K,{height:16})]}),/*#__PURE__*/t(I,{as:G,className:o,children:e.map(((e,a)=>/*#__PURE__*/t(S,{as:J,onClick:()=>r(a),children:/*#__PURE__*/t(V,{balance:e.balance,chain:e.chain})},a)))})]});let Y=C.div`
15
- width: 100%;
16
- position: relative;
17
- `,G=C.div`
18
- width: 100%;
19
- margin-top: 0.5rem;
20
- position: absolute;
21
- background-color: var(--privy-color-background);
22
- border-radius: var(--privy-border-radius-md);
23
- overflow-x: hidden;
24
- overflow-y: auto;
25
- box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
26
- max-height: 11.75rem;
27
-
28
- && {
29
- border: solid 1px var(--privy-color-foreground-4);
30
- }
31
-
32
- z-index: 1;
33
- `,J=C.button`
34
- width: 100%;
35
- display: flex;
36
- justify-content: space-between;
37
-
38
- && {
39
- padding: 1rem;
40
- }
41
-
42
- :not(:last-child) {
43
- border-bottom: solid 1px var(--privy-color-foreground-4);
44
- }
45
-
46
- :hover {
47
- background: var(--privy-color-background-2);
48
- }
49
- `,K=C(E)`
50
- height: 1rem;
51
- margin-left: 0.5rem;
52
- `,X=C.button`
53
- ${B}
54
-
55
- /* Push the chip all the way to the right */
56
- span {
57
- margin-left: auto;
58
- }
59
-
60
- ${K} {
61
- transition: rotate 100ms ease-in;
62
- }
63
-
64
- &[aria-expanded='true'] {
65
- ${K} {
66
- rotate: -180deg;
67
- }
68
- }
69
- `;const Z=({displayName:e,errorMessage:r,configuredFundingChain:a,formattedBalance:i,fundingAmount:n,fundingCurrency:b,fundingAmountInUsd:w,options:C,selectedOption:k,isPreparing:N,isSubmitting:T,addressToFund:B,fundingWalletAddress:$,onSubmit:A,onSelect:I,onAmountChange:S,erc20ContractInfo:E})=>{let H=m(null);/*#__PURE__*/return s(c,{children:[/*#__PURE__*/t(u,{}),/*#__PURE__*/t(h,{}),/*#__PURE__*/t(j,{children:"Transfer from another network"}),/*#__PURE__*/s(v,{children:["You need more funds on the"," ","object"==typeof a?a.name:x(a)," ","network. Bridge from another blockchain network."]}),/*#__PURE__*/s(M,{style:{marginTop:"2rem"},children:[/*#__PURE__*/s(L,{onClick:()=>H.current?.focus(),children:[/*#__PURE__*/t(R,{ref:H,value:n,onChange:e=>{let r=e.target.value;if(/^[0-9.]*$/.test(r)&&r.split(".").length-1<=1){let e=/\.$/.test(r)?".":"",a=Number(r.replace(/\.$/,"")||"0");if(Number.isNaN(a))return void S("0");S(a.toString()+e)}}}),/*#__PURE__*/t(U,{children:b})]}),w&&/*#__PURE__*/t(W,{children:w})]}),/*#__PURE__*/s(f,{style:{marginTop:"1.5rem"},children:[/*#__PURE__*/t(y,{children:"From"}),/*#__PURE__*/t(y,{children:o($)})]}),/*#__PURE__*/t(O,{selected:{chain:k.chain,balance:k.isErc20Quote?F({amount:k.erc20Balance??0n,decimals:E?.decimals??6})+` ${E?.symbol||""}`:P(k.balance,k.chain.nativeCurrency.symbol,3,!0)},options:C.map((({chain:e,balance:r,isErc20Quote:a,erc20Balance:o})=>({chain:e,balance:a?F({amount:o??0n,decimals:E?.decimals??6})+` ${E?.symbol||""}`:P(r,e.nativeCurrency.symbol,3,!0)}))),onSelect:I}),/*#__PURE__*/s(f,{style:{marginTop:"1.5rem"},children:[/*#__PURE__*/t(y,{children:"To"}),/*#__PURE__*/t(y,{children:o(B)})]}),/*#__PURE__*/t(Q,{chain:a,balance:i}),/*#__PURE__*/t(g,{style:{marginTop:"1rem"},children:r}),/*#__PURE__*/s(l,{style:{marginTop:"1rem"},loading:T||N,disabled:N||T,onClick:A,children:["Confirm with ",e]}),/*#__PURE__*/t(p,{}),/*#__PURE__*/t(d,{})]})};export{Z as B,H as g};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as s,useEffect as a}from"react";import{a as n,C as c}from"./index-DMvly1BH.mjs";import{a as m}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as u}from"./ScreenLayout-Ca6ml9wY.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"./context-CcPjcQxY.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const p=({status:o,title:s,description:a,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),y=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:y,title:s,subtitle:a,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:y,reset:g,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[f,C]=s(!0);a((()=>(j(setTimeout(C,1e3,!1)),()=>{v.current.forEach((e=>clearTimeout(e))),v.current=[]})),[]);let[b,w]=s(""),[k,R]=s("Checking that you are a human..."),[S,x]=s(!1),[I,T]=s(3),P=r?.captchaModalData,q=async e=>{try{await(P?.callback(e)),P?.onSuccessNavigateTo&&i(P?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(P?.onErrorNavigateTo||"ErrorScreen",!1)}};a((()=>{"success"===l?j(setTimeout((async()=>{let e=await y();!e||P?.userIntentRequired||q(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),a((()=>{if(!f)switch(l){case"success":w("Success!"),R("CAPTCHA passed successfully."),P?.userIntentRequired||setTimeout((()=>{x(!0),q(d)}),2e3);break;case"loading":w(""),R("Checking that you are a human...");break;case"error":w("Something went wrong"),R(I<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,f,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:k,userIntentRequired:P?.userIntentRequired,retriesRemaining:I,hasSelectedCta:S,onContinue:()=>{x(!0),q(d)},onRetry:async()=>{if(I<=0)return;T((e=>e-1)),g(),h();let e=await y();!e||P?.userIntentRequired||q(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
@@ -1,16 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{M as l,B as d,P as p}from"./ModalHeader-JjfRejxC.mjs";import{a as u}from"./Layouts-BlFm53ED.mjs";import{L as g,a7 as f}from"./useActiveWallet-CHY4WQdQ.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as v}from"./get-is-unified-wallet-CMioBd5c.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{I as b}from"./index-DMvly1BH.mjs";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:p,createAnalyticsEvent:u,client:g}=h(),[f,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:k,popup:I}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===f||"pending-after-flow"===f){let e=setInterval((async()=>{if(k)try{let{status:e}=await g.getCoinbaseOnRampStatus({partnerUserId:k});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");I?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),u({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[k,I,f]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:f,onClickCta:p}),/*#__PURE__*/t(d,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(I,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(u,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(k,{children:a})]})]}),s&&/*#__PURE__*/t(p,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(g,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(f,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},k=m.p`
2
- font-size: 1rem;
3
- color: var(--privy-color-foreground-3);
4
- margin-bottom: 1rem;
5
- display: flex;
6
- flex-direction: column;
7
- gap: 1rem;
8
- `,I=m.div`
9
- display: flex;
10
- flex-direction: column;
11
- align-items: center;
12
- justify-content: center;
13
- margin-left: 1.75rem;
14
- margin-right: 1.75rem;
15
- padding: 2rem 0;
16
- `;export{w as CoinbaseOnrampStatusScreen,w as default};
@@ -1,3 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as a}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-CcPjcQxY.mjs";import{u as m,c,b as d}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./index-DMvly1BH.mjs";import{u,a as h}from"./get-is-unified-wallet-CMioBd5c.mjs";import{F as g,a1 as f,V as y}from"./useActiveWallet-CHY4WQdQ.mjs";import{E,P as S}from"./ModalHeader-JjfRejxC.mjs";import{C as b}from"./Chip-D2-wZOHJ.mjs";import{I as v,a as k}from"./EmailInputForm-Dgoii4vf.mjs";import{E as j}from"./ErrorMessage-D8VaAP5m.mjs";const C=/*#__PURE__*/t(((t,l)=>{let[y,v]=o(t.defaultValue||""),[k,C]=o(""),[T,A]=o(!1),{authenticated:D}=u(),{initLoginWithEmail:L}=m(),{navigate:M,setModalData:I,currentScreen:U,data:F}=h(),{enabled:N,token:W}=p(),[R,V]=o(!1),{accountType:_}=g(),q=s();n((()=>{!y&&q.disablePlusEmails&&F?.inlineError?.error instanceof c&&F?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!k&&C("Please enter a valid email address without a '+'."),k&&C("")}),[y]);let H=f(y),K=T||!H,O=()=>{var e;I({login:F?.login,inlineError:void 0}),!N||W||D?(e=W,A(!0),L({email:y,captchaToken:e,disableSignup:F?.login?.disableSignup,withPrivyUi:!0}).then((()=>{M("AwaitingPasswordlessCodeScreen")})).catch((e=>{I({errorModalData:{error:e,previousScreen:U||"LandingScreen"}}),M("ErrorScreen")})).finally((()=>{A(!1)}))):(I({captchaModalData:{callback:e=>L({email:y,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),M("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(w,{children:[k&&/*#__PURE__*/a(j,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:k}),/*#__PURE__*/e(x,{stacked:t.stacked,$error:!!k,children:[/*#__PURE__*/a(P,{children:/*#__PURE__*/a(i,{})}),/*#__PURE__*/a("input",{ref:l,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>V(!0),onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&O()},value:y,autoComplete:"email"}),"email"!==_||R?t.stacked?/*#__PURE__*/a("span",{}):/*#__PURE__*/a(E,{isSubmitting:T,onClick:O,disabled:K,children:"Submit"}):/*#__PURE__*/a(b,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/a(S,{loadingText:null,loading:T,disabled:K,onClick:O,style:{width:"100%"},children:"Submit"}):null]})}));let w=v,x=k,P=l(y)`
2
- display: inline-flex;
3
- `;export{C};
@@ -1,9 +0,0 @@
1
- import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as n}from"./ScreenLayout-Ca6ml9wY.mjs";import{H as m}from"./index-DMvly1BH.mjs";import"@privy-io/are-addresses-equal";import"react";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";const s=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),p=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:p="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:p,subtitle:/*#__PURE__*/t(u,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(s,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(p,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=o.div`
2
- display: flex;
3
- align-items: center;
4
- justify-content: center;
5
- gap: 8px;
6
- margin-bottom: var(--screen-space);
7
- `,u=o.span`
8
- white-space: pre-wrap;
9
- `;export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,p as ConnectLedgerScreenView,c as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-CcPjcQxY.mjs";import{u as r,c as n,b as a}from"./internal-context-Z-fyxadS.mjs";import{a as i}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./get-is-unified-wallet-CMioBd5c.mjs";import{i as c}from"./ConnectWalletView-DMLO1g28.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-VCBMkqqq.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BdIAB9oU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),u=i(),C=s?.externalConnectWallet?.description,j=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),E=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:j.current,walletChainType:E.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{u("connectWallet","onError",a.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{u("connectWallet","onSuccess",{wallet:t});let o=s?.externalConnectWallet?.onCompleteNavigateTo;o?p(o({address:t.address,walletClientType:e?.walletClientType,walletChainType:e?.chainType})):m()},onConnectError:e=>{e instanceof n?(console.warn(e.cause?e.cause:e.message),u("connectWallet","onError",e.privyErrorCode||a.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),u("connectWallet","onError",a.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:C,app:d,connectOnly:!0})},isUnauthenticatedScreem:!0};export{m as ConnectOnlyLandingScreen,m as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as i}from"./use-export-wallet-BzM2a8Is.mjs";import{q as n}from"./context-CcPjcQxY.mjs";import{Q as a}from"./useActiveWallet-CHY4WQdQ.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as c}from"./ScreenLayout-Ca6ml9wY.mjs";import{B as m}from"./index-DMvly1BH.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-DC1viuqC.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./Link-DJ5gq9Di.mjs";import"./useI18n-BdIAB9oU.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-BsPl2jCD.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:n,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:n,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===i.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:m,watermark:!0}),d={component:()=>{let i,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[C,h]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,R="switching_to_supported_chain"===j?.status;o((()=>{if(S){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=j.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&j.connector){let e=j.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:j.connector?.walletClientType,walletChainType:j.connector?.chainType}))}),n)}else e=setTimeout(v,n);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,h(p(e)))}),[j]);let T=j?.connector?.connectorType||"injected",W=j?.connector?.walletClientType||"unknown",B=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",E=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),M="Browser Extension"===B?B.toLowerCase():B;i=S?`Successfully connected with ${M}`:C?C.message:R?"Switching networks":`Waiting for ${M}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&C?_="Unable to connect wallet":C?_=C.detail:R?_="Switch your wallet to the requested network.":"metamask"===W&&r?_="Click to continue to open and connect MetaMask.":"metamask"===W?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===T?_="Open your mobile wallet app to continue":"coinbase_wallet"===T&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:B,walletLogo:E,success:S,errorMessage:C,title:i,subtitle:_,onRetry:()=>{b(k+1),h(void 0),j?.connectRetry()},onUseDifferentWallet:c,onBack:f===w?void 0:c,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-CcPjcQxY.mjs";import{C as r,L as i}from"./CustomLandingScreenView-JGe-GePA.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-CMioBd5c.mjs";import"@privy-io/are-addresses-equal";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-DMvly1BH.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ConnectWalletView-DMLO1g28.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-VCBMkqqq.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BdIAB9oU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";import"./ConnectEmailForm-DQUiQNyc.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-DTZTENXQ.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-DJthXlpc.mjs";import"./ScreenLayout-Ca6ml9wY.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
@@ -1,7 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as l}from"react-device-detect";import{styled as c}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-DMvly1BH.mjs";import{L as g}from"./Link-DJ5gq9Di.mjs";import{u as w,q as h}from"./context-CcPjcQxY.mjs";import{u as S}from"./useI18n-BdIAB9oU.mjs";import{C as y,P as f,g as C}from"./use-export-wallet-BzM2a8Is.mjs";import{Q as b,k as v,T}from"./useActiveWallet-CHY4WQdQ.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,k as A}from"./internal-context-Z-fyxadS.mjs";import{u as W,a as L}from"./get-is-unified-wallet-CMioBd5c.mjs";import{s as j}from"./shouldProceedtoEmbeddedWalletCreationFlow-BsPl2jCD.mjs";import{u as I}from"./PrivyPluginContext-2QN2dVUw.mjs";import{e as U}from"./usePrivy-DK1coOrO.mjs";import{S as O}from"./ScreenLayout-Ca6ml9wY.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-rvM1mjSi.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"tinycolor2";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>E(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const M=e=>e?.privyErrorCode===R.LINKED_TO_ANOTHER_USER?y.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?y.ERROR_TIMED_OUT:e?.privyErrorCode===R.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,x=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:l,connectSuccess:c,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:b,onCoinbaseReset:v,onDifferentWallet:T})=>{let{t:_}=S(),E=w?{label:"Use a different wallet",onClick:v,disabled:r}:l===y.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:c&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&l?.retryable&&h<2?{label:"Retry",onClick:b,disabled:!1}:r||l?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!l},primaryCta:E,onBack:f,watermark:!0,children:!c&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,c]=a(!1),[g,f]=a(!1),[C,_]=a(void 0),{authenticated:E,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:H}=L(),X=w(),{t:z}=S(),{getAuthFlow:Q,walletConnectionStatus:Y,closePrivyModal:K,initLoginWithWallet:V,loginWithWallet:G,updateWallets:J,createAnalyticsEvent:$}=k(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=I(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[le,ce]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=b(Y?.connector?.walletClientType||"unknown"),we=l&&"wallet_connect_v2"===Y?.connector?.connectorType||l&&"coinbase_wallet"===Y?.connector?.connectorType||l&&"base_account"===Y?.connector?.connectorType||l&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||l&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=Q(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?V(Y.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>V(Y.connectedWallet,e,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&H?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),_(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(X?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(j(ne,X.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),$({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}J();let t=setTimeout((()=>K({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==R.ALLOWLIST_REJECTED){if(e?.privyErrorCode===R.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==R.USER_DOES_NOT_EXIST)return e?.privyErrorCode===R.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:Q()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Q()?.meta.walletClientType,chainId:Q()?.meta.chainId,connectorType:Q()?.meta.connectorType},linkMethod:Q()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await G(),c(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&ce(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",be=Y?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===ve?ve.toLowerCase():ve;t=n?z("connectionStatus.successfullyConnected",{walletName:_e}):C?z("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=z("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:Se?Ee="Switch your wallet to the requested network.":he&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&l?Ee="Click continue to open and connect MetaMask.":"metamask"===be?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):H?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:le,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=c.p`
2
- text-align: center;
3
- color: var(--privy-color-foreground-2);
4
- font-size: 14px;
5
- line-height: 22px;
6
- margin: 16px 0;
7
- `;export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-CcPjcQxY.mjs";import{R as s}from"./index-DMvly1BH.mjs";import{u as n,a as c,e as p,b as l}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CMioBd5c.mjs";import{z as d}from"./useActiveWallet-CHY4WQdQ.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-BsPl2jCD.mjs";import{S as f}from"./ScreenLayout-Ca6ml9wY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-rvM1mjSi.mjs";import"./use-export-wallet-BzM2a8Is.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:g,onUserCloseViaDialogOrKeybindRef:y}=m(),{crossAppAuthFlow:j,updateWallets:A,closePrivyModal:b,createAnalyticsEvent:S}=n(),{logout:w}=d(),[C,I]=o({}),T=f?.crossAppAuth,U=new c(`There was an issue connecting your ${T?.name} account. Please try again.`),x=new s((async e=>{if(T?.popup)try{let t=await j({appId:e,popup:T.popup,action:T.action,disableSignup:T.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return g({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${T.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");T.popup&&T.popup.close(),I({error:U})}else I({error:U})}else I({error:U})})),k=()=>{C.data&&(A(),T?.onSuccess(C.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),T?.onError(C.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return y.current=k,r((()=>{T?.appId?.length&&x.execute(T.appId)}),[T?.appId]),r((()=>{if(!C.data)return;let e=C.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{g({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),S({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${T?.appId}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(k,a);return()=>clearTimeout(o)}),[C.data]),T?.appId?/*#__PURE__*/e(h,{providerApp:{id:T?.appId,logoUrl:T?.logoUrl,name:T?.name},success:!!C.data,error:C.error,onClose:k}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as s,useEffect as i}from"react";import{W as a}from"./WalletInfoCard-CuZCmvHw.mjs";import{u as n,r as c}from"./context-CcPjcQxY.mjs";import{u as m,a as l}from"./internal-context-Z-fyxadS.mjs";import{a as p}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as u}from"./ScreenLayout-Ca6ml9wY.mjs";import"styled-components";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-D-q_5it9.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const d=({appName:s,address:i,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${s}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${s} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:i,title:"Wallet"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=s(!1),[j,f]=s(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return i((()=>{if(!a&&!j)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:j,onAccept:async()=>{try{await g(),u(!0)}catch(e){f(e)}},onDecline:()=>{v()},onClose:v})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-CcPjcQxY.mjs";import{u as c,a as m}from"./internal-context-Z-fyxadS.mjs";import{a as l}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as p}from"./ScreenLayout-Ca6ml9wY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-JjfRejxC.mjs";import"styled-components";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[y,f]=i(),{onRevoke:v,onSuccess:k,onError:j}=o.delegatedActions.revoke,w=async()=>{p?k():j(y??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!y)return;let e=setTimeout(w,a);return()=>clearTimeout(e)}),[p,y]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:y,onRevoke:async()=>{try{await v(),d(!0)}catch(e){f(e)}},onDeny:()=>{w()},onClose:w})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-DMvly1BH.mjs";import{u as s}from"./internal-context-Z-fyxadS.mjs";import{u as l,a as c}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as m}from"./ScreenLayout-Ca6ml9wY.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"./context-CcPjcQxY.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const p=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:P,recoveryMethod:S,connectingWalletAddress:F,isUnifiedWallet:T=!1}=f?.connectWallet,W=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return W("User must be authenticated and have a Privy wallet before it can be connected");try{if(!T){if(!x||!P)return W("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:P})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===S){let e=await d.getAccessToken();if(!e)return W("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:F}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:P}));t?.entropyId||W(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F}}),h(A)}catch(e){W("An error has occurred, please try again.")}}else a(e)&&"privy"!==S&&"privy-v2"!==S?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:P,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:S,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(S))):W(e)}})(),()=>clearTimeout(e)):void 0:W("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{W("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,c as s,d as c}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as a,r as n}from"./context-CcPjcQxY.mjs";import{u as m}from"./internal-context-Z-fyxadS.mjs";import{S as l}from"./ScreenLayout-Ca6ml9wY.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-JjfRejxC.mjs";import"styled-components";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=m(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:y,callAuthOnSuccessOnClose:w}=j.createWallet,x=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):y(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:w})};o((()=>{let e=setTimeout(x,n);return()=>clearTimeout(e)}),[]),f.current=x;let A=p&&!((t?.linkedAccounts?.length??0)>1);/*#__PURE__*/return e(u,{title:A?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:A?"You've successfully created an account.":"Your account is secured.",onClose:x})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{generateWalletIdempotencyKey as i}from"@privy-io/js-sdk-core";import{u as a}from"./context-CcPjcQxY.mjs";import{F as s,s as l,k as n,v as m,G as c,R as d}from"./index-DMvly1BH.mjs";import{u as p,m as u}from"./internal-context-Z-fyxadS.mjs";import{a as h,u as y}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as w}from"./PrivyPluginContext-2QN2dVUw.mjs";import{S as v}from"./ScreenLayout-Ca6ml9wY.mjs";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const C=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(v,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),g={component:()=>{let{setModalData:t,navigate:v,data:g,onUserCloseViaDialogOrKeybindRef:j}=h(),f=a(),[b,S]=r(""),{embeddedWallets:x}=a(),{authenticated:W,user:O}=y(),{closePrivyModal:A,walletProxy:k,client:P}=p(),{onSuccess:I,onFailure:M,callAuthOnSuccessOnClose:R,shouldCreateEth:U,shouldCreateSol:E}=g.createWallet,L=w(),F=O?L(s)?.shouldCreateWallet({user:O}):void 0,K=!!O&&l(O,f.embeddedWallets.ethereum.createOnLogin,F),T=!!O&&n(O,f.embeddedWallets.solana.createOnLogin,F),V="legacy-embedded-wallets-only"===f.embeddedWallets.mode&&!0===f?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[q,D]=r(null),{create:G}=m(),z=U??K,H=E??T,Q=new d((async()=>{let e=await P.getAccessToken();if(O&&e&&k)try{let e,t=await i(O.id,"ethereum"),r=await i(O.id,"solana");if(z&&H)e=await G({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t}),e=await G({chainType:"solana",walletIndex:0,latestUser:e.user,idempotencyKey:r});else if(H)e=await G({chainType:"solana",walletIndex:0,latestUser:O,idempotencyKey:r});else{if(!z)return void A({shouldCallAuthOnSuccess:R});e=await G({chainType:"ethereum",walletIndex:0,latestUser:O,idempotencyKey:t})}D(e),v("EmbeddedWalletCreatedScreen")}catch(e){S(e.message)}}));return o((()=>W&&O?V?(t({...g,createWallet:{...g.createWallet,shouldCreateEth:z,shouldCreateSol:H},recoverySelection:{...g?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:z,shouldCreateSol:H}}),v(c({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:x.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void Q.execute():(v("LandingScreen"),void M(Error("User must be authenticated before creating a Privy wallet")))),[V,W]),j.current=()=>null/*#__PURE__*/,e(C,{errorMessage:b||void 0,onClose:()=>{q?(I(q),A({shouldCallAuthOnSuccess:R})):(M(new u("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))}})}};export{g as EmbeddedWalletOnAccountCreateScreen,C as EmbeddedWalletOnAccountCreateView,g as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as i}from"./context-CcPjcQxY.mjs";import{u as n,o as d,m as c}from"./internal-context-Z-fyxadS.mjs";import{g as l}from"./useWallets-rvM1mjSi.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-C2hZtfwu.mjs";import"@privy-io/are-addresses-equal";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"styled-components";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./shared-BcHk2XA3.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-CHmc4-Lu.mjs";const u={component:()=>{let[u,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:A,user:I}=t(),{client:M,walletProxy:j,refreshSessionAndUser:C,closePrivyModal:R,createAnalyticsEvent:b}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:N}=x.setWalletPassword,D=a(I),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===D?.recoveryMethod;r((()=>{A||(P("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[A]);let T=()=>v?(N(v),void R({shouldCallAuthOnSuccess:!1})):O?(k(u),void R({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>_(p()),onPasswordChange:_,onSubmit:async()=>{O?(k(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&j)try{b({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await C(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void b({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),b({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),b({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-Z-fyxadS.mjs";import{a}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as m}from"./ScreenLayout-Ca6ml9wY.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-JjfRejxC.mjs";import"styled-components";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const c=({onClose:i,onProceed:s})=>/*#__PURE__*/e(m,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),n={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:m}=a(),{onFailure:n}=t.setWalletPassword,l=()=>{n(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return m.current=l,/*#__PURE__*/e(c,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{n as EmbeddedWalletPasswordUpdateSplashScreen,c as EmbeddedWalletPasswordUpdateSplashView,n as default};
@@ -1,4 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{AlertTriangle as i,Phone as a,Lock as o}from"lucide-react";import{styled as n}from"styled-components";import{u as s}from"./context-CcPjcQxY.mjs";import{a as c,P as l}from"./index-DMvly1BH.mjs";import{c as m,b as p,a as d,e as u}from"./internal-context-Z-fyxadS.mjs";import{a as T}from"./get-is-unified-wallet-CMioBd5c.mjs";import{R as g}from"./reservoir-0wfhnc0j.mjs";import{S as y}from"./ScreenLayout-Ca6ml9wY.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"@privy-io/are-addresses-equal";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const h=({error:n,allowlistConfig:s,onRetry:c,onCaptchaReset:T,onBack:h})=>{let f=((n,s)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof d)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof u&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:s.errorTitle||"You don't have access to this app",detail:s.errorDetail||"Have you been invited?",ctaText:s.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,s);/*#__PURE__*/return t(y,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:h,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&T?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&s.errorCtaLink)?window.location.href=s.errorCtaLink:c?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=T(),o=s(),{reset:n}=c(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(h,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
2
- color: var(--privy-color-accent) !important;
3
- font-weight: 600;
4
- `;export{f as ErrorScreen,h as ErrorScreenView,f as default};
@@ -1,28 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as a}from"react";import{isMobile as i,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-DSTf_eKU.mjs";import{L as c}from"./useActiveWallet-CHY4WQdQ.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-VCBMkqqq.mjs";import{u as d,q as u}from"./context-CcPjcQxY.mjs";import{u as g}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as h}from"./ScreenLayout-Ca6ml9wY.mjs";import{F as v}from"./farcaster-DPlSjvF5.mjs";import"zustand";import"./use-export-wallet-BzM2a8Is.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"qrcode";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:a,errorMessage:n,connectUri:d,onBack:u,onClose:g,onOpenFarcaster:f})=>/*#__PURE__*/e(h,i||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},primaryCta:d&&f?{label:"Open Farcaster app",onClick:f}:void 0,onBack:u,onClose:g,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:v,iconVariant:"loading",iconLoadingStatus:{success:a,fail:!!n},onBack:u,onClose:g,watermark:!0,children:d&&i&&/*#__PURE__*/e(w,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:g,watermark:!0,children:/*#__PURE__*/t(j,{children:[/*#__PURE__*/e(x,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:v}):/*#__PURE__*/e(S,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(b,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let w=n.div`
2
- margin-top: 24px;
3
- `,j=n.div`
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- gap: 24px;
8
- `,x=n.div`
9
- padding: 24px;
10
- position: relative;
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- min-height: 275px;
15
- `,C=n.div`
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- gap: 16px;
20
- `,b=n.div`
21
- font-size: 0.875rem;
22
- text-align: center;
23
- color: var(--privy-color-foreground-2);
24
- `,S=n.div`
25
- position: relative;
26
- width: 82px;
27
- height: 82px;
28
- `;const F={component:()=>{let{lastScreen:t,navigateBack:i,data:s}=f(),n=d(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=g(),[m,p]=r(void 0),[h,v]=r(!1),[y,w]=r(!1),j=o([]),x=s?.farcasterSigner;a((()=>{let e=Date.now(),t=setInterval((async()=>{if(!x?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===x.status&&(clearInterval(t),v(!1),w(!0),j.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(x?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),v(!1),w(!0),j.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u))):o>3e5?(clearInterval(t),p({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),p({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),j.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===x?.status?x.signer_approval_url:void 0;/*#__PURE__*/return e(k,{appName:n.name,loading:h,success:y,errorMessage:m,connectUri:C,onBack:t?i:void 0,onClose:c,onOpenFarcaster:()=>{C&&(window.location.href=C)}})}};export{F as FarcasterSignerStatusScreen,k as FarcasterSignerStatusView,F as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as s}from"@privy-io/js-sdk-core";import{B as i,P as l}from"./ModalHeader-JjfRejxC.mjs";import{b as m,c,R as d,e as u}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-DRH4o4R5.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-Dq_xe9dz.mjs";import{L as I,V as w}from"./Value-tcJV9e0L.mjs";import{a as v,R as S}from"./Row-C9vrS4Zi.mjs";import{u as j,t as C}from"./context-CcPjcQxY.mjs";import{u as y,a as L,b as x}from"./internal-context-Z-fyxadS.mjs";import{a as k}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as F,g as U}from"./useWallets-DFA-9f9j.mjs";import{u as T}from"./useGetTokenPrice-PWP-Uiot.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as W}from"@solana-program/system";import{pipe as b,createTransactionMessage as P,setTransactionMessageFeePayerSigner as D,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as O,compileTransaction as E,getTransactionEncoder as M}from"@solana/kit";import{findAssociatedTokenPda as B,getCreateAssociatedTokenIdempotentInstruction as $,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as G,g as V}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as q}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as _,f as z,s as Q,w as X}from"./useSolanaRpcClient-ign2YXAl.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{t as J}from"./use-export-wallet-BzM2a8Is.mjs";import"styled-components";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-B4uPLKn-.mjs";import"./useWallets-rvM1mjSi.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./usePrivy-DK1coOrO.mjs";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";function K({rows:a}){/*#__PURE__*/return e(v,{children:a.filter((e=>!!e)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/t(S,{children:[/*#__PURE__*/e(I,{children:a.label}),/*#__PURE__*/e(w,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(e){return BigInt(Math.floor(1e9*parseFloat(e)))}function ee(e){return+te.format(parseFloat(e.toString())/1e9)}let te=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function ae({tx:e,solanaClient:t,amount:a,asset:n,tokenPrice:o}){if(!e)return null;if("SOL"===n&&o){let n=Z(a),r=V(n,o),s=await z({solanaClient:t,tx:e});return{amountInUsd:r,feeInUsd:o?V(s,o):void 0,totalInUsd:V(n+s,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:t,tx:e}),s=function(e,t){let a=parseFloat(e.toString())/G*t;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:V(r,o),totalInUsd:"$"+(parseFloat(a)+s).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:t,tx:e});return{amountInSol:a+" SOL",feeInSol:ee(o)+" SOL",totalInSol:ee(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:ee(await z({solanaClient:t,tx:e}))+" SOL"}}const ne={component:function(){let I=j(),{closePrivyModal:w,createAnalyticsEvent:v}=y(),{data:S,setModalData:G,navigate:z}=k(),{wallets:ee}=F(),[te,ne]=o("preparing"),[oe,re]=o(),[se,ie]=o(),[le,me]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ce,asset:de,chain:ue,sourceWalletData:pe,destinationAddress:fe,afterSuccessScreen:ge}=S.solanaFundingData,he=ee.find((e=>e.address===pe.address&&J(pe.walletClientType)===J(e.standardWallet.name))),Ie=_()(ue),{tokenPrice:we,isTokenPriceLoading:ve}=T("solana");return r((()=>{if("preparing"!==te||ve||!he)return;let e="SOL"===de?Z(ce):function(e){return BigInt(Math.floor(1e6*parseFloat(e)))}(ce);ie({amount:("SOL"===de&&we?V(e,we):ce)??ce}),("SOL"===de?async function({solanaClient:e,source:t,destination:a,amountInLamports:n}){let{value:o}=await e.rpc.getLatestBlockhash().send(),r={address:t},s=b(P({version:0}),(e=>D(r,e)),(e=>N(o,e)),(e=>O(W({amount:n,source:r,destination:a}),e)),(e=>E(e)));return new Uint8Array(M().encode(s))}({solanaClient:Ie,source:he.address,destination:fe,amountInLamports:e}):async function({solanaClient:e,source:t,destination:a,amountInBaseUnits:n}){let o=q(e.chain),{value:r}=await e.rpc.getLatestBlockhash().send(),s={address:t},[i]=await B({mint:o,owner:t,tokenProgram:H}),[l]=await B({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([e.rpc.getAccountInfo(i,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${t}`);let d=$({payer:s,ata:l,owner:a,mint:o}),u=b(P({version:0}),(e=>D(s,e)),(e=>N(r,e)),(e=>c?.value?e:O(d,e)),(e=>O(R({source:i,destination:l,authority:s,amount:n}),e)),(e=>E(e)));return new Uint8Array(M().encode(u))}({solanaClient:Ie,source:he.address,destination:fe,amountInBaseUnits:e})).then(re).catch((e=>{ne("error"),me(e)}))}),[te,ce,de,ue,he,fe,ve,we]),r((()=>{"preparing"===te&&oe&&ae({tx:oe,solanaClient:Ie,amount:ce,asset:de,tokenPrice:we}).then((e=>{ne("loaded"),ie({amount:e?.amountInUsd??e?.amountInUsdc??e?.amountInSol??ce,fee:e?.feeInUsd??e?.feeInSol,total:e?.totalInUsd??e?.totalInSol})})).catch((e=>{ne("error"),me(e)}))}),[oe,ce,de,te,we]),r((()=>{"error"===te&&le&&(G({errorModalData:{error:le,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:S.solanaFundingData}),z("ErrorScreen",!1))}),[te,z]),r((()=>{if("success"!==te)return;let e=setTimeout(ge?()=>z(ge):w,C);return()=>clearTimeout(e)}),[te]),/*#__PURE__*/t(a,"success"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(m,{}),/*#__PURE__*/t(c,{children:[/*#__PURE__*/e(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/e(p,{title:"Success!",description:`You’ve successfully added ${ce} ${de} to your ${I.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/e(d,{}),/*#__PURE__*/e(i,{})]}:"preparing"===te||"loaded"===te||"sending"===te?{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(u,{style:{marginTop:"16px"},children:/*#__PURE__*/e(g,{icon:he?.standardWallet.icon,name:he?.standardWallet.name})}),/*#__PURE__*/e(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===te&&he?`Confirming with ${he.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/e(K,{rows:[{label:"Source",value:s(pe.address)},{label:"Destination",value:s(fe)},{label:"Network",value:Y(ue)},{label:"Amount",value:se?.amount,isLoading:"preparing"===te},{label:"Estimated fee",value:se?.fee,isLoading:"preparing"===te},{label:"Total",value:se?.total,isLoading:"preparing"===te}]}),/*#__PURE__*/e(l,{style:{marginTop:"1rem"},loading:"preparing"===te||"sending"===te,onClick:function(){"loaded"===te&&oe&&he&&(ne("sending"),async function({transaction:e,chain:t,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:e});if(!o)throw new L(`Wallet ${s(a.address)} does not have enough funds.`,void 0,x.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:e,chain:t}).catch((e=>{throw new L("Transaction was rejected by the user",e,x.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:Ie,transaction:oe,chain:ue,sourceWallet:he}).then((e=>{ne("success"),v({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:he.address,value:ce,chainType:"solana",clusterName:ue,token:de,destinationAddress:fe,destinationValue:ce,destinationChainType:"solana",destinationClusterName:ue,destinationToken:de}})})).catch((e=>{ne("error"),me(e)})))},children:"Confirm"}),/*#__PURE__*/e(i,{})]}:{children:[/*#__PURE__*/e(f,{}),/*#__PURE__*/e(h,{}),/*#__PURE__*/e("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/e(i,{})]})}};export{ne as FundSolWalletWithExternalSolanaWallet,ne as default};
@@ -1 +0,0 @@
1
- import{jsxs as t,Fragment as e,jsx as o}from"react/jsx-runtime";import{useRef as r}from"react";import{c as i,B as n}from"./ModalHeader-JjfRejxC.mjs";import{F as s}from"./Layouts-BlFm53ED.mjs";import{t as a}from"./FundWalletMethodHeader-DRH4o4R5.mjs";import{N as m}from"./index-Dq_xe9dz.mjs";import{T as c}from"./Title-BnzYV3Is.mjs";import{a as l}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as p}from"./useGetTokenPrice-PWP-Uiot.mjs";import{c as d}from"./ethers-VWEScvge.mjs";import{F as u,a as h,h as j,c as f,d as v}from"./styles-Dr0J8BuN.mjs";import"styled-components";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@privy-io/are-addresses-equal";import"./useGetSolPrice-DwwjjGbd.mjs";import"./LinkPasskeyScreen-BfLq2-Q5.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-Ca6ml9wY.mjs";import"./Screen-DE3ldE_X.mjs";const y={component:()=>{let{data:y,setModalData:C}=l(),g=y?.funding,k="solana"===g.chainType,x=r(null),{tokenPrice:S}=p(k?"solana":g.chain.id),D=k?void 0:g,F=!(!D?.erc20Address||D?.erc20ContractInfo),T=k?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",L=parseFloat(g.amount),A=!isNaN(L)&&L>0,I=S?d(g.amount,S):void 0;/*#__PURE__*/return t(e,{children:[/*#__PURE__*/o(a,{}),/*#__PURE__*/o(c,{children:"Confirm or edit amount"}),/*#__PURE__*/t(s,{style:{marginTop:"32px"},children:[/*#__PURE__*/o(u,{children:F?/*#__PURE__*/o(m,{size:"50px"}):/*#__PURE__*/t(e,{children:[/*#__PURE__*/t(h,{onClick:()=>x.current?.focus(),children:[/*#__PURE__*/o(j,{ref:x,value:g.amount,onChange:t=>{let e=t.target.value;/^[0-9.]*$/.test(e)&&e.split(".").length-1<=1&&C({...y,funding:{...g,amount:e},solanaFundingData:y?.solanaFundingData?{...y.solanaFundingData,amount:e}:void 0})}}),/*#__PURE__*/o(f,{children:T})]}),!D?.erc20Address&&!(k&&g.isUSDC)&&/*#__PURE__*/o(v,{children:I&&A?`${I} USD`:""})]})}),/*#__PURE__*/o(i,{style:{marginTop:"1rem"},disabled:!A,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/o(n,{})]})}};export{y as FundingAmountEditScreen,y as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as n,Fragment as t}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-JjfRejxC.mjs";import{t as p}from"./FundWalletMethodHeader-DRH4o4R5.mjs";import{E as h}from"./ErrorBanner-CQERa7bL.mjs";import{I as m}from"./InfoBanner-DkQEPd77.mjs";import{u}from"./context-CcPjcQxY.mjs";import{v as f,Q as g,U as y}from"./useActiveWallet-CHY4WQdQ.mjs";import{a as v,u as C}from"./internal-context-Z-fyxadS.mjs";import{a as w}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as F}from"./useWallets-rvM1mjSi.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-1Q6w1Ibq.mjs";import{monadMainnet as S,avalanche as W,arbitrum as x,polygon as I,optimism as j,base as T,mainnet as D,toCoinbaseAssetId as k,getCoinbaseOnRampUrl as A,chainToMoonpayCurrency as L,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as E}from"@privy-io/js-sdk-core";import{trigger as U}from"@privy-io/popup";import{a as O}from"./index-BpieExSM.mjs";import{e as _,I as H,f as P,g as B}from"./styles-Dr0J8BuN.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-BfLq2-Q5.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-Ca6ml9wY.mjs";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const R=n=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...n,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),V=t=>/*#__PURE__*/n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...t,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),q=e=>{let[n,t]=r();return c((()=>{e().then((e=>{t(e)})).catch((()=>{}))}),[]),n};function N(e){let n=Q[e];if(!n)throw new v(`Unsupported chainId: ${e} for Coinbase Onramp`);return n}let Q={[D.id]:"ethereum",[T.id]:"base",[j.id]:"optimism",[I.id]:"polygon",[x.id]:"arbitrum",[W.id]:"avacchain",[S.id]:"monad"};const $=(e,n,t,a,i,o)=>new Promise((async(r,c)=>{let d=U();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===n.chainType?N(n.chain.id):"solana",l=n.isUSDC?"USDC":"ethereum"===n.chainType?k(n.chain.id,"native-currency"):"SOL",p=await e.initCoinbaseOnRamp({addresses:[{address:n.address,blockchains:[s]}],assets:[l]}),{url:h}=A({appId:e.getAppId(),input:p,amount:n.amount,blockchain:s,asset:l,experience:o});d.location=h.toString();let m={...i?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(m.usingDefaultFundingMethod=!1),t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),setTimeout((()=>{t({funding:m,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:p.partner_user_id,popup:d}})}),5e3),r()})),G=async(e,n,t,a,i,o,r,c)=>{let d=U();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===n.chainType?L(n.chain.id,a):n.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:p}=await e.signMoonpayOnRampUrl({address:n.address,useSandbox:t.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:t.appearance.palette.accent,theme:t.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:O(n.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:n.amount,chainType:n.chainType,chainId:"ethereum"===n.chainType?n.chain.id:n.chain}}),d.location=l;let h={...r?.funding,showAlternateFundingMethod:!0};n.usingDefaultFundingMethod&&(h.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:h,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:p},funding:h,solanaFundingData:r?.solanaFundingData})}),8e3)};let X=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const J=()=>X("https://apple.com/apple-pay"),K=()=>X("https://google.com/pay"),Y={component:()=>{let{wallets:r}=F(),{connectors:v}=C(),S=v.filter(f).flatMap((e=>e.wallets)),{navigate:W,data:x,setModalData:I}=w(),{client:j}=C(),T=u(),D=x?.funding,k=q(J),A=q(K),L="solana"===D.chainType,U=L?void 0:D,O=d((()=>((e,n,t,a,i,o)=>{let r,c,d="solana"===t.chainType,s=d?void 0:t,l=t.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",p=!!d||l&&z(Number(t.chain.id),l),h=!!d||l&&E(Number(t.chain.id),l),m=[];for(let r of(t.preferredCardProvider&&t.supportedOptions.sort((e=>e.provider===t.preferredCardProvider?-1:1)),t.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&h&&m.push((()=>$(n,t,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&p&&l&&m.push((()=>G(n,t,e,l,a,i,o,"credit_debit_card")));for(let e of t.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&h&&(r=()=>$(n,t,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:m,onFundWithExchange:r,onFundWithWallet:c}})(T,j,D,I,W,x)),[T,j,D,x,I,W]),N=L?S.find((({address:e})=>e===D.address)):r.find((({address:e})=>s(e)===s(D.address))),Q=g(N?.walletClientType||"unknown"),X=Q?.name||"wallet",Y=N&&"privy"!==N.walletClientType?X:T.name,Z=d((()=>D.uiConfig?.landing?.title?D.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[D.uiConfig?.landing?.title,Y]);c((()=>{if(D?.defaultFundingMethod&&D.usingDefaultFundingMethod)switch(I({funding:{...D,usingDefaultFundingMethod:!1},solanaFundingData:x?.solanaFundingData}),D?.defaultFundingMethod){case"card":O.onFundWithCard[0]&&O.onFundWithCard[0]();break;case"exchange":O.onFundWithExchange&&O.onFundWithExchange();break;case"wallet":O.onFundWithWallet&&O.onFundWithWallet();break;case"manual":W("ManualTransferScreen")}}),[]),c((()=>{U?.erc20Address&&!U.erc20ContractInfo&&b({address:U.erc20Address,chain:U.chain,rpcConfig:T.rpcConfig,privyAppId:T.id}).then((e=>{I({...x,funding:{...U,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[U?.erc20Address,U?.chain]);let ee=!(!U?.erc20Address||U?.erc20ContractInfo);/*#__PURE__*/return n(t,{children:[/*#__PURE__*/e(p,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/n(_,{children:[D.errorMessage&&/*#__PURE__*/e(h,{theme:T.appearance.palette.colorScheme,children:D.errorMessage}),O.onFundWithCard?.[0]&&/*#__PURE__*/n(y,{disabled:ee,onClick:O.onFundWithCard[0],children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",k?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):A?/*#__PURE__*/e(V,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),O.onFundWithExchange&&/*#__PURE__*/n(y,{disabled:ee,onClick:O.onFundWithExchange,children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),O.onFundWithWallet&&/*#__PURE__*/n(y,{disabled:ee,onClick:O.onFundWithWallet,children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/n(y,{disabled:ee,onClick:()=>W("ManualTransferScreen"),children:[/*#__PURE__*/e(H,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),D?.showAlternateFundingMethod&&O.onFundWithCard?.[1]&&/*#__PURE__*/e(m,{theme:T.appearance.palette.colorScheme,children:/*#__PURE__*/n(P,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(B,{onClick:O.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{Y as FundingMethodSelectionScreen,Y as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{ExternalLink as o}from"lucide-react";import{u as e}from"./internal-context-Z-fyxadS.mjs";import{S as r}from"./ScreenLayout-Ca6ml9wY.mjs";import"ofetch";import"react";import"./ModalHeader-JjfRejxC.mjs";import"styled-components";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-CMioBd5c.mjs";import"@privy-io/are-addresses-equal";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:e})=>/*#__PURE__*/t(r,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:o,primaryCta:{label:"Close",onClick:e},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=e();/*#__PURE__*/return t(i,{onClose:()=>o()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{L as o}from"./Link-DJ5gq9Di.mjs";import{T as i,a as l}from"./TodoList-CgrU7uwu.mjs";import{a}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as n}from"./ScreenLayout-Ca6ml9wY.mjs";import"styled-components";import"lucide-react";import"react";import"@privy-io/are-addresses-equal";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const s=({walletName:a,installLink:s,title:m,subtitle:c="Follow the instructions below to get started.",onReload:p,onBack:d})=>{let u=m||`Create a ${a} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:u,subtitle:c,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:p},helpText:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(o,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(l,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(o,{href:s,target:"_blank",children:[a," browser extension"]})]})}),/*#__PURE__*/t(l,{children:"Set up your first wallet"}),/*#__PURE__*/t(l,{children:"Store your recovery phrase in a safe place!"})]})})},m={component:()=>{let{navigateBack:e,data:r}=a();if(!r?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:o}=r.installWalletModalData;/*#__PURE__*/return t(s,{walletName:o.name,installLink:o.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{m as InstallWalletScreen,s as InstallWalletScreenView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{u as r}from"./context-CcPjcQxY.mjs";import{C as o,L as i}from"./CustomLandingScreenView-JGe-GePA.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-JjfRejxC.mjs";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"eventemitter3";import"viem/utils";import"./get-is-unified-wallet-CMioBd5c.mjs";import"@privy-io/are-addresses-equal";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-DMvly1BH.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ConnectWalletView-DMLO1g28.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"./CopyableText-BCytXyJL.mjs";import"lucide-react";import"./Link-DJ5gq9Di.mjs";import"./QrCode-VCBMkqqq.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-BdIAB9oU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";import"./ConnectEmailForm-DQUiQNyc.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-DTZTENXQ.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-DJthXlpc.mjs";import"./ScreenLayout-Ca6ml9wY.mjs";const e={component:()=>{let e=r();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(o,{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-DQUiQNyc.mjs";import{B as i}from"./Layouts-BlFm53ED.mjs";import{u as e}from"./context-CcPjcQxY.mjs";import{S as m}from"./ScreenLayout-Ca6ml9wY.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./index-DMvly1BH.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"./get-is-unified-wallet-CMioBd5c.mjs";import"@privy-io/are-addresses-equal";import"eventemitter3";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"tinycolor2";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/t(m,{title:e,subtitle:p,icon:o,watermark:!0,children:/*#__PURE__*/t(i,{children:/*#__PURE__*/t(r,{stacked:!0})})}),s={component:()=>{let o=e();/*#__PURE__*/return t(p,{subtitle:`Add your email to your ${o?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import e from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-DTZTENXQ.mjs";import{u as i}from"./context-CcPjcQxY.mjs";import{u as n}from"./internal-context-Z-fyxadS.mjs";import{a as m}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as a}from"./ScreenLayout-Ca6ml9wY.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"./ModalHeader-JjfRejxC.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"@privy-io/are-addresses-equal";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null),l=async()=>{c?.qualifiedPhoneNumber&&await m(c)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:e,primaryCta:{label:s?"Submitting":"Submit",onClick:l,disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/t(r,{onChange:t=>{u(t)},onSubmit:l,noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:e,data:r,navigate:a,setModalData:c}=m(),u=i(),{initLoginWithSms:l}=n(),[p,d]=o(!1);/*#__PURE__*/return t(s,{subtitle:`Add your number to your ${u?.name} account`,onSubmit:async t=>{d(!0);try{await l({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){c({errorModalData:{error:t,previousScreen:r?.errorModalData?.previousScreen||e||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as LinkPhoneScreen,s as LinkPhoneScreenView,c as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{XCircle as e}from"lucide-react";import{u as o}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-CMioBd5c.mjs";import{S as i}from"./ScreenLayout-Ca6ml9wY.mjs";import"ofetch";import"react";import"@privy-io/are-addresses-equal";import"./context-CcPjcQxY.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-JjfRejxC.mjs";import"styled-components";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";const a=({title:o="Could not connect with wallet",subtitle:r="Please check that Phantom multichain is enabled and try again.",primaryCtaText:a="Try again",secondaryCtaText:n="Cancel",onTryAgain:m,onCancel:c})=>/*#__PURE__*/t(i,{title:o,subtitle:r,icon:e,iconVariant:"error",primaryCta:{label:a,onClick:m},secondaryCta:{label:n,onClick:c},watermark:!0}),n={component:()=>{let{closePrivyModal:e}=o(),{navigate:i}=r();/*#__PURE__*/return t(a,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await e()}})}};export{n as LoginFailedScreen,a as LoginFailedScreenView,n as default};
@@ -1 +0,0 @@
1
- import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as i,useMemo as s}from"react";import{formatUnits as a}from"viem";import{formatTokenAmount as n,formatWeiAmount as m}from"@privy-io/js-sdk-core";import{P as c,B as d}from"./ModalHeader-JjfRejxC.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-VCBMkqqq.mjs";import{t as u}from"./FundWalletMethodHeader-DRH4o4R5.mjs";import{I as f}from"./InfoBanner-DkQEPd77.mjs";import{S as h}from"./Subtitle-CV-2yKE4.mjs";import{T as v}from"./Title-BnzYV3Is.mjs";import{W as g}from"./WalletInfoCard-CuZCmvHw.mjs";import{u as y}from"./context-CcPjcQxY.mjs";import{v as j,D as C}from"./useActiveWallet-CHY4WQdQ.mjs";import{u as S}from"./internal-context-Z-fyxadS.mjs";import{a as I}from"./get-is-unified-wallet-CMioBd5c.mjs";import{u as T}from"./useWalletBalance-CDyi5_iR.mjs";import{u as b}from"./useWallets-rvM1mjSi.mjs";import{O as w}from"./analytics-mkkvFRju.mjs";import{x as A,z as k}from"./index-DMvly1BH.mjs";import{g as D}from"./getChainName-DjpPdUSc.mjs";import{g as F}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as M}from"./transaction-CnfuREWo.mjs";import{g as U}from"./getErc20Balance-DA4dGV9O.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-D-q_5it9.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"@privy-io/are-addresses-equal";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const x={component:()=>{let{wallets:k}=b(),{connectors:x}=S(),$=x.filter(j).flatMap((e=>e.wallets)),{data:E,setModalData:L,navigate:P,lastScreen:W}=I(),{rpcConfig:O,appId:q,createAnalyticsEvent:z,closePrivyModal:H}=S(),N=y(),[Q,R]=o(void 0),[X,Y]=o(!1),G=E?.funding,{reloadBalance:J}=T({rpcConfig:O,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?$.find((({address:e})=>e===G.address)):k.find((({address:e})=>C(e)===C(G.address)));if(!G)return L({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:W||"FundingMethodSelectionScreen"},funding:E?.funding,solanaFundingData:E?.solanaFundingData,sendTransaction:E?.sendTransaction}),P("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);Q&&r>Q&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"solana",address:Z?.address,value:G.isUSDC?a(r-Q,6):a(r-Q,9),token:G.isUSDC?"USDC":"SOL"}})),R(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===G.chainType&&(async()=>{if(!G.erc20Address)return await J()??BigInt(0);{let{balance:e}=await U({chain:G.chain,address:G.address,erc20Address:G.erc20Address,rpcConfig:O,appId:q});return e}})().then((e=>{Q&&e>Q&&(Y(!0),z({eventName:w,payload:{provider:"manual",status:"success",chainType:"ethereum",address:Z?.address,chainId:G.chain.id,value:a(e-Q,G.erc20ContractInfo?.decimals??18),token:G.erc20ContractInfo?.symbol??G.erc20Address??"ETH"}})),R(e)})).catch((()=>R(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[Q]);let _=s((()=>null==Q?"":G.isUSDC?n({amount:Q,decimals:6}):K?M(Q,3,!0,!0):null!=G.erc20ContractInfo?.decimals?n({amount:Q,decimals:G.erc20ContractInfo.decimals}):m({wei:Q})),[Q,K,G]),ee="ethereum"===G.chainType?G.chain.name:D(G.chain),re=s((()=>""===G.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(v,{children:G.uiConfig?.receiveFundsTitle??`Receive ${G.amount} ${V??""}`.trim()})),[G.uiConfig?.receiveFundsTitle,G.amount,V]),te=s((()=>""===G.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:G.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[G.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===G.chainType&&G.isUSDC&&F(G.chain)?`?spl-token=${F(G.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${G.chainType}:${G.address}${oe}`,size:200,squareLogoElement:B}),/*#__PURE__*/t(f,{theme:N.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(g,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${V}`,address:G.address}),X&&/*#__PURE__*/e(c,{onClick:()=>H({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let B=({...r})=>/*#__PURE__*/e(k,{color:"black",...r});export{x as ManualTransferScreen,x as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{M as s,b as a,P as m}from"./ModalHeader-JjfRejxC.mjs";import{L as l}from"./useActiveWallet-CHY4WQdQ.mjs";import{u as c}from"./context-CcPjcQxY.mjs";import{u as p,a as u}from"./get-is-unified-wallet-CMioBd5c.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-COmXYzq5.mjs";import{A as v,C as j,I as k,T as g,S as C,B as w}from"./PinInput-3SLvbnQa.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"tinycolor2";import"@privy-io/are-addresses-equal";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-V8ec2dKP.mjs";import"lucide-react";import"./index-DMvly1BH.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./reservoir-0wfhnc0j.mjs";import"./ScreenLayout-Ca6ml9wY.mjs";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-BfLq2-Q5.mjs";import"./TodoList-CgrU7uwu.mjs";import"./CopyToClipboard-DSTf_eKU.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-VCBMkqqq.mjs";import"qrcode";const M={component:()=>{let{user:M,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:A}=u(),P=c(),[S,R]=n(null),[E,x]=n(null),[F,L]=n(null),[T,U]=n(!1),[B,W]=n(!1),[q,O]=n(),z=async()=>{q?D(q):M?await H({user:M}):D(Error("Must be logged in to manage MFA")),setTimeout((()=>{R(null),x(null)}),500)};if(A.current=z,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:D,onSuccess:H,onBack:Q,mfaMethods:X,verify:$,generateTotpSecret:G,enrollTotp:K,unenrollTotp:N,enrollPasskey:V}=I.mfaEnroll,Z=M?.mfaMethods.includes("sms"),J=M?.mfaMethods.includes("totp"),Y=M?.mfaMethods.includes("passkey"),_=!!M?.phone,ee=M?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){R(null),x(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await V(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),U(!1)}}if(!b||!M||!P)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{onClose:z,backFn:Q},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(l,{})}),/*#__PURE__*/t(a,{})]});if("sms"===S)return null;if("totp"===S)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:z},"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 ",P?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await N();return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:B,children:"Remove"})}),/*#__PURE__*/t(a,{})]});if("passkey"===S){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:z},"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(w,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V([]);return await H({user:e})}catch(e){O(e)}finally{W(!1),R(null)}},loading:B,children:"Remove"})}),/*#__PURE__*/t(a,{})]})}return 0!==X.length||Z||J||Y?"sms"===E?null:"totp"===E&&F?/*#__PURE__*/t(h,{onClose:z,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await K(e);return await H({user:o})}catch(e){O(e)}finally{W(!1),R(null)}}(e.mfaCode),error:q,totpInfo:{...F,appName:P?.name||"Privy"}}):"passkey"===E?/*#__PURE__*/t(y,{onReset:oe,onClose:z,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:M.mfaMethods,appMfaMethods:P.mfa.methods,userHasAuthSms:_,backFn:Q,handleSelectMethod:async function(e){O(void 0);try{await $()}catch(e){return void O(e)}return"totp"===e?(x(e),L(null),void G().then((({totpSecret:e,totpAuthUrl:o})=>{L({authUrl:o,secret:e})})).catch((()=>{L(null),oe()}))):"passkey"===e&&1===ee.length?await te():void x(e)},isTotpLoading:"totp"===E&&!F,isPasskeyLoading:T,error:q,onClose:z,setRemovingMfaMethod:async function(e){O(void 0);try{await $()}catch(e){return void O(e)}R(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(s,{onClose:z,backFn:Q},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[P?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{onClick:z,children:"Close"})}),/*#__PURE__*/t(a,{})]})}};export{M as MfaAuthEnrollmentFlowScreen,M as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as o,useState as t,useEffect as r,useRef as i}from"react";import{u as s}from"./context-CcPjcQxY.mjs";import{u as m,a as n}from"./get-is-unified-wallet-CMioBd5c.mjs";import{V as a,a as c,b as p,t as l}from"./to-ui-error-CmP4i4IC.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"@privy-io/are-addresses-equal";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-JjfRejxC.mjs";import"styled-components";import"./useActiveWallet-CHY4WQdQ.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-BzM2a8Is.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-rvM1mjSi.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./ScreenLayout-Ca6ml9wY.mjs";import"./Screen-DE3ldE_X.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-PWP-Uiot.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./index-DMvly1BH.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-DK1coOrO.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./TransactionDetails-DkPozym_.mjs";import"./WalletLink-B12jNftF.mjs";import"./ethers-VWEScvge.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u={component:()=>{let{user:u}=m(),d=s(),h=o((()=>u?.mfaMethods.filter((e=>"passkey"!==e||!d.globalDisablePasskeys))??[]),[u?.mfaMethods,d.globalDisablePasskeys]),{data:f}=n(),[j,y]=t(h[0]),[v,k]=t(!1),[g,w]=t(),[b,C]=t();if(r((()=>{y(h[0])}),[h]),!f?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:M,onSuccess:P,generateOptions:S,verifyTotpCode:I,verifyPasskey:x,verifySmsCode:A,sendSmsCode:E}=f.mfaVerify,F=async e=>{if("passkey"!==e)try{y(e),"sms"===e&&(y(e),await E()),"totp"===e&&y(e)}catch(e){console.error(e)}else try{y(e);let o=await S();if(!o)throw Error("something went wrong");w(o),await x(o),k(!0),C(void 0),P()}catch(e){C(l(e))}},B=async e=>{C(void 0);try{if(!e||!j)return;if("passkey"===j){if(!g)throw Error("Missing passkey challenge");await x(g)}else"sms"===j?await A(e):"totp"===j&&await I(e);C(void 0),k(!0),P()}catch(e){throw l(e).error}},L=()=>{b||!v?M(b?.error??Error("Canceled MFA verification.")):P()},D=i(!1);return r((()=>{!D.current&&j&&(D.current=!0,F(j).finally((()=>{D.current=!1})))}),[open]),u?"passkey"===j?/*#__PURE__*/e(a,{account:u.linkedAccounts.filter((e=>"passkey"===e.type&&e.enrolledInMfa)).sort(((e,o)=>o.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:b?.isBlocking??!1,error:b?.error,onClose:L,onBack:()=>{y(void 0),C(void 0)},handleSubmit:()=>B(g).catch(C)}):"sms"===j||"totp"===j?/*#__PURE__*/e(c,{selectedMethod:j,submitSuccess:v,hasBlockingError:b?.isBlocking??!1,handleSubmitCode:B,onClose:L,onBack:h.length>1?()=>y(void 0):void 0}):/*#__PURE__*/e(p,{mfaMethods:h,onSelect:F,handleClose:L}):null}};export{u as MfaAuthVerifyFlowScreen,u as default};