@privy-io/api-types 0.9.0 → 0.11.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 (180) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/client.d.mts +40 -43
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +40 -43
  5. package/client.d.ts.map +1 -1
  6. package/client.js +28 -20
  7. package/client.js.map +1 -1
  8. package/client.mjs +29 -21
  9. package/client.mjs.map +1 -1
  10. package/internal/types.d.mts +6 -6
  11. package/internal/types.d.mts.map +1 -1
  12. package/internal/types.d.ts +6 -6
  13. package/internal/types.d.ts.map +1 -1
  14. package/package.json +1 -1
  15. package/resources/accounts.d.mts +128 -86
  16. package/resources/accounts.d.mts.map +1 -1
  17. package/resources/accounts.d.ts +128 -86
  18. package/resources/accounts.d.ts.map +1 -1
  19. package/resources/aggregations.d.mts +43 -43
  20. package/resources/aggregations.d.mts.map +1 -1
  21. package/resources/aggregations.d.ts +43 -43
  22. package/resources/aggregations.d.ts.map +1 -1
  23. package/resources/apps.d.mts +169 -135
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +169 -135
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/client-auth.d.mts +931 -947
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +931 -947
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/client-auth.js.map +1 -1
  32. package/resources/client-auth.mjs.map +1 -1
  33. package/resources/embedded-wallets.d.mts +122 -122
  34. package/resources/embedded-wallets.d.mts.map +1 -1
  35. package/resources/embedded-wallets.d.ts +122 -122
  36. package/resources/embedded-wallets.d.ts.map +1 -1
  37. package/resources/fiat.d.mts +110 -0
  38. package/resources/fiat.d.mts.map +1 -0
  39. package/resources/fiat.d.ts +110 -0
  40. package/resources/fiat.d.ts.map +1 -0
  41. package/resources/fiat.js +9 -0
  42. package/resources/fiat.js.map +1 -0
  43. package/resources/fiat.mjs +5 -0
  44. package/resources/fiat.mjs.map +1 -0
  45. package/resources/funding.d.mts +86 -86
  46. package/resources/funding.d.mts.map +1 -1
  47. package/resources/funding.d.ts +86 -86
  48. package/resources/funding.d.ts.map +1 -1
  49. package/resources/index.d.mts +20 -18
  50. package/resources/index.d.mts.map +1 -1
  51. package/resources/index.d.ts +20 -18
  52. package/resources/index.d.ts.map +1 -1
  53. package/resources/index.js +5 -1
  54. package/resources/index.js.map +1 -1
  55. package/resources/index.mjs +3 -1
  56. package/resources/index.mjs.map +1 -1
  57. package/resources/intents.d.mts +269 -265
  58. package/resources/intents.d.mts.map +1 -1
  59. package/resources/intents.d.ts +269 -265
  60. package/resources/intents.d.ts.map +1 -1
  61. package/resources/key-quorums.d.mts +15 -146
  62. package/resources/key-quorums.d.mts.map +1 -1
  63. package/resources/key-quorums.d.ts +15 -146
  64. package/resources/key-quorums.d.ts.map +1 -1
  65. package/resources/key-quorums.js +0 -92
  66. package/resources/key-quorums.js.map +1 -1
  67. package/resources/key-quorums.mjs +0 -92
  68. package/resources/key-quorums.mjs.map +1 -1
  69. package/resources/kraken-embed.d.mts +12 -20
  70. package/resources/kraken-embed.d.mts.map +1 -1
  71. package/resources/kraken-embed.d.ts +12 -20
  72. package/resources/kraken-embed.d.ts.map +1 -1
  73. package/resources/organizations.d.mts +65 -0
  74. package/resources/organizations.d.mts.map +1 -0
  75. package/resources/organizations.d.ts +65 -0
  76. package/resources/organizations.d.ts.map +1 -0
  77. package/resources/organizations.js +9 -0
  78. package/resources/organizations.js.map +1 -0
  79. package/resources/organizations.mjs +5 -0
  80. package/resources/organizations.mjs.map +1 -0
  81. package/resources/policies.d.mts +261 -553
  82. package/resources/policies.d.mts.map +1 -1
  83. package/resources/policies.d.ts +261 -553
  84. package/resources/policies.d.ts.map +1 -1
  85. package/resources/policies.js +0 -229
  86. package/resources/policies.js.map +1 -1
  87. package/resources/policies.mjs +0 -229
  88. package/resources/policies.mjs.map +1 -1
  89. package/resources/shared.d.mts +28 -28
  90. package/resources/shared.d.mts.map +1 -1
  91. package/resources/shared.d.ts +28 -28
  92. package/resources/shared.d.ts.map +1 -1
  93. package/resources/swaps.d.mts +6 -9
  94. package/resources/swaps.d.mts.map +1 -1
  95. package/resources/swaps.d.ts +6 -9
  96. package/resources/swaps.d.ts.map +1 -1
  97. package/resources/swaps.js.map +1 -1
  98. package/resources/swaps.mjs.map +1 -1
  99. package/resources/transactions.d.mts +80 -96
  100. package/resources/transactions.d.mts.map +1 -1
  101. package/resources/transactions.d.ts +80 -96
  102. package/resources/transactions.d.ts.map +1 -1
  103. package/resources/transactions.js +0 -17
  104. package/resources/transactions.js.map +1 -1
  105. package/resources/transactions.mjs +0 -17
  106. package/resources/transactions.mjs.map +1 -1
  107. package/resources/users.d.mts +480 -815
  108. package/resources/users.d.mts.map +1 -1
  109. package/resources/users.d.ts +480 -815
  110. package/resources/users.d.ts.map +1 -1
  111. package/resources/users.js +0 -272
  112. package/resources/users.js.map +1 -1
  113. package/resources/users.mjs +0 -272
  114. package/resources/users.mjs.map +1 -1
  115. package/resources/wallet-actions.d.mts +302 -145
  116. package/resources/wallet-actions.d.mts.map +1 -1
  117. package/resources/wallet-actions.d.ts +302 -145
  118. package/resources/wallet-actions.d.ts.map +1 -1
  119. package/resources/wallets/index.d.mts +1 -1
  120. package/resources/wallets/index.d.mts.map +1 -1
  121. package/resources/wallets/index.d.ts +1 -1
  122. package/resources/wallets/index.d.ts.map +1 -1
  123. package/resources/wallets/index.js.map +1 -1
  124. package/resources/wallets/index.mjs.map +1 -1
  125. package/resources/wallets/transactions.d.mts +7 -2
  126. package/resources/wallets/transactions.d.mts.map +1 -1
  127. package/resources/wallets/transactions.d.ts +7 -2
  128. package/resources/wallets/transactions.d.ts.map +1 -1
  129. package/resources/wallets/transactions.js +1 -1
  130. package/resources/wallets/transactions.mjs +1 -1
  131. package/resources/wallets/wallets.d.mts +1592 -1580
  132. package/resources/wallets/wallets.d.mts.map +1 -1
  133. package/resources/wallets/wallets.d.ts +1592 -1580
  134. package/resources/wallets/wallets.d.ts.map +1 -1
  135. package/resources/wallets/wallets.js +45 -103
  136. package/resources/wallets/wallets.js.map +1 -1
  137. package/resources/wallets/wallets.mjs +45 -103
  138. package/resources/wallets/wallets.mjs.map +1 -1
  139. package/resources/webhooks.d.mts +935 -877
  140. package/resources/webhooks.d.mts.map +1 -1
  141. package/resources/webhooks.d.ts +935 -877
  142. package/resources/webhooks.d.ts.map +1 -1
  143. package/resources/yield.d.mts +157 -157
  144. package/resources/yield.d.mts.map +1 -1
  145. package/resources/yield.d.ts +157 -157
  146. package/resources/yield.d.ts.map +1 -1
  147. package/src/client.ts +650 -618
  148. package/src/internal/types.ts +6 -8
  149. package/src/resources/accounts.ts +157 -103
  150. package/src/resources/aggregations.ts +55 -55
  151. package/src/resources/apps.ts +221 -178
  152. package/src/resources/client-auth.ts +1271 -1315
  153. package/src/resources/embedded-wallets.ts +160 -160
  154. package/src/resources/fiat.ts +177 -0
  155. package/src/resources/funding.ts +130 -130
  156. package/src/resources/index.ts +551 -542
  157. package/src/resources/intents.ts +326 -322
  158. package/src/resources/key-quorums.ts +16 -218
  159. package/src/resources/kraken-embed.ts +14 -22
  160. package/src/resources/organizations.ts +82 -0
  161. package/src/resources/policies.ts +383 -848
  162. package/src/resources/shared.ts +34 -34
  163. package/src/resources/swaps.ts +5 -10
  164. package/src/resources/transactions.ts +116 -136
  165. package/src/resources/users.ts +693 -1160
  166. package/src/resources/wallet-actions.ts +392 -185
  167. package/src/resources/wallets/index.ts +160 -156
  168. package/src/resources/wallets/transactions.ts +18 -3
  169. package/src/resources/wallets/wallets.ts +2123 -2113
  170. package/src/resources/webhooks.ts +1172 -1100
  171. package/src/resources/yield.ts +188 -188
  172. package/src/version.ts +1 -1
  173. package/version.d.mts +1 -1
  174. package/version.d.mts.map +1 -1
  175. package/version.d.ts +1 -1
  176. package/version.d.ts.map +1 -1
  177. package/version.js +1 -1
  178. package/version.js.map +1 -1
  179. package/version.mjs +1 -1
  180. package/version.mjs.map +1 -1
@@ -4,324 +4,53 @@ import { APIResource } from '../core/resource';
4
4
  import * as UsersAPI from './users';
5
5
  import * as ClientAuthAPI from './client-auth';
6
6
  import * as EmbeddedWalletsAPI from './embedded-wallets';
7
- import * as SharedAPI from './shared';
8
7
  import * as WalletsAPI from './wallets/wallets';
9
- import { APIPromise } from '../core/api-promise';
10
- import { Cursor, type CursorParams, PagePromise } from '../core/pagination';
11
- import { buildHeaders } from '../internal/headers';
12
- import { RequestOptions } from '../internal/request-options';
13
- import { path } from '../internal/utils/path';
8
+
9
+ export class Users extends APIResource {}
14
10
 
15
11
  /**
16
- * Operations related to users
12
+ * The authenticated user.
17
13
  */
18
- export class Users extends APIResource {
19
- /**
20
- * Create a new user with linked accounts. Optionally pre-generate embedded wallets
21
- * for the user.
22
- *
23
- * @example
24
- * ```ts
25
- * const user = await client.users.create({
26
- * linked_accounts: [
27
- * { address: 'tom.bombadill@privy.io', type: 'email' },
28
- * ],
29
- * });
30
- * ```
31
- */
32
- create(body: UserCreateParams, options?: RequestOptions): APIPromise<User> {
33
- return this._client.post('/v1/users', { body, ...options });
34
- }
35
-
36
- /**
37
- * Get all users in your app.
38
- *
39
- * @example
40
- * ```ts
41
- * // Automatically fetches more pages as needed.
42
- * for await (const user of client.users.list()) {
43
- * // ...
44
- * }
45
- * ```
46
- */
47
- list(
48
- query: UserListParams | null | undefined = {},
49
- options?: RequestOptions,
50
- ): PagePromise<UsersCursor, User> {
51
- return this._client.getAPIList('/v1/users', Cursor<User>, { query, ...options });
52
- }
53
-
54
- /**
55
- * Delete a user by user ID.
56
- *
57
- * @example
58
- * ```ts
59
- * await client.users.delete('user_id');
60
- * ```
61
- */
62
- delete(userID: string, options?: RequestOptions): APIPromise<void> {
63
- return this._client.delete(path`/v1/users/${userID}`, {
64
- ...options,
65
- headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
66
- });
67
- }
68
-
69
- /**
70
- * Get a user by user ID.
71
- *
72
- * @example
73
- * ```ts
74
- * const user = await client.users._get('user_id');
75
- * ```
76
- */
77
- _get(userID: string, options?: RequestOptions): APIPromise<User> {
78
- return this._client.get(path`/v1/users/${userID}`, options);
79
- }
80
-
81
- /**
82
- * Looks up a user by their custom auth ID.
83
- *
84
- * @example
85
- * ```ts
86
- * const user = await client.users.getByCustomAuthID({
87
- * custom_user_id: 'custom_user_id',
88
- * });
89
- * ```
90
- */
91
- getByCustomAuthID(body: UserGetByCustomAuthIDParams, options?: RequestOptions): APIPromise<User> {
92
- return this._client.post('/v1/users/custom_auth/id', { body, ...options });
93
- }
94
-
95
- /**
96
- * Looks up a user by their Discord username.
97
- *
98
- * @example
99
- * ```ts
100
- * const user = await client.users.getByDiscordUsername({
101
- * username: 'username',
102
- * });
103
- * ```
104
- */
105
- getByDiscordUsername(body: UserGetByDiscordUsernameParams, options?: RequestOptions): APIPromise<User> {
106
- return this._client.post('/v1/users/discord/username', { body, ...options });
107
- }
108
-
109
- /**
110
- * Looks up a user by their email address.
111
- *
112
- * @example
113
- * ```ts
114
- * const user = await client.users.getByEmailAddress({
115
- * address: 'dev@stainless.com',
116
- * });
117
- * ```
118
- */
119
- getByEmailAddress(body: UserGetByEmailAddressParams, options?: RequestOptions): APIPromise<User> {
120
- return this._client.post('/v1/users/email/address', { body, ...options });
121
- }
122
-
123
- /**
124
- * Looks up a user by their Farcaster ID.
125
- *
126
- * @example
127
- * ```ts
128
- * const user = await client.users.getByFarcasterID({
129
- * fid: 0,
130
- * });
131
- * ```
132
- */
133
- getByFarcasterID(body: UserGetByFarcasterIDParams, options?: RequestOptions): APIPromise<User> {
134
- return this._client.post('/v1/users/farcaster/fid', { body, ...options });
135
- }
136
-
137
- /**
138
- * Looks up a user by their Github username.
139
- *
140
- * @example
141
- * ```ts
142
- * const user = await client.users.getByGitHubUsername({
143
- * username: 'username',
144
- * });
145
- * ```
146
- */
147
- getByGitHubUsername(body: UserGetByGitHubUsernameParams, options?: RequestOptions): APIPromise<User> {
148
- return this._client.post('/v1/users/github/username', { body, ...options });
149
- }
150
-
151
- /**
152
- * Looks up a user by their phone number.
153
- *
154
- * @example
155
- * ```ts
156
- * const user = await client.users.getByPhoneNumber({
157
- * number: 'number',
158
- * });
159
- * ```
160
- */
161
- getByPhoneNumber(body: UserGetByPhoneNumberParams, options?: RequestOptions): APIPromise<User> {
162
- return this._client.post('/v1/users/phone/number', { body, ...options });
163
- }
164
-
165
- /**
166
- * Looks up a user by their smart wallet address.
167
- *
168
- * @example
169
- * ```ts
170
- * const user = await client.users.getBySmartWalletAddress({
171
- * address: 'address',
172
- * });
173
- * ```
174
- */
175
- getBySmartWalletAddress(
176
- body: UserGetBySmartWalletAddressParams,
177
- options?: RequestOptions,
178
- ): APIPromise<User> {
179
- return this._client.post('/v1/users/smart_wallet/address', { body, ...options });
180
- }
181
-
182
- /**
183
- * Looks up a user by their Telegram user ID.
184
- *
185
- * @example
186
- * ```ts
187
- * const user = await client.users.getByTelegramUserID({
188
- * telegram_user_id: 'telegram_user_id',
189
- * });
190
- * ```
191
- */
192
- getByTelegramUserID(body: UserGetByTelegramUserIDParams, options?: RequestOptions): APIPromise<User> {
193
- return this._client.post('/v1/users/telegram/telegram_user_id', { body, ...options });
194
- }
14
+ export interface AuthenticatedUser {
15
+ token: string | null;
195
16
 
196
- /**
197
- * Looks up a user by their Telegram username.
198
- *
199
- * @example
200
- * ```ts
201
- * const user = await client.users.getByTelegramUsername({
202
- * username: 'username',
203
- * });
204
- * ```
205
- */
206
- getByTelegramUsername(body: UserGetByTelegramUsernameParams, options?: RequestOptions): APIPromise<User> {
207
- return this._client.post('/v1/users/telegram/username', { body, ...options });
208
- }
17
+ privy_access_token: string | null;
209
18
 
210
- /**
211
- * Looks up a user by their Twitter subject.
212
- *
213
- * @example
214
- * ```ts
215
- * const user = await client.users.getByTwitterSubject({
216
- * subject: 'subject',
217
- * });
218
- * ```
219
- */
220
- getByTwitterSubject(body: UserGetByTwitterSubjectParams, options?: RequestOptions): APIPromise<User> {
221
- return this._client.post('/v1/users/twitter/subject', { body, ...options });
222
- }
19
+ refresh_token: string | null;
223
20
 
224
21
  /**
225
- * Looks up a user by their Twitter username.
226
- *
227
- * @example
228
- * ```ts
229
- * const user = await client.users.getByTwitterUsername({
230
- * username: 'username',
231
- * });
232
- * ```
22
+ * Instructs the client on how to handle tokens received
233
23
  */
234
- getByTwitterUsername(body: UserGetByTwitterUsernameParams, options?: RequestOptions): APIPromise<User> {
235
- return this._client.post('/v1/users/twitter/username', { body, ...options });
236
- }
24
+ session_update_action: 'set' | 'ignore' | 'clear';
237
25
 
238
26
  /**
239
- * Looks up a user by their wallet address.
240
- *
241
- * @example
242
- * ```ts
243
- * const user = await client.users.getByWalletAddress({
244
- * address: 'address',
245
- * });
246
- * ```
27
+ * A Privy user object.
247
28
  */
248
- getByWalletAddress(body: UserGetByWalletAddressParams, options?: RequestOptions): APIPromise<User> {
249
- return this._client.post('/v1/users/wallet/address', { body, ...options });
250
- }
29
+ user: User;
251
30
 
252
- /**
253
- * Creates an embedded wallet for an existing user.
254
- *
255
- * @example
256
- * ```ts
257
- * const user = await client.users.pregenerateWallets(
258
- * 'user_id',
259
- * { wallets: [{ chain_type: 'ethereum' }] },
260
- * );
261
- * ```
262
- */
263
- pregenerateWallets(
264
- userID: string,
265
- body: UserPregenerateWalletsParams,
266
- options?: RequestOptions,
267
- ): APIPromise<User> {
268
- return this._client.post(path`/v1/users/${userID}/wallets`, { body, ...options });
269
- }
31
+ identity_token?: string;
270
32
 
271
- /**
272
- * Search users by search term, emails, phone numbers, or wallet addresses.
273
- *
274
- * @example
275
- * ```ts
276
- * const user = await client.users.search({
277
- * searchTerm: 'searchTerm',
278
- * });
279
- * ```
280
- */
281
- search(body: UserSearchParams, options?: RequestOptions): APIPromise<User> {
282
- return this._client.post('/v1/users/search', { body, ...options });
283
- }
33
+ is_new_user?: boolean;
284
34
 
285
35
  /**
286
- * Adds custom metadata to a user by user ID.
287
- *
288
- * @example
289
- * ```ts
290
- * const user = await client.users.setCustomMetadata(
291
- * 'user_id',
292
- * { custom_metadata: { key: 'value' } },
293
- * );
294
- * ```
36
+ * OAuth tokens associated with the user.
295
37
  */
296
- setCustomMetadata(
297
- userID: string,
298
- body: UserSetCustomMetadataParams,
299
- options?: RequestOptions,
300
- ): APIPromise<User> {
301
- return this._client.post(path`/v1/users/${userID}/custom_metadata`, { body, ...options });
302
- }
38
+ oauth_tokens?: OAuthTokens;
39
+ }
303
40
 
304
- /**
305
- * Unlinks a user linked account.
306
- *
307
- * @example
308
- * ```ts
309
- * const user = await client.users.unlinkLinkedAccount(
310
- * 'user_id',
311
- * { handle: 'test@test.com', type: 'email' },
312
- * );
313
- * ```
314
- */
315
- unlinkLinkedAccount(
316
- userID: string,
317
- body: UserUnlinkLinkedAccountParams,
318
- options?: RequestOptions,
319
- ): APIPromise<User> {
320
- return this._client.post(path`/v1/users/${userID}/accounts/unlink`, { body, ...options });
321
- }
41
+ /**
42
+ * An embedded wallet associated with a cross-app account.
43
+ */
44
+ export interface CrossAppEmbeddedWallet {
45
+ address: string;
322
46
  }
323
47
 
324
- export type UsersCursor = Cursor<User>;
48
+ /**
49
+ * A smart wallet associated with a cross-app account.
50
+ */
51
+ export interface CrossAppSmartWallet {
52
+ address: string;
53
+ }
325
54
 
326
55
  /**
327
56
  * Custom metadata associated with the user.
@@ -329,215 +58,245 @@ export type UsersCursor = Cursor<User>;
329
58
  export type CustomMetadata = { [key: string]: string | number | boolean };
330
59
 
331
60
  /**
332
- * The payload for importing a wallet account.
61
+ * The method used to recover an embedded wallet account.
333
62
  */
334
- export interface LinkedAccountWalletInput {
335
- address: string;
336
-
337
- chain_type: 'ethereum' | 'solana';
338
-
339
- type: 'wallet';
340
- }
63
+ export type EmbeddedWalletRecoveryMethod =
64
+ | 'privy'
65
+ | 'user-passcode'
66
+ | 'google-drive'
67
+ | 'icloud'
68
+ | 'recovery-encryption-key'
69
+ | 'privy-v2';
341
70
 
342
71
  /**
343
- * The payload for importing an email account.
72
+ * A linked account for the user.
344
73
  */
345
- export interface LinkedAccountEmailInput {
346
- address: string;
347
-
348
- type: 'email';
349
- }
74
+ export type LinkedAccount =
75
+ | LinkedAccountEmail
76
+ | LinkedAccountPhone
77
+ | LinkedAccountEthereum
78
+ | LinkedAccountSolana
79
+ | LinkedAccountSmartWallet
80
+ | LinkedAccountEthereumEmbeddedWallet
81
+ | LinkedAccountSolanaEmbeddedWallet
82
+ | LinkedAccountBitcoinSegwitEmbeddedWallet
83
+ | LinkedAccountBitcoinTaprootEmbeddedWallet
84
+ | LinkedAccountCurveSigningEmbeddedWallet
85
+ | LinkedAccountGoogleOAuth
86
+ | LinkedAccountTwitterOAuth
87
+ | LinkedAccountDiscordOAuth
88
+ | LinkedAccountGitHubOAuth
89
+ | LinkedAccountSpotifyOAuth
90
+ | LinkedAccountInstagramOAuth
91
+ | LinkedAccountTiktokOAuth
92
+ | LinkedAccountLineOAuth
93
+ | LinkedAccountTwitchOAuth
94
+ | LinkedAccountLinkedInOAuth
95
+ | LinkedAccountAppleOAuth
96
+ | LinkedAccountCustomOAuth
97
+ | LinkedAccountCustomJwt
98
+ | LinkedAccountFarcaster
99
+ | LinkedAccountPasskey
100
+ | LinkedAccountTelegram
101
+ | LinkedAccountCrossApp
102
+ | LinkedAccountAuthorizationKey;
350
103
 
351
104
  /**
352
- * The payload for importing a phone account.
105
+ * The payload for importing an Apple account.
353
106
  */
354
- export interface LinkedAccountPhoneInput {
355
- number: string;
107
+ export interface LinkedAccountAppleInput {
108
+ subject: string;
356
109
 
357
- type: 'phone';
110
+ type: 'apple_oauth';
111
+
112
+ email?: string;
358
113
  }
359
114
 
360
115
  /**
361
- * The payload for importing a Google account.
116
+ * An Apple OAuth account linked to the user.
362
117
  */
363
- export interface LinkedAccountGoogleInput {
364
- email: string;
118
+ export interface LinkedAccountAppleOAuth {
119
+ email: string | null;
365
120
 
366
- name: string;
121
+ first_verified_at: number | null;
122
+
123
+ latest_verified_at: number | null;
367
124
 
368
125
  subject: string;
369
126
 
370
- type: 'google_oauth';
127
+ type: 'apple_oauth';
128
+
129
+ verified_at: number;
371
130
  }
372
131
 
373
132
  /**
374
- * The payload for importing a Twitter account.
133
+ * An authorization key linked to the user.
375
134
  */
376
- export interface LinkedAccountTwitterInput {
377
- name: string;
135
+ export interface LinkedAccountAuthorizationKey {
136
+ first_verified_at: number | null;
378
137
 
379
- subject: string;
138
+ latest_verified_at: number | null;
380
139
 
381
- type: 'twitter_oauth';
140
+ public_key: string;
382
141
 
383
- username: string;
142
+ type: 'authorization_key';
384
143
 
385
- profile_picture_url?: string;
144
+ verified_at: number;
386
145
  }
387
146
 
388
147
  /**
389
- * The payload for importing a Discord account.
148
+ * Base schema for wallet accounts linked to the user.
390
149
  */
391
- export interface LinkedAccountDiscordInput {
392
- subject: string;
393
-
394
- type: 'discord_oauth';
150
+ export interface LinkedAccountBaseWallet {
151
+ address: string;
395
152
 
396
- username: string;
153
+ chain_type: 'solana' | 'ethereum';
397
154
 
398
- email?: string;
155
+ type: 'wallet' | 'smart_wallet';
399
156
  }
400
157
 
401
158
  /**
402
- * The payload for importing a Github account.
159
+ * A Bitcoin SegWit embedded wallet account linked to the user.
403
160
  */
404
- export interface LinkedAccountGitHubInput {
405
- subject: string;
161
+ export interface LinkedAccountBitcoinSegwitEmbeddedWallet {
162
+ id: string | null;
406
163
 
407
- type: 'github_oauth';
164
+ address: string;
408
165
 
409
- username: string;
166
+ chain_id: string;
410
167
 
411
- email?: string;
168
+ chain_type: 'bitcoin-segwit';
412
169
 
413
- name?: string;
414
- }
170
+ connector_type: 'embedded';
415
171
 
416
- /**
417
- * The payload for importing a Spotify account.
418
- */
419
- export interface LinkedAccountSpotifyInput {
420
- subject: string;
172
+ delegated: boolean;
421
173
 
422
- type: 'spotify_oauth';
174
+ first_verified_at: number | null;
423
175
 
424
- email?: string;
176
+ imported: boolean;
425
177
 
426
- name?: string;
427
- }
178
+ latest_verified_at: number | null;
428
179
 
429
- /**
430
- * The payload for importing an Instagram account.
431
- */
432
- export interface LinkedAccountInstagramInput {
433
- subject: string;
180
+ public_key: string;
434
181
 
435
- type: 'instagram_oauth';
182
+ /**
183
+ * The method used to recover an embedded wallet account.
184
+ */
185
+ recovery_method: EmbeddedWalletRecoveryMethod;
436
186
 
437
- username: string;
187
+ type: 'wallet';
188
+
189
+ verified_at: number;
190
+
191
+ wallet_client: 'privy';
192
+
193
+ wallet_client_type: 'privy';
194
+
195
+ wallet_index: number;
438
196
  }
439
197
 
440
198
  /**
441
- * The payload for importing a Tiktok account.
199
+ * A Bitcoin Taproot embedded wallet account linked to the user.
442
200
  */
443
- export interface LinkedAccountTiktokInput {
444
- name: string | null;
201
+ export interface LinkedAccountBitcoinTaprootEmbeddedWallet {
202
+ id: string | null;
445
203
 
446
- subject: string;
204
+ address: string;
205
+
206
+ chain_id: string;
207
+
208
+ chain_type: 'bitcoin-taproot';
209
+
210
+ connector_type: 'embedded';
211
+
212
+ delegated: boolean;
447
213
 
448
- type: 'tiktok_oauth';
214
+ first_verified_at: number | null;
449
215
 
450
- username: string;
451
- }
216
+ imported: boolean;
452
217
 
453
- /**
454
- * The payload for importing a LINE account.
455
- */
456
- export interface LinkedAccountLineInput {
457
- subject: string;
218
+ latest_verified_at: number | null;
458
219
 
459
- type: 'line_oauth';
220
+ public_key: string;
460
221
 
461
- email?: string;
222
+ /**
223
+ * The method used to recover an embedded wallet account.
224
+ */
225
+ recovery_method: EmbeddedWalletRecoveryMethod;
462
226
 
463
- name?: string;
227
+ type: 'wallet';
464
228
 
465
- profile_picture_url?: string;
466
- }
229
+ verified_at: number;
467
230
 
468
- /**
469
- * The payload for importing a Twitch account.
470
- */
471
- export interface LinkedAccountTwitchInput {
472
- subject: string;
231
+ wallet_client: 'privy';
473
232
 
474
- type: 'twitch_oauth';
233
+ wallet_client_type: 'privy';
475
234
 
476
- username?: string;
235
+ wallet_index: number;
477
236
  }
478
237
 
479
238
  /**
480
- * The payload for importing an Apple account.
239
+ * A cross-app account linked to the user.
481
240
  */
482
- export interface LinkedAccountAppleInput {
483
- subject: string;
241
+ export interface LinkedAccountCrossApp {
242
+ embedded_wallets: Array<CrossAppEmbeddedWallet>;
484
243
 
485
- type: 'apple_oauth';
244
+ first_verified_at: number | null;
486
245
 
487
- email?: string;
488
- }
246
+ latest_verified_at: number | null;
489
247
 
490
- /**
491
- * The payload for importing a LinkedIn account.
492
- */
493
- export interface LinkedAccountLinkedInInput {
494
- subject: string;
248
+ provider_app_id: string;
495
249
 
496
- type: 'linkedin_oauth';
250
+ smart_wallets: Array<CrossAppSmartWallet>;
497
251
 
498
- email?: string;
252
+ subject: string;
499
253
 
500
- name?: string;
254
+ type: 'cross_app';
501
255
 
502
- vanityName?: string;
256
+ verified_at: number;
503
257
  }
504
258
 
505
259
  /**
506
- * The payload for importing a Farcaster account.
260
+ * A curve signing embedded wallet account linked to the user.
507
261
  */
508
- export interface LinkedAccountFarcasterInput {
509
- fid: number;
262
+ export interface LinkedAccountCurveSigningEmbeddedWallet {
263
+ id: string | null;
510
264
 
511
- owner_address: string;
265
+ address: string;
512
266
 
513
- type: 'farcaster';
267
+ chain_id: string;
514
268
 
515
- bio?: string;
269
+ /**
270
+ * The wallet chain types that support curve-based signing.
271
+ */
272
+ chain_type: WalletsAPI.CurveSigningChainType;
516
273
 
517
- display_name?: string;
274
+ connector_type: 'embedded';
518
275
 
519
- homepage_url?: string;
276
+ delegated: boolean;
520
277
 
521
- profile_picture_url?: string;
278
+ first_verified_at: number | null;
522
279
 
523
- username?: string;
524
- }
280
+ imported: boolean;
525
281
 
526
- /**
527
- * The payload for importing a Telegram account.
528
- */
529
- export interface LinkedAccountTelegramInput {
530
- telegram_user_id: string;
282
+ latest_verified_at: number | null;
531
283
 
532
- type: 'telegram';
284
+ public_key: string;
533
285
 
534
- first_name?: string;
286
+ /**
287
+ * The method used to recover an embedded wallet account.
288
+ */
289
+ recovery_method: EmbeddedWalletRecoveryMethod;
535
290
 
536
- last_name?: string;
291
+ type: 'wallet';
537
292
 
538
- photo_url?: string;
293
+ verified_at: number;
539
294
 
540
- username?: string;
295
+ wallet_client: 'privy';
296
+
297
+ wallet_client_type: 'privy';
298
+
299
+ wallet_index: number;
541
300
  }
542
301
 
543
302
  /**
@@ -550,76 +309,77 @@ export interface LinkedAccountCustomJwtInput {
550
309
  }
551
310
 
552
311
  /**
553
- * The payload for importing a passkey account.
312
+ * A custom JWT account linked to the user.
554
313
  */
555
- export interface LinkedAccountPasskeyInput {
556
- credential_device_type: 'singleDevice' | 'multiDevice';
314
+ export interface LinkedAccountCustomJwt {
315
+ custom_user_id: string;
557
316
 
558
- credential_id: string;
317
+ first_verified_at: number | null;
559
318
 
560
- credential_public_key: string;
319
+ latest_verified_at: number | null;
561
320
 
562
- credential_username: string;
321
+ type: 'custom_auth';
563
322
 
564
- type: 'passkey';
323
+ verified_at: number;
565
324
  }
566
325
 
567
326
  /**
568
- * The input for adding a linked account to a user.
327
+ * A custom OAuth account linked to the user.
569
328
  */
570
- export type LinkedAccountInput =
571
- | LinkedAccountWalletInput
572
- | LinkedAccountEmailInput
573
- | LinkedAccountPhoneInput
574
- | LinkedAccountGoogleInput
575
- | LinkedAccountTwitterInput
576
- | LinkedAccountDiscordInput
577
- | LinkedAccountGitHubInput
578
- | LinkedAccountSpotifyInput
579
- | LinkedAccountInstagramInput
580
- | LinkedAccountTiktokInput
581
- | LinkedAccountLineInput
582
- | LinkedAccountTwitchInput
583
- | LinkedAccountAppleInput
584
- | LinkedAccountLinkedInInput
585
- | LinkedAccountFarcasterInput
586
- | LinkedAccountTelegramInput
587
- | LinkedAccountCustomJwtInput
588
- | LinkedAccountPasskeyInput;
329
+ export interface LinkedAccountCustomOAuth {
330
+ first_verified_at: number | null;
331
+
332
+ latest_verified_at: number | null;
333
+
334
+ subject: string;
335
+
336
+ /**
337
+ * The ID of a custom OAuth provider, set up for this app. Must start with
338
+ * "custom:".
339
+ */
340
+ type: ClientAuthAPI.CustomOAuthProviderID;
341
+
342
+ verified_at: number;
343
+
344
+ email?: string;
345
+
346
+ name?: string;
347
+
348
+ profile_picture_url?: string;
349
+
350
+ username?: string;
351
+ }
589
352
 
590
353
  /**
591
- * The payload for batch creating users.
354
+ * The payload for importing a Discord account.
592
355
  */
593
- export interface UserBatchCreateInput {
594
- users: Array<UserBatchCreateInput.User>;
595
- }
356
+ export interface LinkedAccountDiscordInput {
357
+ subject: string;
596
358
 
597
- export namespace UserBatchCreateInput {
598
- export interface User {
599
- linked_accounts: Array<UsersAPI.LinkedAccountInput>;
359
+ type: 'discord_oauth';
600
360
 
601
- create_embedded_wallet?: boolean;
361
+ username: string;
602
362
 
603
- create_ethereum_smart_wallet?: boolean;
363
+ email?: string;
364
+ }
604
365
 
605
- create_ethereum_wallet?: boolean;
366
+ /**
367
+ * A Discord OAuth account linked to the user.
368
+ */
369
+ export interface LinkedAccountDiscordOAuth {
370
+ email: string | null;
606
371
 
607
- create_n_embedded_wallets?: number;
372
+ first_verified_at: number | null;
608
373
 
609
- create_n_ethereum_wallets?: number;
374
+ latest_verified_at: number | null;
610
375
 
611
- create_solana_wallet?: boolean;
376
+ subject: string;
612
377
 
613
- /**
614
- * Custom metadata associated with the user.
615
- */
616
- custom_metadata?: UsersAPI.CustomMetadata;
378
+ type: 'discord_oauth';
617
379
 
618
- /**
619
- * Wallets to create.
620
- */
621
- wallets?: Array<EmbeddedWalletsAPI.WalletCreationInput>;
622
- }
380
+ username: string | null;
381
+
382
+ verified_at: number;
623
383
  }
624
384
 
625
385
  /**
@@ -638,31 +398,81 @@ export interface LinkedAccountEmail {
638
398
  }
639
399
 
640
400
  /**
641
- * A phone number account linked to the user.
401
+ * The payload for importing an email account.
642
402
  */
643
- export interface LinkedAccountPhone {
644
- first_verified_at: number | null;
403
+ export interface LinkedAccountEmailInput {
404
+ address: string;
645
405
 
646
- latest_verified_at: number | null;
406
+ type: 'email';
407
+ }
647
408
 
648
- phoneNumber: string;
409
+ export type LinkedAccountEmbeddedWallet =
410
+ | LinkedAccountEthereumEmbeddedWallet
411
+ | LinkedAccountSolanaEmbeddedWallet
412
+ | LinkedAccountBitcoinSegwitEmbeddedWallet
413
+ | LinkedAccountBitcoinTaprootEmbeddedWallet
414
+ | LinkedAccountCurveSigningEmbeddedWallet;
649
415
 
650
- type: 'phone';
416
+ /**
417
+ * An embedded wallet account with an ID.
418
+ */
419
+ export type LinkedAccountEmbeddedWalletWithID =
420
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountEthereumEmbeddedWallet
421
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountSolanaEmbeddedWallet
422
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinSegwitEmbeddedWallet
423
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinTaprootEmbeddedWallet
424
+ | LinkedAccountEmbeddedWalletWithID.LinkedAccountCurveSigningEmbeddedWallet;
425
+
426
+ export namespace LinkedAccountEmbeddedWalletWithID {
427
+ /**
428
+ * An Ethereum embedded wallet account linked to the user.
429
+ */
430
+ export interface LinkedAccountEthereumEmbeddedWallet
431
+ extends Omit<UsersAPI.LinkedAccountEthereumEmbeddedWallet, 'id' | 'recovery_method'> {
432
+ id: string;
433
+
434
+ recovery_method: 'privy-v2';
435
+ }
436
+
437
+ /**
438
+ * A Solana embedded wallet account linked to the user.
439
+ */
440
+ export interface LinkedAccountSolanaEmbeddedWallet
441
+ extends Omit<UsersAPI.LinkedAccountSolanaEmbeddedWallet, 'id' | 'recovery_method'> {
442
+ id: string;
443
+
444
+ recovery_method: 'privy-v2';
445
+ }
446
+
447
+ /**
448
+ * A Bitcoin SegWit embedded wallet account linked to the user.
449
+ */
450
+ export interface LinkedAccountBitcoinSegwitEmbeddedWallet
451
+ extends Omit<UsersAPI.LinkedAccountBitcoinSegwitEmbeddedWallet, 'id' | 'recovery_method'> {
452
+ id: string;
651
453
 
652
- verified_at: number;
454
+ recovery_method: 'privy-v2';
455
+ }
653
456
 
654
- number?: string;
655
- }
457
+ /**
458
+ * A Bitcoin Taproot embedded wallet account linked to the user.
459
+ */
460
+ export interface LinkedAccountBitcoinTaprootEmbeddedWallet
461
+ extends Omit<UsersAPI.LinkedAccountBitcoinTaprootEmbeddedWallet, 'id' | 'recovery_method'> {
462
+ id: string;
656
463
 
657
- /**
658
- * Base schema for wallet accounts linked to the user.
659
- */
660
- export interface LinkedAccountBaseWallet {
661
- address: string;
464
+ recovery_method: 'privy-v2';
465
+ }
662
466
 
663
- chain_type: 'solana' | 'ethereum';
467
+ /**
468
+ * A curve signing embedded wallet account linked to the user.
469
+ */
470
+ export interface LinkedAccountCurveSigningEmbeddedWallet
471
+ extends Omit<UsersAPI.LinkedAccountCurveSigningEmbeddedWallet, 'id' | 'recovery_method'> {
472
+ id: string;
664
473
 
665
- type: 'wallet' | 'smart_wallet';
474
+ recovery_method: 'privy-v2';
475
+ }
666
476
  }
667
477
 
668
478
  /**
@@ -691,48 +501,41 @@ export interface LinkedAccountEthereum {
691
501
  }
692
502
 
693
503
  /**
694
- * A smart wallet account linked to the user.
504
+ * An Ethereum embedded wallet account linked to the user.
695
505
  */
696
- export interface LinkedAccountSmartWallet {
697
- address: string;
698
-
699
- first_verified_at: number | null;
700
-
701
- latest_verified_at: number | null;
702
-
703
- /**
704
- * The supported smart wallet providers.
705
- */
706
- smart_wallet_type: EmbeddedWalletsAPI.SmartWalletType;
506
+ export interface LinkedAccountEthereumEmbeddedWallet {
507
+ id: string | null;
707
508
 
708
- type: 'smart_wallet';
509
+ address: string;
709
510
 
710
- verified_at: number;
511
+ chain_id: string;
711
512
 
712
- smart_wallet_version?: string;
713
- }
513
+ chain_type: 'ethereum';
714
514
 
715
- /**
716
- * A Solana wallet account linked to the user.
717
- */
718
- export interface LinkedAccountSolana {
719
- address: string;
515
+ connector_type: 'embedded';
720
516
 
721
- chain_type: 'solana';
517
+ delegated: boolean;
722
518
 
723
519
  first_verified_at: number | null;
724
520
 
521
+ imported: boolean;
522
+
725
523
  latest_verified_at: number | null;
726
524
 
525
+ /**
526
+ * The method used to recover an embedded wallet account.
527
+ */
528
+ recovery_method: EmbeddedWalletRecoveryMethod;
529
+
727
530
  type: 'wallet';
728
531
 
729
532
  verified_at: number;
730
533
 
731
- wallet_client: 'unknown';
534
+ wallet_client: 'privy';
732
535
 
733
- connector_type?: string;
536
+ wallet_client_type: 'privy';
734
537
 
735
- wallet_client_type?: string;
538
+ wallet_index: number;
736
539
  }
737
540
 
738
541
  /**
@@ -767,435 +570,381 @@ export interface LinkedAccountFarcaster {
767
570
  }
768
571
 
769
572
  /**
770
- * A passkey account linked to the user.
573
+ * The payload for importing a Farcaster account.
771
574
  */
772
- export interface LinkedAccountPasskey {
773
- credential_id: string;
774
-
775
- enrolled_in_mfa: boolean;
776
-
777
- first_verified_at: number | null;
778
-
779
- latest_verified_at: number | null;
575
+ export interface LinkedAccountFarcasterInput {
576
+ fid: number;
780
577
 
781
- type: 'passkey';
578
+ owner_address: string;
782
579
 
783
- verified_at: number;
580
+ type: 'farcaster';
784
581
 
785
- authenticator_name?: string;
582
+ bio?: string;
786
583
 
787
- created_with_browser?: string;
584
+ display_name?: string;
788
585
 
789
- created_with_device?: string;
586
+ homepage_url?: string;
790
587
 
791
- created_with_os?: string;
588
+ profile_picture_url?: string;
792
589
 
793
- public_key?: string;
590
+ username?: string;
794
591
  }
795
592
 
796
593
  /**
797
- * A Telegram account linked to the user.
594
+ * The payload for importing a Github account.
798
595
  */
799
- export interface LinkedAccountTelegram {
800
- first_verified_at: number | null;
801
-
802
- latest_verified_at: number | null;
803
-
804
- telegram_user_id: string;
805
-
806
- type: 'telegram';
807
-
808
- verified_at: number;
596
+ export interface LinkedAccountGitHubInput {
597
+ subject: string;
809
598
 
810
- first_name?: string | null;
599
+ type: 'github_oauth';
811
600
 
812
- last_name?: string | null;
601
+ username: string;
813
602
 
814
- photo_url?: string | null;
603
+ email?: string;
815
604
 
816
- username?: string | null;
605
+ name?: string;
817
606
  }
818
607
 
819
608
  /**
820
- * The method used to recover an embedded wallet account.
821
- */
822
- export type EmbeddedWalletRecoveryMethod =
823
- | 'privy'
824
- | 'user-passcode'
825
- | 'google-drive'
826
- | 'icloud'
827
- | 'recovery-encryption-key'
828
- | 'privy-v2';
829
-
830
- /**
831
- * An Ethereum embedded wallet account linked to the user.
609
+ * A GitHub OAuth account linked to the user.
832
610
  */
833
- export interface LinkedAccountEthereumEmbeddedWallet {
834
- id: string | null;
835
-
836
- address: string;
837
-
838
- chain_id: string;
839
-
840
- chain_type: 'ethereum';
841
-
842
- connector_type: 'embedded';
843
-
844
- delegated: boolean;
611
+ export interface LinkedAccountGitHubOAuth {
612
+ email: string | null;
845
613
 
846
614
  first_verified_at: number | null;
847
615
 
848
- imported: boolean;
849
-
850
616
  latest_verified_at: number | null;
851
617
 
852
- /**
853
- * The method used to recover an embedded wallet account.
854
- */
855
- recovery_method: EmbeddedWalletRecoveryMethod;
856
-
857
- type: 'wallet';
618
+ name: string | null;
858
619
 
859
- verified_at: number;
620
+ subject: string;
860
621
 
861
- wallet_client: 'privy';
622
+ type: 'github_oauth';
862
623
 
863
- wallet_client_type: 'privy';
624
+ username: string | null;
864
625
 
865
- wallet_index: number;
626
+ verified_at: number;
866
627
  }
867
628
 
868
629
  /**
869
- * A Solana embedded wallet account linked to the user.
630
+ * The payload for importing a Google account.
870
631
  */
871
- export interface LinkedAccountSolanaEmbeddedWallet {
872
- id: string | null;
873
-
874
- address: string;
632
+ export interface LinkedAccountGoogleInput {
633
+ email: string;
875
634
 
876
- chain_id: string;
635
+ name: string;
877
636
 
878
- chain_type: 'solana';
637
+ subject: string;
879
638
 
880
- connector_type: 'embedded';
639
+ type: 'google_oauth';
640
+ }
881
641
 
882
- delegated: boolean;
642
+ /**
643
+ * A Google OAuth account linked to the user.
644
+ */
645
+ export interface LinkedAccountGoogleOAuth {
646
+ email: string;
883
647
 
884
648
  first_verified_at: number | null;
885
649
 
886
- imported: boolean;
887
-
888
650
  latest_verified_at: number | null;
889
651
 
890
- public_key: string;
652
+ name: string | null;
891
653
 
892
- /**
893
- * The method used to recover an embedded wallet account.
894
- */
895
- recovery_method: EmbeddedWalletRecoveryMethod;
654
+ subject: string;
896
655
 
897
- type: 'wallet';
656
+ type: 'google_oauth';
898
657
 
899
658
  verified_at: number;
900
-
901
- wallet_client: 'privy';
902
-
903
- wallet_client_type: 'privy';
904
-
905
- wallet_index: number;
906
659
  }
907
660
 
908
661
  /**
909
- * A Bitcoin SegWit embedded wallet account linked to the user.
662
+ * The input for adding a linked account to a user.
910
663
  */
911
- export interface LinkedAccountBitcoinSegwitEmbeddedWallet {
912
- id: string | null;
913
-
914
- address: string;
915
-
916
- chain_id: string;
917
-
918
- chain_type: 'bitcoin-segwit';
919
-
920
- connector_type: 'embedded';
921
-
922
- delegated: boolean;
923
-
924
- first_verified_at: number | null;
664
+ export type LinkedAccountInput =
665
+ | LinkedAccountWalletInput
666
+ | LinkedAccountEmailInput
667
+ | LinkedAccountPhoneInput
668
+ | LinkedAccountGoogleInput
669
+ | LinkedAccountTwitterInput
670
+ | LinkedAccountDiscordInput
671
+ | LinkedAccountGitHubInput
672
+ | LinkedAccountSpotifyInput
673
+ | LinkedAccountInstagramInput
674
+ | LinkedAccountTiktokInput
675
+ | LinkedAccountLineInput
676
+ | LinkedAccountTwitchInput
677
+ | LinkedAccountAppleInput
678
+ | LinkedAccountLinkedInInput
679
+ | LinkedAccountFarcasterInput
680
+ | LinkedAccountTelegramInput
681
+ | LinkedAccountCustomJwtInput
682
+ | LinkedAccountPasskeyInput;
925
683
 
926
- imported: boolean;
684
+ /**
685
+ * The payload for importing an Instagram account.
686
+ */
687
+ export interface LinkedAccountInstagramInput {
688
+ subject: string;
927
689
 
928
- latest_verified_at: number | null;
690
+ type: 'instagram_oauth';
929
691
 
930
- public_key: string;
692
+ username: string;
693
+ }
931
694
 
932
- /**
933
- * The method used to recover an embedded wallet account.
934
- */
935
- recovery_method: EmbeddedWalletRecoveryMethod;
695
+ /**
696
+ * An Instagram OAuth account linked to the user.
697
+ */
698
+ export interface LinkedAccountInstagramOAuth {
699
+ first_verified_at: number | null;
936
700
 
937
- type: 'wallet';
701
+ latest_verified_at: number | null;
938
702
 
939
- verified_at: number;
703
+ subject: string;
940
704
 
941
- wallet_client: 'privy';
705
+ type: 'instagram_oauth';
942
706
 
943
- wallet_client_type: 'privy';
707
+ username: string | null;
944
708
 
945
- wallet_index: number;
709
+ verified_at: number;
946
710
  }
947
711
 
948
712
  /**
949
- * A Bitcoin Taproot embedded wallet account linked to the user.
713
+ * The payload for importing a LINE account.
950
714
  */
951
- export interface LinkedAccountBitcoinTaprootEmbeddedWallet {
952
- id: string | null;
715
+ export interface LinkedAccountLineInput {
716
+ subject: string;
953
717
 
954
- address: string;
718
+ type: 'line_oauth';
955
719
 
956
- chain_id: string;
720
+ email?: string;
957
721
 
958
- chain_type: 'bitcoin-taproot';
722
+ name?: string;
959
723
 
960
- connector_type: 'embedded';
724
+ profile_picture_url?: string;
725
+ }
961
726
 
962
- delegated: boolean;
727
+ /**
728
+ * A LINE OAuth account linked to the user.
729
+ */
730
+ export interface LinkedAccountLineOAuth {
731
+ email: string | null;
963
732
 
964
733
  first_verified_at: number | null;
965
734
 
966
- imported: boolean;
967
-
968
735
  latest_verified_at: number | null;
969
736
 
970
- public_key: string;
971
-
972
- /**
973
- * The method used to recover an embedded wallet account.
974
- */
975
- recovery_method: EmbeddedWalletRecoveryMethod;
976
-
977
- type: 'wallet';
737
+ name: string | null;
978
738
 
979
- verified_at: number;
739
+ profile_picture_url: string | null;
980
740
 
981
- wallet_client: 'privy';
741
+ subject: string;
982
742
 
983
- wallet_client_type: 'privy';
743
+ type: 'line_oauth';
984
744
 
985
- wallet_index: number;
745
+ verified_at: number;
986
746
  }
987
747
 
988
748
  /**
989
- * A curve signing embedded wallet account linked to the user.
749
+ * The payload for importing a LinkedIn account.
990
750
  */
991
- export interface LinkedAccountCurveSigningEmbeddedWallet {
992
- id: string | null;
751
+ export interface LinkedAccountLinkedInInput {
752
+ subject: string;
993
753
 
994
- address: string;
754
+ type: 'linkedin_oauth';
995
755
 
996
- chain_id: string;
756
+ email?: string;
997
757
 
998
- /**
999
- * The wallet chain types that support curve-based signing.
1000
- */
1001
- chain_type: WalletsAPI.CurveSigningChainType;
758
+ name?: string;
1002
759
 
1003
- connector_type: 'embedded';
760
+ vanityName?: string;
761
+ }
1004
762
 
1005
- delegated: boolean;
763
+ /**
764
+ * A LinkedIn OAuth account linked to the user.
765
+ */
766
+ export interface LinkedAccountLinkedInOAuth {
767
+ email: string | null;
1006
768
 
1007
769
  first_verified_at: number | null;
1008
770
 
1009
- imported: boolean;
1010
-
1011
771
  latest_verified_at: number | null;
1012
772
 
1013
- public_key: string;
1014
-
1015
- /**
1016
- * The method used to recover an embedded wallet account.
1017
- */
1018
- recovery_method: EmbeddedWalletRecoveryMethod;
773
+ subject: string;
1019
774
 
1020
- type: 'wallet';
775
+ type: 'linkedin_oauth';
1021
776
 
1022
777
  verified_at: number;
1023
778
 
1024
- wallet_client: 'privy';
1025
-
1026
- wallet_client_type: 'privy';
779
+ name?: string;
1027
780
 
1028
- wallet_index: number;
781
+ vanity_name?: string;
1029
782
  }
1030
783
 
1031
- export type LinkedAccountEmbeddedWallet =
1032
- | LinkedAccountEthereumEmbeddedWallet
1033
- | LinkedAccountSolanaEmbeddedWallet
1034
- | LinkedAccountBitcoinSegwitEmbeddedWallet
1035
- | LinkedAccountBitcoinTaprootEmbeddedWallet
1036
- | LinkedAccountCurveSigningEmbeddedWallet;
1037
-
1038
784
  /**
1039
- * An embedded wallet account with an ID.
785
+ * A passkey account linked to the user.
1040
786
  */
1041
- export type LinkedAccountEmbeddedWalletWithID =
1042
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountEthereumEmbeddedWallet
1043
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountSolanaEmbeddedWallet
1044
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinSegwitEmbeddedWallet
1045
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountBitcoinTaprootEmbeddedWallet
1046
- | LinkedAccountEmbeddedWalletWithID.LinkedAccountCurveSigningEmbeddedWallet;
787
+ export interface LinkedAccountPasskey {
788
+ credential_id: string;
1047
789
 
1048
- export namespace LinkedAccountEmbeddedWalletWithID {
1049
- /**
1050
- * An Ethereum embedded wallet account linked to the user.
1051
- */
1052
- export interface LinkedAccountEthereumEmbeddedWallet
1053
- extends Omit<UsersAPI.LinkedAccountEthereumEmbeddedWallet, 'id' | 'recovery_method'> {
1054
- id: string;
790
+ enrolled_in_mfa: boolean;
1055
791
 
1056
- recovery_method: 'privy-v2';
1057
- }
792
+ first_verified_at: number | null;
1058
793
 
1059
- /**
1060
- * A Solana embedded wallet account linked to the user.
1061
- */
1062
- export interface LinkedAccountSolanaEmbeddedWallet
1063
- extends Omit<UsersAPI.LinkedAccountSolanaEmbeddedWallet, 'id' | 'recovery_method'> {
1064
- id: string;
794
+ latest_verified_at: number | null;
1065
795
 
1066
- recovery_method: 'privy-v2';
1067
- }
796
+ type: 'passkey';
1068
797
 
1069
- /**
1070
- * A Bitcoin SegWit embedded wallet account linked to the user.
1071
- */
1072
- export interface LinkedAccountBitcoinSegwitEmbeddedWallet
1073
- extends Omit<UsersAPI.LinkedAccountBitcoinSegwitEmbeddedWallet, 'id' | 'recovery_method'> {
1074
- id: string;
798
+ verified_at: number;
1075
799
 
1076
- recovery_method: 'privy-v2';
1077
- }
800
+ authenticator_name?: string;
1078
801
 
1079
- /**
1080
- * A Bitcoin Taproot embedded wallet account linked to the user.
1081
- */
1082
- export interface LinkedAccountBitcoinTaprootEmbeddedWallet
1083
- extends Omit<UsersAPI.LinkedAccountBitcoinTaprootEmbeddedWallet, 'id' | 'recovery_method'> {
1084
- id: string;
802
+ created_with_browser?: string;
1085
803
 
1086
- recovery_method: 'privy-v2';
1087
- }
804
+ created_with_device?: string;
1088
805
 
1089
- /**
1090
- * A curve signing embedded wallet account linked to the user.
1091
- */
1092
- export interface LinkedAccountCurveSigningEmbeddedWallet
1093
- extends Omit<UsersAPI.LinkedAccountCurveSigningEmbeddedWallet, 'id' | 'recovery_method'> {
1094
- id: string;
806
+ created_with_os?: string;
1095
807
 
1096
- recovery_method: 'privy-v2';
1097
- }
808
+ public_key?: string;
1098
809
  }
1099
810
 
1100
811
  /**
1101
- * A Google OAuth account linked to the user.
812
+ * The payload for importing a passkey account.
1102
813
  */
1103
- export interface LinkedAccountGoogleOAuth {
1104
- email: string;
814
+ export interface LinkedAccountPasskeyInput {
815
+ credential_device_type: 'singleDevice' | 'multiDevice';
816
+
817
+ credential_id: string;
818
+
819
+ credential_public_key: string;
820
+
821
+ credential_username: string;
822
+
823
+ type: 'passkey';
824
+ }
1105
825
 
826
+ /**
827
+ * A phone number account linked to the user.
828
+ */
829
+ export interface LinkedAccountPhone {
1106
830
  first_verified_at: number | null;
1107
831
 
1108
832
  latest_verified_at: number | null;
1109
833
 
1110
- name: string | null;
1111
-
1112
- subject: string;
834
+ phoneNumber: string;
1113
835
 
1114
- type: 'google_oauth';
836
+ type: 'phone';
1115
837
 
1116
838
  verified_at: number;
839
+
840
+ number?: string;
1117
841
  }
1118
842
 
1119
843
  /**
1120
- * A Twitter OAuth account linked to the user.
844
+ * The payload for importing a phone account.
1121
845
  */
1122
- export interface LinkedAccountTwitterOAuth {
1123
- first_verified_at: number | null;
846
+ export interface LinkedAccountPhoneInput {
847
+ number: string;
1124
848
 
1125
- latest_verified_at: number | null;
849
+ type: 'phone';
850
+ }
1126
851
 
1127
- name: string | null;
852
+ /**
853
+ * A smart wallet account linked to the user.
854
+ */
855
+ export interface LinkedAccountSmartWallet {
856
+ address: string;
1128
857
 
1129
- profile_picture_url: string | null;
858
+ first_verified_at: number | null;
1130
859
 
1131
- subject: string;
860
+ latest_verified_at: number | null;
1132
861
 
1133
- type: 'twitter_oauth';
862
+ /**
863
+ * The supported smart wallet providers.
864
+ */
865
+ smart_wallet_type: EmbeddedWalletsAPI.SmartWalletType;
1134
866
 
1135
- username: string | null;
867
+ type: 'smart_wallet';
1136
868
 
1137
869
  verified_at: number;
870
+
871
+ smart_wallet_version?: string;
1138
872
  }
1139
873
 
1140
874
  /**
1141
- * A Discord OAuth account linked to the user.
875
+ * A Solana wallet account linked to the user.
1142
876
  */
1143
- export interface LinkedAccountDiscordOAuth {
1144
- email: string | null;
877
+ export interface LinkedAccountSolana {
878
+ address: string;
879
+
880
+ chain_type: 'solana';
1145
881
 
1146
882
  first_verified_at: number | null;
1147
883
 
1148
884
  latest_verified_at: number | null;
1149
885
 
1150
- subject: string;
886
+ type: 'wallet';
1151
887
 
1152
- type: 'discord_oauth';
888
+ verified_at: number;
1153
889
 
1154
- username: string | null;
890
+ wallet_client: 'unknown';
1155
891
 
1156
- verified_at: number;
892
+ connector_type?: string;
893
+
894
+ wallet_client_type?: string;
1157
895
  }
1158
896
 
1159
897
  /**
1160
- * A GitHub OAuth account linked to the user.
898
+ * A Solana embedded wallet account linked to the user.
1161
899
  */
1162
- export interface LinkedAccountGitHubOAuth {
1163
- email: string | null;
900
+ export interface LinkedAccountSolanaEmbeddedWallet {
901
+ id: string | null;
902
+
903
+ address: string;
904
+
905
+ chain_id: string;
906
+
907
+ chain_type: 'solana';
908
+
909
+ connector_type: 'embedded';
910
+
911
+ delegated: boolean;
1164
912
 
1165
913
  first_verified_at: number | null;
1166
914
 
1167
- latest_verified_at: number | null;
915
+ imported: boolean;
916
+
917
+ latest_verified_at: number | null;
918
+
919
+ public_key: string;
920
+
921
+ /**
922
+ * The method used to recover an embedded wallet account.
923
+ */
924
+ recovery_method: EmbeddedWalletRecoveryMethod;
1168
925
 
1169
- name: string | null;
926
+ type: 'wallet';
1170
927
 
1171
- subject: string;
928
+ verified_at: number;
1172
929
 
1173
- type: 'github_oauth';
930
+ wallet_client: 'privy';
1174
931
 
1175
- username: string | null;
932
+ wallet_client_type: 'privy';
1176
933
 
1177
- verified_at: number;
934
+ wallet_index: number;
1178
935
  }
1179
936
 
1180
937
  /**
1181
- * A LinkedIn OAuth account linked to the user.
938
+ * The payload for importing a Spotify account.
1182
939
  */
1183
- export interface LinkedAccountLinkedInOAuth {
1184
- email: string | null;
1185
-
1186
- first_verified_at: number | null;
1187
-
1188
- latest_verified_at: number | null;
1189
-
940
+ export interface LinkedAccountSpotifyInput {
1190
941
  subject: string;
1191
942
 
1192
- type: 'linkedin_oauth';
943
+ type: 'spotify_oauth';
1193
944
 
1194
- verified_at: number;
945
+ email?: string;
1195
946
 
1196
947
  name?: string;
1197
-
1198
- vanity_name?: string;
1199
948
  }
1200
949
 
1201
950
  /**
@@ -1218,73 +967,71 @@ export interface LinkedAccountSpotifyOAuth {
1218
967
  }
1219
968
 
1220
969
  /**
1221
- * An Instagram OAuth account linked to the user.
970
+ * A Telegram account linked to the user.
1222
971
  */
1223
- export interface LinkedAccountInstagramOAuth {
972
+ export interface LinkedAccountTelegram {
1224
973
  first_verified_at: number | null;
1225
974
 
1226
975
  latest_verified_at: number | null;
1227
976
 
1228
- subject: string;
1229
-
1230
- type: 'instagram_oauth';
977
+ telegram_user_id: string;
1231
978
 
1232
- username: string | null;
979
+ type: 'telegram';
1233
980
 
1234
981
  verified_at: number;
982
+
983
+ first_name?: string | null;
984
+
985
+ last_name?: string | null;
986
+
987
+ photo_url?: string | null;
988
+
989
+ username?: string | null;
1235
990
  }
1236
991
 
1237
992
  /**
1238
- * A TikTok OAuth account linked to the user.
993
+ * The payload for importing a Telegram account.
1239
994
  */
1240
- export interface LinkedAccountTiktokOAuth {
1241
- first_verified_at: number | null;
1242
-
1243
- latest_verified_at: number | null;
995
+ export interface LinkedAccountTelegramInput {
996
+ telegram_user_id: string;
1244
997
 
1245
- name: string | null;
998
+ type: 'telegram';
1246
999
 
1247
- subject: string;
1000
+ first_name?: string;
1248
1001
 
1249
- type: 'tiktok_oauth';
1002
+ last_name?: string;
1250
1003
 
1251
- username: string | null;
1004
+ photo_url?: string;
1252
1005
 
1253
- verified_at: number;
1006
+ username?: string;
1254
1007
  }
1255
1008
 
1256
1009
  /**
1257
- * A LINE OAuth account linked to the user.
1010
+ * The payload for importing a Tiktok account.
1258
1011
  */
1259
- export interface LinkedAccountLineOAuth {
1260
- email: string | null;
1261
-
1262
- first_verified_at: number | null;
1263
-
1264
- latest_verified_at: number | null;
1265
-
1012
+ export interface LinkedAccountTiktokInput {
1266
1013
  name: string | null;
1267
1014
 
1268
- profile_picture_url: string | null;
1269
-
1270
1015
  subject: string;
1271
1016
 
1272
- type: 'line_oauth';
1017
+ type: 'tiktok_oauth';
1273
1018
 
1274
- verified_at: number;
1019
+ username: string;
1275
1020
  }
1276
1021
 
1277
1022
  /**
1278
- * A Twitch OAuth account linked to the user.
1023
+ * A TikTok OAuth account linked to the user.
1279
1024
  */
1280
- export interface LinkedAccountTwitchOAuth {
1025
+ export interface LinkedAccountTiktokOAuth {
1281
1026
  first_verified_at: number | null;
1282
1027
 
1283
1028
  latest_verified_at: number | null;
1284
1029
 
1030
+ name: string | null;
1031
+
1285
1032
  subject: string;
1286
1033
 
1287
- type: 'twitch_oauth';
1034
+ type: 'tiktok_oauth';
1288
1035
 
1289
1036
  username: string | null;
1290
1037
 
@@ -1292,147 +1039,69 @@ export interface LinkedAccountTwitchOAuth {
1292
1039
  }
1293
1040
 
1294
1041
  /**
1295
- * An Apple OAuth account linked to the user.
1042
+ * The payload for importing a Twitch account.
1296
1043
  */
1297
- export interface LinkedAccountAppleOAuth {
1298
- email: string | null;
1299
-
1300
- first_verified_at: number | null;
1301
-
1302
- latest_verified_at: number | null;
1303
-
1044
+ export interface LinkedAccountTwitchInput {
1304
1045
  subject: string;
1305
1046
 
1306
- type: 'apple_oauth';
1047
+ type: 'twitch_oauth';
1307
1048
 
1308
- verified_at: number;
1049
+ username?: string;
1309
1050
  }
1310
1051
 
1311
1052
  /**
1312
- * A custom OAuth account linked to the user.
1053
+ * A Twitch OAuth account linked to the user.
1313
1054
  */
1314
- export interface LinkedAccountCustomOAuth {
1055
+ export interface LinkedAccountTwitchOAuth {
1315
1056
  first_verified_at: number | null;
1316
1057
 
1317
1058
  latest_verified_at: number | null;
1318
1059
 
1319
1060
  subject: string;
1320
1061
 
1321
- /**
1322
- * The ID of a custom OAuth provider, set up for this app. Must start with
1323
- * "custom:".
1324
- */
1325
- type: ClientAuthAPI.CustomOAuthProviderID;
1326
-
1327
- verified_at: number;
1328
-
1329
- email?: string;
1330
-
1331
- name?: string;
1062
+ type: 'twitch_oauth';
1332
1063
 
1333
- profile_picture_url?: string;
1064
+ username: string | null;
1334
1065
 
1335
- username?: string;
1066
+ verified_at: number;
1336
1067
  }
1337
1068
 
1338
1069
  /**
1339
- * A custom JWT account linked to the user.
1070
+ * The payload for importing a Twitter account.
1340
1071
  */
1341
- export interface LinkedAccountCustomJwt {
1342
- custom_user_id: string;
1343
-
1344
- first_verified_at: number | null;
1345
-
1346
- latest_verified_at: number | null;
1072
+ export interface LinkedAccountTwitterInput {
1073
+ name: string;
1347
1074
 
1348
- type: 'custom_auth';
1075
+ subject: string;
1349
1076
 
1350
- verified_at: number;
1351
- }
1077
+ type: 'twitter_oauth';
1352
1078
 
1353
- /**
1354
- * An embedded wallet associated with a cross-app account.
1355
- */
1356
- export interface CrossAppEmbeddedWallet {
1357
- address: string;
1358
- }
1079
+ username: string;
1359
1080
 
1360
- /**
1361
- * A smart wallet associated with a cross-app account.
1362
- */
1363
- export interface CrossAppSmartWallet {
1364
- address: string;
1081
+ profile_picture_url?: string;
1365
1082
  }
1366
1083
 
1367
1084
  /**
1368
- * A cross-app account linked to the user.
1085
+ * A Twitter OAuth account linked to the user.
1369
1086
  */
1370
- export interface LinkedAccountCrossApp {
1371
- embedded_wallets: Array<CrossAppEmbeddedWallet>;
1372
-
1087
+ export interface LinkedAccountTwitterOAuth {
1373
1088
  first_verified_at: number | null;
1374
1089
 
1375
1090
  latest_verified_at: number | null;
1376
1091
 
1377
- provider_app_id: string;
1092
+ name: string | null;
1378
1093
 
1379
- smart_wallets: Array<CrossAppSmartWallet>;
1094
+ profile_picture_url: string | null;
1380
1095
 
1381
1096
  subject: string;
1382
1097
 
1383
- type: 'cross_app';
1384
-
1385
- verified_at: number;
1386
- }
1387
-
1388
- /**
1389
- * An authorization key linked to the user.
1390
- */
1391
- export interface LinkedAccountAuthorizationKey {
1392
- first_verified_at: number | null;
1393
-
1394
- latest_verified_at: number | null;
1395
-
1396
- public_key: string;
1098
+ type: 'twitter_oauth';
1397
1099
 
1398
- type: 'authorization_key';
1100
+ username: string | null;
1399
1101
 
1400
1102
  verified_at: number;
1401
1103
  }
1402
1104
 
1403
- /**
1404
- * A linked account for the user.
1405
- */
1406
- export type LinkedAccount =
1407
- | LinkedAccountEmail
1408
- | LinkedAccountPhone
1409
- | LinkedAccountEthereum
1410
- | LinkedAccountSolana
1411
- | LinkedAccountSmartWallet
1412
- | LinkedAccountEthereumEmbeddedWallet
1413
- | LinkedAccountSolanaEmbeddedWallet
1414
- | LinkedAccountBitcoinSegwitEmbeddedWallet
1415
- | LinkedAccountBitcoinTaprootEmbeddedWallet
1416
- | LinkedAccountCurveSigningEmbeddedWallet
1417
- | LinkedAccountGoogleOAuth
1418
- | LinkedAccountTwitterOAuth
1419
- | LinkedAccountDiscordOAuth
1420
- | LinkedAccountGitHubOAuth
1421
- | LinkedAccountSpotifyOAuth
1422
- | LinkedAccountInstagramOAuth
1423
- | LinkedAccountTiktokOAuth
1424
- | LinkedAccountLineOAuth
1425
- | LinkedAccountTwitchOAuth
1426
- | LinkedAccountLinkedInOAuth
1427
- | LinkedAccountAppleOAuth
1428
- | LinkedAccountCustomOAuth
1429
- | LinkedAccountCustomJwt
1430
- | LinkedAccountFarcaster
1431
- | LinkedAccountPasskey
1432
- | LinkedAccountTelegram
1433
- | LinkedAccountCrossApp
1434
- | LinkedAccountAuthorizationKey;
1435
-
1436
1105
  /**
1437
1106
  * The possible types of linked accounts.
1438
1107
  */
@@ -1460,6 +1129,58 @@ export type LinkedAccountType =
1460
1129
  | 'authorization_key'
1461
1130
  | ClientAuthAPI.CustomOAuthProviderID;
1462
1131
 
1132
+ /**
1133
+ * The payload for importing a wallet account.
1134
+ */
1135
+ export interface LinkedAccountWalletInput {
1136
+ address: string;
1137
+
1138
+ chain_type: 'ethereum' | 'solana';
1139
+
1140
+ type: 'wallet';
1141
+ }
1142
+
1143
+ /**
1144
+ * A multi-factor authentication method linked to the user.
1145
+ */
1146
+ export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
1147
+
1148
+ /**
1149
+ * OAuth tokens associated with the user.
1150
+ */
1151
+ export interface OAuthTokens {
1152
+ access_token: string;
1153
+
1154
+ provider: string;
1155
+
1156
+ access_token_expires_in_seconds?: number;
1157
+
1158
+ refresh_token?: string;
1159
+
1160
+ refresh_token_expires_in_seconds?: number;
1161
+
1162
+ scopes?: Array<string>;
1163
+ }
1164
+
1165
+ /**
1166
+ * A Passkey MFA method.
1167
+ */
1168
+ export interface PasskeyMfaMethod {
1169
+ type: 'passkey';
1170
+
1171
+ verified_at: number;
1172
+ }
1173
+
1174
+ /**
1175
+ * The payload for partially updating custom metadata on a user.
1176
+ */
1177
+ export interface PatchUsersCustomMetadata {
1178
+ /**
1179
+ * Custom metadata associated with the user.
1180
+ */
1181
+ custom_metadata: CustomMetadata;
1182
+ }
1183
+
1463
1184
  /**
1464
1185
  * A SMS MFA method.
1465
1186
  */
@@ -1478,20 +1199,6 @@ export interface TotpMfaMethod {
1478
1199
  verified_at: number;
1479
1200
  }
1480
1201
 
1481
- /**
1482
- * A Passkey MFA method.
1483
- */
1484
- export interface PasskeyMfaMethod {
1485
- type: 'passkey';
1486
-
1487
- verified_at: number;
1488
- }
1489
-
1490
- /**
1491
- * A multi-factor authentication method linked to the user.
1492
- */
1493
- export type LinkedMfaMethod = SMSMfaMethod | TotpMfaMethod | PasskeyMfaMethod;
1494
-
1495
1202
  /**
1496
1203
  * A Privy user object.
1497
1204
  */
@@ -1524,293 +1231,119 @@ export interface User {
1524
1231
  }
1525
1232
 
1526
1233
  /**
1527
- * OAuth tokens associated with the user.
1528
- */
1529
- export interface OAuthTokens {
1530
- access_token: string;
1531
-
1532
- provider: string;
1533
-
1534
- access_token_expires_in_seconds?: number;
1535
-
1536
- refresh_token?: string;
1537
-
1538
- refresh_token_expires_in_seconds?: number;
1539
-
1540
- scopes?: Array<string>;
1541
- }
1542
-
1543
- /**
1544
- * The user object along their identity token.
1234
+ * The payload for batch creating users.
1545
1235
  */
1546
- export interface UserWithIdentityToken {
1547
- identity_token: string | null;
1548
-
1549
- /**
1550
- * A Privy user object.
1551
- */
1552
- user: User;
1236
+ export interface UserBatchCreateInput {
1237
+ users: Array<UserBatchCreateInput.User>;
1553
1238
  }
1554
1239
 
1555
- /**
1556
- * The authenticated user.
1557
- */
1558
- export interface AuthenticatedUser {
1559
- token: string | null;
1560
-
1561
- privy_access_token: string | null;
1562
-
1563
- refresh_token: string | null;
1564
-
1565
- /**
1566
- * Instructs the client on how to handle tokens received
1567
- */
1568
- session_update_action: 'set' | 'ignore' | 'clear';
1569
-
1570
- /**
1571
- * A Privy user object.
1572
- */
1573
- user: User;
1574
-
1575
- identity_token?: string;
1576
-
1577
- is_new_user?: boolean;
1240
+ export namespace UserBatchCreateInput {
1241
+ export interface User {
1242
+ linked_accounts: Array<UsersAPI.LinkedAccountInput>;
1578
1243
 
1579
- /**
1580
- * OAuth tokens associated with the user.
1581
- */
1582
- oauth_tokens?: OAuthTokens;
1583
- }
1244
+ create_embedded_wallet?: boolean;
1584
1245
 
1585
- export interface UserCreateParams {
1586
- linked_accounts: Array<LinkedAccountInput>;
1246
+ create_ethereum_smart_wallet?: boolean;
1587
1247
 
1588
- /**
1589
- * Custom metadata associated with the user.
1590
- */
1591
- custom_metadata?: CustomMetadata;
1248
+ create_ethereum_wallet?: boolean;
1592
1249
 
1593
- /**
1594
- * Wallets to create for the user.
1595
- */
1596
- wallets?: Array<UserCreateParams.Wallet>;
1597
- }
1250
+ create_n_embedded_wallets?: number;
1598
1251
 
1599
- export namespace UserCreateParams {
1600
- export interface Wallet {
1601
- /**
1602
- * The wallet chain types.
1603
- */
1604
- chain_type: WalletsAPI.WalletChainType;
1252
+ create_n_ethereum_wallets?: number;
1605
1253
 
1606
- /**
1607
- * Additional signers for the wallet.
1608
- */
1609
- additional_signers?: Array<Wallet.AdditionalSigner>;
1254
+ create_solana_wallet?: boolean;
1610
1255
 
1611
1256
  /**
1612
- * Create a smart wallet with this wallet as the signer. Only supported for wallets
1613
- * with `chain_type: "ethereum"`.
1257
+ * Custom metadata associated with the user.
1614
1258
  */
1615
- create_smart_wallet?: boolean;
1259
+ custom_metadata?: UsersAPI.CustomMetadata;
1616
1260
 
1617
1261
  /**
1618
- * Policy IDs to enforce on the wallet. Currently, only one policy is supported per
1619
- * wallet.
1262
+ * Wallets to create.
1620
1263
  */
1621
- policy_ids?: Array<string>;
1622
- }
1623
-
1624
- export namespace Wallet {
1625
- export interface AdditionalSigner {
1626
- /**
1627
- * A unique identifier for a key quorum.
1628
- */
1629
- signer_id: SharedAPI.KeyQuorumID;
1630
-
1631
- /**
1632
- * The array of policy IDs that will be applied to wallet requests. If specified,
1633
- * this will override the base policy IDs set on the wallet. Currently, only one
1634
- * policy is supported per signer.
1635
- */
1636
- override_policy_ids?: Array<string>;
1637
- }
1638
- }
1639
- }
1640
-
1641
- export interface UserListParams extends CursorParams {}
1642
-
1643
- export interface UserGetByCustomAuthIDParams {
1644
- custom_user_id: string;
1645
- }
1646
-
1647
- export interface UserGetByDiscordUsernameParams {
1648
- username: string;
1649
- }
1650
-
1651
- export interface UserGetByEmailAddressParams {
1652
- address: string;
1653
- }
1654
-
1655
- export interface UserGetByFarcasterIDParams {
1656
- fid: number;
1657
- }
1658
-
1659
- export interface UserGetByGitHubUsernameParams {
1660
- username: string;
1661
- }
1662
-
1663
- export interface UserGetByPhoneNumberParams {
1664
- number: string;
1665
- }
1666
-
1667
- export interface UserGetBySmartWalletAddressParams {
1668
- address: string;
1669
- }
1670
-
1671
- export interface UserGetByTelegramUserIDParams {
1672
- telegram_user_id: string;
1673
- }
1674
-
1675
- export interface UserGetByTelegramUsernameParams {
1676
- username: string;
1677
- }
1678
-
1679
- export interface UserGetByTwitterSubjectParams {
1680
- subject: string;
1681
- }
1682
-
1683
- export interface UserGetByTwitterUsernameParams {
1684
- username: string;
1685
- }
1686
-
1687
- export interface UserGetByWalletAddressParams {
1688
- address: string;
1689
- }
1690
-
1691
- export interface UserPregenerateWalletsParams {
1692
- wallets: Array<EmbeddedWalletsAPI.WalletCreationInput>;
1693
- }
1694
-
1695
- export type UserSearchParams = UserSearchParams.Variant0 | UserSearchParams.Variant1;
1696
-
1697
- export declare namespace UserSearchParams {
1698
- export interface Variant0 {
1699
- searchTerm: string;
1700
- }
1701
-
1702
- export interface Variant1 {
1703
- emails: Array<string>;
1704
-
1705
- phoneNumbers: Array<string>;
1706
-
1707
- walletAddresses: Array<string>;
1264
+ wallets?: Array<EmbeddedWalletsAPI.WalletCreationInput>;
1708
1265
  }
1709
1266
  }
1710
1267
 
1711
- export interface UserSetCustomMetadataParams {
1712
- /**
1713
- * Custom metadata associated with the user.
1714
- */
1715
- custom_metadata: CustomMetadata;
1716
- }
1717
-
1718
- export interface UserUnlinkLinkedAccountParams {
1719
- handle: string;
1268
+ /**
1269
+ * The user object along their identity token.
1270
+ */
1271
+ export interface UserWithIdentityToken {
1272
+ identity_token: string | null;
1720
1273
 
1721
1274
  /**
1722
- * The possible types of linked accounts.
1275
+ * A Privy user object.
1723
1276
  */
1724
- type: LinkedAccountType;
1725
-
1726
- provider?: string;
1277
+ user: User;
1727
1278
  }
1728
1279
 
1729
1280
  export declare namespace Users {
1730
1281
  export {
1282
+ type AuthenticatedUser as AuthenticatedUser,
1283
+ type CrossAppEmbeddedWallet as CrossAppEmbeddedWallet,
1284
+ type CrossAppSmartWallet as CrossAppSmartWallet,
1731
1285
  type CustomMetadata as CustomMetadata,
1732
- type LinkedAccountWalletInput as LinkedAccountWalletInput,
1733
- type LinkedAccountEmailInput as LinkedAccountEmailInput,
1734
- type LinkedAccountPhoneInput as LinkedAccountPhoneInput,
1735
- type LinkedAccountGoogleInput as LinkedAccountGoogleInput,
1736
- type LinkedAccountTwitterInput as LinkedAccountTwitterInput,
1286
+ type EmbeddedWalletRecoveryMethod as EmbeddedWalletRecoveryMethod,
1287
+ type LinkedAccount as LinkedAccount,
1288
+ type LinkedAccountAppleInput as LinkedAccountAppleInput,
1289
+ type LinkedAccountAppleOAuth as LinkedAccountAppleOAuth,
1290
+ type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1291
+ type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
1292
+ type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet,
1293
+ type LinkedAccountBitcoinTaprootEmbeddedWallet as LinkedAccountBitcoinTaprootEmbeddedWallet,
1294
+ type LinkedAccountCrossApp as LinkedAccountCrossApp,
1295
+ type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet,
1296
+ type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1297
+ type LinkedAccountCustomJwt as LinkedAccountCustomJwt,
1298
+ type LinkedAccountCustomOAuth as LinkedAccountCustomOAuth,
1737
1299
  type LinkedAccountDiscordInput as LinkedAccountDiscordInput,
1300
+ type LinkedAccountDiscordOAuth as LinkedAccountDiscordOAuth,
1301
+ type LinkedAccountEmail as LinkedAccountEmail,
1302
+ type LinkedAccountEmailInput as LinkedAccountEmailInput,
1303
+ type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet,
1304
+ type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID,
1305
+ type LinkedAccountEthereum as LinkedAccountEthereum,
1306
+ type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet,
1307
+ type LinkedAccountFarcaster as LinkedAccountFarcaster,
1308
+ type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1738
1309
  type LinkedAccountGitHubInput as LinkedAccountGitHubInput,
1739
- type LinkedAccountSpotifyInput as LinkedAccountSpotifyInput,
1310
+ type LinkedAccountGitHubOAuth as LinkedAccountGitHubOAuth,
1311
+ type LinkedAccountGoogleInput as LinkedAccountGoogleInput,
1312
+ type LinkedAccountGoogleOAuth as LinkedAccountGoogleOAuth,
1313
+ type LinkedAccountInput as LinkedAccountInput,
1740
1314
  type LinkedAccountInstagramInput as LinkedAccountInstagramInput,
1741
- type LinkedAccountTiktokInput as LinkedAccountTiktokInput,
1315
+ type LinkedAccountInstagramOAuth as LinkedAccountInstagramOAuth,
1742
1316
  type LinkedAccountLineInput as LinkedAccountLineInput,
1743
- type LinkedAccountTwitchInput as LinkedAccountTwitchInput,
1744
- type LinkedAccountAppleInput as LinkedAccountAppleInput,
1317
+ type LinkedAccountLineOAuth as LinkedAccountLineOAuth,
1745
1318
  type LinkedAccountLinkedInInput as LinkedAccountLinkedInInput,
1746
- type LinkedAccountFarcasterInput as LinkedAccountFarcasterInput,
1747
- type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1748
- type LinkedAccountCustomJwtInput as LinkedAccountCustomJwtInput,
1319
+ type LinkedAccountLinkedInOAuth as LinkedAccountLinkedInOAuth,
1320
+ type LinkedAccountPasskey as LinkedAccountPasskey,
1749
1321
  type LinkedAccountPasskeyInput as LinkedAccountPasskeyInput,
1750
- type LinkedAccountInput as LinkedAccountInput,
1751
- type UserBatchCreateInput as UserBatchCreateInput,
1752
- type LinkedAccountEmail as LinkedAccountEmail,
1753
1322
  type LinkedAccountPhone as LinkedAccountPhone,
1754
- type LinkedAccountBaseWallet as LinkedAccountBaseWallet,
1755
- type LinkedAccountEthereum as LinkedAccountEthereum,
1323
+ type LinkedAccountPhoneInput as LinkedAccountPhoneInput,
1756
1324
  type LinkedAccountSmartWallet as LinkedAccountSmartWallet,
1757
1325
  type LinkedAccountSolana as LinkedAccountSolana,
1758
- type LinkedAccountFarcaster as LinkedAccountFarcaster,
1759
- type LinkedAccountPasskey as LinkedAccountPasskey,
1760
- type LinkedAccountTelegram as LinkedAccountTelegram,
1761
- type EmbeddedWalletRecoveryMethod as EmbeddedWalletRecoveryMethod,
1762
- type LinkedAccountEthereumEmbeddedWallet as LinkedAccountEthereumEmbeddedWallet,
1763
1326
  type LinkedAccountSolanaEmbeddedWallet as LinkedAccountSolanaEmbeddedWallet,
1764
- type LinkedAccountBitcoinSegwitEmbeddedWallet as LinkedAccountBitcoinSegwitEmbeddedWallet,
1765
- type LinkedAccountBitcoinTaprootEmbeddedWallet as LinkedAccountBitcoinTaprootEmbeddedWallet,
1766
- type LinkedAccountCurveSigningEmbeddedWallet as LinkedAccountCurveSigningEmbeddedWallet,
1767
- type LinkedAccountEmbeddedWallet as LinkedAccountEmbeddedWallet,
1768
- type LinkedAccountEmbeddedWalletWithID as LinkedAccountEmbeddedWalletWithID,
1769
- type LinkedAccountGoogleOAuth as LinkedAccountGoogleOAuth,
1770
- type LinkedAccountTwitterOAuth as LinkedAccountTwitterOAuth,
1771
- type LinkedAccountDiscordOAuth as LinkedAccountDiscordOAuth,
1772
- type LinkedAccountGitHubOAuth as LinkedAccountGitHubOAuth,
1773
- type LinkedAccountLinkedInOAuth as LinkedAccountLinkedInOAuth,
1327
+ type LinkedAccountSpotifyInput as LinkedAccountSpotifyInput,
1774
1328
  type LinkedAccountSpotifyOAuth as LinkedAccountSpotifyOAuth,
1775
- type LinkedAccountInstagramOAuth as LinkedAccountInstagramOAuth,
1329
+ type LinkedAccountTelegram as LinkedAccountTelegram,
1330
+ type LinkedAccountTelegramInput as LinkedAccountTelegramInput,
1331
+ type LinkedAccountTiktokInput as LinkedAccountTiktokInput,
1776
1332
  type LinkedAccountTiktokOAuth as LinkedAccountTiktokOAuth,
1777
- type LinkedAccountLineOAuth as LinkedAccountLineOAuth,
1333
+ type LinkedAccountTwitchInput as LinkedAccountTwitchInput,
1778
1334
  type LinkedAccountTwitchOAuth as LinkedAccountTwitchOAuth,
1779
- type LinkedAccountAppleOAuth as LinkedAccountAppleOAuth,
1780
- type LinkedAccountCustomOAuth as LinkedAccountCustomOAuth,
1781
- type LinkedAccountCustomJwt as LinkedAccountCustomJwt,
1782
- type CrossAppEmbeddedWallet as CrossAppEmbeddedWallet,
1783
- type CrossAppSmartWallet as CrossAppSmartWallet,
1784
- type LinkedAccountCrossApp as LinkedAccountCrossApp,
1785
- type LinkedAccountAuthorizationKey as LinkedAccountAuthorizationKey,
1786
- type LinkedAccount as LinkedAccount,
1335
+ type LinkedAccountTwitterInput as LinkedAccountTwitterInput,
1336
+ type LinkedAccountTwitterOAuth as LinkedAccountTwitterOAuth,
1787
1337
  type LinkedAccountType as LinkedAccountType,
1338
+ type LinkedAccountWalletInput as LinkedAccountWalletInput,
1339
+ type LinkedMfaMethod as LinkedMfaMethod,
1340
+ type OAuthTokens as OAuthTokens,
1341
+ type PasskeyMfaMethod as PasskeyMfaMethod,
1342
+ type PatchUsersCustomMetadata as PatchUsersCustomMetadata,
1788
1343
  type SMSMfaMethod as SMSMfaMethod,
1789
1344
  type TotpMfaMethod as TotpMfaMethod,
1790
- type PasskeyMfaMethod as PasskeyMfaMethod,
1791
- type LinkedMfaMethod as LinkedMfaMethod,
1792
1345
  type User as User,
1793
- type OAuthTokens as OAuthTokens,
1346
+ type UserBatchCreateInput as UserBatchCreateInput,
1794
1347
  type UserWithIdentityToken as UserWithIdentityToken,
1795
- type AuthenticatedUser as AuthenticatedUser,
1796
- type UsersCursor as UsersCursor,
1797
- type UserCreateParams as UserCreateParams,
1798
- type UserListParams as UserListParams,
1799
- type UserGetByCustomAuthIDParams as UserGetByCustomAuthIDParams,
1800
- type UserGetByDiscordUsernameParams as UserGetByDiscordUsernameParams,
1801
- type UserGetByEmailAddressParams as UserGetByEmailAddressParams,
1802
- type UserGetByFarcasterIDParams as UserGetByFarcasterIDParams,
1803
- type UserGetByGitHubUsernameParams as UserGetByGitHubUsernameParams,
1804
- type UserGetByPhoneNumberParams as UserGetByPhoneNumberParams,
1805
- type UserGetBySmartWalletAddressParams as UserGetBySmartWalletAddressParams,
1806
- type UserGetByTelegramUserIDParams as UserGetByTelegramUserIDParams,
1807
- type UserGetByTelegramUsernameParams as UserGetByTelegramUsernameParams,
1808
- type UserGetByTwitterSubjectParams as UserGetByTwitterSubjectParams,
1809
- type UserGetByTwitterUsernameParams as UserGetByTwitterUsernameParams,
1810
- type UserGetByWalletAddressParams as UserGetByWalletAddressParams,
1811
- type UserPregenerateWalletsParams as UserPregenerateWalletsParams,
1812
- type UserSearchParams as UserSearchParams,
1813
- type UserSetCustomMetadataParams as UserSetCustomMetadataParams,
1814
- type UserUnlinkLinkedAccountParams as UserUnlinkLinkedAccountParams,
1815
1348
  };
1816
1349
  }