@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.
- package/CHANGELOG.md +72 -0
- package/client.d.mts +53 -29
- package/client.d.mts.map +1 -1
- package/client.d.ts +53 -29
- package/client.d.ts.map +1 -1
- package/client.js +32 -7
- package/client.js.map +1 -1
- package/client.mjs +34 -9
- package/client.mjs.map +1 -1
- package/package.json +12 -1
- package/resources/accounts.d.mts +146 -4
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +146 -4
- package/resources/accounts.d.ts.map +1 -1
- package/resources/accounts.js.map +1 -1
- package/resources/accounts.mjs.map +1 -1
- package/resources/aggregations.d.mts +18 -392
- package/resources/aggregations.d.mts.map +1 -1
- package/resources/aggregations.d.ts +18 -392
- package/resources/aggregations.d.ts.map +1 -1
- package/resources/aggregations.js.map +1 -1
- package/resources/aggregations.mjs.map +1 -1
- package/resources/apps.d.mts +197 -70
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +197 -70
- package/resources/apps.d.ts.map +1 -1
- package/resources/apps.js.map +1 -1
- package/resources/apps.mjs.map +1 -1
- package/resources/client-auth.d.mts +975 -463
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +975 -463
- package/resources/client-auth.d.ts.map +1 -1
- package/resources/client-auth.js.map +1 -1
- package/resources/client-auth.mjs.map +1 -1
- package/resources/cross-app.d.mts +14 -13
- package/resources/cross-app.d.mts.map +1 -1
- package/resources/cross-app.d.ts +14 -13
- package/resources/cross-app.d.ts.map +1 -1
- package/resources/embedded-wallets.d.mts +165 -81
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +165 -81
- package/resources/embedded-wallets.d.ts.map +1 -1
- package/resources/embedded-wallets.js.map +1 -1
- package/resources/embedded-wallets.mjs.map +1 -1
- package/resources/funding.d.mts +150 -64
- package/resources/funding.d.mts.map +1 -1
- package/resources/funding.d.ts +150 -64
- package/resources/funding.d.ts.map +1 -1
- package/resources/funding.js.map +1 -1
- package/resources/funding.mjs.map +1 -1
- package/resources/index.d.mts +18 -14
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +18 -14
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +9 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +6 -2
- package/resources/index.mjs.map +1 -1
- package/resources/intents.d.mts +446 -31
- package/resources/intents.d.mts.map +1 -1
- package/resources/intents.d.ts +446 -31
- package/resources/intents.d.ts.map +1 -1
- package/resources/intents.js.map +1 -1
- package/resources/intents.mjs.map +1 -1
- package/resources/key-quorums.d.mts +108 -17
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +108 -17
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/key-quorums.js +26 -9
- package/resources/key-quorums.js.map +1 -1
- package/resources/key-quorums.mjs +26 -9
- package/resources/key-quorums.mjs.map +1 -1
- package/resources/kraken-embed.d.mts +62 -0
- package/resources/kraken-embed.d.mts.map +1 -0
- package/resources/kraken-embed.d.ts +62 -0
- package/resources/kraken-embed.d.ts.map +1 -0
- package/resources/kraken-embed.js +9 -0
- package/resources/kraken-embed.js.map +1 -0
- package/resources/kraken-embed.mjs +5 -0
- package/resources/kraken-embed.mjs.map +1 -0
- package/resources/policies.d.mts +342 -926
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +342 -926
- package/resources/policies.d.ts.map +1 -1
- package/resources/policies.js +51 -41
- package/resources/policies.js.map +1 -1
- package/resources/policies.mjs +51 -41
- package/resources/policies.mjs.map +1 -1
- package/resources/shared.d.mts +59 -0
- package/resources/shared.d.mts.map +1 -0
- package/resources/shared.d.ts +59 -0
- package/resources/shared.d.ts.map +1 -0
- package/resources/shared.js +9 -0
- package/resources/shared.js.map +1 -0
- package/resources/shared.mjs +5 -0
- package/resources/shared.mjs.map +1 -0
- package/resources/swaps.d.mts +108 -0
- package/resources/swaps.d.mts.map +1 -0
- package/resources/swaps.d.ts +108 -0
- package/resources/swaps.d.ts.map +1 -0
- package/resources/swaps.js +9 -0
- package/resources/swaps.js.map +1 -0
- package/resources/swaps.mjs +5 -0
- package/resources/swaps.mjs.map +1 -0
- package/resources/transactions.d.mts +158 -93
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +158 -93
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +3 -0
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +3 -0
- package/resources/transactions.mjs.map +1 -1
- package/resources/users.d.mts +64 -94
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +64 -94
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js +3 -0
- package/resources/users.js.map +1 -1
- package/resources/users.mjs +3 -0
- package/resources/users.mjs.map +1 -1
- package/resources/wallet-actions.d.mts +187 -0
- package/resources/wallet-actions.d.mts.map +1 -0
- package/resources/wallet-actions.d.ts +187 -0
- package/resources/wallet-actions.d.ts.map +1 -0
- package/resources/wallet-actions.js +9 -0
- package/resources/wallet-actions.js.map +1 -0
- package/resources/wallet-actions.mjs +5 -0
- package/resources/wallet-actions.mjs.map +1 -0
- package/resources/wallets/balance.d.mts +7 -4
- package/resources/wallets/balance.d.mts.map +1 -1
- package/resources/wallets/balance.d.ts +7 -4
- package/resources/wallets/balance.d.ts.map +1 -1
- package/resources/wallets/balance.js +3 -0
- package/resources/wallets/balance.js.map +1 -1
- package/resources/wallets/balance.mjs +3 -0
- package/resources/wallets/balance.mjs.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 +10 -6
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +10 -6
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/transactions.js +3 -0
- package/resources/wallets/transactions.js.map +1 -1
- package/resources/wallets/transactions.mjs +3 -0
- package/resources/wallets/transactions.mjs.map +1 -1
- package/resources/wallets/wallets.d.mts +2399 -936
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +2399 -936
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +28 -10
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +28 -10
- package/resources/wallets/wallets.mjs.map +1 -1
- package/resources/webhooks.d.mts +780 -339
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +780 -339
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/yield.d.mts +50 -9
- package/resources/yield.d.mts.map +1 -1
- package/resources/yield.d.ts +50 -9
- package/resources/yield.d.ts.map +1 -1
- package/src/client.ts +884 -99
- package/src/resources/accounts.ts +179 -3
- package/src/resources/aggregations.ts +18 -702
- package/src/resources/apps.ts +250 -85
- package/src/resources/client-auth.ts +1453 -786
- package/src/resources/cross-app.ts +19 -15
- package/src/resources/embedded-wallets.ts +219 -123
- package/src/resources/funding.ts +263 -173
- package/src/resources/index.ts +444 -61
- package/src/resources/intents.ts +575 -37
- package/src/resources/key-quorums.ts +137 -21
- package/src/resources/kraken-embed.ts +85 -0
- package/src/resources/policies.ts +582 -1550
- package/src/resources/shared.ts +79 -0
- package/src/resources/swaps.ts +136 -0
- package/src/resources/transactions.ts +188 -91
- package/src/resources/users.ts +82 -132
- package/src/resources/wallet-actions.ts +251 -0
- package/src/resources/wallets/balance.ts +9 -2
- package/src/resources/wallets/index.ts +146 -16
- package/src/resources/wallets/transactions.ts +12 -4
- package/src/resources/wallets/wallets.ts +2922 -974
- package/src/resources/webhooks.ts +970 -454
- package/src/resources/yield.ts +68 -10
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/intents.ts
CHANGED
|
@@ -2,9 +2,133 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as IntentsAPI from './intents';
|
|
5
|
+
import * as KeyQuorumsAPI from './key-quorums';
|
|
6
|
+
import * as PoliciesAPI from './policies';
|
|
7
|
+
import * as SharedAPI from './shared';
|
|
8
|
+
import * as WalletsAPI from './wallets/wallets';
|
|
5
9
|
|
|
6
10
|
export class Intents extends APIResource {}
|
|
7
11
|
|
|
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.
|
|
24
|
+
*/
|
|
25
|
+
export interface RpcIntentRequestDetails {
|
|
26
|
+
/**
|
|
27
|
+
* Request body for wallet RPC operations, discriminated by method.
|
|
28
|
+
*/
|
|
29
|
+
body: WalletsAPI.WalletRpcRequestBody;
|
|
30
|
+
|
|
31
|
+
method: 'POST';
|
|
32
|
+
|
|
33
|
+
url: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Request details for a transfer intent.
|
|
38
|
+
*/
|
|
39
|
+
export interface TransferIntentRequestDetails {
|
|
40
|
+
/**
|
|
41
|
+
* Request body for initiating a sponsored token transfer from an embedded wallet.
|
|
42
|
+
*/
|
|
43
|
+
body: WalletsAPI.CreateTokenTransferRequest;
|
|
44
|
+
|
|
45
|
+
method: 'POST';
|
|
46
|
+
|
|
47
|
+
url: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Request details for a policy intent.
|
|
52
|
+
*/
|
|
53
|
+
export interface PolicyIntentRequestDetails {
|
|
54
|
+
body: PolicyIntentRequestDetails.Body;
|
|
55
|
+
|
|
56
|
+
method: 'PATCH';
|
|
57
|
+
|
|
58
|
+
url: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export namespace PolicyIntentRequestDetails {
|
|
62
|
+
export interface Body {
|
|
63
|
+
/**
|
|
64
|
+
* Name to assign to policy.
|
|
65
|
+
*/
|
|
66
|
+
name?: string;
|
|
67
|
+
|
|
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;
|
|
73
|
+
|
|
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;
|
|
79
|
+
|
|
80
|
+
rules?: Array<PoliciesAPI.PolicyRuleRequestBody>;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Request details for creating a rule via intent.
|
|
86
|
+
*/
|
|
87
|
+
export interface RuleIntentCreateRequestDetails {
|
|
88
|
+
/**
|
|
89
|
+
* The rules that apply to each method the policy covers.
|
|
90
|
+
*/
|
|
91
|
+
body: PoliciesAPI.PolicyRuleRequestBody;
|
|
92
|
+
|
|
93
|
+
method: 'POST';
|
|
94
|
+
|
|
95
|
+
url: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Request details for updating a rule via intent.
|
|
100
|
+
*/
|
|
101
|
+
export interface RuleIntentUpdateRequestDetails {
|
|
102
|
+
/**
|
|
103
|
+
* The rules that apply to each method the policy covers.
|
|
104
|
+
*/
|
|
105
|
+
body: PoliciesAPI.PolicyRuleRequestBody;
|
|
106
|
+
|
|
107
|
+
method: 'PATCH';
|
|
108
|
+
|
|
109
|
+
url: string;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Request details for deleting a rule via intent.
|
|
114
|
+
*/
|
|
115
|
+
export interface RuleIntentDeleteRequestDetails {
|
|
116
|
+
method: 'DELETE';
|
|
117
|
+
|
|
118
|
+
url: string;
|
|
119
|
+
|
|
120
|
+
body?: unknown;
|
|
121
|
+
}
|
|
122
|
+
|
|
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
|
+
|
|
8
132
|
/**
|
|
9
133
|
* A leaf member (user or key) of a nested key quorum in an intent authorization.
|
|
10
134
|
*/
|
|
@@ -15,9 +139,9 @@ export type IntentAuthorizationKeyQuorumMember =
|
|
|
15
139
|
export namespace IntentAuthorizationKeyQuorumMember {
|
|
16
140
|
export interface UserMember {
|
|
17
141
|
/**
|
|
18
|
-
*
|
|
142
|
+
* Unix timestamp when this member signed, or null if not yet signed.
|
|
19
143
|
*/
|
|
20
|
-
|
|
144
|
+
signed_at: number | null;
|
|
21
145
|
|
|
22
146
|
type: 'user';
|
|
23
147
|
|
|
@@ -25,30 +149,20 @@ export namespace IntentAuthorizationKeyQuorumMember {
|
|
|
25
149
|
* User ID of the key quorum member
|
|
26
150
|
*/
|
|
27
151
|
user_id: string;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Display name for the user (email, etc)
|
|
31
|
-
*/
|
|
32
|
-
display_name?: string;
|
|
33
152
|
}
|
|
34
153
|
|
|
35
154
|
export interface KeyMember {
|
|
36
|
-
/**
|
|
37
|
-
* Whether this key has signed the intent
|
|
38
|
-
*/
|
|
39
|
-
has_signed: boolean;
|
|
40
|
-
|
|
41
155
|
/**
|
|
42
156
|
* Public key of the key quorum member
|
|
43
157
|
*/
|
|
44
158
|
public_key: string;
|
|
45
159
|
|
|
46
|
-
type: 'key';
|
|
47
|
-
|
|
48
160
|
/**
|
|
49
|
-
*
|
|
161
|
+
* Unix timestamp when this member signed, or null if not yet signed.
|
|
50
162
|
*/
|
|
51
|
-
|
|
163
|
+
signed_at: number | null;
|
|
164
|
+
|
|
165
|
+
type: 'key';
|
|
52
166
|
}
|
|
53
167
|
}
|
|
54
168
|
|
|
@@ -64,9 +178,9 @@ export type IntentAuthorizationMember =
|
|
|
64
178
|
export namespace IntentAuthorizationMember {
|
|
65
179
|
export interface UserMember {
|
|
66
180
|
/**
|
|
67
|
-
*
|
|
181
|
+
* Unix timestamp when this member signed, or null if not yet signed.
|
|
68
182
|
*/
|
|
69
|
-
|
|
183
|
+
signed_at: number | null;
|
|
70
184
|
|
|
71
185
|
type: 'user';
|
|
72
186
|
|
|
@@ -74,38 +188,23 @@ export namespace IntentAuthorizationMember {
|
|
|
74
188
|
* User ID of the key quorum member
|
|
75
189
|
*/
|
|
76
190
|
user_id: string;
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Display name for the user (email, etc)
|
|
80
|
-
*/
|
|
81
|
-
display_name?: string;
|
|
82
191
|
}
|
|
83
192
|
|
|
84
193
|
export interface KeyMember {
|
|
85
|
-
/**
|
|
86
|
-
* Whether this key has signed the intent
|
|
87
|
-
*/
|
|
88
|
-
has_signed: boolean;
|
|
89
|
-
|
|
90
194
|
/**
|
|
91
195
|
* Public key of the key quorum member
|
|
92
196
|
*/
|
|
93
197
|
public_key: string;
|
|
94
198
|
|
|
95
|
-
type: 'key';
|
|
96
|
-
|
|
97
199
|
/**
|
|
98
|
-
*
|
|
200
|
+
* Unix timestamp when this member signed, or null if not yet signed.
|
|
99
201
|
*/
|
|
100
|
-
|
|
202
|
+
signed_at: number | null;
|
|
203
|
+
|
|
204
|
+
type: 'key';
|
|
101
205
|
}
|
|
102
206
|
|
|
103
207
|
export interface KeyQuorumMember {
|
|
104
|
-
/**
|
|
105
|
-
* Whether this child key quorum has fulfilled its threshold
|
|
106
|
-
*/
|
|
107
|
-
has_signed: boolean;
|
|
108
|
-
|
|
109
208
|
/**
|
|
110
209
|
* ID of the child key quorum member
|
|
111
210
|
*/
|
|
@@ -121,6 +220,11 @@ export namespace IntentAuthorizationMember {
|
|
|
121
220
|
*/
|
|
122
221
|
threshold: number;
|
|
123
222
|
|
|
223
|
+
/**
|
|
224
|
+
* Whether this child key quorum has met its signature threshold
|
|
225
|
+
*/
|
|
226
|
+
threshold_met: boolean;
|
|
227
|
+
|
|
124
228
|
type: 'key_quorum';
|
|
125
229
|
|
|
126
230
|
/**
|
|
@@ -130,9 +234,443 @@ export namespace IntentAuthorizationMember {
|
|
|
130
234
|
}
|
|
131
235
|
}
|
|
132
236
|
|
|
237
|
+
/**
|
|
238
|
+
* Authorization quorum for an intent
|
|
239
|
+
*/
|
|
240
|
+
export interface IntentAuthorization {
|
|
241
|
+
/**
|
|
242
|
+
* Members in this authorization quorum
|
|
243
|
+
*/
|
|
244
|
+
members: Array<IntentAuthorizationMember>;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Number of signatures required to satisfy this quorum
|
|
248
|
+
*/
|
|
249
|
+
threshold: number;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Display name of the key quorum
|
|
253
|
+
*/
|
|
254
|
+
display_name?: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Common fields shared by all intent response types.
|
|
259
|
+
*/
|
|
260
|
+
export interface BaseIntentResponse {
|
|
261
|
+
/**
|
|
262
|
+
* Detailed authorization information including key quorum members, thresholds, and
|
|
263
|
+
* signature status
|
|
264
|
+
*/
|
|
265
|
+
authorization_details: Array<IntentAuthorization>;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Unix timestamp when the intent was created
|
|
269
|
+
*/
|
|
270
|
+
created_at: number;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Display name of the user who created the intent
|
|
274
|
+
*/
|
|
275
|
+
created_by_display_name: string;
|
|
276
|
+
|
|
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;
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Unix timestamp when the intent expires
|
|
285
|
+
*/
|
|
286
|
+
expires_at: number;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Unique ID for the intent
|
|
290
|
+
*/
|
|
291
|
+
intent_id: string;
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* ID of the resource being modified (wallet_id, policy_id, etc)
|
|
295
|
+
*/
|
|
296
|
+
resource_id: string;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Current status of an intent.
|
|
300
|
+
*/
|
|
301
|
+
status: IntentStatus;
|
|
302
|
+
|
|
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;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Human-readable reason for dismissal, present when status is 'dismissed'
|
|
311
|
+
*/
|
|
312
|
+
dismissal_reason?: string;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Unix timestamp when the intent was dismissed, present when status is 'dismissed'
|
|
316
|
+
*/
|
|
317
|
+
dismissed_at?: number;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Unix timestamp when the intent was rejected, present when status is 'rejected'
|
|
321
|
+
*/
|
|
322
|
+
rejected_at?: number;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Common fields for intent action execution results.
|
|
327
|
+
*/
|
|
328
|
+
export interface BaseActionResult {
|
|
329
|
+
/**
|
|
330
|
+
* Unix timestamp when the action was executed
|
|
331
|
+
*/
|
|
332
|
+
executed_at: number;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* HTTP status code from the action execution
|
|
336
|
+
*/
|
|
337
|
+
status_code: number;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Display name of the key quorum that authorized execution
|
|
341
|
+
*/
|
|
342
|
+
authorized_by_display_name?: string;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* ID of the key quorum that authorized execution
|
|
346
|
+
*/
|
|
347
|
+
authorized_by_id?: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Response for an RPC intent
|
|
352
|
+
*/
|
|
353
|
+
export interface RpcIntentResponse extends BaseIntentResponse {
|
|
354
|
+
intent_type: 'RPC';
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* The original RPC request that would be sent to the wallet endpoint
|
|
358
|
+
*/
|
|
359
|
+
request_details: RpcIntentResponse.RequestDetails;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Result of RPC execution (only present if status is 'executed' or 'failed')
|
|
363
|
+
*/
|
|
364
|
+
action_result?: BaseActionResult;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* A wallet managed by Privy's wallet infrastructure.
|
|
368
|
+
*/
|
|
369
|
+
current_resource_data?: WalletsAPI.Wallet;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
export namespace RpcIntentResponse {
|
|
373
|
+
/**
|
|
374
|
+
* The original RPC request that would be sent to the wallet endpoint
|
|
375
|
+
*/
|
|
376
|
+
export interface RequestDetails {
|
|
377
|
+
/**
|
|
378
|
+
* Request body for wallet RPC operations, discriminated by method.
|
|
379
|
+
*/
|
|
380
|
+
body: WalletsAPI.WalletRpcRequestBody;
|
|
381
|
+
|
|
382
|
+
method: 'POST';
|
|
383
|
+
|
|
384
|
+
url: string;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* Response for a transfer intent
|
|
390
|
+
*/
|
|
391
|
+
export interface TransferIntentResponse extends BaseIntentResponse {
|
|
392
|
+
intent_type: 'TRANSFER';
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* The original transfer request that would be sent to the wallet transfer endpoint
|
|
396
|
+
*/
|
|
397
|
+
request_details: TransferIntentResponse.RequestDetails;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Result of transfer execution (only present if intent status is 'executed' or
|
|
401
|
+
* 'failed')
|
|
402
|
+
*/
|
|
403
|
+
action_result?: BaseActionResult;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* A wallet managed by Privy's wallet infrastructure.
|
|
407
|
+
*/
|
|
408
|
+
current_resource_data?: WalletsAPI.Wallet;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export namespace TransferIntentResponse {
|
|
412
|
+
/**
|
|
413
|
+
* The original transfer request that would be sent to the wallet transfer endpoint
|
|
414
|
+
*/
|
|
415
|
+
export interface RequestDetails {
|
|
416
|
+
/**
|
|
417
|
+
* Request body for initiating a sponsored token transfer from an embedded wallet.
|
|
418
|
+
*/
|
|
419
|
+
body: WalletsAPI.CreateTokenTransferRequest;
|
|
420
|
+
|
|
421
|
+
method: 'POST';
|
|
422
|
+
|
|
423
|
+
url: string;
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
/**
|
|
428
|
+
* Response for a wallet intent
|
|
429
|
+
*/
|
|
430
|
+
export interface WalletIntentResponse extends BaseIntentResponse {
|
|
431
|
+
intent_type: 'WALLET';
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* The original wallet update request that would be sent to the wallet endpoint
|
|
435
|
+
*/
|
|
436
|
+
request_details: WalletIntentResponse.RequestDetails;
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Result of wallet update execution (only present if status is 'executed' or
|
|
440
|
+
* 'failed')
|
|
441
|
+
*/
|
|
442
|
+
action_result?: BaseActionResult;
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* A wallet managed by Privy's wallet infrastructure.
|
|
446
|
+
*/
|
|
447
|
+
current_resource_data?: WalletsAPI.Wallet;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export namespace WalletIntentResponse {
|
|
451
|
+
/**
|
|
452
|
+
* The original wallet update request that would be sent to the wallet endpoint
|
|
453
|
+
*/
|
|
454
|
+
export interface RequestDetails {
|
|
455
|
+
body: RequestDetails.Body;
|
|
456
|
+
|
|
457
|
+
method: 'PATCH';
|
|
458
|
+
|
|
459
|
+
url: string;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
export namespace RequestDetails {
|
|
463
|
+
export interface Body {
|
|
464
|
+
/**
|
|
465
|
+
* Additional signers for the wallet.
|
|
466
|
+
*/
|
|
467
|
+
additional_signers?: WalletsAPI.AdditionalSignerInput;
|
|
468
|
+
|
|
469
|
+
authorization_key_ids?: Array<string>;
|
|
470
|
+
|
|
471
|
+
authorization_threshold?: number;
|
|
472
|
+
|
|
473
|
+
display_name?: string | null;
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* The owner of the resource, specified as a Privy user ID, a P-256 public key, or
|
|
477
|
+
* null to remove the current owner.
|
|
478
|
+
*/
|
|
479
|
+
owner?: SharedAPI.OwnerInput | null;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* The key quorum ID to set as the owner of the resource. If you provide this, do
|
|
483
|
+
* not specify an owner.
|
|
484
|
+
*/
|
|
485
|
+
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* An optional list of up to one policy ID to enforce on the wallet.
|
|
489
|
+
*/
|
|
490
|
+
policy_ids?: WalletsAPI.PolicyInput;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
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
|
+
|
|
133
651
|
export declare namespace Intents {
|
|
134
652
|
export {
|
|
653
|
+
type IntentType as IntentType,
|
|
654
|
+
type IntentStatus as IntentStatus,
|
|
655
|
+
type RpcIntentRequestDetails as RpcIntentRequestDetails,
|
|
656
|
+
type TransferIntentRequestDetails as TransferIntentRequestDetails,
|
|
657
|
+
type PolicyIntentRequestDetails as PolicyIntentRequestDetails,
|
|
658
|
+
type RuleIntentCreateRequestDetails as RuleIntentCreateRequestDetails,
|
|
659
|
+
type RuleIntentUpdateRequestDetails as RuleIntentUpdateRequestDetails,
|
|
660
|
+
type RuleIntentDeleteRequestDetails as RuleIntentDeleteRequestDetails,
|
|
661
|
+
type RuleIntentRequestDetails as RuleIntentRequestDetails,
|
|
135
662
|
type IntentAuthorizationKeyQuorumMember as IntentAuthorizationKeyQuorumMember,
|
|
136
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,
|
|
668
|
+
type TransferIntentResponse as TransferIntentResponse,
|
|
669
|
+
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,
|
|
137
675
|
};
|
|
138
676
|
}
|