@privy-io/react-auth 2.6.4 → 2.7.0-beta-20250320153020

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 (47) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/farcaster.js +1 -1
  3. package/dist/cjs/frame-k_wNSSVB.js +1 -0
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/cjs/internal-context-RXYisitW.js +1 -0
  6. package/dist/cjs/privy-provider-DEIRPbB3.js +27 -0
  7. package/dist/cjs/smart-wallets-DbeQ3OaY.js +1 -0
  8. package/dist/cjs/smart-wallets.js +1 -1
  9. package/dist/cjs/solana.js +1 -1
  10. package/dist/cjs/ui.js +1 -1
  11. package/dist/cjs/{useActiveWallet-CsKkB2nL.js → useActiveWallet-DV8bQ41I.js} +1 -1
  12. package/dist/cjs/useFundWallet-DFVoN9CU.js +1 -0
  13. package/dist/dts/farcaster.d.mts +1 -1
  14. package/dist/dts/farcaster.d.ts +1 -1
  15. package/dist/dts/index.d.mts +63 -6
  16. package/dist/dts/index.d.ts +63 -6
  17. package/dist/dts/smart-wallets.d.mts +1 -1
  18. package/dist/dts/smart-wallets.d.ts +1 -1
  19. package/dist/dts/solana.d.mts +4 -4
  20. package/dist/dts/solana.d.ts +4 -4
  21. package/dist/dts/{types-CsAGoXth.d.mts → types-Bv6KFBSe.d.mts} +2 -1
  22. package/dist/dts/{types-CsAGoXth.d.ts → types-Bv6KFBSe.d.ts} +2 -1
  23. package/dist/dts/ui.d.mts +1 -1
  24. package/dist/dts/ui.d.ts +1 -1
  25. package/dist/dts/{useSolanaWallets-CFgYdjDv.d.mts → useSolanaWallets-DmfTxIs8.d.mts} +1 -1
  26. package/dist/dts/{useSolanaWallets-CFgYdjDv.d.ts → useSolanaWallets-DmfTxIs8.d.ts} +1 -1
  27. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  28. package/dist/esm/farcaster.mjs +1 -1
  29. package/dist/esm/frame-Ce7X1pBv.mjs +1 -0
  30. package/dist/esm/index.mjs +1 -1
  31. package/dist/esm/internal-context-1GyQ1hzA.mjs +1 -0
  32. package/dist/esm/privy-provider-QuG0Jtad.mjs +27 -0
  33. package/dist/esm/smart-wallets-DDC7ER1L.mjs +1 -0
  34. package/dist/esm/smart-wallets.mjs +1 -1
  35. package/dist/esm/solana.mjs +1 -1
  36. package/dist/esm/ui.mjs +1 -1
  37. package/dist/esm/{useActiveWallet-D0FziaS7.mjs → useActiveWallet-B13pmqaE.mjs} +1 -1
  38. package/dist/esm/useFundWallet-CxspGtCH.mjs +1 -0
  39. package/package.json +4 -4
  40. package/dist/cjs/internal-context-HesndSYh.js +0 -1
  41. package/dist/cjs/privy-provider-B-yAVEso.js +0 -27
  42. package/dist/cjs/smart-wallets-BUp0Opq4.js +0 -1
  43. package/dist/cjs/useFundWallet-C-vF194x.js +0 -1
  44. package/dist/esm/internal-context-O3TPYUku.mjs +0 -1
  45. package/dist/esm/privy-provider-DSQ8FU83.mjs +0 -27
  46. package/dist/esm/smart-wallets-CjIUBWJS.mjs +0 -1
  47. package/dist/esm/useFundWallet-DGsbN-n3.mjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-CsAGoXth.js';
4
- export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-CsAGoXth.js';
3
+ import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-Bv6KFBSe.js';
4
+ export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-Bv6KFBSe.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -17,8 +17,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
17
17
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
18
18
  import { Cluster } from '@solana/web3.js';
19
19
  import { FetchOptions } from 'ofetch';
20
- import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
21
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
20
+ import { P as PrivyEvents } from './useSolanaWallets-DmfTxIs8.js';
21
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DmfTxIs8.js';
22
22
  import '@solana/wallet-adapter-base';
23
23
  import '@privy-io/js-sdk-core';
24
24
  import '@metamask/eth-sig-util';
@@ -186,6 +186,8 @@ type WalletsRecoverRequestDataType = BaseProxyRequest & {
186
186
  entropyIdVerifier: EntropyIdVerifier;
187
187
  /** Optional: the user-specified recovery password, replaces recoveryPin */
188
188
  recoveryPassword?: string;
189
+ /** Optional: the recovery encryption key */
190
+ recoveryKey?: string;
189
191
  /** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
190
192
  recoveryAccessToken?: string;
191
193
  /** Optional: override the recoverySecret, only for use when we need to retrieve recovery secrets in cloud storage outside of the iframe (eg native) */
@@ -509,7 +511,7 @@ type CaptchaProps = Partial<Pick<TurnstileProps, 'onUnsupported' | 'onError' | '
509
511
  * - the state of the captcha workflow can be accessed using `useCaptcha`
510
512
  * - wrapper around [marsidev/react-turnstile](https://github.com/marsidev/react-turnstile), _accepts same [props](https://docs.page/marsidev/react-turnstile/props)_
511
513
  */
512
- declare const Captcha: (props: CaptchaProps) => react_jsx_runtime.JSX.Element | null;
514
+ declare const Captcha: ({ delayedExecution, ...props }: CaptchaProps) => react_jsx_runtime.JSX.Element | null;
513
515
 
514
516
  /**
515
517
  * Build a viem public client for a given chainId if it is one of our
@@ -2051,6 +2053,26 @@ declare function useWallets(): UseWalletsInterface;
2051
2053
  */
2052
2054
  declare const usePrivy: () => PrivyInterface;
2053
2055
 
2056
+ type RecoverParams = {
2057
+ recoveryMethod: 'recovery-encryption-key';
2058
+ recoveryKey: string;
2059
+ };
2060
+ interface UseRecoverEmbeddedWalletInterface {
2061
+ /**
2062
+ * An async method to recover the embedded wallets.
2063
+ *
2064
+ * @param params The parameters with which to recover the embedded wallets.
2065
+ * @returns A promise that resolves when the embedded wallets have been recovered.
2066
+ */
2067
+ recover: (params: RecoverParams) => Promise<void>;
2068
+ }
2069
+ /**
2070
+ * Hook to recover the user's embedded wallets headlessly.
2071
+ *
2072
+ * @returns An object with a `recover` method that allows you to recover the embedded wallets.
2073
+ */
2074
+ declare const useRecoverEmbeddedWallet: () => UseRecoverEmbeddedWalletInterface;
2075
+
2054
2076
  /**
2055
2077
  * Use this hook to execute the MFA flow with Privy.
2056
2078
  *
@@ -2760,6 +2782,41 @@ declare function useLogin(callbacks?: PrivyEvents['login']): {
2760
2782
  login: (options?: LoginModalOptions | react.MouseEvent<any, any>) => void;
2761
2783
  };
2762
2784
 
2785
+ type LoginWithFarcasterV2Input = {
2786
+ /** The Farcaster user ID. */
2787
+ fid: number;
2788
+ /** The SIWF message. */
2789
+ message: string;
2790
+ /** The signature of the SIWF message. */
2791
+ signature: string;
2792
+ };
2793
+ interface UseLoginWithFarcasterV2Interface {
2794
+ /**
2795
+ * Initializes the Farcaster V2 login flow.
2796
+ *
2797
+ * @returns A promise that resolves to a nonce and expires at used to generate the SIWF message.
2798
+ */
2799
+ init: () => Promise<{
2800
+ nonce: string;
2801
+ expiresAt: string;
2802
+ }>;
2803
+ /**
2804
+ * Authenticates a user's Farcaster V2 account.
2805
+ *
2806
+ * @param input - The input object containing the Farcaster V2 message and signature.
2807
+ * @returns A promise that resolves to the authenticated Privy user.
2808
+ */
2809
+ login: (input: LoginWithFarcasterV2Input) => Promise<{
2810
+ user: User;
2811
+ }>;
2812
+ }
2813
+ /**
2814
+ * Use this hook to login with Farcaster via SIWF.
2815
+ *
2816
+ * @returns An object with the `init` and `login` methods that allows you to login with Farcaster via SIWF.
2817
+ */
2818
+ declare const useLoginWithFarcasterV2: () => UseLoginWithFarcasterV2Interface;
2819
+
2763
2820
  /**
2764
2821
  * Use this hook to get the identity token. Allows you to pass the identity token in your requests.
2765
2822
  *
@@ -3801,4 +3858,4 @@ declare const LoginModal: ({ open }: {
3801
3858
  open: boolean;
3802
3859
  }) => react_jsx_runtime.JSX.Element;
3803
3860
 
3804
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
3861
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-CsAGoXth.js';
4
- export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-CsAGoXth.js';
3
+ import { C as Chain, m as WalletClientType, d as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as PrivyClientConfig, u as RpcConfig, v as EIP1193Provider, w as EntropyIdVerifier$1, x as RequestArguments, y as WalletTimeoutError, z as WalletConnector, B as BaseConnectedEthereumWallet, A as ConnectedWalletMetadata, D as ConnectorType, G as WalletListEntry, H as ExternalWalletsConfig, I as BaseConnectedWallet, l as SolanaWalletConnector, U as User, J as ConnectWalletModalOptions, K as LoginModalOptions, h as CreateWalletOptions, W as Wallet, N as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, Q as SignTypedDataParams, M as MfaMethod, T as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, V as FundWalletConfig, X as ConnectedWallet, O as OAuthTokens, Y as CrossAppProviderDetails, Z as OAuthProviderType, _ as MoonpaySignRequest, $ as MoonpaySignResponse, a0 as SmartWalletConfig, a1 as PrivyServerConfig, a as LoginMethod, a2 as SiweWalletMetadata, a3 as TelegramAuthResult, a4 as TelegramWebAppData, a5 as OAuthUserInfo, a6 as OAuthFlowState, a7 as LoginWithCode, a8 as OtpFlowState, a9 as PasskeyFlowState, aa as SiweFlowState, ab as UnsignedTransactionRequestWithChainId, ac as BaseConnectedWalletType, g as ConnectedSolanaWallet, ad as CustomAuthFlowState, ae as TelegramAuthFlowState } from './types-Bv6KFBSe.js';
4
+ export { ax as Apple, aI as AppleOAuthWithMetadata, aQ as ContractUIOptions, aA as CrossAppAccount, aL as CrossAppAccountWithMetadata, au as Discord, aE as DiscordOAuthWithMetadata, aN as Email, ap as EmailWithMetadata, aU as Farcaster, aJ as FarcasterWithMetadata, av as Github, aF as GithubOAuthWithMetadata, as as Google, aC as GoogleOAuthWithMetadata, aB as LinkedAccountType, b as LinkedAccountWithMetadata, aw as LinkedIn, aH as LinkedInOAuthWithMetadata, aW as LoginMethodOrderOption, ag as MessageTypes, ai as MoonpayConfig, aj as MoonpayCurrencyCode, aS as MoonpayFundingConfig, ak as MoonpayPaymentMethod, aR as NativeFundingConfig, ao as NonEmptyArray, aV as Passkey, aM as PasskeyWithMetadata, aO as Phone, aq as PhoneWithMetadata, aT as PriceDisplayOptions, P as PrivyErrorCode, al as Quantity, ah as SmartWallet, f as SolanaCluster, k as SolanaFundingConfig, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, az as Telegram, aK as TelegramWithMetadata, ay as Tiktok, aG as TiktokOAuthWithMetadata, am as TransactionLog, an as TransactionReceipt, aP as TransactionUIOptions, at as Twitter, aD as TwitterOAuthWithMetadata, af as TypedMessage, ar as WalletWithMetadata } from './types-Bv6KFBSe.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -17,8 +17,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
17
17
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
18
18
  import { Cluster } from '@solana/web3.js';
19
19
  import { FetchOptions } from 'ofetch';
20
- import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
21
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
20
+ import { P as PrivyEvents } from './useSolanaWallets-DmfTxIs8.js';
21
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DmfTxIs8.js';
22
22
  import '@solana/wallet-adapter-base';
23
23
  import '@privy-io/js-sdk-core';
24
24
  import '@metamask/eth-sig-util';
@@ -186,6 +186,8 @@ type WalletsRecoverRequestDataType = BaseProxyRequest & {
186
186
  entropyIdVerifier: EntropyIdVerifier;
187
187
  /** Optional: the user-specified recovery password, replaces recoveryPin */
188
188
  recoveryPassword?: string;
189
+ /** Optional: the recovery encryption key */
190
+ recoveryKey?: string;
189
191
  /** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
190
192
  recoveryAccessToken?: string;
191
193
  /** Optional: override the recoverySecret, only for use when we need to retrieve recovery secrets in cloud storage outside of the iframe (eg native) */
@@ -509,7 +511,7 @@ type CaptchaProps = Partial<Pick<TurnstileProps, 'onUnsupported' | 'onError' | '
509
511
  * - the state of the captcha workflow can be accessed using `useCaptcha`
510
512
  * - wrapper around [marsidev/react-turnstile](https://github.com/marsidev/react-turnstile), _accepts same [props](https://docs.page/marsidev/react-turnstile/props)_
511
513
  */
512
- declare const Captcha: (props: CaptchaProps) => react_jsx_runtime.JSX.Element | null;
514
+ declare const Captcha: ({ delayedExecution, ...props }: CaptchaProps) => react_jsx_runtime.JSX.Element | null;
513
515
 
514
516
  /**
515
517
  * Build a viem public client for a given chainId if it is one of our
@@ -2051,6 +2053,26 @@ declare function useWallets(): UseWalletsInterface;
2051
2053
  */
2052
2054
  declare const usePrivy: () => PrivyInterface;
2053
2055
 
2056
+ type RecoverParams = {
2057
+ recoveryMethod: 'recovery-encryption-key';
2058
+ recoveryKey: string;
2059
+ };
2060
+ interface UseRecoverEmbeddedWalletInterface {
2061
+ /**
2062
+ * An async method to recover the embedded wallets.
2063
+ *
2064
+ * @param params The parameters with which to recover the embedded wallets.
2065
+ * @returns A promise that resolves when the embedded wallets have been recovered.
2066
+ */
2067
+ recover: (params: RecoverParams) => Promise<void>;
2068
+ }
2069
+ /**
2070
+ * Hook to recover the user's embedded wallets headlessly.
2071
+ *
2072
+ * @returns An object with a `recover` method that allows you to recover the embedded wallets.
2073
+ */
2074
+ declare const useRecoverEmbeddedWallet: () => UseRecoverEmbeddedWalletInterface;
2075
+
2054
2076
  /**
2055
2077
  * Use this hook to execute the MFA flow with Privy.
2056
2078
  *
@@ -2760,6 +2782,41 @@ declare function useLogin(callbacks?: PrivyEvents['login']): {
2760
2782
  login: (options?: LoginModalOptions | react.MouseEvent<any, any>) => void;
2761
2783
  };
2762
2784
 
2785
+ type LoginWithFarcasterV2Input = {
2786
+ /** The Farcaster user ID. */
2787
+ fid: number;
2788
+ /** The SIWF message. */
2789
+ message: string;
2790
+ /** The signature of the SIWF message. */
2791
+ signature: string;
2792
+ };
2793
+ interface UseLoginWithFarcasterV2Interface {
2794
+ /**
2795
+ * Initializes the Farcaster V2 login flow.
2796
+ *
2797
+ * @returns A promise that resolves to a nonce and expires at used to generate the SIWF message.
2798
+ */
2799
+ init: () => Promise<{
2800
+ nonce: string;
2801
+ expiresAt: string;
2802
+ }>;
2803
+ /**
2804
+ * Authenticates a user's Farcaster V2 account.
2805
+ *
2806
+ * @param input - The input object containing the Farcaster V2 message and signature.
2807
+ * @returns A promise that resolves to the authenticated Privy user.
2808
+ */
2809
+ login: (input: LoginWithFarcasterV2Input) => Promise<{
2810
+ user: User;
2811
+ }>;
2812
+ }
2813
+ /**
2814
+ * Use this hook to login with Farcaster via SIWF.
2815
+ *
2816
+ * @returns An object with the `init` and `login` methods that allows you to login with Farcaster via SIWF.
2817
+ */
2818
+ declare const useLoginWithFarcasterV2: () => UseLoginWithFarcasterV2Interface;
2819
+
2763
2820
  /**
2764
2821
  * Use this hook to get the identity token. Allows you to pass the identity token in your requests.
2765
2822
  *
@@ -3801,4 +3858,4 @@ declare const LoginModal: ({ open }: {
3801
3858
  open: boolean;
3802
3859
  }) => react_jsx_runtime.JSX.Element;
3803
3860
 
3804
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
3861
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkWithPasskey, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSignupWithPasskey, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, addPrivyRpcToChain, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, useActiveWallet, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkWithPasskey, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useToken, useUpdateAccount, useUser, useWallets };
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
7
7
  import * as viem from 'viem';
8
8
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
9
9
  import { SmartWalletType } from '@privy-io/js-sdk-core';
10
- import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
10
+ import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-Bv6KFBSe.js';
11
11
  import '@solana/wallet-adapter-base';
12
12
  import '@privy-io/public-api';
13
13
  import 'eventemitter3';
@@ -7,7 +7,7 @@ import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstract
7
7
  import * as viem from 'viem';
8
8
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, Client } from 'viem';
9
9
  import { SmartWalletType } from '@privy-io/js-sdk-core';
10
- import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
10
+ import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-Bv6KFBSe.js';
11
11
  import '@solana/wallet-adapter-base';
12
12
  import '@privy-io/public-api';
13
13
  import 'eventemitter3';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
2
- export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-CsAGoXth.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
1
+ import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-Bv6KFBSe.js';
2
+ export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-Bv6KFBSe.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-DmfTxIs8.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DmfTxIs8.js';
5
5
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
6
6
  import { Connection } from '@solana/web3.js';
7
7
  import 'react';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-CsAGoXth.js';
2
- export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-CsAGoXth.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-CFgYdjDv.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CFgYdjDv.js';
1
+ import { W as Wallet, k as SolanaFundingConfig, e as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions } from './types-Bv6KFBSe.js';
2
+ export { g as ConnectedSolanaWallet, l as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-Bv6KFBSe.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-DmfTxIs8.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-DmfTxIs8.js';
5
5
  import { SendTransactionOptions } from '@solana/wallet-adapter-base';
6
6
  import { Connection } from '@solana/web3.js';
7
7
  import 'react';
@@ -232,7 +232,8 @@ declare enum PrivyErrorCode {
232
232
  PASSKEY_NOT_ALLOWED = "passkey_not_allowed",
233
233
  USER_DOES_NOT_EXIST = "user_does_not_exist",
234
234
  INSUFFICIENT_BALANCE = "insufficient_balance",
235
- ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required"
235
+ ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required",
236
+ BUFFER_NOT_DEFINED = "buffer_not_defined"
236
237
  }
237
238
 
238
239
  declare class WalletTimeoutError extends PrivyConnectorError {
@@ -232,7 +232,8 @@ declare enum PrivyErrorCode {
232
232
  PASSKEY_NOT_ALLOWED = "passkey_not_allowed",
233
233
  USER_DOES_NOT_EXIST = "user_does_not_exist",
234
234
  INSUFFICIENT_BALANCE = "insufficient_balance",
235
- ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required"
235
+ ACCOUNT_TRANSFER_REQUIRED = "account_transfer_required",
236
+ BUFFER_NOT_DEFINED = "buffer_not_defined"
236
237
  }
237
238
 
238
239
  declare class WalletTimeoutError extends PrivyConnectorError {
package/dist/dts/ui.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-CsAGoXth.js';
2
+ import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-Bv6KFBSe.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@solana/wallet-adapter-base';
package/dist/dts/ui.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-CsAGoXth.js';
2
+ import { R as RuntimeLoginOverridableOptions, C as Chain } from './types-Bv6KFBSe.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@solana/wallet-adapter-base';
@@ -1,4 +1,4 @@
1
- import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-CsAGoXth.js';
1
+ import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-Bv6KFBSe.js';
2
2
  import { MouseEvent } from 'react';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-CsAGoXth.js';
1
+ import { P as PrivyErrorCode, U as User, a as LoginMethod, b as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, c as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, d as UserRecoveryMethod, S as SolanaTransactionReceipt, e as SupportedSolanaTransaction, O as OAuthTokens, C as Chain, F as FundingMethod, f as SolanaCluster, g as ConnectedSolanaWallet, h as CreateWalletOptions } from './types-Bv6KFBSe.js';
2
2
  import { MouseEvent } from 'react';
3
3
 
4
4
  /**
@@ -1 +1 @@
1
- import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{hexToNumber as o,createWalletClient as r,custom as t,http as i}from"viem";import{toAccount as n}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{c as a,k as s,ak as l,j as p,ar as d,as as m,at as u,au as h,l as I}from"./privy-provider-DSQ8FU83.mjs";import{u as y}from"./internal-context-O3TPYUku.mjs";import{g}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as f}from"./smart-wallets-CjIUBWJS.mjs";import"react/jsx-runtime";import"mipd";import"react";import"react-device-detect";import"viem/utils";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/WalletIcon";import"zustand";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/solid/CheckCircleIcon";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/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"qrcode";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@headlessui/react";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function C(){let{user:C}=a(),{hideWalletUIs:v,openPrivyModal:w,chains:P,appId:T,rpcConfig:k}=y(),{wallets:M}=s(),{setModalData:A}=l(),F=p(C),S=async(a=c.id)=>{let s=g(M);if(!s)throw Error("No connected wallet found");let l="string"==typeof a?o(a):a;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=P.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await s.switchChain(p.id);let d=await s.getEthereumProvider(),m=r({account:s.address,transport:t(d)}),u=n({address:s.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(I(p,k,T)),publicTransport:i(I(p,k,T)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await S(o);return new Promise((async(o,t)=>{let{entropyId:i,entropyIdVerifier:n}=d(C);v.current=!0,A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:i,entropyIdVerifier:n,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},signTypedData:async(e,o)=>{let r=await S(o);return new Promise((async(o,t)=>{v.current=!0;let{entropyId:i,entropyIdVerifier:n}=d(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:i,entropyIdVerifier:n,onCompleteNavigateTo:m,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},sendTransaction:async e=>{let o=await S(e.chainId),r=[],t="calls"in e&&void 0!==e.calls;return r=t?[...e.calls]:[e],new Promise((async(i,n)=>{v.current=!0;let{entropyId:c,entropyIdVerifier:a}=d(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:c,entropyIdVerifier:a,onCompleteNavigateTo:h,onFailure:()=>{}},sendTransaction:{transactionRequests:f({calls:r,chain:o.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:a,transactingWalletAddress:o.account.address,transactingWalletIndex:void 0,signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>t?o.sendTransactionBatch(e):o.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:n,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},signTransaction:async e=>{let o=await S(e.chainId),r=[],t="calls"in e&&void 0!==e.calls;return r=t?[...e.calls]:[e],new Promise((async(i,n)=>{v.current=!0;let{entropyId:c,entropyIdVerifier:a}=d(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:c,entropyIdVerifier:a,onCompleteNavigateTo:h,onFailure:()=>{}},sendTransaction:{transactionRequests:f({calls:r,chain:o.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:a,transactingWalletAddress:o.account.address,transactingWalletIndex:void 0,signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>{if(!t)return o.signTransaction(e);throw Error("Batch transactions not supported for signing")},onSuccess:e=>i(e.hash),onFailure:n,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))}}}export{C as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{hexToNumber as o,createWalletClient as r,custom as t,http as n}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as c}from"viem/chains";import{u as a,m as s,am as l,l as p,a as m,au as d,av as u,aw as h,n as I}from"./privy-provider-QuG0Jtad.mjs";import{u as y}from"./internal-context-1GyQ1hzA.mjs";import{g}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as f}from"./smart-wallets-DDC7ER1L.mjs";import"react/jsx-runtime";import"mipd";import"react";import"react-device-detect";import"viem/utils";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@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/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"zustand";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"qrcode";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";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/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function C(){let{user:C}=a(),{hideWalletUIs:v,openPrivyModal:w,chains:P,appId:T,rpcConfig:M}=y(),{wallets:k}=s(),{setModalData:A}=l(),F=p(C),S=async(a=c.id)=>{let s=g(k);if(!s)throw Error("No connected wallet found");let l="string"==typeof a?o(a):a;if(![c.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=P.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await s.switchChain(p.id);let m=await s.getEthereumProvider(),d=r({account:s.address,transport:t(m)}),u=i({address:s.address,signMessage:d.signMessage,signTransaction:d.signTransaction,signTypedData:d.signTypedData});return await e({chain:p,transport:n(I(p,M,T)),publicTransport:n(I(p,M,T)),signer:u})};return{signMessage:async({message:e},o)=>{let r=await S(o);return new Promise((async(o,t)=>{let{entropyId:n,entropyIdVerifier:i}=m(C);v.current=!0,A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:d,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},signTypedData:async(e,o)=>{let r=await S(o);return new Promise((async(o,t)=>{v.current=!0;let{entropyId:n,entropyIdVerifier:i}=m(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:d,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>o(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},sendTransaction:async e=>{let o=await S(e.chainId),r=[],t="calls"in e&&void 0!==e.calls;return r=t?[...e.calls]:[e],new Promise((async(n,i)=>{v.current=!0;let{entropyId:c,entropyIdVerifier:a}=m(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:c,entropyIdVerifier:a,onCompleteNavigateTo:h,onFailure:()=>{}},sendTransaction:{transactionRequests:f({calls:r,chain:o.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:a,transactingWalletAddress:o.account.address,transactingWalletIndex:void 0,signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>t?o.sendTransactionBatch(e):o.sendTransaction(e),onSuccess:e=>n(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))},signTransaction:async e=>{let o=await S(e.chainId),r=[],t="calls"in e&&void 0!==e.calls;return r=t?[...e.calls]:[e],new Promise((async(n,i)=>{v.current=!0;let{entropyId:c,entropyIdVerifier:a}=m(C);A({connectWallet:{recoveryMethod:F.recoveryMethod,connectingWalletAddress:F.address,entropyId:c,entropyIdVerifier:a,onCompleteNavigateTo:h,onFailure:()=>{}},sendTransaction:{transactionRequests:f({calls:r,chain:o.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:c,entropyIdVerifier:a,transactingWalletAddress:o.account.address,transactingWalletIndex:void 0,signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>{if(!t)return o.signTransaction(e);throw Error("Batch transactions not supported for signing")},onSuccess:e=>n(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w(u)})).finally((()=>{v.current=!1}))}}}export{C as useAbstractSmartWallets};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{a as e,am as i,an as a,f as s,u as n}from"./internal-context-O3TPYUku.mjs";import"ofetch";class r{async init(){if(!this.api)throw new e("Auth flow has no API instance");let{nonce:t}=await this.api.post(i,{});return{nonce:t}}async authenticate(){if(!this.message||!this.signature||!this.fid)throw new e("Auth flow has no message, signature, or fid");if(!this.api)throw new e("Auth flow has no API instance");try{let t=await this.api.post(a,{message:this.message,signature:this.signature,fid:this.fid});if(!t)throw new e("No response from authentication");return t}catch(t){throw s(t)}}async link(){throw Error("Not implemented")}setAuthData({message:t,signature:e,fid:i}){this.message=t,this.signature=e,this.fid=i}constructor(){this.meta={}}}const o=()=>{let{client:i,setAuthenticated:a,setUser:s}=n();return{initLoginToFrame:t((async()=>{let t=new r;if(!i)throw new e("Must initialize Privy client first.");return i.startAuthFlow(t),await t.init()}),[i]),loginToFrame:t((async({message:t,signature:n})=>{if(!i)throw new e("Must initialize Privy client first.");if(!(i.authFlow instanceof r))throw new e("Must initialize Farcaster frame flow first.");let o=(t=>{let e=t.match(/farcaster:\/\/fid\/(\d+)/);return e&&e[1]?parseInt(e[1],10):null})(t);if(!o)throw new e("Invalid message format; could not parse Farcaster ID.");i.authFlow.setAuthData({message:t,signature:n,fid:o});let{user:h}=await i.authenticate();return h&&(s(h),a(!0)),h}),[i,s,a])}};export{o as useLoginToFrame};
1
+ import{useCallback as t}from"react";import{F as e}from"./frame-Ce7X1pBv.mjs";import{u as i,P as r}from"./internal-context-1GyQ1hzA.mjs";import"ofetch";const a=()=>{let{client:a,setAuthenticated:n,setUser:s}=i();return{initLoginToFrame:t((async()=>{let t=new e;if(!a)throw new r("Must initialize Privy client first.");return a.startAuthFlow(t),await t.init()}),[a]),loginToFrame:t((async({message:t,signature:i})=>{if(!a)throw new r("Must initialize Privy client first.");if(!(a.authFlow instanceof e))throw new r("Must initialize Farcaster frame flow first.");let o=(t=>{let e=t.match(/farcaster:\/\/fid\/(\d+)/);return e&&e[1]?parseInt(e[1],10):null})(t);if(!o)throw new r("Invalid message format; could not parse Farcaster ID.");a.authFlow.setAuthData({message:t,signature:i,fid:o});let{user:l}=await a.authenticate();return l&&(s(l),n(!0)),l}),[a,s,n])}};export{a as useLoginToFrame};
@@ -0,0 +1 @@
1
+ import{P as t,am as s,an as i,f as e}from"./internal-context-1GyQ1hzA.mjs";class a{async init(){if(!this.api)throw new t("Auth flow has no API instance");let{nonce:i,expires_at:e}=await this.api.post(s,{});return{nonce:i,expiresAt:e}}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(i,{message:this.message,signature:this.signature,fid:this.fid});if(!s)throw new t("No response from authentication");return s}catch(t){throw e(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{a as F};
@@ -1 +1 @@
1
- import{u as e,a as i,b as s,c as l,C as d,d as h,s as k,P as C,e as W,f,g as T,G as U,W as R,h as S,i as P,j as N,k as O,l as M}from"./privy-provider-DSQ8FU83.mjs";export{o as Captcha,p as ConnectorManager,E as EthereumWalletConnector,L as LoginModal,y as PrivyClient,m as PrivyProvider,H as SUPPORTED_CHAINS,V as VERSION,q as WalletConnector,J as addPrivyRpcToChain,I as addRpcUrlOverrideToChain,w as errorIndicatesMaxMfaRetries,x as errorIndicatesMfaTimeout,v as errorIndicatesMfaVerificationFailed,n as getAccessToken,z as useIdentityToken,F as useImportWallet,A as useLogout,r as useMfa,t as useMfaEnrollment,B as useRegisterMfaListener,D as useSolanaWallets}from"./privy-provider-DSQ8FU83.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-D0FziaS7.mjs";import{useCallback as _,useEffect as K,useContext as j}from"react";import{u as G,P as Q,a as X,I as $}from"./internal-context-O3TPYUku.mjs";import{zeroAddress as Y,getAddress as Z,createWalletClient as ee,http as te,parseSignature as re}from"viem";import{eip7702Actions as oe,hashAuthorization as ie}from"viem/experimental";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/WalletIcon";import"zustand";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"@heroicons/react/24/solid/CheckCircleIcon";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/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"qrcode";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@headlessui/react";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";const ne=t=>{e("login",t);let r=i(),o=s(),{ready:n,user:a}=l(),{initLoginWithHeadlessOAuth:c,loginWithHeadlessOAuth:u,oAuthState:p,setOAuthState:w,isHeadlessOAuthLoading:m}=G(),g=_((async e=>{try{if(r.enabled&&"success"!==r.status)throw new d(r.error,null,Q.CAPTCHA_FAILURE);return await c(e.provider,r.token,e.disableSignup)}catch(e){throw w({status:"error",error:e}),e}}),[c,r]),A=_((async()=>{let e=h();try{if(a)return console.warn("Cannot login with OAuth when already logged in"),a;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw w({status:"error",error:e}),e}try{return await u(e)}catch(e){throw w({status:"error",error:e}),e}finally{k()}}),[u]);return K((()=>{let e=h();n&&o&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&A().catch((()=>{}))}),[n,o]),{initOAuth:g,loading:m,state:p}},ae=e=>{let t=i(),{emailOtpState:r,setEmailOtpState:o,initLoginWithEmail:n,loginWithCode:a}=G();return{sendCode:_((async({email:r,disableSignup:i})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({email:r,captchaToken:e,disableSignup:i,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:_((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:n,linkedAccount:s}=await a(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:n,loginMethod:"email",loginAccount:s})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),r}}),[a,t.status]),state:r}},se=e=>{let t=i(),{initSignupWithPasskey:r,signupWithPasskey:o,passkeyAuthState:n,setPasskeyAuthState:a}=G();return{signupWithPasskey:_((async()=>{try{let i;if(t.enabled&&"error"===t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),i=await t.waitForResult()),await r({captchaToken:i,withPrivyUi:!1});let{user:n,isNewUser:a,wasAlreadyAuthenticated:s,loginAccount:c}=await o();e?.onComplete?.({user:n,isNewUser:a,wasAlreadyAuthenticated:s,loginMethod:"passkey",loginAccount:c})}catch(t){throw a({status:"error",error:t}),e?.onError?.(t.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),t}}),[o,t.status]),state:n}},ce=e=>{let t=i(),{initLoginWithPasskey:r,loginWithPasskey:o,passkeyAuthState:n,setPasskeyAuthState:a}=G();return{loginWithPasskey:_((async i=>{try{let n;if(t.enabled&&"error"===t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),n=await t.waitForResult()),await r({captchaToken:n,withPrivyUi:!1});let{user:a,isNewUser:s,wasAlreadyAuthenticated:c,loginAccount:l}=await o(i);e?.onComplete?.({user:a,isNewUser:s,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:l})}catch(i){throw a({status:"error",error:i}),e?.onError?.(i.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),i}}),[o,t.status]),state:n}},le=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:o,setPasskeyAuthState:i}=G();return{linkWithPasskey:_((async()=>{try{await t();let o=await r();if(!o)throw Error("Error, user not found");let i=o.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:o,linkMethod:"passkey",linkedAccount:i})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||Q.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:o}},ue=e=>{let t=i(),{smsOtpState:r,setSmsOtpState:o,initLoginWithSms:n,loginWithCode:a}=G();return{sendCode:_((async({phoneNumber:r,disableSignup:i})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({phoneNumber:r,captchaToken:e,disableSignup:i,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:_((async({code:r})=>{try{if(t.enabled&&"success"!==t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:n,linkedAccount:s}=await a(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:n,loginMethod:"sms",loginAccount:s})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),r}}),[a,t.status]),state:r}},de=t=>{let{connectOrCreateWallet:r}=l();return e("connectOrCreateWallet",t),{connectOrCreateWallet:r}},he=e=>{let t=i(),{siweState:r,setSiweState:o,linkWithSiwe:n,generateSiweMessage:a}=G();return{generateSiweMessage:_((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await a({address:t,chainId:r}).then((e=>e))}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||Q.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[a]),linkWithSiwe:_((async({signature:r,message:i,chainId:a,walletClientType:s,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);let{user:o,linkedAccount:l}=await n({message:i,signature:r,chainId:a,walletClientType:s,connectorType:c});l&&e?.onSuccess?.({user:o,linkMethod:"siwe",linkedAccount:l})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Q.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[n,t.status]),state:r}};function pe(){let{signTransaction:e}=j(C);return{signTransaction:e}}function we(t){let{linkEmail:r,linkPhone:o,linkWallet:i,linkGoogle:n,linkApple:a,linkTwitter:s,linkDiscord:c,linkGithub:l,linkLinkedIn:u,linkTiktok:d,linkSpotify:h,linkInstagram:p,linkTelegram:w,linkFarcaster:m}=j(C);return e("linkAccount",t),{linkEmail:r,linkPhone:o,linkWallet:i,linkGoogle:n,linkApple:a,linkTwitter:s,linkDiscord:c,linkGithub:l,linkLinkedIn:u,linkTiktok:d,linkSpotify:h,linkInstagram:p,linkFarcaster:m,linkTelegram:w}}function me(t){let{updateEmail:r,updatePhone:o}=j(C);return e("update",t),{updateEmail:r,updatePhone:o}}function ge(t){let{createWallet:r}=j(C);return e("createWallet",t),{createWallet:r}}const Ae=()=>{let{connectCoinbaseSmartWallet:e}=G();return{connectCoinbaseSmartWallet:e}},ye=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:o,sendTransactionWithCrossAppWallet:i}=l();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:o,sendTransaction:i}};function ke(t){let{sendTransaction:r}=j(C);return e("sendTransaction",t),{sendTransaction:r}}function Ce(t){let{setWalletPassword:r}=j(C);return e("setWalletPassword",t),{setWalletPassword:r}}function Ie(){let e=W(),{getAccessToken:t,createWallet:r}=f(),o=T(),{client:i,setUser:n,setAuthenticated:a,setIsNewUser:s,initializeWalletProxy:c,refreshSessionAndUser:l}=G();return{createGuestAccount:async()=>{if(!e.id||!i)throw Error("SDK not yet ready");i.startAuthFlow(new U(e.id));try{let{user:u,isNewUser:d}=await i.authenticate();if(d=d||!1,!u)throw new X("Unable to authenticate guest account");let h=await t(),p=await c(R);if(h&&p)try{let t=S(u,e.embeddedWallets.ethereum.createOnLogin),o=P(u,e.embeddedWallets.solana.createOnLogin);if(t&&o){let e=await r();await p.createSolana({accessToken:h,ethereumAddress:e?.address}),u=await l()}else o?(await p.createSolana({accessToken:h,ethereumAddress:N(u)?.address}),u=await l()):t?(await r(),u=await l()):n(u)}catch(e){n(u),console.warn("Unable to create embedded wallet for guest account")}return s(d),a(!0),o("login","onComplete",{user:u,isNewUser:d,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),u}catch(e){throw o("login","onError",e.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),e}}}}function We(t){let{setWalletRecovery:r}=j(C);return e("setWalletRecovery",t),{setWalletRecovery:r}}function fe(t){let{signMessage:r}=j(C);return e("signMessage",t),{signMessage:r}}const Ee=()=>{let{ready:e,wallets:t}=O(),{user:r}=l(),{rpcConfig:o,chains:i,appId:n}=G();return{signAuthorization:_((async(a,s)=>{if(!r)throw Error("User must be authenticated before signing with a Privy wallet");if(!e)throw Error("Wallets are not ready");let c=s?.address??N(r)?.address??Y,l=t.find((e=>Z(e.address)===Z(c)));if(!l)throw Error("Signing wallet not found.");let u=a.chainId??Number(l.chainId.split(":")[1]),d=i.find((e=>e.id===u));if(!d)throw Error("Error, chain not configured in PrivyProvider config");let h=ee({account:c,chain:d,transport:te(M(d,o,n))}).extend(oe()),p=await h.prepareAuthorization({...a,sponsor:a.sponsor||void 0}),w=await l.getEthereumProvider(),m=await w.request({method:"secp256k1_sign",params:[ie(p)]});return{...p,...re(m)}}),[e,t,r,i])}};function Te(t){let{signTypedData:r}=j(C);return e("signTypedData",t),{signTypedData:r}}const Ue=()=>{let{isModalOpen:e}=j(C);return{isOpen:e}};function Re(t){let{getAccessToken:r}=j(C);return e("accessToken",t),{getAccessToken:r}}function Se(t){let{authenticated:r,user:o}=l(),{initLoginWithOAuth:i}=G(),n=T();return e("oAuthAuthorization",t),{reauthorize:e=>Pe(r,o,i,n,e.provider)}}let Pe=async(e,t,r,o,i)=>{if(!e)throw o("linkAccount","onError",Q.MUST_BE_AUTHENTICATED,{linkMethod:i}),new X("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(i))))throw new X(`OAuth account of type ${i} not linked to the account.`);await r(i)};const ve=t=>{let{customAuthStatus:r}=G();return e("customAuth",t),{status:r}};function Ne(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=l();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}const Oe=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=G();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},be=()=>{let{setUser:e,client:t}=j($),{user:r}=j(C);return{user:r,refreshUser:_((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},Me=e=>{let t=i(),{initLoginWithTelegram:r,loginWithTelegram:o,telegramAuthState:n,setTelegramAuthState:a}=G();return{login:_((async i=>{try{if(t.enabled&&"success"!==t.status)throw new d(t.error,null,Q.CAPTCHA_FAILURE);await r(t.token,i?.disableSignup);let{user:n,isNewUser:a,loginAccount:s,wasAlreadyAuthenticated:c}=await o({intent:"login"});e?.onComplete?.({user:n,isNewUser:a,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:s})}catch(i){throw a({status:"error",error:i}),e?.onError?.(i.privyErrorCode||Q.UNKNOWN_AUTH_ERROR),i}}),[r,o,t]),state:n}},_e=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=G();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}};export{Ae as useConnectCoinbaseSmartWallet,de as useConnectOrCreateWallet,ge as useCreateWallet,ye as useCrossAppAccounts,ve as useCustomAuth,Oe as useDelegatedActions,Ne as useFarcasterSigner,Ie as useGuestAccounts,_e as useHeadlessDelegatedActions,we as useLinkAccount,le as useLinkWithPasskey,he as useLinkWithSiwe,ae as useLoginWithEmail,ne as useLoginWithOAuth,ce as useLoginWithPasskey,ue as useLoginWithSms,Me as useLoginWithTelegram,Ue as useModalStatus,Se as useOAuthTokens,f as usePrivy,ke as useSendTransaction,Ce as useSetWalletPassword,We as useSetWalletRecovery,Ee as useSignAuthorization,fe as useSignMessage,pe as useSignTransaction,Te as useSignTypedData,se as useSignupWithPasskey,Re as useToken,me as useUpdateAccount,be as useUser,O as useWallets};
1
+ import{u as e,g as i,a as n,b as s,c as l,d as h,C as d,e as m,s as k,P as f,f as C,h as W,i as T,G as U,W as R,j as S,k as P,l as N,m as O,n as _}from"./privy-provider-QuG0Jtad.mjs";export{q as Captcha,r as ConnectorManager,E as EthereumWalletConnector,M as LoginModal,A as PrivyClient,o as PrivyProvider,J as SUPPORTED_CHAINS,V as VERSION,t as WalletConnector,L as addPrivyRpcToChain,K as addRpcUrlOverrideToChain,y as errorIndicatesMaxMfaRetries,z as errorIndicatesMfaTimeout,x as errorIndicatesMfaVerificationFailed,p as getAccessToken,B as useIdentityToken,I as useImportWallet,D as useLogout,v as useMfa,w as useMfaEnrollment,F as useRegisterMfaListener,H as useSolanaWallets}from"./privy-provider-QuG0Jtad.mjs";import{useCallback as j,useMemo as G,useEffect as Q,useContext as X}from"react";import{u as $,P as Y,a as Z,I as ee}from"./internal-context-1GyQ1hzA.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-B13pmqaE.mjs";import{F as te}from"./frame-Ce7X1pBv.mjs";import{zeroAddress as re,getAddress as oe,createWalletClient as ie,http as ne,parseSignature as ae}from"viem";import{eip7702Actions as se,hashAuthorization as ce}from"viem/experimental";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/js-sdk-core";import"@marsidev/react-turnstile";import"styled-components";import"tinycolor2";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@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/ChevronDownIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"zustand";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/CheckIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import"@heroicons/react/24/solid/DocumentCheckIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"qrcode";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";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/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/LockClosedIcon";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"ofetch";import"@heroicons/react/24/outline";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/CloudArrowUpIcon";import"@heroicons/react/24/outline/NoSymbolIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/outline/TrashIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";const le=()=>{let{user:t}=e(),{walletProxy:r}=$();return{recover:j((async e=>{if(!r)throw Error("Wallet proxy is not ready");let o=await i();if(!t||!o)throw new Y("User must be logged in before attempting to modify the recovery method.");let{entropyId:a,entropyIdVerifier:s}=n(t);try{await r.recover({entropyId:a,entropyIdVerifier:s,accessToken:o,...e})}catch{throw new Y("Unable to recover wallets")}}),[r,t])}},ue=()=>{let{client:e,setAuthenticated:t,setUser:r}=$();return G((()=>({init:async()=>{if(!e)throw new Y("Must initialize Privy client first.");let t=new te;return e.startAuthFlow(t),await t.init()},login:async({fid:o,message:i,signature:n})=>{if(!e)throw new Y("Must initialize Privy client first.");if(!(e.authFlow instanceof te))throw new Y("Must initialize Farcaster frame flow first.");e.authFlow.setAuthData({message:i,signature:n,fid:o});let{user:a}=await e.authenticate();if(!a)throw new Y("Failed to login with Farcaster V2");return r(a),t(!0),{user:a}}})),[e,r,t])},he=t=>{s("login",t);let r=l(),o=h(),{ready:i,user:n}=e(),{initLoginWithHeadlessOAuth:a,loginWithHeadlessOAuth:c,oAuthState:u,setOAuthState:p,isHeadlessOAuthLoading:w}=$(),g=j((async e=>{try{if(r.enabled&&"success"!==r.status)throw new d(r.error,null,Z.CAPTCHA_FAILURE);return await a(e.provider,r.token,e.disableSignup)}catch(e){throw p({status:"error",error:e}),e}}),[a,r]),A=j((async()=>{let e=m();try{if(n)return console.warn("Cannot login with OAuth when already logged in"),n;if(!e.inProgress)throw Error("Cannot login with OAuth because no OAuth flow is in progress");if(e.popupFlow)return}catch(e){throw p({status:"error",error:e}),e}try{return await c(e)}catch(e){throw p({status:"error",error:e}),e}finally{k()}}),[c]);return Q((()=>{let e=m();i&&o&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&A().catch((()=>{}))}),[i,o]),{initOAuth:g,loading:w,state:u}},de=e=>{let t=l(),{emailOtpState:r,setEmailOtpState:o,initLoginWithEmail:i,loginWithCode:n}=$();return{sendCode:j((async({email:r,disableSignup:n})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i({email:r,captchaToken:e,disableSignup:n,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),r}}),[i]),loginWithCode:j((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:a,linkedAccount:s}=await n(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:a,loginMethod:"email",loginAccount:s})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),r}}),[n,t.status]),state:r}},pe=e=>{let t=l(),{initSignupWithPasskey:r,signupWithPasskey:o,passkeyAuthState:i,setPasskeyAuthState:n}=$();return{signupWithPasskey:j((async()=>{try{let i;if(t.enabled&&"error"===t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),i=await t.waitForResult()),await r({captchaToken:i,withPrivyUi:!1});let{user:n,isNewUser:a,wasAlreadyAuthenticated:s,loginAccount:c}=await o();e?.onComplete?.({user:n,isNewUser:a,wasAlreadyAuthenticated:s,loginMethod:"passkey",loginAccount:c})}catch(t){throw n({status:"error",error:t}),e?.onError?.(t.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),t}}),[o,t.status]),state:i}},we=e=>{let t=l(),{initLoginWithPasskey:r,loginWithPasskey:o,passkeyAuthState:i,setPasskeyAuthState:n}=$();return{loginWithPasskey:j((async i=>{try{let n;if(t.enabled&&"error"===t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),n=await t.waitForResult()),await r({captchaToken:n,withPrivyUi:!1});let{user:a,isNewUser:s,wasAlreadyAuthenticated:c,loginAccount:l}=await o(i);e?.onComplete?.({user:a,isNewUser:s,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:l})}catch(i){throw n({status:"error",error:i}),e?.onError?.(i.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),i}}),[o,t.status]),state:i}},me=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:o,setPasskeyAuthState:i}=$();return{linkWithPasskey:j((async()=>{try{await t();let o=await r();if(!o)throw Error("Error, user not found");let i=o.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:o,linkMethod:"passkey",linkedAccount:i})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||Z.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:o}},ge=e=>{let t=l(),{smsOtpState:r,setSmsOtpState:o,initLoginWithSms:i,loginWithCode:n}=$();return{sendCode:j((async({phoneNumber:r,disableSignup:n})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i({phoneNumber:r,captchaToken:e,disableSignup:n,withPrivyUi:!1})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),r}}),[i]),loginWithCode:j((async({code:r})=>{try{if(t.enabled&&"success"!==t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);let{user:o,isNewUser:i,wasAlreadyAuthenticated:a,linkedAccount:s}=await n(r);e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:a,loginMethod:"sms",loginAccount:s})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),r}}),[n,t.status]),state:r}},Ae=t=>{let{connectOrCreateWallet:r}=e();return s("connectOrCreateWallet",t),{connectOrCreateWallet:r}},ye=e=>{let t=l(),{siweState:r,setSiweState:o,linkWithSiwe:i,generateSiweMessage:n}=$();return{generateSiweMessage:j((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await n({address:t,chainId:r}).then((e=>e))}catch(t){throw o({status:"error",error:t}),e?.onError?.(t.privyErrorCode||Z.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[n]),linkWithSiwe:j((async({signature:r,message:n,chainId:a,walletClientType:s,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);let{user:o,linkedAccount:l}=await i({message:n,signature:r,chainId:a,walletClientType:s,connectorType:c});l&&e?.onSuccess?.({user:o,linkMethod:"siwe",linkedAccount:l})}catch(r){throw o({status:"error",error:r}),e?.onError?.(r.privyErrorCode||Z.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[i,t.status]),state:r}};function ke(){let{signTransaction:e}=X(f);return{signTransaction:e}}function fe(e){let{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:i,linkApple:n,linkTwitter:a,linkDiscord:c,linkGithub:l,linkLinkedIn:u,linkTiktok:h,linkSpotify:d,linkInstagram:p,linkTelegram:w,linkFarcaster:m}=X(f);return s("linkAccount",e),{linkEmail:t,linkPhone:r,linkWallet:o,linkGoogle:i,linkApple:n,linkTwitter:a,linkDiscord:c,linkGithub:l,linkLinkedIn:u,linkTiktok:h,linkSpotify:d,linkInstagram:p,linkFarcaster:m,linkTelegram:w}}function Ce(e){let{updateEmail:t,updatePhone:r}=X(f);return s("update",e),{updateEmail:t,updatePhone:r}}function Ie(e){let{createWallet:t}=X(f);return s("createWallet",e),{createWallet:t}}const We=()=>{let{connectCoinbaseSmartWallet:e}=$();return{connectCoinbaseSmartWallet:e}},Ee=()=>{let{startCrossAppAuthFlow:t,unlinkCrossAppAccount:r,signMessageWithCrossAppWallet:o,signTypedDataWithCrossAppWallet:i,sendTransactionWithCrossAppWallet:n}=e();return{loginWithCrossAppAccount:({appId:e})=>t({appId:e,action:"login"}),linkCrossAppAccount:({appId:e})=>t({appId:e,action:"link"}),unlinkCrossAppAccount:r,signMessage:o,signTypedData:i,sendTransaction:n}};function Te(e){let{sendTransaction:t}=X(f);return s("sendTransaction",e),{sendTransaction:t}}function Ue(e){let{setWalletPassword:t}=X(f);return s("setWalletPassword",e),{setWalletPassword:t}}function Re(){let e=C(),{getAccessToken:t,createWallet:r}=W(),o=T(),{client:i,setUser:n,setAuthenticated:a,setIsNewUser:s,initializeWalletProxy:c,refreshSessionAndUser:l}=$();return{createGuestAccount:async()=>{if(!e.id||!i)throw Error("SDK not yet ready");i.startAuthFlow(new U(e.id));try{let{user:u,isNewUser:h}=await i.authenticate();if(h=h||!1,!u)throw new Y("Unable to authenticate guest account");let d=await t(),p=await c(R);if(d&&p)try{let t=S(u,e.embeddedWallets.ethereum.createOnLogin),o=P(u,e.embeddedWallets.solana.createOnLogin);if(t&&o){let e=await r();await p.createSolana({accessToken:d,ethereumAddress:e?.address}),u=await l()}else o?(await p.createSolana({accessToken:d,ethereumAddress:N(u)?.address}),u=await l()):t?(await r(),u=await l()):n(u)}catch(e){n(u),console.warn("Unable to create embedded wallet for guest account")}return s(h),a(!0),o("login","onComplete",{user:u,isNewUser:h,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),u}catch(e){throw o("login","onError",e.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),e}}}}function Se(e){let{setWalletRecovery:t}=X(f);return s("setWalletRecovery",e),{setWalletRecovery:t}}function ve(e){let{signMessage:t}=X(f);return s("signMessage",e),{signMessage:t}}const Pe=()=>{let{ready:t,wallets:r}=O(),{user:o}=e(),{rpcConfig:i,chains:n,appId:a}=$();return{signAuthorization:j((async(e,s)=>{if(!o)throw Error("User must be authenticated before signing with a Privy wallet");if(!t)throw Error("Wallets are not ready");let c=s?.address??N(o)?.address??re,l=r.find((e=>oe(e.address)===oe(c)));if(!l)throw Error("Signing wallet not found.");let u=e.chainId??Number(l.chainId.split(":")[1]),h=n.find((e=>e.id===u));if(!h)throw Error("Error, chain not configured in PrivyProvider config");let d=ie({account:c,chain:h,transport:ne(_(h,i,a))}).extend(se()),p=await d.prepareAuthorization({...e,sponsor:e.sponsor||void 0}),w=await l.getEthereumProvider(),m=await w.request({method:"secp256k1_sign",params:[ce(p)]});return{...p,...ae(m)}}),[t,r,o,n])}};function Ne(e){let{signTypedData:t}=X(f);return s("signTypedData",e),{signTypedData:t}}const be=()=>{let{isModalOpen:e}=X(f);return{isOpen:e}};function Oe(e){let{getAccessToken:t}=X(f);return s("accessToken",e),{getAccessToken:t}}function Me(t){let{authenticated:r,user:o}=e(),{initLoginWithOAuth:i}=$(),n=T();return s("oAuthAuthorization",t),{reauthorize:e=>Fe(r,o,i,n,e.provider)}}let Fe=async(e,t,r,o,i)=>{if(!e)throw o("linkAccount","onError",Z.MUST_BE_AUTHENTICATED,{linkMethod:i}),new Y("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(i))))throw new Y(`OAuth account of type ${i} not linked to the account.`);await r(i)};const _e=e=>{let{customAuthStatus:t}=$();return s("customAuth",e),{status:t}};function Le(){let{getFarcasterSignerPublicKey:t,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}=e();return{getFarcasterSignerPublicKey:t,signFarcasterMessage:r,requestFarcasterSignerFromWarpcast:o}}const De=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=$();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},He=()=>{let{setUser:e,client:t}=X(ee),{user:r}=X(f);return{user:r,refreshUser:j((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},xe=e=>{let t=l(),{initLoginWithTelegram:r,loginWithTelegram:o,telegramAuthState:i,setTelegramAuthState:n}=$();return{login:j((async i=>{try{if(t.enabled&&"success"!==t.status)throw new d(t.error,null,Z.CAPTCHA_FAILURE);await r(t.token,i?.disableSignup);let{user:n,isNewUser:a,loginAccount:s,wasAlreadyAuthenticated:c}=await o({intent:"login"});e?.onComplete?.({user:n,isNewUser:a,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:s})}catch(i){throw n({status:"error",error:i}),e?.onError?.(i.privyErrorCode||Z.UNKNOWN_AUTH_ERROR),i}}),[r,o,t]),state:i}},Ke=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=$();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}};export{We as useConnectCoinbaseSmartWallet,Ae as useConnectOrCreateWallet,Ie as useCreateWallet,Ee as useCrossAppAccounts,_e as useCustomAuth,De as useDelegatedActions,Le as useFarcasterSigner,Re as useGuestAccounts,Ke as useHeadlessDelegatedActions,fe as useLinkAccount,me as useLinkWithPasskey,ye as useLinkWithSiwe,de as useLoginWithEmail,ue as useLoginWithFarcasterV2,he as useLoginWithOAuth,we as useLoginWithPasskey,ge as useLoginWithSms,xe as useLoginWithTelegram,be as useModalStatus,Me as useOAuthTokens,W as usePrivy,le as useRecoverEmbeddedWallet,Te as useSendTransaction,Ue as useSetWalletPassword,Se as useSetWalletRecovery,Pe as useSignAuthorization,ve as useSignMessage,ke as useSignTransaction,Ne as useSignTypedData,pe as useSignupWithPasskey,Oe as useToken,Ce as useUpdateAccount,He as useUser,O as useWallets};
@@ -0,0 +1 @@
1
+ import{FetchError as a}from"ofetch";import{createContext as e,useContext as s}from"react";var t;class i extends Error{toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}constructor(a,e,s){super(a),e instanceof Error&&(this.cause=e),this.privyErrorCode=s}}class n extends i{constructor(a,e,s,t,i,n){super(s,t,i),this.type=a,this.status=e,this.data=n}}class r extends i{constructor(a,e,s){super(a,e,s),this.type="client_error"}}class _ extends r{constructor(){super("Request timed out",void 0,"client_request_timeout")}}class o extends i{constructor(a,e,s){super(a,e,s),this.type="connector_error"}}const l=e=>{if(e instanceof i)return e;if(!(e instanceof a))return u(e);if(!e.response)return new n("api_error",null,e.message,e);let{type:s,message:t,error:r,code:_}=e.data;return new n(s||"ApiError",e.response.status,t||r,e,_,e.data)},u=a=>a instanceof i?a:a instanceof Error?new r(a.message,a):new r(`Internal error: ${a}`);var d=((t={}).OAUTH_ACCOUNT_SUSPENDED="oauth_account_suspended",t.MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",t.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",t.MISSING_OR_INVALID_TOKEN="missing_or_invalid_token",t.INVALID_DATA="invalid_data",t.INVALID_CAPTCHA="invalid_captcha",t.LINKED_TO_ANOTHER_USER="linked_to_another_user",t.CANNOT_LINK_MORE_OF_TYPE="cannot_link_more_of_type",t.FAILED_TO_LINK_ACCOUNT="failed_to_link_account",t.FAILED_TO_UPDATE_ACCOUNT="failed_to_update_account",t.USER_EXITED_UPDATE_FLOW="exited_update_flow",t.ALLOWLIST_REJECTED="allowlist_rejected",t.OAUTH_USER_DENIED="oauth_user_denied",t.OAUTH_UNEXPECTED="oauth_unexpected",t.UNKNOWN_AUTH_ERROR="unknown_auth_error",t.USER_EXITED_AUTH_FLOW="exited_auth_flow",t.USER_EXITED_LINK_FLOW="exited_link_flow",t.USER_EXITED_SET_PASSWORD_FLOW="user_exited_set_password_flow",t.MUST_BE_AUTHENTICATED="must_be_authenticated",t.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",t.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",t.CLIENT_REQUEST_TIMEOUT="client_request_timeout",t.INVALID_CREDENTIALS="invalid_credentials",t.MISSING_MFA_CREDENTIALS="missing_or_invalid_mfa",t.UNKNOWN_MFA_ERROR="unknown_mfa_error",t.EMBEDDED_WALLET_ALREADY_EXISTS="embedded_wallet_already_exists",t.EMBEDDED_WALLET_NOT_FOUND="embedded_wallet_not_found",t.EMBEDDED_WALLET_CREATE_ERROR="embedded_wallet_create_error",t.UNKNOWN_EMBEDDED_WALLET_ERROR="unknown_embedded_wallet_error",t.EMBEDDED_WALLET_PASSWORD_UNCONFIRMED="embedded_wallet_password_unconfirmed",t.EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS="embedded_wallet_password_already_exists",t.EMBEDDED_WALLET_RECOVERY_ALREADY_EXISTS="embedded_wallet_recovery_already_exists",t.TRANSACTION_FAILURE="transaction_failure",t.UNSUPPORTED_CHAIN_ID="unsupported_chain_id",t.NOT_SUPPORTED="not_supported",t.CAPTCHA_TIMEOUT="captcha_timeout",t.INVALID_MESSAGE="invalid_message",t.UNABLE_TO_SIGN="unable_to_sign",t.CAPTCHA_FAILURE="captcha_failure",t.CAPTCHA_DISABLED="captcha_disabled",t.SESSION_STORAGE_UNAVAILABLE="session_storage_unavailable",t.TOO_MANY_REQUESTS="too_many_requests",t.USER_LIMIT_REACHED="max_accounts_reached",t.DISALLOWED_LOGIN_METHOD="disallowed_login_method",t.DISALLOWED_PLUS_EMAIL="disallowed_plus_email",t.PASSKEY_NOT_ALLOWED="passkey_not_allowed",t.USER_DOES_NOT_EXIST="user_does_not_exist",t.INSUFFICIENT_BALANCE="insufficient_balance",t.ACCOUNT_TRANSFER_REQUIRED="account_transfer_required",t.BUFFER_NOT_DEFINED="buffer_not_defined",t);class p extends r{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}}class c extends r{constructor(a="Embedded wallet error",e){super(a,e,"unknown_embedded_wallet_error")}}class E extends r{constructor(a="User must be authenticated"){super(a,void 0,"must_be_authenticated")}}class A extends r{constructor(a){super("This application is in development mode and must be upgraded to production to log in new users.",a,"max_accounts_reached")}}const h="/api/v1/sessions",v="/api/v1/sessions/logout",S="/api/v1/siwe/init",T="/api/v1/siwe/authenticate",m="/api/v1/siwe/link",w="/api/v1/siwe/link_smart_wallet",I="/api/v1/siwe/unlink",D="/api/v1/siwe/transfer",O="/api/v1/siws/init",N="/api/v1/siws/authenticate",L="/api/v1/siws/link",g="/api/v1/siws/unlink",R="/api/v1/farcaster/init",W="/api/v1/farcaster/authenticate",U="/api/v1/farcaster/link",f="/api/v1/farcaster/status",k="/api/v1/farcaster/unlink",y="/api/v1/farcaster/transfer",C="api/v2/farcaster/init",P="api/v2/farcaster/authenticate",M="/api/v1/passwordless/init",F="/api/v1/passwordless/authenticate",b="/api/v1/passwordless/link",x="/api/v1/passwordless/unlink",H="/api/v1/passwordless/update",B="/api/v1/passwordless/transfer",V="/api/v1/passwordless_sms/init",K="/api/v1/passwordless_sms/link",Y="/api/v1/passwordless_sms/unlink",G="/api/v1/passwordless_sms/authenticate",X="/api/v1/passwordless_sms/update",$="/api/v1/passwordless_sms/transfer",q="/api/v1/oauth/init",j="/api/v1/oauth/authenticate",Q="/api/v1/oauth/link",z="/api/v1/oauth/unlink",J="/api/v1/oauth/transfer",Z="/api/v1/recovery/oauth/init",aa="/api/v1/recovery/oauth/init_icloud",ea="/api/v1/recovery/oauth/authenticate",sa="/api/v1/passkeys/link/init",ta="/api/v1/passkeys/authenticate/init",ia="/api/v1/passkeys/register/init",na="/api/v1/passkeys/link",ra="/api/v1/passkeys/authenticate",_a="/api/v1/passkeys/register",oa="/api/v1/telegram/authenticate",la="/api/v1/telegram/link",ua="/api/v1/telegram/unlink",da="/api/v1/telegram/transfer",pa="/api/v1/mfa/passwordless_sms/init",ca="/api/v1/mfa/passkeys/init",Ea="/api/v1/users/me/accept_terms",Aa="/api/v1/analytics_events",ha="/api/v1/custom_jwt_account/authenticate",va="/api/v1/guest/authenticate",Sa="/api/v1/plugins/moonpay_on_ramp/sign",Ta="/api/v1/funding/coinbase_on_ramp/init",ma="/api/v1/funding/coinbase_on_ramp/status",wa="/api/v1/wallets/revoke",Ia="/api/v1/users/me",Da="/api/v1/scan/transaction",Oa=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},Na=a=>()=>{throw Error(a.trim())},La=/*#__PURE__*/e({setAuthenticated:Oa,setUser:Oa,setIsNewUser:Oa,isNewUserThisSession:!1,walletConnectionStatus:null,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,appId:"notAdded",customAuthStatus:{status:"not-enabled"},hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:Oa,initializeWalletProxy:Oa,getAuthMeta:Oa,getAuthFlow:Oa,closePrivyModal:Oa,openPrivyModal:Oa,connectWallet:Oa,initLoginWithWallet:Oa,loginWithWallet:Oa,initLoginWithFarcaster:Oa,loginWithFarcaster:Oa,loginWithCode:Oa,initLoginWithEmail:Oa,initLoginWithSms:Oa,initUpdateEmail:Oa,initUpdatePhone:Oa,resendEmailCode:Oa,resendSmsCode:Oa,initLoginWithHeadlessOAuth:Oa,loginWithHeadlessOAuth:Oa,crossAppAuthFlow:Oa,initLoginWithOAuth:Oa,recoveryOAuthFlow:Oa,loginWithOAuth:Oa,passkeyAuthState:{status:"initial"},setPasskeyAuthState:Oa,initSignupWithPasskey:Oa,signupWithPasskey:Oa,initLoginWithPasskey:Oa,loginWithPasskey:Oa,initLinkWithPasskey:Oa,linkWithPasskey:Oa,refreshSessionAndUser:Oa,walletProxy:null,createAnalyticsEvent:Oa,acceptTerms:Oa,getUsdTokenPrice:Oa,getUsdPriceForSol:Oa,getSplTokenMetadata:Oa,recoverPrimaryWallet:Oa,updateWallets:Oa,fundWallet:Oa,openModal:Oa,setReadyToTrue:Oa,requestFarcasterSignerStatus:Oa,initLoginWithTelegram:Oa,loginWithTelegram:Oa,generateSiweMessage:Oa,generateSiweMessageForSmartWallet:Oa,linkWithSiwe:Oa,linkSmartWallet:Oa,delegateWallet:Oa,revokeDelegatedWallets:Oa,createEmbeddedSolanaWallet:Oa,exportSolanaWallet:Oa,connectCoinbaseSmartWallet:Oa,initiateAccountTransfer:Oa,emailOtpState:{status:"initial"},setEmailOtpState:Oa,smsOtpState:{status:"initial"},setSmsOtpState:Oa,siweState:{status:"initial"},setSiweState:Oa,oAuthState:{status:"initial"},setOAuthState:Oa,telegramAuthState:{status:"initial"},setTelegramAuthState:Oa,isHeadlessOAuthLoading:!1,isHeadlessSigning:Oa}),ga=()=>s(La);export{ma as $,i as A,oa as B,la as C,Na as D,_ as E,h as F,v as G,Aa as H,La as I,ha as J,va as K,u as L,n as M,pa as N,ca as O,r as P,Ea as Q,x as R,Y as S,I as T,g as U,z as V,k as W,ua as X,wa as Y,Sa as Z,Ta as _,d as a,S as a0,T as a1,m as a2,w as a3,O as a4,N as a5,J as a6,da as a7,y as a8,D as a9,$ as aa,B as ab,L as ac,Ia as ad,Da as ae,c as af,A as ag,E as ah,aa as ai,Z as aj,ea as ak,p as al,C as am,P as an,b,M as c,H as d,o as e,l as f,W as g,U as h,R as i,f as j,Q as k,q as l,_a as m,Oa as n,j as o,F as p,ra as q,na as r,ia as s,ta as t,ga as u,sa as v,G as w,K as x,V as y,X as z};