@privy-io/api-types 0.8.0 → 0.10.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 (167) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/client.d.mts +35 -32
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +35 -32
  5. package/client.d.ts.map +1 -1
  6. package/client.js +22 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +22 -8
  9. package/client.mjs.map +1 -1
  10. package/internal/types.d.mts +6 -6
  11. package/internal/types.d.mts.map +1 -1
  12. package/internal/types.d.ts +6 -6
  13. package/internal/types.d.ts.map +1 -1
  14. package/internal/utils/env.js +2 -2
  15. package/internal/utils/env.js.map +1 -1
  16. package/internal/utils/env.mjs +2 -2
  17. package/internal/utils/env.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/accounts.d.mts +128 -86
  20. package/resources/accounts.d.mts.map +1 -1
  21. package/resources/accounts.d.ts +128 -86
  22. package/resources/accounts.d.ts.map +1 -1
  23. package/resources/aggregations.d.mts +43 -43
  24. package/resources/aggregations.d.mts.map +1 -1
  25. package/resources/aggregations.d.ts +43 -43
  26. package/resources/aggregations.d.ts.map +1 -1
  27. package/resources/apps.d.mts +177 -129
  28. package/resources/apps.d.mts.map +1 -1
  29. package/resources/apps.d.ts +177 -129
  30. package/resources/apps.d.ts.map +1 -1
  31. package/resources/client-auth.d.mts +650 -648
  32. package/resources/client-auth.d.mts.map +1 -1
  33. package/resources/client-auth.d.ts +650 -648
  34. package/resources/client-auth.d.ts.map +1 -1
  35. package/resources/embedded-wallets.d.mts +84 -84
  36. package/resources/embedded-wallets.d.mts.map +1 -1
  37. package/resources/embedded-wallets.d.ts +84 -84
  38. package/resources/embedded-wallets.d.ts.map +1 -1
  39. package/resources/funding.d.mts +42 -42
  40. package/resources/funding.d.mts.map +1 -1
  41. package/resources/funding.d.ts +42 -42
  42. package/resources/funding.d.ts.map +1 -1
  43. package/resources/index.d.mts +19 -18
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +19 -18
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +2 -1
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/intents.d.mts +270 -266
  52. package/resources/intents.d.mts.map +1 -1
  53. package/resources/intents.d.ts +270 -266
  54. package/resources/intents.d.ts.map +1 -1
  55. package/resources/key-quorums.d.mts +20 -20
  56. package/resources/key-quorums.d.mts.map +1 -1
  57. package/resources/key-quorums.d.ts +20 -20
  58. package/resources/key-quorums.d.ts.map +1 -1
  59. package/resources/kraken-embed.d.mts +62 -19
  60. package/resources/kraken-embed.d.mts.map +1 -1
  61. package/resources/kraken-embed.d.ts +62 -19
  62. package/resources/kraken-embed.d.ts.map +1 -1
  63. package/resources/organizations.d.mts +65 -0
  64. package/resources/organizations.d.mts.map +1 -0
  65. package/resources/organizations.d.ts +65 -0
  66. package/resources/organizations.d.ts.map +1 -0
  67. package/resources/organizations.js +9 -0
  68. package/resources/organizations.js.map +1 -0
  69. package/resources/organizations.mjs +5 -0
  70. package/resources/organizations.mjs.map +1 -0
  71. package/resources/policies.d.mts +360 -231
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +360 -231
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/shared.d.mts +28 -28
  76. package/resources/shared.d.mts.map +1 -1
  77. package/resources/shared.d.ts +28 -28
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/swaps.d.mts +8 -11
  80. package/resources/swaps.d.mts.map +1 -1
  81. package/resources/swaps.d.ts +8 -11
  82. package/resources/swaps.d.ts.map +1 -1
  83. package/resources/swaps.js.map +1 -1
  84. package/resources/swaps.mjs.map +1 -1
  85. package/resources/transactions.d.mts +56 -66
  86. package/resources/transactions.d.mts.map +1 -1
  87. package/resources/transactions.d.ts +56 -66
  88. package/resources/transactions.d.ts.map +1 -1
  89. package/resources/users.d.mts +457 -448
  90. package/resources/users.d.mts.map +1 -1
  91. package/resources/users.d.ts +457 -448
  92. package/resources/users.d.ts.map +1 -1
  93. package/resources/wallet-actions.d.mts +450 -41
  94. package/resources/wallet-actions.d.mts.map +1 -1
  95. package/resources/wallet-actions.d.ts +450 -41
  96. package/resources/wallet-actions.d.ts.map +1 -1
  97. package/resources/wallets/balance.d.mts +2 -1
  98. package/resources/wallets/balance.d.mts.map +1 -1
  99. package/resources/wallets/balance.d.ts +2 -1
  100. package/resources/wallets/balance.d.ts.map +1 -1
  101. package/resources/wallets/balance.js.map +1 -1
  102. package/resources/wallets/balance.mjs.map +1 -1
  103. package/resources/wallets/index.d.mts +1 -1
  104. package/resources/wallets/index.d.mts.map +1 -1
  105. package/resources/wallets/index.d.ts +1 -1
  106. package/resources/wallets/index.d.ts.map +1 -1
  107. package/resources/wallets/index.js.map +1 -1
  108. package/resources/wallets/index.mjs.map +1 -1
  109. package/resources/wallets/transactions.d.mts +16 -31
  110. package/resources/wallets/transactions.d.mts.map +1 -1
  111. package/resources/wallets/transactions.d.ts +16 -31
  112. package/resources/wallets/transactions.d.ts.map +1 -1
  113. package/resources/wallets/transactions.js +1 -1
  114. package/resources/wallets/transactions.js.map +1 -1
  115. package/resources/wallets/transactions.mjs +1 -1
  116. package/resources/wallets/transactions.mjs.map +1 -1
  117. package/resources/wallets/wallets.d.mts +1475 -1172
  118. package/resources/wallets/wallets.d.mts.map +1 -1
  119. package/resources/wallets/wallets.d.ts +1475 -1172
  120. package/resources/wallets/wallets.d.ts.map +1 -1
  121. package/resources/wallets/wallets.js +10 -6
  122. package/resources/wallets/wallets.js.map +1 -1
  123. package/resources/wallets/wallets.mjs +10 -6
  124. package/resources/wallets/wallets.mjs.map +1 -1
  125. package/resources/webhooks.d.mts +1345 -582
  126. package/resources/webhooks.d.mts.map +1 -1
  127. package/resources/webhooks.d.ts +1345 -582
  128. package/resources/webhooks.d.ts.map +1 -1
  129. package/resources/yield.d.mts +157 -157
  130. package/resources/yield.d.mts.map +1 -1
  131. package/resources/yield.d.ts +157 -157
  132. package/resources/yield.d.ts.map +1 -1
  133. package/src/client.ts +661 -455
  134. package/src/internal/types.ts +6 -8
  135. package/src/internal/utils/env.ts +2 -2
  136. package/src/resources/accounts.ts +157 -103
  137. package/src/resources/aggregations.ts +55 -55
  138. package/src/resources/apps.ts +232 -166
  139. package/src/resources/client-auth.ts +890 -890
  140. package/src/resources/embedded-wallets.ts +123 -123
  141. package/src/resources/funding.ts +66 -66
  142. package/src/resources/index.ts +521 -431
  143. package/src/resources/intents.ts +326 -322
  144. package/src/resources/key-quorums.ts +23 -23
  145. package/src/resources/kraken-embed.ts +116 -19
  146. package/src/resources/organizations.ts +82 -0
  147. package/src/resources/policies.ts +495 -339
  148. package/src/resources/shared.ts +34 -34
  149. package/src/resources/swaps.ts +9 -14
  150. package/src/resources/transactions.ts +88 -115
  151. package/src/resources/users.ts +664 -653
  152. package/src/resources/wallet-actions.ts +585 -56
  153. package/src/resources/wallets/balance.ts +2 -1
  154. package/src/resources/wallets/index.ts +158 -138
  155. package/src/resources/wallets/transactions.ts +20 -83
  156. package/src/resources/wallets/wallets.ts +1997 -1563
  157. package/src/resources/webhooks.ts +1652 -700
  158. package/src/resources/yield.ts +188 -188
  159. package/src/version.ts +1 -1
  160. package/version.d.mts +1 -1
  161. package/version.d.mts.map +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.d.ts.map +1 -1
  164. package/version.js +1 -1
  165. package/version.js.map +1 -1
  166. package/version.mjs +1 -1
  167. package/version.mjs.map +1 -1
@@ -237,176 +237,89 @@ export declare class Users extends APIResource {
237
237
  }
238
238
  export type UsersCursor = Cursor<User>;
239
239
  /**
240
- * An email account linked to the user.
241
- */
242
- export interface LinkedAccountEmail {
243
- address: string;
244
- first_verified_at: number | null;
245
- latest_verified_at: number | null;
246
- type: 'email';
247
- verified_at: number;
248
- }
249
- /**
250
- * A phone number account linked to the user.
240
+ * The authenticated user.
251
241
  */
252
- export interface LinkedAccountPhone {
253
- first_verified_at: number | null;
254
- latest_verified_at: number | null;
255
- phoneNumber: string;
256
- type: 'phone';
257
- verified_at: number;
258
- number?: string;
242
+ export interface AuthenticatedUser {
243
+ token: string | null;
244
+ privy_access_token: string | null;
245
+ refresh_token: string | null;
246
+ /**
247
+ * Instructs the client on how to handle tokens received
248
+ */
249
+ session_update_action: 'set' | 'ignore' | 'clear';
250
+ /**
251
+ * A Privy user object.
252
+ */
253
+ user: User;
254
+ identity_token?: string;
255
+ is_new_user?: boolean;
256
+ /**
257
+ * OAuth tokens associated with the user.
258
+ */
259
+ oauth_tokens?: OAuthTokens;
259
260
  }
260
261
  /**
261
- * Base schema for wallet accounts linked to the user.
262
+ * An embedded wallet associated with a cross-app account.
262
263
  */
263
- export interface LinkedAccountBaseWallet {
264
+ export interface CrossAppEmbeddedWallet {
264
265
  address: string;
265
- chain_type: 'solana' | 'ethereum';
266
- type: 'wallet' | 'smart_wallet';
267
266
  }
268
267
  /**
269
- * An Ethereum wallet account linked to the user.
268
+ * A smart wallet associated with a cross-app account.
270
269
  */
271
- export interface LinkedAccountEthereum {
270
+ export interface CrossAppSmartWallet {
272
271
  address: string;
273
- chain_type: 'ethereum';
274
- first_verified_at: number | null;
275
- latest_verified_at: number | null;
276
- type: 'wallet';
277
- verified_at: number;
278
- wallet_client: 'unknown';
279
- chain_id?: string;
280
- connector_type?: string;
281
- wallet_client_type?: string;
282
272
  }
283
273
  /**
284
- * A smart wallet account linked to the user.
274
+ * Custom metadata associated with the user.
285
275
  */
286
- export interface LinkedAccountSmartWallet {
287
- address: string;
288
- first_verified_at: number | null;
289
- latest_verified_at: number | null;
290
- /**
291
- * The supported smart wallet providers.
292
- */
293
- smart_wallet_type: EmbeddedWalletsAPI.SmartWalletType;
294
- type: 'smart_wallet';
295
- verified_at: number;
296
- smart_wallet_version?: string;
297
- }
276
+ export type CustomMetadata = {
277
+ [key: string]: string | number | boolean;
278
+ };
298
279
  /**
299
- * A Solana wallet account linked to the user.
280
+ * The method used to recover an embedded wallet account.
300
281
  */
301
- export interface LinkedAccountSolana {
302
- address: string;
303
- chain_type: 'solana';
304
- first_verified_at: number | null;
305
- latest_verified_at: number | null;
306
- type: 'wallet';
307
- verified_at: number;
308
- wallet_client: 'unknown';
309
- connector_type?: string;
310
- wallet_client_type?: string;
311
- }
282
+ export type EmbeddedWalletRecoveryMethod = 'privy' | 'user-passcode' | 'google-drive' | 'icloud' | 'recovery-encryption-key' | 'privy-v2';
312
283
  /**
313
- * A Farcaster account linked to the user.
284
+ * A linked account for the user.
314
285
  */
315
- export interface LinkedAccountFarcaster {
316
- fid: number;
317
- first_verified_at: number | null;
318
- latest_verified_at: number | null;
319
- owner_address: string;
320
- type: 'farcaster';
321
- verified_at: number;
322
- bio?: string;
323
- display_name?: string;
324
- homepage_url?: string;
325
- profile_picture?: string;
326
- profile_picture_url?: string;
327
- signer_public_key?: string;
328
- username?: string;
329
- }
286
+ export type LinkedAccount = LinkedAccountEmail | LinkedAccountPhone | LinkedAccountEthereum | LinkedAccountSolana | LinkedAccountSmartWallet | LinkedAccountEthereumEmbeddedWallet | LinkedAccountSolanaEmbeddedWallet | LinkedAccountBitcoinSegwitEmbeddedWallet | LinkedAccountBitcoinTaprootEmbeddedWallet | LinkedAccountCurveSigningEmbeddedWallet | LinkedAccountGoogleOAuth | LinkedAccountTwitterOAuth | LinkedAccountDiscordOAuth | LinkedAccountGitHubOAuth | LinkedAccountSpotifyOAuth | LinkedAccountInstagramOAuth | LinkedAccountTiktokOAuth | LinkedAccountLineOAuth | LinkedAccountTwitchOAuth | LinkedAccountLinkedInOAuth | LinkedAccountAppleOAuth | LinkedAccountCustomOAuth | LinkedAccountCustomJwt | LinkedAccountFarcaster | LinkedAccountPasskey | LinkedAccountTelegram | LinkedAccountCrossApp | LinkedAccountAuthorizationKey;
330
287
  /**
331
- * A passkey account linked to the user.
288
+ * The payload for importing an Apple account.
332
289
  */
333
- export interface LinkedAccountPasskey {
334
- credential_id: string;
335
- enrolled_in_mfa: boolean;
336
- first_verified_at: number | null;
337
- latest_verified_at: number | null;
338
- type: 'passkey';
339
- verified_at: number;
340
- authenticator_name?: string;
341
- created_with_browser?: string;
342
- created_with_device?: string;
343
- created_with_os?: string;
344
- public_key?: string;
290
+ export interface LinkedAccountAppleInput {
291
+ subject: string;
292
+ type: 'apple_oauth';
293
+ email?: string;
345
294
  }
346
295
  /**
347
- * A Telegram account linked to the user.
296
+ * An Apple OAuth account linked to the user.
348
297
  */
349
- export interface LinkedAccountTelegram {
298
+ export interface LinkedAccountAppleOAuth {
299
+ email: string | null;
350
300
  first_verified_at: number | null;
351
301
  latest_verified_at: number | null;
352
- telegram_user_id: string;
353
- type: 'telegram';
302
+ subject: string;
303
+ type: 'apple_oauth';
354
304
  verified_at: number;
355
- first_name?: string | null;
356
- last_name?: string | null;
357
- photo_url?: string | null;
358
- username?: string | null;
359
305
  }
360
306
  /**
361
- * The method used to recover an embedded wallet account.
362
- */
363
- export type EmbeddedWalletRecoveryMethod = 'privy' | 'user-passcode' | 'google-drive' | 'icloud' | 'recovery-encryption-key' | 'privy-v2';
364
- /**
365
- * An Ethereum embedded wallet account linked to the user.
307
+ * An authorization key linked to the user.
366
308
  */
367
- export interface LinkedAccountEthereumEmbeddedWallet {
368
- id: string | null;
369
- address: string;
370
- chain_id: string;
371
- chain_type: 'ethereum';
372
- connector_type: 'embedded';
373
- delegated: boolean;
309
+ export interface LinkedAccountAuthorizationKey {
374
310
  first_verified_at: number | null;
375
- imported: boolean;
376
311
  latest_verified_at: number | null;
377
- /**
378
- * The method used to recover an embedded wallet account.
379
- */
380
- recovery_method: EmbeddedWalletRecoveryMethod;
381
- type: 'wallet';
312
+ public_key: string;
313
+ type: 'authorization_key';
382
314
  verified_at: number;
383
- wallet_client: 'privy';
384
- wallet_client_type: 'privy';
385
- wallet_index: number;
386
315
  }
387
316
  /**
388
- * A Solana embedded wallet account linked to the user.
317
+ * Base schema for wallet accounts linked to the user.
389
318
  */
390
- export interface LinkedAccountSolanaEmbeddedWallet {
391
- id: string | null;
319
+ export interface LinkedAccountBaseWallet {
392
320
  address: string;
393
- chain_id: string;
394
- chain_type: 'solana';
395
- connector_type: 'embedded';
396
- delegated: boolean;
397
- first_verified_at: number | null;
398
- imported: boolean;
399
- latest_verified_at: number | null;
400
- public_key: string;
401
- /**
402
- * The method used to recover an embedded wallet account.
403
- */
404
- recovery_method: EmbeddedWalletRecoveryMethod;
405
- type: 'wallet';
406
- verified_at: number;
407
- wallet_client: 'privy';
408
- wallet_client_type: 'privy';
409
- wallet_index: number;
321
+ chain_type: 'solana' | 'ethereum';
322
+ type: 'wallet' | 'smart_wallet';
410
323
  }
411
324
  /**
412
325
  * A Bitcoin SegWit embedded wallet account linked to the user.
@@ -456,6 +369,19 @@ export interface LinkedAccountBitcoinTaprootEmbeddedWallet {
456
369
  wallet_client_type: 'privy';
457
370
  wallet_index: number;
458
371
  }
372
+ /**
373
+ * A cross-app account linked to the user.
374
+ */
375
+ export interface LinkedAccountCrossApp {
376
+ embedded_wallets: Array<CrossAppEmbeddedWallet>;
377
+ first_verified_at: number | null;
378
+ latest_verified_at: number | null;
379
+ provider_app_id: string;
380
+ smart_wallets: Array<CrossAppSmartWallet>;
381
+ subject: string;
382
+ type: 'cross_app';
383
+ verified_at: number;
384
+ }
459
385
  /**
460
386
  * A curve signing embedded wallet account linked to the user.
461
387
  */
@@ -483,72 +409,49 @@ export interface LinkedAccountCurveSigningEmbeddedWallet {
483
409
  wallet_client_type: 'privy';
484
410
  wallet_index: number;
485
411
  }
486
- export type LinkedAccountEmbeddedWallet = LinkedAccountEthereumEmbeddedWallet | LinkedAccountSolanaEmbeddedWallet | LinkedAccountBitcoinSegwitEmbeddedWallet | LinkedAccountBitcoinTaprootEmbeddedWallet | LinkedAccountCurveSigningEmbeddedWallet;
487
412
  /**
488
- * An embedded wallet account with an ID.
413
+ * The payload for importing a Custom JWT account.
489
414
  */
490
- export type LinkedAccountEmbeddedWalletWithID = LinkedAccountEmbeddedWalletWithID.LinkedAccountEthereumEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountSolanaEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinSegwitEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinTaprootEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountCurveSigningEmbeddedWallet;
491
- export declare namespace LinkedAccountEmbeddedWalletWithID {
492
- /**
493
- * An Ethereum embedded wallet account linked to the user.
494
- */
495
- interface LinkedAccountEthereumEmbeddedWallet extends Omit<UsersAPI.LinkedAccountEthereumEmbeddedWallet, 'id' | 'recovery_method'> {
496
- id: string;
497
- recovery_method: 'privy-v2';
498
- }
499
- /**
500
- * A Solana embedded wallet account linked to the user.
501
- */
502
- interface LinkedAccountSolanaEmbeddedWallet extends Omit<UsersAPI.LinkedAccountSolanaEmbeddedWallet, 'id' | 'recovery_method'> {
503
- id: string;
504
- recovery_method: 'privy-v2';
505
- }
506
- /**
507
- * A Bitcoin SegWit embedded wallet account linked to the user.
508
- */
509
- interface LinkedAccountBitcoinSegwitEmbeddedWallet extends Omit<UsersAPI.LinkedAccountBitcoinSegwitEmbeddedWallet, 'id' | 'recovery_method'> {
510
- id: string;
511
- recovery_method: 'privy-v2';
512
- }
513
- /**
514
- * A Bitcoin Taproot embedded wallet account linked to the user.
515
- */
516
- interface LinkedAccountBitcoinTaprootEmbeddedWallet extends Omit<UsersAPI.LinkedAccountBitcoinTaprootEmbeddedWallet, 'id' | 'recovery_method'> {
517
- id: string;
518
- recovery_method: 'privy-v2';
519
- }
520
- /**
521
- * A curve signing embedded wallet account linked to the user.
522
- */
523
- interface LinkedAccountCurveSigningEmbeddedWallet extends Omit<UsersAPI.LinkedAccountCurveSigningEmbeddedWallet, 'id' | 'recovery_method'> {
524
- id: string;
525
- recovery_method: 'privy-v2';
526
- }
415
+ export interface LinkedAccountCustomJwtInput {
416
+ custom_user_id: string;
417
+ type: 'custom_auth';
527
418
  }
528
419
  /**
529
- * A Google OAuth account linked to the user.
420
+ * A custom JWT account linked to the user.
530
421
  */
531
- export interface LinkedAccountGoogleOAuth {
532
- email: string;
422
+ export interface LinkedAccountCustomJwt {
423
+ custom_user_id: string;
533
424
  first_verified_at: number | null;
534
425
  latest_verified_at: number | null;
535
- name: string | null;
536
- subject: string;
537
- type: 'google_oauth';
426
+ type: 'custom_auth';
538
427
  verified_at: number;
539
428
  }
540
429
  /**
541
- * A Twitter OAuth account linked to the user.
430
+ * A custom OAuth account linked to the user.
542
431
  */
543
- export interface LinkedAccountTwitterOAuth {
432
+ export interface LinkedAccountCustomOAuth {
544
433
  first_verified_at: number | null;
545
434
  latest_verified_at: number | null;
546
- name: string | null;
547
- profile_picture_url: string | null;
548
435
  subject: string;
549
- type: 'twitter_oauth';
550
- username: string | null;
436
+ /**
437
+ * The ID of a custom OAuth provider, set up for this app. Must start with
438
+ * "custom:".
439
+ */
440
+ type: ClientAuthAPI.CustomOAuthProviderID;
551
441
  verified_at: number;
442
+ email?: string;
443
+ name?: string;
444
+ profile_picture_url?: string;
445
+ username?: string;
446
+ }
447
+ /**
448
+ * The payload for importing a Discord account.
449
+ */
450
+ export interface LinkedAccountDiscordInput {
451
+ subject: string;
452
+ type: 'discord_oauth';
453
+ username: string;
454
+ email?: string;
552
455
  }
553
456
  /**
554
457
  * A Discord OAuth account linked to the user.
@@ -563,241 +466,282 @@ export interface LinkedAccountDiscordOAuth {
563
466
  verified_at: number;
564
467
  }
565
468
  /**
566
- * A GitHub OAuth account linked to the user.
469
+ * An email account linked to the user.
567
470
  */
568
- export interface LinkedAccountGitHubOAuth {
569
- email: string | null;
471
+ export interface LinkedAccountEmail {
472
+ address: string;
570
473
  first_verified_at: number | null;
571
474
  latest_verified_at: number | null;
572
- name: string | null;
573
- subject: string;
574
- type: 'github_oauth';
575
- username: string | null;
475
+ type: 'email';
576
476
  verified_at: number;
577
477
  }
578
478
  /**
579
- * A LinkedIn OAuth account linked to the user.
479
+ * The payload for importing an email account.
580
480
  */
581
- export interface LinkedAccountLinkedInOAuth {
582
- email: string | null;
583
- first_verified_at: number | null;
584
- latest_verified_at: number | null;
585
- subject: string;
586
- type: 'linkedin_oauth';
587
- verified_at: number;
588
- name?: string;
589
- vanity_name?: string;
481
+ export interface LinkedAccountEmailInput {
482
+ address: string;
483
+ type: 'email';
590
484
  }
485
+ export type LinkedAccountEmbeddedWallet = LinkedAccountEthereumEmbeddedWallet | LinkedAccountSolanaEmbeddedWallet | LinkedAccountBitcoinSegwitEmbeddedWallet | LinkedAccountBitcoinTaprootEmbeddedWallet | LinkedAccountCurveSigningEmbeddedWallet;
591
486
  /**
592
- * A Spotify OAuth account linked to the user.
487
+ * An embedded wallet account with an ID.
593
488
  */
594
- export interface LinkedAccountSpotifyOAuth {
595
- email: string | null;
596
- first_verified_at: number | null;
597
- latest_verified_at: number | null;
598
- name: string | null;
599
- subject: string;
600
- type: 'spotify_oauth';
601
- verified_at: number;
489
+ export type LinkedAccountEmbeddedWalletWithID = LinkedAccountEmbeddedWalletWithID.LinkedAccountEthereumEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountSolanaEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinSegwitEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinTaprootEmbeddedWallet | LinkedAccountEmbeddedWalletWithID.LinkedAccountCurveSigningEmbeddedWallet;
490
+ export declare namespace LinkedAccountEmbeddedWalletWithID {
491
+ /**
492
+ * An Ethereum embedded wallet account linked to the user.
493
+ */
494
+ interface LinkedAccountEthereumEmbeddedWallet extends Omit<UsersAPI.LinkedAccountEthereumEmbeddedWallet, 'id' | 'recovery_method'> {
495
+ id: string;
496
+ recovery_method: 'privy-v2';
497
+ }
498
+ /**
499
+ * A Solana embedded wallet account linked to the user.
500
+ */
501
+ interface LinkedAccountSolanaEmbeddedWallet extends Omit<UsersAPI.LinkedAccountSolanaEmbeddedWallet, 'id' | 'recovery_method'> {
502
+ id: string;
503
+ recovery_method: 'privy-v2';
504
+ }
505
+ /**
506
+ * A Bitcoin SegWit embedded wallet account linked to the user.
507
+ */
508
+ interface LinkedAccountBitcoinSegwitEmbeddedWallet extends Omit<UsersAPI.LinkedAccountBitcoinSegwitEmbeddedWallet, 'id' | 'recovery_method'> {
509
+ id: string;
510
+ recovery_method: 'privy-v2';
511
+ }
512
+ /**
513
+ * A Bitcoin Taproot embedded wallet account linked to the user.
514
+ */
515
+ interface LinkedAccountBitcoinTaprootEmbeddedWallet extends Omit<UsersAPI.LinkedAccountBitcoinTaprootEmbeddedWallet, 'id' | 'recovery_method'> {
516
+ id: string;
517
+ recovery_method: 'privy-v2';
518
+ }
519
+ /**
520
+ * A curve signing embedded wallet account linked to the user.
521
+ */
522
+ interface LinkedAccountCurveSigningEmbeddedWallet extends Omit<UsersAPI.LinkedAccountCurveSigningEmbeddedWallet, 'id' | 'recovery_method'> {
523
+ id: string;
524
+ recovery_method: 'privy-v2';
525
+ }
602
526
  }
603
527
  /**
604
- * An Instagram OAuth account linked to the user.
528
+ * An Ethereum wallet account linked to the user.
605
529
  */
606
- export interface LinkedAccountInstagramOAuth {
530
+ export interface LinkedAccountEthereum {
531
+ address: string;
532
+ chain_type: 'ethereum';
607
533
  first_verified_at: number | null;
608
534
  latest_verified_at: number | null;
609
- subject: string;
610
- type: 'instagram_oauth';
611
- username: string | null;
535
+ type: 'wallet';
612
536
  verified_at: number;
537
+ wallet_client: 'unknown';
538
+ chain_id?: string;
539
+ connector_type?: string;
540
+ wallet_client_type?: string;
613
541
  }
614
542
  /**
615
- * A TikTok OAuth account linked to the user.
543
+ * An Ethereum embedded wallet account linked to the user.
616
544
  */
617
- export interface LinkedAccountTiktokOAuth {
545
+ export interface LinkedAccountEthereumEmbeddedWallet {
546
+ id: string | null;
547
+ address: string;
548
+ chain_id: string;
549
+ chain_type: 'ethereum';
550
+ connector_type: 'embedded';
551
+ delegated: boolean;
618
552
  first_verified_at: number | null;
553
+ imported: boolean;
619
554
  latest_verified_at: number | null;
620
- name: string | null;
621
- subject: string;
622
- type: 'tiktok_oauth';
623
- username: string | null;
555
+ /**
556
+ * The method used to recover an embedded wallet account.
557
+ */
558
+ recovery_method: EmbeddedWalletRecoveryMethod;
559
+ type: 'wallet';
624
560
  verified_at: number;
561
+ wallet_client: 'privy';
562
+ wallet_client_type: 'privy';
563
+ wallet_index: number;
625
564
  }
626
565
  /**
627
- * A LINE OAuth account linked to the user.
566
+ * A Farcaster account linked to the user.
628
567
  */
629
- export interface LinkedAccountLineOAuth {
630
- email: string | null;
568
+ export interface LinkedAccountFarcaster {
569
+ fid: number;
631
570
  first_verified_at: number | null;
632
571
  latest_verified_at: number | null;
633
- name: string | null;
634
- profile_picture_url: string | null;
635
- subject: string;
636
- type: 'line_oauth';
572
+ owner_address: string;
573
+ type: 'farcaster';
637
574
  verified_at: number;
575
+ bio?: string;
576
+ display_name?: string;
577
+ homepage_url?: string;
578
+ profile_picture?: string;
579
+ profile_picture_url?: string;
580
+ signer_public_key?: string;
581
+ username?: string;
638
582
  }
639
583
  /**
640
- * A Twitch OAuth account linked to the user.
584
+ * The payload for importing a Farcaster account.
641
585
  */
642
- export interface LinkedAccountTwitchOAuth {
643
- first_verified_at: number | null;
644
- latest_verified_at: number | null;
586
+ export interface LinkedAccountFarcasterInput {
587
+ fid: number;
588
+ owner_address: string;
589
+ type: 'farcaster';
590
+ bio?: string;
591
+ display_name?: string;
592
+ homepage_url?: string;
593
+ profile_picture_url?: string;
594
+ username?: string;
595
+ }
596
+ /**
597
+ * The payload for importing a Github account.
598
+ */
599
+ export interface LinkedAccountGitHubInput {
645
600
  subject: string;
646
- type: 'twitch_oauth';
647
- username: string | null;
648
- verified_at: number;
601
+ type: 'github_oauth';
602
+ username: string;
603
+ email?: string;
604
+ name?: string;
649
605
  }
650
606
  /**
651
- * An Apple OAuth account linked to the user.
607
+ * A GitHub OAuth account linked to the user.
652
608
  */
653
- export interface LinkedAccountAppleOAuth {
609
+ export interface LinkedAccountGitHubOAuth {
654
610
  email: string | null;
655
611
  first_verified_at: number | null;
656
612
  latest_verified_at: number | null;
613
+ name: string | null;
657
614
  subject: string;
658
- type: 'apple_oauth';
615
+ type: 'github_oauth';
616
+ username: string | null;
659
617
  verified_at: number;
660
618
  }
661
619
  /**
662
- * A custom OAuth account linked to the user.
620
+ * The payload for importing a Google account.
663
621
  */
664
- export interface LinkedAccountCustomOAuth {
665
- first_verified_at: number | null;
666
- latest_verified_at: number | null;
622
+ export interface LinkedAccountGoogleInput {
623
+ email: string;
624
+ name: string;
667
625
  subject: string;
668
- /**
669
- * The ID of a custom OAuth provider, set up for this app. Must start with
670
- * "custom:".
671
- */
672
- type: ClientAuthAPI.CustomOAuthProviderID;
673
- verified_at: number;
674
- email?: string;
675
- name?: string;
676
- profile_picture_url?: string;
677
- username?: string;
626
+ type: 'google_oauth';
678
627
  }
679
628
  /**
680
- * A custom JWT account linked to the user.
629
+ * A Google OAuth account linked to the user.
681
630
  */
682
- export interface LinkedAccountCustomJwt {
683
- custom_user_id: string;
631
+ export interface LinkedAccountGoogleOAuth {
632
+ email: string;
684
633
  first_verified_at: number | null;
685
634
  latest_verified_at: number | null;
686
- type: 'custom_auth';
635
+ name: string | null;
636
+ subject: string;
637
+ type: 'google_oauth';
687
638
  verified_at: number;
688
639
  }
689
640
  /**
690
- * An embedded wallet associated with a cross-app account.
641
+ * The input for adding a linked account to a user.
691
642
  */
692
- export interface CrossAppEmbeddedWallet {
693
- address: string;
694
- }
643
+ export type LinkedAccountInput = LinkedAccountWalletInput | LinkedAccountEmailInput | LinkedAccountPhoneInput | LinkedAccountGoogleInput | LinkedAccountTwitterInput | LinkedAccountDiscordInput | LinkedAccountGitHubInput | LinkedAccountSpotifyInput | LinkedAccountInstagramInput | LinkedAccountTiktokInput | LinkedAccountLineInput | LinkedAccountTwitchInput | LinkedAccountAppleInput | LinkedAccountLinkedInInput | LinkedAccountFarcasterInput | LinkedAccountTelegramInput | LinkedAccountCustomJwtInput | LinkedAccountPasskeyInput;
695
644
  /**
696
- * A smart wallet associated with a cross-app account.
645
+ * The payload for importing an Instagram account.
697
646
  */
698
- export interface CrossAppSmartWallet {
699
- address: string;
647
+ export interface LinkedAccountInstagramInput {
648
+ subject: string;
649
+ type: 'instagram_oauth';
650
+ username: string;
700
651
  }
701
652
  /**
702
- * A cross-app account linked to the user.
653
+ * An Instagram OAuth account linked to the user.
703
654
  */
704
- export interface LinkedAccountCrossApp {
705
- embedded_wallets: Array<CrossAppEmbeddedWallet>;
655
+ export interface LinkedAccountInstagramOAuth {
706
656
  first_verified_at: number | null;
707
657
  latest_verified_at: number | null;
708
- provider_app_id: string;
709
- smart_wallets: Array<CrossAppSmartWallet>;
710
658
  subject: string;
711
- type: 'cross_app';
659
+ type: 'instagram_oauth';
660
+ username: string | null;
712
661
  verified_at: number;
713
662
  }
714
663
  /**
715
- * An authorization key linked to the user.
664
+ * The payload for importing a LINE account.
716
665
  */
717
- export interface LinkedAccountAuthorizationKey {
666
+ export interface LinkedAccountLineInput {
667
+ subject: string;
668
+ type: 'line_oauth';
669
+ email?: string;
670
+ name?: string;
671
+ profile_picture_url?: string;
672
+ }
673
+ /**
674
+ * A LINE OAuth account linked to the user.
675
+ */
676
+ export interface LinkedAccountLineOAuth {
677
+ email: string | null;
718
678
  first_verified_at: number | null;
719
679
  latest_verified_at: number | null;
720
- public_key: string;
721
- type: 'authorization_key';
680
+ name: string | null;
681
+ profile_picture_url: string | null;
682
+ subject: string;
683
+ type: 'line_oauth';
722
684
  verified_at: number;
723
685
  }
724
686
  /**
725
- * A linked account for the user.
726
- */
727
- export type LinkedAccount = LinkedAccountEmail | LinkedAccountPhone | LinkedAccountEthereum | LinkedAccountSolana | LinkedAccountSmartWallet | LinkedAccountEthereumEmbeddedWallet | LinkedAccountSolanaEmbeddedWallet | LinkedAccountBitcoinSegwitEmbeddedWallet | LinkedAccountBitcoinTaprootEmbeddedWallet | LinkedAccountCurveSigningEmbeddedWallet | LinkedAccountGoogleOAuth | LinkedAccountTwitterOAuth | LinkedAccountDiscordOAuth | LinkedAccountGitHubOAuth | LinkedAccountSpotifyOAuth | LinkedAccountInstagramOAuth | LinkedAccountTiktokOAuth | LinkedAccountLineOAuth | LinkedAccountTwitchOAuth | LinkedAccountLinkedInOAuth | LinkedAccountAppleOAuth | LinkedAccountCustomOAuth | LinkedAccountCustomJwt | LinkedAccountFarcaster | LinkedAccountPasskey | LinkedAccountTelegram | LinkedAccountCrossApp | LinkedAccountAuthorizationKey;
728
- /**
729
- * The possible types of linked accounts.
730
- */
731
- export type LinkedAccountType = 'email' | 'phone' | 'wallet' | 'smart_wallet' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'line_oauth' | 'twitch_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'authorization_key' | ClientAuthAPI.CustomOAuthProviderID;
732
- /**
733
- * A SMS MFA method.
687
+ * The payload for importing a LinkedIn account.
734
688
  */
735
- export interface SMSMfaMethod {
736
- type: 'sms';
737
- verified_at: number;
689
+ export interface LinkedAccountLinkedInInput {
690
+ subject: string;
691
+ type: 'linkedin_oauth';
692
+ email?: string;
693
+ name?: string;
694
+ vanityName?: string;
738
695
  }
739
696
  /**
740
- * A TOTP MFA method.
697
+ * A LinkedIn OAuth account linked to the user.
741
698
  */
742
- export interface TotpMfaMethod {
743
- type: 'totp';
699
+ export interface LinkedAccountLinkedInOAuth {
700
+ email: string | null;
701
+ first_verified_at: number | null;
702
+ latest_verified_at: number | null;
703
+ subject: string;
704
+ type: 'linkedin_oauth';
744
705
  verified_at: number;
706
+ name?: string;
707
+ vanity_name?: string;
745
708
  }
746
709
  /**
747
- * A Passkey MFA method.
710
+ * A passkey account linked to the user.
748
711
  */
749
- export interface PasskeyMfaMethod {
712
+ export interface LinkedAccountPasskey {
713
+ credential_id: string;
714
+ enrolled_in_mfa: boolean;
715
+ first_verified_at: number | null;
716
+ latest_verified_at: number | null;
750
717
  type: 'passkey';
751
718
  verified_at: number;
719
+ authenticator_name?: string;
720
+ created_with_browser?: string;
721
+ created_with_device?: string;
722
+ created_with_os?: string;
723
+ public_key?: string;
752
724
  }
753
725
  /**
754
- * A multi-factor authentication method linked to the user.
755
- */
756
- export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
757
- /**
758
- * Custom metadata associated with the user.
759
- */
760
- export type CustomMetadata = {
761
- [key: string]: string | number | boolean;
762
- };
763
- /**
764
- * A Privy user object.
765
- */
766
- export interface User {
767
- id: string;
768
- /**
769
- * Unix timestamp of when the user was created in seconds.
770
- */
771
- created_at: number;
772
- /**
773
- * Indicates if the user has accepted the terms of service.
774
- */
775
- has_accepted_terms: boolean;
776
- /**
777
- * Indicates if the user is a guest account user.
778
- */
779
- is_guest: boolean;
780
- linked_accounts: Array<LinkedAccount>;
781
- mfa_methods: Array<LinkedMfaMethod>;
782
- /**
783
- * Custom metadata associated with the user.
784
- */
785
- custom_metadata?: CustomMetadata;
786
- }
787
- /**
788
- * The payload for importing a wallet account.
726
+ * The payload for importing a passkey account.
789
727
  */
790
- export interface LinkedAccountWalletInput {
791
- address: string;
792
- chain_type: 'ethereum' | 'solana';
793
- type: 'wallet';
728
+ export interface LinkedAccountPasskeyInput {
729
+ credential_device_type: 'singleDevice' | 'multiDevice';
730
+ credential_id: string;
731
+ credential_public_key: string;
732
+ credential_username: string;
733
+ type: 'passkey';
794
734
  }
795
735
  /**
796
- * The payload for importing an email account.
736
+ * A phone number account linked to the user.
797
737
  */
798
- export interface LinkedAccountEmailInput {
799
- address: string;
800
- type: 'email';
738
+ export interface LinkedAccountPhone {
739
+ first_verified_at: number | null;
740
+ latest_verified_at: number | null;
741
+ phoneNumber: string;
742
+ type: 'phone';
743
+ verified_at: number;
744
+ number?: string;
801
745
  }
802
746
  /**
803
747
  * The payload for importing a phone account.
@@ -807,59 +751,103 @@ export interface LinkedAccountPhoneInput {
807
751
  type: 'phone';
808
752
  }
809
753
  /**
810
- * The payload for importing a Google account.
754
+ * A smart wallet account linked to the user.
811
755
  */
812
- export interface LinkedAccountGoogleInput {
813
- email: string;
814
- name: string;
815
- subject: string;
816
- type: 'google_oauth';
756
+ export interface LinkedAccountSmartWallet {
757
+ address: string;
758
+ first_verified_at: number | null;
759
+ latest_verified_at: number | null;
760
+ /**
761
+ * The supported smart wallet providers.
762
+ */
763
+ smart_wallet_type: EmbeddedWalletsAPI.SmartWalletType;
764
+ type: 'smart_wallet';
765
+ verified_at: number;
766
+ smart_wallet_version?: string;
817
767
  }
818
768
  /**
819
- * The payload for importing a Twitter account.
769
+ * A Solana wallet account linked to the user.
820
770
  */
821
- export interface LinkedAccountTwitterInput {
822
- name: string;
823
- subject: string;
824
- type: 'twitter_oauth';
825
- username: string;
826
- profile_picture_url?: string;
771
+ export interface LinkedAccountSolana {
772
+ address: string;
773
+ chain_type: 'solana';
774
+ first_verified_at: number | null;
775
+ latest_verified_at: number | null;
776
+ type: 'wallet';
777
+ verified_at: number;
778
+ wallet_client: 'unknown';
779
+ connector_type?: string;
780
+ wallet_client_type?: string;
827
781
  }
828
782
  /**
829
- * The payload for importing a Discord account.
783
+ * A Solana embedded wallet account linked to the user.
830
784
  */
831
- export interface LinkedAccountDiscordInput {
832
- subject: string;
833
- type: 'discord_oauth';
834
- username: string;
835
- email?: string;
785
+ export interface LinkedAccountSolanaEmbeddedWallet {
786
+ id: string | null;
787
+ address: string;
788
+ chain_id: string;
789
+ chain_type: 'solana';
790
+ connector_type: 'embedded';
791
+ delegated: boolean;
792
+ first_verified_at: number | null;
793
+ imported: boolean;
794
+ latest_verified_at: number | null;
795
+ public_key: string;
796
+ /**
797
+ * The method used to recover an embedded wallet account.
798
+ */
799
+ recovery_method: EmbeddedWalletRecoveryMethod;
800
+ type: 'wallet';
801
+ verified_at: number;
802
+ wallet_client: 'privy';
803
+ wallet_client_type: 'privy';
804
+ wallet_index: number;
836
805
  }
837
806
  /**
838
- * The payload for importing a Github account.
807
+ * The payload for importing a Spotify account.
839
808
  */
840
- export interface LinkedAccountGitHubInput {
809
+ export interface LinkedAccountSpotifyInput {
841
810
  subject: string;
842
- type: 'github_oauth';
843
- username: string;
811
+ type: 'spotify_oauth';
844
812
  email?: string;
845
813
  name?: string;
846
814
  }
847
815
  /**
848
- * The payload for importing a Spotify account.
816
+ * A Spotify OAuth account linked to the user.
849
817
  */
850
- export interface LinkedAccountSpotifyInput {
818
+ export interface LinkedAccountSpotifyOAuth {
819
+ email: string | null;
820
+ first_verified_at: number | null;
821
+ latest_verified_at: number | null;
822
+ name: string | null;
851
823
  subject: string;
852
824
  type: 'spotify_oauth';
853
- email?: string;
854
- name?: string;
825
+ verified_at: number;
855
826
  }
856
827
  /**
857
- * The payload for importing an Instagram account.
828
+ * A Telegram account linked to the user.
858
829
  */
859
- export interface LinkedAccountInstagramInput {
860
- subject: string;
861
- type: 'instagram_oauth';
862
- username: string;
830
+ export interface LinkedAccountTelegram {
831
+ first_verified_at: number | null;
832
+ latest_verified_at: number | null;
833
+ telegram_user_id: string;
834
+ type: 'telegram';
835
+ verified_at: number;
836
+ first_name?: string | null;
837
+ last_name?: string | null;
838
+ photo_url?: string | null;
839
+ username?: string | null;
840
+ }
841
+ /**
842
+ * The payload for importing a Telegram account.
843
+ */
844
+ export interface LinkedAccountTelegramInput {
845
+ telegram_user_id: string;
846
+ type: 'telegram';
847
+ first_name?: string;
848
+ last_name?: string;
849
+ photo_url?: string;
850
+ username?: string;
863
851
  }
864
852
  /**
865
853
  * The payload for importing a Tiktok account.
@@ -871,14 +859,16 @@ export interface LinkedAccountTiktokInput {
871
859
  username: string;
872
860
  }
873
861
  /**
874
- * The payload for importing a LINE account.
862
+ * A TikTok OAuth account linked to the user.
875
863
  */
876
- export interface LinkedAccountLineInput {
864
+ export interface LinkedAccountTiktokOAuth {
865
+ first_verified_at: number | null;
866
+ latest_verified_at: number | null;
867
+ name: string | null;
877
868
  subject: string;
878
- type: 'line_oauth';
879
- email?: string;
880
- name?: string;
881
- profile_picture_url?: string;
869
+ type: 'tiktok_oauth';
870
+ username: string | null;
871
+ verified_at: number;
882
872
  }
883
873
  /**
884
874
  * The payload for importing a Twitch account.
@@ -889,68 +879,120 @@ export interface LinkedAccountTwitchInput {
889
879
  username?: string;
890
880
  }
891
881
  /**
892
- * The payload for importing an Apple account.
882
+ * A Twitch OAuth account linked to the user.
893
883
  */
894
- export interface LinkedAccountAppleInput {
884
+ export interface LinkedAccountTwitchOAuth {
885
+ first_verified_at: number | null;
886
+ latest_verified_at: number | null;
895
887
  subject: string;
896
- type: 'apple_oauth';
897
- email?: string;
888
+ type: 'twitch_oauth';
889
+ username: string | null;
890
+ verified_at: number;
898
891
  }
899
892
  /**
900
- * The payload for importing a LinkedIn account.
893
+ * The payload for importing a Twitter account.
901
894
  */
902
- export interface LinkedAccountLinkedInInput {
895
+ export interface LinkedAccountTwitterInput {
896
+ name: string;
903
897
  subject: string;
904
- type: 'linkedin_oauth';
905
- email?: string;
906
- name?: string;
907
- vanityName?: string;
898
+ type: 'twitter_oauth';
899
+ username: string;
900
+ profile_picture_url?: string;
908
901
  }
909
902
  /**
910
- * The payload for importing a Farcaster account.
903
+ * A Twitter OAuth account linked to the user.
911
904
  */
912
- export interface LinkedAccountFarcasterInput {
913
- fid: number;
914
- owner_address: string;
915
- type: 'farcaster';
916
- bio?: string;
917
- display_name?: string;
918
- homepage_url?: string;
919
- profile_picture_url?: string;
920
- username?: string;
905
+ export interface LinkedAccountTwitterOAuth {
906
+ first_verified_at: number | null;
907
+ latest_verified_at: number | null;
908
+ name: string | null;
909
+ profile_picture_url: string | null;
910
+ subject: string;
911
+ type: 'twitter_oauth';
912
+ username: string | null;
913
+ verified_at: number;
921
914
  }
922
915
  /**
923
- * The payload for importing a Telegram account.
916
+ * The possible types of linked accounts.
924
917
  */
925
- export interface LinkedAccountTelegramInput {
926
- telegram_user_id: string;
927
- type: 'telegram';
928
- first_name?: string;
929
- last_name?: string;
930
- photo_url?: string;
931
- username?: string;
918
+ export type LinkedAccountType = 'email' | 'phone' | 'wallet' | 'smart_wallet' | 'google_oauth' | 'twitter_oauth' | 'discord_oauth' | 'github_oauth' | 'spotify_oauth' | 'instagram_oauth' | 'tiktok_oauth' | 'line_oauth' | 'twitch_oauth' | 'linkedin_oauth' | 'apple_oauth' | 'custom_auth' | 'farcaster' | 'passkey' | 'telegram' | 'cross_app' | 'authorization_key' | ClientAuthAPI.CustomOAuthProviderID;
919
+ /**
920
+ * The payload for importing a wallet account.
921
+ */
922
+ export interface LinkedAccountWalletInput {
923
+ address: string;
924
+ chain_type: 'ethereum' | 'solana';
925
+ type: 'wallet';
932
926
  }
933
927
  /**
934
- * The payload for importing a Custom JWT account.
928
+ * A multi-factor authentication method linked to the user.
935
929
  */
936
- export interface LinkedAccountCustomJwtInput {
937
- custom_user_id: string;
938
- type: 'custom_auth';
930
+ export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
931
+ /**
932
+ * OAuth tokens associated with the user.
933
+ */
934
+ export interface OAuthTokens {
935
+ access_token: string;
936
+ provider: string;
937
+ access_token_expires_in_seconds?: number;
938
+ refresh_token?: string;
939
+ refresh_token_expires_in_seconds?: number;
940
+ scopes?: Array<string>;
939
941
  }
940
942
  /**
941
- * The payload for importing a passkey account.
943
+ * A Passkey MFA method.
942
944
  */
943
- export interface LinkedAccountPasskeyInput {
944
- credential_device_type: 'singleDevice' | 'multiDevice';
945
- credential_id: string;
946
- credential_public_key: string;
947
- credential_username: string;
945
+ export interface PasskeyMfaMethod {
948
946
  type: 'passkey';
947
+ verified_at: number;
949
948
  }
950
949
  /**
951
- * The input for adding a linked account to a user.
950
+ * The payload for partially updating custom metadata on a user.
952
951
  */
953
- export type LinkedAccountInput = LinkedAccountWalletInput | LinkedAccountEmailInput | LinkedAccountPhoneInput | LinkedAccountGoogleInput | LinkedAccountTwitterInput | LinkedAccountDiscordInput | LinkedAccountGitHubInput | LinkedAccountSpotifyInput | LinkedAccountInstagramInput | LinkedAccountTiktokInput | LinkedAccountLineInput | LinkedAccountTwitchInput | LinkedAccountAppleInput | LinkedAccountLinkedInInput | LinkedAccountFarcasterInput | LinkedAccountTelegramInput | LinkedAccountCustomJwtInput | LinkedAccountPasskeyInput;
952
+ export interface PatchUsersCustomMetadata {
953
+ /**
954
+ * Custom metadata associated with the user.
955
+ */
956
+ custom_metadata: CustomMetadata;
957
+ }
958
+ /**
959
+ * A SMS MFA method.
960
+ */
961
+ export interface SMSMfaMethod {
962
+ type: 'sms';
963
+ verified_at: number;
964
+ }
965
+ /**
966
+ * A TOTP MFA method.
967
+ */
968
+ export interface TotpMfaMethod {
969
+ type: 'totp';
970
+ verified_at: number;
971
+ }
972
+ /**
973
+ * A Privy user object.
974
+ */
975
+ export interface User {
976
+ id: string;
977
+ /**
978
+ * Unix timestamp of when the user was created in seconds.
979
+ */
980
+ created_at: number;
981
+ /**
982
+ * Indicates if the user has accepted the terms of service.
983
+ */
984
+ has_accepted_terms: boolean;
985
+ /**
986
+ * Indicates if the user is a guest account user.
987
+ */
988
+ is_guest: boolean;
989
+ linked_accounts: Array<LinkedAccount>;
990
+ mfa_methods: Array<LinkedMfaMethod>;
991
+ /**
992
+ * Custom metadata associated with the user.
993
+ */
994
+ custom_metadata?: CustomMetadata;
995
+ }
954
996
  /**
955
997
  * The payload for batch creating users.
956
998
  */
@@ -976,17 +1018,6 @@ export declare namespace UserBatchCreateInput {
976
1018
  wallets?: Array<EmbeddedWalletsAPI.WalletCreationInput>;
977
1019
  }
978
1020
  }
979
- /**
980
- * OAuth tokens associated with the user.
981
- */
982
- export interface OAuthTokens {
983
- access_token: string;
984
- provider: string;
985
- access_token_expires_in_seconds?: number;
986
- refresh_token?: string;
987
- refresh_token_expires_in_seconds?: number;
988
- scopes?: Array<string>;
989
- }
990
1021
  /**
991
1022
  * The user object along their identity token.
992
1023
  */
@@ -997,28 +1028,6 @@ export interface UserWithIdentityToken {
997
1028
  */
998
1029
  user: User;
999
1030
  }
1000
- /**
1001
- * The authenticated user.
1002
- */
1003
- export interface AuthenticatedUser {
1004
- token: string | null;
1005
- privy_access_token: string | null;
1006
- refresh_token: string | null;
1007
- /**
1008
- * Instructs the client on how to handle tokens received
1009
- */
1010
- session_update_action: 'set' | 'ignore' | 'clear';
1011
- /**
1012
- * A Privy user object.
1013
- */
1014
- user: User;
1015
- identity_token?: string;
1016
- is_new_user?: boolean;
1017
- /**
1018
- * OAuth tokens associated with the user.
1019
- */
1020
- oauth_tokens?: OAuthTokens;
1021
- }
1022
1031
  export interface UserCreateParams {
1023
1032
  linked_accounts: Array<LinkedAccountInput>;
1024
1033
  /**
@@ -1133,6 +1142,6 @@ export interface UserUnlinkLinkedAccountParams {
1133
1142
  provider?: string;
1134
1143
  }
1135
1144
  export declare namespace Users {
1136
- export { type LinkedAccountEmail as LinkedAccountEmail, type LinkedAccountPhone as LinkedAccountPhone, type LinkedAccountBaseWallet as LinkedAccountBaseWallet, type LinkedAccountEthereum as LinkedAccountEthereum, type LinkedAccountSmartWallet as LinkedAccountSmartWallet, type LinkedAccountSolana as LinkedAccountSolana, type LinkedAccountFarcaster as LinkedAccountFarcaster, type LinkedAccountPasskey as LinkedAccountPasskey, type LinkedAccountTelegram as LinkedAccountTelegram, type EmbeddedWalletRecoveryMethod as EmbeddedWalletRecoveryMethod, type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet, type LinkedAccountSolanaEmbeddedWallet as LinkedAccountSolanaEmbeddedWallet, type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet, type LinkedAccountBitcoinTaprootEmbeddedWallet as LinkedAccountBitcoinTaprootEmbeddedWallet, type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet, type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet, type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID, type LinkedAccountGoogleOAuth as LinkedAccountGoogleOAuth, type LinkedAccountTwitterOAuth as LinkedAccountTwitterOAuth, type LinkedAccountDiscordOAuth as LinkedAccountDiscordOAuth, type LinkedAccountGitHubOAuth as LinkedAccountGitHubOAuth, type LinkedAccountLinkedInOAuth as LinkedAccountLinkedInOAuth, type LinkedAccountSpotifyOAuth as LinkedAccountSpotifyOAuth, type LinkedAccountInstagramOAuth as LinkedAccountInstagramOAuth, type LinkedAccountTiktokOAuth as LinkedAccountTiktokOAuth, type LinkedAccountLineOAuth as LinkedAccountLineOAuth, type LinkedAccountTwitchOAuth as LinkedAccountTwitchOAuth, type LinkedAccountAppleOAuth as LinkedAccountAppleOAuth, type LinkedAccountCustomOAuth as LinkedAccountCustomOAuth, type LinkedAccountCustomJwt as LinkedAccountCustomJwt, type CrossAppEmbeddedWallet as CrossAppEmbeddedWallet, type CrossAppSmartWallet as CrossAppSmartWallet, type LinkedAccountCrossApp as LinkedAccountCrossApp, type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey, type LinkedAccount as LinkedAccount, type LinkedAccountType as LinkedAccountType, type SMSMfaMethod as SMSMfaMethod, type TotpMfaMethod as TotpMfaMethod, type PasskeyMfaMethod as PasskeyMfaMethod, type LinkedMfaMethod as LinkedMfaMethod, type CustomMetadata as CustomMetadata, type User as User, type LinkedAccountWalletInput as LinkedAccountWalletInput, type LinkedAccountEmailInput as LinkedAccountEmailInput, type LinkedAccountPhoneInput as LinkedAccountPhoneInput, type LinkedAccountGoogleInput as LinkedAccountGoogleInput, type LinkedAccountTwitterInput as LinkedAccountTwitterInput, type LinkedAccountDiscordInput as LinkedAccountDiscordInput, type LinkedAccountGitHubInput as LinkedAccountGitHubInput, type LinkedAccountSpotifyInput as LinkedAccountSpotifyInput, type LinkedAccountInstagramInput as LinkedAccountInstagramInput, type LinkedAccountTiktokInput as LinkedAccountTiktokInput, type LinkedAccountLineInput as LinkedAccountLineInput, type LinkedAccountTwitchInput as LinkedAccountTwitchInput, type LinkedAccountAppleInput as LinkedAccountAppleInput, type LinkedAccountLinkedInInput as LinkedAccountLinkedInInput, type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput, type LinkedAccountTelegramInput as LinkedAccountTelegramInput, type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput, type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput, type LinkedAccountInput as LinkedAccountInput, type UserBatchCreateInput as UserBatchCreateInput, type OAuthTokens as OAuthTokens, type UserWithIdentityToken as UserWithIdentityToken, type AuthenticatedUser as AuthenticatedUser, type UsersCursor as UsersCursor, type UserCreateParams as UserCreateParams, type UserListParams as UserListParams, type UserGetByCustomAuthIDParams as UserGetByCustomAuthIDParams, type UserGetByDiscordUsernameParams as UserGetByDiscordUsernameParams, type UserGetByEmailAddressParams as UserGetByEmailAddressParams, type UserGetByFarcasterIDParams as UserGetByFarcasterIDParams, type UserGetByGitHubUsernameParams as UserGetByGitHubUsernameParams, type UserGetByPhoneNumberParams as UserGetByPhoneNumberParams, type UserGetBySmartWalletAddressParams as UserGetBySmartWalletAddressParams, type UserGetByTelegramUserIDParams as UserGetByTelegramUserIDParams, type UserGetByTelegramUsernameParams as UserGetByTelegramUsernameParams, type UserGetByTwitterSubjectParams as UserGetByTwitterSubjectParams, type UserGetByTwitterUsernameParams as UserGetByTwitterUsernameParams, type UserGetByWalletAddressParams as UserGetByWalletAddressParams, type UserPregenerateWalletsParams as UserPregenerateWalletsParams, type UserSearchParams as UserSearchParams, type UserSetCustomMetadataParams as UserSetCustomMetadataParams, type UserUnlinkLinkedAccountParams as UserUnlinkLinkedAccountParams, };
1145
+ export { type AuthenticatedUser as AuthenticatedUser, type CrossAppEmbeddedWallet as CrossAppEmbeddedWallet, type CrossAppSmartWallet as CrossAppSmartWallet, type CustomMetadata as CustomMetadata, type EmbeddedWalletRecoveryMethod as EmbeddedWalletRecoveryMethod, type LinkedAccount as LinkedAccount, type LinkedAccountAppleInput as LinkedAccountAppleInput, type LinkedAccountAppleOAuth as LinkedAccountAppleOAuth, type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey, type LinkedAccountBaseWallet as LinkedAccountBaseWallet, type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet, type LinkedAccountBitcoinTaprootEmbeddedWallet as LinkedAccountBitcoinTaprootEmbeddedWallet, type LinkedAccountCrossApp as LinkedAccountCrossApp, type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet, type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput, type LinkedAccountCustomJwt as LinkedAccountCustomJwt, type LinkedAccountCustomOAuth as LinkedAccountCustomOAuth, type LinkedAccountDiscordInput as LinkedAccountDiscordInput, type LinkedAccountDiscordOAuth as LinkedAccountDiscordOAuth, type LinkedAccountEmail as LinkedAccountEmail, type LinkedAccountEmailInput as LinkedAccountEmailInput, type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet, type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID, type LinkedAccountEthereum as LinkedAccountEthereum, type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet, type LinkedAccountFarcaster as LinkedAccountFarcaster, type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput, type LinkedAccountGitHubInput as LinkedAccountGitHubInput, type LinkedAccountGitHubOAuth as LinkedAccountGitHubOAuth, type LinkedAccountGoogleInput as LinkedAccountGoogleInput, type LinkedAccountGoogleOAuth as LinkedAccountGoogleOAuth, type LinkedAccountInput as LinkedAccountInput, type LinkedAccountInstagramInput as LinkedAccountInstagramInput, type LinkedAccountInstagramOAuth as LinkedAccountInstagramOAuth, type LinkedAccountLineInput as LinkedAccountLineInput, type LinkedAccountLineOAuth as LinkedAccountLineOAuth, type LinkedAccountLinkedInInput as LinkedAccountLinkedInInput, type LinkedAccountLinkedInOAuth as LinkedAccountLinkedInOAuth, type LinkedAccountPasskey as LinkedAccountPasskey, type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput, type LinkedAccountPhone as LinkedAccountPhone, type LinkedAccountPhoneInput as LinkedAccountPhoneInput, type LinkedAccountSmartWallet as LinkedAccountSmartWallet, type LinkedAccountSolana as LinkedAccountSolana, type LinkedAccountSolanaEmbeddedWallet as LinkedAccountSolanaEmbeddedWallet, type LinkedAccountSpotifyInput as LinkedAccountSpotifyInput, type LinkedAccountSpotifyOAuth as LinkedAccountSpotifyOAuth, type LinkedAccountTelegram as LinkedAccountTelegram, type LinkedAccountTelegramInput as LinkedAccountTelegramInput, type LinkedAccountTiktokInput as LinkedAccountTiktokInput, type LinkedAccountTiktokOAuth as LinkedAccountTiktokOAuth, type LinkedAccountTwitchInput as LinkedAccountTwitchInput, type LinkedAccountTwitchOAuth as LinkedAccountTwitchOAuth, type LinkedAccountTwitterInput as LinkedAccountTwitterInput, type LinkedAccountTwitterOAuth as LinkedAccountTwitterOAuth, type LinkedAccountType as LinkedAccountType, type LinkedAccountWalletInput as LinkedAccountWalletInput, type LinkedMfaMethod as LinkedMfaMethod, type OAuthTokens as OAuthTokens, type PasskeyMfaMethod as PasskeyMfaMethod, type PatchUsersCustomMetadata as PatchUsersCustomMetadata, type SMSMfaMethod as SMSMfaMethod, type TotpMfaMethod as TotpMfaMethod, type User as User, type UserBatchCreateInput as UserBatchCreateInput, type UserWithIdentityToken as UserWithIdentityToken, type UsersCursor as UsersCursor, type UserCreateParams as UserCreateParams, type UserListParams as UserListParams, type UserGetByCustomAuthIDParams as UserGetByCustomAuthIDParams, type UserGetByDiscordUsernameParams as UserGetByDiscordUsernameParams, type UserGetByEmailAddressParams as UserGetByEmailAddressParams, type UserGetByFarcasterIDParams as UserGetByFarcasterIDParams, type UserGetByGitHubUsernameParams as UserGetByGitHubUsernameParams, type UserGetByPhoneNumberParams as UserGetByPhoneNumberParams, type UserGetBySmartWalletAddressParams as UserGetBySmartWalletAddressParams, type UserGetByTelegramUserIDParams as UserGetByTelegramUserIDParams, type UserGetByTelegramUsernameParams as UserGetByTelegramUsernameParams, type UserGetByTwitterSubjectParams as UserGetByTwitterSubjectParams, type UserGetByTwitterUsernameParams as UserGetByTwitterUsernameParams, type UserGetByWalletAddressParams as UserGetByWalletAddressParams, type UserPregenerateWalletsParams as UserPregenerateWalletsParams, type UserSearchParams as UserSearchParams, type UserSetCustomMetadataParams as UserSetCustomMetadataParams, type UserUnlinkLinkedAccountParams as UserUnlinkLinkedAccountParams, };
1137
1146
  }
1138
1147
  //# sourceMappingURL=users.d.mts.map