@privy-io/react-auth 1.76.6 → 1.77.0-beta-20240802164445

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.
package/dist/index.d.ts CHANGED
@@ -894,6 +894,7 @@ interface ResponseSmsMfaMethod {
894
894
  type LinkedMfaMethodsResponseType = Array<ResponseSmsMfaMethod>;
895
895
  interface GetCurrentUserResponse {
896
896
  id: string;
897
+ is_guest: boolean;
897
898
  created_at: number;
898
899
  linked_accounts: LinkedAccountsResponseType;
899
900
  mfa_methods: LinkedMfaMethodsResponseType;
@@ -1274,7 +1275,7 @@ type OAuthProviderType = (typeof SUPPORTED_OAUTH_PROVIDERS)[number];
1274
1275
  * Supported OAuth providers for the recovery flow. Can be `'google-drive'`
1275
1276
  */
1276
1277
  type RecoveryProviderType = (typeof SUPPORTED_RECOVERY_PROVIDERS)[number];
1277
- type LoginMethod = 'email' | 'sms' | 'siwe' | 'farcaster' | OAuthProviderType | 'passkey' | 'telegram' | 'custom' | `privy:${string}`;
1278
+ type LoginMethod = 'email' | 'sms' | 'siwe' | 'farcaster' | OAuthProviderType | 'passkey' | 'telegram' | 'custom' | `privy:${string}` | 'guest';
1278
1279
  type LoginWithCode = {
1279
1280
  /**
1280
1281
  * One-time password _([OTP](https://en.wikipedia.org/wiki/One-time_password))_ that was sent to user during first login step
@@ -1301,7 +1302,7 @@ type WalletBranding = {
1301
1302
  id: string;
1302
1303
  icon?: string | EmbeddedSVG;
1303
1304
  };
1304
- type LinkedAccountType = 'wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app';
1305
+ type LinkedAccountType = 'wallet' | 'email' | 'phone' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'guest';
1305
1306
  /** @ignore */
1306
1307
  interface LinkMetadata {
1307
1308
  /** Account type, most commonly useful when filtering through linkedAccounts */
@@ -1822,6 +1823,8 @@ interface User {
1822
1823
  * and/or Privacy Policy
1823
1824
  */
1824
1825
  hasAcceptedTerms: boolean;
1826
+ /** Whether or not the user is a guest */
1827
+ isGuest: boolean;
1825
1828
  }
1826
1829
  type OAuthTokens = {
1827
1830
  /** The OAuth provider. */
@@ -2490,6 +2493,7 @@ type PrivyFarcasterSignerInitResponse = {
2490
2493
  type RuntimeLoginOverridableOptions = {
2491
2494
  loginMethods?: PrivyClientConfig['loginMethods'];
2492
2495
  };
2496
+ type SetWalletRecoveryOptions = {};
2493
2497
 
2494
2498
  declare function getAccessToken(): Promise<string | null>;
2495
2499
  /**
@@ -2909,7 +2913,7 @@ interface PrivyInterface {
2909
2913
  *
2910
2914
  * @returns Promise for the {@link Wallet} object for the updated embedded wallet
2911
2915
  */
2912
- setWalletRecovery: () => Promise<Wallet>;
2916
+ setWalletRecovery: (o?: SetWalletRecoveryOptions) => Promise<Wallet>;
2913
2917
  /**
2914
2918
  * Prompts a user to sign a message using their embedded wallet using EIP-191's `personal_sign`
2915
2919
  * method (0x45).
@@ -3960,6 +3964,15 @@ declare function useSetWalletPassword(callbacks?: PrivyEvents['setWalletPassword
3960
3964
  setWalletPassword: () => Promise<Wallet>;
3961
3965
  };
3962
3966
 
3967
+ /**
3968
+ * Use this hook to create a guest account
3969
+ *
3970
+ * @returns createGuestAccount - {@link createGuestAccount} creates a guest account
3971
+ */
3972
+ declare function useGuestAccounts(): {
3973
+ createGuestAccount: () => Promise<User>;
3974
+ };
3975
+
3963
3976
  /**
3964
3977
  * Use this hook to set user-controlled recovery on the embedded wallet, and to attach callbacks
3965
3978
  * for successful `recovery set`s, and `recovery set` errors.
@@ -3974,7 +3987,7 @@ declare function useSetWalletRecovery(callbacks?: PrivyEvents['setWalletRecovery
3974
3987
  /**
3975
3988
  * Opens the Privy set recovery modal and prompts the user to set wallet password.
3976
3989
  */
3977
- setWalletRecovery: () => Promise<Wallet>;
3990
+ setWalletRecovery: (o?: SetWalletRecoveryOptions) => Promise<Wallet>;
3978
3991
  };
3979
3992
 
3980
3993
  /**
@@ -4126,4 +4139,4 @@ declare const LoginModal: ({ open }: {
4126
4139
  open: boolean;
4127
4140
  }) => react_jsx_runtime.JSX.Element;
4128
4141
 
4129
- export { Apple, AppleOAuthWithMetadata, AsExternalProvider, CallbackError, Captcha, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, ContractUIOptions, CrossAppAccount, CrossAppAccountWithMetadata, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, Farcaster, FarcasterWithMetadata, FundWalletConfig, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, LinkedIn, LinkedInOAuthWithMetadata, LoginMethodOrderOption, LoginModal, LoginWithCode, MessageTypes, MfaMethod, MoonpayConfig, MoonpayCurrencyCode, MoonpayFundingConfig, MoonpayPaymentMethod, NativeFundingConfig, NonEmptyArray, OAuthProviderType, OAuthTokens, Passkey, PasskeyWithMetadata, Phone, PhoneWithMetadata, PriceDisplayOptions, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, Quantity, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendCodeToEmail, SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, Telegram, TelegramWithMetadata, Tiktok, TiktokOAuthWithMetadata, TransactionLog, TransactionReceipt, TransactionUIOptions, Twitter, TwitterOAuthWithMetadata, TypedMessage, UnsignedTransactionRequest, UseFundWalletInterface, UseLoginWithEmail, UseLoginWithSms, UseOAuthTokens, UseSolanaWalletsInterface, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, WalletWithMetadata, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getAccessToken, getEmbeddedConnectedWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useExperimentalFarcasterSigner, useFarcasterSigner, useFundWallet, useLinkAccount, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithSms, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignMessage, useSignTypedData, useSolanaWallets, useToken, useWallets };
4142
+ export { Apple, AppleOAuthWithMetadata, AsExternalProvider, CallbackError, Captcha, ConnectedSolanaWallet, ConnectedWallet, ConnectorManager, ContractUIOptions, CrossAppAccount, CrossAppAccountWithMetadata, Discord, DiscordOAuthWithMetadata, EIP1193Provider, Email, EmailWithMetadata, Farcaster, FarcasterWithMetadata, FundWalletConfig, Github, GithubOAuthWithMetadata, Google, GoogleOAuthWithMetadata, LinkedIn, LinkedInOAuthWithMetadata, LoginMethodOrderOption, LoginModal, LoginWithCode, MessageTypes, MfaMethod, MoonpayConfig, MoonpayCurrencyCode, MoonpayFundingConfig, MoonpayPaymentMethod, NativeFundingConfig, NonEmptyArray, OAuthProviderType, OAuthTokens, Passkey, PasskeyWithMetadata, Phone, PhoneWithMetadata, PriceDisplayOptions, PrivyClient, PrivyClientConfig, PrivyEvents, PrivyInterface, PrivyProvider, PrivyProviderProps, PrivyProxyProvider, Quantity, DEFAULT_SUPPORTED_CHAINS as SUPPORTED_CHAINS, SendCodeToEmail, SendCodeToSms, SendTransactionModalUIOptions, SignMessageModalUIOptions, SignTypedDataParams, Telegram, TelegramWithMetadata, Tiktok, TiktokOAuthWithMetadata, TransactionLog, TransactionReceipt, TransactionUIOptions, Twitter, TwitterOAuthWithMetadata, TypedMessage, UnsignedTransactionRequest, UseFundWalletInterface, UseLoginWithEmail, UseLoginWithSms, UseOAuthTokens, UseSolanaWalletsInterface, UseWalletsInterface, User, VERSION, Wallet, WalletConnector, WalletListEntry, WalletWithMetadata, addRpcUrlOverrideToChain, errorIndicatesMaxMfaRetries, errorIndicatesMfaTimeout, errorIndicatesMfaVerificationFailed, getAccessToken, getEmbeddedConnectedWallet, useConnectWallet, useCreateWallet, useCrossAppAccounts, useExperimentalFarcasterSigner, useFarcasterSigner, useFundWallet, useGuestAccounts, useLinkAccount, useLinkWithSiwe, useLogin, useLoginWithEmail, useLoginWithOAuth, useLoginWithSms, useLogout, useMfa, useMfaEnrollment, useModalStatus, useOAuthTokens, usePrivy, useRegisterMfaListener, useSendTransaction, useSetWalletPassword, useSetWalletRecovery, useSignMessage, useSignTypedData, useSolanaWallets, useToken, useWallets };