@privy-io/react-auth 1.92.7 → 1.93.0

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 (37) hide show
  1. package/dist/cjs/abstract-smart-wallets.js +1 -1
  2. package/dist/cjs/{getEmbeddedConnectedWallet-DS-w3DHv.js → getEmbeddedConnectedWallet-DGCba9eL.js} +1 -1
  3. package/dist/cjs/index.js +124 -124
  4. package/dist/cjs/privy-context-Ds_CALAJ.js +1 -0
  5. package/dist/cjs/{smart-wallets-Di4AUVjR.js → smart-wallets-C-wtePWG.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-CW-_1LDw.js} +5 -5
  10. package/dist/cjs/{useSolanaWallets-CQuWnY1r.js → useSolanaWallets-DYHtxLmi.js} +1 -1
  11. package/dist/cjs/{useWallets-Br4RRclA.js → useWallets-CZUj7ALT.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-CWtzrK1j.d.mts} +1 -1
  17. package/dist/dts/{solana-BRQvrG8A.d.mts → solana-CWtzrK1j.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-fObwliWo.d.mts} +304 -81
  21. package/dist/dts/{types-fS_ewT7E.d.ts → types-fObwliWo.d.ts} +304 -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-CeIDxPC5.mjs} +1 -1
  26. package/dist/esm/index.mjs +318 -318
  27. package/dist/esm/privy-context-BeqkgOHo.mjs +1 -0
  28. package/dist/esm/{smart-wallets-C0eP6Grh.mjs → smart-wallets-vjWIsaaC.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-BLErEIDU.mjs} +18 -18
  33. package/dist/esm/{useSolanaWallets-Cn7Eb8fU.mjs → useSolanaWallets-DiqA_tT8.mjs} +1 -1
  34. package/dist/esm/{useWallets-0pQT6tND.mjs → useWallets-C0_t04LR.mjs} +1 -1
  35. package/package.json +6 -7
  36. package/dist/cjs/privy-context-6Fn5d7Hw.js +0 -1
  37. package/dist/esm/privy-context-BXjG69vB.mjs +0 -1
@@ -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-fObwliWo.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-fObwliWo.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-fObwliWo.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-fObwliWo.js';
2
+ export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-CWtzrK1j.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-fObwliWo.js';
2
+ export { a as UseFundSolanaWalletInterface, U as UseSolanaWalletsInterface, b as useFundWallet, u as useSolanaWallets } from './solana-CWtzrK1j.js';
3
3
  import '@metamask/eth-sig-util';
4
4
  import '@ethersproject/providers';
5
5
  import 'eventemitter3';
@@ -210,6 +210,7 @@ declare enum PrivyErrorCode {
210
210
  UNKNOWN_MFA_ERROR = "unknown_mfa_error",
211
211
  EMBEDDED_WALLET_ALREADY_EXISTS = "embedded_wallet_already_exists",
212
212
  EMBEDDED_WALLET_NOT_FOUND = "embedded_wallet_not_found",
213
+ EMBEDDED_WALLET_CREATE_ERROR = "embedded_wallet_create_error",
213
214
  UNKNOWN_EMBEDDED_WALLET_ERROR = "unknown_embedded_wallet_error",
214
215
  EMBEDDED_WALLET_PASSWORD_UNCONFIRMED = "embedded_wallet_password_unconfirmed",
215
216
  EMBEDDED_WALLET_PASSWORD_ALREADY_EXISTS = "embedded_wallet_password_already_exists",
@@ -249,6 +250,192 @@ declare class ProviderRpcError extends PrivyError {
249
250
  constructor(message: string, code: number, data?: unknown);
250
251
  }
251
252
 
253
+ type BaseProxyRequest = {
254
+ accessToken: string;
255
+ } & Partial<MfaSubmitArgs>;
256
+ type EntropyIdVerifier = 'ethereum-address-verifier' | 'solana-address-verifier';
257
+ type BaseWalletsRequestData = BaseProxyRequest & {
258
+ chainType: 'ethereum' | 'solana' | 'bitcoin-taproot' | 'bitcoin-segwit';
259
+ };
260
+ type WalletsCreateRequestDataType = BaseWalletsRequestData & {
261
+ /** Optional: the user-specified recovery password, replaces recoveryPin */
262
+ recoveryPassword?: string;
263
+ /** Optional: the recovery method to be used for the created wallet */
264
+ recoveryMethod?: UserRecoveryMethod;
265
+ /** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
266
+ recoveryAccessToken?: string;
267
+ /** Optional: override the recoverySecret, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
268
+ recoverySecretOverride?: string;
269
+ /** Optional: override the iCloudRecordName, only for use when we need to store recovery secrets in cloud storage outside of the iframe (eg native) */
270
+ iCloudRecordNameOverride?: string;
271
+ };
272
+ type WalletsCreateResponseDataType = {
273
+ address: string;
274
+ };
275
+ type WalletsAddRequestDataType = BaseWalletsRequestData & {
276
+ /**
277
+ * Key with which to look up the existing entropy
278
+ */
279
+ entropyId: string;
280
+ /**
281
+ * Source of the `entropyId` property. This field determines how the entropyId will
282
+ * be used. Possible values include:
283
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
284
+ * at index 0 for this entropy
285
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
286
+ * at index 0 for this entropy
287
+ *
288
+ * When this field is a wallet address, we can verify reconstitution was successful by
289
+ * deriving the specified wallet and comparing the address to the `entropyId`
290
+ */
291
+ entropyIdVerifier: EntropyIdVerifier;
292
+ /**
293
+ * The HD node index at which to create a wallet. Must be >= 1 AND equal to the next
294
+ * index in the sequence, since the primary wallet is created at index 0.
295
+ */
296
+ hdWalletIndex: number;
297
+ };
298
+ type WalletsAddResponseDataType = {
299
+ address: string;
300
+ };
301
+ type WalletsSetRecoveryBaseRequestDataType = BaseWalletsRequestData & {
302
+ /**
303
+ * Key with which to look up the existing entropy
304
+ */
305
+ entropyId: string;
306
+ /**
307
+ * Source of the `entropyId` property. This field determines how the entropyId will
308
+ * be used. Possible values include:
309
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
310
+ * at index 0 for this entropy
311
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
312
+ * at index 0 for this entropy
313
+ *
314
+ * When this field is a wallet address, we can verify reconstitution was successful by
315
+ * deriving the specified wallet and comparing the address to the `entropyId`
316
+ */
317
+ entropyIdVerifier: EntropyIdVerifier;
318
+ existingRecoveryMethod?: UserRecoveryMethod;
319
+ };
320
+ type WalletsSetRecoveryPasswordDataType = WalletsSetRecoveryBaseRequestDataType & {
321
+ recoveryMethod: 'user-passcode';
322
+ recoveryPassword: string;
323
+ };
324
+ type WalletsSetRecoveryGoogleDriveDataType = WalletsSetRecoveryBaseRequestDataType & {
325
+ recoveryMethod: 'google-drive';
326
+ recoveryAccessToken: string;
327
+ };
328
+ type WalletsSetRecoveryICloudDataType = WalletsSetRecoveryBaseRequestDataType & {
329
+ recoveryMethod: 'icloud';
330
+ recoveryAccessToken: string;
331
+ };
332
+ type WalletsSetRecoveryICloudNativeDataType = WalletsSetRecoveryBaseRequestDataType & {
333
+ recoveryMethod: 'icloud-native';
334
+ recoverySecretOverride: string;
335
+ iCloudRecordNameOverride: string;
336
+ };
337
+ type WalletsSetRecoveryRequestDataType = Omit<WalletsSetRecoveryPasswordDataType, 'chainType'> | Omit<WalletsSetRecoveryGoogleDriveDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudDataType, 'chainType'> | Omit<WalletsSetRecoveryICloudNativeDataType, 'chainType'>;
338
+ type WalletsSetRecoveryResponseDataType = {
339
+ entropyId: string;
340
+ /**
341
+ * Source of the `entropyId` property. This field determines how the entropyId will
342
+ * be used. Possible values include:
343
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
344
+ * at index 0 for this entropy
345
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
346
+ * at index 0 for this entropy
347
+ *
348
+ * When this field is a wallet address, we can verify reconstitution was successful by
349
+ * deriving the specified wallet and comparing the address to the `entropyId`
350
+ */
351
+ entropyIdVerifier: EntropyIdVerifier;
352
+ recoveryMethod: WalletsSetRecoveryRequestDataType['recoveryMethod'];
353
+ };
354
+ type WalletsConnectRequestDataType = BaseProxyRequest & {
355
+ /**
356
+ * Key with which to look up the existing entropy
357
+ */
358
+ entropyId: string;
359
+ /**
360
+ * Source of the key with which to look up the existing entropy
361
+ */
362
+ entropyIdVerifier: EntropyIdVerifier;
363
+ };
364
+ type WalletsConnectResponseDataType = {
365
+ address: string;
366
+ };
367
+ type WalletsRecoverRequestDataType = BaseProxyRequest & {
368
+ /**
369
+ * Key with which to look up the existing entropy
370
+ */
371
+ entropyId: string;
372
+ /**
373
+ * Source of the `entropyId` property. This field determines how the entropyId will
374
+ * be used. Possible values include:
375
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
376
+ * at index 0 for this entropy
377
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
378
+ * at index 0 for this entropy
379
+ *
380
+ * When this field is a wallet address, we can verify reconstitution was successful by
381
+ * deriving the specified wallet and comparing the address to the `entropyId`
382
+ */
383
+ entropyIdVerifier: EntropyIdVerifier;
384
+ /** Optional: the user-specified recovery password, replaces recoveryPin */
385
+ recoveryPassword?: string;
386
+ /** Optional: in the case of cloud recovery, the access token to be used to communicated with the cloud provider (eg Google) */
387
+ recoveryAccessToken?: string;
388
+ /** Optional: override the recoverySecret, only for use when we need to retrieve recovery secrets in cloud storage outside of the iframe (eg native) */
389
+ recoverySecretOverride?: string;
390
+ };
391
+ type WalletsRecoverResponseDataType = {
392
+ entropyId: string;
393
+ };
394
+ type WalletsRpcEthereumRequestDataType = {
395
+ chainType: 'ethereum';
396
+ request: EthereumRpcRequestType;
397
+ };
398
+ type WalletsRpcSolanaRequestDataType = {
399
+ chainType: 'solana';
400
+ request: SolanaRpcRequestType;
401
+ };
402
+ type WalletsRpcBitcoinRequestDataType = {
403
+ chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
404
+ request: unknown;
405
+ };
406
+ type WalletsRpcRequestDataType = BaseWalletsRequestData & {
407
+ /**
408
+ * Key with which to look up the existing entropy
409
+ */
410
+ entropyId: string;
411
+ /**
412
+ * Source of the `entropyId` property. This field determines how the entropyId will
413
+ * be used. Possible values include:
414
+ * - ethereum-address-verifier: the entropyId is the address of the Ethereum wallet derived
415
+ * at index 0 for this entropy
416
+ * - solana-address-verifier: the entropyId is a the address of the Solana wallet derived
417
+ * at index 0 for this entropy
418
+ *
419
+ * When this field is a wallet address, we can verify reconstitution was successful by
420
+ * deriving the specified wallet and comparing the address to the `entropyId`
421
+ */
422
+ entropyIdVerifier: EntropyIdVerifier;
423
+ } & (WalletsRpcEthereumRequestDataType | WalletsRpcSolanaRequestDataType | WalletsRpcBitcoinRequestDataType);
424
+ type WalletsRpcEthereumResponseDataType = {
425
+ chainType: 'ethereum';
426
+ response: EthereumRpcResponseType;
427
+ };
428
+ type WalletsRpcSolanaResponseDataType = {
429
+ chainType: 'solana';
430
+ response: SolanaRpcResponseType;
431
+ };
432
+ type WalletsRpcBitcoinResponseDataType = {
433
+ chainType: 'bitcoin-taproot' | 'bitcoin-segwit';
434
+ response: unknown;
435
+ };
436
+ type WalletsRpcResponseDataType = {
437
+ address: string;
438
+ } & (WalletsRpcEthereumResponseDataType | WalletsRpcSolanaResponseDataType | WalletsRpcBitcoinResponseDataType);
252
439
  type BaseWalletCreateRequestDataType = {
253
440
  accessToken: string;
254
441
  };
@@ -273,32 +460,34 @@ type EthereumWalletCreateRequestDataType = BaseWalletCreateRequestDataType & Bas
273
460
  */
274
461
  solanaAddress?: string;
275
462
  };
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;
463
+ type WalletCreateResponseDataType = {
464
+ address: string;
286
465
  };
287
466
  type WalletCreateAdditionalRequestDataType = {
288
467
  accessToken: string;
289
468
  primaryWalletAddress: string;
469
+ /**
470
+ * The HD node index at which to create a wallet. Must be >= 1 for ethereum
471
+ * and solana, must be >= 0 otherwise.
472
+ */
290
473
  hdWalletIndex: number;
291
474
  };
475
+ type WalletCreateAdditionalResponseDataType = {
476
+ address: string;
477
+ };
292
478
  type WalletImportRequestDataType = {
293
479
  accessToken: string;
294
480
  privateKey: string;
295
481
  };
296
- type WalletSetRecoveryRequestDataType = {
482
+ type WalletImportResponseDataType = {
483
+ address: string;
484
+ };
485
+ type WalletConnectRequestDataType = {
297
486
  accessToken: string;
298
487
  address: string;
299
- recoveryMethod: UserRecoveryMethod;
300
- recoveryPassword?: string;
301
- recoveryAccessToken?: string;
488
+ };
489
+ type WalletConnectResponseDataType = {
490
+ address: string;
302
491
  };
303
492
  type WalletRecoverRequestDataType = {
304
493
  address: string;
@@ -316,9 +505,18 @@ type WalletRecoverRequestDataType = {
316
505
  */
317
506
  recoveryPin?: string;
318
507
  };
319
- type WalletConnectRequestDataType = {
508
+ type WalletRecoverResponseDataType = {
509
+ address: string;
510
+ };
511
+ type WalletSetRecoveryRequestDataType = {
320
512
  accessToken: string;
321
513
  address: string;
514
+ recoveryMethod: UserRecoveryMethod;
515
+ recoveryPassword?: string;
516
+ recoveryAccessToken?: string;
517
+ };
518
+ type WalletSetRecoveryResponseDataType = {
519
+ address: string;
322
520
  };
323
521
  type WalletRpcRequestDataType = {
324
522
  accessToken: string;
@@ -330,46 +528,51 @@ type WalletRpcRequestDataType = {
330
528
  address: string;
331
529
  request: EthereumRpcRequestType;
332
530
  };
531
+ type WalletRpcResponseDataType = {
532
+ address: string;
533
+ response: EthereumRpcResponseType;
534
+ };
535
+ type SolanaWalletCreateRequestDataType = BaseWalletCreateRequestDataType & {
536
+ /**
537
+ * If a user has an existing Ethereum embedded wallet when creating the Solana embedded wallet, that address
538
+ * MUST be passed in this field. Our iframe will use this address to derive the Solana embedded wallet from the
539
+ * same entropy as the Ethereum wallet.
540
+ *
541
+ * If no address is passed here, our iframe assumes that the user has no existing Ethereum wallet and will create
542
+ * a new set of entropy for Solana.
543
+ */
544
+ ethereumAddress?: string;
545
+ };
546
+ type SolanaWalletCreateResponseDataType = {
547
+ publicKey: string;
548
+ };
333
549
  type SolanaWalletConnectRequestDataType = {
334
550
  publicKey: string;
335
551
  accessToken: string;
336
552
  };
553
+ type SolanaWalletConnectResponseDataType = {
554
+ publicKey: string;
555
+ };
337
556
  type SolanaWalletRecoverRequestDataType = {
338
557
  publicKey: string;
339
558
  accessToken: string;
340
559
  };
560
+ type SolanaWalletRecoverResponseDataType = {
561
+ publicKey: string;
562
+ };
341
563
  type SolanaWalletRpcRequestDataType = {
342
564
  accessToken: string;
343
565
  publicKey: string;
344
566
  request: SolanaRpcRequestType;
345
567
  };
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[];
568
+ type SolanaWalletRpcResponseDataType = {
569
+ publicKey: string;
570
+ response: SolanaRpcResponseType;
369
571
  };
370
572
  type MfaVerifyRequestDataType = {
371
573
  accessToken: string;
372
574
  };
575
+ type MfaVerifyResponseDataType = Record<string, never>;
373
576
  type MfaInitEnrollmentRequestDataType = {
374
577
  accessToken: string;
375
578
  method: 'sms';
@@ -378,6 +581,11 @@ type MfaInitEnrollmentRequestDataType = {
378
581
  accessToken: string;
379
582
  method: 'totp';
380
583
  };
584
+ type MfaInitEnrollmentResponseDataType = {
585
+ method: string;
586
+ secret?: string;
587
+ authUrl?: string;
588
+ };
381
589
  type MfaSubmitEnrollmentRequestDataType = {
382
590
  accessToken: string;
383
591
  method: 'sms';
@@ -392,13 +600,16 @@ type MfaSubmitEnrollmentRequestDataType = {
392
600
  method: 'passkey';
393
601
  credentialIds: string[];
394
602
  };
603
+ type MfaSubmitEnrollmentResponseDataType = Record<string, never>;
395
604
  type MfaUnenrollRequestDataType = {
396
605
  accessToken: string;
397
606
  method: 'sms' | 'totp';
398
607
  };
608
+ type MfaUnenrollResponseDataType = Record<string, never>;
399
609
  type MfaClearRequestDataType = {
400
610
  userId: string;
401
611
  };
612
+ type MfaClearResponseDataType = Record<string, never>;
402
613
  type FarcasterSignerInitRequestDataType = {
403
614
  address: string;
404
615
  hdWalletIndex: number | null;
@@ -407,6 +618,7 @@ type FarcasterSignerInitRequestDataType = {
407
618
  mfaMethod: string | null;
408
619
  relyingParty: string;
409
620
  };
621
+ type FarcasterSignerInitResponseDataType = PrivyFarcasterSignerInitResponse;
410
622
  type FarcasterSignRequestDataType = {
411
623
  address: string;
412
624
  hdWalletIndex: number | null;
@@ -419,72 +631,68 @@ type FarcasterSignRequestDataType = {
419
631
  };
420
632
  fid: bigint;
421
633
  };
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;
634
+ type FarcasterSignResponseDataType = {
635
+ hash: string;
636
+ signature: string;
436
637
  };
437
- type WalletSetRecoveryResponseDataType = {
638
+ type RootWalletForDelegation = {
639
+ /** Address of the root wallet for the entropy being delegated. */
438
640
  address: string;
641
+ /** Chain type of the root wallet for the entropy being delegated. */
642
+ chainType: 'ethereum' | 'solana';
643
+ /** Whether or not the root wallet for the entropy being delegated is imported. */
644
+ imported: boolean;
439
645
  };
440
- type WalletRpcResponseDataType = {
646
+ type DelegatedWallet = {
647
+ /** Address for a wallet to delegate. */
441
648
  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;
649
+ /** Chain type for a wallet to delegate. */
650
+ chainType: 'ethereum' | 'solana';
651
+ /** HD index for the wallet to delegate. */
652
+ walletIndex: number;
452
653
  };
453
- type SolanaWalletRpcResponseDataType = {
454
- publicKey: string;
455
- response: SolanaRpcResponseType;
654
+ type DelegatedActionsConsentRequestDataType = {
655
+ /** Access token for the user */
656
+ accessToken: string;
657
+ /** Root wallet to delegate, which is the wallet at HD index 0 for the entropy. */
658
+ rootWallet: RootWalletForDelegation;
659
+ /** Wallets to delegate, whose entropy is the same as `rootWallet`'s. */
660
+ delegatedWallets: DelegatedWallet[];
456
661
  };
457
662
  type DelegatedActionsConsentResponseDataType = {
458
663
  success: boolean;
459
664
  };
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
665
  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
666
  type PrivyIframeErrorTypesType = (typeof PrivyIframeErrorTypes)[number];
476
667
  interface EmbeddedWalletProxy {
668
+ createWallet: (data: WalletsCreateRequestDataType) => Promise<WalletsCreateResponseDataType>;
669
+ addWallet: (data: WalletsAddRequestDataType) => Promise<WalletsAddResponseDataType>;
670
+ setRecoveryWallet: (data: WalletsSetRecoveryRequestDataType) => Promise<WalletsSetRecoveryResponseDataType>;
671
+ connectWallet: (data: WalletsConnectRequestDataType) => Promise<WalletsConnectResponseDataType>;
672
+ recoverWallet: (data: WalletsRecoverRequestDataType) => Promise<WalletsRecoverResponseDataType>;
673
+ rpcWallet(data: WalletsRpcRequestDataType): Promise<WalletsRpcResponseDataType>;
674
+ /** @deprecated */
477
675
  create: (data: EthereumWalletCreateRequestDataType) => Promise<WalletCreateResponseDataType>;
676
+ /** @deprecated */
478
677
  createAdditional: (data: WalletCreateAdditionalRequestDataType) => Promise<WalletCreateAdditionalResponseDataType>;
479
678
  import: (data: WalletImportRequestDataType) => Promise<WalletImportResponseDataType>;
679
+ /** @deprecated */
480
680
  connect: (data: WalletConnectRequestDataType) => Promise<WalletConnectResponseDataType>;
681
+ /** @deprecated */
481
682
  recover: (data: WalletRecoverRequestDataType) => Promise<WalletRecoverResponseDataType>;
683
+ /** @deprecated */
482
684
  setRecovery: (data: WalletSetRecoveryRequestDataType) => Promise<WalletSetRecoveryResponseDataType>;
685
+ /** @deprecated */
483
686
  rpc: (data: WalletRpcRequestDataType) => Promise<WalletRpcResponseDataType>;
687
+ /** @deprecated */
484
688
  createSolana: (data: SolanaWalletCreateRequestDataType) => Promise<SolanaWalletCreateResponseDataType>;
689
+ /** @deprecated */
485
690
  connectSolana: (data: SolanaWalletConnectRequestDataType) => Promise<SolanaWalletConnectResponseDataType>;
691
+ /** @deprecated */
486
692
  recoverSolana: (data: SolanaWalletRecoverRequestDataType) => Promise<SolanaWalletRecoverResponseDataType>;
693
+ /** @deprecated */
487
694
  rpcSolana: (data: SolanaWalletRpcRequestDataType) => Promise<SolanaWalletRpcResponseDataType>;
695
+ /** @deprecated */
488
696
  createDelegatedAction: (data: DelegatedActionsConsentRequestDataType) => Promise<DelegatedActionsConsentResponseDataType>;
489
697
  verifyMfa: (data: MfaVerifyRequestDataType) => Promise<MfaVerifyResponseDataType>;
490
698
  initEnrollMfa: (data: MfaInitEnrollmentRequestDataType) => Promise<MfaInitEnrollmentResponseDataType>;
@@ -797,6 +1005,11 @@ declare const SUPPORTED_OAUTH_PROVIDERS: readonly ["google", "discord", "twitter
797
1005
  declare const SUPPORTED_RECOVERY_PROVIDERS: readonly ["google-drive", "icloud"];
798
1006
  declare const SUPPORTED_MFA_METHODS: readonly ["sms", "totp", "passkey"];
799
1007
  type MfaMethod = (typeof SUPPORTED_MFA_METHODS)[number];
1008
+ type MfaSubmitArgs = {
1009
+ mfaMethod: MfaMethod;
1010
+ mfaCode: string | PasskeyAuthenticateInputType['authenticator_response'];
1011
+ relyingParty: string;
1012
+ };
800
1013
  /**
801
1014
  * Supported OAuth providers. Can be `'google'`, `'discord'`, `'twitter'`, `'github'`, `'spotify'`,
802
1015
  * `'instagram'`, `'tiktok'`, `'linkedin'`, or `'apple'`
@@ -2246,6 +2459,16 @@ type CreateWalletOptions = {
2246
2459
  * Defaults to `false`.
2247
2460
  */
2248
2461
  createAdditional?: boolean;
2462
+ } | {
2463
+ /**
2464
+ * Specify the hierarchical deterministic (HD) index of the embedded wallet to create.
2465
+ * **A wallet with HD index 0 must be created before creating a wallet at greater HD indices.**
2466
+ * If a value < 0 is passed in, `createWallet` will throw an error.
2467
+ * If a value > 1 is passed in, and the user does not have a primary wallet (HD index == 0),
2468
+ * `createWallet` will throw an error.
2469
+ *
2470
+ */
2471
+ walletIndex: number;
2249
2472
  };
2250
2473
  type SetWalletRecoveryOptions = {};
2251
2474
  type CustomAuthFlowState = {