@privy-io/api-types 0.6.1 → 0.8.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 (197) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/client.d.mts +53 -29
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +53 -29
  5. package/client.d.ts.map +1 -1
  6. package/client.js +32 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +34 -9
  9. package/client.mjs.map +1 -1
  10. package/package.json +12 -1
  11. package/resources/accounts.d.mts +146 -4
  12. package/resources/accounts.d.mts.map +1 -1
  13. package/resources/accounts.d.ts +146 -4
  14. package/resources/accounts.d.ts.map +1 -1
  15. package/resources/accounts.js.map +1 -1
  16. package/resources/accounts.mjs.map +1 -1
  17. package/resources/aggregations.d.mts +18 -392
  18. package/resources/aggregations.d.mts.map +1 -1
  19. package/resources/aggregations.d.ts +18 -392
  20. package/resources/aggregations.d.ts.map +1 -1
  21. package/resources/aggregations.js.map +1 -1
  22. package/resources/aggregations.mjs.map +1 -1
  23. package/resources/apps.d.mts +197 -70
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +197 -70
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/apps.js.map +1 -1
  28. package/resources/apps.mjs.map +1 -1
  29. package/resources/client-auth.d.mts +975 -463
  30. package/resources/client-auth.d.mts.map +1 -1
  31. package/resources/client-auth.d.ts +975 -463
  32. package/resources/client-auth.d.ts.map +1 -1
  33. package/resources/client-auth.js.map +1 -1
  34. package/resources/client-auth.mjs.map +1 -1
  35. package/resources/cross-app.d.mts +14 -13
  36. package/resources/cross-app.d.mts.map +1 -1
  37. package/resources/cross-app.d.ts +14 -13
  38. package/resources/cross-app.d.ts.map +1 -1
  39. package/resources/embedded-wallets.d.mts +165 -81
  40. package/resources/embedded-wallets.d.mts.map +1 -1
  41. package/resources/embedded-wallets.d.ts +165 -81
  42. package/resources/embedded-wallets.d.ts.map +1 -1
  43. package/resources/embedded-wallets.js.map +1 -1
  44. package/resources/embedded-wallets.mjs.map +1 -1
  45. package/resources/funding.d.mts +150 -64
  46. package/resources/funding.d.mts.map +1 -1
  47. package/resources/funding.d.ts +150 -64
  48. package/resources/funding.d.ts.map +1 -1
  49. package/resources/funding.js.map +1 -1
  50. package/resources/funding.mjs.map +1 -1
  51. package/resources/index.d.mts +18 -14
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +18 -14
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +9 -1
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +6 -2
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/intents.d.mts +446 -31
  60. package/resources/intents.d.mts.map +1 -1
  61. package/resources/intents.d.ts +446 -31
  62. package/resources/intents.d.ts.map +1 -1
  63. package/resources/intents.js.map +1 -1
  64. package/resources/intents.mjs.map +1 -1
  65. package/resources/key-quorums.d.mts +108 -17
  66. package/resources/key-quorums.d.mts.map +1 -1
  67. package/resources/key-quorums.d.ts +108 -17
  68. package/resources/key-quorums.d.ts.map +1 -1
  69. package/resources/key-quorums.js +26 -9
  70. package/resources/key-quorums.js.map +1 -1
  71. package/resources/key-quorums.mjs +26 -9
  72. package/resources/key-quorums.mjs.map +1 -1
  73. package/resources/kraken-embed.d.mts +62 -0
  74. package/resources/kraken-embed.d.mts.map +1 -0
  75. package/resources/kraken-embed.d.ts +62 -0
  76. package/resources/kraken-embed.d.ts.map +1 -0
  77. package/resources/kraken-embed.js +9 -0
  78. package/resources/kraken-embed.js.map +1 -0
  79. package/resources/kraken-embed.mjs +5 -0
  80. package/resources/kraken-embed.mjs.map +1 -0
  81. package/resources/policies.d.mts +342 -926
  82. package/resources/policies.d.mts.map +1 -1
  83. package/resources/policies.d.ts +342 -926
  84. package/resources/policies.d.ts.map +1 -1
  85. package/resources/policies.js +51 -41
  86. package/resources/policies.js.map +1 -1
  87. package/resources/policies.mjs +51 -41
  88. package/resources/policies.mjs.map +1 -1
  89. package/resources/shared.d.mts +59 -0
  90. package/resources/shared.d.mts.map +1 -0
  91. package/resources/shared.d.ts +59 -0
  92. package/resources/shared.d.ts.map +1 -0
  93. package/resources/shared.js +9 -0
  94. package/resources/shared.js.map +1 -0
  95. package/resources/shared.mjs +5 -0
  96. package/resources/shared.mjs.map +1 -0
  97. package/resources/swaps.d.mts +108 -0
  98. package/resources/swaps.d.mts.map +1 -0
  99. package/resources/swaps.d.ts +108 -0
  100. package/resources/swaps.d.ts.map +1 -0
  101. package/resources/swaps.js +9 -0
  102. package/resources/swaps.js.map +1 -0
  103. package/resources/swaps.mjs +5 -0
  104. package/resources/swaps.mjs.map +1 -0
  105. package/resources/transactions.d.mts +158 -93
  106. package/resources/transactions.d.mts.map +1 -1
  107. package/resources/transactions.d.ts +158 -93
  108. package/resources/transactions.d.ts.map +1 -1
  109. package/resources/transactions.js +3 -0
  110. package/resources/transactions.js.map +1 -1
  111. package/resources/transactions.mjs +3 -0
  112. package/resources/transactions.mjs.map +1 -1
  113. package/resources/users.d.mts +64 -94
  114. package/resources/users.d.mts.map +1 -1
  115. package/resources/users.d.ts +64 -94
  116. package/resources/users.d.ts.map +1 -1
  117. package/resources/users.js +3 -0
  118. package/resources/users.js.map +1 -1
  119. package/resources/users.mjs +3 -0
  120. package/resources/users.mjs.map +1 -1
  121. package/resources/wallet-actions.d.mts +187 -0
  122. package/resources/wallet-actions.d.mts.map +1 -0
  123. package/resources/wallet-actions.d.ts +187 -0
  124. package/resources/wallet-actions.d.ts.map +1 -0
  125. package/resources/wallet-actions.js +9 -0
  126. package/resources/wallet-actions.js.map +1 -0
  127. package/resources/wallet-actions.mjs +5 -0
  128. package/resources/wallet-actions.mjs.map +1 -0
  129. package/resources/wallets/balance.d.mts +7 -4
  130. package/resources/wallets/balance.d.mts.map +1 -1
  131. package/resources/wallets/balance.d.ts +7 -4
  132. package/resources/wallets/balance.d.ts.map +1 -1
  133. package/resources/wallets/balance.js +3 -0
  134. package/resources/wallets/balance.js.map +1 -1
  135. package/resources/wallets/balance.mjs +3 -0
  136. package/resources/wallets/balance.mjs.map +1 -1
  137. package/resources/wallets/index.d.mts +1 -1
  138. package/resources/wallets/index.d.mts.map +1 -1
  139. package/resources/wallets/index.d.ts +1 -1
  140. package/resources/wallets/index.d.ts.map +1 -1
  141. package/resources/wallets/index.js.map +1 -1
  142. package/resources/wallets/index.mjs.map +1 -1
  143. package/resources/wallets/transactions.d.mts +10 -6
  144. package/resources/wallets/transactions.d.mts.map +1 -1
  145. package/resources/wallets/transactions.d.ts +10 -6
  146. package/resources/wallets/transactions.d.ts.map +1 -1
  147. package/resources/wallets/transactions.js +3 -0
  148. package/resources/wallets/transactions.js.map +1 -1
  149. package/resources/wallets/transactions.mjs +3 -0
  150. package/resources/wallets/transactions.mjs.map +1 -1
  151. package/resources/wallets/wallets.d.mts +2399 -936
  152. package/resources/wallets/wallets.d.mts.map +1 -1
  153. package/resources/wallets/wallets.d.ts +2399 -936
  154. package/resources/wallets/wallets.d.ts.map +1 -1
  155. package/resources/wallets/wallets.js +28 -10
  156. package/resources/wallets/wallets.js.map +1 -1
  157. package/resources/wallets/wallets.mjs +28 -10
  158. package/resources/wallets/wallets.mjs.map +1 -1
  159. package/resources/webhooks.d.mts +780 -339
  160. package/resources/webhooks.d.mts.map +1 -1
  161. package/resources/webhooks.d.ts +780 -339
  162. package/resources/webhooks.d.ts.map +1 -1
  163. package/resources/webhooks.js.map +1 -1
  164. package/resources/webhooks.mjs.map +1 -1
  165. package/resources/yield.d.mts +50 -9
  166. package/resources/yield.d.mts.map +1 -1
  167. package/resources/yield.d.ts +50 -9
  168. package/resources/yield.d.ts.map +1 -1
  169. package/src/client.ts +884 -99
  170. package/src/resources/accounts.ts +179 -3
  171. package/src/resources/aggregations.ts +18 -702
  172. package/src/resources/apps.ts +250 -85
  173. package/src/resources/client-auth.ts +1453 -786
  174. package/src/resources/cross-app.ts +19 -15
  175. package/src/resources/embedded-wallets.ts +219 -123
  176. package/src/resources/funding.ts +263 -173
  177. package/src/resources/index.ts +444 -61
  178. package/src/resources/intents.ts +575 -37
  179. package/src/resources/key-quorums.ts +137 -21
  180. package/src/resources/kraken-embed.ts +85 -0
  181. package/src/resources/policies.ts +582 -1550
  182. package/src/resources/shared.ts +79 -0
  183. package/src/resources/swaps.ts +136 -0
  184. package/src/resources/transactions.ts +188 -91
  185. package/src/resources/users.ts +82 -132
  186. package/src/resources/wallet-actions.ts +251 -0
  187. package/src/resources/wallets/balance.ts +9 -2
  188. package/src/resources/wallets/index.ts +146 -16
  189. package/src/resources/wallets/transactions.ts +12 -4
  190. package/src/resources/wallets/wallets.ts +2922 -974
  191. package/src/resources/webhooks.ts +970 -454
  192. package/src/resources/yield.ts +68 -10
  193. package/src/version.ts +1 -1
  194. package/version.d.mts +1 -1
  195. package/version.d.ts +1 -1
  196. package/version.js +1 -1
  197. package/version.mjs +1 -1
@@ -2,9 +2,143 @@
2
2
 
3
3
  import { APIResource } from '../core/resource';
4
4
  import * as ClientAuthAPI from './client-auth';
5
+ import * as EmbeddedWalletsAPI from './embedded-wallets';
5
6
 
6
7
  export class Apps extends APIResource {}
7
8
 
9
+ /**
10
+ * A valid CAIP-2 chain ID (e.g. 'eip155:1').
11
+ */
12
+ export type Caip2 = string;
13
+
14
+ /**
15
+ * A currency asset type.
16
+ */
17
+ export type CurrencyAsset = 'native-currency' | 'USDC';
18
+
19
+ /**
20
+ * A crypto currency identified by a CAIP-2 chain ID and optional asset.
21
+ */
22
+ export interface Currency {
23
+ /**
24
+ * A valid CAIP-2 chain ID (e.g. 'eip155:1').
25
+ */
26
+ chain: Caip2;
27
+
28
+ /**
29
+ * A currency asset type.
30
+ */
31
+ asset?: CurrencyAsset;
32
+ }
33
+
34
+ /**
35
+ * Whether to create embedded wallets on login.
36
+ */
37
+ export type EmbeddedWalletCreateOnLogin = 'users-without-wallets' | 'all-users' | 'off';
38
+
39
+ /**
40
+ * Chain-specific configuration for embedded wallets.
41
+ */
42
+ export interface EmbeddedWalletChainConfig {
43
+ /**
44
+ * Whether to create embedded wallets on login.
45
+ */
46
+ create_on_login: EmbeddedWalletCreateOnLogin;
47
+ }
48
+
49
+ /**
50
+ * A user-owned recovery option for embedded wallets.
51
+ */
52
+ export type UserOwnedRecoveryOption = 'user-passcode' | 'google-drive' | 'icloud';
53
+
54
+ /**
55
+ * Input configuration for embedded wallets.
56
+ */
57
+ export interface EmbeddedWalletInputSchema {
58
+ /**
59
+ * Whether to create embedded wallets on login.
60
+ */
61
+ create_on_login: EmbeddedWalletCreateOnLogin;
62
+
63
+ /**
64
+ * Chain-specific configuration for embedded wallets.
65
+ */
66
+ ethereum: EmbeddedWalletChainConfig;
67
+
68
+ /**
69
+ * Chain-specific configuration for embedded wallets.
70
+ */
71
+ solana: EmbeddedWalletChainConfig;
72
+
73
+ user_owned_recovery_options: Array<UserOwnedRecoveryOption>;
74
+
75
+ require_user_owned_recovery_on_create?: boolean;
76
+
77
+ require_user_password_on_create?: boolean;
78
+ }
79
+
80
+ /**
81
+ * The mode for embedded wallets.
82
+ */
83
+ export type EmbeddedWalletMode = 'legacy-embedded-wallets-only' | 'user-controlled-server-wallets-only';
84
+
85
+ /**
86
+ * Configuration for embedded wallets including the mode.
87
+ */
88
+ export interface EmbeddedWalletConfigSchema extends EmbeddedWalletInputSchema {
89
+ /**
90
+ * The mode for embedded wallets.
91
+ */
92
+ mode: EmbeddedWalletMode;
93
+ }
94
+
95
+ /**
96
+ * Configuration for Telegram authentication.
97
+ */
98
+ export interface TelegramAuthConfigSchema {
99
+ bot_id: string;
100
+
101
+ bot_name: string;
102
+
103
+ link_enabled: boolean;
104
+
105
+ seamless_auth_enabled: boolean;
106
+ }
107
+
108
+ /**
109
+ * A funding method for on-ramp.
110
+ */
111
+ export type FundingMethodEnum = 'moonpay' | 'coinbase-onramp' | 'external';
112
+
113
+ /**
114
+ * A funding option with method and provider.
115
+ */
116
+ export interface FundingOption {
117
+ method: string;
118
+
119
+ provider: string;
120
+ }
121
+
122
+ /**
123
+ * Configuration for funding and on-ramp options.
124
+ */
125
+ export interface FundingConfigResponseSchema {
126
+ cross_chain_bridging_enabled: boolean;
127
+
128
+ default_recommended_amount: string;
129
+
130
+ /**
131
+ * A crypto currency identified by a CAIP-2 chain ID and optional asset.
132
+ */
133
+ default_recommended_currency: Currency;
134
+
135
+ methods: Array<FundingMethodEnum>;
136
+
137
+ options: Array<FundingOption>;
138
+
139
+ prompt_funding_on_wallet_creation: boolean;
140
+ }
141
+
8
142
  /**
9
143
  * The response for getting an app.
10
144
  */
@@ -39,7 +173,10 @@ export interface AppResponse {
39
173
 
40
174
  email_auth: boolean;
41
175
 
42
- embedded_wallet_config: AppResponse.EmbeddedWalletConfig;
176
+ /**
177
+ * Configuration for embedded wallets including the mode.
178
+ */
179
+ embedded_wallet_config: EmbeddedWalletConfigSchema;
43
180
 
44
181
  enabled_captcha_provider: 'turnstile' | 'hcaptcha' | null;
45
182
 
@@ -85,7 +222,10 @@ export interface AppResponse {
85
222
 
86
223
  show_wallet_login_first: boolean;
87
224
 
88
- smart_wallet_config: AppResponse.Enabled | AppResponse.UnionMember1;
225
+ /**
226
+ * The configuration object for smart wallets.
227
+ */
228
+ smart_wallet_config: EmbeddedWalletsAPI.SmartWalletConfiguration;
89
229
 
90
230
  sms_auth: boolean;
91
231
 
@@ -117,9 +257,15 @@ export interface AppResponse {
117
257
 
118
258
  captcha_site_key?: string;
119
259
 
120
- funding_config?: AppResponse.FundingConfig;
260
+ /**
261
+ * Configuration for funding and on-ramp options.
262
+ */
263
+ funding_config?: FundingConfigResponseSchema;
121
264
 
122
- telegram_auth_config?: AppResponse.TelegramAuthConfig;
265
+ /**
266
+ * Configuration for Telegram authentication.
267
+ */
268
+ telegram_auth_config?: TelegramAuthConfigSchema;
123
269
  }
124
270
 
125
271
  export namespace AppResponse {
@@ -146,114 +292,133 @@ export namespace AppResponse {
146
292
 
147
293
  provider_icon_url: string;
148
294
  }
295
+ }
149
296
 
150
- export interface EmbeddedWalletConfig {
151
- create_on_login: 'users-without-wallets' | 'all-users' | 'off';
152
-
153
- ethereum: EmbeddedWalletConfig.Ethereum;
154
-
155
- mode: 'legacy-embedded-wallets-only' | 'user-controlled-server-wallets-only';
156
-
157
- solana: EmbeddedWalletConfig.Solana;
158
-
159
- user_owned_recovery_options: Array<'user-passcode' | 'google-drive' | 'icloud'>;
160
-
161
- require_user_owned_recovery_on_create?: boolean;
162
-
163
- require_user_password_on_create?: boolean;
164
- }
165
-
166
- export namespace EmbeddedWalletConfig {
167
- export interface Ethereum {
168
- create_on_login: 'users-without-wallets' | 'all-users' | 'off';
169
- }
170
-
171
- export interface Solana {
172
- create_on_login: 'users-without-wallets' | 'all-users' | 'off';
173
- }
174
- }
175
-
176
- export interface Enabled {
177
- enabled: false;
178
- }
297
+ /**
298
+ * Allowlist invite input for an email address.
299
+ */
300
+ export interface EmailInviteInput {
301
+ type: 'email';
179
302
 
180
- export interface UnionMember1 {
181
- configured_networks: Array<UnionMember1.ConfiguredNetwork>;
303
+ value: string;
304
+ }
182
305
 
183
- enabled: true;
306
+ /**
307
+ * Allowlist invite input for a wallet address.
308
+ */
309
+ export interface WalletInviteInput {
310
+ type: 'wallet';
184
311
 
185
- smart_wallet_type:
186
- | 'safe'
187
- | 'kernel'
188
- | 'light_account'
189
- | 'biconomy'
190
- | 'coinbase_smart_wallet'
191
- | 'thirdweb';
312
+ value: string;
313
+ }
192
314
 
193
- smart_wallet_version?: string;
194
- }
315
+ /**
316
+ * Allowlist invite input for a phone number.
317
+ */
318
+ export interface PhoneInviteInput {
319
+ type: 'phone';
195
320
 
196
- export namespace UnionMember1 {
197
- export interface ConfiguredNetwork {
198
- bundler_url: string;
321
+ value: string;
322
+ }
199
323
 
200
- chain_id: string;
324
+ /**
325
+ * Input for adding or removing an allowlist entry. Discriminated by type.
326
+ */
327
+ export type UserInviteInput = EmailInviteInput | WalletInviteInput | PhoneInviteInput;
201
328
 
202
- chain_name?: string;
329
+ /**
330
+ * An allowlist entry for an app.
331
+ */
332
+ export interface AllowlistEntry {
333
+ id: string;
203
334
 
204
- paymaster_context?: ConfiguredNetwork.PaymasterContext;
335
+ acceptedAt: number | null;
205
336
 
206
- paymaster_url?: string;
337
+ appId: string;
207
338
 
208
- rpc_url?: string;
209
- }
339
+ type: string;
210
340
 
211
- export namespace ConfiguredNetwork {
212
- export interface PaymasterContext {
213
- policy_id: string;
214
- }
215
- }
216
- }
341
+ value: string;
342
+ }
217
343
 
218
- export interface FundingConfig {
219
- cross_chain_bridging_enabled: boolean;
344
+ /**
345
+ * Confirmation response for deleting an allowlist entry.
346
+ */
347
+ export interface AllowlistDeletionResponse {
348
+ message: string;
349
+ }
220
350
 
221
- default_recommended_amount: string;
351
+ /**
352
+ * A test account for an app.
353
+ */
354
+ export interface TestAccount {
355
+ id: string;
222
356
 
223
- default_recommended_currency: FundingConfig.DefaultRecommendedCurrency;
357
+ created_at: string;
224
358
 
225
- methods: Array<'moonpay' | 'coinbase-onramp' | 'external'>;
359
+ email: string;
226
360
 
227
- options: Array<FundingConfig.Option>;
361
+ otp_code: string;
228
362
 
229
- prompt_funding_on_wallet_creation: boolean;
230
- }
363
+ phone_number: string;
231
364
 
232
- export namespace FundingConfig {
233
- export interface DefaultRecommendedCurrency {
234
- chain: string;
365
+ updated_at: string;
366
+ }
235
367
 
236
- asset?: 'native-currency' | 'USDC';
237
- }
368
+ /**
369
+ * Response for listing test accounts for an app.
370
+ */
371
+ export interface TestAccountsResponse {
372
+ data: Array<TestAccount>;
373
+ }
238
374
 
239
- export interface Option {
240
- method: string;
375
+ /**
376
+ * Input for configuring gas sponsorship settings for an app.
377
+ */
378
+ export interface GasSponsorshipConfigurationInput {
379
+ configured_networks?: Array<Caip2>;
241
380
 
242
- provider: string;
243
- }
244
- }
381
+ require_app_secret?: boolean;
245
382
 
246
- export interface TelegramAuthConfig {
247
- bot_id: string;
383
+ sponsorship_enabled?: boolean;
384
+ }
248
385
 
249
- bot_name: string;
386
+ /**
387
+ * Gas sponsorship configuration for an app.
388
+ */
389
+ export interface GasSponsorshipConfiguration {
390
+ configured_networks: Array<Caip2>;
250
391
 
251
- link_enabled: boolean;
392
+ require_app_secret: boolean;
252
393
 
253
- seamless_auth_enabled: boolean;
254
- }
394
+ sponsorship_enabled: boolean;
255
395
  }
256
396
 
257
397
  export declare namespace Apps {
258
- export { type AppResponse as AppResponse };
398
+ export {
399
+ type Caip2 as Caip2,
400
+ type CurrencyAsset as CurrencyAsset,
401
+ type Currency as Currency,
402
+ type EmbeddedWalletCreateOnLogin as EmbeddedWalletCreateOnLogin,
403
+ type EmbeddedWalletChainConfig as EmbeddedWalletChainConfig,
404
+ type UserOwnedRecoveryOption as UserOwnedRecoveryOption,
405
+ type EmbeddedWalletInputSchema as EmbeddedWalletInputSchema,
406
+ type EmbeddedWalletMode as EmbeddedWalletMode,
407
+ type EmbeddedWalletConfigSchema as EmbeddedWalletConfigSchema,
408
+ type TelegramAuthConfigSchema as TelegramAuthConfigSchema,
409
+ type FundingMethodEnum as FundingMethodEnum,
410
+ type FundingOption as FundingOption,
411
+ type FundingConfigResponseSchema as FundingConfigResponseSchema,
412
+ type AppResponse as AppResponse,
413
+ type EmailInviteInput as EmailInviteInput,
414
+ type WalletInviteInput as WalletInviteInput,
415
+ type PhoneInviteInput as PhoneInviteInput,
416
+ type UserInviteInput as UserInviteInput,
417
+ type AllowlistEntry as AllowlistEntry,
418
+ type AllowlistDeletionResponse as AllowlistDeletionResponse,
419
+ type TestAccount as TestAccount,
420
+ type TestAccountsResponse as TestAccountsResponse,
421
+ type GasSponsorshipConfigurationInput as GasSponsorshipConfigurationInput,
422
+ type GasSponsorshipConfiguration as GasSponsorshipConfiguration,
423
+ };
259
424
  }