@privy-io/react-auth 1.92.7 → 1.92.8

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 (36) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/{getEmbeddedConnectedWallet-DS-w3DHv.js → getEmbeddedConnectedWallet-BCSe3UD8.js} +1 -1
  3. package/dist/cjs/index.js +67 -67
  4. package/dist/cjs/{privy-context-6Fn5d7Hw.js → privy-context-B43g6JiF.js} +1 -1
  5. package/dist/cjs/{smart-wallets-Di4AUVjR.js → smart-wallets-DlagnlvE.js} +1 -1
  6. package/dist/cjs/smart-wallets.js +1 -1
  7. package/dist/cjs/solana.js +1 -1
  8. package/dist/cjs/ui.js +1 -1
  9. package/dist/cjs/{useFundWallet-CmI_P32R.js → useFundWallet-DFftFMBJ.js} +5 -5
  10. package/dist/cjs/{useSolanaWallets-CQuWnY1r.js → useSolanaWallets-DfiHdSOv.js} +1 -1
  11. package/dist/cjs/{useWallets-Br4RRclA.js → useWallets-CWzH6bag.js} +1 -1
  12. package/dist/dts/index.d.mts +10 -30
  13. package/dist/dts/index.d.ts +10 -30
  14. package/dist/dts/smart-wallets.d.mts +1 -1
  15. package/dist/dts/smart-wallets.d.ts +1 -1
  16. package/dist/dts/{solana-BRQvrG8A.d.ts → solana-D4LbpEn7.d.mts} +1 -1
  17. package/dist/dts/{solana-BRQvrG8A.d.mts → solana-D4LbpEn7.d.ts} +1 -1
  18. package/dist/dts/solana.d.mts +2 -2
  19. package/dist/dts/solana.d.ts +2 -2
  20. package/dist/dts/{types-fS_ewT7E.d.mts → types-CAHNKx-q.d.mts} +293 -81
  21. package/dist/dts/{types-fS_ewT7E.d.ts → types-CAHNKx-q.d.ts} +293 -81
  22. package/dist/dts/ui.d.mts +1 -1
  23. package/dist/dts/ui.d.ts +1 -1
  24. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  25. package/dist/esm/{getEmbeddedConnectedWallet-2FJQV-TA.mjs → getEmbeddedConnectedWallet-Qi_uxCqa.mjs} +1 -1
  26. package/dist/esm/index.mjs +314 -314
  27. package/dist/esm/privy-context-CW9-rtNf.mjs +1 -0
  28. package/dist/esm/{smart-wallets-C0eP6Grh.mjs → smart-wallets-Bk-33Glw.mjs} +1 -1
  29. package/dist/esm/smart-wallets.mjs +1 -1
  30. package/dist/esm/solana.mjs +1 -1
  31. package/dist/esm/ui.mjs +1 -1
  32. package/dist/esm/{useFundWallet-DfRcsTFv.mjs → useFundWallet-BVBVr3Un.mjs} +18 -18
  33. package/dist/esm/{useSolanaWallets-Cn7Eb8fU.mjs → useSolanaWallets-bZtAvFN_.mjs} +1 -1
  34. package/dist/esm/{useWallets-0pQT6tND.mjs → useWallets-CPLpVZRq.mjs} +1 -1
  35. package/package.json +5 -5
  36. package/dist/esm/privy-context-BXjG69vB.mjs +0 -1
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import react__default, { MouseEvent } from 'react';
3
- import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, n as SiweWalletMetadata, T as TelegramAuthResult, o as OAuthUserInfo, p as PrivyClientConfig, q as ConnectWalletModalOptions, r as LoginModalOptions, s as CreateWalletOptions, t as Wallet, u as SetWalletRecoveryOptions, v as SignMessageModalUIOptions, w as SignTypedDataParams, x as MfaMethod, y as UnsignedTransactionRequest, z as SendTransactionModalUIOptions, F as FundWalletConfig, A as TransactionReceipt, D as SupportedSolanaTransaction, G as SolanaTransactionReceipt, H as ConnectedWallet, I as PrivyIframeErrorTypesType, J as OAuthFlowState, K as LoginWithCode, N as OtpFlowState, Q as PasskeyFlowState, V as SiweFlowState, X as UnsignedTransactionRequestWithChainId, Y as CustomAuthFlowState } from './types-fS_ewT7E.js';
4
- export { ag as Apple, aq as AppleOAuthWithMetadata, Z as AsExternalProvider, aF as ConnectedSolanaWallet, ay as ContractUIOptions, aj as CrossAppAccount, at as CrossAppAccountWithMetadata, ad as Discord, am as DiscordOAuthWithMetadata, av as Email, a8 as EmailWithMetadata, aC as Farcaster, ar as FarcasterWithMetadata, ae as Github, an as GithubOAuthWithMetadata, ab as Google, ak as GoogleOAuthWithMetadata, af as LinkedIn, ap as LinkedInOAuthWithMetadata, aE as LoginMethodOrderOption, $ as MessageTypes, a1 as MoonpayConfig, a2 as MoonpayCurrencyCode, aA as MoonpayFundingConfig, a3 as MoonpayPaymentMethod, az as NativeFundingConfig, a7 as NonEmptyArray, aD as Passkey, au as PasskeyWithMetadata, aw as Phone, a9 as PhoneWithMetadata, aB as PriceDisplayOptions, a4 as Quantity, a6 as SolanaCluster, a0 as SolanaFundingConfig, ai as Telegram, as as TelegramWithMetadata, ah as Tiktok, ao as TiktokOAuthWithMetadata, a5 as TransactionLog, ax as TransactionUIOptions, ac as Twitter, al as TwitterOAuthWithMetadata, _ as TypedMessage, aa as WalletWithMetadata } from './types-fS_ewT7E.js';
3
+ import { C as Chain, W as WalletConnector, B as BaseConnectedEthereumWallet, a as RpcConfig, P as PrivyProxyProvider, E as Embedded1193Provider, b as WalletClientType, c as ConnectedWalletMetadata, d as ConnectorType, e as WalletListEntry, f as ExternalWalletsConfig, g as BaseConnectedWallet, S as SolanaWalletConnector, h as EIP1193Provider, U as User, O as OAuthTokens, i as OAuthProviderType, M as MoonpaySignRequest, j as MoonpaySignResponse, k as SmartWalletConfig, l as PrivyServerConfig, m as PrivyFarcasterSignerInitResponse, L as LoginMethod, n as SiweWalletMetadata, T as TelegramAuthResult, o as OAuthUserInfo, p as PrivyClientConfig, q as ConnectWalletModalOptions, r as LoginModalOptions, s as CreateWalletOptions, t as Wallet, u as SetWalletRecoveryOptions, v as SignMessageModalUIOptions, w as SignTypedDataParams, x as MfaMethod, y as UnsignedTransactionRequest, z as SendTransactionModalUIOptions, F as FundWalletConfig, A as TransactionReceipt, D as SupportedSolanaTransaction, G as SolanaTransactionReceipt, H as ConnectedWallet, I as PrivyIframeErrorTypesType, J as OAuthFlowState, K as LoginWithCode, N as OtpFlowState, Q as PasskeyFlowState, V as SiweFlowState, X as UnsignedTransactionRequestWithChainId, Y as CustomAuthFlowState } from './types-CAHNKx-q.js';
4
+ export { ag as Apple, aq as AppleOAuthWithMetadata, Z as AsExternalProvider, aF as ConnectedSolanaWallet, ay as ContractUIOptions, aj as CrossAppAccount, at as CrossAppAccountWithMetadata, ad as Discord, am as DiscordOAuthWithMetadata, av as Email, a8 as EmailWithMetadata, aC as Farcaster, ar as FarcasterWithMetadata, ae as Github, an as GithubOAuthWithMetadata, ab as Google, ak as GoogleOAuthWithMetadata, af as LinkedIn, ap as LinkedInOAuthWithMetadata, aE as LoginMethodOrderOption, $ as MessageTypes, a1 as MoonpayConfig, a2 as MoonpayCurrencyCode, aA as MoonpayFundingConfig, a3 as MoonpayPaymentMethod, az as NativeFundingConfig, a7 as NonEmptyArray, aD as Passkey, au as PasskeyWithMetadata, aw as Phone, a9 as PhoneWithMetadata, aB as PriceDisplayOptions, a4 as Quantity, a6 as SolanaCluster, a0 as SolanaFundingConfig, ai as Telegram, as as TelegramWithMetadata, ah as Tiktok, ao as TiktokOAuthWithMetadata, a5 as TransactionLog, ax as TransactionUIOptions, ac as Twitter, al as TwitterOAuthWithMetadata, _ as TypedMessage, aa as WalletWithMetadata } from './types-CAHNKx-q.js';
5
5
  import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import { TurnstileProps } from '@marsidev/react-turnstile';
7
7
  import EventEmitter from 'eventemitter3';
@@ -16,8 +16,8 @@ import { Connection } from '@solana/web3.js';
16
16
  import { AbstractProvider } from 'web3-core';
17
17
  import { CustomMetadataType, SmartWalletType, PrivyCoinbaseOnRampInitInput, PrivyCoinbaseOnRampInitResponse, PrivyCoinbaseOnRampStatusResponse } from '@privy-io/public-api';
18
18
  import { FetchOptions } from 'ofetch';
19
- import { P as PrivyEvents } from './solana-BRQvrG8A.js';
20
- export { C as CallbackError, a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './solana-BRQvrG8A.js';
19
+ import { P as PrivyEvents } from './solana-D4LbpEn7.js';
20
+ export { C as CallbackError, a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, u as useSolanaWallets } from './solana-D4LbpEn7.js';
21
21
  import '@metamask/eth-sig-util';
22
22
  import 'viem';
23
23
  import '@privy-io/js-sdk-core';
@@ -491,24 +491,15 @@ declare class PrivyClient {
491
491
  onDeleteToken?: (() => void) | undefined;
492
492
  /**
493
493
  * Creates a new Privy client.
494
- * @param options Initialization options.
494
+ * @param apiUrl - The URL of the Privy API
495
+ * @param appId - The app id from your dashboard
496
+ * @param appClientId - The app client id from your dashboard
497
+ * @param timeout - Time in milliseconds after which to timeout requests to the API
495
498
  */
496
- constructor(options: {
497
- /**
498
- * The URL of the Privy API. Defaults to `https://auth.privy.io`.
499
- */
499
+ constructor({ apiUrl, appId, appClientId, timeout, }: {
500
500
  apiUrl?: string;
501
- /**
502
- * The app id from your dashboard
503
- */
504
501
  appId: string;
505
- /**
506
- * The app client id from your dashboard
507
- */
508
502
  appClientId?: string;
509
- /**
510
- * Time in milliseconds after which to timeout requests to the API. Defaults to `10000` (10 seconds).
511
- */
512
503
  timeout?: number;
513
504
  });
514
505
  /**
@@ -611,7 +602,7 @@ declare class PrivyClient {
611
602
  * recommended.
612
603
  *
613
604
  * @param disableAutoRefresh not recommended - optionally disable automatic
614
- * token refresh when the token is
605
+ * token refresh when the token is expired or expiring soon
615
606
  *
616
607
  * @returns Promise<string | null>
617
608
  */
@@ -1514,17 +1505,6 @@ type UseLoginWithOAuth = {
1514
1505
  provider: OAuthProviderType;
1515
1506
  disableSignup?: boolean;
1516
1507
  }) => Promise<void>;
1517
- /**
1518
- * Used to log users in via various OAuth providers without using Privy's UI
1519
- *
1520
- * @returns a Promise that resolves with the User if login was successful or rejects if there was an error.
1521
- *
1522
- * @example
1523
- * const {loginWithOAuth} = useLoginWithOAuth()
1524
- *
1525
- * <Button onPress={loginWithOAuth} /> *
1526
- */
1527
- loginWithOAuth: () => Promise<User | undefined>;
1528
1508
  /**
1529
1509
  * Indicates a headless OAuth flow is in progress
1530
1510
  */
@@ -1,6 +1,6 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import react__default from 'react';
3
- import './types-fS_ewT7E.js';
3
+ import './types-CAHNKx-q.js';
4
4
  import * as permissionless from 'permissionless';
5
5
  import * as viem__types_account_abstraction_types_userOperation from 'viem/_types/account-abstraction/types/userOperation';
6
6
  import * as viem_account_abstraction 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 './types-fS_ewT7E.js';
3
+ import './types-CAHNKx-q.js';
4
4
  import * as permissionless from 'permissionless';
5
5
  import * as viem__types_account_abstraction_types_userOperation from 'viem/_types/account-abstraction/types/userOperation';
6
6
  import * as viem_account_abstraction from 'viem/account-abstraction';
@@ -1,4 +1,4 @@
1
- import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, B as BaseConnectedEthereumWallet, aI as BaseConnectedSolanaWallet, t as Wallet, x as MfaMethod, aJ as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aK as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types-fS_ewT7E.js';
1
+ import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, B as BaseConnectedEthereumWallet, aI as BaseConnectedSolanaWallet, t as Wallet, x as MfaMethod, aJ as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aK as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types-CAHNKx-q.js';
2
2
  import { TransactionResponse } from '@ethersproject/providers';
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, B as BaseConnectedEthereumWallet, aI as BaseConnectedSolanaWallet, t as Wallet, x as MfaMethod, aJ as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aK as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types-fS_ewT7E.js';
1
+ import { aG as PrivyErrorCode, U as User, L as LoginMethod, aH as LinkedAccountWithMetadata, O as OAuthTokens, B as BaseConnectedEthereumWallet, aI as BaseConnectedSolanaWallet, t as Wallet, x as MfaMethod, aJ as UserRecoveryMethod, G as SolanaTransactionReceipt, C as Chain, aK as FundingMethod, a6 as SolanaCluster, aF as ConnectedSolanaWallet, a0 as SolanaFundingConfig } from './types-CAHNKx-q.js';
2
2
  import { TransactionResponse } from '@ethersproject/providers';
3
3
 
4
4
  /**
@@ -1,5 +1,5 @@
1
- export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aL as toSolanaWalletConnectors } from './types-fS_ewT7E.js';
2
- export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-BRQvrG8A.js';
1
+ export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aL as toSolanaWalletConnectors } from './types-CAHNKx-q.js';
2
+ export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-D4LbpEn7.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
@@ -1,5 +1,5 @@
1
- export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aL as toSolanaWalletConnectors } from './types-fS_ewT7E.js';
2
- export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-BRQvrG8A.js';
1
+ export { aF as ConnectedSolanaWallet, S as SolanaAdapterConnector, G as SolanaTransactionReceipt, D as SupportedSolanaTransaction, aL as toSolanaWalletConnectors } from './types-CAHNKx-q.js';
2
+ export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-D4LbpEn7.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
@@ -249,6 +249,192 @@ declare class ProviderRpcError extends PrivyError {
249
249
  constructor(message: string, code: number, data?: unknown);
250
250
  }
251
251
 
252
+ type BaseProxyRequest = {
253
+ accessToken: string;
254
+ } & Partial<MfaSubmitArgs>;
255
+ type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier';
256
+ type BaseWalletsRequestData = BaseProxyRequest & {
257
+ chainType: 'ethereum' | 'solana' | 'bitcoin-taproot' | 'bitcoin-segwit';
258
+ };
259
+ type WalletsCreateRequestDataType = BaseWalletsRequestData & {
260
+ /** Optional: the user-specified recovery password, replaces recoveryPin */
261
+ recoveryPassword?: string;
262
+ /** Optional: the recovery method to be used for the created wallet */
263
+ recoveryMethod?: UserRecoveryMethod;
264
+ /** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
265
+ recoveryAccessToken?: string;
266
+ /** Optional: override the recoverySecret, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
267
+ recoverySecretOverride?: string;
268
+ /** Optional: override the iCloudRecordName, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
269
+ iCloudRecordNameOverride?: string;
270
+ };
271
+ type WalletsCreateResponseDataType = {
272
+ address: string;
273
+ };
274
+ type WalletsAddRequestDataType = BaseWalletsRequestData & {
275
+ /**
276
+ * Key with which to look up the existing entropy
277
+ */
278
+ entropyId: string;
279
+ /**
280
+ * Source of the `entropyId` property. This field determines how the entropyId will
281
+ * be used. Possible values include:
282
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
283
+ * at index 0 for this entropy
284
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
285
+ * at index 0 for this entropy
286
+ *
287
+ * When this field is a wallet address, we can verify reconstitution was successful by
288
+ * deriving the specified wallet and comparing the address to the `entropyId`
289
+ */
290
+ entropyIdVerifier: EntropyIdVerifier;
291
+ /**
292
+ * The HD node index at which to create a wallet. Must be >= 1 AND equal to the next
293
+ * index in the sequence, since the primary wallet is created at index 0.
294
+ */
295
+ hdWalletIndex: number;
296
+ };
297
+ type WalletsAddResponseDataType = {
298
+ address: string;
299
+ };
300
+ type WalletsSetRecoveryBaseRequestDataType = BaseWalletsRequestData & {
301
+ /**
302
+ * Key with which to look up the existing entropy
303
+ */
304
+ entropyId: string;
305
+ /**
306
+ * Source of the `entropyId` property. This field determines how the entropyId will
307
+ * be used. Possible values include:
308
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
309
+ * at index 0 for this entropy
310
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
311
+ * at index 0 for this entropy
312
+ *
313
+ * When this field is a wallet address, we can verify reconstitution was successful by
314
+ * deriving the specified wallet and comparing the address to the `entropyId`
315
+ */
316
+ entropyIdVerifier: EntropyIdVerifier;
317
+ existingRecoveryMethod?: UserRecoveryMethod;
318
+ };
319
+ type WalletsSetRecoveryPasswordDataType = WalletsSetRecoveryBaseRequestDataType & {
320
+ recoveryMethod: 'user-passcode';
321
+ recoveryPassword: string;
322
+ };
323
+ type WalletsSetRecoveryGoogleDriveDataType = WalletsSetRecoveryBaseRequestDataType & {
324
+ recoveryMethod: 'google-drive';
325
+ recoveryAccessToken: string;
326
+ };
327
+ type WalletsSetRecoveryICloudDataType = WalletsSetRecoveryBaseRequestDataType & {
328
+ recoveryMethod: 'icloud';
329
+ recoveryAccessToken: string;
330
+ };
331
+ type WalletsSetRecoveryICloudNativeDataType = WalletsSetRecoveryBaseRequestDataType & {
332
+ recoveryMethod: 'icloud-native';
333
+ recoverySecretOverride: string;
334
+ iCloudRecordNameOverride: string;
335
+ };
336
+ type WalletsSetRecoveryRequestDataType = Omit<WalletsSetRecoveryPasswordDataType, 'chainType'> | Omit<WalletsSetRecoveryGoogleDriveDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudNativeDataType, 'chainType'>;
337
+ type WalletsSetRecoveryResponseDataType = {
338
+ entropyId: string;
339
+ /**
340
+ * Source of the `entropyId` property. This field determines how the entropyId will
341
+ * be used. Possible values include:
342
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
343
+ * at index 0 for this entropy
344
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
345
+ * at index 0 for this entropy
346
+ *
347
+ * When this field is a wallet address, we can verify reconstitution was successful by
348
+ * deriving the specified wallet and comparing the address to the `entropyId`
349
+ */
350
+ entropyIdVerifier: EntropyIdVerifier;
351
+ recoveryMethod: WalletsSetRecoveryRequestDataType['recoveryMethod'];
352
+ };
353
+ type WalletsConnectRequestDataType = BaseProxyRequest & {
354
+ /**
355
+ * Key with which to look up the existing entropy
356
+ */
357
+ entropyId: string;
358
+ /**
359
+ * Source of the key with which to look up the existing entropy
360
+ */
361
+ entropyIdVerifier: EntropyIdVerifier;
362
+ };
363
+ type WalletsConnectResponseDataType = {
364
+ address: string;
365
+ };
366
+ type WalletsRecoverRequestDataType = BaseProxyRequest & {
367
+ /**
368
+ * Key with which to look up the existing entropy
369
+ */
370
+ entropyId: string;
371
+ /**
372
+ * Source of the `entropyId` property. This field determines how the entropyId will
373
+ * be used. Possible values include:
374
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
375
+ * at index 0 for this entropy
376
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
377
+ * at index 0 for this entropy
378
+ *
379
+ * When this field is a wallet address, we can verify reconstitution was successful by
380
+ * deriving the specified wallet and comparing the address to the `entropyId`
381
+ */
382
+ entropyIdVerifier: EntropyIdVerifier;
383
+ /** Optional: the user-specified recovery password, replaces recoveryPin */
384
+ recoveryPassword?: string;
385
+ /** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
386
+ recoveryAccessToken?: string;
387
+ /** Optional: override the recoverySecret, only for use when we need to retrieve recovery secrets in cloud storage outside of the iframe (eg native) */
388
+ recoverySecretOverride?: string;
389
+ };
390
+ type WalletsRecoverResponseDataType = {
391
+ entropyId: string;
392
+ };
393
+ type WalletsRpcEthereumRequestDataType = {
394
+ chainType: 'ethereum';
395
+ request: EthereumRpcRequestType;
396
+ };
397
+ type WalletsRpcSolanaRequestDataType = {
398
+ chainType: 'solana';
399
+ request: SolanaRpcRequestType;
400
+ };
401
+ type WalletsRpcBitcoinRequestDataType = {
402
+ chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
403
+ request: unknown;
404
+ };
405
+ type WalletsRpcRequestDataType = BaseWalletsRequestData & {
406
+ /**
407
+ * Key with which to look up the existing entropy
408
+ */
409
+ entropyId: string;
410
+ /**
411
+ * Source of the `entropyId` property. This field determines how the entropyId will
412
+ * be used. Possible values include:
413
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
414
+ * at index 0 for this entropy
415
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
416
+ * at index 0 for this entropy
417
+ *
418
+ * When this field is a wallet address, we can verify reconstitution was successful by
419
+ * deriving the specified wallet and comparing the address to the `entropyId`
420
+ */
421
+ entropyIdVerifier: EntropyIdVerifier;
422
+ } & (WalletsRpcEthereumRequestDataType | WalletsRpcSolanaRequestDataType | WalletsRpcBitcoinRequestDataType);
423
+ type WalletsRpcEthereumResponseDataType = {
424
+ chainType: 'ethereum';
425
+ response: EthereumRpcResponseType;
426
+ };
427
+ type WalletsRpcSolanaResponseDataType = {
428
+ chainType: 'solana';
429
+ response: SolanaRpcResponseType;
430
+ };
431
+ type WalletsRpcBitcoinResponseDataType = {
432
+ chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
433
+ response: unknown;
434
+ };
435
+ type WalletsRpcResponseDataType = {
436
+ address: string;
437
+ } & (WalletsRpcEthereumResponseDataType | WalletsRpcSolanaResponseDataType | WalletsRpcBitcoinResponseDataType);
252
438
  type BaseWalletCreateRequestDataType = {
253
439
  accessToken: string;
254
440
  };
@@ -273,32 +459,34 @@ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & Bas
273
459
  */
274
460
  solanaAddress?: string;
275
461
  };
276
- type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
277
- /**
278
- * If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
279
- * MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
280
- * same entropy as the Ethereum wallet.
281
- *
282
- * If no address is passed here, our iframe assumes that the user has no existing Ethereum wallet and will create
283
- * a new set of entropy for Solana.
284
- */
285
- ethereumAddress?: string;
462
+ type WalletCreateResponseDataType = {
463
+ address: string;
286
464
  };
287
465
  type WalletCreateAdditionalRequestDataType = {
288
466
  accessToken: string;
289
467
  primaryWalletAddress: string;
468
+ /**
469
+ * The HD node index at which to create a wallet. Must be >= 1 for ethereum
470
+ * and solana, must be >= 0 otherwise.
471
+ */
290
472
  hdWalletIndex: number;
291
473
  };
474
+ type WalletCreateAdditionalResponseDataType = {
475
+ address: string;
476
+ };
292
477
  type WalletImportRequestDataType = {
293
478
  accessToken: string;
294
479
  privateKey: string;
295
480
  };
296
- type WalletSetRecoveryRequestDataType = {
481
+ type WalletImportResponseDataType = {
482
+ address: string;
483
+ };
484
+ type WalletConnectRequestDataType = {
297
485
  accessToken: string;
298
486
  address: string;
299
- recoveryMethod: UserRecoveryMethod;
300
- recoveryPassword?: string;
301
- recoveryAccessToken?: string;
487
+ };
488
+ type WalletConnectResponseDataType = {
489
+ address: string;
302
490
  };
303
491
  type WalletRecoverRequestDataType = {
304
492
  address: string;
@@ -316,9 +504,18 @@ type WalletRecoverRequestDataType = {
316
504
  */
317
505
  recoveryPin?: string;
318
506
  };
319
- type WalletConnectRequestDataType = {
507
+ type WalletRecoverResponseDataType = {
508
+ address: string;
509
+ };
510
+ type WalletSetRecoveryRequestDataType = {
320
511
  accessToken: string;
321
512
  address: string;
513
+ recoveryMethod: UserRecoveryMethod;
514
+ recoveryPassword?: string;
515
+ recoveryAccessToken?: string;
516
+ };
517
+ type WalletSetRecoveryResponseDataType = {
518
+ address: string;
322
519
  };
323
520
  type WalletRpcRequestDataType = {
324
521
  accessToken: string;
@@ -330,46 +527,51 @@ type WalletRpcRequestDataType = {
330
527
  address: string;
331
528
  request: EthereumRpcRequestType;
332
529
  };
530
+ type WalletRpcResponseDataType = {
531
+ address: string;
532
+ response: EthereumRpcResponseType;
533
+ };
534
+ type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
535
+ /**
536
+ * If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
537
+ * MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
538
+ * same entropy as the Ethereum wallet.
539
+ *
540
+ * If no address is passed here, our iframe assumes that the user has no existing Ethereum wallet and will create
541
+ * a new set of entropy for Solana.
542
+ */
543
+ ethereumAddress?: string;
544
+ };
545
+ type SolanaWalletCreateResponseDataType = {
546
+ publicKey: string;
547
+ };
333
548
  type SolanaWalletConnectRequestDataType = {
334
549
  publicKey: string;
335
550
  accessToken: string;
336
551
  };
552
+ type SolanaWalletConnectResponseDataType = {
553
+ publicKey: string;
554
+ };
337
555
  type SolanaWalletRecoverRequestDataType = {
338
556
  publicKey: string;
339
557
  accessToken: string;
340
558
  };
559
+ type SolanaWalletRecoverResponseDataType = {
560
+ publicKey: string;
561
+ };
341
562
  type SolanaWalletRpcRequestDataType = {
342
563
  accessToken: string;
343
564
  publicKey: string;
344
565
  request: SolanaRpcRequestType;
345
566
  };
346
- type RootWalletForDelegation = {
347
- /** Address of the root wallet for the entropy being delegated. */
348
- address: string;
349
- /** Chain type of the root wallet for the entropy being delegated. */
350
- chainType: 'ethereum' | 'solana';
351
- /** Whether or not the root wallet for the entropy being delegated is imported. */
352
- imported: boolean;
353
- };
354
- type DelegatedWallet = {
355
- /** Address for a wallet to delegate. */
356
- address: string;
357
- /** Chain type for a wallet to delegate. */
358
- chainType: 'ethereum' | 'solana';
359
- /** HD index for the wallet to delegate. */
360
- walletIndex: number;
361
- };
362
- type DelegatedActionsConsentRequestDataType = {
363
- /** Access token for the user */
364
- accessToken: string;
365
- /** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
366
- rootWallet: RootWalletForDelegation;
367
- /** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
368
- delegatedWallets: DelegatedWallet[];
567
+ type SolanaWalletRpcResponseDataType = {
568
+ publicKey: string;
569
+ response: SolanaRpcResponseType;
369
570
  };
370
571
  type MfaVerifyRequestDataType = {
371
572
  accessToken: string;
372
573
  };
574
+ type MfaVerifyResponseDataType = Record<string, never>;
373
575
  type MfaInitEnrollmentRequestDataType = {
374
576
  accessToken: string;
375
577
  method: 'sms';
@@ -378,6 +580,11 @@ type MfaInitEnrollmentRequestDataType = {
378
580
  accessToken: string;
379
581
  method: 'totp';
380
582
  };
583
+ type MfaInitEnrollmentResponseDataType = {
584
+ method: string;
585
+ secret?: string;
586
+ authUrl?: string;
587
+ };
381
588
  type MfaSubmitEnrollmentRequestDataType = {
382
589
  accessToken: string;
383
590
  method: 'sms';
@@ -392,13 +599,16 @@ type MfaSubmitEnrollmentRequestDataType = {
392
599
  method: 'passkey';
393
600
  credentialIds: string[];
394
601
  };
602
+ type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
395
603
  type MfaUnenrollRequestDataType = {
396
604
  accessToken: string;
397
605
  method: 'sms' | 'totp';
398
606
  };
607
+ type MfaUnenrollResponseDataType = Record<string, never>;
399
608
  type MfaClearRequestDataType = {
400
609
  userId: string;
401
610
  };
611
+ type MfaClearResponseDataType = Record<string, never>;
402
612
  type FarcasterSignerInitRequestDataType = {
403
613
  address: string;
404
614
  hdWalletIndex: number | null;
@@ -407,6 +617,7 @@ type FarcasterSignerInitRequestDataType = {
407
617
  mfaMethod: string | null;
408
618
  relyingParty: string;
409
619
  };
620
+ type FarcasterSignerInitResponseDataType = PrivyFarcasterSignerInitResponse;
410
621
  type FarcasterSignRequestDataType = {
411
622
  address: string;
412
623
  hdWalletIndex: number | null;
@@ -419,72 +630,68 @@ type FarcasterSignRequestDataType = {
419
630
  };
420
631
  fid: bigint;
421
632
  };
422
- type WalletCreateResponseDataType = {
423
- address: string;
424
- };
425
- type WalletCreateAdditionalResponseDataType = {
426
- address: string;
427
- };
428
- type WalletImportResponseDataType = {
429
- address: string;
430
- };
431
- type WalletConnectResponseDataType = {
432
- address: string;
433
- };
434
- type WalletRecoverResponseDataType = {
435
- address: string;
633
+ type FarcasterSignResponseDataType = {
634
+ hash: string;
635
+ signature: string;
436
636
  };
437
- type WalletSetRecoveryResponseDataType = {
637
+ type RootWalletForDelegation = {
638
+ /** Address of the root wallet for the entropy being delegated. */
438
639
  address: string;
640
+ /** Chain type of the root wallet for the entropy being delegated. */
641
+ chainType: 'ethereum' | 'solana';
642
+ /** Whether or not the root wallet for the entropy being delegated is imported. */
643
+ imported: boolean;
439
644
  };
440
- type WalletRpcResponseDataType = {
645
+ type DelegatedWallet = {
646
+ /** Address for a wallet to delegate. */
441
647
  address: string;
442
- response: EthereumRpcResponseType;
443
- };
444
- type SolanaWalletCreateResponseDataType = {
445
- publicKey: string;
446
- };
447
- type SolanaWalletConnectResponseDataType = {
448
- publicKey: string;
449
- };
450
- type SolanaWalletRecoverResponseDataType = {
451
- publicKey: string;
648
+ /** Chain type for a wallet to delegate. */
649
+ chainType: 'ethereum' | 'solana';
650
+ /** HD index for the wallet to delegate. */
651
+ walletIndex: number;
452
652
  };
453
- type SolanaWalletRpcResponseDataType = {
454
- publicKey: string;
455
- response: SolanaRpcResponseType;
653
+ type DelegatedActionsConsentRequestDataType = {
654
+ /** Access token for the user */
655
+ accessToken: string;
656
+ /** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
657
+ rootWallet: RootWalletForDelegation;
658
+ /** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
659
+ delegatedWallets: DelegatedWallet[];
456
660
  };
457
661
  type DelegatedActionsConsentResponseDataType = {
458
662
  success: boolean;
459
663
  };
460
- type MfaVerifyResponseDataType = Record<string, never>;
461
- type MfaInitEnrollmentResponseDataType = {
462
- method: string;
463
- secret?: string;
464
- authUrl?: string;
465
- };
466
- type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
467
- type MfaUnenrollResponseDataType = Record<string, never>;
468
- type MfaClearResponseDataType = Record<string, never>;
469
- type FarcasterSignerInitResponseDataType = PrivyFarcasterSignerInitResponse;
470
- type FarcasterSignResponseDataType = {
471
- hash: string;
472
- signature: string;
473
- };
474
664
  declare const PrivyIframeErrorTypes: readonly ["error", "invalid_request_arguments", "wallet_not_on_device", "invalid_recovery_pin", "insufficient_funds", "missing_or_invalid_mfa", "mfa_verification_max_attempts_reached", "mfa_timeout", "twilio_verification_failed"];
475
665
  type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
476
666
  interface EmbeddedWalletProxy {
667
+ createWallet: (data: WalletsCreateRequestDataType) => Promise<WalletsCreateResponseDataType>;
668
+ addWallet: (data: WalletsAddRequestDataType) => Promise<WalletsAddResponseDataType>;
669
+ setRecoveryWallet: (data: WalletsSetRecoveryRequestDataType) => Promise<WalletsSetRecoveryResponseDataType>;
670
+ connectWallet: (data: WalletsConnectRequestDataType) => Promise<WalletsConnectResponseDataType>;
671
+ recoverWallet: (data: WalletsRecoverRequestDataType) => Promise<WalletsRecoverResponseDataType>;
672
+ rpcWallet(data: WalletsRpcRequestDataType): Promise<WalletsRpcResponseDataType>;
673
+ /** @deprecated */
477
674
  create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
675
+ /** @deprecated */
478
676
  createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
479
677
  import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
678
+ /** @deprecated */
480
679
  connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
680
+ /** @deprecated */
481
681
  recover: (data: WalletRecoverRequestDataType) => Promise<WalletRecoverResponseDataType>;
682
+ /** @deprecated */
482
683
  setRecovery: (data: WalletSetRecoveryRequestDataType) => Promise<WalletSetRecoveryResponseDataType>;
684
+ /** @deprecated */
483
685
  rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
686
+ /** @deprecated */
484
687
  createSolana: (data: SolanaWalletCreateRequestDataType) => Promise<SolanaWalletCreateResponseDataType>;
688
+ /** @deprecated */
485
689
  connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
690
+ /** @deprecated */
486
691
  recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
692
+ /** @deprecated */
487
693
  rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
694
+ /** @deprecated */
488
695
  createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
489
696
  verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
490
697
  initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
@@ -797,6 +1004,11 @@ declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter
797
1004
  declare const SUPPORTED_RECOVERY_PROVIDERS: readonly ["google-drive", "icloud"];
798
1005
  declare const SUPPORTED_MFA_METHODS: readonly ["sms", "totp", "passkey"];
799
1006
  type MfaMethod = (typeof SUPPORTED_MFA_METHODS)[number];
1007
+ type MfaSubmitArgs = {
1008
+ mfaMethod: MfaMethod;
1009
+ mfaCode: string | PasskeyAuthenticateInputType['authenticator_response'];
1010
+ relyingParty: string;
1011
+ };
800
1012
  /**
801
1013
  * Supported OAuth providers. Can be `'google'`, `'discord'`, `'twitter'`, `'github'`, `'spotify'`,
802
1014
  * `'instagram'`, `'tiktok'`, `'linkedin'`, or `'apple'`