@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.
- package/dist/cjs/getEmbeddedConnectedWallet.js +1 -0
- package/dist/cjs/index.js +3113 -0
- package/dist/cjs/internal-context.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -0
- package/dist/cjs/solana.js +1 -0
- package/dist/cjs/ui.js +132 -0
- package/dist/cjs/useFundWallet.js +118 -0
- package/dist/cjs/useSolanaWallets.js +1 -0
- package/dist/cjs/useWallets.js +1 -0
- package/dist/dts/index.d.mts +2448 -0
- package/dist/{index.d.ts → dts/index.d.ts} +21 -8
- package/dist/dts/smart-wallets.d.mts +728 -0
- package/dist/{smart-wallets.d.ts → dts/smart-wallets.d.ts} +1 -1
- package/dist/dts/solana.d.mts +65 -0
- package/dist/{solana.d.ts → dts/solana.d.ts} +3 -3
- package/dist/{types-eaea6708.d.ts → dts/types.d.mts} +44 -1
- package/dist/dts/types.d.ts +2251 -0
- package/dist/dts/ui.d.mts +29 -0
- package/dist/{ui.d.ts → dts/ui.d.ts} +1 -1
- package/dist/esm/getEmbeddedConnectedWallet.mjs +1 -0
- package/dist/esm/index.mjs +3113 -0
- package/dist/esm/internal-context.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -0
- package/dist/esm/solana.mjs +1 -0
- package/dist/esm/ui.mjs +132 -0
- package/dist/esm/useFundWallet.mjs +118 -0
- package/dist/esm/useSolanaWallets.mjs +1 -0
- package/dist/esm/useWallets.mjs +1 -0
- package/package.json +58 -29
- package/dist/chunk-4ODVFLKF.js +0 -1
- package/dist/chunk-4RGQ4R3M.js +0 -118
- package/dist/chunk-E7B7OFUX.js +0 -3376
- package/dist/chunk-VGM5FGSZ.js +0 -1
- package/dist/esm/chunk-4ODVFLKF.js +0 -1
- package/dist/esm/chunk-4RGQ4R3M.js +0 -118
- package/dist/esm/chunk-E7B7OFUX.js +0 -3376
- package/dist/esm/chunk-VGM5FGSZ.js +0 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/smart-wallets.js +0 -1
- package/dist/esm/solana.js +0 -1
- package/dist/esm/ui.js +0 -142
- package/dist/index.js +0 -1
- package/dist/smart-wallets.js +0 -1
- package/dist/solana.js +0 -1
- 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 {
|
|
2
|
-
export { S as SolanaAdapterConnector,
|
|
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 {
|
|
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 };
|