@privy-io/api-types 0.8.0 → 0.10.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 (167) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/client.d.mts +35 -32
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +35 -32
  5. package/client.d.ts.map +1 -1
  6. package/client.js +22 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +22 -8
  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/internal/utils/env.js +2 -2
  15. package/internal/utils/env.js.map +1 -1
  16. package/internal/utils/env.mjs +2 -2
  17. package/internal/utils/env.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/accounts.d.mts +128 -86
  20. package/resources/accounts.d.mts.map +1 -1
  21. package/resources/accounts.d.ts +128 -86
  22. package/resources/accounts.d.ts.map +1 -1
  23. package/resources/aggregations.d.mts +43 -43
  24. package/resources/aggregations.d.mts.map +1 -1
  25. package/resources/aggregations.d.ts +43 -43
  26. package/resources/aggregations.d.ts.map +1 -1
  27. package/resources/apps.d.mts +177 -129
  28. package/resources/apps.d.mts.map +1 -1
  29. package/resources/apps.d.ts +177 -129
  30. package/resources/apps.d.ts.map +1 -1
  31. package/resources/client-auth.d.mts +650 -648
  32. package/resources/client-auth.d.mts.map +1 -1
  33. package/resources/client-auth.d.ts +650 -648
  34. package/resources/client-auth.d.ts.map +1 -1
  35. package/resources/embedded-wallets.d.mts +84 -84
  36. package/resources/embedded-wallets.d.mts.map +1 -1
  37. package/resources/embedded-wallets.d.ts +84 -84
  38. package/resources/embedded-wallets.d.ts.map +1 -1
  39. package/resources/funding.d.mts +42 -42
  40. package/resources/funding.d.mts.map +1 -1
  41. package/resources/funding.d.ts +42 -42
  42. package/resources/funding.d.ts.map +1 -1
  43. package/resources/index.d.mts +19 -18
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +19 -18
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +2 -1
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/intents.d.mts +270 -266
  52. package/resources/intents.d.mts.map +1 -1
  53. package/resources/intents.d.ts +270 -266
  54. package/resources/intents.d.ts.map +1 -1
  55. package/resources/key-quorums.d.mts +20 -20
  56. package/resources/key-quorums.d.mts.map +1 -1
  57. package/resources/key-quorums.d.ts +20 -20
  58. package/resources/key-quorums.d.ts.map +1 -1
  59. package/resources/kraken-embed.d.mts +62 -19
  60. package/resources/kraken-embed.d.mts.map +1 -1
  61. package/resources/kraken-embed.d.ts +62 -19
  62. package/resources/kraken-embed.d.ts.map +1 -1
  63. package/resources/organizations.d.mts +65 -0
  64. package/resources/organizations.d.mts.map +1 -0
  65. package/resources/organizations.d.ts +65 -0
  66. package/resources/organizations.d.ts.map +1 -0
  67. package/resources/organizations.js +9 -0
  68. package/resources/organizations.js.map +1 -0
  69. package/resources/organizations.mjs +5 -0
  70. package/resources/organizations.mjs.map +1 -0
  71. package/resources/policies.d.mts +360 -231
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +360 -231
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/shared.d.mts +28 -28
  76. package/resources/shared.d.mts.map +1 -1
  77. package/resources/shared.d.ts +28 -28
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/swaps.d.mts +8 -11
  80. package/resources/swaps.d.mts.map +1 -1
  81. package/resources/swaps.d.ts +8 -11
  82. package/resources/swaps.d.ts.map +1 -1
  83. package/resources/swaps.js.map +1 -1
  84. package/resources/swaps.mjs.map +1 -1
  85. package/resources/transactions.d.mts +56 -66
  86. package/resources/transactions.d.mts.map +1 -1
  87. package/resources/transactions.d.ts +56 -66
  88. package/resources/transactions.d.ts.map +1 -1
  89. package/resources/users.d.mts +457 -448
  90. package/resources/users.d.mts.map +1 -1
  91. package/resources/users.d.ts +457 -448
  92. package/resources/users.d.ts.map +1 -1
  93. package/resources/wallet-actions.d.mts +450 -41
  94. package/resources/wallet-actions.d.mts.map +1 -1
  95. package/resources/wallet-actions.d.ts +450 -41
  96. package/resources/wallet-actions.d.ts.map +1 -1
  97. package/resources/wallets/balance.d.mts +2 -1
  98. package/resources/wallets/balance.d.mts.map +1 -1
  99. package/resources/wallets/balance.d.ts +2 -1
  100. package/resources/wallets/balance.d.ts.map +1 -1
  101. package/resources/wallets/balance.js.map +1 -1
  102. package/resources/wallets/balance.mjs.map +1 -1
  103. package/resources/wallets/index.d.mts +1 -1
  104. package/resources/wallets/index.d.mts.map +1 -1
  105. package/resources/wallets/index.d.ts +1 -1
  106. package/resources/wallets/index.d.ts.map +1 -1
  107. package/resources/wallets/index.js.map +1 -1
  108. package/resources/wallets/index.mjs.map +1 -1
  109. package/resources/wallets/transactions.d.mts +16 -31
  110. package/resources/wallets/transactions.d.mts.map +1 -1
  111. package/resources/wallets/transactions.d.ts +16 -31
  112. package/resources/wallets/transactions.d.ts.map +1 -1
  113. package/resources/wallets/transactions.js +1 -1
  114. package/resources/wallets/transactions.js.map +1 -1
  115. package/resources/wallets/transactions.mjs +1 -1
  116. package/resources/wallets/transactions.mjs.map +1 -1
  117. package/resources/wallets/wallets.d.mts +1475 -1172
  118. package/resources/wallets/wallets.d.mts.map +1 -1
  119. package/resources/wallets/wallets.d.ts +1475 -1172
  120. package/resources/wallets/wallets.d.ts.map +1 -1
  121. package/resources/wallets/wallets.js +10 -6
  122. package/resources/wallets/wallets.js.map +1 -1
  123. package/resources/wallets/wallets.mjs +10 -6
  124. package/resources/wallets/wallets.mjs.map +1 -1
  125. package/resources/webhooks.d.mts +1345 -582
  126. package/resources/webhooks.d.mts.map +1 -1
  127. package/resources/webhooks.d.ts +1345 -582
  128. package/resources/webhooks.d.ts.map +1 -1
  129. package/resources/yield.d.mts +157 -157
  130. package/resources/yield.d.mts.map +1 -1
  131. package/resources/yield.d.ts +157 -157
  132. package/resources/yield.d.ts.map +1 -1
  133. package/src/client.ts +661 -455
  134. package/src/internal/types.ts +6 -8
  135. package/src/internal/utils/env.ts +2 -2
  136. package/src/resources/accounts.ts +157 -103
  137. package/src/resources/aggregations.ts +55 -55
  138. package/src/resources/apps.ts +232 -166
  139. package/src/resources/client-auth.ts +890 -890
  140. package/src/resources/embedded-wallets.ts +123 -123
  141. package/src/resources/funding.ts +66 -66
  142. package/src/resources/index.ts +521 -431
  143. package/src/resources/intents.ts +326 -322
  144. package/src/resources/key-quorums.ts +23 -23
  145. package/src/resources/kraken-embed.ts +116 -19
  146. package/src/resources/organizations.ts +82 -0
  147. package/src/resources/policies.ts +495 -339
  148. package/src/resources/shared.ts +34 -34
  149. package/src/resources/swaps.ts +9 -14
  150. package/src/resources/transactions.ts +88 -115
  151. package/src/resources/users.ts +664 -653
  152. package/src/resources/wallet-actions.ts +585 -56
  153. package/src/resources/wallets/balance.ts +2 -1
  154. package/src/resources/wallets/index.ts +158 -138
  155. package/src/resources/wallets/transactions.ts +20 -83
  156. package/src/resources/wallets/wallets.ts +1997 -1563
  157. package/src/resources/webhooks.ts +1652 -700
  158. package/src/resources/yield.ts +188 -188
  159. package/src/version.ts +1 -1
  160. package/version.d.mts +1 -1
  161. package/version.d.mts.map +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.d.ts.map +1 -1
  164. package/version.js +1 -1
  165. package/version.js.map +1 -1
  166. package/version.mjs +1 -1
  167. package/version.mjs.map +1 -1
@@ -10,125 +10,118 @@ import * as WalletsAPI from './wallets/wallets';
10
10
  export class Intents extends APIResource {}
11
11
 
12
12
  /**
13
- * Type of intent.
14
- */
15
- export type IntentType = 'KEY_QUORUM' | 'POLICY' | 'RULE' | 'RPC' | 'TRANSFER' | 'WALLET';
16
-
17
- /**
18
- * Current status of an intent.
19
- */
20
- export type IntentStatus = 'pending' | 'executed' | 'failed' | 'expired' | 'rejected' | 'dismissed';
21
-
22
- /**
23
- * Request details for an RPC intent.
13
+ * Common fields for intent action execution results.
24
14
  */
25
- export interface RpcIntentRequestDetails {
15
+ export interface BaseActionResult {
26
16
  /**
27
- * Request body for wallet RPC operations, discriminated by method.
17
+ * Unix timestamp when the action was executed
28
18
  */
29
- body: WalletsAPI.WalletRpcRequestBody;
30
-
31
- method: 'POST';
32
-
33
- url: string;
34
- }
19
+ executed_at: number;
35
20
 
36
- /**
37
- * Request details for a transfer intent.
38
- */
39
- export interface TransferIntentRequestDetails {
40
21
  /**
41
- * Request body for initiating a sponsored token transfer from an embedded wallet.
22
+ * HTTP status code from the action execution
42
23
  */
43
- body: WalletsAPI.CreateTokenTransferRequest;
24
+ status_code: number;
44
25
 
45
- method: 'POST';
26
+ /**
27
+ * Display name of the key quorum that authorized execution
28
+ */
29
+ authorized_by_display_name?: string;
46
30
 
47
- url: string;
31
+ /**
32
+ * ID of the key quorum that authorized execution
33
+ */
34
+ authorized_by_id?: string;
48
35
  }
49
36
 
50
37
  /**
51
- * Request details for a policy intent.
38
+ * Common fields shared by all intent response types.
52
39
  */
53
- export interface PolicyIntentRequestDetails {
54
- body: PolicyIntentRequestDetails.Body;
55
-
56
- method: 'PATCH';
40
+ export interface BaseIntentResponse {
41
+ /**
42
+ * Detailed authorization information including key quorum members, thresholds, and
43
+ * signature status
44
+ */
45
+ authorization_details: Array<IntentAuthorization>;
57
46
 
58
- url: string;
59
- }
47
+ /**
48
+ * Unix timestamp when the intent was created
49
+ */
50
+ created_at: number;
60
51
 
61
- export namespace PolicyIntentRequestDetails {
62
- export interface Body {
63
- /**
64
- * Name to assign to policy.
65
- */
66
- name?: string;
52
+ /**
53
+ * Display name of the user who created the intent
54
+ */
55
+ created_by_display_name: string;
67
56
 
68
- /**
69
- * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
70
- * null to remove the current owner.
71
- */
72
- owner?: SharedAPI.OwnerInput | null;
57
+ /**
58
+ * Whether this intent has a custom expiry time set by the client. If false, the
59
+ * intent expires after a default duration.
60
+ */
61
+ custom_expiry: boolean;
73
62
 
74
- /**
75
- * The key quorum ID to set as the owner of the resource. If you provide this, do
76
- * not specify an owner.
77
- */
78
- owner_id?: SharedAPI.OwnerIDInput | null;
63
+ /**
64
+ * Unix timestamp when the intent expires
65
+ */
66
+ expires_at: number;
79
67
 
80
- rules?: Array<PoliciesAPI.PolicyRuleRequestBody>;
81
- }
82
- }
68
+ /**
69
+ * Unique ID for the intent
70
+ */
71
+ intent_id: string;
83
72
 
84
- /**
85
- * Request details for creating a rule via intent.
86
- */
87
- export interface RuleIntentCreateRequestDetails {
88
73
  /**
89
- * The rules that apply to each method the policy covers.
74
+ * ID of the resource being modified (wallet_id, policy_id, etc)
90
75
  */
91
- body: PoliciesAPI.PolicyRuleRequestBody;
76
+ resource_id: string;
92
77
 
93
- method: 'POST';
78
+ /**
79
+ * Current status of an intent.
80
+ */
81
+ status: IntentStatus;
94
82
 
95
- url: string;
96
- }
83
+ /**
84
+ * ID of the user who created the intent. If undefined, the intent was created
85
+ * using the app secret
86
+ */
87
+ created_by_id?: string;
97
88
 
98
- /**
99
- * Request details for updating a rule via intent.
100
- */
101
- export interface RuleIntentUpdateRequestDetails {
102
89
  /**
103
- * The rules that apply to each method the policy covers.
90
+ * Human-readable reason for dismissal, present when status is 'dismissed'
104
91
  */
105
- body: PoliciesAPI.PolicyRuleRequestBody;
92
+ dismissal_reason?: string;
106
93
 
107
- method: 'PATCH';
94
+ /**
95
+ * Unix timestamp when the intent was dismissed, present when status is 'dismissed'
96
+ */
97
+ dismissed_at?: number;
108
98
 
109
- url: string;
99
+ /**
100
+ * Unix timestamp when the intent was rejected, present when status is 'rejected'
101
+ */
102
+ rejected_at?: number;
110
103
  }
111
104
 
112
105
  /**
113
- * Request details for deleting a rule via intent.
106
+ * Authorization quorum for an intent
114
107
  */
115
- export interface RuleIntentDeleteRequestDetails {
116
- method: 'DELETE';
108
+ export interface IntentAuthorization {
109
+ /**
110
+ * Members in this authorization quorum
111
+ */
112
+ members: Array<IntentAuthorizationMember>;
117
113
 
118
- url: string;
114
+ /**
115
+ * Number of signatures required to satisfy this quorum
116
+ */
117
+ threshold: number;
119
118
 
120
- body?: unknown;
119
+ /**
120
+ * Display name of the key quorum
121
+ */
122
+ display_name?: string;
121
123
  }
122
124
 
123
- /**
124
- * The original rule request. Method is POST (create), PATCH (update), or DELETE
125
- * (delete)
126
- */
127
- export type RuleIntentRequestDetails =
128
- | RuleIntentCreateRequestDetails
129
- | RuleIntentUpdateRequestDetails
130
- | RuleIntentDeleteRequestDetails;
131
-
132
125
  /**
133
126
  * A leaf member (user or key) of a nested key quorum in an intent authorization.
134
127
  */
@@ -235,116 +228,188 @@ export namespace IntentAuthorizationMember {
235
228
  }
236
229
 
237
230
  /**
238
- * Authorization quorum for an intent
231
+ * Headers required to create an intent.
239
232
  */
240
- export interface IntentAuthorization {
241
- /**
242
- * Members in this authorization quorum
243
- */
244
- members: Array<IntentAuthorizationMember>;
245
-
233
+ export interface IntentCreationHeaders {
246
234
  /**
247
- * Number of signatures required to satisfy this quorum
235
+ * ID of your Privy app.
248
236
  */
249
- threshold: number;
237
+ 'privy-app-id': string;
250
238
 
251
239
  /**
252
- * Display name of the key quorum
240
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
241
+ * deadline by which the request must be processed.
253
242
  */
254
- display_name?: string;
243
+ 'privy-request-expiry'?: string;
255
244
  }
256
245
 
257
246
  /**
258
- * Common fields shared by all intent response types.
247
+ * Response for an intent object
259
248
  */
260
- export interface BaseIntentResponse {
261
- /**
262
- * Detailed authorization information including key quorum members, thresholds, and
263
- * signature status
264
- */
265
- authorization_details: Array<IntentAuthorization>;
249
+ export type IntentResponse =
250
+ | RpcIntentResponse
251
+ | TransferIntentResponse
252
+ | WalletIntentResponse
253
+ | PolicyIntentResponse
254
+ | RuleIntentResponse
255
+ | KeyQuorumIntentResponse;
266
256
 
267
- /**
268
- * Unix timestamp when the intent was created
269
- */
270
- created_at: number;
257
+ /**
258
+ * Current status of an intent.
259
+ */
260
+ export type IntentStatus = 'pending' | 'executed' | 'failed' | 'expired' | 'rejected' | 'dismissed';
271
261
 
272
- /**
273
- * Display name of the user who created the intent
274
- */
275
- created_by_display_name: string;
262
+ /**
263
+ * Type of intent.
264
+ */
265
+ export type IntentType = 'KEY_QUORUM' | 'POLICY' | 'RULE' | 'RPC' | 'TRANSFER' | 'WALLET';
276
266
 
277
- /**
278
- * Whether this intent has a custom expiry time set by the client. If false, the
279
- * intent expires after a default duration.
280
- */
281
- custom_expiry: boolean;
267
+ /**
268
+ * Response for a key quorum intent
269
+ */
270
+ export interface KeyQuorumIntentResponse extends BaseIntentResponse {
271
+ intent_type: 'KEY_QUORUM';
282
272
 
283
273
  /**
284
- * Unix timestamp when the intent expires
274
+ * The original key quorum update request that would be sent to the key quorum
275
+ * endpoint
285
276
  */
286
- expires_at: number;
277
+ request_details: KeyQuorumIntentResponse.RequestDetails;
287
278
 
288
279
  /**
289
- * Unique ID for the intent
280
+ * Result of key quorum update execution (only present if status is 'executed' or
281
+ * 'failed')
290
282
  */
291
- intent_id: string;
283
+ action_result?: BaseActionResult;
292
284
 
293
285
  /**
294
- * ID of the resource being modified (wallet_id, policy_id, etc)
286
+ * A key quorum for authorizing wallet operations.
295
287
  */
296
- resource_id: string;
288
+ current_resource_data?: KeyQuorumsAPI.KeyQuorum;
289
+ }
297
290
 
291
+ export namespace KeyQuorumIntentResponse {
298
292
  /**
299
- * Current status of an intent.
293
+ * The original key quorum update request that would be sent to the key quorum
294
+ * endpoint
300
295
  */
301
- status: IntentStatus;
296
+ export interface RequestDetails {
297
+ /**
298
+ * Request input for updating an existing key quorum.
299
+ */
300
+ body: KeyQuorumsAPI.KeyQuorumUpdateRequestBody;
302
301
 
303
- /**
304
- * ID of the user who created the intent. If undefined, the intent was created
305
- * using the app secret
306
- */
307
- created_by_id?: string;
302
+ method: 'PATCH';
308
303
 
309
- /**
310
- * Human-readable reason for dismissal, present when status is 'dismissed'
311
- */
312
- dismissal_reason?: string;
304
+ url: string;
305
+ }
306
+ }
313
307
 
314
- /**
315
- * Unix timestamp when the intent was dismissed, present when status is 'dismissed'
316
- */
317
- dismissed_at?: number;
308
+ /**
309
+ * Request details for a policy intent.
310
+ */
311
+ export interface PolicyIntentRequestDetails {
312
+ body: PolicyIntentRequestDetails.Body;
318
313
 
319
- /**
320
- * Unix timestamp when the intent was rejected, present when status is 'rejected'
321
- */
322
- rejected_at?: number;
314
+ method: 'PATCH';
315
+
316
+ url: string;
317
+ }
318
+
319
+ export namespace PolicyIntentRequestDetails {
320
+ export interface Body {
321
+ /**
322
+ * Name to assign to policy.
323
+ */
324
+ name?: string;
325
+
326
+ /**
327
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
328
+ * null to remove the current owner.
329
+ */
330
+ owner?: SharedAPI.OwnerInput | null;
331
+
332
+ /**
333
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
334
+ * not specify an owner.
335
+ */
336
+ owner_id?: SharedAPI.OwnerIDInput | null;
337
+
338
+ rules?: Array<PoliciesAPI.PolicyRuleRequestBody>;
339
+ }
323
340
  }
324
341
 
325
342
  /**
326
- * Common fields for intent action execution results.
343
+ * Response for a policy intent
327
344
  */
328
- export interface BaseActionResult {
345
+ export interface PolicyIntentResponse extends BaseIntentResponse {
346
+ intent_type: 'POLICY';
347
+
329
348
  /**
330
- * Unix timestamp when the action was executed
349
+ * The original policy update request that would be sent to the policy endpoint
331
350
  */
332
- executed_at: number;
351
+ request_details: PolicyIntentResponse.RequestDetails;
333
352
 
334
353
  /**
335
- * HTTP status code from the action execution
354
+ * Result of policy update execution (only present if status is 'executed' or
355
+ * 'failed')
336
356
  */
337
- status_code: number;
357
+ action_result?: BaseActionResult;
338
358
 
339
359
  /**
340
- * Display name of the key quorum that authorized execution
360
+ * A policy for controlling wallet operations.
341
361
  */
342
- authorized_by_display_name?: string;
362
+ current_resource_data?: PoliciesAPI.Policy;
363
+ }
343
364
 
365
+ export namespace PolicyIntentResponse {
344
366
  /**
345
- * ID of the key quorum that authorized execution
367
+ * The original policy update request that would be sent to the policy endpoint
346
368
  */
347
- authorized_by_id?: string;
369
+ export interface RequestDetails {
370
+ body: RequestDetails.Body;
371
+
372
+ method: 'PATCH';
373
+
374
+ url: string;
375
+ }
376
+
377
+ export namespace RequestDetails {
378
+ export interface Body {
379
+ /**
380
+ * Name to assign to policy.
381
+ */
382
+ name?: string;
383
+
384
+ /**
385
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
386
+ * null to remove the current owner.
387
+ */
388
+ owner?: SharedAPI.OwnerInput | null;
389
+
390
+ /**
391
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
392
+ * not specify an owner.
393
+ */
394
+ owner_id?: SharedAPI.OwnerIDInput | null;
395
+
396
+ rules?: Array<PoliciesAPI.PolicyRuleRequestBody>;
397
+ }
398
+ }
399
+ }
400
+
401
+ /**
402
+ * Request details for an RPC intent.
403
+ */
404
+ export interface RpcIntentRequestDetails {
405
+ /**
406
+ * Request body for wallet RPC operations, discriminated by method.
407
+ */
408
+ body: WalletsAPI.WalletRpcRequestBody;
409
+
410
+ method: 'POST';
411
+
412
+ url: string;
348
413
  }
349
414
 
350
415
  /**
@@ -385,6 +450,101 @@ export namespace RpcIntentResponse {
385
450
  }
386
451
  }
387
452
 
453
+ /**
454
+ * Request details for creating a rule via intent.
455
+ */
456
+ export interface RuleIntentCreateRequestDetails {
457
+ /**
458
+ * The rules that apply to each method the policy covers.
459
+ */
460
+ body: PoliciesAPI.PolicyRuleRequestBody;
461
+
462
+ method: 'POST';
463
+
464
+ url: string;
465
+ }
466
+
467
+ /**
468
+ * Request details for deleting a rule via intent.
469
+ */
470
+ export interface RuleIntentDeleteRequestDetails {
471
+ method: 'DELETE';
472
+
473
+ url: string;
474
+
475
+ body?: RuleIntentDeleteRequestDetails.Body;
476
+ }
477
+
478
+ export namespace RuleIntentDeleteRequestDetails {
479
+ export interface Body {}
480
+ }
481
+
482
+ /**
483
+ * The original rule request. Method is POST (create), PATCH (update), or DELETE
484
+ * (delete)
485
+ */
486
+ export type RuleIntentRequestDetails =
487
+ | RuleIntentCreateRequestDetails
488
+ | RuleIntentUpdateRequestDetails
489
+ | RuleIntentDeleteRequestDetails;
490
+
491
+ /**
492
+ * Response for a rule intent
493
+ */
494
+ export interface RuleIntentResponse extends BaseIntentResponse {
495
+ intent_type: 'RULE';
496
+
497
+ /**
498
+ * The original rule request. Method is POST (create), PATCH (update), or DELETE
499
+ * (delete)
500
+ */
501
+ request_details: RuleIntentRequestDetails;
502
+
503
+ /**
504
+ * Result of rule execution (only present if status is 'executed' or 'failed')
505
+ */
506
+ action_result?: BaseActionResult;
507
+
508
+ /**
509
+ * A rule that defines the conditions and action to take if the conditions are
510
+ * true.
511
+ */
512
+ current_resource_data?: PoliciesAPI.PolicyRuleResponse;
513
+
514
+ /**
515
+ * A policy for controlling wallet operations.
516
+ */
517
+ policy?: PoliciesAPI.Policy;
518
+ }
519
+
520
+ /**
521
+ * Request details for updating a rule via intent.
522
+ */
523
+ export interface RuleIntentUpdateRequestDetails {
524
+ /**
525
+ * The rules that apply to each method the policy covers.
526
+ */
527
+ body: PoliciesAPI.PolicyRuleRequestBody;
528
+
529
+ method: 'PATCH';
530
+
531
+ url: string;
532
+ }
533
+
534
+ /**
535
+ * Request details for a transfer intent.
536
+ */
537
+ export interface TransferIntentRequestDetails {
538
+ /**
539
+ * Request body for initiating a sponsored token transfer from an embedded wallet.
540
+ */
541
+ body: WalletsAPI.TransferRequestBody;
542
+
543
+ method: 'POST';
544
+
545
+ url: string;
546
+ }
547
+
388
548
  /**
389
549
  * Response for a transfer intent
390
550
  */
@@ -416,7 +576,7 @@ export namespace TransferIntentResponse {
416
576
  /**
417
577
  * Request body for initiating a sponsored token transfer from an embedded wallet.
418
578
  */
419
- body: WalletsAPI.CreateTokenTransferRequest;
579
+ body: WalletsAPI.TransferRequestBody;
420
580
 
421
581
  method: 'POST';
422
582
 
@@ -492,185 +652,29 @@ export namespace WalletIntentResponse {
492
652
  }
493
653
  }
494
654
 
495
- /**
496
- * Response for a policy intent
497
- */
498
- export interface PolicyIntentResponse extends BaseIntentResponse {
499
- intent_type: 'POLICY';
500
-
501
- /**
502
- * The original policy update request that would be sent to the policy endpoint
503
- */
504
- request_details: PolicyIntentResponse.RequestDetails;
505
-
506
- /**
507
- * Result of policy update execution (only present if status is 'executed' or
508
- * 'failed')
509
- */
510
- action_result?: BaseActionResult;
511
-
512
- /**
513
- * A policy for controlling wallet operations.
514
- */
515
- current_resource_data?: PoliciesAPI.Policy;
516
- }
517
-
518
- export namespace PolicyIntentResponse {
519
- /**
520
- * The original policy update request that would be sent to the policy endpoint
521
- */
522
- export interface RequestDetails {
523
- body: RequestDetails.Body;
524
-
525
- method: 'PATCH';
526
-
527
- url: string;
528
- }
529
-
530
- export namespace RequestDetails {
531
- export interface Body {
532
- /**
533
- * Name to assign to policy.
534
- */
535
- name?: string;
536
-
537
- /**
538
- * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
539
- * null to remove the current owner.
540
- */
541
- owner?: SharedAPI.OwnerInput | null;
542
-
543
- /**
544
- * The key quorum ID to set as the owner of the resource. If you provide this, do
545
- * not specify an owner.
546
- */
547
- owner_id?: SharedAPI.OwnerIDInput | null;
548
-
549
- rules?: Array<PoliciesAPI.PolicyRuleRequestBody>;
550
- }
551
- }
552
- }
553
-
554
- /**
555
- * Response for a key quorum intent
556
- */
557
- export interface KeyQuorumIntentResponse extends BaseIntentResponse {
558
- intent_type: 'KEY_QUORUM';
559
-
560
- /**
561
- * The original key quorum update request that would be sent to the key quorum
562
- * endpoint
563
- */
564
- request_details: KeyQuorumIntentResponse.RequestDetails;
565
-
566
- /**
567
- * Result of key quorum update execution (only present if status is 'executed' or
568
- * 'failed')
569
- */
570
- action_result?: BaseActionResult;
571
-
572
- /**
573
- * A key quorum for authorizing wallet operations.
574
- */
575
- current_resource_data?: KeyQuorumsAPI.KeyQuorum;
576
- }
577
-
578
- export namespace KeyQuorumIntentResponse {
579
- /**
580
- * The original key quorum update request that would be sent to the key quorum
581
- * endpoint
582
- */
583
- export interface RequestDetails {
584
- /**
585
- * Request input for updating an existing key quorum.
586
- */
587
- body: KeyQuorumsAPI.KeyQuorumUpdateRequestBody;
588
-
589
- method: 'PATCH';
590
-
591
- url: string;
592
- }
593
- }
594
-
595
- /**
596
- * Response for a rule intent
597
- */
598
- export interface RuleIntentResponse extends BaseIntentResponse {
599
- intent_type: 'RULE';
600
-
601
- /**
602
- * The original rule request. Method is POST (create), PATCH (update), or DELETE
603
- * (delete)
604
- */
605
- request_details: RuleIntentRequestDetails;
606
-
607
- /**
608
- * Result of rule execution (only present if status is 'executed' or 'failed')
609
- */
610
- action_result?: BaseActionResult;
611
-
612
- /**
613
- * A rule that defines the conditions and action to take if the conditions are
614
- * true.
615
- */
616
- current_resource_data?: PoliciesAPI.PolicyRuleResponse;
617
-
618
- /**
619
- * A policy for controlling wallet operations.
620
- */
621
- policy?: PoliciesAPI.Policy;
622
- }
623
-
624
- /**
625
- * Response for an intent object
626
- */
627
- export type IntentResponse =
628
- | RpcIntentResponse
629
- | TransferIntentResponse
630
- | WalletIntentResponse
631
- | PolicyIntentResponse
632
- | RuleIntentResponse
633
- | KeyQuorumIntentResponse;
634
-
635
- /**
636
- * Headers required to create an intent.
637
- */
638
- export interface IntentCreationHeaders {
639
- /**
640
- * ID of your Privy app.
641
- */
642
- 'privy-app-id': string;
643
-
644
- /**
645
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
646
- * deadline by which the request must be processed.
647
- */
648
- 'privy-request-expiry'?: string;
649
- }
650
-
651
655
  export declare namespace Intents {
652
656
  export {
653
- type IntentType as IntentType,
657
+ type BaseActionResult as BaseActionResult,
658
+ type BaseIntentResponse as BaseIntentResponse,
659
+ type IntentAuthorization as IntentAuthorization,
660
+ type IntentAuthorizationKeyQuorumMember as IntentAuthorizationKeyQuorumMember,
661
+ type IntentAuthorizationMember as IntentAuthorizationMember,
662
+ type IntentCreationHeaders as IntentCreationHeaders,
663
+ type IntentResponse as IntentResponse,
654
664
  type IntentStatus as IntentStatus,
655
- type RpcIntentRequestDetails as RpcIntentRequestDetails,
656
- type TransferIntentRequestDetails as TransferIntentRequestDetails,
665
+ type IntentType as IntentType,
666
+ type KeyQuorumIntentResponse as KeyQuorumIntentResponse,
657
667
  type PolicyIntentRequestDetails as PolicyIntentRequestDetails,
668
+ type PolicyIntentResponse as PolicyIntentResponse,
669
+ type RpcIntentRequestDetails as RpcIntentRequestDetails,
670
+ type RpcIntentResponse as RpcIntentResponse,
658
671
  type RuleIntentCreateRequestDetails as RuleIntentCreateRequestDetails,
659
- type RuleIntentUpdateRequestDetails as RuleIntentUpdateRequestDetails,
660
672
  type RuleIntentDeleteRequestDetails as RuleIntentDeleteRequestDetails,
661
673
  type RuleIntentRequestDetails as RuleIntentRequestDetails,
662
- type IntentAuthorizationKeyQuorumMember as IntentAuthorizationKeyQuorumMember,
663
- type IntentAuthorizationMember as IntentAuthorizationMember,
664
- type IntentAuthorization as IntentAuthorization,
665
- type BaseIntentResponse as BaseIntentResponse,
666
- type BaseActionResult as BaseActionResult,
667
- type RpcIntentResponse as RpcIntentResponse,
674
+ type RuleIntentResponse as RuleIntentResponse,
675
+ type RuleIntentUpdateRequestDetails as RuleIntentUpdateRequestDetails,
676
+ type TransferIntentRequestDetails as TransferIntentRequestDetails,
668
677
  type TransferIntentResponse as TransferIntentResponse,
669
678
  type WalletIntentResponse as WalletIntentResponse,
670
- type PolicyIntentResponse as PolicyIntentResponse,
671
- type KeyQuorumIntentResponse as KeyQuorumIntentResponse,
672
- type RuleIntentResponse as RuleIntentResponse,
673
- type IntentResponse as IntentResponse,
674
- type IntentCreationHeaders as IntentCreationHeaders,
675
679
  };
676
680
  }