@privy-io/react-auth 1.87.0-beta-20240920184838 → 1.87.0-beta-20240924131550

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 (45) hide show
  1. package/dist/cjs/getEmbeddedConnectedWallet.js +1 -0
  2. package/dist/cjs/index.js +3113 -0
  3. package/dist/cjs/internal-context.js +1 -0
  4. package/dist/cjs/smart-wallets.js +1 -0
  5. package/dist/cjs/solana.js +1 -0
  6. package/dist/cjs/ui.js +132 -0
  7. package/dist/cjs/useFundWallet.js +118 -0
  8. package/dist/cjs/useSolanaWallets.js +1 -0
  9. package/dist/cjs/useWallets.js +1 -0
  10. package/dist/dts/index.d.mts +2448 -0
  11. package/dist/{index.d.ts → dts/index.d.ts} +21 -8
  12. package/dist/dts/smart-wallets.d.mts +728 -0
  13. package/dist/{smart-wallets.d.ts → dts/smart-wallets.d.ts} +1 -1
  14. package/dist/dts/solana.d.mts +65 -0
  15. package/dist/{solana.d.ts → dts/solana.d.ts} +3 -3
  16. package/dist/{types-eaea6708.d.ts → dts/types.d.mts} +44 -1
  17. package/dist/dts/types.d.ts +2251 -0
  18. package/dist/dts/ui.d.mts +29 -0
  19. package/dist/{ui.d.ts → dts/ui.d.ts} +1 -1
  20. package/dist/esm/getEmbeddedConnectedWallet.mjs +1 -0
  21. package/dist/esm/index.mjs +3113 -0
  22. package/dist/esm/internal-context.mjs +1 -0
  23. package/dist/esm/smart-wallets.mjs +1 -0
  24. package/dist/esm/solana.mjs +1 -0
  25. package/dist/esm/ui.mjs +132 -0
  26. package/dist/esm/useFundWallet.mjs +118 -0
  27. package/dist/esm/useSolanaWallets.mjs +1 -0
  28. package/dist/esm/useWallets.mjs +1 -0
  29. package/package.json +58 -29
  30. package/dist/chunk-4ODVFLKF.js +0 -1
  31. package/dist/chunk-4RGQ4R3M.js +0 -118
  32. package/dist/chunk-E7B7OFUX.js +0 -3376
  33. package/dist/chunk-VGM5FGSZ.js +0 -1
  34. package/dist/esm/chunk-4ODVFLKF.js +0 -1
  35. package/dist/esm/chunk-4RGQ4R3M.js +0 -118
  36. package/dist/esm/chunk-E7B7OFUX.js +0 -3376
  37. package/dist/esm/chunk-VGM5FGSZ.js +0 -1
  38. package/dist/esm/index.js +0 -1
  39. package/dist/esm/smart-wallets.js +0 -1
  40. package/dist/esm/solana.js +0 -1
  41. package/dist/esm/ui.js +0 -142
  42. package/dist/index.js +0 -1
  43. package/dist/smart-wallets.js +0 -1
  44. package/dist/solana.js +0 -1
  45. package/dist/ui.js +0 -142
@@ -725,4 +725,4 @@ interface SmartWalletsProviderProps {
725
725
  declare const SmartWalletsProvider: ({ config, children }: SmartWalletsProviderProps) => react_jsx_runtime.JSX.Element;
726
726
  declare const useSmartWallets: () => SmartWalletsInterface;
727
727
 
728
- export { SmartWalletsProvider, SmartWalletsProviderProps, useSmartWallets };
728
+ export { SmartWalletsProvider, type SmartWalletsProviderProps, useSmartWallets };
@@ -0,0 +1,65 @@
1
+ import { aF as ConnectedSolanaWallet, t as Wallet } from './types.js';
2
+ export { S as SolanaAdapterConnector, aG as toSolanaWalletConnectors } from './types.js';
3
+ import { Transaction, VersionedTransaction, ParsedTransactionWithMeta } from '@solana/web3.js';
4
+ import '@metamask/eth-sig-util';
5
+ import '@ethersproject/providers';
6
+ import 'eventemitter3';
7
+ import '@privy-io/public-api';
8
+ import '@solana/wallet-adapter-base';
9
+ import 'libphonenumber-js/min';
10
+ import 'react';
11
+ import 'viem';
12
+ import 'web3-core';
13
+
14
+ /**
15
+ * A transaction that can be sent to the Solana network. Legacy transactions or v0 transactions (versioned) are supported.
16
+ * Refer to {@link https://solana-labs.github.io/solana-web3.js/classes/Transaction.html Transaction} and {@link https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html VersionedTransaction}
17
+ */
18
+ type SupportedSolanaTransaction = Transaction | VersionedTransaction;
19
+ /**
20
+ * Result of the transaction sent to the Solana network.
21
+ */
22
+ type SolanaTransactionReceipt = {
23
+ /** The signature of the transaction */
24
+ signature: string;
25
+ /** The parsed transaction result. Refer to {@link https://solana-labs.github.io/solana-web3.js/types/ParsedTransactionWithMeta.html ParsedTransactionWithMeta}*/
26
+ parsedTransaction: ParsedTransactionWithMeta | null;
27
+ /** The fees payed for the transaction in lamports */
28
+ fees: bigint;
29
+ };
30
+
31
+ /**
32
+ * Hook to create and interact with Solana wallets. This currently only supports an embedded Solana wallet and no
33
+ * external wallets.
34
+ *
35
+ * @returns wallets {ConnectedSolanaWallet[]} an array of connected Solana wallets
36
+ * @returns createWallet {() => Promise<Wallet>} an method to create an embedded Solana wallet.
37
+ */
38
+ interface UseSolanaWalletsInterface {
39
+ /**
40
+ * An array of the connected Solana wallets for the user. Currently, this will only contain the embedded
41
+ * Solana wallet if the user has created one.
42
+ */
43
+ wallets: ConnectedSolanaWallet[];
44
+ /**
45
+ * Method to create an embedded Solana wallet for a user. This method will throw an error if the user already has an
46
+ * embedded Solana or Ethereum wallet. Currently, only embedded Solana wallets with automatic recovery are supported.
47
+ * @returns wallet {Wallet} the Solana linked account for the user.
48
+ */
49
+ createWallet: () => Promise<Wallet>;
50
+ /**
51
+ * Shows the user a Privy modal, from which they can copy their embedded solana wallet's private
52
+ * key for easy export to another wallet client (e.g. Phantom, Backpack). The private key is loaded
53
+ * on an iframe running on a separate domain from your app, meaning your app cannot access it.
54
+ *
55
+ * This method will error if the user is not authenticated or does not have an embedded solana wallet.
56
+ * @param options {@link {address: string}} (optional) wallet address to export the private key for
57
+ * @returns Promise that resolves once the user exits the modal
58
+ */
59
+ exportWallet: (options?: {
60
+ address: string;
61
+ }) => Promise<void>;
62
+ }
63
+ declare const useSolanaWallets: () => UseSolanaWalletsInterface;
64
+
65
+ export { ConnectedSolanaWallet, type SolanaTransactionReceipt, type SupportedSolanaTransaction, type UseSolanaWalletsInterface, useSolanaWallets };
@@ -1,5 +1,5 @@
1
- import { aB as ConnectedSolanaWallet, r as Wallet } from './types-eaea6708.js';
2
- export { S as SolanaAdapterConnector, aC as toSolanaWalletConnectors } from './types-eaea6708.js';
1
+ import { aF as ConnectedSolanaWallet, t as Wallet } from './types.js';
2
+ export { S as SolanaAdapterConnector, aG as toSolanaWalletConnectors } from './types.js';
3
3
  import { Transaction, VersionedTransaction, ParsedTransactionWithMeta } from '@solana/web3.js';
4
4
  import '@metamask/eth-sig-util';
5
5
  import '@ethersproject/providers';
@@ -62,4 +62,4 @@ interface UseSolanaWalletsInterface {
62
62
  }
63
63
  declare const useSolanaWallets: () => UseSolanaWalletsInterface;
64
64
 
65
- export { ConnectedSolanaWallet, SolanaTransactionReceipt, SupportedSolanaTransaction, UseSolanaWalletsInterface, useSolanaWallets };
65
+ export { ConnectedSolanaWallet, type SolanaTransactionReceipt, type SupportedSolanaTransaction, type UseSolanaWalletsInterface, useSolanaWallets };
@@ -1783,6 +1783,25 @@ interface TelegramAuthResult {
1783
1783
  photo_url?: string;
1784
1784
  username?: string;
1785
1785
  }
1786
+ /**
1787
+ * Data received from an OAuth user endpoint
1788
+ */
1789
+ interface OAuthUserInfo {
1790
+ subject: string;
1791
+ username?: string;
1792
+ name?: string;
1793
+ email?: string;
1794
+ profilePictureUrl?: string;
1795
+ vanityName?: string;
1796
+ }
1797
+ /**
1798
+ * Object representation of metadata reported by a connected wallet during the SIWE flow
1799
+ */
1800
+ interface SiweWalletMetadata {
1801
+ walletClientType: WalletClientType;
1802
+ chainId: string;
1803
+ connectorType: string;
1804
+ }
1786
1805
  /**
1787
1806
  * Configuration for the Privy Smart Wallet SDK.
1788
1807
  * This configuration is used to enable the Smart Wallet SDK and configure the networks that the Smart Wallet will be used on.
@@ -1840,6 +1859,30 @@ type PasskeyFlowState = {
1840
1859
  } | {
1841
1860
  status: 'done';
1842
1861
  };
1862
+ type SiweFlowState = {
1863
+ status: 'initial';
1864
+ } | {
1865
+ status: 'error';
1866
+ error: Error | null;
1867
+ } | {
1868
+ status: 'generating-message';
1869
+ } | {
1870
+ status: 'awaiting-signature';
1871
+ } | {
1872
+ status: 'submitting-signature';
1873
+ } | {
1874
+ status: 'done';
1875
+ };
1876
+ type OAuthFlowState = {
1877
+ status: 'initial';
1878
+ } | {
1879
+ status: 'loading';
1880
+ } | {
1881
+ status: 'done';
1882
+ } | {
1883
+ status: 'error';
1884
+ error: Error | null;
1885
+ };
1843
1886
  /**
1844
1887
  * UI configuration object for the embedded wallet's Sign Message screen
1845
1888
  */
@@ -2205,4 +2248,4 @@ type EthereumRpcResponseType = eth_signTransactionResponse | eth_populateTransac
2205
2248
  type SolanaRpcRequestType = solana_signMessage;
2206
2249
  type SolanaRpcResponseType = solana_signMessageResponse;
2207
2250
 
2208
- export { MoonpayCurrencyCode as $, PrivyIframeErrorTypesType as A, BaseConnectedEthereumWallet as B, Chain as C, PrivyErrorCode as D, Embedded1193Provider as E, FundWalletConfig as F, LinkedAccountWithMetadata as G, UserRecoveryMethod as H, FundingMethod as I, LoginWithCode as J, PasskeyFlowState as K, LoginMethod as L, MoonpaySignRequest as M, OtpFlowState as N, OAuthTokens as O, PrivyProxyProvider as P, UnsignedTransactionRequestWithChainId as Q, RuntimeLoginOverridableOptions as R, SolanaWalletConnector as S, TelegramAuthResult as T, User as U, CustomAuthFlowState as V, WalletConnector as W, AsExternalProvider as X, TypedMessage as Y, MessageTypes as Z, MoonpayConfig as _, RpcConfig as a, MoonpayPaymentMethod as a0, Quantity as a1, TransactionLog as a2, NonEmptyArray as a3, EmailWithMetadata as a4, PhoneWithMetadata as a5, WalletWithMetadata as a6, Google as a7, Twitter as a8, Discord as a9, LoginMethodOrderOption as aA, ConnectedSolanaWallet as aB, toSolanaWalletConnectors as aC, Github as aa, LinkedIn as ab, Apple as ac, Tiktok as ad, Telegram as ae, CrossAppAccount as af, GoogleOAuthWithMetadata as ag, TwitterOAuthWithMetadata as ah, DiscordOAuthWithMetadata as ai, GithubOAuthWithMetadata as aj, TiktokOAuthWithMetadata as ak, LinkedInOAuthWithMetadata as al, AppleOAuthWithMetadata as am, FarcasterWithMetadata as an, TelegramWithMetadata as ao, CrossAppAccountWithMetadata as ap, PasskeyWithMetadata as aq, Email as ar, Phone as as, TransactionUIOptions as at, ContractUIOptions as au, NativeFundingConfig as av, MoonpayFundingConfig as aw, PriceDisplayOptions as ax, Farcaster as ay, Passkey as az, WalletClientType as b, ConnectedWalletMetadata as c, ConnectorType as d, WalletListEntry as e, ExternalWalletsConfig as f, BaseConnectedWallet as g, EIP1193Provider as h, OAuthProviderType as i, MoonpaySignResponse as j, SmartWalletConfig as k, PrivyServerConfig as l, PrivyFarcasterSignerInitResponse as m, PrivyClientConfig as n, ConnectWalletModalOptions as o, LoginModalOptions as p, CreateWalletOptions as q, Wallet as r, SetWalletRecoveryOptions as s, SignMessageModalUIOptions as t, SignTypedDataParams as u, MfaMethod as v, UnsignedTransactionRequest as w, SendTransactionModalUIOptions as x, TransactionReceipt as y, ConnectedWallet as z };
2251
+ export { AsExternalProvider as $, type TransactionReceipt as A, type BaseConnectedEthereumWallet as B, type Chain as C, type ConnectedWallet as D, Embedded1193Provider as E, type FundWalletConfig as F, type PrivyIframeErrorTypesType as G, PrivyErrorCode as H, type LinkedAccountWithMetadata as I, type UserRecoveryMethod as J, type FundingMethod as K, type LoginMethod as L, type MoonpaySignRequest as M, type OAuthFlowState as N, type OAuthTokens as O, PrivyProxyProvider as P, type LoginWithCode as Q, type RuntimeLoginOverridableOptions as R, SolanaWalletConnector as S, type TelegramAuthResult as T, type User as U, type OtpFlowState as V, WalletConnector as W, type PasskeyFlowState as X, type SiweFlowState as Y, type UnsignedTransactionRequestWithChainId as Z, type CustomAuthFlowState as _, type RpcConfig as a, type TypedMessage as a0, type MessageTypes as a1, type MoonpayConfig as a2, type MoonpayCurrencyCode as a3, type MoonpayPaymentMethod as a4, type Quantity as a5, type TransactionLog as a6, type NonEmptyArray as a7, type EmailWithMetadata as a8, type PhoneWithMetadata as a9, type MoonpayFundingConfig as aA, type PriceDisplayOptions as aB, type Farcaster as aC, type Passkey as aD, type LoginMethodOrderOption as aE, type ConnectedSolanaWallet as aF, toSolanaWalletConnectors as aG, type WalletWithMetadata as aa, type Google as ab, type Twitter as ac, type Discord as ad, type Github as ae, type LinkedIn as af, type Apple as ag, type Tiktok as ah, type Telegram as ai, type CrossAppAccount as aj, type GoogleOAuthWithMetadata as ak, type TwitterOAuthWithMetadata as al, type DiscordOAuthWithMetadata as am, type GithubOAuthWithMetadata as an, type TiktokOAuthWithMetadata as ao, type LinkedInOAuthWithMetadata as ap, type AppleOAuthWithMetadata as aq, type FarcasterWithMetadata as ar, type TelegramWithMetadata as as, type CrossAppAccountWithMetadata as at, type PasskeyWithMetadata as au, type Email as av, type Phone as aw, type TransactionUIOptions as ax, type ContractUIOptions as ay, type NativeFundingConfig as az, type WalletClientType as b, type ConnectedWalletMetadata as c, type ConnectorType as d, type WalletListEntry as e, type ExternalWalletsConfig as f, type BaseConnectedWallet as g, type EIP1193Provider as h, type OAuthProviderType as i, type MoonpaySignResponse as j, type SmartWalletConfig as k, type PrivyServerConfig as l, type PrivyFarcasterSignerInitResponse as m, type SiweWalletMetadata as n, type OAuthUserInfo as o, type PrivyClientConfig as p, type ConnectWalletModalOptions as q, type LoginModalOptions as r, type CreateWalletOptions as s, type Wallet as t, type SetWalletRecoveryOptions as u, type SignMessageModalUIOptions as v, type SignTypedDataParams as w, type MfaMethod as x, type UnsignedTransactionRequest as y, type SendTransactionModalUIOptions as z };