@privy-io/node 0.6.1 → 0.7.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 (106) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/client.d.mts +7 -7
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -7
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/index.d.mts +2 -1
  9. package/index.d.mts.map +1 -1
  10. package/index.d.ts +2 -1
  11. package/index.d.ts.map +1 -1
  12. package/index.js +4 -1
  13. package/index.js.map +1 -1
  14. package/index.mjs +2 -1
  15. package/index.mjs.map +1 -1
  16. package/lib/auth.d.mts +30 -2
  17. package/lib/auth.d.mts.map +1 -1
  18. package/lib/auth.d.ts +30 -2
  19. package/lib/auth.d.ts.map +1 -1
  20. package/lib/auth.js +14 -5
  21. package/lib/auth.js.map +1 -1
  22. package/lib/auth.mjs +11 -3
  23. package/lib/auth.mjs.map +1 -1
  24. package/lib/cryptography.d.mts +35 -3
  25. package/lib/cryptography.d.mts.map +1 -1
  26. package/lib/cryptography.d.ts +35 -3
  27. package/lib/cryptography.d.ts.map +1 -1
  28. package/lib/cryptography.js +53 -6
  29. package/lib/cryptography.js.map +1 -1
  30. package/lib/cryptography.mjs +50 -3
  31. package/lib/cryptography.mjs.map +1 -1
  32. package/lib/identity-token.d.mts.map +1 -1
  33. package/lib/identity-token.d.ts.map +1 -1
  34. package/lib/identity-token.js +0 -1
  35. package/lib/identity-token.js.map +1 -1
  36. package/lib/identity-token.mjs +0 -1
  37. package/lib/identity-token.mjs.map +1 -1
  38. package/package.json +13 -1
  39. package/public-api/services/utils/auth.d.mts +10 -1
  40. package/public-api/services/utils/auth.d.mts.map +1 -1
  41. package/public-api/services/utils/auth.d.ts +10 -1
  42. package/public-api/services/utils/auth.d.ts.map +1 -1
  43. package/public-api/services/utils/auth.js +16 -5
  44. package/public-api/services/utils/auth.js.map +1 -1
  45. package/public-api/services/utils/auth.mjs +17 -6
  46. package/public-api/services/utils/auth.mjs.map +1 -1
  47. package/resources/apps.d.mts +26 -0
  48. package/resources/apps.d.mts.map +1 -1
  49. package/resources/apps.d.ts +26 -0
  50. package/resources/apps.d.ts.map +1 -1
  51. package/resources/index.d.mts +3 -3
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +3 -3
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js.map +1 -1
  56. package/resources/index.mjs.map +1 -1
  57. package/resources/policies.d.mts +68 -115
  58. package/resources/policies.d.mts.map +1 -1
  59. package/resources/policies.d.ts +68 -115
  60. package/resources/policies.d.ts.map +1 -1
  61. package/resources/policies.js.map +1 -1
  62. package/resources/policies.mjs.map +1 -1
  63. package/resources/users.d.mts +642 -381
  64. package/resources/users.d.mts.map +1 -1
  65. package/resources/users.d.ts +642 -381
  66. package/resources/users.d.ts.map +1 -1
  67. package/resources/wallets/index.d.mts +1 -1
  68. package/resources/wallets/index.d.mts.map +1 -1
  69. package/resources/wallets/index.d.ts +1 -1
  70. package/resources/wallets/index.d.ts.map +1 -1
  71. package/resources/wallets/index.js.map +1 -1
  72. package/resources/wallets/index.mjs.map +1 -1
  73. package/resources/wallets/wallets.d.mts +98 -4
  74. package/resources/wallets/wallets.d.mts.map +1 -1
  75. package/resources/wallets/wallets.d.ts +98 -4
  76. package/resources/wallets/wallets.d.ts.map +1 -1
  77. package/resources/wallets/wallets.js +1 -1
  78. package/resources/wallets/wallets.js.map +1 -1
  79. package/resources/wallets/wallets.mjs +1 -1
  80. package/resources/wallets/wallets.mjs.map +1 -1
  81. package/solana-kit.d.mts +53 -0
  82. package/solana-kit.d.mts.map +1 -0
  83. package/solana-kit.d.ts +53 -0
  84. package/solana-kit.d.ts.map +1 -0
  85. package/solana-kit.js +92 -0
  86. package/solana-kit.js.map +1 -0
  87. package/solana-kit.mjs +89 -0
  88. package/solana-kit.mjs.map +1 -0
  89. package/src/client.ts +131 -3
  90. package/src/index.ts +5 -0
  91. package/src/lib/auth.ts +42 -6
  92. package/src/lib/cryptography.ts +72 -3
  93. package/src/lib/identity-token.ts +38 -18
  94. package/src/public-api/services/utils/auth.ts +19 -6
  95. package/src/resources/apps.ts +46 -0
  96. package/src/resources/index.ts +66 -2
  97. package/src/resources/policies.ts +105 -191
  98. package/src/resources/users.ts +942 -625
  99. package/src/resources/wallets/index.ts +6 -0
  100. package/src/resources/wallets/wallets.ts +125 -3
  101. package/src/solana-kit.ts +148 -0
  102. package/src/version.ts +1 -1
  103. package/version.d.mts +1 -1
  104. package/version.d.ts +1 -1
  105. package/version.js +1 -1
  106. package/version.mjs +1 -1
@@ -333,6 +333,9 @@ export interface AuthenticatedUser {
333
333
  */
334
334
  session_update_action: 'set' | 'ignore' | 'clear';
335
335
 
336
+ /**
337
+ * A Privy user object.
338
+ */
336
339
  user: User;
337
340
 
338
341
  identity_token?: string;
@@ -342,988 +345,1268 @@ export interface AuthenticatedUser {
342
345
  /**
343
346
  * OAuth tokens associated with the user.
344
347
  */
345
- oauth_tokens?: AuthenticatedUser.OAuthTokens;
346
- }
347
-
348
- export namespace AuthenticatedUser {
349
- /**
350
- * OAuth tokens associated with the user.
351
- */
352
- export interface OAuthTokens {
353
- access_token: string;
354
-
355
- provider: string;
356
-
357
- access_token_expires_in_seconds?: number;
358
-
359
- refresh_token?: string;
360
-
361
- refresh_token_expires_in_seconds?: number;
362
-
363
- scopes?: Array<string>;
364
- }
348
+ oauth_tokens?: OAuthTokens;
365
349
  }
366
350
 
367
351
  /**
368
352
  * A linked account for the user.
369
353
  */
370
354
  export type LinkedAccount =
371
- | LinkedAccount.LinkedAccountEmail
372
- | LinkedAccount.LinkedAccountPhone
373
- | LinkedAccount.LinkedAccountCrossApp
374
- | LinkedAccount.LinkedAccountAuthorizationKey
375
- | LinkedAccount.LinkedAccountCustomJwt
376
- | LinkedAccount.LinkedAccountAppleOAuth
377
- | LinkedAccount.LinkedAccountDiscordOAuth
378
- | LinkedAccount.LinkedAccountGitHubOAuth
379
- | LinkedAccount.LinkedAccountGoogleOAuth
380
- | LinkedAccount.LinkedAccountInstagramOAuth
381
- | LinkedAccount.LinkedAccountLinkedInOAuth
382
- | LinkedAccount.LinkedAccountSpotifyOAuth
383
- | LinkedAccount.LinkedAccountTiktokOAuth
384
- | LinkedAccount.LinkedAccountLineOAuth
385
- | LinkedAccount.LinkedAccountTwitchOAuth
386
- | LinkedAccount.LinkedAccountTwitterOAuth
355
+ | LinkedAccountEmail
356
+ | LinkedAccountPhone
357
+ | LinkedAccountEthereum
358
+ | LinkedAccountSolana
387
359
  | LinkedAccountSmartWallet
388
- | LinkedAccount.LinkedAccountPasskey
389
- | LinkedAccount.LinkedAccountFarcaster
390
- | LinkedAccount.LinkedAccountTelegram
391
- | LinkedAccount.LinkedAccountEthereum
392
360
  | LinkedAccountEthereumEmbeddedWallet
393
- | LinkedAccount.LinkedAccountSolana
394
361
  | LinkedAccountSolanaEmbeddedWallet
395
362
  | LinkedAccountBitcoinSegwitEmbeddedWallet
396
363
  | LinkedAccountBitcoinTaprootEmbeddedWallet
397
364
  | LinkedAccountCurveSigningEmbeddedWallet
398
- | LinkedAccount.LinkedAccountCustomOAuth;
365
+ | LinkedAccountGoogleOAuth
366
+ | LinkedAccountTwitterOAuth
367
+ | LinkedAccountDiscordOAuth
368
+ | LinkedAccountGitHubOAuth
369
+ | LinkedAccountSpotifyOAuth
370
+ | LinkedAccountInstagramOAuth
371
+ | LinkedAccountTiktokOAuth
372
+ | LinkedAccountLineOAuth
373
+ | LinkedAccountTwitchOAuth
374
+ | LinkedAccountLinkedInOAuth
375
+ | LinkedAccountAppleOAuth
376
+ | LinkedAccountCustomOAuth
377
+ | LinkedAccountCustomJwt
378
+ | LinkedAccountFarcaster
379
+ | LinkedAccountPasskey
380
+ | LinkedAccountTelegram
381
+ | LinkedAccountCrossApp
382
+ | LinkedAccountAuthorizationKey;
399
383
 
400
- export namespace LinkedAccount {
401
- export interface LinkedAccountEmail {
402
- address: string;
384
+ /**
385
+ * A Privy user object.
386
+ */
387
+ export interface User {
388
+ id: string;
403
389
 
404
- first_verified_at: number | null;
390
+ /**
391
+ * Unix timestamp of when the user was created in milliseconds.
392
+ */
393
+ created_at: number;
405
394
 
406
- latest_verified_at: number | null;
395
+ /**
396
+ * Indicates if the user has accepted the terms of service.
397
+ */
398
+ has_accepted_terms: boolean;
407
399
 
408
- type: 'email';
400
+ /**
401
+ * Indicates if the user is a guest account user.
402
+ */
403
+ is_guest: boolean;
409
404
 
410
- verified_at: number;
411
- }
405
+ linked_accounts: Array<LinkedAccount>;
412
406
 
413
- export interface LinkedAccountPhone {
414
- first_verified_at: number | null;
407
+ mfa_methods: Array<LinkedMfaMethod>;
415
408
 
416
- latest_verified_at: number | null;
409
+ /**
410
+ * Custom metadata associated with the user.
411
+ */
412
+ custom_metadata?: CustomMetadata;
413
+ }
417
414
 
418
- phoneNumber: string;
415
+ /**
416
+ * An email account linked to the user.
417
+ */
418
+ export interface LinkedAccountEmail {
419
+ address: string;
419
420
 
420
- type: 'phone';
421
+ first_verified_at: number | null;
421
422
 
422
- verified_at: number;
423
+ latest_verified_at: number | null;
423
424
 
424
- number?: string;
425
- }
425
+ type: 'email';
426
426
 
427
- export interface LinkedAccountCrossApp {
428
- embedded_wallets: Array<LinkedAccountCrossApp.EmbeddedWallet>;
427
+ verified_at: number;
428
+ }
429
429
 
430
- first_verified_at: number | null;
430
+ /**
431
+ * A phone number account linked to the user.
432
+ */
433
+ export interface LinkedAccountPhone {
434
+ first_verified_at: number | null;
431
435
 
432
- latest_verified_at: number | null;
436
+ latest_verified_at: number | null;
433
437
 
434
- provider_app_id: string;
438
+ phoneNumber: string;
435
439
 
436
- smart_wallets: Array<LinkedAccountCrossApp.SmartWallet>;
440
+ type: 'phone';
437
441
 
438
- subject: string;
442
+ verified_at: number;
439
443
 
440
- type: 'cross_app';
444
+ number?: string;
445
+ }
441
446
 
442
- verified_at: number;
443
- }
447
+ /**
448
+ * Base schema for wallet accounts linked to the user.
449
+ */
450
+ export interface LinkedAccountBaseWallet {
451
+ address: string;
444
452
 
445
- export namespace LinkedAccountCrossApp {
446
- export interface EmbeddedWallet {
447
- address: string;
448
- }
453
+ chain_type: 'solana' | 'ethereum';
449
454
 
450
- export interface SmartWallet {
451
- address: string;
452
- }
453
- }
455
+ type: 'wallet' | 'smart_wallet';
456
+ }
454
457
 
455
- export interface LinkedAccountAuthorizationKey {
456
- first_verified_at: number | null;
458
+ /**
459
+ * An Ethereum wallet account linked to the user.
460
+ */
461
+ export interface LinkedAccountEthereum {
462
+ address: string;
457
463
 
458
- latest_verified_at: number | null;
464
+ chain_type: 'ethereum';
459
465
 
460
- public_key: string;
466
+ first_verified_at: number | null;
461
467
 
462
- type: 'authorization_key';
468
+ latest_verified_at: number | null;
463
469
 
464
- verified_at: number;
465
- }
470
+ type: 'wallet';
466
471
 
467
- export interface LinkedAccountCustomJwt {
468
- custom_user_id: string;
472
+ verified_at: number;
469
473
 
470
- first_verified_at: number | null;
474
+ wallet_client: 'unknown';
471
475
 
472
- latest_verified_at: number | null;
476
+ chain_id?: string;
473
477
 
474
- type: 'custom_auth';
478
+ connector_type?: string;
475
479
 
476
- verified_at: number;
477
- }
480
+ wallet_client_type?: string;
481
+ }
478
482
 
479
- export interface LinkedAccountAppleOAuth {
480
- email: string | null;
483
+ /**
484
+ * The provider for a smart wallet.
485
+ */
486
+ export type SmartWalletType =
487
+ | 'safe'
488
+ | 'kernel'
489
+ | 'light_account'
490
+ | 'biconomy'
491
+ | 'coinbase_smart_wallet'
492
+ | 'thirdweb';
481
493
 
482
- first_verified_at: number | null;
494
+ /**
495
+ * A smart wallet account linked to the user.
496
+ */
497
+ export interface LinkedAccountSmartWallet {
498
+ address: string;
483
499
 
484
- latest_verified_at: number | null;
500
+ first_verified_at: number | null;
485
501
 
486
- subject: string;
502
+ latest_verified_at: number | null;
487
503
 
488
- type: 'apple_oauth';
504
+ /**
505
+ * The provider for a smart wallet.
506
+ */
507
+ smart_wallet_type: SmartWalletType;
489
508
 
490
- verified_at: number;
491
- }
509
+ type: 'smart_wallet';
492
510
 
493
- export interface LinkedAccountDiscordOAuth {
494
- email: string | null;
511
+ verified_at: number;
495
512
 
496
- first_verified_at: number | null;
513
+ smart_wallet_version?: string;
514
+ }
497
515
 
498
- latest_verified_at: number | null;
516
+ /**
517
+ * A Solana wallet account linked to the user.
518
+ */
519
+ export interface LinkedAccountSolana {
520
+ address: string;
499
521
 
500
- subject: string;
522
+ chain_type: 'solana';
501
523
 
502
- type: 'discord_oauth';
524
+ first_verified_at: number | null;
503
525
 
504
- username: string | null;
526
+ latest_verified_at: number | null;
505
527
 
506
- verified_at: number;
507
- }
528
+ type: 'wallet';
508
529
 
509
- export interface LinkedAccountGitHubOAuth {
510
- email: string | null;
530
+ verified_at: number;
511
531
 
512
- first_verified_at: number | null;
532
+ wallet_client: 'unknown';
513
533
 
514
- latest_verified_at: number | null;
534
+ connector_type?: string;
515
535
 
516
- name: string | null;
536
+ wallet_client_type?: string;
537
+ }
517
538
 
518
- subject: string;
539
+ /**
540
+ * A Farcaster account linked to the user.
541
+ */
542
+ export interface LinkedAccountFarcaster {
543
+ fid: number;
519
544
 
520
- type: 'github_oauth';
545
+ first_verified_at: number | null;
521
546
 
522
- username: string | null;
547
+ latest_verified_at: number | null;
523
548
 
524
- verified_at: number;
525
- }
549
+ owner_address: string;
526
550
 
527
- export interface LinkedAccountGoogleOAuth {
528
- email: string;
551
+ type: 'farcaster';
529
552
 
530
- first_verified_at: number | null;
553
+ verified_at: number;
531
554
 
532
- latest_verified_at: number | null;
555
+ bio?: string;
533
556
 
534
- name: string | null;
557
+ display_name?: string;
535
558
 
536
- subject: string;
559
+ homepage_url?: string;
537
560
 
538
- type: 'google_oauth';
561
+ profile_picture?: string;
539
562
 
540
- verified_at: number;
541
- }
563
+ profile_picture_url?: string;
542
564
 
543
- export interface LinkedAccountInstagramOAuth {
544
- first_verified_at: number | null;
565
+ signer_public_key?: string;
545
566
 
546
- latest_verified_at: number | null;
567
+ username?: string;
568
+ }
547
569
 
548
- subject: string;
570
+ /**
571
+ * A passkey account linked to the user.
572
+ */
573
+ export interface LinkedAccountPasskey {
574
+ credential_id: string;
549
575
 
550
- type: 'instagram_oauth';
576
+ enrolled_in_mfa: boolean;
551
577
 
552
- username: string | null;
578
+ first_verified_at: number | null;
553
579
 
554
- verified_at: number;
555
- }
580
+ latest_verified_at: number | null;
556
581
 
557
- export interface LinkedAccountLinkedInOAuth {
558
- email: string | null;
582
+ type: 'passkey';
559
583
 
560
- first_verified_at: number | null;
584
+ verified_at: number;
561
585
 
562
- latest_verified_at: number | null;
586
+ authenticator_name?: string;
563
587
 
564
- subject: string;
588
+ created_with_browser?: string;
565
589
 
566
- type: 'linkedin_oauth';
590
+ created_with_device?: string;
567
591
 
568
- verified_at: number;
592
+ created_with_os?: string;
569
593
 
570
- name?: string;
594
+ public_key?: string;
595
+ }
571
596
 
572
- vanity_name?: string;
573
- }
597
+ /**
598
+ * A Telegram account linked to the user.
599
+ */
600
+ export interface LinkedAccountTelegram {
601
+ first_verified_at: number | null;
574
602
 
575
- export interface LinkedAccountSpotifyOAuth {
576
- email: string | null;
603
+ latest_verified_at: number | null;
577
604
 
578
- first_verified_at: number | null;
605
+ telegram_user_id: string;
579
606
 
580
- latest_verified_at: number | null;
607
+ type: 'telegram';
581
608
 
582
- name: string | null;
609
+ verified_at: number;
583
610
 
584
- subject: string;
611
+ first_name?: string | null;
585
612
 
586
- type: 'spotify_oauth';
613
+ last_name?: string | null;
587
614
 
588
- verified_at: number;
589
- }
615
+ photo_url?: string | null;
590
616
 
591
- export interface LinkedAccountTiktokOAuth {
592
- first_verified_at: number | null;
617
+ username?: string | null;
618
+ }
593
619
 
594
- latest_verified_at: number | null;
620
+ /**
621
+ * The method used to recover an embedded wallet account.
622
+ */
623
+ export type EmbeddedWalletRecoveryMethod =
624
+ | 'privy'
625
+ | 'user-passcode'
626
+ | 'google-drive'
627
+ | 'icloud'
628
+ | 'recovery-encryption-key'
629
+ | 'privy-v2';
595
630
 
596
- name: string | null;
631
+ /**
632
+ * An Ethereum embedded wallet account linked to the user.
633
+ */
634
+ export interface LinkedAccountEthereumEmbeddedWallet {
635
+ id: string | null;
597
636
 
598
- subject: string;
637
+ address: string;
599
638
 
600
- type: 'tiktok_oauth';
639
+ chain_id: string;
601
640
 
602
- username: string | null;
641
+ chain_type: 'ethereum';
603
642
 
604
- verified_at: number;
605
- }
643
+ connector_type: 'embedded';
606
644
 
607
- export interface LinkedAccountLineOAuth {
608
- email: string | null;
645
+ delegated: boolean;
609
646
 
610
- first_verified_at: number | null;
647
+ first_verified_at: number | null;
611
648
 
612
- latest_verified_at: number | null;
649
+ imported: boolean;
613
650
 
614
- name: string | null;
651
+ latest_verified_at: number | null;
615
652
 
616
- profile_picture_url: string | null;
653
+ /**
654
+ * The method used to recover an embedded wallet account.
655
+ */
656
+ recovery_method: EmbeddedWalletRecoveryMethod;
617
657
 
618
- subject: string;
658
+ type: 'wallet';
619
659
 
620
- type: 'line_oauth';
660
+ verified_at: number;
621
661
 
622
- verified_at: number;
623
- }
662
+ wallet_client: 'privy';
624
663
 
625
- export interface LinkedAccountTwitchOAuth {
626
- first_verified_at: number | null;
664
+ wallet_client_type: 'privy';
627
665
 
628
- latest_verified_at: number | null;
666
+ wallet_index: number;
667
+ }
629
668
 
630
- subject: string;
669
+ /**
670
+ * A Solana embedded wallet account linked to the user.
671
+ */
672
+ export interface LinkedAccountSolanaEmbeddedWallet {
673
+ id: string | null;
631
674
 
632
- type: 'twitch_oauth';
675
+ address: string;
633
676
 
634
- username: string | null;
677
+ chain_id: string;
635
678
 
636
- verified_at: number;
637
- }
679
+ chain_type: 'solana';
638
680
 
639
- export interface LinkedAccountTwitterOAuth {
640
- first_verified_at: number | null;
681
+ connector_type: 'embedded';
641
682
 
642
- latest_verified_at: number | null;
683
+ delegated: boolean;
643
684
 
644
- name: string | null;
685
+ first_verified_at: number | null;
645
686
 
646
- profile_picture_url: string | null;
687
+ imported: boolean;
647
688
 
648
- subject: string;
689
+ latest_verified_at: number | null;
649
690
 
650
- type: 'twitter_oauth';
691
+ public_key: string;
651
692
 
652
- username: string | null;
693
+ /**
694
+ * The method used to recover an embedded wallet account.
695
+ */
696
+ recovery_method: EmbeddedWalletRecoveryMethod;
653
697
 
654
- verified_at: number;
655
- }
698
+ type: 'wallet';
656
699
 
657
- export interface LinkedAccountPasskey {
658
- credential_id: string;
700
+ verified_at: number;
659
701
 
660
- enrolled_in_mfa: boolean;
702
+ wallet_client: 'privy';
661
703
 
662
- first_verified_at: number | null;
704
+ wallet_client_type: 'privy';
663
705
 
664
- latest_verified_at: number | null;
706
+ wallet_index: number;
707
+ }
665
708
 
666
- type: 'passkey';
709
+ /**
710
+ * A Bitcoin SegWit embedded wallet account linked to the user.
711
+ */
712
+ export interface LinkedAccountBitcoinSegwitEmbeddedWallet {
713
+ id: string | null;
667
714
 
668
- verified_at: number;
715
+ address: string;
669
716
 
670
- authenticator_name?: string;
717
+ chain_id: string;
671
718
 
672
- created_with_browser?: string;
719
+ chain_type: 'bitcoin-segwit';
673
720
 
674
- created_with_device?: string;
721
+ connector_type: 'embedded';
675
722
 
676
- created_with_os?: string;
723
+ delegated: boolean;
677
724
 
678
- public_key?: string;
679
- }
725
+ first_verified_at: number | null;
680
726
 
681
- export interface LinkedAccountFarcaster {
682
- fid: number;
727
+ imported: boolean;
683
728
 
684
- first_verified_at: number | null;
729
+ latest_verified_at: number | null;
685
730
 
686
- latest_verified_at: number | null;
731
+ public_key: string;
687
732
 
688
- owner_address: string;
733
+ /**
734
+ * The method used to recover an embedded wallet account.
735
+ */
736
+ recovery_method: EmbeddedWalletRecoveryMethod;
689
737
 
690
- type: 'farcaster';
738
+ type: 'wallet';
691
739
 
692
- verified_at: number;
740
+ verified_at: number;
693
741
 
694
- bio?: string;
742
+ wallet_client: 'privy';
695
743
 
696
- display_name?: string;
744
+ wallet_client_type: 'privy';
697
745
 
698
- homepage_url?: string;
746
+ wallet_index: number;
747
+ }
699
748
 
700
- profile_picture?: string;
749
+ /**
750
+ * A Bitcoin Taproot embedded wallet account linked to the user.
751
+ */
752
+ export interface LinkedAccountBitcoinTaprootEmbeddedWallet {
753
+ id: string | null;
701
754
 
702
- profile_picture_url?: string;
755
+ address: string;
703
756
 
704
- signer_public_key?: string;
757
+ chain_id: string;
705
758
 
706
- username?: string;
707
- }
759
+ chain_type: 'bitcoin-taproot';
708
760
 
709
- export interface LinkedAccountTelegram {
710
- first_verified_at: number | null;
761
+ connector_type: 'embedded';
711
762
 
712
- latest_verified_at: number | null;
763
+ delegated: boolean;
713
764
 
714
- telegram_user_id: string;
765
+ first_verified_at: number | null;
715
766
 
716
- telegramUserId: string;
767
+ imported: boolean;
717
768
 
718
- type: 'telegram';
769
+ latest_verified_at: number | null;
719
770
 
720
- verified_at: number;
771
+ public_key: string;
721
772
 
722
- first_name?: string | null;
773
+ /**
774
+ * The method used to recover an embedded wallet account.
775
+ */
776
+ recovery_method: EmbeddedWalletRecoveryMethod;
723
777
 
724
- firstName?: string | null;
778
+ type: 'wallet';
725
779
 
726
- last_name?: string | null;
780
+ verified_at: number;
727
781
 
728
- photo_url?: string | null;
782
+ wallet_client: 'privy';
729
783
 
730
- username?: string | null;
731
- }
784
+ wallet_client_type: 'privy';
732
785
 
733
- export interface LinkedAccountEthereum {
734
- address: string;
786
+ wallet_index: number;
787
+ }
735
788
 
736
- chain_type: 'ethereum';
789
+ /**
790
+ * A curve signing embedded wallet account linked to the user.
791
+ */
792
+ export interface LinkedAccountCurveSigningEmbeddedWallet {
793
+ id: string | null;
737
794
 
738
- first_verified_at: number | null;
795
+ address: string;
739
796
 
740
- latest_verified_at: number | null;
797
+ chain_id: string;
741
798
 
742
- type: 'wallet';
799
+ /**
800
+ * The wallet chain types that support curve-based signing.
801
+ */
802
+ chain_type: WalletsAPI.CurveSigningChainType;
743
803
 
744
- verified_at: number;
804
+ connector_type: 'embedded';
745
805
 
746
- wallet_client: 'unknown';
806
+ delegated: boolean;
747
807
 
748
- chain_id?: string;
808
+ first_verified_at: number | null;
749
809
 
750
- connector_type?: string;
810
+ imported: boolean;
751
811
 
752
- wallet_client_type?: string;
753
- }
812
+ latest_verified_at: number | null;
754
813
 
755
- export interface LinkedAccountSolana {
756
- address: string;
814
+ public_key: string;
757
815
 
758
- chain_type: 'solana';
816
+ /**
817
+ * The method used to recover an embedded wallet account.
818
+ */
819
+ recovery_method: EmbeddedWalletRecoveryMethod;
759
820
 
760
- first_verified_at: number | null;
821
+ type: 'wallet';
761
822
 
762
- latest_verified_at: number | null;
823
+ verified_at: number;
763
824
 
764
- type: 'wallet';
825
+ wallet_client: 'privy';
765
826
 
766
- verified_at: number;
827
+ wallet_client_type: 'privy';
767
828
 
768
- wallet_client: 'unknown';
829
+ wallet_index: number;
830
+ }
769
831
 
770
- connector_type?: string;
832
+ export type LinkedAccountEmbeddedWallet =
833
+ | LinkedAccountEthereumEmbeddedWallet
834
+ | LinkedAccountSolanaEmbeddedWallet
835
+ | LinkedAccountBitcoinSegwitEmbeddedWallet
836
+ | LinkedAccountBitcoinTaprootEmbeddedWallet
837
+ | LinkedAccountCurveSigningEmbeddedWallet;
771
838
 
772
- wallet_client_type?: string;
773
- }
839
+ /**
840
+ * An embedded wallet account with an ID.
841
+ */
842
+ export type LinkedAccountEmbeddedWalletWithID =
843
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountEthereumEmbeddedWallet
844
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountSolanaEmbeddedWallet
845
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinSegwitEmbeddedWallet
846
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinTaprootEmbeddedWallet
847
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountCurveSigningEmbeddedWallet;
774
848
 
775
- export interface LinkedAccountCustomOAuth {
776
- first_verified_at: number | null;
849
+ export namespace LinkedAccountEmbeddedWalletWithID {
850
+ /**
851
+ * An Ethereum embedded wallet account linked to the user.
852
+ */
853
+ export interface LinkedAccountEthereumEmbeddedWallet
854
+ extends Omit<UsersAPI.LinkedAccountEthereumEmbeddedWallet, 'id' | 'recovery_method'> {
855
+ id: string;
777
856
 
778
- latest_verified_at: number | null;
857
+ recovery_method: 'privy-v2';
858
+ }
859
+
860
+ /**
861
+ * A Solana embedded wallet account linked to the user.
862
+ */
863
+ export interface LinkedAccountSolanaEmbeddedWallet
864
+ extends Omit<UsersAPI.LinkedAccountSolanaEmbeddedWallet, 'id' | 'recovery_method'> {
865
+ id: string;
779
866
 
780
- subject: string;
867
+ recovery_method: 'privy-v2';
868
+ }
781
869
 
782
- /**
783
- * The ID of a custom OAuth provider, set up for this app. Must start with
784
- * "custom:".
785
- */
786
- type: ClientAuthAPI.CustomOAuthProviderID;
870
+ /**
871
+ * A Bitcoin SegWit embedded wallet account linked to the user.
872
+ */
873
+ export interface LinkedAccountBitcoinSegwitEmbeddedWallet
874
+ extends Omit<UsersAPI.LinkedAccountBitcoinSegwitEmbeddedWallet, 'id' | 'recovery_method'> {
875
+ id: string;
787
876
 
788
- verified_at: number;
877
+ recovery_method: 'privy-v2';
878
+ }
789
879
 
790
- email?: string;
880
+ /**
881
+ * A Bitcoin Taproot embedded wallet account linked to the user.
882
+ */
883
+ export interface LinkedAccountBitcoinTaprootEmbeddedWallet
884
+ extends Omit<UsersAPI.LinkedAccountBitcoinTaprootEmbeddedWallet, 'id' | 'recovery_method'> {
885
+ id: string;
791
886
 
792
- name?: string;
887
+ recovery_method: 'privy-v2';
888
+ }
793
889
 
794
- profile_picture_url?: string;
890
+ /**
891
+ * A curve signing embedded wallet account linked to the user.
892
+ */
893
+ export interface LinkedAccountCurveSigningEmbeddedWallet
894
+ extends Omit<UsersAPI.LinkedAccountCurveSigningEmbeddedWallet, 'id' | 'recovery_method'> {
895
+ id: string;
795
896
 
796
- username?: string;
897
+ recovery_method: 'privy-v2';
797
898
  }
798
899
  }
799
900
 
800
- export interface User {
801
- id: string;
901
+ /**
902
+ * A Google OAuth account linked to the user.
903
+ */
904
+ export interface LinkedAccountGoogleOAuth {
905
+ email: string;
802
906
 
803
- /**
804
- * Unix timestamp of when the user was created in milliseconds.
805
- */
806
- created_at: number;
907
+ first_verified_at: number | null;
807
908
 
808
- /**
809
- * Indicates if the user has accepted the terms of service.
810
- */
811
- has_accepted_terms: boolean;
909
+ latest_verified_at: number | null;
812
910
 
813
- /**
814
- * Indicates if the user is a guest account user.
815
- */
816
- is_guest: boolean;
911
+ name: string | null;
817
912
 
818
- linked_accounts: Array<LinkedAccount>;
913
+ subject: string;
819
914
 
820
- mfa_methods: Array<User.PasskeyMfaMethod | User.SMSMfaMethod | User.TotpMfaMethod>;
915
+ type: 'google_oauth';
821
916
 
822
- /**
823
- * Custom metadata associated with the user.
824
- */
825
- custom_metadata?: { [key: string]: string | number | boolean };
917
+ verified_at: number;
826
918
  }
827
919
 
828
- export namespace User {
829
- export interface PasskeyMfaMethod {
830
- type: 'passkey';
920
+ /**
921
+ * A Twitter OAuth account linked to the user.
922
+ */
923
+ export interface LinkedAccountTwitterOAuth {
924
+ first_verified_at: number | null;
831
925
 
832
- verified_at: number;
833
- }
926
+ latest_verified_at: number | null;
834
927
 
835
- export interface SMSMfaMethod {
836
- type: 'sms';
928
+ name: string | null;
837
929
 
838
- verified_at: number;
839
- }
930
+ profile_picture_url: string | null;
840
931
 
841
- export interface TotpMfaMethod {
842
- type: 'totp';
932
+ subject: string;
843
933
 
844
- verified_at: number;
845
- }
934
+ type: 'twitter_oauth';
935
+
936
+ username: string | null;
937
+
938
+ verified_at: number;
846
939
  }
847
940
 
848
- export interface LinkedAccountEthereumEmbeddedWallet {
849
- id: string | null;
941
+ /**
942
+ * A Discord OAuth account linked to the user.
943
+ */
944
+ export interface LinkedAccountDiscordOAuth {
945
+ email: string | null;
850
946
 
851
- address: string;
947
+ first_verified_at: number | null;
852
948
 
853
- chain_id: string;
949
+ latest_verified_at: number | null;
854
950
 
855
- chain_type: 'ethereum';
951
+ subject: string;
856
952
 
857
- connector_type: 'embedded';
953
+ type: 'discord_oauth';
858
954
 
859
- delegated: boolean;
955
+ username: string | null;
860
956
 
861
- first_verified_at: number | null;
957
+ verified_at: number;
958
+ }
862
959
 
863
- imported: boolean;
960
+ /**
961
+ * A GitHub OAuth account linked to the user.
962
+ */
963
+ export interface LinkedAccountGitHubOAuth {
964
+ email: string | null;
965
+
966
+ first_verified_at: number | null;
864
967
 
865
968
  latest_verified_at: number | null;
866
969
 
867
- recovery_method:
868
- | 'privy'
869
- | 'user-passcode'
870
- | 'google-drive'
871
- | 'icloud'
872
- | 'recovery-encryption-key'
873
- | 'privy-v2';
970
+ name: string | null;
874
971
 
875
- type: 'wallet';
972
+ subject: string;
973
+
974
+ type: 'github_oauth';
975
+
976
+ username: string | null;
876
977
 
877
978
  verified_at: number;
979
+ }
878
980
 
879
- wallet_client: 'privy';
981
+ /**
982
+ * A LinkedIn OAuth account linked to the user.
983
+ */
984
+ export interface LinkedAccountLinkedInOAuth {
985
+ email: string | null;
880
986
 
881
- wallet_client_type: 'privy';
987
+ first_verified_at: number | null;
882
988
 
883
- wallet_index: number;
989
+ latest_verified_at: number | null;
990
+
991
+ subject: string;
992
+
993
+ type: 'linkedin_oauth';
994
+
995
+ verified_at: number;
996
+
997
+ name?: string;
998
+
999
+ vanity_name?: string;
884
1000
  }
885
1001
 
886
- export interface LinkedAccountSolanaEmbeddedWallet {
887
- id: string | null;
1002
+ /**
1003
+ * A Spotify OAuth account linked to the user.
1004
+ */
1005
+ export interface LinkedAccountSpotifyOAuth {
1006
+ email: string | null;
888
1007
 
889
- address: string;
1008
+ first_verified_at: number | null;
890
1009
 
891
- chain_id: string;
1010
+ latest_verified_at: number | null;
892
1011
 
893
- chain_type: 'solana';
1012
+ name: string | null;
894
1013
 
895
- connector_type: 'embedded';
1014
+ subject: string;
896
1015
 
897
- delegated: boolean;
1016
+ type: 'spotify_oauth';
898
1017
 
1018
+ verified_at: number;
1019
+ }
1020
+
1021
+ /**
1022
+ * An Instagram OAuth account linked to the user.
1023
+ */
1024
+ export interface LinkedAccountInstagramOAuth {
899
1025
  first_verified_at: number | null;
900
1026
 
901
- imported: boolean;
1027
+ latest_verified_at: number | null;
1028
+
1029
+ subject: string;
1030
+
1031
+ type: 'instagram_oauth';
1032
+
1033
+ username: string | null;
1034
+
1035
+ verified_at: number;
1036
+ }
1037
+
1038
+ /**
1039
+ * A TikTok OAuth account linked to the user.
1040
+ */
1041
+ export interface LinkedAccountTiktokOAuth {
1042
+ first_verified_at: number | null;
902
1043
 
903
1044
  latest_verified_at: number | null;
904
1045
 
905
- public_key: string;
1046
+ name: string | null;
906
1047
 
907
- recovery_method:
908
- | 'privy'
909
- | 'user-passcode'
910
- | 'google-drive'
911
- | 'icloud'
912
- | 'recovery-encryption-key'
913
- | 'privy-v2';
1048
+ subject: string;
914
1049
 
915
- type: 'wallet';
1050
+ type: 'tiktok_oauth';
1051
+
1052
+ username: string | null;
916
1053
 
917
1054
  verified_at: number;
1055
+ }
918
1056
 
919
- wallet_client: 'privy';
1057
+ /**
1058
+ * A LINE OAuth account linked to the user.
1059
+ */
1060
+ export interface LinkedAccountLineOAuth {
1061
+ email: string | null;
920
1062
 
921
- wallet_client_type: 'privy';
1063
+ first_verified_at: number | null;
922
1064
 
923
- wallet_index: number;
1065
+ latest_verified_at: number | null;
1066
+
1067
+ name: string | null;
1068
+
1069
+ profile_picture_url: string | null;
1070
+
1071
+ subject: string;
1072
+
1073
+ type: 'line_oauth';
1074
+
1075
+ verified_at: number;
924
1076
  }
925
1077
 
926
- export interface LinkedAccountBitcoinSegwitEmbeddedWallet {
927
- id: string | null;
1078
+ /**
1079
+ * A Twitch OAuth account linked to the user.
1080
+ */
1081
+ export interface LinkedAccountTwitchOAuth {
1082
+ first_verified_at: number | null;
928
1083
 
929
- address: string;
1084
+ latest_verified_at: number | null;
930
1085
 
931
- chain_id: string;
1086
+ subject: string;
932
1087
 
933
- chain_type: 'bitcoin-segwit';
1088
+ type: 'twitch_oauth';
934
1089
 
935
- connector_type: 'embedded';
1090
+ username: string | null;
936
1091
 
937
- delegated: boolean;
1092
+ verified_at: number;
1093
+ }
1094
+
1095
+ /**
1096
+ * An Apple OAuth account linked to the user.
1097
+ */
1098
+ export interface LinkedAccountAppleOAuth {
1099
+ email: string | null;
938
1100
 
939
1101
  first_verified_at: number | null;
940
1102
 
941
- imported: boolean;
1103
+ latest_verified_at: number | null;
1104
+
1105
+ subject: string;
1106
+
1107
+ type: 'apple_oauth';
1108
+
1109
+ verified_at: number;
1110
+ }
1111
+
1112
+ /**
1113
+ * A custom OAuth account linked to the user.
1114
+ */
1115
+ export interface LinkedAccountCustomOAuth {
1116
+ first_verified_at: number | null;
942
1117
 
943
1118
  latest_verified_at: number | null;
944
1119
 
945
- public_key: string;
1120
+ subject: string;
1121
+
1122
+ verified_at: number;
946
1123
 
947
- recovery_method:
948
- | 'privy'
949
- | 'user-passcode'
950
- | 'google-drive'
951
- | 'icloud'
952
- | 'recovery-encryption-key'
953
- | 'privy-v2';
1124
+ email?: string;
954
1125
 
955
- type: 'wallet';
1126
+ name?: string;
1127
+
1128
+ profile_picture_url?: string;
1129
+
1130
+ /**
1131
+ * The ID of a custom OAuth provider, set up for this app. Must start with
1132
+ * "custom:".
1133
+ */
1134
+ type?: ClientAuthAPI.CustomOAuthProviderID;
1135
+
1136
+ username?: string;
1137
+ }
1138
+
1139
+ /**
1140
+ * A custom JWT account linked to the user.
1141
+ */
1142
+ export interface LinkedAccountCustomJwt {
1143
+ custom_user_id: string;
1144
+
1145
+ first_verified_at: number | null;
1146
+
1147
+ latest_verified_at: number | null;
1148
+
1149
+ type: 'custom_auth';
956
1150
 
957
1151
  verified_at: number;
1152
+ }
958
1153
 
959
- wallet_client: 'privy';
1154
+ /**
1155
+ * An embedded wallet associated with a cross-app account.
1156
+ */
1157
+ export interface CrossAppEmbeddedWallet {
1158
+ address: string;
1159
+ }
960
1160
 
961
- wallet_client_type: 'privy';
1161
+ /**
1162
+ * A smart wallet associated with a cross-app account.
1163
+ */
1164
+ export interface CrossAppSmartWallet {
1165
+ address: string;
1166
+ }
1167
+
1168
+ /**
1169
+ * A cross-app account linked to the user.
1170
+ */
1171
+ export interface LinkedAccountCrossApp {
1172
+ embedded_wallets: Array<CrossAppEmbeddedWallet>;
962
1173
 
963
- wallet_index: number;
964
- }
1174
+ first_verified_at: number | null;
965
1175
 
966
- export interface LinkedAccountBitcoinTaprootEmbeddedWallet {
967
- id: string | null;
1176
+ latest_verified_at: number | null;
968
1177
 
969
- address: string;
1178
+ provider_app_id: string;
970
1179
 
971
- chain_id: string;
1180
+ smart_wallets: Array<CrossAppSmartWallet>;
972
1181
 
973
- chain_type: 'bitcoin-taproot';
1182
+ subject: string;
974
1183
 
975
- connector_type: 'embedded';
1184
+ type: 'cross_app';
976
1185
 
977
- delegated: boolean;
1186
+ verified_at: number;
1187
+ }
978
1188
 
1189
+ /**
1190
+ * An authorization key linked to the user.
1191
+ */
1192
+ export interface LinkedAccountAuthorizationKey {
979
1193
  first_verified_at: number | null;
980
1194
 
981
- imported: boolean;
982
-
983
1195
  latest_verified_at: number | null;
984
1196
 
985
1197
  public_key: string;
986
1198
 
987
- recovery_method:
988
- | 'privy'
989
- | 'user-passcode'
990
- | 'google-drive'
991
- | 'icloud'
992
- | 'recovery-encryption-key'
993
- | 'privy-v2';
994
-
995
- type: 'wallet';
1199
+ type: 'authorization_key';
996
1200
 
997
1201
  verified_at: number;
998
-
999
- wallet_client: 'privy';
1000
-
1001
- wallet_client_type: 'privy';
1002
-
1003
- wallet_index: number;
1004
1202
  }
1005
1203
 
1006
- export interface LinkedAccountCurveSigningEmbeddedWallet {
1007
- id: string | null;
1008
-
1009
- address: string;
1204
+ /**
1205
+ * The possible types of linked accounts.
1206
+ */
1207
+ export type LinkedAccountType =
1208
+ | 'email'
1209
+ | 'phone'
1210
+ | 'wallet'
1211
+ | 'smart_wallet'
1212
+ | 'google_oauth'
1213
+ | 'twitter_oauth'
1214
+ | 'discord_oauth'
1215
+ | 'github_oauth'
1216
+ | 'spotify_oauth'
1217
+ | 'instagram_oauth'
1218
+ | 'tiktok_oauth'
1219
+ | 'line_oauth'
1220
+ | 'twitch_oauth'
1221
+ | 'linkedin_oauth'
1222
+ | 'apple_oauth'
1223
+ | 'custom_auth'
1224
+ | 'farcaster'
1225
+ | 'passkey'
1226
+ | 'telegram'
1227
+ | 'cross_app'
1228
+ | 'authorization_key'
1229
+ | ClientAuthAPI.CustomOAuthProviderID;
1010
1230
 
1011
- chain_id: string;
1231
+ /**
1232
+ * Custom metadata associated with the user.
1233
+ */
1234
+ export type CustomMetadata = { [key: string]: string | number | boolean };
1012
1235
 
1013
- /**
1014
- * The wallet chain types that support curve-based signing.
1015
- */
1016
- chain_type: WalletsAPI.CurveSigningChainType;
1236
+ /**
1237
+ * The payload for importing a wallet account.
1238
+ */
1239
+ export interface LinkedAccountWalletInput {
1240
+ address: string;
1017
1241
 
1018
- connector_type: 'embedded';
1242
+ chain_type: 'ethereum' | 'solana';
1019
1243
 
1020
- delegated: boolean;
1244
+ type: 'wallet';
1245
+ }
1021
1246
 
1022
- first_verified_at: number | null;
1247
+ /**
1248
+ * The payload for importing an email account.
1249
+ */
1250
+ export interface LinkedAccountEmailInput {
1251
+ address: string;
1023
1252
 
1024
- imported: boolean;
1253
+ type: 'email';
1254
+ }
1025
1255
 
1026
- latest_verified_at: number | null;
1256
+ /**
1257
+ * The payload for importing a phone account.
1258
+ */
1259
+ export interface LinkedAccountPhoneInput {
1260
+ number: string;
1027
1261
 
1028
- public_key: string;
1262
+ type: 'phone';
1263
+ }
1029
1264
 
1030
- recovery_method:
1031
- | 'privy'
1032
- | 'user-passcode'
1033
- | 'google-drive'
1034
- | 'icloud'
1035
- | 'recovery-encryption-key'
1036
- | 'privy-v2';
1265
+ /**
1266
+ * The payload for importing a Google account.
1267
+ */
1268
+ export interface LinkedAccountGoogleInput {
1269
+ email: string;
1037
1270
 
1038
- type: 'wallet';
1271
+ name: string;
1039
1272
 
1040
- verified_at: number;
1273
+ subject: string;
1041
1274
 
1042
- wallet_client: 'privy';
1275
+ type: 'google_oauth';
1276
+ }
1043
1277
 
1044
- wallet_client_type: 'privy';
1278
+ /**
1279
+ * The payload for importing a Twitter account.
1280
+ */
1281
+ export interface LinkedAccountTwitterInput {
1282
+ name: string;
1045
1283
 
1046
- wallet_index: number;
1047
- }
1284
+ subject: string;
1048
1285
 
1049
- export type LinkedAccountEmbeddedWallet =
1050
- | LinkedAccountEthereumEmbeddedWallet
1051
- | LinkedAccountSolanaEmbeddedWallet
1052
- | LinkedAccountBitcoinSegwitEmbeddedWallet
1053
- | LinkedAccountBitcoinTaprootEmbeddedWallet
1054
- | LinkedAccountCurveSigningEmbeddedWallet;
1286
+ type: 'twitter_oauth';
1055
1287
 
1056
- export type LinkedAccountEmbeddedWalletWithID =
1057
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountEthereumEmbeddedWallet
1058
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountSolanaEmbeddedWallet
1059
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinSegwitEmbeddedWallet
1060
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinTaprootEmbeddedWallet
1061
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountCurveSigningEmbeddedWallet;
1288
+ username: string;
1062
1289
 
1063
- export namespace LinkedAccountEmbeddedWalletWithID {
1064
- export interface LinkedAccountEthereumEmbeddedWallet
1065
- extends Omit<UsersAPI.LinkedAccountEthereumEmbeddedWallet, 'id' | 'recovery_method'> {
1066
- id: string;
1290
+ profile_picture_url?: string;
1291
+ }
1067
1292
 
1068
- recovery_method: 'privy-v2';
1069
- }
1293
+ /**
1294
+ * The payload for importing a Discord account.
1295
+ */
1296
+ export interface LinkedAccountDiscordInput {
1297
+ subject: string;
1070
1298
 
1071
- export interface LinkedAccountSolanaEmbeddedWallet
1072
- extends Omit<UsersAPI.LinkedAccountSolanaEmbeddedWallet, 'id' | 'recovery_method'> {
1073
- id: string;
1299
+ type: 'discord_oauth';
1074
1300
 
1075
- recovery_method: 'privy-v2';
1076
- }
1301
+ username: string;
1077
1302
 
1078
- export interface LinkedAccountBitcoinSegwitEmbeddedWallet
1079
- extends Omit<UsersAPI.LinkedAccountBitcoinSegwitEmbeddedWallet, 'id' | 'recovery_method'> {
1080
- id: string;
1303
+ email?: string;
1304
+ }
1081
1305
 
1082
- recovery_method: 'privy-v2';
1083
- }
1306
+ /**
1307
+ * The payload for importing a Github account.
1308
+ */
1309
+ export interface LinkedAccountGitHubInput {
1310
+ subject: string;
1084
1311
 
1085
- export interface LinkedAccountBitcoinTaprootEmbeddedWallet
1086
- extends Omit<UsersAPI.LinkedAccountBitcoinTaprootEmbeddedWallet, 'id' | 'recovery_method'> {
1087
- id: string;
1312
+ type: 'github_oauth';
1088
1313
 
1089
- recovery_method: 'privy-v2';
1090
- }
1314
+ username: string;
1091
1315
 
1092
- export interface LinkedAccountCurveSigningEmbeddedWallet
1093
- extends Omit<UsersAPI.LinkedAccountCurveSigningEmbeddedWallet, 'id' | 'recovery_method'> {
1094
- id: string;
1316
+ email?: string;
1095
1317
 
1096
- recovery_method: 'privy-v2';
1097
- }
1318
+ name?: string;
1098
1319
  }
1099
1320
 
1100
- export type SmartWalletType =
1101
- | 'safe'
1102
- | 'kernel'
1103
- | 'light_account'
1104
- | 'biconomy'
1105
- | 'coinbase_smart_wallet'
1106
- | 'thirdweb';
1107
-
1108
- export interface LinkedAccountSmartWallet {
1109
- address: string;
1321
+ /**
1322
+ * The payload for importing a Spotify account.
1323
+ */
1324
+ export interface LinkedAccountSpotifyInput {
1325
+ subject: string;
1110
1326
 
1111
- first_verified_at: number | null;
1327
+ type: 'spotify_oauth';
1112
1328
 
1113
- latest_verified_at: number | null;
1329
+ email?: string;
1114
1330
 
1115
- smart_wallet_type: SmartWalletType;
1331
+ name?: string;
1332
+ }
1116
1333
 
1117
- type: 'smart_wallet';
1334
+ /**
1335
+ * The payload for importing an Instagram account.
1336
+ */
1337
+ export interface LinkedAccountInstagramInput {
1338
+ subject: string;
1118
1339
 
1119
- verified_at: number;
1340
+ type: 'instagram_oauth';
1120
1341
 
1121
- smart_wallet_version?: string;
1342
+ username: string;
1122
1343
  }
1123
1344
 
1124
- export interface UserCreateParams {
1125
- linked_accounts: Array<
1126
- | UserCreateParams.LinkedAccountWalletInput
1127
- | UserCreateParams.LinkedAccountEmailInput
1128
- | UserCreateParams.LinkedAccountPhoneInput
1129
- | UserCreateParams.LinkedAccountGoogleInput
1130
- | UserCreateParams.LinkedAccountTwitterInput
1131
- | UserCreateParams.LinkedAccountDiscordInput
1132
- | UserCreateParams.LinkedAccountGitHubInput
1133
- | UserCreateParams.LinkedAccountSpotifyInput
1134
- | UserCreateParams.LinkedAccountInstagramInput
1135
- | UserCreateParams.LinkedAccountTiktokInput
1136
- | UserCreateParams.LinkedAccountLineInput
1137
- | UserCreateParams.LinkedAccountTwitchInput
1138
- | UserCreateParams.LinkedAccountAppleInput
1139
- | UserCreateParams.LinkedAccountLinkedInInput
1140
- | UserCreateParams.LinkedAccountFarcasterInput
1141
- | UserCreateParams.LinkedAccountTelegramInput
1142
- | UserCreateParams.LinkedAccountCustomJwtInput
1143
- >;
1345
+ /**
1346
+ * The payload for importing a Tiktok account.
1347
+ */
1348
+ export interface LinkedAccountTiktokInput {
1349
+ name: string | null;
1144
1350
 
1145
- /**
1146
- * Custom metadata associated with the user.
1147
- */
1148
- custom_metadata?: { [key: string]: string | number | boolean };
1351
+ subject: string;
1149
1352
 
1150
- /**
1151
- * Wallets to create for the user.
1152
- */
1153
- wallets?: Array<UserCreateParams.Wallet>;
1154
- }
1353
+ type: 'tiktok_oauth';
1155
1354
 
1156
- export namespace UserCreateParams {
1157
- export interface LinkedAccountWalletInput {
1158
- address: string;
1355
+ username: string;
1356
+ }
1159
1357
 
1160
- chain_type: 'ethereum' | 'solana';
1358
+ /**
1359
+ * The payload for importing a LINE account.
1360
+ */
1361
+ export interface LinkedAccountLineInput {
1362
+ subject: string;
1161
1363
 
1162
- type: 'wallet';
1163
- }
1364
+ type: 'line_oauth';
1164
1365
 
1165
- export interface LinkedAccountEmailInput {
1166
- address: string;
1366
+ email?: string;
1167
1367
 
1168
- type: 'email';
1169
- }
1368
+ name?: string;
1170
1369
 
1171
- export interface LinkedAccountPhoneInput {
1172
- number: string;
1370
+ profile_picture_url?: string;
1371
+ }
1173
1372
 
1174
- type: 'phone';
1175
- }
1373
+ /**
1374
+ * The payload for importing a Twitch account.
1375
+ */
1376
+ export interface LinkedAccountTwitchInput {
1377
+ subject: string;
1176
1378
 
1177
- export interface LinkedAccountGoogleInput {
1178
- email: string;
1379
+ type: 'twitch_oauth';
1179
1380
 
1180
- name: string;
1381
+ username?: string;
1382
+ }
1181
1383
 
1182
- subject: string;
1384
+ /**
1385
+ * The payload for importing an Apple account.
1386
+ */
1387
+ export interface LinkedAccountAppleInput {
1388
+ subject: string;
1183
1389
 
1184
- type: 'google_oauth';
1185
- }
1390
+ type: 'apple_oauth';
1186
1391
 
1187
- export interface LinkedAccountTwitterInput {
1188
- name: string;
1392
+ email?: string;
1393
+ }
1189
1394
 
1190
- subject: string;
1395
+ /**
1396
+ * The payload for importing a LinkedIn account.
1397
+ */
1398
+ export interface LinkedAccountLinkedInInput {
1399
+ subject: string;
1191
1400
 
1192
- type: 'twitter_oauth';
1401
+ type: 'linkedin_oauth';
1193
1402
 
1194
- username: string;
1403
+ email?: string;
1195
1404
 
1196
- profile_picture_url?: string;
1197
- }
1405
+ name?: string;
1198
1406
 
1199
- export interface LinkedAccountDiscordInput {
1200
- subject: string;
1407
+ vanityName?: string;
1408
+ }
1201
1409
 
1202
- type: 'discord_oauth';
1410
+ /**
1411
+ * The payload for importing a Farcaster account.
1412
+ */
1413
+ export interface LinkedAccountFarcasterInput {
1414
+ fid: number;
1203
1415
 
1204
- username: string;
1416
+ owner_address: string;
1205
1417
 
1206
- email?: string;
1207
- }
1418
+ type: 'farcaster';
1208
1419
 
1209
- export interface LinkedAccountGitHubInput {
1210
- subject: string;
1420
+ bio?: string;
1211
1421
 
1212
- type: 'github_oauth';
1422
+ display_name?: string;
1213
1423
 
1214
- username: string;
1424
+ homepage_url?: string;
1215
1425
 
1216
- email?: string;
1426
+ profile_picture_url?: string;
1217
1427
 
1218
- name?: string;
1219
- }
1428
+ username?: string;
1429
+ }
1220
1430
 
1221
- export interface LinkedAccountSpotifyInput {
1222
- subject: string;
1431
+ /**
1432
+ * The payload for importing a Telegram account.
1433
+ */
1434
+ export interface LinkedAccountTelegramInput {
1435
+ telegram_user_id: string;
1223
1436
 
1224
- type: 'spotify_oauth';
1437
+ type: 'telegram';
1225
1438
 
1226
- email?: string;
1439
+ first_name?: string;
1227
1440
 
1228
- name?: string;
1229
- }
1441
+ last_name?: string;
1230
1442
 
1231
- export interface LinkedAccountInstagramInput {
1232
- subject: string;
1443
+ photo_url?: string;
1233
1444
 
1234
- type: 'instagram_oauth';
1445
+ username?: string;
1446
+ }
1235
1447
 
1236
- username: string;
1237
- }
1448
+ /**
1449
+ * The payload for importing a Custom JWT account.
1450
+ */
1451
+ export interface LinkedAccountCustomJwtInput {
1452
+ custom_user_id: string;
1238
1453
 
1239
- export interface LinkedAccountTiktokInput {
1240
- name: string | null;
1454
+ type: 'custom_auth';
1455
+ }
1241
1456
 
1242
- subject: string;
1457
+ /**
1458
+ * The input for adding a linked account to a user.
1459
+ */
1460
+ export type LinkedAccountInput =
1461
+ | LinkedAccountWalletInput
1462
+ | LinkedAccountEmailInput
1463
+ | LinkedAccountPhoneInput
1464
+ | LinkedAccountGoogleInput
1465
+ | LinkedAccountTwitterInput
1466
+ | LinkedAccountDiscordInput
1467
+ | LinkedAccountGitHubInput
1468
+ | LinkedAccountSpotifyInput
1469
+ | LinkedAccountInstagramInput
1470
+ | LinkedAccountTiktokInput
1471
+ | LinkedAccountLineInput
1472
+ | LinkedAccountTwitchInput
1473
+ | LinkedAccountAppleInput
1474
+ | LinkedAccountLinkedInInput
1475
+ | LinkedAccountFarcasterInput
1476
+ | LinkedAccountTelegramInput
1477
+ | LinkedAccountCustomJwtInput;
1243
1478
 
1244
- type: 'tiktok_oauth';
1479
+ /**
1480
+ * The payload for batch creating users.
1481
+ */
1482
+ export interface UserBatchCreateInput {
1483
+ users: Array<UserBatchCreateInput.User>;
1484
+ }
1245
1485
 
1246
- username: string;
1247
- }
1486
+ export namespace UserBatchCreateInput {
1487
+ export interface User {
1488
+ linked_accounts: Array<UsersAPI.LinkedAccountInput>;
1248
1489
 
1249
- export interface LinkedAccountLineInput {
1250
- subject: string;
1490
+ create_embedded_wallet?: boolean;
1251
1491
 
1252
- type: 'line_oauth';
1492
+ create_ethereum_smart_wallet?: boolean;
1253
1493
 
1254
- email?: string;
1494
+ create_ethereum_wallet?: boolean;
1255
1495
 
1256
- name?: string;
1496
+ create_n_embedded_wallets?: number;
1257
1497
 
1258
- profile_picture_url?: string;
1259
- }
1498
+ create_n_ethereum_wallets?: number;
1260
1499
 
1261
- export interface LinkedAccountTwitchInput {
1262
- subject: string;
1500
+ create_solana_wallet?: boolean;
1263
1501
 
1264
- type: 'twitch_oauth';
1502
+ /**
1503
+ * Custom metadata associated with the user.
1504
+ */
1505
+ custom_metadata?: UsersAPI.CustomMetadata;
1265
1506
 
1266
- username?: string;
1507
+ wallets?: Array<User.Wallet>;
1267
1508
  }
1268
1509
 
1269
- export interface LinkedAccountAppleInput {
1270
- subject: string;
1510
+ export namespace User {
1511
+ export interface Wallet {
1512
+ /**
1513
+ * The wallet chain types.
1514
+ */
1515
+ chain_type: WalletsAPI.WalletChainType;
1271
1516
 
1272
- type: 'apple_oauth';
1517
+ additional_signers?: Array<Wallet.AdditionalSigner>;
1273
1518
 
1274
- email?: string;
1275
- }
1519
+ create_smart_wallet?: boolean;
1276
1520
 
1277
- export interface LinkedAccountLinkedInInput {
1278
- subject: string;
1521
+ policy_ids?: Array<string>;
1522
+ }
1279
1523
 
1280
- type: 'linkedin_oauth';
1524
+ export namespace Wallet {
1525
+ export interface AdditionalSigner {
1526
+ signer_id: string;
1281
1527
 
1282
- email?: string;
1528
+ override_policy_ids?: Array<string>;
1529
+ }
1530
+ }
1531
+ }
1532
+ }
1283
1533
 
1284
- name?: string;
1534
+ /**
1535
+ * A SMS MFA method.
1536
+ */
1537
+ export interface SMSMfaMethod {
1538
+ type: 'sms';
1285
1539
 
1286
- vanityName?: string;
1287
- }
1540
+ verified_at: number;
1541
+ }
1288
1542
 
1289
- export interface LinkedAccountFarcasterInput {
1290
- fid: number;
1543
+ /**
1544
+ * A TOTP MFA method.
1545
+ */
1546
+ export interface TotpMfaMethod {
1547
+ type: 'totp';
1291
1548
 
1292
- owner_address: string;
1549
+ verified_at: number;
1550
+ }
1293
1551
 
1294
- type: 'farcaster';
1552
+ /**
1553
+ * A Passkey MFA method.
1554
+ */
1555
+ export interface PasskeyMfaMethod {
1556
+ type: 'passkey';
1295
1557
 
1296
- bio?: string;
1558
+ verified_at: number;
1559
+ }
1297
1560
 
1298
- display_name?: string;
1561
+ /**
1562
+ * A multi-factor authentication method linked to the user.
1563
+ */
1564
+ export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
1299
1565
 
1300
- homepage_url?: string;
1566
+ /**
1567
+ * OAuth tokens associated with the user.
1568
+ */
1569
+ export interface OAuthTokens {
1570
+ access_token: string;
1301
1571
 
1302
- profile_picture_url?: string;
1572
+ provider: string;
1303
1573
 
1304
- username?: string;
1305
- }
1574
+ access_token_expires_in_seconds?: number;
1306
1575
 
1307
- export interface LinkedAccountTelegramInput {
1308
- telegram_user_id: string;
1576
+ refresh_token?: string;
1309
1577
 
1310
- type: 'telegram';
1578
+ refresh_token_expires_in_seconds?: number;
1311
1579
 
1312
- first_name?: string;
1580
+ scopes?: Array<string>;
1581
+ }
1313
1582
 
1314
- last_name?: string;
1583
+ /**
1584
+ * The user object along their identity token.
1585
+ */
1586
+ export interface UserWithIdentityToken {
1587
+ identity_token: string | null;
1315
1588
 
1316
- photo_url?: string;
1589
+ /**
1590
+ * A Privy user object.
1591
+ */
1592
+ user: User;
1593
+ }
1317
1594
 
1318
- username?: string;
1319
- }
1595
+ export interface UserCreateParams {
1596
+ linked_accounts: Array<LinkedAccountInput>;
1320
1597
 
1321
- export interface LinkedAccountCustomJwtInput {
1322
- custom_user_id: string;
1598
+ /**
1599
+ * Custom metadata associated with the user.
1600
+ */
1601
+ custom_metadata?: CustomMetadata;
1323
1602
 
1324
- type: 'custom_auth';
1325
- }
1603
+ /**
1604
+ * Wallets to create for the user.
1605
+ */
1606
+ wallets?: Array<UserCreateParams.Wallet>;
1607
+ }
1326
1608
 
1609
+ export namespace UserCreateParams {
1327
1610
  export interface Wallet {
1328
1611
  /**
1329
1612
  * The wallet chain types.
@@ -1462,35 +1745,16 @@ export interface UserSetCustomMetadataParams {
1462
1745
  /**
1463
1746
  * Custom metadata associated with the user.
1464
1747
  */
1465
- custom_metadata: { [key: string]: string | number | boolean };
1748
+ custom_metadata: CustomMetadata;
1466
1749
  }
1467
1750
 
1468
1751
  export interface UserUnlinkLinkedAccountParams {
1469
1752
  handle: string;
1470
1753
 
1471
- type:
1472
- | 'email'
1473
- | 'wallet'
1474
- | 'smart_wallet'
1475
- | 'farcaster'
1476
- | 'passkey'
1477
- | 'phone'
1478
- | 'google_oauth'
1479
- | 'discord_oauth'
1480
- | 'twitter_oauth'
1481
- | 'github_oauth'
1482
- | 'linkedin_oauth'
1483
- | 'apple_oauth'
1484
- | 'spotify_oauth'
1485
- | 'instagram_oauth'
1486
- | 'tiktok_oauth'
1487
- | 'line_oauth'
1488
- | 'twitch_oauth'
1489
- | 'custom_auth'
1490
- | 'telegram'
1491
- | 'cross_app'
1492
- | 'guest'
1493
- | (string & {});
1754
+ /**
1755
+ * The possible types of linked accounts.
1756
+ */
1757
+ type: LinkedAccountType;
1494
1758
 
1495
1759
  provider?: string;
1496
1760
  }
@@ -1500,6 +1764,17 @@ export declare namespace Users {
1500
1764
  type AuthenticatedUser as AuthenticatedUser,
1501
1765
  type LinkedAccount as LinkedAccount,
1502
1766
  type User as User,
1767
+ type LinkedAccountEmail as LinkedAccountEmail,
1768
+ type LinkedAccountPhone as LinkedAccountPhone,
1769
+ type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
1770
+ type LinkedAccountEthereum as LinkedAccountEthereum,
1771
+ type SmartWalletType as SmartWalletType,
1772
+ type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1773
+ type LinkedAccountSolana as LinkedAccountSolana,
1774
+ type LinkedAccountFarcaster as LinkedAccountFarcaster,
1775
+ type LinkedAccountPasskey as LinkedAccountPasskey,
1776
+ type LinkedAccountTelegram as LinkedAccountTelegram,
1777
+ type EmbeddedWalletRecoveryMethod as EmbeddedWalletRecoveryMethod,
1503
1778
  type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet,
1504
1779
  type LinkedAccountSolanaEmbeddedWallet as LinkedAccountSolanaEmbeddedWallet,
1505
1780
  type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet,
@@ -1507,8 +1782,50 @@ export declare namespace Users {
1507
1782
  type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet,
1508
1783
  type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet,
1509
1784
  type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID,
1510
- type SmartWalletType as SmartWalletType,
1511
- type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1785
+ type LinkedAccountGoogleOAuth as LinkedAccountGoogleOAuth,
1786
+ type LinkedAccountTwitterOAuth as LinkedAccountTwitterOAuth,
1787
+ type LinkedAccountDiscordOAuth as LinkedAccountDiscordOAuth,
1788
+ type LinkedAccountGitHubOAuth as LinkedAccountGitHubOAuth,
1789
+ type LinkedAccountLinkedInOAuth as LinkedAccountLinkedInOAuth,
1790
+ type LinkedAccountSpotifyOAuth as LinkedAccountSpotifyOAuth,
1791
+ type LinkedAccountInstagramOAuth as LinkedAccountInstagramOAuth,
1792
+ type LinkedAccountTiktokOAuth as LinkedAccountTiktokOAuth,
1793
+ type LinkedAccountLineOAuth as LinkedAccountLineOAuth,
1794
+ type LinkedAccountTwitchOAuth as LinkedAccountTwitchOAuth,
1795
+ type LinkedAccountAppleOAuth as LinkedAccountAppleOAuth,
1796
+ type LinkedAccountCustomOAuth as LinkedAccountCustomOAuth,
1797
+ type LinkedAccountCustomJwt as LinkedAccountCustomJwt,
1798
+ type CrossAppEmbeddedWallet as CrossAppEmbeddedWallet,
1799
+ type CrossAppSmartWallet as CrossAppSmartWallet,
1800
+ type LinkedAccountCrossApp as LinkedAccountCrossApp,
1801
+ type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1802
+ type LinkedAccountType as LinkedAccountType,
1803
+ type CustomMetadata as CustomMetadata,
1804
+ type LinkedAccountWalletInput as LinkedAccountWalletInput,
1805
+ type LinkedAccountEmailInput as LinkedAccountEmailInput,
1806
+ type LinkedAccountPhoneInput as LinkedAccountPhoneInput,
1807
+ type LinkedAccountGoogleInput as LinkedAccountGoogleInput,
1808
+ type LinkedAccountTwitterInput as LinkedAccountTwitterInput,
1809
+ type LinkedAccountDiscordInput as LinkedAccountDiscordInput,
1810
+ type LinkedAccountGitHubInput as LinkedAccountGitHubInput,
1811
+ type LinkedAccountSpotifyInput as LinkedAccountSpotifyInput,
1812
+ type LinkedAccountInstagramInput as LinkedAccountInstagramInput,
1813
+ type LinkedAccountTiktokInput as LinkedAccountTiktokInput,
1814
+ type LinkedAccountLineInput as LinkedAccountLineInput,
1815
+ type LinkedAccountTwitchInput as LinkedAccountTwitchInput,
1816
+ type LinkedAccountAppleInput as LinkedAccountAppleInput,
1817
+ type LinkedAccountLinkedInInput as LinkedAccountLinkedInInput,
1818
+ type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1819
+ type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1820
+ type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1821
+ type LinkedAccountInput as LinkedAccountInput,
1822
+ type UserBatchCreateInput as UserBatchCreateInput,
1823
+ type SMSMfaMethod as SMSMfaMethod,
1824
+ type TotpMfaMethod as TotpMfaMethod,
1825
+ type PasskeyMfaMethod as PasskeyMfaMethod,
1826
+ type LinkedMfaMethod as LinkedMfaMethod,
1827
+ type OAuthTokens as OAuthTokens,
1828
+ type UserWithIdentityToken as UserWithIdentityToken,
1512
1829
  type UsersCursor as UsersCursor,
1513
1830
  type UserCreateParams as UserCreateParams,
1514
1831
  type UserListParams as UserListParams,