@privy-io/api-types 0.8.0 → 0.9.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 (112) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/client.d.mts +19 -19
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +19 -19
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs +1 -1
  8. package/client.mjs.map +1 -1
  9. package/internal/utils/env.js +2 -2
  10. package/internal/utils/env.js.map +1 -1
  11. package/internal/utils/env.mjs +2 -2
  12. package/internal/utils/env.mjs.map +1 -1
  13. package/package.json +1 -1
  14. package/resources/apps.d.mts +16 -2
  15. package/resources/apps.d.mts.map +1 -1
  16. package/resources/apps.d.ts +16 -2
  17. package/resources/apps.d.ts.map +1 -1
  18. package/resources/client-auth.d.mts +14 -14
  19. package/resources/client-auth.d.mts.map +1 -1
  20. package/resources/client-auth.d.ts +14 -14
  21. package/resources/client-auth.d.ts.map +1 -1
  22. package/resources/embedded-wallets.d.mts +50 -50
  23. package/resources/embedded-wallets.d.mts.map +1 -1
  24. package/resources/embedded-wallets.d.ts +50 -50
  25. package/resources/embedded-wallets.d.ts.map +1 -1
  26. package/resources/index.d.mts +11 -11
  27. package/resources/index.d.mts.map +1 -1
  28. package/resources/index.d.ts +11 -11
  29. package/resources/index.d.ts.map +1 -1
  30. package/resources/index.js.map +1 -1
  31. package/resources/index.mjs.map +1 -1
  32. package/resources/intents.d.mts +2 -2
  33. package/resources/intents.d.mts.map +1 -1
  34. package/resources/intents.d.ts +2 -2
  35. package/resources/intents.d.ts.map +1 -1
  36. package/resources/kraken-embed.d.mts +52 -1
  37. package/resources/kraken-embed.d.mts.map +1 -1
  38. package/resources/kraken-embed.d.ts +52 -1
  39. package/resources/kraken-embed.d.ts.map +1 -1
  40. package/resources/policies.d.mts +223 -112
  41. package/resources/policies.d.mts.map +1 -1
  42. package/resources/policies.d.ts +223 -112
  43. package/resources/policies.d.ts.map +1 -1
  44. package/resources/swaps.d.mts +3 -3
  45. package/resources/swaps.d.mts.map +1 -1
  46. package/resources/swaps.d.ts +3 -3
  47. package/resources/swaps.d.ts.map +1 -1
  48. package/resources/transactions.d.mts +10 -20
  49. package/resources/transactions.d.mts.map +1 -1
  50. package/resources/transactions.d.ts +10 -20
  51. package/resources/transactions.d.ts.map +1 -1
  52. package/resources/users.d.mts +199 -199
  53. package/resources/users.d.mts.map +1 -1
  54. package/resources/users.d.ts +199 -199
  55. package/resources/users.d.ts.map +1 -1
  56. package/resources/wallet-actions.d.mts +255 -3
  57. package/resources/wallet-actions.d.mts.map +1 -1
  58. package/resources/wallet-actions.d.ts +255 -3
  59. package/resources/wallet-actions.d.ts.map +1 -1
  60. package/resources/wallets/balance.d.mts +2 -1
  61. package/resources/wallets/balance.d.mts.map +1 -1
  62. package/resources/wallets/balance.d.ts +2 -1
  63. package/resources/wallets/balance.d.ts.map +1 -1
  64. package/resources/wallets/balance.js.map +1 -1
  65. package/resources/wallets/balance.mjs.map +1 -1
  66. package/resources/wallets/index.d.mts +1 -1
  67. package/resources/wallets/index.d.mts.map +1 -1
  68. package/resources/wallets/index.d.ts +1 -1
  69. package/resources/wallets/index.d.ts.map +1 -1
  70. package/resources/wallets/index.js.map +1 -1
  71. package/resources/wallets/index.mjs.map +1 -1
  72. package/resources/wallets/transactions.d.mts +10 -30
  73. package/resources/wallets/transactions.d.mts.map +1 -1
  74. package/resources/wallets/transactions.d.ts +10 -30
  75. package/resources/wallets/transactions.d.ts.map +1 -1
  76. package/resources/wallets/transactions.js.map +1 -1
  77. package/resources/wallets/transactions.mjs.map +1 -1
  78. package/resources/wallets/wallets.d.mts +222 -116
  79. package/resources/wallets/wallets.d.mts.map +1 -1
  80. package/resources/wallets/wallets.d.ts +222 -116
  81. package/resources/wallets/wallets.d.ts.map +1 -1
  82. package/resources/wallets/wallets.js +6 -5
  83. package/resources/wallets/wallets.js.map +1 -1
  84. package/resources/wallets/wallets.mjs +6 -5
  85. package/resources/wallets/wallets.mjs.map +1 -1
  86. package/resources/webhooks.d.mts +798 -93
  87. package/resources/webhooks.d.mts.map +1 -1
  88. package/resources/webhooks.d.ts +798 -93
  89. package/resources/webhooks.d.ts.map +1 -1
  90. package/src/client.ts +163 -35
  91. package/src/internal/utils/env.ts +2 -2
  92. package/src/resources/apps.ts +24 -1
  93. package/src/resources/client-auth.ts +17 -17
  94. package/src/resources/embedded-wallets.ts +59 -59
  95. package/src/resources/index.ts +92 -31
  96. package/src/resources/intents.ts +2 -2
  97. package/src/resources/kraken-embed.ts +105 -0
  98. package/src/resources/policies.ts +310 -181
  99. package/src/resources/swaps.ts +4 -4
  100. package/src/resources/transactions.ts +11 -38
  101. package/src/resources/users.ts +724 -724
  102. package/src/resources/wallet-actions.ts +324 -2
  103. package/src/resources/wallets/balance.ts +2 -1
  104. package/src/resources/wallets/index.ts +13 -2
  105. package/src/resources/wallets/transactions.ts +10 -88
  106. package/src/resources/wallets/wallets.ts +319 -136
  107. package/src/resources/webhooks.ts +1021 -141
  108. package/src/version.ts +1 -1
  109. package/version.d.mts +1 -1
  110. package/version.d.ts +1 -1
  111. package/version.js +1 -1
  112. package/version.mjs +1 -1
@@ -7,7 +7,12 @@ export class WalletActions extends APIResource {}
7
7
  /**
8
8
  * Type of wallet action
9
9
  */
10
- export type WalletActionType = 'swap' | 'transfer';
10
+ export type WalletActionType =
11
+ | 'swap'
12
+ | 'transfer'
13
+ | 'earn_deposit'
14
+ | 'earn_withdraw'
15
+ | 'earn_incentive_claim';
11
16
 
12
17
  /**
13
18
  * Status of a wallet action.
@@ -171,6 +176,11 @@ export interface SwapActionResponse {
171
176
  */
172
177
  wallet_id: string;
173
178
 
179
+ /**
180
+ * A description of why a wallet action (or a step within a wallet action) failed.
181
+ */
182
+ failure_reason?: FailureReason;
183
+
174
184
  /**
175
185
  * The steps of the wallet action. Only returned if `?include=steps` is provided.
176
186
  */
@@ -223,6 +233,248 @@ export interface TransferActionResponse {
223
233
  */
224
234
  wallet_id: string;
225
235
 
236
+ /**
237
+ * A description of why a wallet action (or a step within a wallet action) failed.
238
+ */
239
+ failure_reason?: FailureReason;
240
+
241
+ /**
242
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
243
+ */
244
+ steps?: Array<WalletActionStep>;
245
+ }
246
+
247
+ /**
248
+ * A specific reward token and amount associated with an earn incentive claim.
249
+ */
250
+ export interface EarnIncetiveClaimRewardEntry {
251
+ /**
252
+ * Claimable amount in base units.
253
+ */
254
+ amount: string;
255
+
256
+ /**
257
+ * Address of the reward token.
258
+ */
259
+ token_address: string;
260
+
261
+ /**
262
+ * Symbol of the reward token (e.g. "MORPHO").
263
+ */
264
+ token_symbol: string;
265
+ }
266
+
267
+ /**
268
+ * Response for an earn deposit action.
269
+ */
270
+ export interface EarnDepositActionResponse {
271
+ /**
272
+ * The ID of the wallet action.
273
+ */
274
+ id: string;
275
+
276
+ /**
277
+ * Underlying asset token address.
278
+ */
279
+ asset_address: string;
280
+
281
+ /**
282
+ * CAIP-2 chain identifier.
283
+ */
284
+ caip2: string;
285
+
286
+ /**
287
+ * ISO 8601 timestamp of when the wallet action was created.
288
+ */
289
+ created_at: string;
290
+
291
+ /**
292
+ * Base-unit amount of asset deposited (e.g. "1500000").
293
+ */
294
+ raw_amount: string;
295
+
296
+ /**
297
+ * Vault shares received in base units. Populated after on-chain confirmation.
298
+ */
299
+ share_amount: string | null;
300
+
301
+ /**
302
+ * Status of a wallet action.
303
+ */
304
+ status: WalletActionStatus;
305
+
306
+ type: 'earn_deposit';
307
+
308
+ /**
309
+ * ERC-4626 vault contract address.
310
+ */
311
+ vault_address: string;
312
+
313
+ /**
314
+ * The vault ID.
315
+ */
316
+ vault_id: string;
317
+
318
+ /**
319
+ * The ID of the wallet involved in the action.
320
+ */
321
+ wallet_id: string;
322
+
323
+ /**
324
+ * Human-readable decimal amount of asset deposited (e.g. "1.5"). Only present when
325
+ * the token is known in the asset registry.
326
+ */
327
+ amount?: string;
328
+
329
+ /**
330
+ * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
331
+ * the asset registry.
332
+ */
333
+ asset?: string;
334
+
335
+ /**
336
+ * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
337
+ * present when the token is known in the asset registry.
338
+ */
339
+ decimals?: number;
340
+
341
+ /**
342
+ * A description of why a wallet action (or a step within a wallet action) failed.
343
+ */
344
+ failure_reason?: FailureReason;
345
+
346
+ /**
347
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
348
+ */
349
+ steps?: Array<WalletActionStep>;
350
+ }
351
+
352
+ /**
353
+ * Response for an earn withdraw action.
354
+ */
355
+ export interface EarnWithdrawActionResponse {
356
+ /**
357
+ * The ID of the wallet action.
358
+ */
359
+ id: string;
360
+
361
+ /**
362
+ * Underlying asset token address.
363
+ */
364
+ asset_address: string;
365
+
366
+ /**
367
+ * CAIP-2 chain identifier.
368
+ */
369
+ caip2: string;
370
+
371
+ /**
372
+ * ISO 8601 timestamp of when the wallet action was created.
373
+ */
374
+ created_at: string;
375
+
376
+ /**
377
+ * Base-unit amount of asset withdrawn (e.g. "1500000").
378
+ */
379
+ raw_amount: string;
380
+
381
+ /**
382
+ * Vault shares burned in base units. Populated after on-chain confirmation.
383
+ */
384
+ share_amount: string | null;
385
+
386
+ /**
387
+ * Status of a wallet action.
388
+ */
389
+ status: WalletActionStatus;
390
+
391
+ type: 'earn_withdraw';
392
+
393
+ /**
394
+ * ERC-4626 vault contract address.
395
+ */
396
+ vault_address: string;
397
+
398
+ /**
399
+ * The vault ID.
400
+ */
401
+ vault_id: string;
402
+
403
+ /**
404
+ * The ID of the wallet involved in the action.
405
+ */
406
+ wallet_id: string;
407
+
408
+ /**
409
+ * Human-readable decimal amount of asset withdrawn (e.g. "1.5"). Only present when
410
+ * the token is known in the asset registry.
411
+ */
412
+ amount?: string;
413
+
414
+ /**
415
+ * Asset identifier (e.g. "usdc", "eth"). Only present when the token is known in
416
+ * the asset registry.
417
+ */
418
+ asset?: string;
419
+
420
+ /**
421
+ * Number of decimals for the underlying asset (e.g. 6 for USDC, 18 for ETH). Only
422
+ * present when the token is known in the asset registry.
423
+ */
424
+ decimals?: number;
425
+
426
+ /**
427
+ * A description of why a wallet action (or a step within a wallet action) failed.
428
+ */
429
+ failure_reason?: FailureReason;
430
+
431
+ /**
432
+ * The steps of the wallet action. Only returned if `?include=steps` is provided.
433
+ */
434
+ steps?: Array<WalletActionStep>;
435
+ }
436
+
437
+ /**
438
+ * Response for an earn incentive claim action.
439
+ */
440
+ export interface EarnIncentiveClaimActionResponse {
441
+ /**
442
+ * The ID of the wallet action.
443
+ */
444
+ id: string;
445
+
446
+ /**
447
+ * EVM chain name (e.g. "base", "ethereum").
448
+ */
449
+ chain: string;
450
+
451
+ /**
452
+ * ISO 8601 timestamp of when the wallet action was created.
453
+ */
454
+ created_at: string;
455
+
456
+ /**
457
+ * Claimed reward tokens. Populated after the preparation step fetches from Merkl.
458
+ */
459
+ rewards: Array<EarnIncetiveClaimRewardEntry> | null;
460
+
461
+ /**
462
+ * Status of a wallet action.
463
+ */
464
+ status: WalletActionStatus;
465
+
466
+ type: 'earn_incentive_claim';
467
+
468
+ /**
469
+ * The ID of the wallet involved in the action.
470
+ */
471
+ wallet_id: string;
472
+
473
+ /**
474
+ * A description of why a wallet action (or a step within a wallet action) failed.
475
+ */
476
+ failure_reason?: FailureReason;
477
+
226
478
  /**
227
479
  * The steps of the wallet action. Only returned if `?include=steps` is provided.
228
480
  */
@@ -232,7 +484,70 @@ export interface TransferActionResponse {
232
484
  /**
233
485
  * Response for a wallet action, discriminated on type.
234
486
  */
235
- export type WalletActionResponse = SwapActionResponse | TransferActionResponse;
487
+ export type WalletActionResponse =
488
+ | SwapActionResponse
489
+ | TransferActionResponse
490
+ | EarnDepositActionResponse
491
+ | EarnWithdrawActionResponse
492
+ | EarnIncentiveClaimActionResponse;
493
+
494
+ /**
495
+ * Input for depositing assets into an ERC-4626 vault. Exactly one of `amount` or
496
+ * `raw_amount` must be provided.
497
+ */
498
+ export interface EarnDepositRequestBody {
499
+ /**
500
+ * The ID of the vault to deposit into.
501
+ */
502
+ vault_id: string;
503
+
504
+ /**
505
+ * Human-readable decimal amount to deposit (e.g. "1.5" for 1.5 USDC). Exactly one
506
+ * of `amount` or `raw_amount` must be provided.
507
+ */
508
+ amount?: string;
509
+
510
+ /**
511
+ * Amount in smallest unit to deposit (e.g. "1500000" for 1.5 USDC with 6
512
+ * decimals). Exactly one of `amount` or `raw_amount` must be provided.
513
+ */
514
+ raw_amount?: string;
515
+ }
516
+
517
+ /**
518
+ * Input for withdrawing assets from an ERC-4626 vault. Exactly one of `amount` or
519
+ * `raw_amount` must be provided.
520
+ */
521
+ export interface EarnWithdrawRequestBody {
522
+ /**
523
+ * The ID of the vault to withdraw from.
524
+ */
525
+ vault_id: string;
526
+
527
+ /**
528
+ * Human-readable decimal amount to withdraw (e.g. "1.5" for 1.5 USDC). Exactly one
529
+ * of `amount` or `raw_amount` must be provided.
530
+ */
531
+ amount?: string;
532
+
533
+ /**
534
+ * Amount in smallest unit to withdraw (e.g. "1500000" for 1.5 USDC with 6
535
+ * decimals). Exactly one of `amount` or `raw_amount` must be provided.
536
+ */
537
+ raw_amount?: string;
538
+ }
539
+
540
+ /**
541
+ * Input for claiming incentive rewards.
542
+ */
543
+ export interface EarnIncentiveClaimRequestBody {
544
+ /**
545
+ * The blockchain network on which to perform the incentive claim. Supported chains
546
+ * include: 'ethereum', 'base', 'arbitrum', 'polygon', 'solana', and more, along
547
+ * with their respective testnets.
548
+ */
549
+ chain: string;
550
+ }
236
551
 
237
552
  export declare namespace WalletActions {
238
553
  export {
@@ -246,6 +561,13 @@ export declare namespace WalletActions {
246
561
  type WalletActionStep as WalletActionStep,
247
562
  type SwapActionResponse as SwapActionResponse,
248
563
  type TransferActionResponse as TransferActionResponse,
564
+ type EarnIncetiveClaimRewardEntry as EarnIncetiveClaimRewardEntry,
565
+ type EarnDepositActionResponse as EarnDepositActionResponse,
566
+ type EarnWithdrawActionResponse as EarnWithdrawActionResponse,
567
+ type EarnIncentiveClaimActionResponse as EarnIncentiveClaimActionResponse,
249
568
  type WalletActionResponse as WalletActionResponse,
569
+ type EarnDepositRequestBody as EarnDepositRequestBody,
570
+ type EarnWithdrawRequestBody as EarnWithdrawRequestBody,
571
+ type EarnIncentiveClaimRequestBody as EarnIncentiveClaimRequestBody,
250
572
  };
251
573
  }
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as WalletsAPI from './wallets';
4
5
  import { APIPromise } from '../../core/api-promise';
5
6
  import { RequestOptions } from '../../internal/request-options';
6
7
  import { path } from '../../internal/utils/path';
@@ -80,7 +81,7 @@ export interface BalanceGetParams {
80
81
  | 'eurc'
81
82
  | 'usdb'
82
83
  | 'sol'
83
- | Array<'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol'>;
84
+ | Array<WalletsAPI.WalletAsset>;
84
85
 
85
86
  chain?:
86
87
  | 'ethereum'
@@ -164,16 +164,27 @@ export {
164
164
  type WalletRpcRequestBody,
165
165
  type WalletRpcResponse,
166
166
  type WalletAuthenticateRequestBody,
167
+ type PrivateKeyInitInput,
168
+ type HDInitInput,
169
+ type PrivateKeySubmitInput,
170
+ type HDSubmitInput,
171
+ type WalletExportRequestBody,
172
+ type WalletExportResponseBody,
167
173
  type TokenTransferSource,
168
174
  type TokenTransferDestination,
169
- type CreateTokenTransferRequest,
175
+ type TransferRequestBody,
170
176
  type SuiCommandName,
177
+ type WalletEthereumAsset,
178
+ type WalletSolanaAsset,
179
+ type WalletAsset,
180
+ type TransferSentTransactionDetail,
181
+ type TransferReceivedTransactionDetail,
182
+ type TransactionDetail,
171
183
  type WalletAPIRegisterAuthorizationKeyInput,
172
184
  type WalletAPIRevokeAuthorizationKeyInput,
173
185
  type AuthorizationKeyDashboardResponse,
174
186
  type AuthorizationKeyResponse,
175
187
  type WalletAuthorizationHeaders,
176
- type WalletExportResponse,
177
188
  type WalletInitImportResponse,
178
189
  type WalletAuthenticateWithJwtResponse,
179
190
  type WalletCreateWalletsWithRecoveryResponse,
@@ -1,6 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../core/resource';
4
+ import * as WalletsAPI from './wallets';
4
5
  import { APIPromise } from '../../core/api-promise';
5
6
  import { RequestOptions } from '../../internal/request-options';
6
7
  import { path } from '../../internal/utils/path';
@@ -41,7 +42,10 @@ export namespace TransactionGetResponse {
41
42
 
42
43
  created_at: number;
43
44
 
44
- details: Transaction.UnionMember0 | Transaction.UnionMember1 | null;
45
+ /**
46
+ * Details of a wallet transaction, varying by transaction type.
47
+ */
48
+ details: Transaction.Details;
45
49
 
46
50
  privy_transaction_id: string;
47
51
 
@@ -65,97 +69,15 @@ export namespace TransactionGetResponse {
65
69
  }
66
70
 
67
71
  export namespace Transaction {
68
- export interface UnionMember0 {
69
- asset: 'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
70
-
71
- chain:
72
- | 'ethereum'
73
- | 'arbitrum'
74
- | 'base'
75
- | 'tempo'
76
- | 'linea'
77
- | 'optimism'
78
- | 'polygon'
79
- | 'solana'
80
- | 'zksync_era'
81
- | 'sepolia'
82
- | 'arbitrum_sepolia'
83
- | 'base_sepolia'
84
- | 'linea_testnet'
85
- | 'optimism_sepolia'
86
- | 'polygon_amoy'
87
- | 'solana_devnet'
88
- | 'solana_testnet';
89
-
90
- display_values: { [key: string]: string };
91
-
92
- raw_value: string;
93
-
94
- raw_value_decimals: number;
95
-
96
- recipient: string;
97
-
98
- recipient_privy_user_id: string | null;
99
-
100
- sender: string;
101
-
102
- sender_privy_user_id: string | null;
103
-
104
- type: 'transfer_sent';
105
- }
106
-
107
- export interface UnionMember1 {
108
- asset: 'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | (string & {});
109
-
110
- chain:
111
- | 'ethereum'
112
- | 'arbitrum'
113
- | 'base'
114
- | 'tempo'
115
- | 'linea'
116
- | 'optimism'
117
- | 'polygon'
118
- | 'solana'
119
- | 'zksync_era'
120
- | 'sepolia'
121
- | 'arbitrum_sepolia'
122
- | 'base_sepolia'
123
- | 'linea_testnet'
124
- | 'optimism_sepolia'
125
- | 'polygon_amoy'
126
- | 'solana_devnet'
127
- | 'solana_testnet';
128
-
129
- display_values: { [key: string]: string };
130
-
131
- raw_value: string;
132
-
133
- raw_value_decimals: number;
134
-
135
- recipient: string;
136
-
137
- recipient_privy_user_id: string | null;
138
-
139
- sender: string;
140
-
141
- sender_privy_user_id: string | null;
142
-
143
- type: 'transfer_received';
144
- }
72
+ /**
73
+ * Details of a wallet transaction, varying by transaction type.
74
+ */
75
+ export type Details = WalletsAPI.TransactionDetail & {};
145
76
  }
146
77
  }
147
78
 
148
79
  export interface TransactionGetParams {
149
- asset:
150
- | 'usdc'
151
- | 'usdc.e'
152
- | 'eth'
153
- | 'pol'
154
- | 'usdt'
155
- | 'eurc'
156
- | 'usdb'
157
- | 'sol'
158
- | Array<'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol'>;
80
+ asset: 'usdc' | 'usdc.e' | 'eth' | 'pol' | 'usdt' | 'eurc' | 'usdb' | 'sol' | Array<WalletsAPI.WalletAsset>;
159
81
 
160
82
  chain: 'ethereum' | 'arbitrum' | 'base' | 'tempo' | 'linea' | 'optimism' | 'polygon' | 'solana' | 'sepolia';
161
83