@privy-io/react-auth 3.6.1 → 3.8.0-beta-20251120191721

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 (362) hide show
  1. package/dist/cjs/AccountNotFoundScreen-BpKsxQvX.js +1 -0
  2. package/dist/cjs/Address-BN-0TKbs.js +1 -0
  3. package/dist/cjs/AffirmativeConsentScreen-DzbZOm2w.js +1 -0
  4. package/dist/cjs/AllowlistRejectionScreen-Q10vxo1K.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-CV9eoP2y.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-CnkvZDfs.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-BIcmYFKE.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-B0LAVodx.js +1 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-BtYlcuDi.js +2 -0
  10. package/dist/cjs/BridgeNetworkSelectionView-BuCMlP7B.js +1 -0
  11. package/dist/cjs/Button-CeOGdFfx.js +2 -0
  12. package/dist/cjs/CaptchaScreen-DkSZl6Xn.js +1 -0
  13. package/dist/cjs/Checkbox-DXPQZFlQ.js +1 -0
  14. package/dist/cjs/Chip-ChrHHazc.js +1 -0
  15. package/dist/cjs/CoinbaseOnrampStatusScreen-DY3NibCh.js +1 -0
  16. package/dist/cjs/Column-C2bAbJE0.js +1 -0
  17. package/dist/cjs/ConnectEmailForm-B61UuDxF.js +1 -0
  18. package/dist/cjs/ConnectLedgerScreen-DOOcr9FJ.js +1 -0
  19. package/dist/cjs/ConnectOnlyLandingScreen-THjT-iSS.js +1 -0
  20. package/dist/cjs/ConnectOnlyStatusScreen-B1IeyALu.js +1 -0
  21. package/dist/cjs/ConnectOrCreateScreen-CzQHm9Ow.js +1 -0
  22. package/dist/cjs/ConnectPhoneForm-wVTnktZK.js +1 -0
  23. package/dist/cjs/ConnectWalletView-Cmptu0yu.js +1 -0
  24. package/dist/cjs/ConnectionStatusScreen-CQamULAx.js +1 -0
  25. package/dist/cjs/CopyToClipboard-fd8Z3kQX.js +1 -0
  26. package/dist/cjs/CrossAppAuthScreen-Bjp8h5Jn.js +1 -0
  27. package/dist/cjs/CustomLandingScreenView-BvudwF0o.js +2 -0
  28. package/dist/cjs/DelegatedActionsConsentScreen-3Ci805SP.js +1 -0
  29. package/dist/cjs/DelegatedActionsRevokeScreen-DRyT-mir.js +1 -0
  30. package/dist/cjs/EmailInputForm-tjrhBacA.js +1 -0
  31. package/dist/cjs/EmbeddedWalletConnectingScreen-C3JBYig6.js +1 -0
  32. package/dist/cjs/EmbeddedWalletCreatedScreen-XfuXLYat.js +1 -0
  33. package/dist/cjs/EmbeddedWalletKeyExportScreen-iFge_CDq.js +2 -0
  34. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-TYXIDwwn.js +1 -0
  35. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-De7njr-w.js +1 -0
  36. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-Na9Q8UM-.js +1 -0
  37. package/dist/cjs/EnrollTotp-BKG8Lb1B.js +1 -0
  38. package/dist/cjs/ErrorBanner-CMjaobRI.js +1 -0
  39. package/dist/cjs/ErrorMessage-f0cRWc29.js +1 -0
  40. package/dist/cjs/ErrorScreen-BoF6xniP.js +1 -0
  41. package/dist/cjs/FarcasterConnectStatusScreen-Fhiqg9Fd.js +2 -0
  42. package/dist/cjs/FarcasterSignerStatusScreen-ZYp1tPT-.js +2 -0
  43. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-xxYuSfS7.js +2 -0
  44. package/dist/cjs/FundWalletMethodHeader-Bk1rumOR.js +1 -0
  45. package/dist/cjs/FundingEditAmountScreen-C8cZMsWI.js +1 -0
  46. package/dist/cjs/FundingMethodSelectionScreen-CK-qptfa.js +1 -0
  47. package/dist/cjs/InAppBrowserLoginNotPossible-DQ6_NTxS.js +1 -0
  48. package/dist/cjs/InfoBanner-CTx1eRnV.js +1 -0
  49. package/dist/cjs/InjectedWalletIcon-UY3nMvZo.js +1 -0
  50. package/dist/cjs/InstallWalletScreen-Dm_g2MTP.js +1 -0
  51. package/dist/cjs/JsonTree-xaeo0q6z.js +1 -0
  52. package/dist/cjs/LabelXs-CYMv6rOZ.js +1 -0
  53. package/dist/cjs/LandingScreen-BTF5VgZc.js +1 -0
  54. package/dist/cjs/Layouts-dRL0OSpp.js +1 -0
  55. package/dist/cjs/Link-DmzPZ_M7.js +1 -0
  56. package/dist/cjs/LinkConflictScreen-BmFVsv9I.js +1 -0
  57. package/dist/cjs/LinkEmailScreen-Bj5Tis7X.js +1 -0
  58. package/dist/cjs/LinkPasskeyScreen-BHJ1uTEs.js +1 -0
  59. package/dist/cjs/LinkPhoneScreen-CtRsk0t7.js +1 -0
  60. package/dist/cjs/LoadingSkeleton-DoCrfGnl.js +1 -0
  61. package/dist/cjs/LoginFailedScreen-CbFRgwWs.js +1 -0
  62. package/dist/cjs/ManualTransferScreen-Cd0aWRb-.js +1 -0
  63. package/dist/cjs/MfaAuthEnrollmentFlowScreen-Ds6l3rz7.js +1 -0
  64. package/dist/cjs/MfaAuthVerifyFlowScreen-BDUEqJmg.js +1 -0
  65. package/dist/cjs/MfaEnrollmentFlowScreen-BVzBtnEj.js +1 -0
  66. package/dist/cjs/MfaVerifyFlowScreen-DUj0ltAq.js +1 -0
  67. package/dist/cjs/ModalHeader-B35XTVly.js +3 -0
  68. package/dist/cjs/MoonpayStatusScreen-ZVMYoDud.js +1 -0
  69. package/dist/cjs/NetworkIcon-BZ9Mj6vV.js +1 -0
  70. package/dist/cjs/OAuthStatusScreen-CmvuRE7W.js +1 -0
  71. package/dist/cjs/OpenLink-BpCUf9iR.js +1 -0
  72. package/dist/cjs/PasskeySelectSignupOrLogin-DozaXTAd.js +1 -0
  73. package/dist/cjs/PasskeyStatusScreen-DPlqOafY.js +1 -0
  74. package/dist/cjs/PasswordRecoveryScreen-DvoYWBLb.js +1 -0
  75. package/dist/cjs/PinInput-DSI6rjOn.js +1 -0
  76. package/dist/cjs/QrCode-BGg2mpDQ.js +2 -0
  77. package/dist/cjs/RecoveryOAuthStatusScreen-VYnfrRDK.js +1 -0
  78. package/dist/cjs/RecoveryPasswordCreateScreen-DLcafP-u.js +1 -0
  79. package/dist/cjs/RecoverySelectionScreen-BO80IPn_.js +1 -0
  80. package/dist/cjs/Row-CxDF-VMy.js +1 -0
  81. package/dist/cjs/Screen-CEgdngB-.js +9 -0
  82. package/dist/cjs/ScreenHeader-CyURV6Ti.js +2 -0
  83. package/dist/cjs/ScreenLayout-B7Fie6CO.js +1 -0
  84. package/dist/cjs/SetAutomaticRecoveryScreen-B4Nayroc.js +1 -0
  85. package/dist/cjs/SetWalletPasswordForm-Dobw5csI.js +2 -0
  86. package/dist/cjs/SignRequestScreen-CuY2wFaP.js +1 -0
  87. package/dist/cjs/StackedContainer-ByB6Mdu0.js +1 -0
  88. package/dist/cjs/StandardSignAndSendTransactionScreen-DsMs4ir5.js +1 -0
  89. package/dist/cjs/Subtitle-Dtmrw8l5.js +1 -0
  90. package/dist/cjs/TelegramAuthScreen-F1qt752X.js +1 -0
  91. package/dist/cjs/Title-C-tHJvrb.js +1 -0
  92. package/dist/cjs/TodoList-Cm_a93ef.js +2 -0
  93. package/dist/cjs/TransactionDetails-CEChy5O4.js +3 -0
  94. package/dist/cjs/TransactionErrorView-DWzOlCzW.js +2 -0
  95. package/dist/cjs/TransferFromWalletScreen-D0pcCgJX.js +1 -0
  96. package/dist/cjs/TransferOrBridgeLoadingScreen-CQ9ApaxG.js +1 -0
  97. package/dist/cjs/UpdateEmailScreen-KtOSkxQs.js +1 -0
  98. package/dist/cjs/UpdatePhoneScreen-BNbEmS8E.js +1 -0
  99. package/dist/cjs/UserLimitReachedScreen-D0EeTk2y.js +1 -0
  100. package/dist/cjs/Value-C-XtZyFa.js +1 -0
  101. package/dist/cjs/WalletButtonList-BkksH0ha.js +1 -0
  102. package/dist/cjs/WalletCards-BfpeHH5n.js +1 -0
  103. package/dist/cjs/WalletInfoCard-BtpUZmuz.js +1 -0
  104. package/dist/cjs/WalletInterstitialScreen-B5Bd3bSI.js +1 -0
  105. package/dist/cjs/WalletLink-GwIiqbkF.js +3 -0
  106. package/dist/cjs/WarningBanner-B_Gs_15p.js +1 -0
  107. package/dist/cjs/abstract-smart-wallets.js +1 -1
  108. package/dist/cjs/analytics-C6C_4JmG.js +1 -0
  109. package/dist/cjs/capitalizeFirstLetter-D-K8mqBm.js +1 -0
  110. package/dist/cjs/context-Bm0Zs5CX.js +1 -0
  111. package/dist/cjs/copy-BiZ7dtqy.js +1 -0
  112. package/dist/cjs/ethers-Ce8kN66R.js +1 -0
  113. package/dist/cjs/events-context-Di6--rDg.js +1 -0
  114. package/dist/cjs/extended-chains.js +1 -1
  115. package/dist/cjs/farcaster-CWHXGAib.js +1 -0
  116. package/dist/cjs/farcaster.js +1 -1
  117. package/dist/cjs/formatErc20TokenAmount-DxwoWe7e.js +1 -0
  118. package/dist/cjs/frame-bPqBJ8fS.js +1 -0
  119. package/dist/cjs/get-is-unified-wallet-B62rO8Nq.js +1 -0
  120. package/dist/cjs/getChainName-C4rO8-3n.js +1 -0
  121. package/dist/cjs/getErc20Balance-BZ5-OGfD.js +1 -0
  122. package/dist/cjs/getErc20TokenInfo-HX7DgcWx.js +1 -0
  123. package/dist/cjs/getFormattedUsdFromLamports-Mu2fqwL2.js +1 -0
  124. package/dist/cjs/getPublicClient-EjAv8R2z.js +1 -0
  125. package/dist/cjs/getUsdcMintAddress-REYZSOb9.js +1 -0
  126. package/dist/cjs/index-0zGcPi2m.js +1 -0
  127. package/dist/cjs/index-CHEx8Ofc.js +5 -0
  128. package/dist/cjs/index-CRFXS9pP.js +1 -0
  129. package/dist/cjs/index-DQpR657P.js +1 -0
  130. package/dist/cjs/index.js +1 -7
  131. package/dist/cjs/internal-context-VDPFkIXN.js +1 -0
  132. package/dist/cjs/internal.js +1 -1
  133. package/dist/cjs/paths-DizMb-lU.js +1 -0
  134. package/dist/cjs/prepareFundingModalData-sWt0B4UM.js +1 -0
  135. package/dist/cjs/reservoir-3I-Vkf2B.js +1 -0
  136. package/dist/cjs/shared-B8h89GbU.js +1 -0
  137. package/dist/cjs/shared-BPGwTh8c.js +1 -0
  138. package/dist/cjs/shouldProceedtoEmbeddedWalletCreationFlow-zk7vYZVb.js +1 -0
  139. package/dist/cjs/smart-wallets-QJMian4a.js +1 -0
  140. package/dist/cjs/smart-wallets.js +1 -1
  141. package/dist/cjs/solana.js +1 -1
  142. package/dist/cjs/styles-Ca_DS00a.js +1 -0
  143. package/dist/cjs/styles-D4VeJNv1.js +1 -0
  144. package/dist/cjs/telegram-D3O0_F1a.js +1 -0
  145. package/dist/cjs/to-ui-error-MqTMUD0U.js +1 -0
  146. package/dist/cjs/transaction-DjF5X-by.js +1 -0
  147. package/dist/cjs/transfer-Cit146vy.js +1 -0
  148. package/dist/cjs/twitch-BNvhZb2Y.js +1 -0
  149. package/dist/cjs/twitter-BVVRWkcG.js +1 -0
  150. package/dist/cjs/ui.js +2 -2
  151. package/dist/cjs/use-create-wallet-without-fallback-CMY6x38O.js +1 -0
  152. package/dist/cjs/use-export-wallet-CZUS_TFM.js +1 -0
  153. package/dist/cjs/{use-sign-with-user-signer-BtJVKMQr.js → use-sign-with-user-signer-On9f1Fag.js} +1 -1
  154. package/dist/cjs/useActiveWallet-LxZuuWaX.js +1 -0
  155. package/dist/cjs/useGetSolPrice-eOpcFeNE.js +1 -0
  156. package/dist/cjs/useGetTokenPrice-MTnZpS2R.js +1 -0
  157. package/dist/cjs/useI18n-BOxae6PZ.js +1 -0
  158. package/dist/cjs/usePrivy-B75u65l2.js +1 -0
  159. package/dist/cjs/useSolanaRpcClient-CLwcfVYS.js +1 -0
  160. package/dist/cjs/useWalletBalance-CQAgfkRc.js +1 -0
  161. package/dist/cjs/useWallets-TQ28bZtC.js +1 -0
  162. package/dist/cjs/useWallets-ZAg2DE4-.js +1 -0
  163. package/dist/dts/{events-context-CCElA92Y.d.mts → events-context-CkFXl3uc.d.mts} +1 -1
  164. package/dist/dts/{events-context-CCElA92Y.d.ts → events-context-CkFXl3uc.d.ts} +1 -1
  165. package/dist/dts/extended-chains.d.mts +1 -1
  166. package/dist/dts/extended-chains.d.ts +1 -1
  167. package/dist/dts/farcaster.d.mts +1 -1
  168. package/dist/dts/farcaster.d.ts +1 -1
  169. package/dist/dts/index.d.mts +99 -10
  170. package/dist/dts/index.d.ts +99 -10
  171. package/dist/dts/internal.d.mts +1 -1
  172. package/dist/dts/internal.d.ts +1 -1
  173. package/dist/dts/smart-wallets.d.mts +1 -1
  174. package/dist/dts/smart-wallets.d.ts +1 -1
  175. package/dist/dts/solana.d.mts +3 -3
  176. package/dist/dts/solana.d.ts +3 -3
  177. package/dist/dts/ui.d.mts +1 -1
  178. package/dist/dts/ui.d.ts +1 -1
  179. package/dist/esm/AccountNotFoundScreen-V5N3r4Ot.mjs +1 -0
  180. package/dist/esm/Address-8wLEsvcI.mjs +1 -0
  181. package/dist/esm/AffirmativeConsentScreen-BXI3CEbA.mjs +1 -0
  182. package/dist/esm/AllowlistRejectionScreen-D7h7_AD7.mjs +1 -0
  183. package/dist/esm/AuthenticateWithWalletScreen-Xk6KqT5A.mjs +1 -0
  184. package/dist/esm/AwaitingEvmToSolBridgingScreen-nCGHB9yB.mjs +2 -0
  185. package/dist/esm/AwaitingExternalEthereumTransferScreen-B9i85XhH.mjs +2 -0
  186. package/dist/esm/AwaitingPasswordlessCodeScreen-7n3shhgt.mjs +1 -0
  187. package/dist/esm/AwaitingSolToEvmBridgingScreen-Bny4YIW8.mjs +2 -0
  188. package/dist/esm/BridgeNetworkSelectionView-BTC8PLhp.mjs +1 -0
  189. package/dist/esm/Button-BvV3nq1d.mjs +2 -0
  190. package/dist/esm/CaptchaScreen-D0MhZPJK.mjs +1 -0
  191. package/dist/esm/Checkbox-NmGCZeKL.mjs +1 -0
  192. package/dist/esm/Chip-Bsgj4Yc-.mjs +1 -0
  193. package/dist/esm/CoinbaseOnrampStatusScreen-Ko3jBwVQ.mjs +1 -0
  194. package/dist/esm/Column-DQ5Vw9t1.mjs +1 -0
  195. package/dist/esm/ConnectEmailForm-MvKXaPgl.mjs +1 -0
  196. package/dist/esm/ConnectLedgerScreen-Bt9W_A0A.mjs +1 -0
  197. package/dist/esm/ConnectOnlyLandingScreen-B--AIEDa.mjs +1 -0
  198. package/dist/esm/ConnectOnlyStatusScreen-CFhkBDzA.mjs +1 -0
  199. package/dist/esm/ConnectOrCreateScreen-hf2XyL5U.mjs +1 -0
  200. package/dist/esm/ConnectPhoneForm-Bs0KpBTr.mjs +1 -0
  201. package/dist/esm/ConnectWalletView-Ca56OA4K.mjs +1 -0
  202. package/dist/esm/ConnectionStatusScreen-DAAOi5F0.mjs +1 -0
  203. package/dist/esm/CopyToClipboard-DatKc59_.mjs +1 -0
  204. package/dist/esm/CrossAppAuthScreen-Bm869hxc.mjs +1 -0
  205. package/dist/esm/CustomLandingScreenView-Bgpw5yMS.mjs +2 -0
  206. package/dist/esm/DelegatedActionsConsentScreen-CyrkY2LI.mjs +1 -0
  207. package/dist/esm/DelegatedActionsRevokeScreen-BaL-lABH.mjs +1 -0
  208. package/dist/esm/EmailInputForm-B4hjCxRU.mjs +1 -0
  209. package/dist/esm/EmbeddedWalletConnectingScreen-7EQnOmOz.mjs +1 -0
  210. package/dist/esm/EmbeddedWalletCreatedScreen-BLB3bzh-.mjs +1 -0
  211. package/dist/esm/EmbeddedWalletKeyExportScreen-BX0jzDjo.mjs +2 -0
  212. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-D_Zrc1SH.mjs +1 -0
  213. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-BYj_9WgE.mjs +1 -0
  214. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-S-O0EYAK.mjs +1 -0
  215. package/dist/esm/EnrollTotp-DOltRnw0.mjs +1 -0
  216. package/dist/esm/ErrorBanner-BdiArMwu.mjs +1 -0
  217. package/dist/esm/ErrorMessage-Cx8GKGhL.mjs +1 -0
  218. package/dist/esm/ErrorScreen-B3jTfxM4.mjs +1 -0
  219. package/dist/esm/FarcasterConnectStatusScreen-BtUa2GRy.mjs +1 -0
  220. package/dist/esm/FarcasterSignerStatusScreen-9Fn_X1-B.mjs +1 -0
  221. package/dist/esm/FundSolWalletWithExternalSolanaWallet-C8UV3RJb.mjs +1 -0
  222. package/dist/esm/FundWalletMethodHeader-DAMdr4Vz.mjs +1 -0
  223. package/dist/esm/FundingEditAmountScreen-CfGLzAF-.mjs +1 -0
  224. package/dist/esm/FundingMethodSelectionScreen-CP9lHaRK.mjs +1 -0
  225. package/dist/esm/InAppBrowserLoginNotPossible-BN_-SfZ8.mjs +1 -0
  226. package/dist/esm/InfoBanner-D6C6Bt8L.mjs +1 -0
  227. package/dist/esm/InjectedWalletIcon-DLcYOGDj.mjs +1 -0
  228. package/dist/esm/InstallWalletScreen-DDCf9vep.mjs +1 -0
  229. package/dist/esm/JsonTree-Bvd2C29R.mjs +1 -0
  230. package/dist/esm/LabelXs-BOisBtqT.mjs +1 -0
  231. package/dist/esm/LandingScreen-xT9H8qFk.mjs +1 -0
  232. package/dist/esm/Layouts-Bmf8DxNP.mjs +1 -0
  233. package/dist/esm/Link-DwjLfHwW.mjs +1 -0
  234. package/dist/esm/LinkConflictScreen-CKMpbAGF.mjs +1 -0
  235. package/dist/esm/LinkEmailScreen-ck5SRliU.mjs +1 -0
  236. package/dist/esm/LinkPasskeyScreen-CYAb2YB1.mjs +1 -0
  237. package/dist/esm/LinkPhoneScreen-BVmDsdut.mjs +1 -0
  238. package/dist/esm/LoadingSkeleton-CHdaq3pb.mjs +1 -0
  239. package/dist/esm/LoginFailedScreen-C1twM4M0.mjs +1 -0
  240. package/dist/esm/ManualTransferScreen-BvDI5pit.mjs +1 -0
  241. package/dist/esm/MfaAuthEnrollmentFlowScreen-BmywzpjA.mjs +1 -0
  242. package/dist/esm/MfaAuthVerifyFlowScreen-DeX_PX04.mjs +1 -0
  243. package/dist/esm/MfaEnrollmentFlowScreen-Cdg0ZOZ9.mjs +1 -0
  244. package/dist/esm/MfaVerifyFlowScreen-BFNo-UNN.mjs +1 -0
  245. package/dist/esm/ModalHeader-Bh_PKIU9.mjs +3 -0
  246. package/dist/esm/MoonpayStatusScreen-BlP2VRxe.mjs +1 -0
  247. package/dist/esm/NetworkIcon-B48ilzF8.mjs +1 -0
  248. package/dist/esm/OAuthStatusScreen-DlumYk-O.mjs +1 -0
  249. package/dist/esm/OpenLink-BpeNYBKs.mjs +1 -0
  250. package/dist/esm/PasskeySelectSignupOrLogin-CJ8Gc5kC.mjs +1 -0
  251. package/dist/esm/PasskeyStatusScreen-CV6Ga1oO.mjs +1 -0
  252. package/dist/esm/PasswordRecoveryScreen-BPj-kFfD.mjs +1 -0
  253. package/dist/esm/PinInput-C3_MNxMt.mjs +1 -0
  254. package/dist/esm/QrCode-C-QpSY36.mjs +2 -0
  255. package/dist/esm/RecoveryOAuthStatusScreen-Cq_CH3Kz.mjs +1 -0
  256. package/dist/esm/RecoveryPasswordCreateScreen-D4_ywnfI.mjs +1 -0
  257. package/dist/esm/RecoverySelectionScreen-C8ffcrKj.mjs +1 -0
  258. package/dist/esm/Row-CG0lSY5Z.mjs +1 -0
  259. package/dist/esm/Screen-BagBuHbN.mjs +8 -0
  260. package/dist/esm/ScreenHeader-Biz1wq02.mjs +2 -0
  261. package/dist/esm/ScreenLayout-CySJnyOi.mjs +1 -0
  262. package/dist/esm/SetAutomaticRecoveryScreen-BXO3DDtn.mjs +1 -0
  263. package/dist/esm/SetWalletPasswordForm-BOxZyUhQ.mjs +2 -0
  264. package/dist/esm/SignRequestScreen-CLDrfIWS.mjs +1 -0
  265. package/dist/esm/StackedContainer-BrIQsdas.mjs +1 -0
  266. package/dist/esm/StandardSignAndSendTransactionScreen-C1-4OJaX.mjs +1 -0
  267. package/dist/esm/Subtitle-DkvfP2Ev.mjs +1 -0
  268. package/dist/esm/TelegramAuthScreen-BrwJ_w9H.mjs +1 -0
  269. package/dist/esm/Title-D0pfZff-.mjs +1 -0
  270. package/dist/esm/TodoList-Dn0Qu-vv.mjs +2 -0
  271. package/dist/esm/TransactionDetails-BA6Mg8A_.mjs +3 -0
  272. package/dist/esm/TransactionErrorView-FfwlWheg.mjs +2 -0
  273. package/dist/esm/TransferFromWalletScreen-BuKmTPKV.mjs +1 -0
  274. package/dist/esm/TransferOrBridgeLoadingScreen-C1ZynMXz.mjs +1 -0
  275. package/dist/esm/UpdateEmailScreen-Cg-pO5nC.mjs +1 -0
  276. package/dist/esm/UpdatePhoneScreen-DpQguGc4.mjs +1 -0
  277. package/dist/esm/UserLimitReachedScreen-DBpRXfKx.mjs +1 -0
  278. package/dist/esm/Value-B4M62ove.mjs +1 -0
  279. package/dist/esm/WalletButtonList-CRZdXlK3.mjs +1 -0
  280. package/dist/esm/WalletCards-DH1rqayz.mjs +1 -0
  281. package/dist/esm/WalletInfoCard-ByshkAcF.mjs +1 -0
  282. package/dist/esm/WalletInterstitialScreen-BgGmbeJm.mjs +1 -0
  283. package/dist/esm/WalletLink-BteV-rJa.mjs +3 -0
  284. package/dist/esm/WarningBanner-BDp-QC9i.mjs +1 -0
  285. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  286. package/dist/esm/analytics-mkkvFRju.mjs +1 -0
  287. package/dist/esm/capitalizeFirstLetter-DmLYqXsO.mjs +1 -0
  288. package/dist/esm/context-DrEBh-QM.mjs +1 -0
  289. package/dist/esm/copy-Bx2Jwc5_.mjs +1 -0
  290. package/dist/esm/ethers-CDHJG_GP.mjs +1 -0
  291. package/dist/esm/events-context-CI0iqAXA.mjs +1 -0
  292. package/dist/esm/extended-chains.mjs +1 -1
  293. package/dist/esm/farcaster-DPlSjvF5.mjs +1 -0
  294. package/dist/esm/farcaster.mjs +1 -1
  295. package/dist/esm/formatErc20TokenAmount-BuPk9xcy.mjs +1 -0
  296. package/dist/esm/frame-BMa3kyjk.mjs +1 -0
  297. package/dist/esm/get-is-unified-wallet-DjMnN6w-.mjs +1 -0
  298. package/dist/esm/getChainName-DjpPdUSc.mjs +1 -0
  299. package/dist/esm/getErc20Balance-Dtau1386.mjs +1 -0
  300. package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +1 -0
  301. package/dist/esm/getFormattedUsdFromLamports-B6EqSEho.mjs +1 -0
  302. package/dist/esm/getPublicClient-IxRndou_.mjs +1 -0
  303. package/dist/esm/getUsdcMintAddress-DFI1hv05.mjs +1 -0
  304. package/dist/esm/index-CJMgUOnw.mjs +1 -0
  305. package/dist/esm/index-CuJmrgWj.mjs +1 -0
  306. package/dist/esm/index-DHS-Ngo5.mjs +1 -0
  307. package/dist/esm/index-UMYdObny.mjs +5 -0
  308. package/dist/esm/index.mjs +1 -6
  309. package/dist/esm/internal-context-Cvo1WmWN.mjs +1 -0
  310. package/dist/esm/internal.mjs +1 -1
  311. package/dist/esm/paths-3HW55qZg.mjs +1 -0
  312. package/dist/esm/prepareFundingModalData-B_fHl6nD.mjs +1 -0
  313. package/dist/esm/reservoir-B0V48m2I.mjs +1 -0
  314. package/dist/esm/shared-CtYf3O54.mjs +1 -0
  315. package/dist/esm/shared-i9iZKcjf.mjs +1 -0
  316. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-B-DA9rrk.mjs +1 -0
  317. package/dist/esm/smart-wallets-DSw3zXfv.mjs +1 -0
  318. package/dist/esm/smart-wallets.mjs +1 -1
  319. package/dist/esm/solana.mjs +1 -1
  320. package/dist/esm/styles-BxA7nKxI.mjs +1 -0
  321. package/dist/esm/styles-DY17fuAX.mjs +1 -0
  322. package/dist/esm/telegram-B-JqnkqZ.mjs +1 -0
  323. package/dist/esm/to-ui-error-D0R7TYw2.mjs +1 -0
  324. package/dist/esm/transaction-CnfuREWo.mjs +1 -0
  325. package/dist/esm/transfer-CMPmjPsM.mjs +1 -0
  326. package/dist/esm/twitch-5IOe4sIQ.mjs +1 -0
  327. package/dist/esm/twitter-6jomarO4.mjs +1 -0
  328. package/dist/esm/ui.mjs +2 -2
  329. package/dist/esm/use-create-wallet-without-fallback-7_Kdlq3v.mjs +1 -0
  330. package/dist/esm/use-export-wallet-BbkIao0B.mjs +1 -0
  331. package/dist/esm/use-sign-with-user-signer-LJ6ROduD.mjs +1 -0
  332. package/dist/esm/useActiveWallet-BnhoT9lw.mjs +1 -0
  333. package/dist/esm/useGetSolPrice-Bi0pPiUW.mjs +1 -0
  334. package/dist/esm/useGetTokenPrice-vOCP_wlo.mjs +1 -0
  335. package/dist/esm/useI18n-C18aiDt_.mjs +1 -0
  336. package/dist/esm/usePrivy-BkrUs537.mjs +1 -0
  337. package/dist/esm/useSolanaRpcClient-C7MdhPmd.mjs +1 -0
  338. package/dist/esm/useWalletBalance-Xca4-c_r.mjs +1 -0
  339. package/dist/esm/useWallets-D9FTjmQA.mjs +1 -0
  340. package/dist/esm/useWallets-Dfi2cihT.mjs +1 -0
  341. package/package.json +18 -11
  342. package/dist/cjs/EmbeddedWalletConnectingScreen-DmH8RMAY.js +0 -27
  343. package/dist/cjs/SignRequestScreen-DELDI80-.js +0 -1
  344. package/dist/cjs/events-context-CJ1M8bnZ.js +0 -1
  345. package/dist/cjs/frame-B2orQ_lK.js +0 -1
  346. package/dist/cjs/internal-context-CeWKmK5u.js +0 -1
  347. package/dist/cjs/smart-wallets-N48ncX_X.js +0 -1
  348. package/dist/cjs/use-export-wallet-DT6dr7Z0.js +0 -2
  349. package/dist/cjs/useActiveWallet-u2yYoS5O.js +0 -1
  350. package/dist/cjs/usePrivy-BiM8CWww.js +0 -1
  351. package/dist/esm/EmbeddedWalletConnectingScreen-DTl397rT.mjs +0 -25
  352. package/dist/esm/SignRequestScreen-Ca9hEGyq.mjs +0 -1
  353. package/dist/esm/events-context-DGSLy4O3.mjs +0 -1
  354. package/dist/esm/frame-Dj70FEYB.mjs +0 -1
  355. package/dist/esm/internal-context-eGSwROSk.mjs +0 -1
  356. package/dist/esm/smart-wallets-p7WscfjP.mjs +0 -1
  357. package/dist/esm/use-export-wallet-CwTc9_pt.mjs +0 -1
  358. package/dist/esm/use-sign-with-user-signer-DaTvrd5T.mjs +0 -1
  359. package/dist/esm/useActiveWallet-D2LLcdLS.mjs +0 -1
  360. package/dist/esm/usePrivy-BDEzTFuZ.mjs +0 -1
  361. package/dist/dts/{types-B6UNnZ2P.d.mts → types-BkkvIRg5.d.mts} +134 -134
  362. package/dist/dts/{types-B6UNnZ2P.d.ts → types-BkkvIRg5.d.ts} +134 -134
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as a,useEffect as i}from"react";import{M as o,B as l}from"./ModalHeader-Bh_PKIU9.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as s}from"./FundWalletMethodHeader-DAMdr4Vz.mjs";import{C as m}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as c}from"./context-DrEBh-QM.mjs";import{v as d,a8 as u,U as h}from"./useActiveWallet-BnhoT9lw.mjs";import{u as y}from"./internal-context-Cvo1WmWN.mjs";import{a as f}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{u as g}from"./useWallets-D9FTjmQA.mjs";import{t as C,W as w}from"./WalletButtonList-CRZdXlK3.mjs";import{I as T}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-B_fHl6nD.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"lucide-react";import"./index-UMYdObny.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BkrUs537.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";const j={component:()=>{let m,{connectors:h}=y(),{setModalData:T,data:j,navigate:W}=f(),S=c(),{wallets:x}=g(),D=h.filter(d).flatMap((e=>e.wallets)),[F,k]=a("default"),M="solana"===j?.funding?.chainType,b=!!j?.funding?.crossChainBridgingEnabled;m="ethereum"===j?.funding?.chainType?j.funding.erc20Address&&!j.funding.isUSDC?"ethereum-only":b&&!j.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":b&&!j.funding?.isUSDC?"ethereum-and-solana":"solana-only";let E=x.filter((e=>"privy"!==e.walletClientType)),A=E.map((e=>e.walletClientType)),I=D.filter((e=>"privy"!==e.walletClientType)),L=I.map((e=>e.walletClientType)),B=[],H={...j.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let U=({wallet:e,walletChainType:t})=>{T({...j,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>W(z({destChainType:M?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),W("FundingAmountEditScreen")};"solana-only"!==m&&B.push(...E.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"ethereum"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),"ethereum-only"!==m&&B.push(...I.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"solana"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),B.push(...C({walletList:S.appearance.walletList.filter((e=>!E.some((t=>t.walletClientType===e))&&!I.some((t=>t.walletClientType===e)))),walletChainType:m,connectors:h,connectOnly:!0,ignore:[...S.appearance.walletList,...A,...L],walletConnectEnabled:S.externalWallets.walletConnect.enabled}));let P=/*#__PURE__*/e(w,{text:"More wallets",onClick:()=>k("overflow")}),z=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===t?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===t?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return i((()=>{T({...j,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?E.find((n=>n.address===e&&n.walletClientType===t)):I.find((n=>n.address===e&&n.walletClientType===t));return T({...j,funding:{...H,connectedWallet:i,onContinueWithExternalWallet:()=>{W(z({destChainType:M?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/t(n,"overflow"===F?{children:[/*#__PURE__*/e(o,{backFn:()=>k("default")},"header"),/*#__PURE__*/t(u,{children:[/*#__PURE__*/e(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),B]}),/*#__PURE__*/e(l,{})]}:{children:[/*#__PURE__*/e(s,{}),/*#__PURE__*/e(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/t(u,{children:[B.length>4?B.slice(0,3):B,B.length>4&&P]}),/*#__PURE__*/e(l,{})]})}};let v=({onClick:n,icon:a,name:i,chainType:o})=>/*#__PURE__*/t(h,{onClick:n,children:[/*#__PURE__*/e(T,{style:{width:20},children:/*#__PURE__*/e("img",{src:a})}),i,/*#__PURE__*/e(m,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/e(m,{color:"gray",children:"Solana"})]});export{j as TransferFromWalletScreen,j as default};
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-Bh_PKIU9.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-DAMdr4Vz.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-8wLEsvcI.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-BnhoT9lw.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:x,isErc20Flow:C,totalPriceInNativeCurrency:T,totalPriceInUsd:v,gasPriceInNativeCurrency:A,gasPriceInUsd:B})=>{let P=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:P?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${x?"Bridging":"Confirming"} with ${I}`}),!x&&!C&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),A&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:B||A})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-DrEBh-QM.mjs";import{a as l}from"./index-UMYdObny.mjs";import{u as d}from"./internal-context-Cvo1WmWN.mjs";import{u as c,a as p}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{a1 as u,V as h}from"./useActiveWallet-BnhoT9lw.mjs";import{E as f,P as j}from"./Button-BvV3nq1d.mjs";import{I as v,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-CySJnyOi.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-D9FTjmQA.mjs";import"./prepareFundingModalData-B_fHl6nD.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BkrUs537.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-BagBuHbN.mjs";import"./ModalHeader-Bh_PKIU9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,v]=m(""),[g,w]=m(""),[k,S]=m(!1),{authenticated:A,user:x}=c(),{initUpdateEmail:C}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||A?(async e=>{if(!x?.email)throw Error("User is required to have an email address to update it.");S(!0);try{await C({oldAddress:x.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}S(!1)})(U):(M({captchaModalData:{callback:e=>{if(!x?.email)throw Error("User is required to have an email address to update it.");return C({oldAddress:x.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(E,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(f,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(j,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=v,E=g;const S=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),A={component:()=>/*#__PURE__*/t(S,{})};export{A as UpdateEmailScreen,S as UpdateEmailScreenView,A as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-Bs0KpBTr.mjs";import{u as i}from"./internal-context-Cvo1WmWN.mjs";import{a as n,u as m}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{S as a}from"./ScreenLayout-CySJnyOi.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-DrEBh-QM.mjs";import"tinycolor2";import"./useActiveWallet-BnhoT9lw.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-B_fHl6nD.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-D9FTjmQA.mjs";import"./Button-BvV3nq1d.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-BagBuHbN.mjs";import"./ModalHeader-Bh_PKIU9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:p}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await p(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{S as e}from"./ScreenLayout-CySJnyOi.mjs";import"viem";import"react";import"./context-DrEBh-QM.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./Button-BvV3nq1d.mjs";import"styled-components";import"./useActiveWallet-BnhoT9lw.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-B_fHl6nD.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-D9FTjmQA.mjs";import"./Screen-BagBuHbN.mjs";import"./ModalHeader-Bh_PKIU9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const i=({style:o,...e})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...o},...e,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:o="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
@@ -0,0 +1 @@
1
+ import{styled as o}from"styled-components";import{L as e}from"./LoadingSkeleton-CHdaq3pb.mjs";const r=/*#__PURE__*/o.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),a=/*#__PURE__*/o(r).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),i=/*#__PURE__*/o.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],e);export{r as L,i as V,a};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{Wallet as t}from"lucide-react";import{U as l,V as a,Y as o,F as c,Q as i,n as r,T as s}from"./useActiveWallet-BnhoT9lw.mjs";import{m as p,n as d,o as y}from"./index-UMYdObny.mjs";import{isMobile as w}from"react-device-detect";import{styled as m}from"styled-components";import{I as h}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{C as f}from"./Chip-Bsgj4Yc-.mjs";import{u}from"./internal-context-Cvo1WmWN.mjs";import{a as T}from"./get-is-unified-wallet-DjMnN6w-.mjs";const C=({onClick:c,text:i})=>/*#__PURE__*/e(l,{onClick:c,children:[/*#__PURE__*/n(a,{children:/*#__PURE__*/n(t,{})}),/*#__PURE__*/n(o,{children:i})]}),_=({provider:t,displayName:l,logo:a,connectOnly:o,connector:d})=>{let y,{navigate:m,setModalData:f}=T(),{connectWallet:C}=u(),_=c(),x=i(t),b="wallet_connect_v2"===d.connectorType?t:d.walletClientType,O=window.matchMedia("(display-mode: standalone)").matches,W=r({connectorType:d.connectorType,walletClientType:b});y=W&&W.chainTypes.includes(d.chainType)?()=>{W.isInstalled||"solana"===d.chainType&&"isInstalled"in d&&d.isInstalled?(C(d,b),m(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):w?(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("WalletInterstitialScreen")):(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("InstallWalletScreen"))}:"coinbase_wallet"!==d.connectorType||"eoaOnly"!==d.coinbaseWalletConfig.preference?.options||!w||O||s()?()=>{(!p(window.navigator.userAgent)||event?.isTrusted)&&(C(d,b),o?"wallet_connect_v2"===d.connectorType?(f((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),m("ConnectOnlyLandingScreen")):m("ConnectOnlyStatusScreen"):m("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let S=l||x?.metadata?.shortName||x?.name||d.walletClientType;/*#__PURE__*/return e(g,{onClick:y,children:[/*#__PURE__*/n(h,{icon:a||x?.image_url?.md,name:S}),/*#__PURE__*/n("span",{children:S}),/*#__PURE__*/e($,{id:"chip-container",children:[_?.walletClientType===b&&_?.chainType===d.chainType?/*#__PURE__*/n(v,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===d.chainType&&/*#__PURE__*/n(v,{color:"gray",children:"Solana"})]})]})};let g=/*#__PURE__*/m(l).withConfig({displayName:"ConnectWalletButton",componentId:"sc-5fe2f19b-0"})(["> span{color:var(--privy-color-foreground);}> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),v=/*#__PURE__*/m(f).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),$=/*#__PURE__*/m.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const x=["coinbase_wallet","base_account"];let b=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance"];const O=["safe"],W=["phantom","backpack","solflare","universal_profile"],S=({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:c,forceWallet:i})=>{let r=[],s=[],p=[],w=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=w.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,h]of(i?[i.wallet]:e).entries()){if("detected_ethereum_wallets"===h)for(let[e,t]of w.filter((({chainType:e,connectorType:n,walletClientType:t})=>"solana"!==e&&("uniswap_wallet_extension"===t||"uniswap_extension"===t?!o.includes("uniswap"):"crypto.com_wallet_extension"===t||"crypto.com_onchain"===t?!o.includes("cryptocom"):"injected"===n&&!o.includes(t)))).entries()){let{walletClientType:o,walletBranding:c,chainType:i}=t;("unknown"===o?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:o,logo:c.icon,displayName:c.name,connector:t},`${l}-${h}-${o}-${i}-${e}`))}if("detected_solana_wallets"===h)for(let[e,c]of w.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:i}=c;("unknown"===t?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:c},`${l}-${h}-${t}-${i}-${e}`))}if(W.includes(h)){let e=w.find((e=>"injected"===e.connectorType&&e.walletClientType===h||e.connectorType===h));if(e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(b.includes(h)){let e=w.find((e=>"uniswap"===h?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===h?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===h));if(c&&!e&&(e=m),e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(x.includes(h)){let e=w.find((({connectorType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?d:y},`${l}-${h}`))}else if(O.includes(h))m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m},`${l}-${h}`));else if("wallet_connect"===h)m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${h}`));else if(h===i?.wallet){let t="ethereum"===i.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===i.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=w.find((({walletClientType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${h}`))}}}return[...s,...r,...p]};export{C as W,S as t};
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as r}from"react/jsx-runtime";const e=({...e})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[/*#__PURE__*/r("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),/*#__PURE__*/r("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),/*#__PURE__*/r("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]});export{e as W};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{Check as i,Copy as r}from"lucide-react";import{useState as n,useEffect as s}from"react";import{styled as a}from"styled-components";import{S as d}from"./Button-BvV3nq1d.mjs";import{E as m}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as l}from"./LabelXs-BOisBtqT.mjs";import{A as c}from"./Address-8wLEsvcI.mjs";import{B as p}from"./shared-CtYf3O54.mjs";let f=/*#__PURE__*/a(p).withConfig({displayName:"StyledBox",componentId:"sc-4010d8f3-0"})(["&&{padding:0.75rem;height:56px;}"]),h=/*#__PURE__*/a.div.withConfig({displayName:"WalletContent",componentId:"sc-4010d8f3-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;"]),g=/*#__PURE__*/a.div.withConfig({displayName:"AddressContainer",componentId:"sc-4010d8f3-2"})(["display:flex;flex-direction:column;gap:0;"]),y=/*#__PURE__*/a.div.withConfig({displayName:"BalanceText",componentId:"sc-4010d8f3-3"})(["font-size:12px;line-height:1rem;color:var(--privy-color-foreground-3);"]),C=/*#__PURE__*/a(l).withConfig({displayName:"TitleLabel",componentId:"sc-4010d8f3-4"})(["text-align:left;margin-bottom:0.5rem;"]),u=/*#__PURE__*/a(m).withConfig({displayName:"StyledErrorMessage",componentId:"sc-4010d8f3-5"})(["margin-top:0.25rem;"]),x=/*#__PURE__*/a(d).withConfig({displayName:"CopyButton",componentId:"sc-4010d8f3-6"})(["&&{gap:0.375rem;font-size:14px;}"]);const w=({errMsg:a,balance:d,address:m,className:l,title:p,showCopyButton:w=!1})=>{let[v,N]=n(!1);return s((()=>{if(v){let e=setTimeout((()=>N(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e("div",{children:[p&&/*#__PURE__*/o(C,{children:p}),/*#__PURE__*/o(f,{className:l,$state:a?"error":void 0,children:/*#__PURE__*/e(h,{children:[/*#__PURE__*/e(g,{children:[/*#__PURE__*/o(c,{address:m,showCopyIcon:!1}),void 0!==d&&/*#__PURE__*/o(y,{children:d})]}),w&&/*#__PURE__*/o(x,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(m).then((()=>N(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/o(i,{size:14})]}:{children:["Copy",/*#__PURE__*/o(r,{size:14})]})})]})}),a&&/*#__PURE__*/o(u,{children:a})]})};export{w as W};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{u as o,a as i}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{S as n}from"./ScreenLayout-CySJnyOi.mjs";import"viem";import"./context-DrEBh-QM.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./Button-BvV3nq1d.mjs";import"styled-components";import"./useActiveWallet-BnhoT9lw.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-B_fHl6nD.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-D9FTjmQA.mjs";import"./Screen-BagBuHbN.mjs";import"./ModalHeader-Bh_PKIU9.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const r=({title:e,subtitle:o,buttonText:i,buttonHref:r,isLoading:l=!1,helpText:a,onButtonClick:m})=>/*#__PURE__*/t(n,{title:e,subtitle:o,primaryCta:{label:i,onClick:()=>{r&&window.open(r,"_self"),m?.()},disabled:l},helpText:a,watermark:!0}),l={component:()=>{let{ready:n}=o(),{data:l}=i(),[a,m]=e(!1);if(!l?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:s,connectOnly:c,chainType:p}=l.installWalletModalData,u=s.getMobileRedirect({useUniversalLink:!a,isSolana:"solana"===p,connectOnly:c}),d=s.name.replace(/ wallet/gi,""),h={title:`Redirecting to ${d} Mobile Wallet`,description:`We'll take you to the ${d} Mobile Wallet app to continue your login experience.`,footnote:""};return n&&(h.description=`For the best experience, we'll automatically log you into the ${d} Mobile Wallet in-app browser.`,h.footnote="You can always return here to login via other methods."),a&&(h.title="Still here?",h.description=`You may need to install the ${s.name} mobile app.`,h.footnote=`Once you're done, you can connect with ${s.name} wallet to complete the login.`),/*#__PURE__*/t(r,{title:h.title,subtitle:h.description,buttonText:a?"Go to App Store":"Continue",buttonHref:u,isLoading:n&&!u,helpText:h.footnote||void 0,onButtonClick:()=>{setTimeout((()=>m(!0)),1e3)}})}};export{l as WalletInterstitialScreen,r as WalletInterstitialScreenView,l as default};
@@ -0,0 +1,3 @@
1
+ import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{styled as n}from"styled-components";import{formatUnits as o}from"viem";import{s as r,a,g as s,b as c}from"./ethers-CDHJG_GP.mjs";import{g as l}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as d}from"./transaction-CnfuREWo.mjs";import{D as m}from"./useActiveWallet-BnhoT9lw.mjs";const p=({weiQuantities:t,tokenPrice:i,tokenSymbol:n})=>{let o=r(t),c=i?a(o,i):void 0,l=s(o,n);/*#__PURE__*/return e(y,{children:c||l})},h=({weiQuantities:n,tokenPrice:o,tokenSymbol:c})=>{let l=r(n),d=o?a(l,o):void 0,m=s(l,c);/*#__PURE__*/return e(y,{children:d?/*#__PURE__*/i(t,{children:[/*#__PURE__*/e(g,{children:"USD"}),"<$0.01"===d?
2
+ /*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):d]}):m})},f=({quantities:n,tokenPrice:r,tokenSymbol:a="SOL",tokenDecimals:s=9})=>{let c=n.reduce(((e,t)=>e+t),0n),m=r&&"SOL"===a&&9===s?l(c,r):void 0,p="SOL"===a&&9===s?d(c):`${o(c,s)} ${a}`;/*#__PURE__*/return e(y,{children:m?/*#__PURE__*/e(t,{children:"<$0.01"===m?
3
+ /*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):m}):p})};let y=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-3cd56c8a-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),g=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-3cd56c8a-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),u=/*#__PURE__*/n.span.withConfig({displayName:"TinyLessThan",componentId:"sc-3cd56c8a-2"})(["font-size:10px;"]),x=/*#__PURE__*/n.span.withConfig({displayName:"FlexCenter",componentId:"sc-3cd56c8a-3"})(["display:flex;align-items:center;"]);function S(e,t){return`https://explorer.solana.com/account/${e}?chain=${t}`}const w=t=>/*#__PURE__*/e(k,{href:"ethereum"===t.chainType?c(t.chainId,t.walletAddress):S(t.walletAddress,t.chainId),target:"_blank",children:m(t.walletAddress)});let k=/*#__PURE__*/n.a.withConfig({displayName:"StyledLink",componentId:"sc-dd6c0f9f-0"})(["&:hover{text-decoration:underline;}"]);export{p as H,h as P,f as S,w as W};
@@ -0,0 +1 @@
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{styled as i}from"styled-components";const t=({children:i,theme:t})=>/*#__PURE__*/r(n,{$theme:t,children:[/*#__PURE__*/e(o,{width:"20px",height:"20px",color:"var(--privy-color-icon-warning)",strokeWidth:2,style:{flexShrink:0}}),/*#__PURE__*/e(a,{$theme:t,children:i})]});let n=/*#__PURE__*/i.div.withConfig({displayName:"Container",componentId:"sc-a77c2854-0"})(["display:flex;gap:0.75rem;background-color:var(--privy-color-warn-bg);align-items:flex-start;padding:1rem;border-radius:0.75rem;"]),a=/*#__PURE__*/i.div.withConfig({displayName:"Content",componentId:"sc-a77c2854-1"})(["color:",";font-size:1rem;font-weight:400;line-height:1.5;flex:1;text-align:left;"],(r=>"dark"===r.$theme?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)"));export{t as W};
@@ -1 +1 @@
1
- import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,custom as n,http as a}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as s,zksync as c}from"viem/chains";import{ab as l,$ as p,ac as d,b4 as m,q as u,H as h,bD as y,bv as g,bL as I}from"./EmbeddedWalletConnectingScreen-DTl397rT.mjs";import{k as f}from"./events-context-DGSLy4O3.mjs";import{aa as v}from"./internal-context-eGSwROSk.mjs";import{S as w}from"./SignRequestScreen-Ca9hEGyq.mjs";import{g as C}from"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import{c as T}from"./smart-wallets-p7WscfjP.mjs";import"react/jsx-runtime";import"lucide-react";import"react";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";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/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/PhoneIcon";import"react-device-detect";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@privy-io/js-sdk-core";import"zustand";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";import"viem/utils";import"eventemitter3";import"@scure/base";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@privy-io/ethereum";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@headlessui/react";import"@privy-io/popup";import"@heroicons/react/24/solid/CheckCircleIcon";import"ofetch";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"jose";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@privy-io/urls";import"tinycolor2";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function S(){let{user:S}=l(),{hideWalletUIs:b,openPrivyModal:P,chains:W,appId:A,rpcConfig:M,client:F}=v(),q=f(),{wallets:x}=p(),{setModalData:E}=d(),_=m(S),k=!!_&&u(_),D=async(t=s.id)=>{let l=C(x);if(!l)throw Error("No connected wallet found");let p="string"==typeof t?r(t):t;if(![s.id,2741,c.id].includes(p))throw Error("Error, only Abstract and ZKSync Era chains are supported");let d=W.find((e=>e.id===p));if(!d)throw Error("Chain not configured");await l.switchChain(d.id);let m=await l.getEthereumProvider(),u=o({account:l.address,transport:n(m)}),h=i({address:l.address,signMessage:u.signMessage,signTransaction:u.signTransaction,signTypedData:u.signTypedData});return await e({chain:d,transport:a(I(d,M,A)),publicTransport:a(I(d,M,A)),signer:h})};return{signMessage:async({message:e},t)=>{let r=await D(t);return new Promise((async(t,o)=>{let{entropyId:n,entropyIdVerifier:a}=h(S);b.current=!0,E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:n,entropyIdVerifier:a,onCompleteNavigateTo:w,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))},signTypedData:async(e,t)=>{let r=await D(t);return new Promise((async(t,o)=>{b.current=!0;let{entropyId:n,entropyIdVerifier:a}=h(S);E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:n,entropyIdVerifier:a,onCompleteNavigateTo:w,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))},sendTransaction:async e=>{let r=await D(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(a,i)=>{b.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(S);E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:T({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!F)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,a=await r.prepareAbstractTransactionRequest(o);return await F.scanTransaction({metadata:{domain:q.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:a.from,to:a.to,value:a.value?.toString(),gas:a.gas?.toString(),gasPrice:a.gasPrice?.toString(),nonce:a.nonce?.toString(),data:a.data,eip_712_meta:{paymaster_params:{paymaster:a.paymaster,paymaster_input:a.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>a(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))},signTransaction:async e=>{let r=await D(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(a,i)=>{b.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(S);E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:T({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!F)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,a=await r.prepareAbstractTransactionRequest(o);return await F.scanTransaction({metadata:{domain:q.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:a.from,to:a.to,value:a.value?.toString(),gas:a.gas?.toString(),gasPrice:a.gasPrice?.toString(),nonce:a.nonce?.toString(),data:a.data,eip_712_meta:{paymaster_params:{paymaster:a.paymaster,paymaster_input:a.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let o=n?t(r.account.address,e):e,a=await r.prepareAbstractTransactionRequest(o);return r.signTransaction(a)},onSuccess:e=>a(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))}}}export{S as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as a}from"@abstract-foundation/agw-client/actions";import{hexToNumber as n,createWalletClient as t,custom as r,http as s}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as o,zksync as c}from"viem/chains";import{u as d,a as l,b as m,d as p}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{u}from"./context-DrEBh-QM.mjs";import{u as g}from"./internal-context-Cvo1WmWN.mjs";import{u as y,g as f}from"./useWallets-D9FTjmQA.mjs";import{a as h}from"./getPublicClient-IxRndou_.mjs";import{g as v}from"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import{c as I}from"./smart-wallets-DSw3zXfv.mjs";import"react/jsx-runtime";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=d(),{hideWalletUIs:S,openPrivyModal:w,chains:P,appId:W,rpcConfig:b,client:C}=g(),F=u(),{wallets:M}=y(),{setModalData:_}=l(),x=m(T),A=!!x&&p(x),q=async(a=o.id)=>{let d=v(M);if(!d)throw Error("No connected wallet found");let l="string"==typeof a?n(a):a;if(![o.id,2741,c.id].includes(l))throw Error("Error, only Abstract and ZKSync Era chains are supported");let m=P.find((e=>e.id===l));if(!m)throw Error("Chain not configured");await d.switchChain(m.id);let p=await d.getEthereumProvider(),u=t({account:d.address,transport:r(p)}),g=i({address:d.address,signMessage:u.signMessage,signTransaction:u.signTransaction,signTypedData:u.signTypedData});return await e({chain:m,transport:s(h(m,b,W)),publicTransport:s(h(m,b,W)),signer:g})};return{signMessage:async({message:e},a)=>{let n=await q(a);return new Promise((async(a,t)=>{let{entropyId:r,entropyIdVerifier:s}=f(T);S.current=!0,_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>n.signMessage({message:e}),onSuccess:e=>a(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},signTypedData:async(e,a)=>{let n=await q(a);return new Promise((async(a,t)=>{S.current=!0;let{entropyId:r,entropyIdVerifier:s}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>n.signTypedData(e),onSuccess:e=>a(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},sendTransaction:async e=>{let n=await q(e.chainId),t=[],r="calls"in e&&void 0!==e.calls;return t=r?[...e.calls]:[e],new Promise((async(s,i)=>{S.current=!0;let{entropyId:o,entropyIdVerifier:c}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:o,entropyIdVerifier:c,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:I({calls:t,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:c,transactingWalletAddress:n.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=r?a(n.account.address,e):e;return await n.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!C)throw Error("Privy client not found");let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return await C.scanTransaction({metadata:{domain:F.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:s.from,to:s.to,value:s.value?.toString(),gas:s.gas?.toString(),gasPrice:s.gasPrice?.toString(),nonce:s.nonce?.toString(),data:s.data,eip_712_meta:{paymaster_params:{paymaster:s.paymaster,paymaster_input:s.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>r?n.sendTransactionBatch(e):n.sendTransaction(e),onSuccess:e=>s(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},signTransaction:async e=>{let n=await q(e.chainId),t=[],r="calls"in e&&void 0!==e.calls;return t=r?[...e.calls]:[e],new Promise((async(s,i)=>{S.current=!0;let{entropyId:o,entropyIdVerifier:c}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:o,entropyIdVerifier:c,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:I({calls:t,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:c,transactingWalletAddress:n.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=r?a(n.account.address,e):e;return await n.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!C)throw Error("Privy client not found");let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return await C.scanTransaction({metadata:{domain:F.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:s.from,to:s.to,value:s.value?.toString(),gas:s.gas?.toString(),gasPrice:s.gasPrice?.toString(),nonce:s.nonce?.toString(),data:s.data,eip_712_meta:{paymaster_params:{paymaster:s.paymaster,paymaster_input:s.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return n.signTransaction(s)},onSuccess:e=>s(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))}}}export{T as useAbstractSmartWallets};
@@ -0,0 +1 @@
1
+ const t="sdk_fiat_on_ramp_completed_with_status";export{t as O};
@@ -0,0 +1 @@
1
+ function e(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{e};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as n,useEffect as a,createContext as o,useContext as l}from"react";import{dedupeSupportedChains as r,DEFAULT_SUPPORTED_CHAINS as i,mainnet as c}from"@privy-io/js-sdk-core";import s from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.8.0-beta-20251120191721",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",F="privy-id-token",C="privy-session",y="privy:caid",M=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,A="privy:state_code",x="privy:code_verifier",B="privy:headless_oauth",D="privy:oauth_disable_signup",W=e=>`privy:wallet:${e}`,S="privy:connections",H=12e4,L=1,I="0x1",O=3e4,U="https://api.moonpay.com/v1",q="https://api.moonpay.com/v1",P="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated",T={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let N=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","binance","binanceus","bitget_wallet"]),$=e=>N.has(e),z=(e,t,n)=>n.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($).filter(z):e?e.filter($).filter(z):T.appearance.walletList;function J(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:n})}function G(e,t){let n=e.getLuminance(),a=t.getLuminance();return(Math.max(n,a)+.05)/(Math.min(n,a)+.05)}function K(e,t){if(!e){let e=t?X:Z;return{accent:s(e.background.interactive),accentLight:s(e.background.interactive),accentHover:s(e.background["interactive-hover"]),accentDark:s(e.background["interactive-clicked"]),accentDarkest:s(e.background["interactive-disabled"])}}let n=s(e);return{accent:n,accentLight:J(n,.15),accentHover:J(n,.3),accentDark:J(n,-.06),accentDarkest:J(n,-.6)}}function V({backgroundTheme:e,accentHex:t}){let n,a;"light"===e?n=!1:"dark"===e?n=!0:(n=.5>=s(e).getLuminance(),a=s(e).toHslString());let o=n?"dark":"light",l=n?X:Z,{accent:r,accentLight:i,accentHover:c,accentDark:d,accentDarkest:u}=K(t,n),g=function(e){let t=s(Z.text.default),n=s(X.text.default),a=G(e,t),o=G(e,n),l=e.toHsl();return l.h>=220&&l.h<=300&&o>=3?X.text.default:a>o?Z.text.default:X.text.default}(r),h=s(g),f=G(r,s(l.background.default))>=3;return{colorScheme:o,background:a||l.background.default,background2:l.background.elevated,background3:l.background.interactive,foreground:l.text.default,foreground2:l.text.muted,foreground3:l.text.placeholder,foreground4:l.border.default,accent:r.toHslString(),accentLight:i.toHslString(),accentHover:c.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:l.background.success,successDark:l.text.success,successLight:l.background.success,error:l.text.error,errorLight:l.background.error,warn:l.background.warning,warnLight:l.background.warning,warningDark:l.text.warning,errorDark:l.text.error,successBg:l.background.success,errorBg:l.background.error,errorBgHover:l.background["error-hover"],warnBg:l.background.warning,infoBg:l.background.info,infoBgHover:l.background["info-hover"],borderDefault:l.border.default,borderHover:l.border["default-hover"],borderFocus:l.border.focused,borderError:l.border.error,borderSuccess:l.border.success,borderWarning:l.border.warning,borderInfo:l.border.info,borderInteractive:l.border.interactive,borderInteractiveHover:l.border["interactive-hover"],backgroundHover:l.background["default-hover"],backgroundClicked:l.background["default-clicked"],backgroundDisabled:l.background["default-disabled"],backgroundInteractive:l.background.interactive,backgroundInteractiveHover:l.background["interactive-hover"],backgroundInteractiveClicked:l.background["interactive-clicked"],backgroundInteractiveDisabled:l.background["interactive-disabled"],foregroundHover:l.text.default,foregroundClicked:l.text.default,foregroundDisabled:l.text["default-disabled"],foregroundInteractive:l.text.interactive,foregroundInteractiveHover:l.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?r.toHslString():l.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:l.icon.default,iconMuted:l.icon.muted,iconSubtle:l.icon.subtle,iconInverse:l.icon.inverse,iconSuccess:l.icon.success,iconWarning:l.icon.warning,iconError:l.icon.error,iconInteractive:l.icon.interactive,iconDefaultHover:l.icon["default-hover"],iconMutedHover:l.icon["muted-hover"],iconSubtleHover:l.icon["subtle-hover"],iconDefaultClicked:l.icon["default-clicked"],iconMutedClicked:l.icon["muted-clicked"],iconSubtleClicked:l.icon["subtle-clicked"],iconDefaultDisabled:l.icon["default-disabled"],iconMutedDisabled:l.icon["muted-disabled"],iconSubtleDisabled:l.icon["subtle-disabled"],iconErrorHover:l.icon["error-hover"],iconInteractiveHover:l.icon["interactive-hover"],iconErrorClicked:l.icon["error-clicked"],iconInteractiveClicked:l.icon["interactive-clicked"],iconMutedDisabledAlt:l.icon["muted-disabled"],iconSubtleDisabledAlt:l.icon["subtle-disabled"]}}const X={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},Z={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function Q(e,t,n,a,o){let l,s,d,u,g,h,f,p,_,b,m,v,w,k,F,C,y,M=n?console.warn:()=>{};t?.loginMethods?(l=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),F=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey")):(l=e.email_auth,s=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,F=e.apple_oauth,C=e.farcaster_auth,y=e.telegram_auth,d=e.passkey_auth),e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let E=[l,s].filter(Boolean),A=[g,h,f,k,m,v,p,_,w,F,C,y].filter(Boolean),x=[u].filter(Boolean),B=t?.loginMethods?.includes("passkey")??!1,D=e.passkeys_for_signup_enabled??!1,W=[d&&(D||B)].filter(Boolean);if(E.length+A.length+x.length+W.length===0)throw Error("You must enable at least one login method");let S=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;S&&0===x.length?(M("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):S||A.length+E.length!==0||(M("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let H=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&M("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((L.includes("wallet_connect_qr")||L.includes("wallet_connect"))&&L.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let I=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];for(let n of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(n)?console.warn(`Duplicated login method: ${n}`):t.push(n);for(let a of e.overflow??[])t.includes(a)||n.includes(a)?console.warn(`Duplicated login method: ${a}`):n.push(a);return{primary:t,overflow:n}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:q}=function({supportedChains:e,defaultChainFromConfig:t}){let n;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");n=r(e)}else n=[...i];let a=e?n[0]:c,o=t??a;if(!n.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),P=!!t?.defaultChain,j=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=j?"all-users":e.embedded_wallet_config.ethereum.create_on_login,N=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let $=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,z=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??T.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:V({backgroundTheme:t?.appearance?.theme??T.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:l,sms:s,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:F,farcaster:C,telegram:y},customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:I,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??T.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:U,defaultChain:q,intl:{defaultCountry:O,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captcha_enabled??T.captchaEnabled,captchaSiteKey:e.captcha_site_key,externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:H},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!j&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:j?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??R},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??N},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??a??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:j?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:$,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??T._render.standalone},fundingConfig:z,fundingMethodConfig:{...t?.fundingMethodConfig??T.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??T.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??T.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null}}}const ee={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_enabled:!1,captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let te=/*#__PURE__*/o({appConfig:Q(ee,void 0,!1),isServerConfigLoaded:!1});const ne=({children:o,client:l,legacyClient:r,clientConfig:i,appClientId:c})=>{let[s,d]=t(null),u=n((()=>Q(s??ee,i,!!s,"undefined"!=typeof window?window.location.origin:void 0,c)),[s,i,c]);return a((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:n,defaultChain:a,externalWallets:o,...l}=e;return{...l,...n?{supportedChains:n.map((e=>e.id))}:void 0,...a?{defaultChain:a.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let n=3735928559^t,a=1103547991^t;for(let t,o=0;o<e.length;o++)n=Math.imul(n^(t=e.charCodeAt(o)),2654435761),a=Math.imul(a^t,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(JSON.stringify(e)).toString(),n=`privy:sent:${s.id}:${t}`;localStorage.getItem(n)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))}),[i,s]),a((()=>{s||(async()=>{try{await l.initialize();let e=l.app.getConfig();e.custom_api_url&&r.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(te.Provider,{value:{appConfig:u,isServerConfigLoaded:!!s},children:o})},ae=()=>{let{appConfig:e}=l(te);return e},oe=()=>{let{isServerConfigLoaded:e}=l(te);return e};export{_ as C,d as D,B as H,k as I,q as M,D as O,w as P,m as R,A as S,p as V,O as W,x as a,S as b,oe as c,y as d,E as e,C as f,M as g,R as h,b as i,v as j,F as k,u as l,ne as m,H as n,W as o,I as p,g as q,h as r,L as s,f as t,ae as u,U as v,j as w,P as x};
@@ -0,0 +1 @@
1
+ import{jsx as h}from"react/jsx-runtime";const c=({color:c,...v})=>/*#__PURE__*/h("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...v,children:/*#__PURE__*/h("g",{children:/*#__PURE__*/h("path",{fill:c||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});export{c as C};
@@ -0,0 +1 @@
1
+ import{formatEther as e}from"viem";import{u as r}from"./internal-context-Cvo1WmWN.mjs";import{a5 as t}from"./useActiveWallet-BnhoT9lw.mjs";let a=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),s=e=>a.format(e);const n=(e,r)=>{let t=s(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},o=(r,t)=>{let a=s(t*parseFloat(e(r)));return"$0.00"===a?"<$0.01":a},c=(e,r,t=6,a=!1)=>`${i(e,t,a)} ${r}`,i=(r,t=6,a=!1)=>{let s=parseFloat(e(r)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return a?s:`${"0"===s?"<0.001":s}`},l=e=>e.reduce(((e,r)=>e+r),0n),m=(e,a)=>{let{chains:s}=r(),n=`https://etherscan.io/address/${a}`,o=`${t(e,s)}/address/${a}`;if(!o)return n;try{new URL(o)}catch{return n}return o};export{o as a,m as b,n as c,c as g,i as p,l as s};
@@ -0,0 +1 @@
1
+ import{createContext as o,useContext as e,useEffect as n}from"react";const r={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},t=/*#__PURE__*/o(void 0);let c=()=>e(t);function s(o,e){if(!e)return;let r=c().current[o];return n((()=>{for(let[n,t]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,n)||console.warn(`Invalid event type "${n}" for action "${o}"`),r[n]?.push(t);return()=>{for(let[n,t]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,n)||console.warn(`Invalid event type "${n}" for action "${o}"`),r[n]=r[n]?.filter((o=>o!==t))}}),[e])}function a(o,e,n,...r){for(let t of o.current[e][n])t(...r)}function u(){let o=c();return(e,n,...r)=>a(o,e,n,...r)}export{t as P,u as a,a as e,r as p,s as u};
@@ -1 +1 @@
1
- import{useMemo as e}from"react";import{create as o,rawSign as r}from"@privy-io/js-sdk-core";import{aa as t,P as i}from"./internal-context-eGSwROSk.mjs";import{ab as n,ac as c,bc as a,q as s,bu as l,bv as p,cN as m}from"./EmbeddedWalletConnectingScreen-DTl397rT.mjs";import{k as u}from"./events-context-DGSLy4O3.mjs";import{u as d}from"./use-sign-with-user-signer-DaTvrd5T.mjs";import"ofetch";import"react/jsx-runtime";import"lucide-react";import"viem";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";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/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/PhoneIcon";import"react-device-detect";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"zustand";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";import"viem/utils";import"eventemitter3";import"@scure/base";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@privy-io/ethereum";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@headlessui/react";import"@privy-io/popup";import"@heroicons/react/24/solid/CheckCircleIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"jose";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@privy-io/urls";import"tinycolor2";const h=()=>{let{refreshSessionAndUser:r,privy:i}=t();return e((()=>({async createWallet(e){let t=await o(i,{request:{chain_type:e.chainType}}),n=await r();if(!n)throw Error("User must be authenticated before creating a Privy wallet");return{user:n,wallet:t}}})),[r,i])};function I(){let{user:o,getAccessToken:r}=n(),{walletProxy:m,openModal:d,client:h}=t(),{setModalData:I}=c(),w=u();return e((()=>({exportWallet:e=>new Promise((async(t,n)=>{if(!o)return void n(new i("User must be authenticated before exporting their Privy wallet"));let c=a(o,e.address);c?"spark"===c.chainType&&s(c)?await r()?m?(I({connectWallet:{recoveryMethod:c.recoveryMethod,connectingWalletAddress:c.address,isUnifiedWallet:!0,onCompleteNavigateTo:l,onFailure:n,shouldForceMFA:!0},keyExport:{appId:w.id,appClientId:w.appClientId,origin:h.apiUrl,address:c.address,hdWalletIndex:c.walletIndex,chainType:c.chainType,walletId:c.id,isUnifiedWallet:!0,imported:c.imported,onSuccess:t,onFailure:n}}),d(p)):n(new i("Wallet not ready for export")):n(new i("Must have valid access token.")):n(Error("Export via extended-chains is only supported for unified stack wallets")):n(new i("User must have an embedded wallet."))}))})),[o,r,m,d,h,I,w])}const w=()=>{let{user:o}=n(),{privy:i}=t(),{signWithUserSigner:c}=d();return e((()=>({async signRawHash({address:e,chainType:t,hash:n}){if(!o)throw Error("User must be authenticated before signing");let a=m(o,t).filter((e=>s(e))).find((o=>o.address===e));if(!a)throw Error("Wallet not found");let l=await r(i,c,{wallet_id:a.id,params:{hash:n}});if(l.data&&"signature"in l.data&&"hex"===l.data.encoding)return{signature:l.data.signature};throw Error("Failed to sign")}})),[i,c,o])};export{h as useCreateWallet,I as useExportWallet,w as useSignRawHash};
1
+ import{useMemo as e}from"react";import{create as t,rawSign as r}from"@privy-io/js-sdk-core";import{u as a,a as i}from"./internal-context-Cvo1WmWN.mjs";import{u as n,a as s,h as o,d,n as l}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{u as c}from"./context-DrEBh-QM.mjs";import{u as p}from"./use-sign-with-user-signer-LJ6ROduD.mjs";import"ofetch";import"viem";import"react/jsx-runtime";import"tinycolor2";const u=()=>{let{refreshSessionAndUser:r,privy:i}=a();return e((()=>({async createWallet(e){let a=await t(i,{request:{chain_type:e.chainType}}),n=await r();if(!n)throw Error("User must be authenticated before creating a Privy wallet");return{user:n,wallet:a}}})),[r,i])};function m(){let{user:t,getAccessToken:r}=n(),{walletProxy:l,openModal:p,client:u}=a(),{setModalData:m}=s(),h=c();return e((()=>({exportWallet:e=>new Promise((async(a,n)=>{if(!t)return void n(new i("User must be authenticated before exporting their Privy wallet"));let s=o(t,e.address);s?"spark"===s.chainType&&d(s)?await r()?l?(m({connectWallet:{recoveryMethod:s.recoveryMethod,connectingWalletAddress:s.address,isUnifiedWallet:!0,onCompleteNavigateTo:"EmbeddedWalletKeyExportScreen",onFailure:n,shouldForceMFA:!0},keyExport:{appId:h.id,appClientId:h.appClientId,origin:u.apiUrl,address:s.address,hdWalletIndex:s.walletIndex,chainType:s.chainType,walletId:s.id,isUnifiedWallet:!0,imported:s.imported,onSuccess:a,onFailure:n}}),p("EmbeddedWalletConnectingScreen")):n(new i("Wallet not ready for export")):n(new i("Must have valid access token.")):n(Error("Export via extended-chains is only supported for unified stack wallets")):n(new i("User must have an embedded wallet."))}))})),[t,r,l,p,u,m,h])}const h=()=>{let{user:t}=n(),{privy:i}=a(),{signWithUserSigner:s}=p();return e((()=>({async signRawHash({address:e,chainType:a,hash:n}){if(!t)throw Error("User must be authenticated before signing");let o=l(t,a).filter((e=>d(e))).find((t=>t.address===e));if(!o)throw Error("Wallet not found");let c=await r(i,s,{wallet_id:o.id,params:{hash:n}});if(c.data&&"signature"in c.data&&"hex"===c.data.encoding)return{signature:c.data.signature};throw Error("Failed to sign")}})),[i,s,t])};export{u as useCreateWallet,m as useExportWallet,h as useSignRawHash};
@@ -0,0 +1 @@
1
+ import{jsxs as i,jsx as t}from"react/jsx-runtime";const l=l=>/*#__PURE__*/i("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...l,children:[/*#__PURE__*/t("rect",{x:"0.5",width:"32",height:"32",rx:"4",fill:"#855DCD"}),/*#__PURE__*/i("g",{"clip-path":"url(#clip0_1715_1960)",children:[/*#__PURE__*/t("path",{d:"M4.5 4H28.5V28H4.5V4Z",fill:"#855DCD"}),/*#__PURE__*/t("path",{d:"M11.1072 8.42105H21.6983V23.5789H20.1437V16.6357H20.1284C19.9566 14.7167 18.3542 13.2129 16.4028 13.2129C14.4514 13.2129 12.849 14.7167 12.6771 16.6357H12.6619V23.5789H11.1072V8.42105Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M8.28943 10.5725L8.92101 12.7239H9.45542V21.4275C9.1871 21.4275 8.96959 21.6464 8.96959 21.9165V22.5032H8.87242C8.60411 22.5032 8.38659 22.7221 8.38659 22.9922V23.5789H13.8279V22.9922C13.8279 22.7221 13.6104 22.5032 13.3421 22.5032H13.2449V21.9165C13.2449 21.6464 13.0274 21.4275 12.7591 21.4275H12.1761V10.5725H8.28943Z",fill:"white"}),/*#__PURE__*/t("path",{d:"M20.2408 21.4275C19.9725 21.4275 19.755 21.6464 19.755 21.9165V22.5032H19.6579C19.3895 22.5032 19.172 22.7221 19.172 22.9922V23.5789H24.6133V22.9922C24.6133 22.7221 24.3958 22.5032 24.1275 22.5032H24.0303V21.9165C24.0303 21.6464 23.8128 21.4275 23.5445 21.4275V12.7239H24.0789L24.7105 10.5725H20.8238V21.4275H20.2408Z",fill:"white"})]}),/*#__PURE__*/t("defs",{children:/*#__PURE__*/t("clipPath",{id:"clip0_1715_1960",children:/*#__PURE__*/t("rect",{width:"24",height:"24",fill:"white",transform:"translate(4.5 4)"})})})]});export{l as F};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{F as i}from"./frame-Dj70FEYB.mjs";import{aa as e,P as a}from"./internal-context-eGSwROSk.mjs";import"ofetch";const r=()=>{let{client:r,setAuthenticated:n,setUser:s}=e();return{initLoginToMiniApp:t((async()=>{let t=new i;if(!r)throw new a("Must initialize Privy client first.");return r.startAuthFlow(t),await t.init()}),[r]),loginToMiniApp:t((async({message:t,signature:e})=>{if(!r)throw new a("Must initialize Privy client first.");if(!(r.authFlow instanceof i))throw new a("Must initialize Farcaster Mini App flow first.");let o=(t=>{let i=t.match(/farcaster:\/\/fid\/(\d+)/);return i&&i[1]?parseInt(i[1],10):null})(t);if(!o)throw new a("Invalid message format; could not parse Farcaster ID.");r.authFlow.setAuthData({message:t,signature:e,fid:o});let{user:l}=await r.authenticate();return l&&(s(l),n(!0)),l}),[r,s,n])}};export{r as useLoginToMiniApp};
1
+ import{useCallback as t}from"react";import{F as i}from"./frame-BMa3kyjk.mjs";import{u as e,a as r}from"./internal-context-Cvo1WmWN.mjs";import"./paths-3HW55qZg.mjs";import"ofetch";const a=()=>{let{client:a,setAuthenticated:n,setUser:s}=e();return{initLoginToMiniApp:t((async()=>{let t=new i;if(!a)throw new r("Must initialize Privy client first.");return a.startAuthFlow(t),await t.init()}),[a]),loginToMiniApp:t((async({message:t,signature:e})=>{if(!a)throw new r("Must initialize Privy client first.");if(!(a.authFlow instanceof i))throw new r("Must initialize Farcaster Mini App flow first.");let o=(t=>{let i=t.match(/farcaster:\/\/fid\/(\d+)/);return i&&i[1]?parseInt(i[1],10):null})(t);if(!o)throw new r("Invalid message format; could not parse Farcaster ID.");a.authFlow.setAuthData({message:t,signature:e,fid:o});let{user:l}=await a.authenticate();return l&&(s(l),n(!0)),l}),[a,s,n])}};export{a as useLoginToMiniApp};
@@ -0,0 +1 @@
1
+ let m=2n**256n-1n;const t=({amount:t,decimals:a})=>t===m?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:a}).format(Number(t)/10**a);export{t as f};
@@ -0,0 +1 @@
1
+ import{a as t,f as s}from"./internal-context-Cvo1WmWN.mjs";import{a5 as i,a6 as a}from"./paths-3HW55qZg.mjs";class e{async init(){if(!this.api)throw new t("Auth flow has no API instance");let{nonce:s,expires_at:a}=await this.api.post(i,{});return{nonce:s,expiresAt:a}}async authenticate(){if(!this.message||!this.signature||!this.fid)throw new t("Auth flow has no message, signature, or fid");if(!this.api)throw new t("Auth flow has no API instance");try{let s=await this.api.post(a,{message:this.message,signature:this.signature,fid:this.fid});if(!s)throw new t("No response from authentication");return s}catch(t){throw s(t)}}async link(){throw Error("Not implemented")}setAuthData({message:t,signature:s,fid:i}){this.message=t,this.signature=s,this.fid=i}constructor(){this.meta={}}}export{e as F};
@@ -0,0 +1 @@
1
+ import{getAddress as e}from"viem";import{jsx as t,jsxs as i}from"react/jsx-runtime";import{useContext as a,createContext as r,useState as s,useRef as l,useEffect as n}from"react";import{u}from"./context-DrEBh-QM.mjs";import{n as d}from"./internal-context-Cvo1WmWN.mjs";function o(e){return"string"==typeof e&&/^custom:[a-zA-Z0-9_-]+$/i.test(e)}function c(e){return e?new Date(1e3*e):null}function p(e,t){return e.slice().sort(((e,t)=>(e.firstVerifiedAt?.getTime()??0)-(t.firstVerifiedAt?.getTime()??0))).find((e=>e.type===t))}const m=e=>e?f(e).find((e=>0===e.walletIndex))??null:null,f=e=>e?_(e,"ethereum"):[],_=(e,t)=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&e.chainType===t)),y=e=>e?_(e,"solana"):[],h=e=>e?y(e).find((e=>0===e.walletIndex))??null:null,b=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)),k=e=>(e?.linkedAccounts??[]).filter((e=>"wallet"===e.type&&e.imported&&"privy"===e.walletClientType&&"solana"===e.chainType)),g=(t,i)=>t===i||!(!t.startsWith("0x")||!i.startsWith("0x"))&&e(t)===e(i),v=(e,t)=>e?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType&&g(e.address,t)))||null,A=(e,t)=>e.find((e=>g(e.address,t)))||null,j=e=>m(e)??h(e);function w(e){if(!e)return null;let t=function(e){let t=[];for(let i of e){let e=i.type;switch(i.type){case"wallet":let a={id:i.id,address:i.address,type:i.type,imported:i.imported,delegated:i.delegated,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),chainType:i.chain_type,walletClientType:i.wallet_client_type,connectorType:i.connector_type,recoveryMethod:i.recovery_method,walletIndex:i.wallet_index,publicKey:i.public_key};t.push(a);break;case"smart_wallet":let r={address:i.address,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),smartWalletType:i.smart_wallet_type,smartWalletVersion:i.smart_wallet_version};t.push(r);break;case"cross_app":let s={type:i.type,subject:i.subject,embeddedWallets:i.embedded_wallets,smartWallets:i.smart_wallets,providerApp:{id:i.provider_app_id},firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(s);break;case"email":let l={address:i.address,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(l);break;case"phone":let n={number:i.phoneNumber,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(n);break;case"google_oauth":let u={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(u);break;case"spotify_oauth":let d={subject:i.subject,email:i.email,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(d);break;case"instagram_oauth":let p={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(p);break;case"twitter_oauth":let m={subject:i.subject,username:i.username,name:i.name,type:i.type,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(m);break;case"discord_oauth":let f={subject:i.subject,username:i.username,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(f);break;case"github_oauth":let _={subject:i.subject,username:i.username,name:i.name,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(_);break;case"tiktok_oauth":let y={subject:i.subject,username:i.username,name:i.name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(y);break;case"line_oauth":let h={subject:i.subject,name:i.name,email:i.email,profilePictureUrl:i.profile_picture_url,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(h);break;case"twitch_oauth":let b={subject:i.subject,username:i.username,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(b);break;case"linkedin_oauth":let k={subject:i.subject,name:i.name,email:i.email,vanityName:i.vanity_name,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(k);break;case"apple_oauth":let g={subject:i.subject,email:i.email,type:i.type,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(g);break;case"custom_auth":t.push({type:i.type,customUserId:i.custom_user_id,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)});break;case"farcaster":let v={type:i.type,fid:i.fid,ownerAddress:i.owner_address,displayName:i.display_name,username:i.username,bio:i.bio,pfp:i.profile_picture_url,url:i.homepage_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at),signerPublicKey:i.signer_public_key};t.push(v);break;case"passkey":let A={type:i.type,enrolledInMfa:i.enrolled_in_mfa,credentialId:i.credential_id,publicKey:i.public_key,authenticatorName:i.authenticator_name,createdWithDevice:i.created_with_device,createdWithOs:i.created_with_os,createdWithBrowser:i.created_with_browser,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(A);break;case"telegram":let j={type:i.type,telegramUserId:i.telegram_user_id,firstName:i.first_name,lastName:i.last_name,username:i.username,photoUrl:i.photo_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(j);break;default:if(o(i.type)){let e={type:i.type,subject:i.subject,name:i.name,username:i.username,email:i.email,profilePictureUrl:i.profile_picture_url,firstVerifiedAt:c(i.first_verified_at),latestVerifiedAt:c(i.latest_verified_at)};t.push(e);break}console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),i=p(t,"wallet"),a=p(t,"smart_wallet"),r=p(t,"email"),s=p(t,"phone"),l=p(t,"google_oauth"),n=p(t,"twitter_oauth"),u=p(t,"discord_oauth"),d=p(t,"github_oauth"),m=p(t,"spotify_oauth"),f=p(t,"instagram_oauth"),_=p(t,"tiktok_oauth"),y=p(t,"line_oauth"),h=p(t,"twitch_oauth"),b=p(t,"linkedin_oauth"),k=p(t,"apple_oauth"),g=p(t,"farcaster"),v=p(t,"telegram"),A=e.mfa_methods.map((({type:e,verified_at:t})=>({type:e,verifiedAt:c(t)})));return{id:e.id,createdAt:c(e.created_at),linkedAccounts:t,email:r&&{address:r?.address},phone:s&&{number:s?.number},wallet:i&&{id:i.id,address:i.address,chainType:i.chainType,walletClientType:i.walletClientType,connectorType:i.connectorType,recoveryMethod:i.recoveryMethod,imported:i.imported,delegated:i.delegated,walletIndex:i.walletIndex,publicKey:i.publicKey},smartWallet:a&&{address:a.address,smartWalletType:a.smartWalletType,smartWalletVersion:a.smartWalletVersion},google:l&&{subject:l.subject,email:l.email,name:l.name},twitter:n&&{subject:n.subject,username:n.username,name:n.name,profilePictureUrl:n.profilePictureUrl},discord:u&&{subject:u.subject,username:u.username,email:u.email},github:d&&{subject:d.subject,username:d.username,name:d.name,email:d.email},spotify:m&&{subject:m.subject,email:m.email,name:m.name},instagram:f&&{subject:f.subject,username:f.username},tiktok:_&&{subject:_.subject,username:_.username,name:_.name},line:y&&{subject:y.subject,name:y.name,email:y.email,profilePictureUrl:y.profilePictureUrl},twitch:h&&{subject:h.subject,username:h.username},linkedin:b&&{subject:b.subject,name:b.name,email:b.email,vanityName:b.vanityName},apple:k&&{subject:k.subject,email:k.email},farcaster:g&&{fid:g.fid,ownerAddress:g.ownerAddress,displayName:g.displayName,username:g.username,bio:g.bio,pfp:g.pfp,url:g.url,signerPublicKey:g.signerPublicKey},telegram:v&&{telegramUserId:v.telegramUserId,firstName:v.firstName,lastName:v.lastName,username:v.username,photoUrl:v.photoUrl},delegatedWallets:[],mfaMethods:A.map((e=>e.type)),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest,customMetadata:e.custom_metadata}}function V({src:e,...i}){/*#__PURE__*/return t("img",{src:e,...i,style:{display:"none"}})}const T=/*#__PURE__*/r({currentScreen:null,lastScreen:null,navigate:d,navigateBack:d,resetNavigation:d,setModalData:d,onUserCloseViaDialogOrKeybindRef:void 0}),W=e=>{let a=u(),[r,d]=s(e.initialScreen),o=l(null);n((()=>{e.open||(o.current=null)}),[e.open]),n((()=>{o.current=null}),[e.initialScreen]);let c={data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:r,navigate:(t,i=!0)=>{e.setInitialScreen(t),i&&d(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(r)},resetNavigation:()=>{e.setInitialScreen(null),d(null)},onUserCloseViaDialogOrKeybindRef:o};/*#__PURE__*/return i(T.Provider,{value:c,children:[("string"==typeof a.appearance.logo||"img"===a.appearance.logo?.type)&&/*#__PURE__*/t(V,{src:"string"==typeof a.appearance.logo?a.appearance.logo:a.appearance.logo.props.src}),e.children]})},P=()=>a(T),I=/*#__PURE__*/r({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:d,login:d,connectOrCreateWallet:d,linkEmail:d,linkPhone:d,linkFarcaster:d,linkWallet:d,startCrossAppAuthFlow:d,linkGoogle:d,linkTwitter:d,linkTwitch:d,linkDiscord:d,linkGithub:d,linkSpotify:d,linkInstagram:d,linkTelegram:d,linkTiktok:d,linkLine:d,linkLinkedIn:d,linkApple:d,linkPasskey:d,updateEmail:d,updatePhone:d,logout:d,getAccessToken:d,unlinkEmail:d,unlinkPhone:d,unlinkWallet:d,unlinkGoogle:d,unlinkTwitter:d,unlinkTwitch:d,unlinkDiscord:d,unlinkGithub:d,unlinkSpotify:d,unlinkInstagram:d,unlinkTiktok:d,unlinkLine:d,unlinkLinkedIn:d,unlinkApple:d,unlinkCrossAppAccount:d,unlinkFarcaster:d,unlinkTelegram:d,unlinkPasskey:d,signMessage:d,signTypedData:d,enrollInMfa:d,initEnrollmentWithSms:d,initEnrollmentWithTotp:d,initEnrollmentWithPasskey:d,promptMfa:d,init:d,submitEnrollmentWithSms:d,submitEnrollmentWithTotp:d,submitEnrollmentWithPasskey:d,unenroll:d,submit:d,cancel:d,sendTransaction:d,signTransaction:d,exportWallet:d,setWalletPassword:d,setWalletRecovery:d,requestFarcasterSignerFromWarpcast:d,getFarcasterSignerPublicKey:d,signFarcasterMessage:d,signMessageWithCrossAppWallet:d,signTypedDataWithCrossAppWallet:d,sendTransactionWithCrossAppWallet:d,signTransactionWithCrossAppWallet:d,isModalOpen:!1,mfaMethods:[]}),M=()=>a(I),S=e=>!!e.id&&"privy-v2"===e.recoveryMethod;export{W as M,I as P,P as a,m as b,h as c,S as d,f as e,b as f,j as g,v as h,o as i,k as j,A as k,w as l,g as m,_ as n,y as o,M as u};
@@ -0,0 +1 @@
1
+ function e(e){switch(e){case"solana:mainnet":return"Solana";case"solana:devnet":return"Devnet";case"solana:testnet":return"Testnet"}}export{e as g};
@@ -0,0 +1 @@
1
+ import{createPublicClient as a,http as t}from"viem";import{a as e}from"./getPublicClient-IxRndou_.mjs";const n=async({chain:n,address:s,appId:c,rpcConfig:i,erc20Address:o})=>{let p=a({chain:n,transport:t(e(n,i,c))});return{balance:await p.readContract({address:o,abi:r,functionName:"balanceOf",args:[s]}).catch((()=>0n)),chain:n}};let r=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];export{n as g};
@@ -0,0 +1 @@
1
+ import{createPublicClient as t,http as e}from"viem";import{a}from"./getPublicClient-IxRndou_.mjs";const n=async({address:n,chain:s,rpcConfig:r,privyAppId:o})=>{try{let l=t({chain:s,transport:e(a(s,r,o))}),[m,c]=await Promise.all([l.readContract({abi:i,address:n,functionName:"symbol"}),l.readContract({abi:i,address:n,functionName:"decimals"})]);return{decimals:c,symbol:m}}catch(t){return console.log(t),null}};let i=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];export{n as g};
@@ -0,0 +1 @@
1
+ const s=1e9,a="11111111111111111111111111111111",e="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",n="TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",o="ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",d=["CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C","CPMDWBwJDtYax9qW7AyRuVC19Cc4L4Vcy4n2BHAbHkCW"],r=["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"],t={"solana:mainnet":{EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v:{symbol:"USDC",decimals:6,address:"EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"},Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB:{symbol:"USDT",decimals:6,address:"Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"},So11111111111111111111111111111111111111112:{symbol:"SOL",decimals:9,address:"So11111111111111111111111111111111111111112"}},"solana:devnet":{"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU":{symbol:"USDC",decimals:6,address:"4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU"},EJwZgeZrdC8TXTQbQBoL6bfuAnFUUy1PVCMB4DYPzVaS:{symbol:"USDT",decimals:6,address:"EJwZgeZrdC8TXTQbQBoL6bfuAnFUUy1PVCMB4DYPzVaS"},So11111111111111111111111111111111111111112:{symbol:"SOL",decimals:9,address:"So11111111111111111111111111111111111111112"}},"solana:testnet":{}};function C(a,e){let n=parseFloat(a.toString())/s,o=b.format(e*n);return"$0.00"===o?"<$0.01":o}let b=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});export{o as A,t as D,r as J,s as L,d as R,a as S,e as T,n as a,C as g};
@@ -0,0 +1 @@
1
+ import{createPublicClient as r,http as p}from"viem";import{P as t}from"./internal-context-Cvo1WmWN.mjs";const e=(e,i,s,c)=>{let a=Number(e),n=i.find((r=>r.id===a));if(!n)throw new t(`Unsupported chainId ${e}`,4901);return r({transport:p(l(n,s,c.appId)),chain:n})},l=(r,p,e)=>{let l,i=r.id,s=Number(r.id);if(r.rpcUrls.privyWalletOverride&&r.rpcUrls.privyWalletOverride.http[0])l=r.rpcUrls.privyWalletOverride.http[0];else if(p.rpcUrls&&p.rpcUrls[s])l=p.rpcUrls[s];else if(r.rpcUrls.privy?.http[0]){let p=new URL(r.rpcUrls.privy.http[0]);p.searchParams.append("privyAppId",e),l=p.toString()}else l=r.rpcUrls.public?.http[0]?r.rpcUrls.public.http[0]:r.rpcUrls.default?.http[0];if(!l)throw new t(`No RPC url found for ${i}`);return l};export{l as a,e as g};
@@ -0,0 +1 @@
1
+ import{D as t}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";function r(r){let[e]=Object.entries(t[r]).find((([t,r])=>"USDC"===r.symbol))??[];return e}export{r as g};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as i}from"react/jsx-runtime";import{styled as n}from"styled-components";const t=({size:n,centerIcon:t})=>/*#__PURE__*/e(r,{$size:n,children:/*#__PURE__*/i(o,{children:[/*#__PURE__*/e(a,{}),/*#__PURE__*/e(d,{}),t?/*#__PURE__*/e(s,{children:t}):null]})});let r=/*#__PURE__*/n.div.withConfig({displayName:"LoadingContainer",componentId:"sc-ebc93df8-0"})(["--spinner-size:",";display:inline-flex;justify-content:center;align-items:center;@media all and (display-mode:standalone){margin-bottom:30px;}"],(e=>e.$size?e.$size:"96px")),o=/*#__PURE__*/n.div.withConfig({displayName:"SpinnerContainer",componentId:"sc-ebc93df8-1"})(["position:relative;height:var(--spinner-size);width:var(--spinner-size);opacity:1;animation:fadein 200ms ease;"]),s=/*#__PURE__*/n.div.withConfig({displayName:"CenterIconContainer",componentId:"sc-ebc93df8-2"})(["position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;svg,img{width:calc(var(--spinner-size) * 0.4);height:calc(var(--spinner-size) * 0.4);border-radius:var(--privy-border-radius-full);}"]),a=/*#__PURE__*/n.div.withConfig({displayName:"CircleFixed",componentId:"sc-ebc93df8-3"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);&&{border:4px solid var(--privy-color-border-default);border-radius:50%;}"]),d=/*#__PURE__*/n.div.withConfig({displayName:"CircleRotate",componentId:"sc-ebc93df8-4"})(["position:absolute;top:0;right:0;bottom:0;left:0;width:var(--spinner-size);height:var(--spinner-size);animation:spin 1200ms linear infinite;&&{border:4px solid;border-color:var(--privy-color-icon-subtle) transparent transparent transparent;border-radius:50%;}@keyframes spin{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}"]);export{t as N};
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as e,Fragment as n}from"react/jsx-runtime";import{useState as a,useMemo as s,useCallback as i,useEffect as o}from"react";import{createPublicClient as r,http as p,toHex as l,decodeFunctionData as u,decodeAbiParameters as m,formatEther as c}from"viem";import{getJsonRpcEndpointFromChain as d,formatTokenAmount as y,ProviderErrors as f}from"@privy-io/js-sdk-core";import{A as b}from"./Address-8wLEsvcI.mjs";import{u as T,q as h}from"./context-DrEBh-QM.mjs";import{P as g,j as I}from"./prepareFundingModalData-B_fHl6nD.mjs";import{u as v}from"./internal-context-Cvo1WmWN.mjs";import{a as k,u as j}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{u as E}from"./useGetTokenPrice-vOCP_wlo.mjs";import{u as C}from"./useWalletBalance-Xca4-c_r.mjs";import{g as M}from"./getErc20TokenInfo-CKA_MDcy.mjs";import{f as _}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{g as w,a as F,p as x}from"./ethers-CDHJG_GP.mjs";import{Y as N,D as S}from"./useActiveWallet-BnhoT9lw.mjs";import{g as A}from"./getPublicClient-IxRndou_.mjs";import{ErrorScreenView as O}from"./ErrorScreen-B3jTfxM4.mjs";import{styled as R}from"styled-components";import{M as D,B}from"./ModalHeader-Bh_PKIU9.mjs";import{D as $}from"./JsonTree-Bvd2C29R.mjs";import{T as P,S as q}from"./TransactionErrorView-FfwlWheg.mjs";import{P as L}from"./Button-BvV3nq1d.mjs";import{R as U}from"./Layouts-Bmf8DxNP.mjs";import{S as W}from"./ScreenHeader-Biz1wq02.mjs";import{T as H}from"./TransactionDetails-BA6Mg8A_.mjs";import{E as V}from"./transfer-CMPmjPsM.mjs";import{p as G}from"./index-UMYdObny.mjs";import"lucide-react";import"tinycolor2";import"eventemitter3";import"ofetch";import"./useGetSolPrice-Bi0pPiUW.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./useWallets-D9FTjmQA.mjs";import"./reservoir-B0V48m2I.mjs";import"./ScreenLayout-CySJnyOi.mjs";import"./Screen-BagBuHbN.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline";import"./Value-B4M62ove.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./Row-CG0lSY5Z.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./WalletInfoCard-ByshkAcF.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"./WalletLink-BteV-rJa.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BkrUs537.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";let z=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}],Q=/*#__PURE__*/R.div.withConfig({displayName:"Container",componentId:"sc-31acb2bc-0"})(["display:flex;flex-direction:column;min-height:72px;"]);var J=({onBack:n,details:a})=>/*#__PURE__*/t(Q,{children:[/*#__PURE__*/e(D,{backFn:n}),/*#__PURE__*/e($,{data:a}),/*#__PURE__*/e(B,{})]});let K=({gasUsed:t,effectiveGasPrice:e})=>{if(t&&e)try{return l(t*e)}catch(t){return}};const X=({txn:a,receipt:s,transactionInfo:i,onClose:o,tokenPrice:r,tokenSymbol:p,receiptHeader:l,receiptDescription:u})=>/*#__PURE__*/t(n,{children:[/*#__PURE__*/e(D,{onClose:o}),/*#__PURE__*/e(W,{title:l??"Transaction complete!",description:u??"You're all set."}),/*#__PURE__*/e(H,{tokenPrice:r,from:s.from,to:s.to,gas:K(s),txn:a,transactionInfo:i,tokenSymbol:p}),/*#__PURE__*/e(N,{}),/*#__PURE__*/e(Y,{loading:!1,onClick:o,children:"All Done"}),/*#__PURE__*/e(U,{}),/*#__PURE__*/e(B,{})]});let Y=/*#__PURE__*/R(L).withConfig({displayName:"SubmitButton",componentId:"sc-f70d0f7a-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);const Z=[{constant:!1,inputs:[{name:"_salt",type:"bytes32"},{name:"_initializer",type:"bytes"}],name:"deployAccount",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],tt=[{name:"from",type:"address"},{name:"param2",type:"address"},{name:"param3",type:"bytes"},{name:"param4",type:"tuple",components:[]},{type:"tuple",components:[{name:"param5",type:"address"},{name:"param6",type:"uint256"},{name:"param7",type:"uint256"},{name:"encodedInitData",type:"bytes"}]}],et=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],nt=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"payable",type:"function"}],at=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],st=[{constant:!1,inputs:[{name:"_operator",type:"address"},{name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],it=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],ot=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenIds",type:"uint256[]"},{name:"_amounts",type:"uint256[]"},{name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],rt=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"},{name:"_amount",type:"uint256"},{name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],pt=(t,e)=>{let n=lt(et,t);if(n)return{action:"approve",functionName:"approve",isErc20Ish:!0,isNFTIsh:!1,spender:n.args[0],amount:n.args[1]};let a=lt(V,t);if(a)return{action:"transfer",functionName:"transfer",isErc20Ish:!0,isNFTIsh:!1,transferTo:a.args[0],amount:a.args[1]};if(!e)return{action:"transaction",functionName:"",isErc20Ish:!1,isNFTIsh:!1};let s=lt(Z,t);if(s&&"string"==typeof s.args[1]){let t=ut(s.args[1]);if(t&&t[4].encodedInitData)return pt(t[4].encodedInitData,e)}let i=lt(st,t);if(i)return{action:"approve",functionName:"setApprovalForAll",isNFTIsh:!0,isErc20Ish:!1,operator:i.args[0],approved:i.args[1]};let o=lt(it,t);if(o)return{action:"transfer",functionName:"transferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:o.args[0],transferTo:o.args[1],tokenId:o.args[2]};let r=lt(at,t);if(r)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:r.args[0],transferTo:r.args[1],tokenId:r.args[2]};let p=lt(rt,t);if(p)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:p.args[0],transferTo:p.args[1],tokenId:p.args[2],amount:p.args[3]};let l=lt(ot,t);if(l)return{action:"batch transfer",functionName:"safeBatchTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:l.args[0],transferTo:l.args[1],tokenIds:l.args[2],amounts:l.args[3]};let u=lt(nt,t);return u?{action:"mint",functionName:u.functionName,isNFTIsh:!0,isErc20Ish:!1,args:u.args}:{action:"transaction",isErc20Ish:!1,isNFTIsh:!1}};let lt=(t,e)=>{try{let n=u({abi:t,data:e});return{functionName:n.functionName,args:n.args||[]}}catch(t){return null}},ut=t=>{try{if("string"==typeof t)return m(tt,`0x${t.slice(10)}`)}catch(t){return null}},mt=t=>`${parseFloat(t).toFixed(2)}`;function ct(t,e){let n=[],a=new Map;if(t)for(let e of t)if(e.in[0]){let t;t="ERC721"===e.asset.type||"approve_for_all"===e.in[0].value?{id:`nft:${e.asset.name}`,nftName:e.asset.name,nftCount:e.in.length}:{id:`token:${e.asset.type}:${e.asset.symbol}:${e.asset.name}`,iconUrl:e.asset.logo_url,value:e.in[0].value,symbol:e.asset.symbol,usdValue:e.in[0].usd_price?mt(e.in[0].usd_price):void 0,decimals:e.asset.decimals},n.push(t)}else if(e.out[0]?.value){let t;t="ERC721"===e.asset.type||"approve_for_all"===e.out[0].value?{id:`nft:${e.asset.name}`,nftName:e.asset.name}:{id:`token:${e.asset.type}:${e.asset.symbol}:${e.asset.name}`,iconUrl:e.asset.logo_url,value:e.out[0].value,symbol:e.asset.symbol,usdValue:e.out[0].usd_price?mt(e.out[0].usd_price):void 0,decimals:e.asset.decimals},a.has(t.id)||a.set(t.id,t)}for(let t of e)for(let e of Object.keys(t.spenders)){let n;n="ERC721"===t.asset.type||"approve_for_all"===t.spenders[e]?.value?{id:`nft:${t.asset.name}`,nftName:t.asset.name}:{id:`token:${t.asset.type}:${t.asset.symbol}:${t.asset.name}`,iconUrl:t.asset.logo_url,value:t.spenders[e]?.value,symbol:t.asset.symbol,usdValue:t.spenders[e]?.usd_price?mt(t.spenders[e]?.usd_price):void 0,decimals:t.asset.decimals},a.has(n.id)||a.set(n.id,n)}return{assetsIn:n,assetsOut:Array.from(a.values())}}const dt=(t,e,n,s)=>{let[i,r]=a(null),{walletProxy:p}=v();return o((()=>{i&&r(null),(async()=>{if(!p||!e)return null;let a=[],i=!0,o=await G(t,n,e,s).catch((e=>(e.message&&e.message.includes("Insufficient balance for transaction")||e.details&&e.details.includes("insufficient funds")?i=!1:a.push(e),t)));return{tx:o,totalGasEstimate:o.gas,hasFunds:i,errors:a}})().then(r)}),[t]),i};let yt=new g(new I("There was an issue preparing your transaction",f.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),ft=(t,e)=>t?.sendTransaction?"transactionRequest"in t.sendTransaction?t.sendTransaction.transactionRequest:t.sendTransaction.transactionRequests[e]:void 0;const bt={component:()=>{let{data:l,onUserCloseViaDialogOrKeybindRef:u,setModalData:m,navigate:N}=k(),{client:R,rpcConfig:D,chains:B,closePrivyModal:$,walletProxy:L,showFiatPrices:U}=v(),{user:W}=j(),H=T(),[V,G]=a(0),[Q,K]=a(0),[Y,Z]=a(ft(l,V)),[tt,et]=a(null),[nt,at]=a(),[st,it]=a(!1),[ot,rt]=a(null),[lt,ut]=a(null),[mt,bt]=a(null),[Tt,ht]=a(void 0),[gt,It]=a(void 0),[vt,kt]=a(!1),[jt,Et]=a(!1),[Ct,Mt]=a([]),[_t,wt]=a([]),[Ft,xt]=a("uninitiated"),[Nt,St]=a(void 0);if(!Y||!l?.sendTransaction||!l?.sendTransaction)/*#__PURE__*/return e(O,{error:Error("Invalid transaction request"),allowlistConfig:H.allowlistConfig,onRetry:()=>{l?.sendTransaction?.onFailure(yt),$({shouldCallAuthOnSuccess:!1})}});let{transactingWalletAddress:At}=l.sendTransaction,Ot=s((()=>B.find((t=>Number(t.id)===Number(Y.chainId)))),[Y.chainId]),Rt=Ot?.nativeCurrency.symbol??"ETH",Dt=s((()=>pt(Y.data,!!H.embeddedWallets.extendedCalldataDecoding)),[Y.data]),{action:Bt,isErc20Ish:$t,isNFTIsh:Pt,functionName:qt}=Dt,{toAddress:Lt,tokenAddress:Ut}=s((()=>({toAddress:Dt.isErc20Ish?Dt.transferTo:Y.to??void 0,tokenAddress:Dt.isErc20Ish?Y.to:void 0})),[Dt]);o((()=>{Y.to&&Ot&&$t&&M({address:Y.to,chain:Ot,rpcConfig:H.rpcConfig,privyAppId:H.id}).then(et).catch(console.error)}),[Y.to,Ot]);let{tokenPrice:Wt,isTokenPriceLoading:Ht}=E(Y.chainId),{balance:Vt}=C({rpcConfig:H.rpcConfig,appId:H.id,address:At,chain:Ot}),Gt=function({rpcConfig:t,appId:e,address:n,chain:l,tokenInfo:u}){let{chains:m}=v(),[c,f]=a(null),[b,T]=a(!1),h=s((()=>{let n=l||m[0];if(n)return r({chain:l,transport:p(d(n,t,e))})}),[l,t,e]),g=i((async()=>{if(n&&h&&u.address)try{return T(!0),await h.readContract({address:u.address,abi:z,functionName:"balanceOf",args:[n]})}catch(t){console.error(t)}finally{T(!1)}}),[h,n,u?.address,l]);return o((()=>{g().then((t=>null!=t&&f(t)))}),[g]),{balance:c,isLoading:b&&null==c,formattedBalance:y({amount:c??BigInt(0),decimals:u.decimals})}}({rpcConfig:H.rpcConfig,appId:H.id,address:At,tokenInfo:{address:Ut||"",decimals:tt?.decimals??18},chain:Ot}),zt=s((()=>A(Number(Y.chainId),B,D,{appId:H.id})),[Y.chainId,D]),Qt=dt(Y,At,zt,l?.sendTransaction?.prepareTransactionRequest);o((()=>{Z(ft(l,V))}),[V]),o((()=>{l.sendTransaction?.getIsSponsored?l.sendTransaction.getIsSponsored().then(at).catch(console.error):at(!1)}),[l.sendTransaction.getIsSponsored]);let Jt=()=>{if(!st)return ot?l?.sendTransaction?.onSuccess({hash:ot}):mt||Qt?.errors[0]?l?.sendTransaction?.onFailure(mt??Qt?.errors[0]??yt):l?.sendTransaction?.onFailure(new g(new I("The user rejected the request",f.E4001_USER_REJECTED_REQUEST.eipCode))),$({shouldCallAuthOnSuccess:!1})};u.current=Jt;let Kt=!!(l.funding&&l.funding.supportedOptions.length>0),Xt=w(BigInt(Qt?.totalGasEstimate??0n),Rt),Yt=U&&Wt?F(BigInt(Qt?.totalGasEstimate??0n),Wt):void 0,Zt=w(Vt??0n,Rt,void 0,!0),te=U&&Wt?F(Vt??0n,Wt):void 0,ee=tt&&!Gt.isLoading&&$t&&"approve"!==Bt?`${Gt.formattedBalance} ${tt.symbol}`:void 0,ne=l.sendTransaction?.uiOptions?.transactionInfo?.title;ne||(ne="approve"===Bt?$t?"Confirm address":"Confirm action":`Approve ${Bt}`);let ae=s((()=>{if(l.sendTransaction?.uiOptions?.description)return l.sendTransaction?.uiOptions?.description;if("approve"===Bt&&"setApprovalForAll"===qt&&Dt.approved){let a=/*#__PURE__*/e(b,{address:Dt.operator||"",url:Ot?.blockExplorers?.default?.url});/*#__PURE__*/return t(n,{children:[H.name," would like your permission for ",a," to transfer tokens on your behalf."]})}if("approve"===Bt&&"setApprovalForAll"===qt&&!Dt.approved){let a=/*#__PURE__*/e(b,{address:Dt.operator||"",url:Ot?.blockExplorers?.default?.url});/*#__PURE__*/return t(n,{children:[H.name," would like your permission to revoke permissions of ",a," from transferring tokens on your behalf."]})}return $t&&"approve"===Bt||$t&&"approve"===Bt?`${H.name} would like your permission for ${S(Dt.spender)} to spend tokens on your behalf.`:`${H.name} wants your permission to approve the following transaction.`}),[H.name,$t,Dt,l.sendTransaction?.uiOptions.description,qt]),se=l.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e("img",{src:l.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:l.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ie=!(!Qt||Qt.errors[0]||Qt.hasFunds||!1!==nt),oe=ie&&Kt,re=oe?"Add funds":l.sendTransaction?.uiOptions?.buttonText||(V<Q?"Continue":"Approve"),pe=t=>{if(!t)throw Error("Transaction scan failed");if("Success"===t.validation.status&&("Benign"===t.validation.result_type?It("safe"):"Warning"===t.validation.result_type?It("warn"):"Malicious"===t.validation.result_type&&(It("error"),Et(!0))),"Success"!==t.simulation.status)throw Error("Simulation failed");{ht(t.simulation.params);let{assetsIn:e,assetsOut:n}=ct(t.simulation.assets_diffs,t.simulation.exposures);if(0===n.length&&0===e.length)throw Error("No tokens found");Mt(n),wt(e)}};if(o((()=>{l.sendTransaction?.scanTransaction&&H.embeddedWallets.transactionScanning.enabled&&"uninitiated"===Ft&&(xt("in progress"),l.sendTransaction.scanTransaction().then((t=>{pe(t),xt("completed")})).catch((()=>xt("failed"))))}),[!!l.sendTransaction?.scanTransaction]),o((()=>{l.sendTransaction?.scanTransaction&&"failed"!==Ft||((t,e,n)=>{if(K((t=>t?.sendTransaction?"transactionRequest"in t.sendTransaction?0:t.sendTransaction.transactionRequests.length-1:0)(l)),e.isErc20Ish&&e.amount&&n){let t=_({amount:e.amount,decimals:n.decimals});St(t),Mt([{value:t,symbol:n?.symbol,decimals:n?.decimals}])}else if(t.value){let e=BigInt(t.value),n=Wt?F(e,Wt):void 0;Mt(U&&n?[{value:n}]:[{value:x(e),symbol:Rt,decimals:18,usdValue:n}])}else Mt(U?[{value:"$0"}]:[{value:"0",symbol:Rt,decimals:18}])})(Qt?.tx??Y,Dt,tt)}),[Y,Qt?.tx,Dt,tt,Ft]),lt/*#__PURE__*/)return e(X,{txn:Qt?.tx??Y,onClose:Jt,receipt:lt,transactionInfo:l.sendTransaction?.uiOptions.transactionInfo,tokenPrice:Wt,tokenSymbol:Rt,receiptHeader:l.sendTransaction?.uiOptions.successHeader,receiptDescription:l.sendTransaction?.uiOptions.successDescription});if(mt)/*#__PURE__*/return e(P,{transactionError:mt,transactionHash:ot??void 0,chainType:"ethereum",chainId:Qt?.tx.chainId??Y.chainId,onClose:Jt,onRetry:({resetNonce:t})=>{bt(null);let e={...Qt?.tx??Y};t&&(e.nonce=void 0),Z(e)}});let le=0!==Q&&"number"==typeof V&&0!==V?()=>{G(V-1)}:void 0;return vt&&Tt?/*#__PURE__*/e(J,{details:Tt,onBack:()=>kt(!1)}):/*#__PURE__*/e(q,{transactionIndex:V,onBack:le,maxIndex:Q,disabled:ie&&!Kt||jt,isSubmitting:st,submitError:mt,isPreparing:!Qt,isTokenPriceLoading:Ht,isTokenContractInfoLoading:!Pt&&!tt,prepareError:Qt?.errors[0],symbol:tt?.symbol,chain:Ot,img:se,title:ne,subtitle:ae,txValue:Y.value,fee:Yt??Xt,isSponsored:nt,from:At??"",to:Lt,tokenAddress:Ut??void 0,network:H.chains.find((t=>t.id===Y.chainId))?.name??"",transactionDetails:{...Dt,formattedAmount:Nt},cta:re,missingFunds:ie,action:Bt,balance:ee??te??Zt,onClose:Jt,onClick:oe?async()=>{if(!At)return;if(!Kt)throw Error("Funding wallet is not enabled");let t="FundingMethodSelectionScreen";m({...l,funding:{...l.funding,methodScreen:t,chainType:"ethereum",amount:c(BigInt(Qt?.tx.value??0)+BigInt(Qt?.totalGasEstimate?.toString()??0)),chain:Ot},solanaFundingData:l?.solanaFundingData}),N(t)}:async()=>{if(V<Q)G(V+1);else{it(!0);try{let t=await R.getAccessToken();if(st||!t||!L||!W)return;let e=await l.sendTransaction.onConfirm({transactionRequest:Qt?.tx??Y});if(rt(e),l.sendTransaction?.signOnly)return await new Promise((t=>setTimeout(t,h))),l?.sendTransaction?.onSuccess({hash:e}),$({shouldCallAuthOnSuccess:!1});let n=await zt.waitForTransactionReceipt({hash:e});if("reverted"===n.status)throw Error("Transaction failed");ut(n)}catch(t){console.warn({transaction:Qt?.tx??Y,error:t}),bt(t)}finally{it(!1)}}},validation:gt,hasScanDetails:!!Tt,setIsScanDetailsOpen:kt,preventMaliciousTransaction:jt,setPreventMaliciousTransaction:Et,tokensSent:Ct,tokensReceived:_t,isScanning:"in progress"===Ft,isCancellable:l.sendTransaction?.uiOptions?.isCancellable??!1,functionName:qt})}};export{bt as SendTransactionScreen,bt as default};
@@ -0,0 +1 @@
1
+ import{ofetch as e}from"ofetch";import{useState as t,useRef as n,useEffect as a}from"react";import{M as r,v as o,w as i,x as u}from"./context-DrEBh-QM.mjs";import{u as s}from"./internal-context-Cvo1WmWN.mjs";import{a as d}from"./get-is-unified-wallet-DjMnN6w-.mjs";import{O as c}from"./analytics-mkkvFRju.mjs";const m="moonpay";function l(e){return parseFloat(e)}function y(l,y=!1){let[f,g]=t(null),{createAnalyticsEvent:p}=s(),{data:h,navigate:v,setModalData:w}=d(),A=h?.funding,F=n(0);return a((()=>{let t=setInterval((async()=>{if(l)try{let[n]=await async function(t,n){return e(`${n?r:o}/transactions/ext/${t}`,{query:{apiKey:n?i:u}})}(l,y),a="waitingAuthorization"===n.status&&"credit_debit_card"===n.paymentMethod?"pending":n.status;if(["failed","completed","awaitingAuthorization"].includes(a)&&(p({eventName:c,payload:{status:a,provider:m,paymentMethod:n.paymentMethod,cardPaymentType:n.cardPaymentType,currency:n.currency?.code,baseCurrencyAmount:n.baseCurrencyAmount,quoteCurrencyAmount:n.quoteCurrencyAmount,feeAmount:n.feeAmount,extraFeeAmount:n.extraFeeAmount,networkFeeAmount:n.networkFeeAmount,isSandbox:y}}),clearInterval(t)),"failed"===a||"serviceFailure"===a)return w({funding:{...A,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."},solanaFundingData:h?.solanaFundingData}),void v("FundingMethodSelectionScreen");g(a)}catch(e){404!==e.response?.status&&(F.current+=1),F.current>=3&&(p({eventName:c,payload:{status:"serviceFailure",provider:m}}),clearInterval(t),w({funding:{...A,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."},solanaFundingData:h?.solanaFundingData}),v("FundingMethodSelectionScreen"))}}),3e3);return()=>clearInterval(t)}),[l,F]),f}export{l as a,y as u};