@privy-io/api-types 0.9.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.
- package/CHANGELOG.md +38 -0
- package/client.d.mts +33 -30
- package/client.d.mts.map +1 -1
- package/client.d.ts +33 -30
- package/client.d.ts.map +1 -1
- package/client.js +22 -8
- package/client.js.map +1 -1
- package/client.mjs +23 -9
- package/client.mjs.map +1 -1
- package/internal/types.d.mts +6 -6
- package/internal/types.d.mts.map +1 -1
- package/internal/types.d.ts +6 -6
- package/internal/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/resources/accounts.d.mts +128 -86
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +128 -86
- package/resources/accounts.d.ts.map +1 -1
- package/resources/aggregations.d.mts +43 -43
- package/resources/aggregations.d.mts.map +1 -1
- package/resources/aggregations.d.ts +43 -43
- package/resources/aggregations.d.ts.map +1 -1
- package/resources/apps.d.mts +169 -135
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +169 -135
- package/resources/apps.d.ts.map +1 -1
- package/resources/client-auth.d.mts +646 -644
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +646 -644
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/embedded-wallets.d.mts +114 -114
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +114 -114
- package/resources/embedded-wallets.d.ts.map +1 -1
- package/resources/funding.d.mts +42 -42
- package/resources/funding.d.mts.map +1 -1
- package/resources/funding.d.ts +42 -42
- package/resources/funding.d.ts.map +1 -1
- package/resources/index.d.mts +19 -18
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +19 -18
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/intents.d.mts +269 -265
- package/resources/intents.d.mts.map +1 -1
- package/resources/intents.d.ts +269 -265
- package/resources/intents.d.ts.map +1 -1
- package/resources/key-quorums.d.mts +20 -20
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +20 -20
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/kraken-embed.d.mts +12 -20
- package/resources/kraken-embed.d.mts.map +1 -1
- package/resources/kraken-embed.d.ts +12 -20
- package/resources/kraken-embed.d.ts.map +1 -1
- package/resources/organizations.d.mts +65 -0
- package/resources/organizations.d.mts.map +1 -0
- package/resources/organizations.d.ts +65 -0
- package/resources/organizations.d.ts.map +1 -0
- package/resources/organizations.js +9 -0
- package/resources/organizations.js.map +1 -0
- package/resources/organizations.mjs +5 -0
- package/resources/organizations.mjs.map +1 -0
- package/resources/policies.d.mts +258 -240
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +258 -240
- package/resources/policies.d.ts.map +1 -1
- package/resources/shared.d.mts +28 -28
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +28 -28
- package/resources/shared.d.ts.map +1 -1
- package/resources/swaps.d.mts +6 -9
- package/resources/swaps.d.mts.map +1 -1
- package/resources/swaps.d.ts +6 -9
- package/resources/swaps.d.ts.map +1 -1
- package/resources/swaps.js.map +1 -1
- package/resources/swaps.mjs.map +1 -1
- package/resources/transactions.d.mts +53 -53
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +53 -53
- package/resources/transactions.d.ts.map +1 -1
- package/resources/users.d.mts +468 -459
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +468 -459
- package/resources/users.d.ts.map +1 -1
- package/resources/wallet-actions.d.mts +302 -145
- package/resources/wallet-actions.d.mts.map +1 -1
- package/resources/wallet-actions.d.ts +302 -145
- package/resources/wallet-actions.d.ts.map +1 -1
- package/resources/wallets/index.d.mts +1 -1
- package/resources/wallets/index.d.mts.map +1 -1
- package/resources/wallets/index.d.ts +1 -1
- package/resources/wallets/index.d.ts.map +1 -1
- package/resources/wallets/index.js.map +1 -1
- package/resources/wallets/index.mjs.map +1 -1
- package/resources/wallets/transactions.d.mts +7 -2
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +7 -2
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/transactions.js +1 -1
- package/resources/wallets/transactions.mjs +1 -1
- package/resources/wallets/wallets.d.mts +1424 -1227
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +1424 -1227
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +4 -1
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +4 -1
- package/resources/wallets/wallets.mjs.map +1 -1
- package/resources/webhooks.d.mts +935 -877
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +935 -877
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/yield.d.mts +157 -157
- package/resources/yield.d.mts.map +1 -1
- package/resources/yield.d.ts +157 -157
- package/resources/yield.d.ts.map +1 -1
- package/src/client.ts +594 -516
- package/src/internal/types.ts +6 -8
- package/src/resources/accounts.ts +157 -103
- package/src/resources/aggregations.ts +55 -55
- package/src/resources/apps.ts +221 -178
- package/src/resources/client-auth.ts +887 -887
- package/src/resources/embedded-wallets.ts +150 -150
- package/src/resources/funding.ts +66 -66
- package/src/resources/index.ts +504 -475
- package/src/resources/intents.ts +326 -322
- package/src/resources/key-quorums.ts +23 -23
- package/src/resources/kraken-embed.ts +14 -22
- package/src/resources/organizations.ts +82 -0
- package/src/resources/policies.ts +379 -352
- package/src/resources/shared.ts +34 -34
- package/src/resources/swaps.ts +5 -10
- package/src/resources/transactions.ts +86 -86
- package/src/resources/users.ts +707 -696
- package/src/resources/wallet-actions.ts +392 -185
- package/src/resources/wallets/index.ts +157 -148
- package/src/resources/wallets/transactions.ts +18 -3
- package/src/resources/wallets/wallets.ts +1937 -1686
- package/src/resources/webhooks.ts +1172 -1100
- package/src/resources/yield.ts +188 -188
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
package/src/resources/intents.ts
CHANGED
|
@@ -10,125 +10,118 @@ import * as WalletsAPI from './wallets/wallets';
|
|
|
10
10
|
export class Intents extends APIResource {}
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
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
|
|
15
|
+
export interface BaseActionResult {
|
|
26
16
|
/**
|
|
27
|
-
*
|
|
17
|
+
* Unix timestamp when the action was executed
|
|
28
18
|
*/
|
|
29
|
-
|
|
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
|
-
*
|
|
22
|
+
* HTTP status code from the action execution
|
|
42
23
|
*/
|
|
43
|
-
|
|
24
|
+
status_code: number;
|
|
44
25
|
|
|
45
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Display name of the key quorum that authorized execution
|
|
28
|
+
*/
|
|
29
|
+
authorized_by_display_name?: string;
|
|
46
30
|
|
|
47
|
-
|
|
31
|
+
/**
|
|
32
|
+
* ID of the key quorum that authorized execution
|
|
33
|
+
*/
|
|
34
|
+
authorized_by_id?: string;
|
|
48
35
|
}
|
|
49
36
|
|
|
50
37
|
/**
|
|
51
|
-
*
|
|
38
|
+
* Common fields shared by all intent response types.
|
|
52
39
|
*/
|
|
53
|
-
export interface
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
59
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Unix timestamp when the intent was created
|
|
49
|
+
*/
|
|
50
|
+
created_at: number;
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
63
|
+
/**
|
|
64
|
+
* Unix timestamp when the intent expires
|
|
65
|
+
*/
|
|
66
|
+
expires_at: number;
|
|
79
67
|
|
|
80
|
-
|
|
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
|
-
*
|
|
74
|
+
* ID of the resource being modified (wallet_id, policy_id, etc)
|
|
90
75
|
*/
|
|
91
|
-
|
|
76
|
+
resource_id: string;
|
|
92
77
|
|
|
93
|
-
|
|
78
|
+
/**
|
|
79
|
+
* Current status of an intent.
|
|
80
|
+
*/
|
|
81
|
+
status: IntentStatus;
|
|
94
82
|
|
|
95
|
-
|
|
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
|
-
*
|
|
90
|
+
* Human-readable reason for dismissal, present when status is 'dismissed'
|
|
104
91
|
*/
|
|
105
|
-
|
|
92
|
+
dismissal_reason?: string;
|
|
106
93
|
|
|
107
|
-
|
|
94
|
+
/**
|
|
95
|
+
* Unix timestamp when the intent was dismissed, present when status is 'dismissed'
|
|
96
|
+
*/
|
|
97
|
+
dismissed_at?: number;
|
|
108
98
|
|
|
109
|
-
|
|
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
|
-
*
|
|
106
|
+
* Authorization quorum for an intent
|
|
114
107
|
*/
|
|
115
|
-
export interface
|
|
116
|
-
|
|
108
|
+
export interface IntentAuthorization {
|
|
109
|
+
/**
|
|
110
|
+
* Members in this authorization quorum
|
|
111
|
+
*/
|
|
112
|
+
members: Array<IntentAuthorizationMember>;
|
|
117
113
|
|
|
118
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Number of signatures required to satisfy this quorum
|
|
116
|
+
*/
|
|
117
|
+
threshold: number;
|
|
119
118
|
|
|
120
|
-
|
|
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
|
-
*
|
|
231
|
+
* Headers required to create an intent.
|
|
239
232
|
*/
|
|
240
|
-
export interface
|
|
241
|
-
/**
|
|
242
|
-
* Members in this authorization quorum
|
|
243
|
-
*/
|
|
244
|
-
members: Array<IntentAuthorizationMember>;
|
|
245
|
-
|
|
233
|
+
export interface IntentCreationHeaders {
|
|
246
234
|
/**
|
|
247
|
-
*
|
|
235
|
+
* ID of your Privy app.
|
|
248
236
|
*/
|
|
249
|
-
|
|
237
|
+
'privy-app-id': string;
|
|
250
238
|
|
|
251
239
|
/**
|
|
252
|
-
*
|
|
240
|
+
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
241
|
+
* deadline by which the request must be processed.
|
|
253
242
|
*/
|
|
254
|
-
|
|
243
|
+
'privy-request-expiry'?: string;
|
|
255
244
|
}
|
|
256
245
|
|
|
257
246
|
/**
|
|
258
|
-
*
|
|
247
|
+
* Response for an intent object
|
|
259
248
|
*/
|
|
260
|
-
export
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Unix timestamp when the intent was created
|
|
269
|
-
*/
|
|
270
|
-
created_at: number;
|
|
249
|
+
export type IntentResponse =
|
|
250
|
+
| RpcIntentResponse
|
|
251
|
+
| TransferIntentResponse
|
|
252
|
+
| WalletIntentResponse
|
|
253
|
+
| PolicyIntentResponse
|
|
254
|
+
| RuleIntentResponse
|
|
255
|
+
| KeyQuorumIntentResponse;
|
|
271
256
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
257
|
+
/**
|
|
258
|
+
* Current status of an intent.
|
|
259
|
+
*/
|
|
260
|
+
export type IntentStatus = 'pending' | 'executed' | 'failed' | 'expired' | 'rejected' | 'dismissed';
|
|
276
261
|
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
custom_expiry: boolean;
|
|
262
|
+
/**
|
|
263
|
+
* Type of intent.
|
|
264
|
+
*/
|
|
265
|
+
export type IntentType = 'KEY_QUORUM' | 'POLICY' | 'RULE' | 'RPC' | 'TRANSFER' | 'WALLET';
|
|
282
266
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
267
|
+
/**
|
|
268
|
+
* Response for a key quorum intent
|
|
269
|
+
*/
|
|
270
|
+
export interface KeyQuorumIntentResponse extends BaseIntentResponse {
|
|
271
|
+
intent_type: 'KEY_QUORUM';
|
|
287
272
|
|
|
288
273
|
/**
|
|
289
|
-
*
|
|
274
|
+
* The original key quorum update request that would be sent to the key quorum
|
|
275
|
+
* endpoint
|
|
290
276
|
*/
|
|
291
|
-
|
|
277
|
+
request_details: KeyQuorumIntentResponse.RequestDetails;
|
|
292
278
|
|
|
293
279
|
/**
|
|
294
|
-
*
|
|
280
|
+
* Result of key quorum update execution (only present if status is 'executed' or
|
|
281
|
+
* 'failed')
|
|
295
282
|
*/
|
|
296
|
-
|
|
283
|
+
action_result?: BaseActionResult;
|
|
297
284
|
|
|
298
285
|
/**
|
|
299
|
-
*
|
|
286
|
+
* A key quorum for authorizing wallet operations.
|
|
300
287
|
*/
|
|
301
|
-
|
|
288
|
+
current_resource_data?: KeyQuorumsAPI.KeyQuorum;
|
|
289
|
+
}
|
|
302
290
|
|
|
291
|
+
export namespace KeyQuorumIntentResponse {
|
|
303
292
|
/**
|
|
304
|
-
*
|
|
305
|
-
*
|
|
293
|
+
* The original key quorum update request that would be sent to the key quorum
|
|
294
|
+
* endpoint
|
|
306
295
|
*/
|
|
307
|
-
|
|
296
|
+
export interface RequestDetails {
|
|
297
|
+
/**
|
|
298
|
+
* Request input for updating an existing key quorum.
|
|
299
|
+
*/
|
|
300
|
+
body: KeyQuorumsAPI.KeyQuorumUpdateRequestBody;
|
|
308
301
|
|
|
309
|
-
|
|
310
|
-
* Human-readable reason for dismissal, present when status is 'dismissed'
|
|
311
|
-
*/
|
|
312
|
-
dismissal_reason?: string;
|
|
302
|
+
method: 'PATCH';
|
|
313
303
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
dismissed_at?: number;
|
|
304
|
+
url: string;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
318
307
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
308
|
+
/**
|
|
309
|
+
* Request details for a policy intent.
|
|
310
|
+
*/
|
|
311
|
+
export interface PolicyIntentRequestDetails {
|
|
312
|
+
body: PolicyIntentRequestDetails.Body;
|
|
313
|
+
|
|
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
|
-
*
|
|
343
|
+
* Response for a policy intent
|
|
327
344
|
*/
|
|
328
|
-
export interface
|
|
345
|
+
export interface PolicyIntentResponse extends BaseIntentResponse {
|
|
346
|
+
intent_type: 'POLICY';
|
|
347
|
+
|
|
329
348
|
/**
|
|
330
|
-
*
|
|
349
|
+
* The original policy update request that would be sent to the policy endpoint
|
|
331
350
|
*/
|
|
332
|
-
|
|
351
|
+
request_details: PolicyIntentResponse.RequestDetails;
|
|
333
352
|
|
|
334
353
|
/**
|
|
335
|
-
*
|
|
354
|
+
* Result of policy update execution (only present if status is 'executed' or
|
|
355
|
+
* 'failed')
|
|
336
356
|
*/
|
|
337
|
-
|
|
357
|
+
action_result?: BaseActionResult;
|
|
338
358
|
|
|
339
359
|
/**
|
|
340
|
-
*
|
|
360
|
+
* A policy for controlling wallet operations.
|
|
341
361
|
*/
|
|
342
|
-
|
|
362
|
+
current_resource_data?: PoliciesAPI.Policy;
|
|
363
|
+
}
|
|
343
364
|
|
|
365
|
+
export namespace PolicyIntentResponse {
|
|
344
366
|
/**
|
|
345
|
-
*
|
|
367
|
+
* The original policy update request that would be sent to the policy endpoint
|
|
346
368
|
*/
|
|
347
|
-
|
|
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
|
*/
|
|
@@ -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
|
|
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
|
|
656
|
-
type
|
|
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
|
|
663
|
-
type
|
|
664
|
-
type
|
|
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
|
}
|