@privy-io/react-auth 2.23.0 → 2.23.1-beta-20250829154550

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 (43) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/extended-chains.js +1 -1
  3. package/dist/cjs/farcaster.js +1 -1
  4. package/dist/cjs/index.js +1 -1
  5. package/dist/cjs/{internal-context-C3Ps4gAt.js → internal-context-B_aIJuQh.js} +1 -1
  6. package/dist/cjs/{privy-provider-Q9EYyb3N.js → privy-provider-DIPD4zMP.js} +5 -5
  7. package/dist/cjs/{smart-wallets-DiLEwIKs.js → smart-wallets-B1f07c9Y.js} +1 -1
  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/{use-sign-with-user-signer-L1_W0zce.js → use-sign-with-user-signer-mIruAdfm.js} +1 -1
  12. package/dist/cjs/{useActiveWallet-DEknGgdp.js → useActiveWallet-f60dxyTD.js} +1 -1
  13. package/dist/cjs/{useFundWallet-BOm_c85i.js → useFundWallet-D-RgLsO6.js} +1 -1
  14. package/dist/dts/extended-chains.d.mts +1 -1
  15. package/dist/dts/extended-chains.d.ts +1 -1
  16. package/dist/dts/farcaster.d.mts +1 -1
  17. package/dist/dts/farcaster.d.ts +1 -1
  18. package/dist/dts/index.d.mts +8 -17
  19. package/dist/dts/index.d.ts +8 -17
  20. package/dist/dts/smart-wallets.d.mts +1 -1
  21. package/dist/dts/smart-wallets.d.ts +1 -1
  22. package/dist/dts/solana.d.mts +4 -4
  23. package/dist/dts/solana.d.ts +4 -4
  24. package/dist/dts/{types-cjyKPOmY.d.mts → types-omkxDlqB.d.mts} +1 -1
  25. package/dist/dts/{types-cjyKPOmY.d.ts → types-omkxDlqB.d.ts} +1 -1
  26. package/dist/dts/ui.d.mts +1 -1
  27. package/dist/dts/ui.d.ts +1 -1
  28. package/dist/dts/{useSolanaWallets-CZcmg0rm.d.mts → useSolanaWallets-CgL8k7D0.d.mts} +1 -1
  29. package/dist/dts/{useSolanaWallets-CZcmg0rm.d.ts → useSolanaWallets-CgL8k7D0.d.ts} +1 -1
  30. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  31. package/dist/esm/extended-chains.mjs +1 -1
  32. package/dist/esm/farcaster.mjs +1 -1
  33. package/dist/esm/index.mjs +1 -1
  34. package/dist/esm/{internal-context-D0EM1HLm.mjs → internal-context-qdNgTV5f.mjs} +1 -1
  35. package/dist/esm/{privy-provider-BOSSQASA.mjs → privy-provider-DPOlKdGx.mjs} +5 -5
  36. package/dist/esm/{smart-wallets-eeVPZj7Y.mjs → smart-wallets-_bWaRi0s.mjs} +1 -1
  37. package/dist/esm/smart-wallets.mjs +1 -1
  38. package/dist/esm/solana.mjs +1 -1
  39. package/dist/esm/ui.mjs +2 -2
  40. package/dist/esm/{use-sign-with-user-signer-BWQ0PcRX.mjs → use-sign-with-user-signer-u7zZ9cLA.mjs} +1 -1
  41. package/dist/esm/{useActiveWallet-CzofJJwe.mjs → useActiveWallet-DFwBUieX.mjs} +1 -1
  42. package/dist/esm/{useFundWallet-YwYOhvEX.mjs → useFundWallet-BwjddURP.mjs} +1 -1
  43. package/package.json +4 -4
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, a3 as SiwsMessageType, L as LoginMethod, a4 as ExternalWalletMetadata, a5 as TelegramAuthResult, a6 as TelegramWebAppData, a7 as OAuthUserInfo, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, ad as SiwsFlowState, a as LinkedAccountWithMetadata, ae as BaseAccountSdkType, af as UnsignedTransactionRequestWithChainId, ag as BaseConnectedWalletType, C as ConnectedSolanaWallet, ah as SessionSignerInput, ai as TelegramAuthFlowState } from './types-cjyKPOmY.js';
4
- export { aB as Apple, aO as AppleOAuthWithMetadata, aW as ContractUIOptions, aF as CrossAppAccount, aR as CrossAppAccountWithMetadata, ay as Discord, aJ as DiscordOAuthWithMetadata, aT as Email, at as EmailWithMetadata, a_ as Farcaster, aP as FarcasterWithMetadata, az as Github, aK as GithubOAuthWithMetadata, aw as Google, aH as GoogleOAuthWithMetadata, aD as Line, aM as LineOAuthWithMetadata, aG as LinkedAccountType, aA as LinkedIn, aN as LinkedInOAuthWithMetadata, b0 as LoginMethodOrderOption, ak as MessageTypes, am as MoonpayConfig, an as MoonpayCurrencyCode, aY as MoonpayFundingConfig, ao as MoonpayPaymentMethod, aX as NativeFundingConfig, as as NonEmptyArray, a$ as Passkey, aS as PasskeyWithMetadata, aU as Phone, au as PhoneWithMetadata, aZ as PriceDisplayOptions, P as PrivyErrorCode, ap as Quantity, al as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aE as Telegram, aQ as TelegramWithMetadata, aC as Tiktok, aL as TiktokOAuthWithMetadata, aq as TransactionLog, ar as TransactionReceipt, aV as TransactionUIOptions, ax as Twitter, aI as TwitterOAuthWithMetadata, aj as TypedMessage, av as WalletWithMetadata } from './types-cjyKPOmY.js';
3
+ import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, a3 as SiwsMessageType, L as LoginMethod, a4 as ExternalWalletMetadata, a5 as TelegramAuthResult, a6 as TelegramWebAppData, a7 as OAuthUserInfo, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, a as LinkedAccountWithMetadata, ad as BaseAccountSdkType, ae as UnsignedTransactionRequestWithChainId, af as BaseConnectedWalletType, C as ConnectedSolanaWallet, ag as SessionSignerInput, ah as TelegramAuthFlowState } from './types-omkxDlqB.js';
4
+ export { aA as Apple, aN as AppleOAuthWithMetadata, aV as ContractUIOptions, aE as CrossAppAccount, aQ as CrossAppAccountWithMetadata, ax as Discord, aI as DiscordOAuthWithMetadata, aS as Email, as as EmailWithMetadata, aZ as Farcaster, aO as FarcasterWithMetadata, ay as Github, aJ as GithubOAuthWithMetadata, av as Google, aG as GoogleOAuthWithMetadata, aC as Line, aL as LineOAuthWithMetadata, aF as LinkedAccountType, az as LinkedIn, aM as LinkedInOAuthWithMetadata, a$ as LoginMethodOrderOption, aj as MessageTypes, al as MoonpayConfig, am as MoonpayCurrencyCode, aX as MoonpayFundingConfig, an as MoonpayPaymentMethod, aW as NativeFundingConfig, ar as NonEmptyArray, a_ as Passkey, aR as PasskeyWithMetadata, aT as Phone, at as PhoneWithMetadata, aY as PriceDisplayOptions, P as PrivyErrorCode, ao as Quantity, b0 as SiwsFlowState, ak as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aD as Telegram, aP as TelegramWithMetadata, aB as Tiktok, aK as TiktokOAuthWithMetadata, ap as TransactionLog, aq as TransactionReceipt, aU as TransactionUIOptions, aw as Twitter, aH as TwitterOAuthWithMetadata, ai as TypedMessage, au as WalletWithMetadata } from './types-omkxDlqB.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import { AppKit } from '@reown/appkit';
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
17
17
  import { Cluster } from '@solana/web3.js';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './useSolanaWallets-CZcmg0rm.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CZcmg0rm.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-CgL8k7D0.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CgL8k7D0.js';
21
21
  import * as viem_accounts from 'viem/accounts';
22
22
  import '@coinbase/wallet-sdk';
23
23
  import '@solana/wallet-adapter-base';
@@ -3171,9 +3171,8 @@ type UseLoginWithSiws = {
3171
3171
  * @param opts.address {string} Base58-encoded Solana address performing the signing.
3172
3172
  * @returns {string} SIWS message for signing.
3173
3173
  */
3174
- generateSiwsMessage: ({ address, disableSignup, }: {
3174
+ generateSiwsMessage: ({ address }: {
3175
3175
  address: string;
3176
- disableSignup?: boolean;
3177
3176
  }) => Promise<string>;
3178
3177
  /**
3179
3178
  * Log a user in with a SIWS message and signature.
@@ -3188,12 +3187,8 @@ type UseLoginWithSiws = {
3188
3187
  message: string;
3189
3188
  disableSignup?: boolean;
3190
3189
  }) => Promise<User>;
3191
- /**
3192
- * The current state of the SIWS login operation
3193
- */
3194
- state: SiwsFlowState;
3195
3190
  };
3196
- declare const useLoginWithSiws: (callbacks?: PrivyEvents["login"]) => UseLoginWithSiws;
3191
+ declare const useLoginWithSiws: () => UseLoginWithSiws;
3197
3192
 
3198
3193
  type UseLinkWithSiws = {
3199
3194
  /**
@@ -3226,12 +3221,8 @@ type UseLinkWithSiws = {
3226
3221
  user: User;
3227
3222
  linkedAccount: LinkedAccountWithMetadata | null;
3228
3223
  }>;
3229
- /**
3230
- * The current state of the SIWS link operation
3231
- */
3232
- state: SiwsFlowState;
3233
3224
  };
3234
- declare const useLinkWithSiws: (callbacks?: PrivyEvents["linkAccount"]) => UseLinkWithSiws;
3225
+ declare const useLinkWithSiws: () => UseLinkWithSiws;
3235
3226
 
3236
3227
  /**
3237
3228
  * Use this hook to sign a transaction using the embedded wallet.
@@ -4333,4 +4324,4 @@ declare const useMigrateWallets: () => {
4333
4324
  }>;
4334
4325
  };
4335
4326
 
4336
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, SiwsFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
4327
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, 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 UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, a3 as SiwsMessageType, L as LoginMethod, a4 as ExternalWalletMetadata, a5 as TelegramAuthResult, a6 as TelegramWebAppData, a7 as OAuthUserInfo, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, ad as SiwsFlowState, a as LinkedAccountWithMetadata, ae as BaseAccountSdkType, af as UnsignedTransactionRequestWithChainId, ag as BaseConnectedWalletType, C as ConnectedSolanaWallet, ah as SessionSignerInput, ai as TelegramAuthFlowState } from './types-cjyKPOmY.js';
4
- export { aB as Apple, aO as AppleOAuthWithMetadata, aW as ContractUIOptions, aF as CrossAppAccount, aR as CrossAppAccountWithMetadata, ay as Discord, aJ as DiscordOAuthWithMetadata, aT as Email, at as EmailWithMetadata, a_ as Farcaster, aP as FarcasterWithMetadata, az as Github, aK as GithubOAuthWithMetadata, aw as Google, aH as GoogleOAuthWithMetadata, aD as Line, aM as LineOAuthWithMetadata, aG as LinkedAccountType, aA as LinkedIn, aN as LinkedInOAuthWithMetadata, b0 as LoginMethodOrderOption, ak as MessageTypes, am as MoonpayConfig, an as MoonpayCurrencyCode, aY as MoonpayFundingConfig, ao as MoonpayPaymentMethod, aX as NativeFundingConfig, as as NonEmptyArray, a$ as Passkey, aS as PasskeyWithMetadata, aU as Phone, au as PhoneWithMetadata, aZ as PriceDisplayOptions, P as PrivyErrorCode, ap as Quantity, al as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aE as Telegram, aQ as TelegramWithMetadata, aC as Tiktok, aL as TiktokOAuthWithMetadata, aq as TransactionLog, ar as TransactionReceipt, aV as TransactionUIOptions, ax as Twitter, aI as TwitterOAuthWithMetadata, aj as TypedMessage, av as WalletWithMetadata } from './types-cjyKPOmY.js';
3
+ import { c as UserRecoveryMethod, n as PrivyFarcasterSignerInitResponse, o as MfaSubmitArgs, E as EthereumRpcRequestType, p as SolanaRpcRequestType, q as EthereumRpcResponseType, r as SolanaRpcResponseType, s as EIP1193Provider, u as EntropyIdVerifier$1, H as HDWalletWithMetadata, v as RequestArguments, w as WalletConnector, B as BaseConnectedEthereumWallet, x as PrivyProxyProvider, y as WalletClientType, z as ConnectedWalletMetadata, A as PrivyClientConfig, D as ConnectorType, G as SetBaseAccountSdkType, I as WalletListEntry, J as AppConfig, K as BaseConnectedWallet, m as SolanaWalletConnector, U as User, N as ConnectWalletModalOptions, Q as LoginModalOptions, f as CreateWalletOptions, W as Wallet, T as SetWalletRecoveryOptions, j as SignMessageModalUIOptions, V as SignTypedDataParams, M as MfaMethod, X as UnsignedTransactionRequest, i as SendTransactionModalUIOptions, Y as FundWalletConfig, Z as ConnectedWallet, O as OAuthTokens, _ as CrossAppProviderDetails, $ as OAuthProviderType, a0 as MoonpaySignRequest, a1 as MoonpaySignResponse, a2 as SmartWalletConfig, a3 as SiwsMessageType, L as LoginMethod, a4 as ExternalWalletMetadata, a5 as TelegramAuthResult, a6 as TelegramWebAppData, a7 as OAuthUserInfo, a8 as OAuthFlowState, a9 as LoginWithCode, aa as OtpFlowState, ab as PasskeyFlowState, ac as SiweFlowState, a as LinkedAccountWithMetadata, ad as BaseAccountSdkType, ae as UnsignedTransactionRequestWithChainId, af as BaseConnectedWalletType, C as ConnectedSolanaWallet, ag as SessionSignerInput, ah as TelegramAuthFlowState } from './types-omkxDlqB.js';
4
+ export { aA as Apple, aN as AppleOAuthWithMetadata, aV as ContractUIOptions, aE as CrossAppAccount, aQ as CrossAppAccountWithMetadata, ax as Discord, aI as DiscordOAuthWithMetadata, aS as Email, as as EmailWithMetadata, aZ as Farcaster, aO as FarcasterWithMetadata, ay as Github, aJ as GithubOAuthWithMetadata, av as Google, aG as GoogleOAuthWithMetadata, aC as Line, aL as LineOAuthWithMetadata, aF as LinkedAccountType, az as LinkedIn, aM as LinkedInOAuthWithMetadata, a$ as LoginMethodOrderOption, aj as MessageTypes, al as MoonpayConfig, am as MoonpayCurrencyCode, aX as MoonpayFundingConfig, an as MoonpayPaymentMethod, aW as NativeFundingConfig, ar as NonEmptyArray, a_ as Passkey, aR as PasskeyWithMetadata, aT as Phone, at as PhoneWithMetadata, aY as PriceDisplayOptions, P as PrivyErrorCode, ao as Quantity, b0 as SiwsFlowState, ak as SmartWallet, e as SolanaCluster, l as SolanaFundingConfig, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, aD as Telegram, aP as TelegramWithMetadata, aB as Tiktok, aK as TiktokOAuthWithMetadata, ap as TransactionLog, aq as TransactionReceipt, aU as TransactionUIOptions, aw as Twitter, aH as TwitterOAuthWithMetadata, ai as TypedMessage, au as WalletWithMetadata } from './types-omkxDlqB.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import { AppKit } from '@reown/appkit';
@@ -16,8 +16,8 @@ import * as _simplewebauthn_types from '@simplewebauthn/types';
16
16
  import { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/types';
17
17
  import { Cluster } from '@solana/web3.js';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './useSolanaWallets-CZcmg0rm.js';
20
- export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CZcmg0rm.js';
19
+ import { P as PrivyEvents } from './useSolanaWallets-CgL8k7D0.js';
20
+ export { C as CallbackError, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CgL8k7D0.js';
21
21
  import * as viem_accounts from 'viem/accounts';
22
22
  import '@coinbase/wallet-sdk';
23
23
  import '@solana/wallet-adapter-base';
@@ -3171,9 +3171,8 @@ type UseLoginWithSiws = {
3171
3171
  * @param opts.address {string} Base58-encoded Solana address performing the signing.
3172
3172
  * @returns {string} SIWS message for signing.
3173
3173
  */
3174
- generateSiwsMessage: ({ address, disableSignup, }: {
3174
+ generateSiwsMessage: ({ address }: {
3175
3175
  address: string;
3176
- disableSignup?: boolean;
3177
3176
  }) => Promise<string>;
3178
3177
  /**
3179
3178
  * Log a user in with a SIWS message and signature.
@@ -3188,12 +3187,8 @@ type UseLoginWithSiws = {
3188
3187
  message: string;
3189
3188
  disableSignup?: boolean;
3190
3189
  }) => Promise<User>;
3191
- /**
3192
- * The current state of the SIWS login operation
3193
- */
3194
- state: SiwsFlowState;
3195
3190
  };
3196
- declare const useLoginWithSiws: (callbacks?: PrivyEvents["login"]) => UseLoginWithSiws;
3191
+ declare const useLoginWithSiws: () => UseLoginWithSiws;
3197
3192
 
3198
3193
  type UseLinkWithSiws = {
3199
3194
  /**
@@ -3226,12 +3221,8 @@ type UseLinkWithSiws = {
3226
3221
  user: User;
3227
3222
  linkedAccount: LinkedAccountWithMetadata | null;
3228
3223
  }>;
3229
- /**
3230
- * The current state of the SIWS link operation
3231
- */
3232
- state: SiwsFlowState;
3233
3224
  };
3234
- declare const useLinkWithSiws: (callbacks?: PrivyEvents["linkAccount"]) => UseLinkWithSiws;
3225
+ declare const useLinkWithSiws: () => UseLinkWithSiws;
3235
3226
 
3236
3227
  /**
3237
3228
  * Use this hook to sign a transaction using the embedded wallet.
@@ -4333,4 +4324,4 @@ declare const useMigrateWallets: () => {
4333
4324
  }>;
4334
4325
  };
4335
4326
 
4336
- export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, SiwsFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
4327
+ export { BaseConnectedWalletType, Captcha, ConnectWalletModalOptions, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, type CustomAuthFlowState, EIP1193Provider, EthereumWalletConnector, FundWalletConfig, type JwtAuthFlowState, LinkedAccountWithMetadata, LoginModal, LoginModalOptions, LoginWithCode, MfaMethod, OAuthFlowState, OAuthProviderType, OAuthTokens, OtpFlowState, PasskeyFlowState, PrivyClient, PrivyClientConfig, PrivyEvents, type PrivyInterface, PrivyProvider, type PrivyProviderProps, type SendCodeToEmail, type SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, SiweFlowState, TelegramAuthFlowState, UnsignedTransactionRequest, type UseAuthorizationSignatureInterface, type UseBaseAccountSdkInterface, type UseConnectBaseAccountInterface, type UseConnectCoinbaseSmartWalletInterface, type UseCustomAuth, type UseDelegatedActionsInterface, type UseFundWalletInterface, type UseImportWalletInterface, type UseLinkJwtAccount, type UseLinkWithPasskey, type UseLinkWithSiws, type UseLoginWithEmail, type UseLoginWithPasskey, type UseLoginWithSiws, type UseLoginWithSms, type UseLoginWithTelegram, type UseOAuthTokens, type UseRecoverEmbeddedWalletInterface, type UseSessionSignersInterface, type UseSignupWithPasskey, type UseSubscribeToJwtAuthWithFlagInput, type UseSyncJwtBasedAuthStateInput, type UseSyncJwtBasedAuthStateInterface, type UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getCustomerAccessToken as getAccessToken, getEmbeddedConnectedWallet, toViemAccount, useActiveWallet, useAuthMfa, useAuthMfaEnrollment, useAuthorizationSignature, useBaseAccountSdk, useConnectBaseAccount, useConnectCoinbaseSmartWallet, useConnectOrCreateWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useCustomAuth, useDelegatedActions, useFarcasterSigner, useFundWallet, useGuestAccounts, useHeadlessDelegatedActions, useIdentityToken, useImportWallet, useLinkAccount, useLinkJwtAccount, useLinkWithPasskey, useLinkWithSiwe, useLinkWithSiws, useLogin, useLoginWithEmail, useLoginWithFarcasterV2, useLoginWithOAuth, useLoginWithPasskey, useLoginWithSiwe, useLoginWithSiws, useLoginWithSms, useLoginWithTelegram, useLogout, useMfa, useMfaEnrollment, useMigrateWallets, useModalStatus, useOAuthTokens, usePrivy, useRecoverEmbeddedWallet, useRegisterMfaListener, useSendTransaction, useSessionSigners, useSetWalletPassword, useSetWalletRecovery, useSign7702Authorization, useSignAuthorization, useSignMessage, useSignTransaction, useSignTypedData, useSignupWithPasskey, useSubscribeToJwtAuthWithFlag, useSyncJwtBasedAuthState, useToken, useUpdateAccount, useUpdateEmail, useUser, useWallets };
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-cjyKPOmY.js';
3
+ import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-omkxDlqB.js';
4
4
  import { SmartAccountClient } from 'permissionless';
5
5
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
6
6
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-cjyKPOmY.js';
3
+ import { i as SendTransactionModalUIOptions, j as SignMessageModalUIOptions } from './types-omkxDlqB.js';
4
4
  import { SmartAccountClient } from 'permissionless';
5
5
  import { SendTransactionParameters, Chain, Hash, SignableMessage, Hex, TypedData, SignTypedDataParameters, EIP1193Provider, PublicClient, HttpTransport, WalletClient, PaymasterRpcSchema } from 'viem';
6
6
  import { SmartAccount, SendUserOperationParameters } from 'viem/account-abstraction';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-cjyKPOmY.js';
2
- export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-cjyKPOmY.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-CZcmg0rm.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CZcmg0rm.js';
1
+ import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-omkxDlqB.js';
2
+ export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-omkxDlqB.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-CgL8k7D0.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CgL8k7D0.js';
5
5
  import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
6
6
  import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
7
7
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
@@ -1,7 +1,7 @@
1
- import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-cjyKPOmY.js';
2
- export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-cjyKPOmY.js';
3
- import { P as PrivyEvents } from './useSolanaWallets-CZcmg0rm.js';
4
- export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CZcmg0rm.js';
1
+ import { W as Wallet, k as SolanaStandardWallet, l as SolanaFundingConfig, d as SupportedSolanaTransaction, i as SendTransactionModalUIOptions, S as SolanaTransactionReceipt, j as SignMessageModalUIOptions, f as CreateWalletOptions } from './types-omkxDlqB.js';
2
+ export { C as ConnectedSolanaWallet, m as SolanaAdapterConnector, t as toSolanaWalletConnectors } from './types-omkxDlqB.js';
3
+ import { P as PrivyEvents } from './useSolanaWallets-CgL8k7D0.js';
4
+ export { U as UseSolanaWalletsInterface, u as useSolanaWallets } from './useSolanaWallets-CgL8k7D0.js';
5
5
  import { SolanaSignAndSendTransactionFeature, SolanaSignTransactionFeature, SolanaSignMessageFeature } from '@solana/wallet-standard-features';
6
6
  import { WalletAccount, WalletIcon, WalletVersion } from '@wallet-standard/base';
7
7
  import { StandardConnectFeature, StandardDisconnectFeature, StandardEventsFeature } from '@wallet-standard/features';
@@ -2389,4 +2389,4 @@ type SessionSignerInput = {
2389
2389
  policyIds?: string[];
2390
2390
  }[];
2391
2391
 
2392
- export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type Passkey as a$, type MoonpaySignRequest as a0, type MoonpaySignResponse as a1, type SmartWalletConfig as a2, type SiwsMessageType as a3, type ExternalWalletMetadata as a4, type TelegramAuthResult as a5, type TelegramWebAppData as a6, type OAuthUserInfo as a7, type OAuthFlowState as a8, type LoginWithCode as a9, type LinkedIn as aA, type Apple as aB, type Tiktok as aC, type Line as aD, type Telegram as aE, type CrossAppAccount as aF, type LinkedAccountType as aG, type GoogleOAuthWithMetadata as aH, type TwitterOAuthWithMetadata as aI, type DiscordOAuthWithMetadata as aJ, type GithubOAuthWithMetadata as aK, type TiktokOAuthWithMetadata as aL, type LineOAuthWithMetadata as aM, type LinkedInOAuthWithMetadata as aN, type AppleOAuthWithMetadata as aO, type FarcasterWithMetadata as aP, type TelegramWithMetadata as aQ, type CrossAppAccountWithMetadata as aR, type PasskeyWithMetadata as aS, type Email as aT, type Phone as aU, type TransactionUIOptions as aV, type ContractUIOptions as aW, type NativeFundingConfig as aX, type MoonpayFundingConfig as aY, type PriceDisplayOptions as aZ, type Farcaster as a_, type OtpFlowState as aa, type PasskeyFlowState as ab, type SiweFlowState as ac, type SiwsFlowState as ad, type BaseAccountSdkType as ae, type UnsignedTransactionRequestWithChainId as af, type BaseConnectedWalletType as ag, type SessionSignerInput as ah, type TelegramAuthFlowState as ai, type TypedMessage as aj, type MessageTypes as ak, type SmartWallet as al, type MoonpayConfig as am, type MoonpayCurrencyCode as an, type MoonpayPaymentMethod as ao, type Quantity as ap, type TransactionLog as aq, type TransactionReceipt as ar, type NonEmptyArray as as, type EmailWithMetadata as at, type PhoneWithMetadata as au, type WalletWithMetadata as av, type Google as aw, type Twitter as ax, type Discord as ay, type Github as az, type BaseConnectedSolanaWallet as b, type LoginMethodOrderOption as b0, type UserRecoveryMethod as c, type SupportedSolanaTransaction as d, type SolanaCluster as e, type CreateWalletOptions as f, type LoginToFrame as g, type LoginToMiniApp as h, type SendTransactionModalUIOptions as i, type SignMessageModalUIOptions as j, type SolanaStandardWallet as k, type SolanaFundingConfig as l, SolanaWalletConnector as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletConnector as w, PrivyProxyProvider as x, type WalletClientType as y, type ConnectedWalletMetadata as z };
2392
+ export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type LoginMethodOrderOption as a$, type MoonpaySignRequest as a0, type MoonpaySignResponse as a1, type SmartWalletConfig as a2, type SiwsMessageType as a3, type ExternalWalletMetadata as a4, type TelegramAuthResult as a5, type TelegramWebAppData as a6, type OAuthUserInfo as a7, type OAuthFlowState as a8, type LoginWithCode as a9, type Apple as aA, type Tiktok as aB, type Line as aC, type Telegram as aD, type CrossAppAccount as aE, type LinkedAccountType as aF, type GoogleOAuthWithMetadata as aG, type TwitterOAuthWithMetadata as aH, type DiscordOAuthWithMetadata as aI, type GithubOAuthWithMetadata as aJ, type TiktokOAuthWithMetadata as aK, type LineOAuthWithMetadata as aL, type LinkedInOAuthWithMetadata as aM, type AppleOAuthWithMetadata as aN, type FarcasterWithMetadata as aO, type TelegramWithMetadata as aP, type CrossAppAccountWithMetadata as aQ, type PasskeyWithMetadata as aR, type Email as aS, type Phone as aT, type TransactionUIOptions as aU, type ContractUIOptions as aV, type NativeFundingConfig as aW, type MoonpayFundingConfig as aX, type PriceDisplayOptions as aY, type Farcaster as aZ, type Passkey as a_, type OtpFlowState as aa, type PasskeyFlowState as ab, type SiweFlowState as ac, type BaseAccountSdkType as ad, type UnsignedTransactionRequestWithChainId as ae, type BaseConnectedWalletType as af, type SessionSignerInput as ag, type TelegramAuthFlowState as ah, type TypedMessage as ai, type MessageTypes as aj, type SmartWallet as ak, type MoonpayConfig as al, type MoonpayCurrencyCode as am, type MoonpayPaymentMethod as an, type Quantity as ao, type TransactionLog as ap, type TransactionReceipt as aq, type NonEmptyArray as ar, type EmailWithMetadata as as, type PhoneWithMetadata as at, type WalletWithMetadata as au, type Google as av, type Twitter as aw, type Discord as ax, type Github as ay, type LinkedIn as az, type BaseConnectedSolanaWallet as b, type SiwsFlowState as b0, type UserRecoveryMethod as c, type SupportedSolanaTransaction as d, type SolanaCluster as e, type CreateWalletOptions as f, type LoginToFrame as g, type LoginToMiniApp as h, type SendTransactionModalUIOptions as i, type SignMessageModalUIOptions as j, type SolanaStandardWallet as k, type SolanaFundingConfig as l, SolanaWalletConnector as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletConnector as w, PrivyProxyProvider as x, type WalletClientType as y, type ConnectedWalletMetadata as z };
@@ -2389,4 +2389,4 @@ type SessionSignerInput = {
2389
2389
  policyIds?: string[];
2390
2390
  }[];
2391
2391
 
2392
- export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type Passkey as a$, type MoonpaySignRequest as a0, type MoonpaySignResponse as a1, type SmartWalletConfig as a2, type SiwsMessageType as a3, type ExternalWalletMetadata as a4, type TelegramAuthResult as a5, type TelegramWebAppData as a6, type OAuthUserInfo as a7, type OAuthFlowState as a8, type LoginWithCode as a9, type LinkedIn as aA, type Apple as aB, type Tiktok as aC, type Line as aD, type Telegram as aE, type CrossAppAccount as aF, type LinkedAccountType as aG, type GoogleOAuthWithMetadata as aH, type TwitterOAuthWithMetadata as aI, type DiscordOAuthWithMetadata as aJ, type GithubOAuthWithMetadata as aK, type TiktokOAuthWithMetadata as aL, type LineOAuthWithMetadata as aM, type LinkedInOAuthWithMetadata as aN, type AppleOAuthWithMetadata as aO, type FarcasterWithMetadata as aP, type TelegramWithMetadata as aQ, type CrossAppAccountWithMetadata as aR, type PasskeyWithMetadata as aS, type Email as aT, type Phone as aU, type TransactionUIOptions as aV, type ContractUIOptions as aW, type NativeFundingConfig as aX, type MoonpayFundingConfig as aY, type PriceDisplayOptions as aZ, type Farcaster as a_, type OtpFlowState as aa, type PasskeyFlowState as ab, type SiweFlowState as ac, type SiwsFlowState as ad, type BaseAccountSdkType as ae, type UnsignedTransactionRequestWithChainId as af, type BaseConnectedWalletType as ag, type SessionSignerInput as ah, type TelegramAuthFlowState as ai, type TypedMessage as aj, type MessageTypes as ak, type SmartWallet as al, type MoonpayConfig as am, type MoonpayCurrencyCode as an, type MoonpayPaymentMethod as ao, type Quantity as ap, type TransactionLog as aq, type TransactionReceipt as ar, type NonEmptyArray as as, type EmailWithMetadata as at, type PhoneWithMetadata as au, type WalletWithMetadata as av, type Google as aw, type Twitter as ax, type Discord as ay, type Github as az, type BaseConnectedSolanaWallet as b, type LoginMethodOrderOption as b0, type UserRecoveryMethod as c, type SupportedSolanaTransaction as d, type SolanaCluster as e, type CreateWalletOptions as f, type LoginToFrame as g, type LoginToMiniApp as h, type SendTransactionModalUIOptions as i, type SignMessageModalUIOptions as j, type SolanaStandardWallet as k, type SolanaFundingConfig as l, SolanaWalletConnector as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletConnector as w, PrivyProxyProvider as x, type WalletClientType as y, type ConnectedWalletMetadata as z };
2392
+ export { type OAuthProviderType as $, type PrivyClientConfig as A, type BaseConnectedEthereumWallet as B, type ConnectedSolanaWallet as C, type ConnectorType as D, type EthereumRpcRequestType as E, type FundingMethod as F, type SetBaseAccountSdkType as G, type HDWalletWithMetadata as H, type WalletListEntry as I, type AppConfig as J, type BaseConnectedWallet as K, type LoginMethod as L, type MfaMethod as M, type ConnectWalletModalOptions as N, type OAuthTokens as O, PrivyErrorCode as P, type LoginModalOptions as Q, type RuntimeLoginOverridableOptions as R, type SolanaTransactionReceipt as S, type SetWalletRecoveryOptions as T, type User as U, type SignTypedDataParams as V, type Wallet as W, type UnsignedTransactionRequest as X, type FundWalletConfig as Y, type ConnectedWallet as Z, type CrossAppProviderDetails as _, type LinkedAccountWithMetadata as a, type LoginMethodOrderOption as a$, type MoonpaySignRequest as a0, type MoonpaySignResponse as a1, type SmartWalletConfig as a2, type SiwsMessageType as a3, type ExternalWalletMetadata as a4, type TelegramAuthResult as a5, type TelegramWebAppData as a6, type OAuthUserInfo as a7, type OAuthFlowState as a8, type LoginWithCode as a9, type Apple as aA, type Tiktok as aB, type Line as aC, type Telegram as aD, type CrossAppAccount as aE, type LinkedAccountType as aF, type GoogleOAuthWithMetadata as aG, type TwitterOAuthWithMetadata as aH, type DiscordOAuthWithMetadata as aI, type GithubOAuthWithMetadata as aJ, type TiktokOAuthWithMetadata as aK, type LineOAuthWithMetadata as aL, type LinkedInOAuthWithMetadata as aM, type AppleOAuthWithMetadata as aN, type FarcasterWithMetadata as aO, type TelegramWithMetadata as aP, type CrossAppAccountWithMetadata as aQ, type PasskeyWithMetadata as aR, type Email as aS, type Phone as aT, type TransactionUIOptions as aU, type ContractUIOptions as aV, type NativeFundingConfig as aW, type MoonpayFundingConfig as aX, type PriceDisplayOptions as aY, type Farcaster as aZ, type Passkey as a_, type OtpFlowState as aa, type PasskeyFlowState as ab, type SiweFlowState as ac, type BaseAccountSdkType as ad, type UnsignedTransactionRequestWithChainId as ae, type BaseConnectedWalletType as af, type SessionSignerInput as ag, type TelegramAuthFlowState as ah, type TypedMessage as ai, type MessageTypes as aj, type SmartWallet as ak, type MoonpayConfig as al, type MoonpayCurrencyCode as am, type MoonpayPaymentMethod as an, type Quantity as ao, type TransactionLog as ap, type TransactionReceipt as aq, type NonEmptyArray as ar, type EmailWithMetadata as as, type PhoneWithMetadata as at, type WalletWithMetadata as au, type Google as av, type Twitter as aw, type Discord as ax, type Github as ay, type LinkedIn as az, type BaseConnectedSolanaWallet as b, type SiwsFlowState as b0, type UserRecoveryMethod as c, type SupportedSolanaTransaction as d, type SolanaCluster as e, type CreateWalletOptions as f, type LoginToFrame as g, type LoginToMiniApp as h, type SendTransactionModalUIOptions as i, type SignMessageModalUIOptions as j, type SolanaStandardWallet as k, type SolanaFundingConfig as l, SolanaWalletConnector as m, type PrivyFarcasterSignerInitResponse as n, type MfaSubmitArgs as o, type SolanaRpcRequestType as p, type EthereumRpcResponseType as q, type SolanaRpcResponseType as r, type EIP1193Provider as s, toSolanaWalletConnectors as t, type EntropyIdVerifier as u, type RequestArguments as v, WalletConnector as w, PrivyProxyProvider as x, type WalletClientType as y, type ConnectedWalletMetadata as z };
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 } from './types-cjyKPOmY.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-omkxDlqB.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@coinbase/wallet-sdk';
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 } from './types-cjyKPOmY.js';
2
+ import { R as RuntimeLoginOverridableOptions } from './types-omkxDlqB.js';
3
3
  import { Hex } from 'viem';
4
4
  import { Chain, Cluster } from '@privy-io/js-sdk-core';
5
5
  import '@coinbase/wallet-sdk';
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-cjyKPOmY.js';
2
+ import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-omkxDlqB.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
1
  import { Chain } from '@privy-io/js-sdk-core';
2
- import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-cjyKPOmY.js';
2
+ import { P as PrivyErrorCode, U as User, L as LoginMethod, a as LinkedAccountWithMetadata, B as BaseConnectedEthereumWallet, b as BaseConnectedSolanaWallet, W as Wallet, M as MfaMethod, c as UserRecoveryMethod, S as SolanaTransactionReceipt, d as SupportedSolanaTransaction, O as OAuthTokens, F as FundingMethod, e as SolanaCluster, C as ConnectedSolanaWallet, f as CreateWalletOptions } from './types-omkxDlqB.js';
3
3
  import { MouseEvent } from 'react';
4
4
 
5
5
  /**
@@ -1 +1 @@
1
- import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as c,g as l,c as p}from"./use-sign-with-user-signer-BWQ0PcRX.mjs";import{o as d,w as m,e as u,a as h,a$ as y,b0 as g,b1 as I,x as f}from"./privy-provider-BOSSQASA.mjs";import{u as v}from"./internal-context-D0EM1HLm.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-eeVPZj7Y.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-DCwuPDUk.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";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/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"lucide-react";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";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/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@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"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=c(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=d(),{wallets:F}=m(),{setModalData:x}=u(),_=l(T),q=!!_&&p(_),E=async(t=s.id)=>{let c=w(F);if(!c)throw Error("No connected wallet found");let l="string"==typeof t?r(t):t;if(![s.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=b.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await c.switchChain(p.id);let d=await c.getEthereumProvider(),m=o({account:c.address,transport:n(d)}),u=a({address:c.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(f(p,W,A)),publicTransport:i(f(p,W,A)),signer:u})};return{signMessage:async({message:e},t)=>{let r=await E(t);return new Promise((async(t,o)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,t)=>{let r=await E(t);return new Promise((async(t,o)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);x({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:q,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,custom as n,http as i}from"viem";import{toAccount as a}from"viem/accounts";import{abstractTestnet as s}from"viem/chains";import{u as c,g as l,c as p}from"./use-sign-with-user-signer-u7zZ9cLA.mjs";import{q as d,y as m,f as u,a as h,a$ as y,b0 as g,b1 as I,z as f}from"./privy-provider-DPOlKdGx.mjs";import{u as v}from"./internal-context-qdNgTV5f.mjs";import{g as w}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{c as C}from"./smart-wallets-_bWaRi0s.mjs";import"react";import"react/jsx-runtime";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"./paths-DCwuPDUk.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";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/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"lucide-react";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";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/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@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"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=c(),{hideWalletUIs:P,openPrivyModal:S,chains:b,appId:A,rpcConfig:W,client:M}=v(),k=d(),{wallets:F}=m(),{setModalData:q}=u(),x=l(T),_=!!x&&p(x),E=async(t=s.id)=>{let c=w(F);if(!c)throw Error("No connected wallet found");let l="string"==typeof t?r(t):t;if(![s.id,2741].includes(l))throw Error("Error, only Abstract chains are supported");let p=b.find((e=>e.id===l));if(!p)throw Error("Chain not configured");await c.switchChain(p.id);let d=await c.getEthereumProvider(),m=o({account:c.address,transport:n(d)}),u=a({address:c.address,signMessage:m.signMessage,signTransaction:m.signTransaction,signTypedData:m.signTypedData});return await e({chain:p,transport:i(f(p,W,A)),publicTransport:i(f(p,W,A)),signer:u})};return{signMessage:async({message:e},t)=>{let r=await E(t);return new Promise((async(t,o)=>{let{entropyId:n,entropyIdVerifier:i}=h(T);P.current=!0,q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:_,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTypedData:async(e,t)=>{let r=await E(t);return new Promise((async(t,o)=>{P.current=!0;let{entropyId:n,entropyIdVerifier:i}=h(T);q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:_,entropyId:n,entropyIdVerifier:i,onCompleteNavigateTo:y,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},sendTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:_,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))},signTransaction:async e=>{let r=await E(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(i,a)=>{P.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(T);q({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:_,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:I,onFailure:()=>{}},sendTransaction:{transactionRequests:C({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!M)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return await M.scanTransaction({metadata:{domain:k.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:i.from,to:i.to,value:i.value?.toString(),gas:i.gas?.toString(),gasPrice:i.gasPrice?.toString(),nonce:i.nonce?.toString(),data:i.data,eip_712_meta:{paymaster_params:{paymaster:i.paymaster,paymaster_input:i.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let o=n?t(r.account.address,e):e,i=await r.prepareAbstractTransactionRequest(o);return r.signTransaction(i)},onSuccess:e=>i(e.hash),onFailure:a,uiOptions:{isCancellable:!0}}}),S(g)})).finally((()=>{P.current=!1}))}}}export{T as useAbstractSmartWallets};
@@ -1 +1 @@
1
- import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-D0EM1HLm.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-BWQ0PcRX.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u,d,e])};export{u as useCreateWallet,d as useSignRawHash};
1
+ import{useMemo as r}from"react";import{create as e,rawSign as t}from"@privy-io/js-sdk-core";import{u as a}from"./internal-context-qdNgTV5f.mjs";import{u as i,a as s,f as n,c as o}from"./use-sign-with-user-signer-u7zZ9cLA.mjs";import"viem";const u=()=>{let{refreshSessionAndUser:t,privy:i}=a();return r((()=>({async createWallet(r){let a=await e(i,{request:{chain_type:r.chainType}}),s=await t();if(!s)throw Error("User must be authenticated before creating a Privy wallet");return{user:s,wallet:a}}})),[t,i])},d=()=>{let{user:e}=i(),{privy:u}=a(),{signWithUserSigner:d}=s();return r((()=>({async signRawHash({address:r,chainType:a,hash:i}){if(!e)throw Error("User must be authenticated before signing");let s=n(e,a).filter((r=>o(r))).find((e=>e.address===r));if(!s)throw Error("Wallet not found");let h=await t(u,d,{wallet_id:s.id,params:{hash:i}});if(h.data&&"signature"in h.data&&"hex"===h.data.encoding)return{signature:h.data.signature};throw Error("Failed to sign")}})),[u,d,e])};export{u as useCreateWallet,d as useSignRawHash};
@@ -1 +1 @@
1
- import{useCallback as t}from"react";import{F as i}from"./frame-DMd4vZ0H.mjs";import{P as e}from"./paths-DCwuPDUk.mjs";import{u as a}from"./internal-context-D0EM1HLm.mjs";import"ofetch";const n=()=>{let{client:n,setAuthenticated:r,setUser:s}=a();return{initLoginToMiniApp:t((async()=>{let t=new i;if(!n)throw new e("Must initialize Privy client first.");return n.startAuthFlow(t),await t.init()}),[n]),loginToMiniApp:t((async({message:t,signature:a})=>{if(!n)throw new e("Must initialize Privy client first.");if(!(n.authFlow instanceof i))throw new e("Must initialize Farcaster Mini App flow first.");let o=(t=>{let i=t.match(/farcaster:\/\/fid\/(\d+)/);return i&&i[1]?parseInt(i[1],10):null})(t);if(!o)throw new e("Invalid message format; could not parse Farcaster ID.");n.authFlow.setAuthData({message:t,signature:a,fid:o});let{user:l}=await n.authenticate();return l&&(s(l),r(!0)),l}),[n,s,r])}},r=()=>{let{initLoginToMiniApp:i,loginToMiniApp:e}=n();return{initLoginToFrame:t((async()=>await i()),[i]),loginToFrame:t((async({message:t,signature:i})=>await e({message:t,signature:i})),[e])}};export{r as useLoginToFrame,n as useLoginToMiniApp};
1
+ import{useCallback as t}from"react";import{F as i}from"./frame-DMd4vZ0H.mjs";import{P as e}from"./paths-DCwuPDUk.mjs";import{u as a}from"./internal-context-qdNgTV5f.mjs";import"ofetch";const n=()=>{let{client:n,setAuthenticated:r,setUser:s}=a();return{initLoginToMiniApp:t((async()=>{let t=new i;if(!n)throw new e("Must initialize Privy client first.");return n.startAuthFlow(t),await t.init()}),[n]),loginToMiniApp:t((async({message:t,signature:a})=>{if(!n)throw new e("Must initialize Privy client first.");if(!(n.authFlow instanceof i))throw new e("Must initialize Farcaster Mini App flow first.");let o=(t=>{let i=t.match(/farcaster:\/\/fid\/(\d+)/);return i&&i[1]?parseInt(i[1],10):null})(t);if(!o)throw new e("Invalid message format; could not parse Farcaster ID.");n.authFlow.setAuthData({message:t,signature:a,fid:o});let{user:l}=await n.authenticate();return l&&(s(l),r(!0)),l}),[n,s,r])}},r=()=>{let{initLoginToMiniApp:i,loginToMiniApp:e}=n();return{initLoginToFrame:t((async()=>await i()),[i]),loginToFrame:t((async({message:t,signature:i})=>await e({message:t,signature:i})),[e])}};export{r as useLoginToFrame,n as useLoginToMiniApp};
@@ -1 +1 @@
1
- import{g as e,a as t,u as r,b as s,c as o,C as n,d as i,s as l,U as d,e as h,f as w,t as p,h as y,M as m,i as A,A as f,j as k,k as C,L as v,l as E,I as S,T,S as U,B as W,P as I,E as P,m as M,n as F,o as H,p as L,q as x,G as D,W as q,r as z,v as j,w as B,x as G,y as J,z as ee,D as te,F as re,H as ae,J as se}from"./privy-provider-BOSSQASA.mjs";export{O as Captcha,Q as ConnectorManager,V as EthereumWalletConnector,a9 as LoginModal,a2 as PrivyClient,K as PrivyProvider,a1 as VERSION,R as WalletConnector,$ as errorIndicatesMaxMfaRetries,a0 as errorIndicatesMfaTimeout,_ as errorIndicatesMfaVerificationFailed,N as getAccessToken,a6 as useCreateWallet,a3 as useIdentityToken,a8 as useImportWallet,a4 as useLogout,Y as useMfa,Z as useMfaEnrollment,aa as useMigrateWallets,X as usePrivy,a5 as useRegisterMfaListener,a7 as useSolanaWallets}from"./privy-provider-BOSSQASA.mjs";import{useCallback as oe,useMemo as ne,useEffect as ie,useContext as le,useState as ce,useRef as ue}from"react";import{P as de,a as he}from"./paths-DCwuPDUk.mjs";import{u as we,I as pe}from"./internal-context-D0EM1HLm.mjs";import{u as ye,P as me,g as ge,a as Ae,b as fe,c as ke}from"./use-sign-with-user-signer-BWQ0PcRX.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-CzofJJwe.mjs";import{F as Ce}from"./frame-DMd4vZ0H.mjs";import{MfaAuthTotpVerify as ve,MfaAuthPasskeyInit as Ee,MfaAuthPasskeyVerify as Se,MfaAuthTotpInit as Te,MfaAuthTotpEnroll as Ue,MfaAuthTotpUnenroll as Re,MfaAuthPasskeyEnrollment as We}from"@privy-io/public-api";import{jsxs as Ie,Fragment as be,jsx as Pe}from"react/jsx-runtime";import Me from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Ne from"@heroicons/react/24/outline/ShieldCheckIcon";import{zeroAddress as _e,getAddress as Oe,createWalletClient as Fe,http as He,parseSignature as Le}from"viem";import{hashAuthorization as xe}from"viem/utils";import{getWallet as De,updateWallet as Ke,generateAuthorizationSignature as qe,PrivyClientError as ze}from"@privy-io/js-sdk-core";export{DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS,addPrivyRpcToChain,addRpcUrlOverrideToChain}from"@privy-io/js-sdk-core";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{toAccount as je}from"viem/accounts";import"mipd";import"react-device-detect";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";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/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"lucide-react";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";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/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@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/ClipboardDocumentIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";const Ve=()=>{let{user:r}=ye(),{walletProxy:a}=we();return{recover:oe((async s=>{if(!a)throw Error("Wallet proxy is not ready");let o=await e();if(!r||!o)throw new de("User must be logged in before attempting to modify the recovery method.");let{entropyId:n,entropyIdVerifier:i}=t(r);try{await a.recover({entropyId:n,entropyIdVerifier:i,accessToken:o,...s})}catch{throw new de("Unable to recover wallets")}}),[a,r])}},Be=()=>{let{client:e,setAuthenticated:t,setUser:r}=we();return ne((()=>({init:async()=>{if(!e)throw new de("Must initialize Privy client first.");let t=new Ce;return e.startAuthFlow(t),await t.init()},login:async({fid:a,message:s,signature:o})=>{if(!e)throw new de("Must initialize Privy client first.");if(!(e.authFlow instanceof Ce))throw new de("Must initialize Farcaster Mini App flow first.");e.authFlow.setAuthData({message:s,signature:o,fid:a});let{user:n}=await e.authenticate();if(!n)throw new de("Failed to login with Farcaster V2");return r(n),t(!0),{user:n}}})),[e,r,t])},Ge=e=>{r("login",e);let t=s(),a=o(),{ready:c,user:u}=ye(),{initLoginWithHeadlessOAuth:d,loginWithHeadlessOAuth:h,oAuthState:w,setOAuthState:p,isHeadlessOAuthLoading:y}=we(),m=oe((async e=>{try{if(t.enabled&&"success"!==t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);return await d(e.provider,t.token,e.disableSignup)}catch(e){throw p({status:"error",error:e}),e}}),[d,t]),g=oe((async()=>{let e=i();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;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 h(e)}catch(e){throw p({status:"error",error:e}),e}finally{l()}}),[h]);return ie((()=>{let e=i();c&&a&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&g().catch((()=>{}))}),[c,a]),{initOAuth:m,loading:y,state:w}},$e=e=>{let t=s(),{emailOtpState:r,setEmailOtpState:a,initLoginWithEmail:o,loginWithCode:i}=we();return{sendCode:oe((async({email:r,disableSignup:s})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await o({email:r,captchaToken:e,disableSignup:s,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[o]),loginWithCode:oe((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:s,wasAlreadyAuthenticated:o,linkedAccount:l}=await i(r);e?.onComplete?.({user:a,isNewUser:s,wasAlreadyAuthenticated:o,loginMethod:"email",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},Qe=e=>{let t=s(),{initSignupWithPasskey:r,signupWithPasskey:a,passkeyAuthState:o,setPasskeyAuthState:i}=we();return{signupWithPasskey:oe((async()=>{try{let s;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),s=await t.waitForResult()),await r({captchaToken:s,withPrivyUi:!1});let{user:o,isNewUser:i,wasAlreadyAuthenticated:l,loginAccount:c}=await a();e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:l,loginMethod:"passkey",loginAccount:c})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR),t}}),[a,t.status]),state:o}},Xe=e=>{let t=s(),{initLoginWithPasskey:r,loginWithPasskey:a,passkeyAuthState:o,setPasskeyAuthState:i}=we();return{loginWithPasskey:oe((async s=>{try{let o;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),o=await t.waitForResult()),await r({captchaToken:o,withPrivyUi:!1});let{user:i,isNewUser:l,wasAlreadyAuthenticated:c,loginAccount:u}=await a(s);e?.onComplete?.({user:i,isNewUser:l,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:u})}catch(s){throw i({status:"error",error:s}),e?.onError?.(s.privyErrorCode||he.UNKNOWN_AUTH_ERROR),s}}),[a,t.status]),state:o}},Je=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:a,setPasskeyAuthState:s}=we();return{linkWithPasskey:oe((async()=>{try{await t();let a=await r();if(!a)throw Error("Error, user not found");let s=a.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:a,linkMethod:"passkey",linkedAccount:s})}catch(t){throw s({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:a}},Ye=e=>{let t=s(),{smsOtpState:r,setSmsOtpState:a,initLoginWithSms:o,loginWithCode:i}=we();return{sendCode:oe((async({phoneNumber:r,disableSignup:s})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await o({phoneNumber:r,captchaToken:e,disableSignup:s,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[o]),loginWithCode:oe((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:s,wasAlreadyAuthenticated:o,linkedAccount:l}=await i(r);e?.onComplete?.({user:a,isNewUser:s,wasAlreadyAuthenticated:o,loginMethod:"sms",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},Ze=e=>{let{connectOrCreateWallet:t}=ye();return r("connectOrCreateWallet",e),{connectOrCreateWallet:t}},et=e=>{let t=s(),{siweState:r,setSiweState:a,linkWithSiwe:o,generateSiweMessage:i}=we();return{generateSiweMessage:oe((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await i({address:t,chainId:r}).then((e=>e))}catch(t){throw a({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[i]),linkWithSiwe:oe((async({signature:r,message:s,chainId:i,walletClientType:l,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);let{user:a,linkedAccount:u}=await o({message:s,signature:r,chainId:i,walletClientType:l,connectorType:c});u&&e?.onSuccess?.({user:a,linkMethod:"siwe",linkedAccount:u})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[o,t.status]),state:r}},tt=e=>{let t=s(),{siweState:r,setSiweState:a,client:o,generateSiweMessage:i,loginWithSiwe:l}=we();return{generateSiweNonce:oe((async r=>{try{let e;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),a({status:"generating-message"});let s=await o.generateSiweNonce({address:r?.address,captchaToken:e});return a({status:"awaiting-signature"}),s}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[o,t]),generateSiweMessage:oe((async({address:r,chainId:s})=>{try{let e;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i({address:r,chainId:s,captchaToken:e})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t]),loginWithSiwe:oe((async({message:r,signature:s,disableSignup:o})=>{try{let a;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult());let i=await l({message:r,signature:s,captchaToken:a,disableSignup:o});return e?.onComplete?.({user:i,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siwe",loginAccount:null}),i}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[l,t.status]),state:r}},rt=e=>{let t=s(),{siwsState:r,setSiwsState:a,generateSiwsMessage:o,loginWithSiws:i}=we();return{generateSiwsMessage:oe((async({address:r})=>{try{let e;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await o({address:r,captchaToken:e})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[o,t]),loginWithSiws:oe((async({message:r,signature:s,disableSignup:o})=>{try{let a;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult());let l=await i({message:r,signature:s,captchaToken:a,disableSignup:o});return e?.onComplete?.({user:l,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siws",loginAccount:null}),l}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},at=e=>{let t=s(),{siwsState:r,setSiwsState:a,generateSiwsMessage:o,linkWithSiws:i}=we();return{generateSiwsMessage:oe((async({address:r})=>{try{let e;if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await o({address:r,captchaToken:e})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siws"}),r}}),[o,t,a,e]),linkWithSiws:oe((async({signature:r,message:s,walletClientType:o,connectorType:l})=>{try{if(t.enabled&&"error"===t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);let{user:a,linkedAccount:c}=await i({message:s,signature:r,walletClientType:o,connectorType:l});return c&&e?.onSuccess?.({user:a,linkMethod:"siws",linkedAccount:c}),{user:a,linkedAccount:c}}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siws"}),r}}),[i,t.status,a,e]),state:r}};function st(){let{signTransaction:e}=le(me);return{signTransaction:e}}function ot(e){let{linkEmail:t,linkPhone:a,linkWallet:s,linkGoogle:o,linkApple:n,linkTwitter:i,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkTelegram:y,linkFarcaster:m,linkPasskey:g}=le(me);return r("linkAccount",e),{linkEmail:t,linkPhone:a,linkWallet:s,linkGoogle:o,linkApple:n,linkTwitter:i,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkFarcaster:m,linkTelegram:y,linkPasskey:g}}function nt(e){let{updateEmail:t,updatePhone:a}=le(me);return r("update",e),{updateEmail:t,updatePhone:a}}const it=e=>{let{user:t}=ye(),{loginWithCode:r,emailOtpState:a,setEmailOtpState:s,client:o,inProgressAuthFlowRef:n,inProgressLoginOrLinkMethodRef:i}=we();return{state:a,sendCode:oe((async({newEmailAddress:r})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");let e=new d(t.email.address,r);o.startAuthFlow(e),await e.sendCodeEmail({withPrivyUi:!1})}catch(r){s({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email]),verifyCode:oe((async({code:a})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");n.current="update",i.current="email";let{user:s,linkedAccount:o}=await r(a);return e?.onSuccess?.({user:s,updateMethod:"email",updatedAccount:o}),{user:s}}catch(a){s({status:"error",error:a}),e?.onError?.(a.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email])}},lt=()=>{let{connectCoinbaseSmartWallet:e}=we();return{connectCoinbaseSmartWallet:e}},ct=()=>{let{connectBaseAccount:e}=we();return{connectBaseAccount:e}},ut=()=>{let{baseAccountSdk:e}=we();return{baseAccountSdk:e}},dt=()=>{let{setModalData:e}=h(),{openModal:t,privy:r,closePrivyModal:a}=we(),{user:s}=ye();return ne((()=>({verify:async({standalone:o=!0}={standalone:!0})=>new Promise(((n,i)=>s?0===s.mfaMethods.length?n():(e((e=>({...e,mfaVerify:{onSuccess:async()=>{o?await a({shouldCallAuthOnSuccess:!1,isSuccess:!0}):w.setState({inProgressMfaFlow:void 0}),n()},onFailure:async e=>{o?await a({shouldCallAuthOnSuccess:!1,isSuccess:!1}):w.setState({inProgressMfaFlow:void 0}),i(e)},sendSmsCode:async()=>{throw Error("Not enabled")},verifySmsCode:async()=>{throw Error("Not enabled")},verifyTotpCode:async e=>{await r.fetchPrivyRoute(ve,{body:{code:e}})},generateOptions:async()=>p((await r.fetchPrivyRoute(Ee,{body:{}})).options),verifyPasskey:async e=>{let t=await import("@simplewebauthn/browser"),a=await t.startAuthentication(e);await r.fetchPrivyRoute(Se,{body:{authenticator_response:y(a)}})}}}))),void(o?t(m):w.setState({inProgressMfaFlow:"auth"}))):i(Error("Must be logged in to verify MFA"))))})),[r,e,t,a])},ht={component:()=>{let{user:e,ready:t}=ye(),{app:r,data:a,onUserCloseViaDialogOrKeybindRef:s}=h(),[o,n]=ce(null),[i,l]=ce(null),[c,u]=ce(null),[d,w]=ce(!1),[p,y]=ce(!1),[m,g]=ce(),R=async()=>{m?b(m):e?await N({user:e}):b(Error("Must be logged in to manage MFA")),setTimeout((()=>{n(null),l(null)}),500)};if(s.current=R,!a?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:b,onSuccess:N,mfaMethods:_,verify:O,generateTotpSecret:H,enrollTotp:L,unenrollTotp:x,enrollPasskey:D}=a.mfaEnroll,K=e?.mfaMethods.includes("sms"),q=e?.mfaMethods.includes("totp"),z=e?.mfaMethods.includes("passkey"),j=!!e?.phone,V=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function B(){n(null),l(null),g(void 0)}async function G(e=V){try{g(void 0),y(!0);let t=await D(e);return await N({user:t})}catch(e){g(e)}finally{y(!1),w(!1)}}if(!t||!e||!r)/*#__PURE__*/return Ie(be,{children:[/*#__PURE__*/Pe(A,{onClose:R},"header"),/*#__PURE__*/Pe(f,{children:/*#__PURE__*/Pe(k,{})}),/*#__PURE__*/Pe(C,{children:/*#__PURE__*/Pe(v,{})}),/*#__PURE__*/Pe(E,{})]});if("sms"===o)return null;if("totp"===o)/*#__PURE__*/return Ie(be,{children:[/*#__PURE__*/Pe(A,{backFn:B,onClose:R},"header"),/*#__PURE__*/Pe(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/Pe(Me,{})}),/*#__PURE__*/Pe(T,{children:"Remove authenticator app verification?"}),/*#__PURE__*/Ie(U,{children:["MFA adds an extra layer of security to your ",r?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/Pe(W,{children:/*#__PURE__*/Pe(I,{$warn:!0,onClick:async function(){try{g(void 0),y(!0);let e=await x();return await N({user:e})}catch(e){g(e)}finally{y(!1),n(null)}},loading:p,children:"Remove"})}),/*#__PURE__*/Pe(E,{})]});if("passkey"===o){let e=a.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return Ie(be,{children:[/*#__PURE__*/Pe(A,{backFn:B,onClose:R},"header"),/*#__PURE__*/Pe(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/Pe(Me,{})}),/*#__PURE__*/Pe(T,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/Pe(U,{children:e?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/Pe(W,{children:/*#__PURE__*/Pe(I,{$warn:!0,onClick:async function(){try{g(void 0),y(!0);let e=await D([]);return await N({user:e})}catch(e){g(e)}finally{y(!1),n(null)}},loading:p,children:"Remove"})}),/*#__PURE__*/Pe(E,{})]})}return 0!==_.length||K||q||z?"sms"===i?null:"totp"===i&&c?/*#__PURE__*/Pe(P,{onClose:R,onReset:B,submitEnrollmentWithTotp:e=>async function(e){try{g(void 0),y(!0);let t=await L(e);return await N({user:t})}catch(e){g(e)}finally{y(!1),n(null)}}(e.mfaCode),error:m,totpInfo:{...c,appName:r?.name||"Privy"}}):"passkey"===i?/*#__PURE__*/Pe(M,{onReset:B,onClose:R,submitEnrollmentWithPasskey:G}):/*#__PURE__*/Pe(F,{showIntro:!1,userMfaMethods:e.mfaMethods,appMfaMethods:r.mfa.methods,userHasAuthSms:j,onBackToIntro:()=>{},handleSelectMethod:async function(e){g(void 0);try{await O()}catch(e){return void g(e)}return"totp"===e?(l(e),u(null),void H().then((({totpSecret:e,totpAuthUrl:t})=>{u({authUrl:t,secret:e})})).catch((()=>{u(null),B()}))):"passkey"===e&&1===V.length?await G():void l(e)},isTotpLoading:"totp"===i&&!c,isPasskeyLoading:d,error:m,onClose:R,setRemovingMfaMethod:async function(e){g(void 0);try{await O()}catch(e){return void g(e)}n(e)}}):/*#__PURE__*/Ie(be,{children:[/*#__PURE__*/Pe(A,{onClose:R},"header"),/*#__PURE__*/Pe(S,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/Pe(Ne,{})}),/*#__PURE__*/Pe(T,{children:"Add more security"}),/*#__PURE__*/Ie(U,{children:[r?.name," does not have any verification methods enabled."]}),/*#__PURE__*/Pe(W,{children:/*#__PURE__*/Pe(I,{onClick:R,children:"Close"})}),/*#__PURE__*/Pe(E,{})]})}},wt=()=>{let e=H(),{setModalData:t}=h(),{verify:r}=dt(),{openModal:a,privy:s,closePrivyModal:o,refreshSessionAndUser:n,setUser:i}=we();return ne((()=>({enroll:async()=>new Promise(((l,c)=>{t({mfaEnroll:{onSuccess:async e=>{await o({shouldCallAuthOnSuccess:!1,isSuccess:!0}),l(e)},onFailure:async e=>{await o({shouldCallAuthOnSuccess:!1,isSuccess:!1}),c(e)},verify:()=>r({standalone:!1}),shouldUnlinkOnUnenrollMfa:!0,mfaMethods:e.mfa.methods,sendSmsCode:async()=>{throw Error("Not enabled")},enrollSms:async()=>{throw Error("Not enabled")},unenrollSms:async()=>{throw Error("Not enabled")},generateTotpSecret:async()=>await s.fetchPrivyRoute(Te,{body:{}}),enrollTotp:async e=>{await s.fetchPrivyRoute(Ue,{body:{code:e}});let t=await n();return i(t),t},unenrollTotp:async()=>{await s.fetchPrivyRoute(Re,{body:{}});let e=await n();return i(e),e},enrollPasskey:async e=>{await s.fetchPrivyRoute(We,{body:{credential_ids:e,remove_for_login:!0}});let t=await n();return i(t),t}}}),a(ht)}))})),[s,t,a,o])},pt=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:a,sendTransactionWithCrossAppWallet:s,signTransactionWithCrossAppWallet:o}=ye();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:a,sendTransaction:s,signTransaction:o}};function yt(e){let{sendTransaction:t}=le(me);return r("sendTransaction",e),{sendTransaction:t}}function mt(e){let{setWalletPassword:t}=le(me);return r("setWalletPassword",e),{setWalletPassword:t}}function gt(){let e=H(),t=L(),{client:r,setUser:a,setAuthenticated:s,setIsNewUser:o,initializeWalletProxy:n}=we(),{create:i}=x();return{createGuestAccount:async()=>{if(!e.id||!r)throw Error("SDK not yet ready");r.startAuthFlow(new D(e.id));try{let l=await r.authenticate(),c=l.user,u=l.isNewUser??!1;if(!c)throw new de("Unable to authenticate guest account");let d=await r.getAccessToken(),h=await n(q);if(d&&h)try{let t=z(c,e.embeddedWallets.ethereum.createOnLogin),r=j(c,e.embeddedWallets.solana.createOnLogin);t&&r?(c=(await i({chainType:"ethereum",latestUser:c})).user,c=(await i({chainType:"solana",latestUser:c})).user):r?c=(await i({chainType:"solana",latestUser:c})).user:t?c=(await i({chainType:"ethereum",latestUser:c})).user:a(c)}catch(e){a(c),console.warn("Unable to create embedded wallet for guest account")}return o(u),s(!0),t("login","onComplete",{user:c,isNewUser:u,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),c}catch(e){throw t("login","onError",e.privyErrorCode||he.UNKNOWN_AUTH_ERROR),e}}}}function At(e){let{setWalletRecovery:t}=le(me);return r("setWalletRecovery",e),{setWalletRecovery:t}}function ft(e){let{signMessage:t}=le(me);return r("signMessage",e),{signMessage:t}}const kt=()=>{let{ready:e,wallets:t}=B(),{user:r}=ye(),{rpcConfig:a,chains:s,appId:o}=we();return{signAuthorization:oe((async(n,i)=>{let l;if(!r)throw Error("User must be authenticated before signing with a Privy wallet");if(!e)throw Error("Wallets are not ready");let c=i?.address??ge(r)?.address??_e,u=t.find((e=>Oe(e.address)===Oe(c)));if(!u)throw Error("Signing wallet not found.");let d=n.chainId??Number(u.chainId.split(":")[1]);if(0===d)l={chainId:0,address:n.contractAddress,nonce:n.nonce??0};else{let e=s.find((e=>e.id===d));if(!e)throw Error("Error, chain not configured in PrivyProvider config");let t=Fe({account:c,chain:e,transport:He(G(e,a,o))});l=await t.prepareAuthorization({...n})}let h=await u.getEthereumProvider(),w=await h.request({method:"secp256k1_sign",params:[xe(l)]});return{...l,...Le(w)}}),[e,t,r,s])}},Ct=kt;function vt(e){let{signTypedData:t}=le(me);return r("signTypedData",e),{signTypedData:t}}const Et=()=>{let{isModalOpen:e}=le(me);return{isOpen:e}};function St(e){let{getAccessToken:t}=le(me);return r("accessToken",e),{getAccessToken:t}}function Tt(e){let{authenticated:t,user:a}=ye(),{initLoginWithOAuth:s}=we(),o=L();return r("oAuthAuthorization",e),{reauthorize:e=>Ut(t,a,s,o,e.provider)}}let Ut=async(e,t,r,a,s)=>{if(!e)throw a("linkAccount","onError",he.MUST_BE_AUTHENTICATED,{linkMethod:s}),new de("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(s))))throw new de(`OAuth account of type ${s} not linked to the account.`);await r(s)};function Rt(e){let{client:t}=we(),[r,a]=ce({status:"initial"});return{linkWithCustomJwt:oe((async r=>{try{a({status:"initial"}),t.startAuthFlow(new J(r)),a({status:"loading"});let{user:s}=await t.link();if(!s)throw Error("Error, user not found");let o=s.linkedAccounts.filter((e=>"custom_auth"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())).at(0);return a({status:"done"}),e?.onSuccess?.({user:s,linkMethod:"custom",linkedAccount:o}),{user:s}}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"custom"}),r}}),[t.startAuthFlow,t.link]),state:r}}const Wt=e=>{let t=ee();return r("customAuth",e),{status:t}};function It({isAuthenticated:e,isLoading:t,...r}){let a=ue();ie((()=>{t||a.current?.()}),[e,t]);let s=oe((e=>(a.current=e,()=>{a.current=void 0})),[]);return te({...r,subscribe:s})}function bt(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=ye();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}const Pt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},Mt=()=>{let{addSessionSignersInternal:e,removeSessionSignersInternal:t}=(()=>{let{user:e}=ye(),t=we(),{signWithUserSigner:r}=Ae(),a=async({wallet:a,additional_signers:s})=>{let o=await t.client.getAccessToken();if(!e||!o)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!a.id)throw new de("Wallet to add signers to must have ID on server");if(!t.walletProxy)throw new de("Wallet proxy not initialized.");await Ke(t.privy,{wallet_id:a.id},r,{additional_signers:s})};return{addSessionSignersInternal:async({address:r,signers:s})=>{let o=await t.client.getAccessToken();if(!e||!o)throw new de("User must be authenticated and have an embedded wallet to add a session signer.");let n=t.walletProxy??await t.initializeWalletProxy(15e3);if(!n)throw new de("Wallet proxy not initialized.");let i=fe(e,r);if(!i)throw new de("Address to add signers too is not associated with current user.");if(ke(i)){if(0===s.length)throw new de("Must specify at least one signer to add.");let e=[...(await De(t.privy,{wallet_id:i.id})).additional_signers,...re(s)];await a({wallet:i,additional_signers:e})}else{if(i.delegated)return{user:e};if(s.length>0)throw new de("Specifying signers in addSessionSigners is only supported for TEE execution and this app uses On-device execution. Pass an empty array for signers instead. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let a=ae({address:r,user:e}),l=se({address:r,user:e});await t.recoverEmbeddedWallet({address:r}),await n.createDelegatedAction({accessToken:o,rootWallet:l,delegatedWallets:[a]})}let l=await t.refreshSessionAndUser();if(!l)throw Error("Could not refresh user");return{user:l}},removeSessionSignersInternal:async({address:r})=>{let s=await t.client.getAccessToken();if(!e||!s)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!(t.walletProxy??await t.initializeWalletProxy(15e3)))throw new de("Wallet proxy not initialized.");let o=fe(e,r);if(!o)throw new de("Address to remove signers from is not associated with current user.");ke(o)?await a({wallet:o,additional_signers:[]}):await t.client.revokeDelegatedWallet();let n=await t.refreshSessionAndUser();if(!n)throw Error("Could not refresh user");return{user:n}}}})();return{addSessionSigners:async({address:t,signers:r})=>e({address:t,signers:r}),removeSessionSigners:async({address:e})=>t({address:e})}},Nt=()=>{let{signWithUserSigner:e}=Ae();return ne((()=>({async generateAuthorizationSignature(t){let{signature:r}=await qe(e,t);return{signature:r}}})),[e])},_t=()=>{let{setUser:e,client:t}=le(pe),{user:r}=le(me);return{user:r,refreshUser:oe((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},Ot=e=>{let t=s(),{initLoginWithTelegram:r,loginWithTelegram:a,telegramAuthState:o,setTelegramAuthState:i}=we();return{login:oe((async s=>{try{if(t.enabled&&"success"!==t.status)throw new n(t.error,null,he.CAPTCHA_FAILURE);await r(t.token,s?.disableSignup);let{user:o,isNewUser:i,loginAccount:l,wasAlreadyAuthenticated:c}=await a({intent:"login"});e?.onComplete?.({user:o,isNewUser:i,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:l})}catch(s){throw i({status:"error",error:s}),e?.onError?.(s.privyErrorCode||he.UNKNOWN_AUTH_ERROR),s}}),[r,a,t]),state:o}},Ft=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}},Ht=async({wallet:e})=>{let t=await e.getEthereumProvider();return je({address:e.address,sign:async({hash:r})=>{if("privy"!==e.walletClientType)throw new ze({error:"Unprefixed signing is not supported by external wallets.",code:"unsupported_wallet_type"});return await t.request({method:"secp256k1_sign",params:[r]})},signMessage:async({message:r})=>await t.request({method:"personal_sign",params:[r,e.address]}),signTypedData:async r=>await t.request({method:"eth_signTypedData_v4",params:[e.address,r]}),signTransaction:async e=>await t.request({method:"eth_signTransaction",params:[e]})})};export{Ht as toViemAccount,dt as useAuthMfa,wt as useAuthMfaEnrollment,Nt as useAuthorizationSignature,ut as useBaseAccountSdk,ct as useConnectBaseAccount,lt as useConnectCoinbaseSmartWallet,Ze as useConnectOrCreateWallet,pt as useCrossAppAccounts,Wt as useCustomAuth,Pt as useDelegatedActions,bt as useFarcasterSigner,gt as useGuestAccounts,Ft as useHeadlessDelegatedActions,ot as useLinkAccount,Rt as useLinkJwtAccount,Je as useLinkWithPasskey,et as useLinkWithSiwe,at as useLinkWithSiws,$e as useLoginWithEmail,Be as useLoginWithFarcasterV2,Ge as useLoginWithOAuth,Xe as useLoginWithPasskey,tt as useLoginWithSiwe,rt as useLoginWithSiws,Ye as useLoginWithSms,Ot as useLoginWithTelegram,Et as useModalStatus,Tt as useOAuthTokens,Ve as useRecoverEmbeddedWallet,yt as useSendTransaction,Mt as useSessionSigners,mt as useSetWalletPassword,At as useSetWalletRecovery,kt as useSign7702Authorization,Ct as useSignAuthorization,ft as useSignMessage,st as useSignTransaction,vt as useSignTypedData,Qe as useSignupWithPasskey,It as useSubscribeToJwtAuthWithFlag,te as useSyncJwtBasedAuthState,St as useToken,nt as useUpdateAccount,it as useUpdateEmail,_t as useUser,B as useWallets};
1
+ import{g as e,a as t,u as r,b as s,c as n,C as o,d as i,s as l,e as d,p as h,U as w,f as p,h as m,t as y,i as f,M as A,j as k,A as C,k as v,l as E,L as T,m as S,I as U,T as W,S as I,B as P,P as M,E as N,n as F,o as L,q as H,r as x,v as D,G as K,W as q,w as z,x as j,y as B,z as G,D as J,F as ee,H as te,J as re,K as ae,N as se}from"./privy-provider-DPOlKdGx.mjs";export{R as Captcha,V as ConnectorManager,Y as EthereumWalletConnector,aa as LoginModal,a3 as PrivyClient,O as PrivyProvider,a2 as VERSION,X as WalletConnector,a0 as errorIndicatesMaxMfaRetries,a1 as errorIndicatesMfaTimeout,$ as errorIndicatesMfaVerificationFailed,Q as getAccessToken,a7 as useCreateWallet,a4 as useIdentityToken,a9 as useImportWallet,a5 as useLogout,Z as useMfa,_ as useMfaEnrollment,ab as useMigrateWallets,a6 as useRegisterMfaListener,a8 as useSolanaWallets}from"./privy-provider-DPOlKdGx.mjs";import{useCallback as ne,useMemo as oe,useEffect as ie,useContext as le,useState as ce,useRef as ue}from"react";import{P as de,a as he}from"./paths-DCwuPDUk.mjs";import{u as we,I as pe}from"./internal-context-qdNgTV5f.mjs";import{u as me,P as ye,g as ge,a as fe,b as Ae,c as ke}from"./use-sign-with-user-signer-u7zZ9cLA.mjs";export{c as useActiveWallet,a as useConnectWallet,b as useFundWallet,u as useLogin}from"./useActiveWallet-DFwBUieX.mjs";import{F as Ce}from"./frame-DMd4vZ0H.mjs";import{MfaAuthTotpVerify as ve,MfaAuthPasskeyInit as Ee,MfaAuthPasskeyVerify as Te,MfaAuthTotpInit as Se,MfaAuthTotpEnroll as Ue,MfaAuthTotpUnenroll as We,MfaAuthPasskeyEnrollment as Ie}from"@privy-io/public-api";import{jsxs as Re,Fragment as be,jsx as Pe}from"react/jsx-runtime";import Me from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import Ne from"@heroicons/react/24/outline/ShieldCheckIcon";import{zeroAddress as _e,getAddress as Oe,createWalletClient as Fe,http as Le,parseSignature as He}from"viem";import{hashAuthorization as xe}from"viem/utils";import{getWallet as De,updateWallet as Ke,generateAuthorizationSignature as qe,PrivyClientError as ze}from"@privy-io/js-sdk-core";export{DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS,addPrivyRpcToChain,addRpcUrlOverrideToChain}from"@privy-io/js-sdk-core";export{g as getEmbeddedConnectedWallet}from"./getEmbeddedConnectedWallet-CSSBWE2p.mjs";import{toAccount as je}from"viem/accounts";import"mipd";import"react-device-detect";import"uuid";import"jose";import"eventemitter3";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";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/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"zustand";import"@headlessui/react";import"lucide-react";import"@walletconnect/ethereum-provider";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";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/solid/CheckCircleIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@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/ClipboardDocumentIcon";import"@heroicons/react/24/solid/CheckBadgeIcon";import"@heroicons/react/24/solid/IdentificationIcon";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"@heroicons/react/24/solid/ShieldCheckIcon";import"js-cookie";const Ve=()=>{let{user:r}=me(),{walletProxy:a}=we();return{recover:ne((async s=>{if(!a)throw Error("Wallet proxy is not ready");let n=await e();if(!r||!n)throw new de("User must be logged in before attempting to modify the recovery method.");let{entropyId:o,entropyIdVerifier:i}=t(r);try{await a.recover({entropyId:o,entropyIdVerifier:i,accessToken:n,...s})}catch{throw new de("Unable to recover wallets")}}),[a,r])}},Be=()=>{let{client:e,setAuthenticated:t,setUser:r}=we();return oe((()=>({init:async()=>{if(!e)throw new de("Must initialize Privy client first.");let t=new Ce;return e.startAuthFlow(t),await t.init()},login:async({fid:a,message:s,signature:n})=>{if(!e)throw new de("Must initialize Privy client first.");if(!(e.authFlow instanceof Ce))throw new de("Must initialize Farcaster Mini App flow first.");e.authFlow.setAuthData({message:s,signature:n,fid:a});let{user:o}=await e.authenticate();if(!o)throw new de("Failed to login with Farcaster V2");return r(o),t(!0),{user:o}}})),[e,r,t])},Ge=e=>{r("login",e);let t=s(),a=n(),{ready:c,user:u}=me(),{initLoginWithHeadlessOAuth:d,loginWithHeadlessOAuth:h,oAuthState:w,setOAuthState:p,isHeadlessOAuthLoading:m}=we(),y=ne((async e=>{try{if(t.enabled&&"success"!==t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);return await d(e.provider,t.token,e.disableSignup)}catch(e){throw p({status:"error",error:e}),e}}),[d,t]),g=ne((async()=>{let e=i();try{if(u)return console.warn("Cannot login with OAuth when already logged in"),u;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 h(e)}catch(e){throw p({status:"error",error:e}),e}finally{l()}}),[h]);return ie((()=>{let e=i();c&&a&&e.inProgress&&!e.withPrivyUi&&!e.popupFlow&&g().catch((()=>{}))}),[c,a]),{initOAuth:y,loading:m,state:w}},$e=e=>{let t=s(),{emailOtpState:r,setEmailOtpState:a,initLoginWithEmail:n,loginWithCode:i}=we();return{sendCode:ne((async({email:r,disableSignup:s})=>{try{let e;if(!r)throw Error("Email required to send OTP code");if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({email:r,captchaToken:e,disableSignup:s,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:ne((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:s,wasAlreadyAuthenticated:n,linkedAccount:l}=await i(r);e?.onComplete?.({user:a,isNewUser:s,wasAlreadyAuthenticated:n,loginMethod:"email",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},Qe=e=>{let t=s(),{initSignupWithPasskey:r,signupWithPasskey:a,passkeyAuthState:n,setPasskeyAuthState:i}=we();return{signupWithPasskey:ne((async()=>{try{let s;if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),s=await t.waitForResult()),await r({captchaToken:s,withPrivyUi:!1});let{user:n,isNewUser:i,wasAlreadyAuthenticated:l,loginAccount:c}=await a();e?.onComplete?.({user:n,isNewUser:i,wasAlreadyAuthenticated:l,loginMethod:"passkey",loginAccount:c})}catch(t){throw i({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR),t}}),[a,t.status]),state:n}},Xe=e=>{let t=s(),{initLoginWithPasskey:r,loginWithPasskey:a,passkeyAuthState:n,setPasskeyAuthState:i}=we();return{loginWithPasskey:ne((async s=>{try{let n;if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),n=await t.waitForResult()),await r({captchaToken:n,withPrivyUi:!1});let{user:i,isNewUser:l,wasAlreadyAuthenticated:c,loginAccount:u}=await a(s);e?.onComplete?.({user:i,isNewUser:l,wasAlreadyAuthenticated:c,loginMethod:"passkey",loginAccount:u})}catch(s){throw i({status:"error",error:s}),e?.onError?.(s.privyErrorCode||he.UNKNOWN_AUTH_ERROR),s}}),[a,t.status]),state:n}},Je=e=>{let{initLinkWithPasskey:t,linkWithPasskey:r,passkeyAuthState:a,setPasskeyAuthState:s}=we();return{linkWithPasskey:ne((async()=>{try{await t();let a=await r();if(!a)throw Error("Error, user not found");let s=a.linkedAccounts.filter((e=>"passkey"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0];e?.onSuccess?.({user:a,linkMethod:"passkey",linkedAccount:s})}catch(t){throw s({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),t}}),[r]),state:a}},Ye=e=>{let t=s(),{smsOtpState:r,setSmsOtpState:a,initLoginWithSms:n,loginWithCode:i}=we();return{sendCode:ne((async({phoneNumber:r,disableSignup:s})=>{try{let e;if(!r)throw Error("SMS required to send OTP code");if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await n({phoneNumber:r,captchaToken:e,disableSignup:s,withPrivyUi:!1})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n]),loginWithCode:ne((async({code:r})=>{try{if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);let{user:a,isNewUser:s,wasAlreadyAuthenticated:n,linkedAccount:l}=await i(r);e?.onComplete?.({user:a,isNewUser:s,wasAlreadyAuthenticated:n,loginMethod:"sms",loginAccount:l})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t.status]),state:r}},Ze=e=>{let{connectOrCreateWallet:t}=me();return r("connectOrCreateWallet",e),{connectOrCreateWallet:t}},et=e=>{let t=s(),{siweState:r,setSiweState:a,linkWithSiwe:n,generateSiweMessage:i}=we();return{generateSiweMessage:ne((async({address:t,chainId:r})=>{try{if(!t||!r)throw Error("wallet address and chainId required to generate nonce");return await i({address:t,chainId:r}).then((e=>e))}catch(t){throw a({status:"error",error:t}),e?.onError?.(t.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),t}}),[i]),linkWithSiwe:ne((async({signature:r,message:s,chainId:i,walletClientType:l,connectorType:c})=>{try{if(t.enabled&&"success"!==t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);let{user:a,linkedAccount:u}=await n({message:s,signature:r,chainId:i,walletClientType:l,connectorType:c});u&&e?.onSuccess?.({user:a,linkMethod:"siwe",linkedAccount:u})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"siwe"}),r}}),[n,t.status]),state:r}},tt=e=>{let t=s(),{siweState:r,setSiweState:a,client:n,generateSiweMessage:i,loginWithSiwe:l}=we();return{generateSiweNonce:ne((async r=>{try{let e;if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),a({status:"generating-message"});let s=await n.generateSiweNonce({address:r?.address,captchaToken:e});return a({status:"awaiting-signature"}),s}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[n,t]),generateSiweMessage:ne((async({address:r,chainId:s})=>{try{let e;if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);return t.enabled&&"success"!==t.status&&(t.execute(),e=await t.waitForResult()),await i({address:r,chainId:s,captchaToken:e})}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[i,t]),loginWithSiwe:ne((async({message:r,signature:s,disableSignup:n})=>{try{let a;if(t.enabled&&"error"===t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);t.enabled&&"success"!==t.status&&(t.execute(),a=await t.waitForResult());let i=await l({message:r,signature:s,captchaToken:a,disableSignup:n});return e?.onComplete?.({user:i,isNewUser:!1,wasAlreadyAuthenticated:!1,loginMethod:"siwe",loginAccount:null}),i}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR),r}}),[l,t.status]),state:r}},rt=()=>{let e=s(),{client:t,setAuthenticated:r,setUser:a,setIsNewUser:n}=we(),{authenticated:i}=d();return{generateSiwsMessage:ne((async({address:r})=>{let a;if(e.enabled&&"error"===e.status)throw new o(e.error,null,he.CAPTCHA_FAILURE);e.enabled&&"success"!==e.status&&(e.execute(),a=await e.waitForResult());let s=await t.generateSiwsNonce({address:r,captchaToken:a});return h({address:r,nonce:s})}),[e,t]),loginWithSiws:ne((async({message:s,signature:l,disableSignup:c})=>{if(i)throw Error("User already authenticated");if(e.enabled&&"error"===e.status)throw new o(e.error,null,he.CAPTCHA_FAILURE);e.enabled&&"success"!==e.status&&(e.execute(),await e.waitForResult());let{user:u,isNewUser:d}=await t.authenticateWithSiws({message:s,signature:l,mode:c?"no-signup":"login-or-sign-up",messageType:"plain"});if(!u)throw Error("Authentication failed - no user returned");return a(u),n(d||!1),r(!0),u}),[i,e,t,r,a,n])}},at=()=>{let e=s(),{client:t,setUser:r,refreshSessionAndUser:a}=we(),{authenticated:n}=d();return{generateSiwsMessage:ne((async({address:r})=>{let a;if(e.enabled&&"error"===e.status)throw new o(e.error,null,he.CAPTCHA_FAILURE);e.enabled&&"success"!==e.status&&(e.execute(),a=await e.waitForResult());let s=await t.generateSiwsNonce({address:r,captchaToken:a});return h({address:r,nonce:s})}),[e,t]),linkWithSiws:ne((async({signature:s,message:i,walletClientType:l,connectorType:c})=>{if(!n)throw Error("User must be authenticated before linking");if(e.enabled&&"error"===e.status)throw new o(e.error,null,he.CAPTCHA_FAILURE);let u=await t.linkWithSiws({message:i,signature:s,walletClientType:l,connectorType:c,messageType:"plain"}),d=(e=>{if(!e)return;let t=e.linkedAccounts;return t&&0!==t.length?t[t.length-1]:void 0})(u=await a()??u)||null;return r(u||null),{user:u,linkedAccount:d}}),[n,e,t,a,r])}};function st(){let{signTransaction:e}=le(ye);return{signTransaction:e}}function nt(e){let{linkEmail:t,linkPhone:a,linkWallet:s,linkGoogle:n,linkApple:o,linkTwitter:i,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkTelegram:m,linkFarcaster:y,linkPasskey:g}=le(ye);return r("linkAccount",e),{linkEmail:t,linkPhone:a,linkWallet:s,linkGoogle:n,linkApple:o,linkTwitter:i,linkDiscord:l,linkGithub:c,linkLinkedIn:u,linkTiktok:d,linkLine:h,linkSpotify:w,linkInstagram:p,linkFarcaster:y,linkTelegram:m,linkPasskey:g}}function ot(e){let{updateEmail:t,updatePhone:a}=le(ye);return r("update",e),{updateEmail:t,updatePhone:a}}const it=e=>{let{user:t}=me(),{loginWithCode:r,emailOtpState:a,setEmailOtpState:s,client:n,inProgressAuthFlowRef:o,inProgressLoginOrLinkMethodRef:i}=we();return{state:a,sendCode:ne((async({newEmailAddress:r})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");let e=new w(t.email.address,r);n.startAuthFlow(e),await e.sendCodeEmail({withPrivyUi:!1})}catch(r){s({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email]),verifyCode:ne((async({code:a})=>{try{if(!t?.email)throw Error("User is required to have an email address to update it.");o.current="update",i.current="email";let{user:s,linkedAccount:n}=await r(a);return e?.onSuccess?.({user:s,updateMethod:"email",updatedAccount:n}),{user:s}}catch(a){s({status:"error",error:a}),e?.onError?.(a.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"email"})}}),[t?.email])}},lt=()=>{let{connectCoinbaseSmartWallet:e}=we();return{connectCoinbaseSmartWallet:e}},ct=()=>{let{connectBaseAccount:e}=we();return{connectBaseAccount:e}},ut=()=>{let{baseAccountSdk:e}=we();return{baseAccountSdk:e}},dt=()=>{let{setModalData:e}=p(),{openModal:t,privy:r,closePrivyModal:a}=we(),{user:s}=me();return oe((()=>({verify:async({standalone:n=!0}={standalone:!0})=>new Promise(((o,i)=>s?0===s.mfaMethods.length?o():(e((e=>({...e,mfaVerify:{onSuccess:async()=>{n?await a({shouldCallAuthOnSuccess:!1,isSuccess:!0}):m.setState({inProgressMfaFlow:void 0}),o()},onFailure:async e=>{n?await a({shouldCallAuthOnSuccess:!1,isSuccess:!1}):m.setState({inProgressMfaFlow:void 0}),i(e)},sendSmsCode:async()=>{throw Error("Not enabled")},verifySmsCode:async()=>{throw Error("Not enabled")},verifyTotpCode:async e=>{await r.fetchPrivyRoute(ve,{body:{code:e}})},generateOptions:async()=>y((await r.fetchPrivyRoute(Ee,{body:{}})).options),verifyPasskey:async e=>{let t=await import("@simplewebauthn/browser"),a=await t.startAuthentication(e);await r.fetchPrivyRoute(Te,{body:{authenticator_response:f(a)}})}}}))),void(n?t(A):m.setState({inProgressMfaFlow:"auth"}))):i(Error("Must be logged in to verify MFA"))))})),[r,e,t,a])},ht={component:()=>{let{user:e,ready:t}=me(),{app:r,data:a,onUserCloseViaDialogOrKeybindRef:s}=p(),[n,o]=ce(null),[i,l]=ce(null),[c,u]=ce(null),[d,h]=ce(!1),[w,m]=ce(!1),[y,g]=ce(),f=async()=>{y?A(y):e?await R({user:e}):A(Error("Must be logged in to manage MFA")),setTimeout((()=>{o(null),l(null)}),500)};if(s.current=f,!a?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:A,onSuccess:R,mfaMethods:b,verify:_,generateTotpSecret:O,enrollTotp:H,unenrollTotp:x,enrollPasskey:D}=a.mfaEnroll,K=e?.mfaMethods.includes("sms"),q=e?.mfaMethods.includes("totp"),z=e?.mfaMethods.includes("passkey"),j=!!e?.phone,V=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function B(){o(null),l(null),g(void 0)}async function G(e=V){try{g(void 0),m(!0);let t=await D(e);return await R({user:t})}catch(e){g(e)}finally{m(!1),h(!1)}}if(!t||!e||!r)/*#__PURE__*/return Re(be,{children:[/*#__PURE__*/Pe(k,{onClose:f},"header"),/*#__PURE__*/Pe(C,{children:/*#__PURE__*/Pe(v,{})}),/*#__PURE__*/Pe(E,{children:/*#__PURE__*/Pe(T,{})}),/*#__PURE__*/Pe(S,{})]});if("sms"===n)return null;if("totp"===n)/*#__PURE__*/return Re(be,{children:[/*#__PURE__*/Pe(k,{backFn:B,onClose:f},"header"),/*#__PURE__*/Pe(U,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/Pe(Me,{})}),/*#__PURE__*/Pe(W,{children:"Remove authenticator app verification?"}),/*#__PURE__*/Re(I,{children:["MFA adds an extra layer of security to your ",r?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/Pe(P,{children:/*#__PURE__*/Pe(M,{$warn:!0,onClick:async function(){try{g(void 0),m(!0);let e=await x();return await R({user:e})}catch(e){g(e)}finally{m(!1),o(null)}},loading:w,children:"Remove"})}),/*#__PURE__*/Pe(S,{})]});if("passkey"===n){let e=a.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return Re(be,{children:[/*#__PURE__*/Pe(k,{backFn:B,onClose:f},"header"),/*#__PURE__*/Pe(U,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/Pe(Me,{})}),/*#__PURE__*/Pe(W,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/Pe(I,{children:e?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/Pe(P,{children:/*#__PURE__*/Pe(M,{$warn:!0,onClick:async function(){try{g(void 0),m(!0);let e=await D([]);return await R({user:e})}catch(e){g(e)}finally{m(!1),o(null)}},loading:w,children:"Remove"})}),/*#__PURE__*/Pe(S,{})]})}return 0!==b.length||K||q||z?"sms"===i?null:"totp"===i&&c?/*#__PURE__*/Pe(N,{onClose:f,onReset:B,submitEnrollmentWithTotp:e=>async function(e){try{g(void 0),m(!0);let t=await H(e);return await R({user:t})}catch(e){g(e)}finally{m(!1),o(null)}}(e.mfaCode),error:y,totpInfo:{...c,appName:r?.name||"Privy"}}):"passkey"===i?/*#__PURE__*/Pe(F,{onReset:B,onClose:f,submitEnrollmentWithPasskey:G}):/*#__PURE__*/Pe(L,{showIntro:!1,userMfaMethods:e.mfaMethods,appMfaMethods:r.mfa.methods,userHasAuthSms:j,onBackToIntro:()=>{},handleSelectMethod:async function(e){g(void 0);try{await _()}catch(e){return void g(e)}return"totp"===e?(l(e),u(null),void O().then((({totpSecret:e,totpAuthUrl:t})=>{u({authUrl:t,secret:e})})).catch((()=>{u(null),B()}))):"passkey"===e&&1===V.length?await G():void l(e)},isTotpLoading:"totp"===i&&!c,isPasskeyLoading:d,error:y,onClose:f,setRemovingMfaMethod:async function(e){g(void 0);try{await _()}catch(e){return void g(e)}o(e)}}):/*#__PURE__*/Re(be,{children:[/*#__PURE__*/Pe(k,{onClose:f},"header"),/*#__PURE__*/Pe(U,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/Pe(Ne,{})}),/*#__PURE__*/Pe(W,{children:"Add more security"}),/*#__PURE__*/Re(I,{children:[r?.name," does not have any verification methods enabled."]}),/*#__PURE__*/Pe(P,{children:/*#__PURE__*/Pe(M,{onClick:f,children:"Close"})}),/*#__PURE__*/Pe(S,{})]})}},wt=()=>{let e=H(),{setModalData:t}=p(),{verify:r}=dt(),{openModal:a,privy:s,closePrivyModal:n,refreshSessionAndUser:o,setUser:i}=we();return oe((()=>({enroll:async()=>new Promise(((l,c)=>{t({mfaEnroll:{onSuccess:async e=>{await n({shouldCallAuthOnSuccess:!1,isSuccess:!0}),l(e)},onFailure:async e=>{await n({shouldCallAuthOnSuccess:!1,isSuccess:!1}),c(e)},verify:()=>r({standalone:!1}),shouldUnlinkOnUnenrollMfa:!0,mfaMethods:e.mfa.methods,sendSmsCode:async()=>{throw Error("Not enabled")},enrollSms:async()=>{throw Error("Not enabled")},unenrollSms:async()=>{throw Error("Not enabled")},generateTotpSecret:async()=>await s.fetchPrivyRoute(Se,{body:{}}),enrollTotp:async e=>{await s.fetchPrivyRoute(Ue,{body:{code:e}});let t=await o();return i(t),t},unenrollTotp:async()=>{await s.fetchPrivyRoute(We,{body:{}});let e=await o();return i(e),e},enrollPasskey:async e=>{await s.fetchPrivyRoute(Ie,{body:{credential_ids:e,remove_for_login:!0}});let t=await o();return i(t),t}}}),a(ht)}))})),[s,t,a,n])},pt=()=>{let{startCrossAppAuthFlow:e,unlinkCrossAppAccount:t,signMessageWithCrossAppWallet:r,signTypedDataWithCrossAppWallet:a,sendTransactionWithCrossAppWallet:s,signTransactionWithCrossAppWallet:n}=me();return{loginWithCrossAppAccount:({appId:t})=>e({appId:t,action:"login"}),linkCrossAppAccount:({appId:t})=>e({appId:t,action:"link"}),unlinkCrossAppAccount:t,signMessage:r,signTypedData:a,sendTransaction:s,signTransaction:n}};function mt(e){let{sendTransaction:t}=le(ye);return r("sendTransaction",e),{sendTransaction:t}}function yt(e){let{setWalletPassword:t}=le(ye);return r("setWalletPassword",e),{setWalletPassword:t}}function gt(){let e=H(),t=x(),{client:r,setUser:a,setAuthenticated:s,setIsNewUser:n,initializeWalletProxy:o}=we(),{create:i}=D();return{createGuestAccount:async()=>{if(!e.id||!r)throw Error("SDK not yet ready");r.startAuthFlow(new K(e.id));try{let l=await r.authenticate(),c=l.user,u=l.isNewUser??!1;if(!c)throw new de("Unable to authenticate guest account");let d=await r.getAccessToken(),h=await o(q);if(d&&h)try{let t=z(c,e.embeddedWallets.ethereum.createOnLogin),r=j(c,e.embeddedWallets.solana.createOnLogin);t&&r?(c=(await i({chainType:"ethereum",latestUser:c})).user,c=(await i({chainType:"solana",latestUser:c})).user):r?c=(await i({chainType:"solana",latestUser:c})).user:t?c=(await i({chainType:"ethereum",latestUser:c})).user:a(c)}catch(e){a(c),console.warn("Unable to create embedded wallet for guest account")}return n(u),s(!0),t("login","onComplete",{user:c,isNewUser:u,wasAlreadyAuthenticated:!1,loginMethod:"guest",loginAccount:null}),c}catch(e){throw t("login","onError",e.privyErrorCode||he.UNKNOWN_AUTH_ERROR),e}}}}function ft(e){let{setWalletRecovery:t}=le(ye);return r("setWalletRecovery",e),{setWalletRecovery:t}}function At(e){let{signMessage:t}=le(ye);return r("signMessage",e),{signMessage:t}}const kt=()=>{let{ready:e,wallets:t}=B(),{user:r}=me(),{rpcConfig:a,chains:s,appId:n}=we();return{signAuthorization:ne((async(o,i)=>{let l;if(!r)throw Error("User must be authenticated before signing with a Privy wallet");if(!e)throw Error("Wallets are not ready");let c=i?.address??ge(r)?.address??_e,u=t.find((e=>Oe(e.address)===Oe(c)));if(!u)throw Error("Signing wallet not found.");let d=o.chainId??Number(u.chainId.split(":")[1]);if(0===d)l={chainId:0,address:o.contractAddress,nonce:o.nonce??0};else{let e=s.find((e=>e.id===d));if(!e)throw Error("Error, chain not configured in PrivyProvider config");let t=Fe({account:c,chain:e,transport:Le(G(e,a,n))});l=await t.prepareAuthorization({...o})}let h=await u.getEthereumProvider(),w=await h.request({method:"secp256k1_sign",params:[xe(l)]});return{...l,...He(w)}}),[e,t,r,s])}},Ct=kt;function vt(e){let{signTypedData:t}=le(ye);return r("signTypedData",e),{signTypedData:t}}const Et=()=>{let{isModalOpen:e}=le(ye);return{isOpen:e}};function Tt(e){let{getAccessToken:t}=le(ye);return r("accessToken",e),{getAccessToken:t}}function St(e){let{authenticated:t,user:a}=me(),{initLoginWithOAuth:s}=we(),n=x();return r("oAuthAuthorization",e),{reauthorize:e=>Ut(t,a,s,n,e.provider)}}let Ut=async(e,t,r,a,s)=>{if(!e)throw a("linkAccount","onError",he.MUST_BE_AUTHENTICATED,{linkMethod:s}),new de("User must be authenticated before linking an account.");if(!t?.linkedAccounts.some((e=>e.type.includes(s))))throw new de(`OAuth account of type ${s} not linked to the account.`);await r(s)};function Wt(e){let{client:t}=we(),[r,a]=ce({status:"initial"});return{linkWithCustomJwt:ne((async r=>{try{a({status:"initial"}),t.startAuthFlow(new J(r)),a({status:"loading"});let{user:s}=await t.link();if(!s)throw Error("Error, user not found");let n=s.linkedAccounts.filter((e=>"custom_auth"===e.type)).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())).at(0);return a({status:"done"}),e?.onSuccess?.({user:s,linkMethod:"custom",linkedAccount:n}),{user:s}}catch(r){throw a({status:"error",error:r}),e?.onError?.(r.privyErrorCode||he.UNKNOWN_AUTH_ERROR,{linkMethod:"custom"}),r}}),[t.startAuthFlow,t.link]),state:r}}const It=e=>{let t=ee();return r("customAuth",e),{status:t}};function Rt({isAuthenticated:e,isLoading:t,...r}){let a=ue();ie((()=>{t||a.current?.()}),[e,t]);let s=ne((e=>(a.current=e,()=>{a.current=void 0})),[]);return te({...r,subscribe:s})}function bt(){let{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}=me();return{getFarcasterSignerPublicKey:e,signFarcasterMessage:t,requestFarcasterSignerFromWarpcast:r}}const Pt=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!0}),revokeWallets:async()=>await e({showDelegationUIs:!0})}},Mt=()=>{let{addSessionSignersInternal:e,removeSessionSignersInternal:t}=(()=>{let{user:e}=me(),t=we(),{signWithUserSigner:r}=fe(),a=async({wallet:a,additional_signers:s})=>{let n=await t.client.getAccessToken();if(!e||!n)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!a.id)throw new de("Wallet to add signers to must have ID on server");if(!t.walletProxy)throw new de("Wallet proxy not initialized.");await Ke(t.privy,{wallet_id:a.id},r,{additional_signers:s})};return{addSessionSignersInternal:async({address:r,signers:s})=>{let n=await t.client.getAccessToken();if(!e||!n)throw new de("User must be authenticated and have an embedded wallet to add a session signer.");let o=t.walletProxy??await t.initializeWalletProxy(15e3);if(!o)throw new de("Wallet proxy not initialized.");let i=Ae(e,r);if(!i)throw new de("Address to add signers too is not associated with current user.");if(ke(i)){if(0===s.length)throw new de("Must specify at least one signer to add.");let e=[...(await De(t.privy,{wallet_id:i.id})).additional_signers,...re(s)];await a({wallet:i,additional_signers:e})}else{if(i.delegated)return{user:e};if(s.length>0)throw new de("Specifying signers in addSessionSigners is only supported for TEE execution and this app uses On-device execution. Pass an empty array for signers instead. Learn more https://docs.privy.io/recipes/tee-wallet-migration-guide");let a=ae({address:r,user:e}),l=se({address:r,user:e});await t.recoverEmbeddedWallet({address:r}),await o.createDelegatedAction({accessToken:n,rootWallet:l,delegatedWallets:[a]})}let l=await t.refreshSessionAndUser();if(!l)throw Error("Could not refresh user");return{user:l}},removeSessionSignersInternal:async({address:r})=>{let s=await t.client.getAccessToken();if(!e||!s)throw new de("User must be authenticated and have an embedded wallet to delegate actions.");if(!(t.walletProxy??await t.initializeWalletProxy(15e3)))throw new de("Wallet proxy not initialized.");let n=Ae(e,r);if(!n)throw new de("Address to remove signers from is not associated with current user.");ke(n)?await a({wallet:n,additional_signers:[]}):await t.client.revokeDelegatedWallet();let o=await t.refreshSessionAndUser();if(!o)throw Error("Could not refresh user");return{user:o}}}})();return{addSessionSigners:async({address:t,signers:r})=>e({address:t,signers:r}),removeSessionSigners:async({address:e})=>t({address:e})}},Nt=()=>{let{signWithUserSigner:e}=fe();return oe((()=>({async generateAuthorizationSignature(t){let{signature:r}=await qe(e,t);return{signature:r}}})),[e])},_t=()=>{let{setUser:e,client:t}=le(pe),{user:r}=le(ye);return{user:r,refreshUser:ne((async()=>{let r=await(t?.updateUserAndIdToken());return e(r??null),r}),[t,e])}},Ot=e=>{let t=s(),{initLoginWithTelegram:r,loginWithTelegram:a,telegramAuthState:n,setTelegramAuthState:i}=we();return{login:ne((async s=>{try{if(t.enabled&&"success"!==t.status)throw new o(t.error,null,he.CAPTCHA_FAILURE);await r(t.token,s?.disableSignup);let{user:n,isNewUser:i,loginAccount:l,wasAlreadyAuthenticated:c}=await a({intent:"login"});e?.onComplete?.({user:n,isNewUser:i,wasAlreadyAuthenticated:c,loginMethod:"telegram",loginAccount:l})}catch(s){throw i({status:"error",error:s}),e?.onError?.(s.privyErrorCode||he.UNKNOWN_AUTH_ERROR),s}}),[r,a,t]),state:n}},Ft=()=>{let{revokeDelegatedWallets:e,delegateWallet:t}=we();return{delegateWallet:async({address:e,chainType:r})=>await t({address:e,chainType:r,showDelegationUIs:!1}),revokeWallets:async()=>await e({showDelegationUIs:!1})}},Lt=async({wallet:e})=>{let t=await e.getEthereumProvider();return je({address:e.address,sign:async({hash:r})=>{if("privy"!==e.walletClientType)throw new ze({error:"Unprefixed signing is not supported by external wallets.",code:"unsupported_wallet_type"});return await t.request({method:"secp256k1_sign",params:[r]})},signMessage:async({message:r})=>await t.request({method:"personal_sign",params:[r,e.address]}),signTypedData:async r=>await t.request({method:"eth_signTypedData_v4",params:[e.address,r]}),signTransaction:async e=>await t.request({method:"eth_signTransaction",params:[e]})})};export{Lt as toViemAccount,dt as useAuthMfa,wt as useAuthMfaEnrollment,Nt as useAuthorizationSignature,ut as useBaseAccountSdk,ct as useConnectBaseAccount,lt as useConnectCoinbaseSmartWallet,Ze as useConnectOrCreateWallet,pt as useCrossAppAccounts,It as useCustomAuth,Pt as useDelegatedActions,bt as useFarcasterSigner,gt as useGuestAccounts,Ft as useHeadlessDelegatedActions,nt as useLinkAccount,Wt as useLinkJwtAccount,Je as useLinkWithPasskey,et as useLinkWithSiwe,at as useLinkWithSiws,$e as useLoginWithEmail,Be as useLoginWithFarcasterV2,Ge as useLoginWithOAuth,Xe as useLoginWithPasskey,tt as useLoginWithSiwe,rt as useLoginWithSiws,Ye as useLoginWithSms,Ot as useLoginWithTelegram,Et as useModalStatus,St as useOAuthTokens,d as usePrivy,Ve as useRecoverEmbeddedWallet,mt as useSendTransaction,Mt as useSessionSigners,yt as useSetWalletPassword,ft as useSetWalletRecovery,kt as useSign7702Authorization,Ct as useSignAuthorization,At as useSignMessage,st as useSignTransaction,vt as useSignTypedData,Qe as useSignupWithPasskey,Rt as useSubscribeToJwtAuthWithFlag,te as useSyncJwtBasedAuthState,Tt as useToken,ot as useUpdateAccount,it as useUpdateEmail,_t as useUser,B as useWallets};
@@ -1 +1 @@
1
- import{createContext as t,useContext as e}from"react";const i=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},a=t=>()=>{throw Error(t.trim())},s=/*#__PURE__*/t({setAuthenticated:i,setUser:i,setIsNewUser:i,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:i,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:i,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:i,initializeWalletProxy:i,getAuthMeta:i,getAuthFlow:i,closePrivyModal:i,openPrivyModal:i,connectWallet:i,initLoginWithWallet:i,loginWithWallet:i,initLoginWithFarcaster:i,loginWithFarcaster:i,loginWithCode:i,initLoginWithEmail:i,initLoginWithSms:i,initUpdateEmail:i,initUpdatePhone:i,resendEmailCode:i,resendSmsCode:i,initLoginWithHeadlessOAuth:i,loginWithHeadlessOAuth:i,crossAppAuthFlow:i,initLoginWithOAuth:i,loginWithOAuth:i,passkeyAuthState:{status:"initial"},setPasskeyAuthState:i,initSignupWithPasskey:i,signupWithPasskey:i,initLoginWithPasskey:i,loginWithPasskey:i,initLinkWithPasskey:i,linkWithPasskey:i,refreshSessionAndUser:i,walletProxy:null,createAnalyticsEvent:i,acceptTerms:i,getUsdTokenPrice:i,getUsdPriceForSol:i,getSplTokenMetadata:i,recoverEmbeddedWallet:i,updateWallets:i,fundWallet:i,openModal:i,setReadyToTrue:i,requestFarcasterSignerStatus:i,initLoginWithTelegram:i,loginWithTelegram:i,generateSiweMessage:i,generateSiweMessageForSmartWallet:i,loginWithSiwe:i,linkWithSiwe:i,linkSmartWallet:i,delegateWallet:i,revokeDelegatedWallets:i,exportSolanaWallet:i,connectCoinbaseSmartWallet:i,connectBaseAccount:i,initiateAccountTransfer:i,emailOtpState:{status:"initial"},setEmailOtpState:i,smsOtpState:{status:"initial"},setSmsOtpState:i,siweState:{status:"initial"},setSiweState:i,siwsState:{status:"initial"},setSiwsState:i,generateSiwsMessage:i,loginWithSiws:i,linkWithSiws:i,oAuthState:{status:"initial"},setOAuthState:i,telegramAuthState:{status:"initial"},setTelegramAuthState:i,isHeadlessOAuthLoading:!1,isHeadlessSigning:i,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:i}),n=()=>e(s);export{s as I,i as a,a as n,n as u};
1
+ import{createContext as t,useContext as e}from"react";const i=()=>{throw Error("You need to wrap your application with the <PrivyProvider> initialized with your app id.")},a=t=>()=>{throw Error(t.trim())},n=/*#__PURE__*/t({setAuthenticated:i,setUser:i,setIsNewUser:i,isNewUserThisSession:!1,walletConnectionStatus:null,setWalletConnectionStatus:i,connectors:[],solanaWallets:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,client:null,privy:null,appId:"notAdded",onCustomAuthAuthenticated:i,hideWalletUIs:{current:!1},nativeTokenSymbolForChainId:i,initializeWalletProxy:i,getAuthMeta:i,getAuthFlow:i,closePrivyModal:i,openPrivyModal:i,connectWallet:i,initLoginWithWallet:i,loginWithWallet:i,initLoginWithFarcaster:i,loginWithFarcaster:i,loginWithCode:i,initLoginWithEmail:i,initLoginWithSms:i,initUpdateEmail:i,initUpdatePhone:i,resendEmailCode:i,resendSmsCode:i,initLoginWithHeadlessOAuth:i,loginWithHeadlessOAuth:i,crossAppAuthFlow:i,initLoginWithOAuth:i,loginWithOAuth:i,passkeyAuthState:{status:"initial"},setPasskeyAuthState:i,initSignupWithPasskey:i,signupWithPasskey:i,initLoginWithPasskey:i,loginWithPasskey:i,initLinkWithPasskey:i,linkWithPasskey:i,refreshSessionAndUser:i,walletProxy:null,createAnalyticsEvent:i,acceptTerms:i,getUsdTokenPrice:i,getUsdPriceForSol:i,getSplTokenMetadata:i,recoverEmbeddedWallet:i,updateWallets:i,fundWallet:i,openModal:i,setReadyToTrue:i,requestFarcasterSignerStatus:i,initLoginWithTelegram:i,loginWithTelegram:i,generateSiweMessage:i,generateSiweMessageForSmartWallet:i,loginWithSiwe:i,linkWithSiwe:i,linkSmartWallet:i,delegateWallet:i,revokeDelegatedWallets:i,exportSolanaWallet:i,connectCoinbaseSmartWallet:i,connectBaseAccount:i,initiateAccountTransfer:i,emailOtpState:{status:"initial"},setEmailOtpState:i,smsOtpState:{status:"initial"},setSmsOtpState:i,siweState:{status:"initial"},setSiweState:i,oAuthState:{status:"initial"},setOAuthState:i,telegramAuthState:{status:"initial"},setTelegramAuthState:i,isHeadlessOAuthLoading:!1,isHeadlessSigning:i,inProgressAuthFlowRef:{current:null},inProgressLoginOrLinkMethodRef:{current:null},baseAccountSdk:void 0,setBaseAccountSdk:i}),s=()=>e(n);export{n as I,i as a,a as n,s as u};