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