@privy-io/api-types 0.7.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +62 -0
- package/client.d.mts +39 -30
- package/client.d.mts.map +1 -1
- package/client.d.ts +39 -30
- package/client.d.ts.map +1 -1
- package/client.js +9 -0
- package/client.js.map +1 -1
- package/client.mjs +9 -0
- package/client.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/accounts.d.mts +79 -106
- package/resources/accounts.d.mts.map +1 -1
- package/resources/accounts.d.ts +79 -106
- 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 +154 -71
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +154 -71
- 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 +796 -427
- package/resources/client-auth.d.mts.map +1 -1
- package/resources/client-auth.d.ts +796 -427
- 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 +167 -83
- package/resources/embedded-wallets.d.mts.map +1 -1
- package/resources/embedded-wallets.d.ts +167 -83
- 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 -15
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +18 -15
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +7 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +3 -0
- package/resources/index.mjs.map +1 -1
- package/resources/intents.d.mts +224 -1757
- package/resources/intents.d.mts.map +1 -1
- package/resources/intents.d.ts +224 -1757
- 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 +74 -26
- package/resources/key-quorums.d.mts.map +1 -1
- package/resources/key-quorums.d.ts +74 -26
- package/resources/key-quorums.d.ts.map +1 -1
- package/resources/key-quorums.js +8 -8
- package/resources/key-quorums.js.map +1 -1
- package/resources/key-quorums.mjs +8 -8
- package/resources/key-quorums.mjs.map +1 -1
- package/resources/kraken-embed.d.mts +52 -1
- package/resources/kraken-embed.d.mts.map +1 -1
- package/resources/kraken-embed.d.ts +52 -1
- package/resources/kraken-embed.d.ts.map +1 -1
- package/resources/policies.d.mts +512 -992
- package/resources/policies.d.mts.map +1 -1
- package/resources/policies.d.ts +512 -992
- package/resources/policies.d.ts.map +1 -1
- package/resources/policies.js +48 -41
- package/resources/policies.js.map +1 -1
- package/resources/policies.mjs +48 -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 +150 -98
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +150 -98
- package/resources/transactions.d.ts.map +1 -1
- package/resources/users.d.mts +207 -240
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +207 -240
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js.map +1 -1
- package/resources/users.mjs.map +1 -1
- package/resources/wallet-actions.d.mts +439 -0
- package/resources/wallet-actions.d.mts.map +1 -0
- package/resources/wallet-actions.d.ts +439 -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 +2 -1
- package/resources/wallets/balance.d.mts.map +1 -1
- package/resources/wallets/balance.d.ts +2 -1
- package/resources/wallets/balance.d.ts.map +1 -1
- package/resources/wallets/balance.js.map +1 -1
- 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 +11 -30
- package/resources/wallets/transactions.d.mts.map +1 -1
- package/resources/wallets/transactions.d.ts +11 -30
- package/resources/wallets/transactions.d.ts.map +1 -1
- package/resources/wallets/transactions.js.map +1 -1
- package/resources/wallets/transactions.mjs.map +1 -1
- package/resources/wallets/wallets.d.mts +2435 -923
- package/resources/wallets/wallets.d.mts.map +1 -1
- package/resources/wallets/wallets.d.ts +2435 -923
- package/resources/wallets/wallets.d.ts.map +1 -1
- package/resources/wallets/wallets.js +24 -11
- package/resources/wallets/wallets.js.map +1 -1
- package/resources/wallets/wallets.mjs +24 -11
- package/resources/wallets/wallets.mjs.map +1 -1
- package/resources/webhooks.d.mts +1296 -186
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +1296 -186
- 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 +25 -1
- package/resources/yield.d.mts.map +1 -1
- package/resources/yield.d.ts +25 -1
- package/resources/yield.d.ts.map +1 -1
- package/src/client.ts +869 -92
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/accounts.ts +93 -120
- package/src/resources/aggregations.ts +18 -702
- package/src/resources/apps.ts +211 -111
- package/src/resources/client-auth.ts +1361 -896
- 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 +447 -65
- package/src/resources/intents.ts +370 -3100
- package/src/resources/key-quorums.ts +100 -32
- package/src/resources/kraken-embed.ts +105 -0
- package/src/resources/policies.ts +648 -1494
- package/src/resources/shared.ts +79 -0
- package/src/resources/swaps.ts +136 -0
- package/src/resources/transactions.ts +169 -102
- package/src/resources/users.ts +676 -729
- package/src/resources/wallet-actions.ts +573 -0
- package/src/resources/wallets/balance.ts +2 -1
- package/src/resources/wallets/index.ts +156 -17
- package/src/resources/wallets/transactions.ts +12 -88
- package/src/resources/wallets/wallets.ts +3162 -1109
- package/src/resources/webhooks.ts +1609 -229
- package/src/resources/yield.ts +29 -0
- 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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as PoliciesAPI from './policies';
|
|
5
|
+
import * as SharedAPI from './shared';
|
|
5
6
|
import * as WalletsAPI from './wallets/wallets';
|
|
6
7
|
import { APIPromise } from '../core/api-promise';
|
|
7
8
|
import { buildHeaders } from '../internal/headers';
|
|
@@ -56,30 +57,35 @@ export class Policies extends APIResource {
|
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
59
|
* ```ts
|
|
59
|
-
* const
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
60
|
+
* const policyRuleResponse =
|
|
61
|
+
* await client.policies._createRule(
|
|
62
|
+
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
63
|
+
* {
|
|
64
|
+
* action: 'ALLOW',
|
|
65
|
+
* conditions: [
|
|
66
|
+
* {
|
|
67
|
+
* field: 'to',
|
|
68
|
+
* field_source: 'ethereum_transaction',
|
|
69
|
+
* operator: 'eq',
|
|
70
|
+
* value: 'string',
|
|
71
|
+
* },
|
|
72
|
+
* ],
|
|
73
|
+
* method: 'eth_sendTransaction',
|
|
74
|
+
* name: 'x',
|
|
75
|
+
* },
|
|
76
|
+
* );
|
|
75
77
|
* ```
|
|
76
78
|
*/
|
|
77
79
|
_createRule(
|
|
78
80
|
policyID: string,
|
|
79
81
|
params: PolicyCreateRuleParams,
|
|
80
82
|
options?: RequestOptions,
|
|
81
|
-
): APIPromise<
|
|
82
|
-
const {
|
|
83
|
+
): APIPromise<PolicyRuleResponse> {
|
|
84
|
+
const {
|
|
85
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
86
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
87
|
+
...body
|
|
88
|
+
} = params;
|
|
83
89
|
return this._client.post(path`/v1/policies/${policyID}/rules`, {
|
|
84
90
|
body,
|
|
85
91
|
...options,
|
|
@@ -88,6 +94,7 @@ export class Policies extends APIResource {
|
|
|
88
94
|
...(privyAuthorizationSignature != null ?
|
|
89
95
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
90
96
|
: undefined),
|
|
97
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
91
98
|
},
|
|
92
99
|
options?.headers,
|
|
93
100
|
]),
|
|
@@ -99,7 +106,7 @@ export class Policies extends APIResource {
|
|
|
99
106
|
*
|
|
100
107
|
* @example
|
|
101
108
|
* ```ts
|
|
102
|
-
* const
|
|
109
|
+
* const successResponse = await client.policies._delete(
|
|
103
110
|
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
104
111
|
* );
|
|
105
112
|
* ```
|
|
@@ -108,8 +115,11 @@ export class Policies extends APIResource {
|
|
|
108
115
|
policyID: string,
|
|
109
116
|
params: PolicyDeleteParams | null | undefined = {},
|
|
110
117
|
options?: RequestOptions,
|
|
111
|
-
): APIPromise<
|
|
112
|
-
const {
|
|
118
|
+
): APIPromise<SharedAPI.SuccessResponse> {
|
|
119
|
+
const {
|
|
120
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
121
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
122
|
+
} = params ?? {};
|
|
113
123
|
return this._client.delete(path`/v1/policies/${policyID}`, {
|
|
114
124
|
...options,
|
|
115
125
|
headers: buildHeaders([
|
|
@@ -117,6 +127,7 @@ export class Policies extends APIResource {
|
|
|
117
127
|
...(privyAuthorizationSignature != null ?
|
|
118
128
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
119
129
|
: undefined),
|
|
130
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
120
131
|
},
|
|
121
132
|
options?.headers,
|
|
122
133
|
]),
|
|
@@ -128,7 +139,7 @@ export class Policies extends APIResource {
|
|
|
128
139
|
*
|
|
129
140
|
* @example
|
|
130
141
|
* ```ts
|
|
131
|
-
* const
|
|
142
|
+
* const successResponse = await client.policies._deleteRule(
|
|
132
143
|
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
133
144
|
* { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
|
|
134
145
|
* );
|
|
@@ -138,8 +149,12 @@ export class Policies extends APIResource {
|
|
|
138
149
|
ruleID: string,
|
|
139
150
|
params: PolicyDeleteRuleParams,
|
|
140
151
|
options?: RequestOptions,
|
|
141
|
-
): APIPromise<
|
|
142
|
-
const {
|
|
152
|
+
): APIPromise<SharedAPI.SuccessResponse> {
|
|
153
|
+
const {
|
|
154
|
+
policy_id,
|
|
155
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
156
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
157
|
+
} = params;
|
|
143
158
|
return this._client.delete(path`/v1/policies/${policy_id}/rules/${ruleID}`, {
|
|
144
159
|
...options,
|
|
145
160
|
headers: buildHeaders([
|
|
@@ -147,6 +162,7 @@ export class Policies extends APIResource {
|
|
|
147
162
|
...(privyAuthorizationSignature != null ?
|
|
148
163
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
149
164
|
: undefined),
|
|
165
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
150
166
|
},
|
|
151
167
|
options?.headers,
|
|
152
168
|
]),
|
|
@@ -164,7 +180,11 @@ export class Policies extends APIResource {
|
|
|
164
180
|
* ```
|
|
165
181
|
*/
|
|
166
182
|
_update(policyID: string, params: PolicyUpdateParams, options?: RequestOptions): APIPromise<Policy> {
|
|
167
|
-
const {
|
|
183
|
+
const {
|
|
184
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
185
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
186
|
+
...body
|
|
187
|
+
} = params;
|
|
168
188
|
return this._client.patch(path`/v1/policies/${policyID}`, {
|
|
169
189
|
body,
|
|
170
190
|
...options,
|
|
@@ -173,6 +193,7 @@ export class Policies extends APIResource {
|
|
|
173
193
|
...(privyAuthorizationSignature != null ?
|
|
174
194
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
175
195
|
: undefined),
|
|
196
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
176
197
|
},
|
|
177
198
|
options?.headers,
|
|
178
199
|
]),
|
|
@@ -184,31 +205,37 @@ export class Policies extends APIResource {
|
|
|
184
205
|
*
|
|
185
206
|
* @example
|
|
186
207
|
* ```ts
|
|
187
|
-
* const
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
*
|
|
200
|
-
*
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
208
|
+
* const policyRuleResponse =
|
|
209
|
+
* await client.policies._updateRule(
|
|
210
|
+
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
211
|
+
* {
|
|
212
|
+
* policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
213
|
+
* action: 'ALLOW',
|
|
214
|
+
* conditions: [
|
|
215
|
+
* {
|
|
216
|
+
* field: 'to',
|
|
217
|
+
* field_source: 'ethereum_transaction',
|
|
218
|
+
* operator: 'eq',
|
|
219
|
+
* value: 'string',
|
|
220
|
+
* },
|
|
221
|
+
* ],
|
|
222
|
+
* method: 'eth_sendTransaction',
|
|
223
|
+
* name: 'x',
|
|
224
|
+
* },
|
|
225
|
+
* );
|
|
204
226
|
* ```
|
|
205
227
|
*/
|
|
206
228
|
_updateRule(
|
|
207
229
|
ruleID: string,
|
|
208
230
|
params: PolicyUpdateRuleParams,
|
|
209
231
|
options?: RequestOptions,
|
|
210
|
-
): APIPromise<
|
|
211
|
-
const {
|
|
232
|
+
): APIPromise<PolicyRuleResponse> {
|
|
233
|
+
const {
|
|
234
|
+
policy_id,
|
|
235
|
+
'privy-authorization-signature': privyAuthorizationSignature,
|
|
236
|
+
'privy-request-expiry': privyRequestExpiry,
|
|
237
|
+
...body
|
|
238
|
+
} = params;
|
|
212
239
|
return this._client.patch(path`/v1/policies/${policy_id}/rules/${ruleID}`, {
|
|
213
240
|
body,
|
|
214
241
|
...options,
|
|
@@ -217,6 +244,7 @@ export class Policies extends APIResource {
|
|
|
217
244
|
...(privyAuthorizationSignature != null ?
|
|
218
245
|
{ 'privy-authorization-signature': privyAuthorizationSignature }
|
|
219
246
|
: undefined),
|
|
247
|
+
...(privyRequestExpiry != null ? { 'privy-request-expiry': privyRequestExpiry } : undefined),
|
|
220
248
|
},
|
|
221
249
|
options?.headers,
|
|
222
250
|
]),
|
|
@@ -242,7 +270,7 @@ export class Policies extends APIResource {
|
|
|
242
270
|
*
|
|
243
271
|
* @example
|
|
244
272
|
* ```ts
|
|
245
|
-
* const
|
|
273
|
+
* const policyRuleResponse = await client.policies.getRule(
|
|
246
274
|
* 'xxxxxxxxxxxxxxxxxxxxxxxx',
|
|
247
275
|
* { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
|
|
248
276
|
* );
|
|
@@ -252,930 +280,751 @@ export class Policies extends APIResource {
|
|
|
252
280
|
ruleID: string,
|
|
253
281
|
params: PolicyGetRuleParams,
|
|
254
282
|
options?: RequestOptions,
|
|
255
|
-
): APIPromise<
|
|
283
|
+
): APIPromise<PolicyRuleResponse> {
|
|
256
284
|
const { policy_id } = params;
|
|
257
285
|
return this._client.get(path`/v1/policies/${policy_id}/rules/${ruleID}`, options);
|
|
258
286
|
}
|
|
259
287
|
}
|
|
260
288
|
|
|
261
289
|
/**
|
|
262
|
-
*
|
|
263
|
-
* supported for command names.
|
|
290
|
+
* Unique ID of the condition set to take actions on.
|
|
264
291
|
*/
|
|
265
|
-
export
|
|
292
|
+
export interface ConditionSetRequestParams {
|
|
293
|
+
condition_set_id: string;
|
|
294
|
+
}
|
|
266
295
|
|
|
267
296
|
/**
|
|
268
|
-
*
|
|
269
|
-
*
|
|
297
|
+
* Unique IDs of the condition set and the condition set item within the condition
|
|
298
|
+
* set to take actions on.
|
|
270
299
|
*/
|
|
271
|
-
export
|
|
300
|
+
export interface ConditionSetItemRequestParams {
|
|
301
|
+
condition_set_id: string;
|
|
302
|
+
|
|
303
|
+
condition_set_item_id: string;
|
|
304
|
+
}
|
|
272
305
|
|
|
273
306
|
/**
|
|
274
|
-
*
|
|
275
|
-
* transaction types.
|
|
307
|
+
* Request body for creating a condition set.
|
|
276
308
|
*/
|
|
277
|
-
export interface
|
|
309
|
+
export interface ConditionSetRequestBody {
|
|
278
310
|
/**
|
|
279
|
-
*
|
|
311
|
+
* Name to assign to condition set.
|
|
280
312
|
*/
|
|
281
|
-
|
|
282
|
-
| 'TransferContract.to_address'
|
|
283
|
-
| 'TransferContract.amount'
|
|
284
|
-
| 'TriggerSmartContract.contract_address'
|
|
285
|
-
| 'TriggerSmartContract.call_value'
|
|
286
|
-
| 'TriggerSmartContract.token_id'
|
|
287
|
-
| 'TriggerSmartContract.call_token_value';
|
|
288
|
-
|
|
289
|
-
field_source: 'tron_transaction';
|
|
313
|
+
name: string;
|
|
290
314
|
|
|
291
|
-
|
|
315
|
+
/**
|
|
316
|
+
* The owner of the resource, specified as a Privy user ID, a P-256 public key, or
|
|
317
|
+
* null to remove the current owner.
|
|
318
|
+
*/
|
|
319
|
+
owner?: SharedAPI.OwnerInput | null;
|
|
292
320
|
|
|
293
|
-
|
|
321
|
+
/**
|
|
322
|
+
* The key quorum ID to set as the owner of the resource. If you provide this, do
|
|
323
|
+
* not specify an owner.
|
|
324
|
+
*/
|
|
325
|
+
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
294
326
|
}
|
|
295
327
|
|
|
296
328
|
/**
|
|
297
|
-
*
|
|
298
|
-
* Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and
|
|
299
|
-
* 'in' operators are supported.
|
|
329
|
+
* A condition set for grouping related condition values.
|
|
300
330
|
*/
|
|
301
|
-
export interface
|
|
302
|
-
|
|
331
|
+
export interface ConditionSet {
|
|
332
|
+
/**
|
|
333
|
+
* Unique ID of the created condition set. This will be the primary identifier when
|
|
334
|
+
* using the condition set in the future.
|
|
335
|
+
*/
|
|
336
|
+
id: string;
|
|
303
337
|
|
|
304
|
-
|
|
338
|
+
/**
|
|
339
|
+
* Unix timestamp of when the condition set was created in milliseconds.
|
|
340
|
+
*/
|
|
341
|
+
created_at: number;
|
|
305
342
|
|
|
306
343
|
/**
|
|
307
|
-
*
|
|
308
|
-
* supported for command names.
|
|
344
|
+
* Name of the condition set.
|
|
309
345
|
*/
|
|
310
|
-
|
|
346
|
+
name: string;
|
|
311
347
|
|
|
312
348
|
/**
|
|
313
|
-
*
|
|
314
|
-
* 'MergeCoins'
|
|
349
|
+
* A unique identifier for a key quorum.
|
|
315
350
|
*/
|
|
316
|
-
|
|
351
|
+
owner_id: SharedAPI.KeyQuorumID;
|
|
317
352
|
}
|
|
318
353
|
|
|
319
354
|
/**
|
|
320
|
-
*
|
|
355
|
+
* Request body for updating a condition set.
|
|
321
356
|
*/
|
|
322
|
-
export interface
|
|
357
|
+
export interface UpdateConditionSetRequestBody {
|
|
323
358
|
/**
|
|
324
|
-
*
|
|
325
|
-
* and 'amount' are supported.
|
|
359
|
+
* Name to assign to condition set.
|
|
326
360
|
*/
|
|
327
|
-
|
|
361
|
+
name?: string;
|
|
328
362
|
|
|
329
|
-
|
|
363
|
+
/**
|
|
364
|
+
* The owner of the resource, specified as a Privy user ID, a P-256 public key, or
|
|
365
|
+
* null to remove the current owner.
|
|
366
|
+
*/
|
|
367
|
+
owner?: SharedAPI.OwnerInput | null;
|
|
330
368
|
|
|
331
|
-
|
|
369
|
+
/**
|
|
370
|
+
* The key quorum ID to set as the owner of the resource. If you provide this, do
|
|
371
|
+
* not specify an owner.
|
|
372
|
+
*/
|
|
373
|
+
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
374
|
+
}
|
|
332
375
|
|
|
333
|
-
|
|
376
|
+
/**
|
|
377
|
+
* A single value to add to a condition set.
|
|
378
|
+
*/
|
|
379
|
+
export interface ConditionSetItemValueInput {
|
|
380
|
+
value: string;
|
|
334
381
|
}
|
|
335
382
|
|
|
336
383
|
/**
|
|
337
|
-
*
|
|
384
|
+
* Array of values to add to the condition set. Maximum 100 items per request.
|
|
338
385
|
*/
|
|
339
|
-
export
|
|
386
|
+
export type ConditionSetItemsRequestBody = Array<ConditionSetItemValueInput>;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* A single item in a condition set.
|
|
390
|
+
*/
|
|
391
|
+
export interface ConditionSetItem {
|
|
340
392
|
/**
|
|
341
|
-
* Unique ID of the created
|
|
342
|
-
* the policy in the future.
|
|
393
|
+
* Unique ID of the created condition set item.
|
|
343
394
|
*/
|
|
344
395
|
id: string;
|
|
345
396
|
|
|
346
397
|
/**
|
|
347
|
-
*
|
|
398
|
+
* Unique ID of the condition set this item belongs to.
|
|
348
399
|
*/
|
|
349
|
-
|
|
400
|
+
condition_set_id: string;
|
|
350
401
|
|
|
351
402
|
/**
|
|
352
|
-
* Unix timestamp of when the
|
|
403
|
+
* Unix timestamp of when the condition set item was created in milliseconds.
|
|
353
404
|
*/
|
|
354
405
|
created_at: number;
|
|
355
406
|
|
|
356
407
|
/**
|
|
357
|
-
*
|
|
358
|
-
*/
|
|
359
|
-
name: string;
|
|
360
|
-
|
|
361
|
-
/**
|
|
362
|
-
* The key quorum ID of the owner of the policy.
|
|
408
|
+
* The value stored in this condition set item.
|
|
363
409
|
*/
|
|
364
|
-
|
|
410
|
+
value: string;
|
|
411
|
+
}
|
|
365
412
|
|
|
366
|
-
|
|
413
|
+
/**
|
|
414
|
+
* Array of condition set items.
|
|
415
|
+
*/
|
|
416
|
+
export type ConditionSetItems = Array<ConditionSetItem>;
|
|
367
417
|
|
|
418
|
+
/**
|
|
419
|
+
* Paginated list of condition set items.
|
|
420
|
+
*/
|
|
421
|
+
export interface ConditionSetItemsResponse {
|
|
368
422
|
/**
|
|
369
|
-
*
|
|
423
|
+
* List of condition set items.
|
|
370
424
|
*/
|
|
371
|
-
|
|
372
|
-
}
|
|
425
|
+
items: Array<ConditionSetItem>;
|
|
373
426
|
|
|
374
|
-
export namespace Policy {
|
|
375
427
|
/**
|
|
376
|
-
*
|
|
377
|
-
* true.
|
|
428
|
+
* Cursor for pagination. Null if there are no more items.
|
|
378
429
|
*/
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
/**
|
|
383
|
-
* Action to take if the conditions are true.
|
|
384
|
-
*/
|
|
385
|
-
action: 'ALLOW' | 'DENY';
|
|
386
|
-
|
|
387
|
-
conditions: Array<
|
|
388
|
-
| Rule.EthereumTransactionCondition
|
|
389
|
-
| Rule.EthereumCalldataCondition
|
|
390
|
-
| Rule.EthereumTypedDataDomainCondition
|
|
391
|
-
| Rule.EthereumTypedDataMessageCondition
|
|
392
|
-
| Rule.Ethereum7702AuthorizationCondition
|
|
393
|
-
| Rule.SolanaProgramInstructionCondition
|
|
394
|
-
| Rule.SolanaSystemProgramInstructionCondition
|
|
395
|
-
| Rule.SolanaTokenProgramInstructionCondition
|
|
396
|
-
| Rule.SystemCondition
|
|
397
|
-
| PoliciesAPI.TronTransactionCondition
|
|
398
|
-
| PoliciesAPI.SuiTransactionCommandCondition
|
|
399
|
-
| PoliciesAPI.SuiTransferObjectsCommandCondition
|
|
400
|
-
>;
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* Method the rule applies to.
|
|
404
|
-
*/
|
|
405
|
-
method:
|
|
406
|
-
| 'eth_sendTransaction'
|
|
407
|
-
| 'eth_signTransaction'
|
|
408
|
-
| 'eth_signUserOperation'
|
|
409
|
-
| 'eth_signTypedData_v4'
|
|
410
|
-
| 'eth_sign7702Authorization'
|
|
411
|
-
| 'signTransaction'
|
|
412
|
-
| 'signAndSendTransaction'
|
|
413
|
-
| 'exportPrivateKey'
|
|
414
|
-
| 'signTransactionBytes'
|
|
415
|
-
| '*';
|
|
416
|
-
|
|
417
|
-
name: string;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
export namespace Rule {
|
|
421
|
-
/**
|
|
422
|
-
* The verbatim Ethereum transaction object in an eth_signTransaction or
|
|
423
|
-
* eth_sendTransaction request.
|
|
424
|
-
*/
|
|
425
|
-
export interface EthereumTransactionCondition {
|
|
426
|
-
field: 'to' | 'value' | 'chain_id';
|
|
427
|
-
|
|
428
|
-
field_source: 'ethereum_transaction';
|
|
429
|
-
|
|
430
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
431
|
-
|
|
432
|
-
value: string | Array<string>;
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
/**
|
|
436
|
-
* The decoded calldata in a smart contract interaction as the smart contract
|
|
437
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
438
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
439
|
-
*/
|
|
440
|
-
export interface EthereumCalldataCondition {
|
|
441
|
-
abi: unknown;
|
|
442
|
-
|
|
443
|
-
field: string;
|
|
444
|
-
|
|
445
|
-
field_source: 'ethereum_calldata';
|
|
446
|
-
|
|
447
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
448
|
-
|
|
449
|
-
value: string | Array<string>;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* Attributes from the signing domain that will verify the signature.
|
|
454
|
-
*/
|
|
455
|
-
export interface EthereumTypedDataDomainCondition {
|
|
456
|
-
field: 'chainId' | 'verifyingContract';
|
|
457
|
-
|
|
458
|
-
field_source: 'ethereum_typed_data_domain';
|
|
459
|
-
|
|
460
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
461
|
-
|
|
462
|
-
value: string | Array<string>;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* 'types' and 'primary_type' attributes of the TypedData JSON object defined in
|
|
467
|
-
* EIP-712.
|
|
468
|
-
*/
|
|
469
|
-
export interface EthereumTypedDataMessageCondition {
|
|
470
|
-
field: string;
|
|
471
|
-
|
|
472
|
-
field_source: 'ethereum_typed_data_message';
|
|
473
|
-
|
|
474
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
475
|
-
|
|
476
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
477
|
-
|
|
478
|
-
value: string | Array<string>;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
482
|
-
export interface TypedData {
|
|
483
|
-
primary_type: string;
|
|
484
|
-
|
|
485
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
export namespace TypedData {
|
|
489
|
-
export interface Type {
|
|
490
|
-
name: string;
|
|
491
|
-
|
|
492
|
-
type: string;
|
|
493
|
-
}
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* Allowed contract addresses for eth_sign7702Authorization requests.
|
|
499
|
-
*/
|
|
500
|
-
export interface Ethereum7702AuthorizationCondition {
|
|
501
|
-
field: 'contract';
|
|
502
|
-
|
|
503
|
-
field_source: 'ethereum_7702_authorization';
|
|
504
|
-
|
|
505
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
430
|
+
next_cursor: string | null;
|
|
431
|
+
}
|
|
506
432
|
|
|
507
|
-
|
|
508
|
-
|
|
433
|
+
/**
|
|
434
|
+
* The action to take when a policy rule matches.
|
|
435
|
+
*/
|
|
436
|
+
export type PolicyAction = 'ALLOW' | 'DENY';
|
|
509
437
|
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
438
|
+
/**
|
|
439
|
+
* A parameter in a Solidity ABI function or event definition.
|
|
440
|
+
*/
|
|
441
|
+
export interface AbiParameter {
|
|
442
|
+
type: string;
|
|
515
443
|
|
|
516
|
-
|
|
444
|
+
components?: Array<unknown>;
|
|
517
445
|
|
|
518
|
-
|
|
446
|
+
indexed?: boolean;
|
|
519
447
|
|
|
520
|
-
|
|
521
|
-
}
|
|
448
|
+
internalType?: string;
|
|
522
449
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
* fields.
|
|
526
|
-
*/
|
|
527
|
-
export interface SolanaSystemProgramInstructionCondition {
|
|
528
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
450
|
+
name?: string;
|
|
451
|
+
}
|
|
529
452
|
|
|
530
|
-
|
|
453
|
+
/**
|
|
454
|
+
* A Solidity ABI definition for decoding smart contract calldata.
|
|
455
|
+
*/
|
|
456
|
+
export type AbiSchema = Array<AbiSchema.AbiSchemaItem>;
|
|
531
457
|
|
|
532
|
-
|
|
458
|
+
export namespace AbiSchema {
|
|
459
|
+
export interface AbiSchemaItem {
|
|
460
|
+
type: 'function' | 'constructor' | 'event' | 'fallback' | 'receive';
|
|
533
461
|
|
|
534
|
-
|
|
535
|
-
}
|
|
462
|
+
anonymous?: boolean;
|
|
536
463
|
|
|
537
|
-
|
|
538
|
-
* Solana Token Program attributes, including more granular TransferChecked
|
|
539
|
-
* instruction fields.
|
|
540
|
-
*/
|
|
541
|
-
export interface SolanaTokenProgramInstructionCondition {
|
|
542
|
-
field:
|
|
543
|
-
| 'instructionName'
|
|
544
|
-
| 'TransferChecked.source'
|
|
545
|
-
| 'TransferChecked.destination'
|
|
546
|
-
| 'TransferChecked.authority'
|
|
547
|
-
| 'TransferChecked.amount'
|
|
548
|
-
| 'TransferChecked.mint';
|
|
464
|
+
inputs?: Array<PoliciesAPI.AbiParameter>;
|
|
549
465
|
|
|
550
|
-
|
|
466
|
+
name?: string;
|
|
551
467
|
|
|
552
|
-
|
|
468
|
+
outputs?: Array<PoliciesAPI.AbiParameter>;
|
|
553
469
|
|
|
554
|
-
|
|
555
|
-
|
|
470
|
+
stateMutability?: 'pure' | 'view' | 'nonpayable' | 'payable';
|
|
471
|
+
}
|
|
472
|
+
}
|
|
556
473
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
field: 'current_unix_timestamp';
|
|
474
|
+
/**
|
|
475
|
+
* Operator to use for policy conditions.
|
|
476
|
+
*/
|
|
477
|
+
export type ConditionOperator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
562
478
|
|
|
563
|
-
|
|
479
|
+
/**
|
|
480
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
481
|
+
* array of strings.
|
|
482
|
+
*/
|
|
483
|
+
export type ConditionValue = string | Array<string>;
|
|
564
484
|
|
|
565
|
-
|
|
485
|
+
/**
|
|
486
|
+
* Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
|
|
487
|
+
* supported for command names.
|
|
488
|
+
*/
|
|
489
|
+
export type SuiTransactionCommandOperator = 'eq' | 'in';
|
|
566
490
|
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
491
|
+
/**
|
|
492
|
+
* Supported fields for SUI TransferObjects command conditions. Only 'recipient'
|
|
493
|
+
* and 'amount' are supported.
|
|
494
|
+
*/
|
|
495
|
+
export type SuiTransferObjectsCommandField = 'recipient' | 'amount';
|
|
571
496
|
|
|
572
497
|
/**
|
|
573
|
-
*
|
|
574
|
-
*
|
|
498
|
+
* The verbatim Ethereum transaction object in an eth_signTransaction or
|
|
499
|
+
* eth_sendTransaction request.
|
|
575
500
|
*/
|
|
576
|
-
export interface
|
|
577
|
-
|
|
501
|
+
export interface EthereumTransactionCondition {
|
|
502
|
+
field: 'to' | 'value' | 'chain_id';
|
|
503
|
+
|
|
504
|
+
field_source: 'ethereum_transaction';
|
|
578
505
|
|
|
579
506
|
/**
|
|
580
|
-
*
|
|
507
|
+
* Operator to use for policy conditions.
|
|
581
508
|
*/
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
conditions: Array<
|
|
585
|
-
| PolicyCreateRuleResponse.EthereumTransactionCondition
|
|
586
|
-
| PolicyCreateRuleResponse.EthereumCalldataCondition
|
|
587
|
-
| PolicyCreateRuleResponse.EthereumTypedDataDomainCondition
|
|
588
|
-
| PolicyCreateRuleResponse.EthereumTypedDataMessageCondition
|
|
589
|
-
| PolicyCreateRuleResponse.Ethereum7702AuthorizationCondition
|
|
590
|
-
| PolicyCreateRuleResponse.SolanaProgramInstructionCondition
|
|
591
|
-
| PolicyCreateRuleResponse.SolanaSystemProgramInstructionCondition
|
|
592
|
-
| PolicyCreateRuleResponse.SolanaTokenProgramInstructionCondition
|
|
593
|
-
| PolicyCreateRuleResponse.SystemCondition
|
|
594
|
-
| TronTransactionCondition
|
|
595
|
-
| SuiTransactionCommandCondition
|
|
596
|
-
| SuiTransferObjectsCommandCondition
|
|
597
|
-
>;
|
|
509
|
+
operator: ConditionOperator;
|
|
598
510
|
|
|
599
511
|
/**
|
|
600
|
-
*
|
|
512
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
513
|
+
* array of strings.
|
|
601
514
|
*/
|
|
602
|
-
|
|
603
|
-
| 'eth_sendTransaction'
|
|
604
|
-
| 'eth_signTransaction'
|
|
605
|
-
| 'eth_signUserOperation'
|
|
606
|
-
| 'eth_signTypedData_v4'
|
|
607
|
-
| 'eth_sign7702Authorization'
|
|
608
|
-
| 'signTransaction'
|
|
609
|
-
| 'signAndSendTransaction'
|
|
610
|
-
| 'exportPrivateKey'
|
|
611
|
-
| 'signTransactionBytes'
|
|
612
|
-
| '*';
|
|
613
|
-
|
|
614
|
-
name: string;
|
|
515
|
+
value: ConditionValue;
|
|
615
516
|
}
|
|
616
517
|
|
|
617
|
-
|
|
518
|
+
/**
|
|
519
|
+
* The decoded calldata in a smart contract interaction as the smart contract
|
|
520
|
+
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
521
|
+
* an abi parameter with the JSON ABI of the smart contract.
|
|
522
|
+
*/
|
|
523
|
+
export interface EthereumCalldataCondition {
|
|
618
524
|
/**
|
|
619
|
-
*
|
|
620
|
-
* eth_sendTransaction request.
|
|
525
|
+
* A Solidity ABI definition for decoding smart contract calldata.
|
|
621
526
|
*/
|
|
622
|
-
|
|
623
|
-
field: 'to' | 'value' | 'chain_id';
|
|
527
|
+
abi: AbiSchema;
|
|
624
528
|
|
|
625
|
-
|
|
529
|
+
field: string;
|
|
626
530
|
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
value: string | Array<string>;
|
|
630
|
-
}
|
|
531
|
+
field_source: 'ethereum_calldata';
|
|
631
532
|
|
|
632
533
|
/**
|
|
633
|
-
*
|
|
634
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
635
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
534
|
+
* Operator to use for policy conditions.
|
|
636
535
|
*/
|
|
637
|
-
|
|
638
|
-
abi: unknown;
|
|
536
|
+
operator: ConditionOperator;
|
|
639
537
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
538
|
+
/**
|
|
539
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
540
|
+
* array of strings.
|
|
541
|
+
*/
|
|
542
|
+
value: ConditionValue;
|
|
543
|
+
}
|
|
643
544
|
|
|
644
|
-
|
|
545
|
+
/**
|
|
546
|
+
* Attributes from the signing domain that will verify the signature.
|
|
547
|
+
*/
|
|
548
|
+
export interface EthereumTypedDataDomainCondition {
|
|
549
|
+
field: 'chainId' | 'verifyingContract' | 'chain_id' | 'verifying_contract';
|
|
645
550
|
|
|
646
|
-
|
|
647
|
-
}
|
|
551
|
+
field_source: 'ethereum_typed_data_domain';
|
|
648
552
|
|
|
649
553
|
/**
|
|
650
|
-
*
|
|
554
|
+
* Operator to use for policy conditions.
|
|
651
555
|
*/
|
|
652
|
-
|
|
653
|
-
field: 'chainId' | 'verifyingContract';
|
|
556
|
+
operator: ConditionOperator;
|
|
654
557
|
|
|
655
|
-
|
|
558
|
+
/**
|
|
559
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
560
|
+
* array of strings.
|
|
561
|
+
*/
|
|
562
|
+
value: ConditionValue;
|
|
563
|
+
}
|
|
656
564
|
|
|
657
|
-
|
|
565
|
+
/**
|
|
566
|
+
* 'types' and 'primary_type' attributes of the TypedData JSON object defined in
|
|
567
|
+
* EIP-712.
|
|
568
|
+
*/
|
|
569
|
+
export interface EthereumTypedDataMessageCondition {
|
|
570
|
+
field: string;
|
|
658
571
|
|
|
659
|
-
|
|
660
|
-
}
|
|
572
|
+
field_source: 'ethereum_typed_data_message';
|
|
661
573
|
|
|
662
574
|
/**
|
|
663
|
-
*
|
|
664
|
-
* EIP-712.
|
|
575
|
+
* Operator to use for policy conditions.
|
|
665
576
|
*/
|
|
666
|
-
|
|
667
|
-
field: string;
|
|
577
|
+
operator: ConditionOperator;
|
|
668
578
|
|
|
669
|
-
|
|
579
|
+
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
670
580
|
|
|
671
|
-
|
|
581
|
+
/**
|
|
582
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
583
|
+
* array of strings.
|
|
584
|
+
*/
|
|
585
|
+
value: ConditionValue;
|
|
586
|
+
}
|
|
672
587
|
|
|
673
|
-
|
|
588
|
+
export namespace EthereumTypedDataMessageCondition {
|
|
589
|
+
export interface TypedData {
|
|
590
|
+
primary_type: string;
|
|
674
591
|
|
|
675
|
-
|
|
592
|
+
/**
|
|
593
|
+
* The type definitions for EIP-712 typed data signing.
|
|
594
|
+
*/
|
|
595
|
+
types: WalletsAPI.TypedDataTypesInputParams;
|
|
676
596
|
}
|
|
597
|
+
}
|
|
677
598
|
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
}
|
|
599
|
+
/**
|
|
600
|
+
* Allowed contract addresses for eth_sign7702Authorization requests.
|
|
601
|
+
*/
|
|
602
|
+
export interface Ethereum7702AuthorizationCondition {
|
|
603
|
+
field: 'contract';
|
|
684
604
|
|
|
685
|
-
|
|
686
|
-
export interface Type {
|
|
687
|
-
name: string;
|
|
605
|
+
field_source: 'ethereum_7702_authorization';
|
|
688
606
|
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
607
|
+
/**
|
|
608
|
+
* Operator to use for policy conditions.
|
|
609
|
+
*/
|
|
610
|
+
operator: ConditionOperator;
|
|
693
611
|
|
|
694
612
|
/**
|
|
695
|
-
*
|
|
613
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
614
|
+
* array of strings.
|
|
696
615
|
*/
|
|
697
|
-
|
|
698
|
-
|
|
616
|
+
value: ConditionValue;
|
|
617
|
+
}
|
|
699
618
|
|
|
700
|
-
|
|
619
|
+
/**
|
|
620
|
+
* Solana Program attributes, enables allowlisting Solana Programs.
|
|
621
|
+
*/
|
|
622
|
+
export interface SolanaProgramInstructionCondition {
|
|
623
|
+
field: 'programId';
|
|
701
624
|
|
|
702
|
-
|
|
625
|
+
field_source: 'solana_program_instruction';
|
|
703
626
|
|
|
704
|
-
|
|
705
|
-
|
|
627
|
+
/**
|
|
628
|
+
* Operator to use for policy conditions.
|
|
629
|
+
*/
|
|
630
|
+
operator: ConditionOperator;
|
|
706
631
|
|
|
707
632
|
/**
|
|
708
|
-
*
|
|
633
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
634
|
+
* array of strings.
|
|
709
635
|
*/
|
|
710
|
-
|
|
711
|
-
|
|
636
|
+
value: ConditionValue;
|
|
637
|
+
}
|
|
712
638
|
|
|
713
|
-
|
|
639
|
+
/**
|
|
640
|
+
* Solana System Program attributes, including more granular Transfer instruction
|
|
641
|
+
* fields.
|
|
642
|
+
*/
|
|
643
|
+
export interface SolanaSystemProgramInstructionCondition {
|
|
644
|
+
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
714
645
|
|
|
715
|
-
|
|
646
|
+
field_source: 'solana_system_program_instruction';
|
|
716
647
|
|
|
717
|
-
|
|
718
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Operator to use for policy conditions.
|
|
650
|
+
*/
|
|
651
|
+
operator: ConditionOperator;
|
|
719
652
|
|
|
720
653
|
/**
|
|
721
|
-
*
|
|
722
|
-
*
|
|
654
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
655
|
+
* array of strings.
|
|
723
656
|
*/
|
|
724
|
-
|
|
725
|
-
|
|
657
|
+
value: ConditionValue;
|
|
658
|
+
}
|
|
726
659
|
|
|
727
|
-
|
|
660
|
+
/**
|
|
661
|
+
* Solana Token Program attributes, including more granular TransferChecked
|
|
662
|
+
* instruction fields.
|
|
663
|
+
*/
|
|
664
|
+
export interface SolanaTokenProgramInstructionCondition {
|
|
665
|
+
field:
|
|
666
|
+
| 'instructionName'
|
|
667
|
+
| 'Transfer.source'
|
|
668
|
+
| 'Transfer.destination'
|
|
669
|
+
| 'Transfer.authority'
|
|
670
|
+
| 'Transfer.amount'
|
|
671
|
+
| 'TransferChecked.source'
|
|
672
|
+
| 'TransferChecked.destination'
|
|
673
|
+
| 'TransferChecked.authority'
|
|
674
|
+
| 'TransferChecked.amount'
|
|
675
|
+
| 'TransferChecked.mint'
|
|
676
|
+
| 'Burn.account'
|
|
677
|
+
| 'Burn.mint'
|
|
678
|
+
| 'Burn.authority'
|
|
679
|
+
| 'Burn.amount'
|
|
680
|
+
| 'MintTo.mint'
|
|
681
|
+
| 'MintTo.account'
|
|
682
|
+
| 'MintTo.authority'
|
|
683
|
+
| 'MintTo.amount'
|
|
684
|
+
| 'CloseAccount.account'
|
|
685
|
+
| 'CloseAccount.destination'
|
|
686
|
+
| 'CloseAccount.authority'
|
|
687
|
+
| 'InitializeAccount3.account'
|
|
688
|
+
| 'InitializeAccount3.mint'
|
|
689
|
+
| 'InitializeAccount3.owner';
|
|
690
|
+
|
|
691
|
+
field_source: 'solana_token_program_instruction';
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Operator to use for policy conditions.
|
|
695
|
+
*/
|
|
696
|
+
operator: ConditionOperator;
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
700
|
+
* array of strings.
|
|
701
|
+
*/
|
|
702
|
+
value: ConditionValue;
|
|
703
|
+
}
|
|
728
704
|
|
|
729
|
-
|
|
705
|
+
/**
|
|
706
|
+
* System attributes, including current unix timestamp (in seconds).
|
|
707
|
+
*/
|
|
708
|
+
export interface SystemCondition {
|
|
709
|
+
field: 'current_unix_timestamp';
|
|
730
710
|
|
|
731
|
-
|
|
732
|
-
}
|
|
711
|
+
field_source: 'system';
|
|
733
712
|
|
|
734
713
|
/**
|
|
735
|
-
*
|
|
736
|
-
* instruction fields.
|
|
714
|
+
* Operator to use for policy conditions.
|
|
737
715
|
*/
|
|
738
|
-
|
|
739
|
-
field:
|
|
740
|
-
| 'instructionName'
|
|
741
|
-
| 'TransferChecked.source'
|
|
742
|
-
| 'TransferChecked.destination'
|
|
743
|
-
| 'TransferChecked.authority'
|
|
744
|
-
| 'TransferChecked.amount'
|
|
745
|
-
| 'TransferChecked.mint';
|
|
746
|
-
|
|
747
|
-
field_source: 'solana_token_program_instruction';
|
|
748
|
-
|
|
749
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
750
|
-
|
|
751
|
-
value: string | Array<string>;
|
|
752
|
-
}
|
|
716
|
+
operator: ConditionOperator;
|
|
753
717
|
|
|
754
718
|
/**
|
|
755
|
-
*
|
|
719
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
720
|
+
* array of strings.
|
|
756
721
|
*/
|
|
757
|
-
|
|
758
|
-
|
|
722
|
+
value: ConditionValue;
|
|
723
|
+
}
|
|
759
724
|
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
725
|
+
/**
|
|
726
|
+
* TRON transaction fields for TransferContract and TriggerSmartContract
|
|
727
|
+
* transaction types.
|
|
728
|
+
*/
|
|
729
|
+
export interface TronTransactionCondition {
|
|
730
|
+
/**
|
|
731
|
+
* Supported TRON transaction fields in format "TransactionType.field_name"
|
|
732
|
+
*/
|
|
733
|
+
field:
|
|
734
|
+
| 'TransferContract.to_address'
|
|
735
|
+
| 'TransferContract.amount'
|
|
736
|
+
| 'TriggerSmartContract.contract_address'
|
|
737
|
+
| 'TriggerSmartContract.call_value'
|
|
738
|
+
| 'TriggerSmartContract.token_id'
|
|
739
|
+
| 'TriggerSmartContract.call_token_value';
|
|
763
740
|
|
|
764
|
-
|
|
765
|
-
}
|
|
766
|
-
}
|
|
741
|
+
field_source: 'tron_transaction';
|
|
767
742
|
|
|
768
|
-
export interface PolicyDeleteResponse {
|
|
769
743
|
/**
|
|
770
|
-
*
|
|
744
|
+
* Operator to use for policy conditions.
|
|
771
745
|
*/
|
|
772
|
-
|
|
773
|
-
}
|
|
746
|
+
operator: ConditionOperator;
|
|
774
747
|
|
|
775
|
-
export interface PolicyDeleteRuleResponse {
|
|
776
748
|
/**
|
|
777
|
-
*
|
|
749
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
750
|
+
* array of strings.
|
|
778
751
|
*/
|
|
779
|
-
|
|
752
|
+
value: ConditionValue;
|
|
780
753
|
}
|
|
781
754
|
|
|
782
755
|
/**
|
|
783
|
-
*
|
|
784
|
-
* true.
|
|
756
|
+
* Decoded calldata from a TRON TriggerSmartContract interaction.
|
|
785
757
|
*/
|
|
786
|
-
export interface
|
|
787
|
-
id: string;
|
|
788
|
-
|
|
758
|
+
export interface TronCalldataCondition {
|
|
789
759
|
/**
|
|
790
|
-
*
|
|
760
|
+
* A Solidity ABI definition for decoding smart contract calldata.
|
|
791
761
|
*/
|
|
792
|
-
|
|
762
|
+
abi: AbiSchema;
|
|
763
|
+
|
|
764
|
+
field: string;
|
|
793
765
|
|
|
794
|
-
|
|
795
|
-
| PolicyUpdateRuleResponse.EthereumTransactionCondition
|
|
796
|
-
| PolicyUpdateRuleResponse.EthereumCalldataCondition
|
|
797
|
-
| PolicyUpdateRuleResponse.EthereumTypedDataDomainCondition
|
|
798
|
-
| PolicyUpdateRuleResponse.EthereumTypedDataMessageCondition
|
|
799
|
-
| PolicyUpdateRuleResponse.Ethereum7702AuthorizationCondition
|
|
800
|
-
| PolicyUpdateRuleResponse.SolanaProgramInstructionCondition
|
|
801
|
-
| PolicyUpdateRuleResponse.SolanaSystemProgramInstructionCondition
|
|
802
|
-
| PolicyUpdateRuleResponse.SolanaTokenProgramInstructionCondition
|
|
803
|
-
| PolicyUpdateRuleResponse.SystemCondition
|
|
804
|
-
| TronTransactionCondition
|
|
805
|
-
| SuiTransactionCommandCondition
|
|
806
|
-
| SuiTransferObjectsCommandCondition
|
|
807
|
-
>;
|
|
766
|
+
field_source: 'tron_trigger_smart_contract_data';
|
|
808
767
|
|
|
809
768
|
/**
|
|
810
|
-
*
|
|
769
|
+
* Operator to use for policy conditions.
|
|
811
770
|
*/
|
|
812
|
-
|
|
813
|
-
| 'eth_sendTransaction'
|
|
814
|
-
| 'eth_signTransaction'
|
|
815
|
-
| 'eth_signUserOperation'
|
|
816
|
-
| 'eth_signTypedData_v4'
|
|
817
|
-
| 'eth_sign7702Authorization'
|
|
818
|
-
| 'signTransaction'
|
|
819
|
-
| 'signAndSendTransaction'
|
|
820
|
-
| 'exportPrivateKey'
|
|
821
|
-
| 'signTransactionBytes'
|
|
822
|
-
| '*';
|
|
771
|
+
operator: ConditionOperator;
|
|
823
772
|
|
|
824
|
-
name: string;
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
export namespace PolicyUpdateRuleResponse {
|
|
828
773
|
/**
|
|
829
|
-
*
|
|
830
|
-
*
|
|
774
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
775
|
+
* array of strings.
|
|
831
776
|
*/
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
field_source: 'ethereum_transaction';
|
|
777
|
+
value: ConditionValue;
|
|
778
|
+
}
|
|
836
779
|
|
|
837
|
-
|
|
780
|
+
/**
|
|
781
|
+
* SUI transaction command attributes, enables allowlisting specific command types.
|
|
782
|
+
* Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and
|
|
783
|
+
* 'in' operators are supported.
|
|
784
|
+
*/
|
|
785
|
+
export interface SuiTransactionCommandCondition {
|
|
786
|
+
field: 'commandName';
|
|
838
787
|
|
|
839
|
-
|
|
840
|
-
}
|
|
788
|
+
field_source: 'sui_transaction_command';
|
|
841
789
|
|
|
842
790
|
/**
|
|
843
|
-
*
|
|
844
|
-
*
|
|
845
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
791
|
+
* Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
|
|
792
|
+
* supported for command names.
|
|
846
793
|
*/
|
|
847
|
-
|
|
848
|
-
abi: unknown;
|
|
849
|
-
|
|
850
|
-
field: string;
|
|
851
|
-
|
|
852
|
-
field_source: 'ethereum_calldata';
|
|
853
|
-
|
|
854
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
855
|
-
|
|
856
|
-
value: string | Array<string>;
|
|
857
|
-
}
|
|
794
|
+
operator: SuiTransactionCommandOperator;
|
|
858
795
|
|
|
859
796
|
/**
|
|
860
|
-
*
|
|
797
|
+
* Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins',
|
|
798
|
+
* 'MergeCoins'
|
|
861
799
|
*/
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
field_source: 'ethereum_typed_data_domain';
|
|
866
|
-
|
|
867
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
868
|
-
|
|
869
|
-
value: string | Array<string>;
|
|
870
|
-
}
|
|
800
|
+
value: WalletsAPI.SuiCommandName | Array<WalletsAPI.SuiCommandName>;
|
|
801
|
+
}
|
|
871
802
|
|
|
803
|
+
/**
|
|
804
|
+
* SUI TransferObjects command attributes, including recipient and amount fields.
|
|
805
|
+
*/
|
|
806
|
+
export interface SuiTransferObjectsCommandCondition {
|
|
872
807
|
/**
|
|
873
|
-
*
|
|
874
|
-
*
|
|
808
|
+
* Supported fields for SUI TransferObjects command conditions. Only 'recipient'
|
|
809
|
+
* and 'amount' are supported.
|
|
875
810
|
*/
|
|
876
|
-
|
|
877
|
-
field: string;
|
|
878
|
-
|
|
879
|
-
field_source: 'ethereum_typed_data_message';
|
|
880
|
-
|
|
881
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
882
|
-
|
|
883
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
884
|
-
|
|
885
|
-
value: string | Array<string>;
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
889
|
-
export interface TypedData {
|
|
890
|
-
primary_type: string;
|
|
891
|
-
|
|
892
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
893
|
-
}
|
|
894
|
-
|
|
895
|
-
export namespace TypedData {
|
|
896
|
-
export interface Type {
|
|
897
|
-
name: string;
|
|
811
|
+
field: SuiTransferObjectsCommandField;
|
|
898
812
|
|
|
899
|
-
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
}
|
|
813
|
+
field_source: 'sui_transfer_objects_command';
|
|
903
814
|
|
|
904
815
|
/**
|
|
905
|
-
*
|
|
816
|
+
* Operator to use for policy conditions.
|
|
906
817
|
*/
|
|
907
|
-
|
|
908
|
-
field: 'contract';
|
|
909
|
-
|
|
910
|
-
field_source: 'ethereum_7702_authorization';
|
|
911
|
-
|
|
912
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
913
|
-
|
|
914
|
-
value: string | Array<string>;
|
|
915
|
-
}
|
|
818
|
+
operator: ConditionOperator;
|
|
916
819
|
|
|
917
820
|
/**
|
|
918
|
-
*
|
|
821
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
822
|
+
* array of strings.
|
|
919
823
|
*/
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
field_source: 'solana_program_instruction';
|
|
824
|
+
value: ConditionValue;
|
|
825
|
+
}
|
|
924
826
|
|
|
925
|
-
|
|
827
|
+
/**
|
|
828
|
+
* Condition referencing an aggregation value. The field must start with
|
|
829
|
+
* "aggregation." followed by the aggregation ID.
|
|
830
|
+
*/
|
|
831
|
+
export interface AggregationCondition {
|
|
832
|
+
field: string;
|
|
926
833
|
|
|
927
|
-
|
|
928
|
-
}
|
|
834
|
+
field_source: 'reference';
|
|
929
835
|
|
|
930
836
|
/**
|
|
931
|
-
*
|
|
932
|
-
* fields.
|
|
837
|
+
* Operator to use for policy conditions.
|
|
933
838
|
*/
|
|
934
|
-
|
|
935
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
936
|
-
|
|
937
|
-
field_source: 'solana_system_program_instruction';
|
|
938
|
-
|
|
939
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
940
|
-
|
|
941
|
-
value: string | Array<string>;
|
|
942
|
-
}
|
|
839
|
+
operator: ConditionOperator;
|
|
943
840
|
|
|
944
841
|
/**
|
|
945
|
-
*
|
|
946
|
-
*
|
|
842
|
+
* Value to compare against in a policy condition. Can be a single string or an
|
|
843
|
+
* array of strings.
|
|
947
844
|
*/
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
| 'instructionName'
|
|
951
|
-
| 'TransferChecked.source'
|
|
952
|
-
| 'TransferChecked.destination'
|
|
953
|
-
| 'TransferChecked.authority'
|
|
954
|
-
| 'TransferChecked.amount'
|
|
955
|
-
| 'TransferChecked.mint';
|
|
956
|
-
|
|
957
|
-
field_source: 'solana_token_program_instruction';
|
|
845
|
+
value: ConditionValue;
|
|
846
|
+
}
|
|
958
847
|
|
|
959
|
-
|
|
848
|
+
/**
|
|
849
|
+
* A condition that must be true for the rule action to be applied.
|
|
850
|
+
*/
|
|
851
|
+
export type PolicyCondition =
|
|
852
|
+
| EthereumTransactionCondition
|
|
853
|
+
| EthereumCalldataCondition
|
|
854
|
+
| EthereumTypedDataDomainCondition
|
|
855
|
+
| EthereumTypedDataMessageCondition
|
|
856
|
+
| Ethereum7702AuthorizationCondition
|
|
857
|
+
| SolanaProgramInstructionCondition
|
|
858
|
+
| SolanaSystemProgramInstructionCondition
|
|
859
|
+
| SolanaTokenProgramInstructionCondition
|
|
860
|
+
| SystemCondition
|
|
861
|
+
| TronTransactionCondition
|
|
862
|
+
| TronCalldataCondition
|
|
863
|
+
| SuiTransactionCommandCondition
|
|
864
|
+
| SuiTransferObjectsCommandCondition
|
|
865
|
+
| AggregationCondition;
|
|
960
866
|
|
|
961
|
-
|
|
962
|
-
|
|
867
|
+
/**
|
|
868
|
+
* Method the rule applies to.
|
|
869
|
+
*/
|
|
870
|
+
export type PolicyMethod =
|
|
871
|
+
| 'eth_sendTransaction'
|
|
872
|
+
| 'eth_signTransaction'
|
|
873
|
+
| 'eth_signUserOperation'
|
|
874
|
+
| 'eth_signTypedData_v4'
|
|
875
|
+
| 'eth_sign7702Authorization'
|
|
876
|
+
| 'wallet_sendCalls'
|
|
877
|
+
| 'signTransaction'
|
|
878
|
+
| 'signAndSendTransaction'
|
|
879
|
+
| 'exportPrivateKey'
|
|
880
|
+
| 'exportSeedPhrase'
|
|
881
|
+
| 'signTransactionBytes'
|
|
882
|
+
| '*';
|
|
963
883
|
|
|
884
|
+
/**
|
|
885
|
+
* The rules that apply to each method the policy covers.
|
|
886
|
+
*/
|
|
887
|
+
export interface PolicyRuleRequestBody {
|
|
964
888
|
/**
|
|
965
|
-
*
|
|
889
|
+
* The action to take when a policy rule matches.
|
|
966
890
|
*/
|
|
967
|
-
|
|
968
|
-
field: 'current_unix_timestamp';
|
|
891
|
+
action: PolicyAction;
|
|
969
892
|
|
|
970
|
-
|
|
893
|
+
conditions: Array<PolicyCondition>;
|
|
971
894
|
|
|
972
|
-
|
|
895
|
+
/**
|
|
896
|
+
* Method the rule applies to.
|
|
897
|
+
*/
|
|
898
|
+
method: PolicyMethod;
|
|
973
899
|
|
|
974
|
-
|
|
975
|
-
}
|
|
900
|
+
name: string;
|
|
976
901
|
}
|
|
977
902
|
|
|
978
903
|
/**
|
|
979
904
|
* A rule that defines the conditions and action to take if the conditions are
|
|
980
905
|
* true.
|
|
981
906
|
*/
|
|
982
|
-
export interface
|
|
907
|
+
export interface PolicyRuleResponse {
|
|
983
908
|
id: string;
|
|
984
909
|
|
|
985
910
|
/**
|
|
986
|
-
*
|
|
911
|
+
* The action to take when a policy rule matches.
|
|
987
912
|
*/
|
|
988
|
-
action:
|
|
913
|
+
action: PolicyAction;
|
|
989
914
|
|
|
990
|
-
conditions: Array<
|
|
991
|
-
| PolicyGetRuleResponse.EthereumTransactionCondition
|
|
992
|
-
| PolicyGetRuleResponse.EthereumCalldataCondition
|
|
993
|
-
| PolicyGetRuleResponse.EthereumTypedDataDomainCondition
|
|
994
|
-
| PolicyGetRuleResponse.EthereumTypedDataMessageCondition
|
|
995
|
-
| PolicyGetRuleResponse.Ethereum7702AuthorizationCondition
|
|
996
|
-
| PolicyGetRuleResponse.SolanaProgramInstructionCondition
|
|
997
|
-
| PolicyGetRuleResponse.SolanaSystemProgramInstructionCondition
|
|
998
|
-
| PolicyGetRuleResponse.SolanaTokenProgramInstructionCondition
|
|
999
|
-
| PolicyGetRuleResponse.SystemCondition
|
|
1000
|
-
| TronTransactionCondition
|
|
1001
|
-
| SuiTransactionCommandCondition
|
|
1002
|
-
| SuiTransferObjectsCommandCondition
|
|
1003
|
-
>;
|
|
915
|
+
conditions: Array<PolicyCondition>;
|
|
1004
916
|
|
|
1005
917
|
/**
|
|
1006
918
|
* Method the rule applies to.
|
|
1007
919
|
*/
|
|
1008
|
-
method:
|
|
1009
|
-
| 'eth_sendTransaction'
|
|
1010
|
-
| 'eth_signTransaction'
|
|
1011
|
-
| 'eth_signUserOperation'
|
|
1012
|
-
| 'eth_signTypedData_v4'
|
|
1013
|
-
| 'eth_sign7702Authorization'
|
|
1014
|
-
| 'signTransaction'
|
|
1015
|
-
| 'signAndSendTransaction'
|
|
1016
|
-
| 'exportPrivateKey'
|
|
1017
|
-
| 'signTransactionBytes'
|
|
1018
|
-
| '*';
|
|
920
|
+
method: PolicyMethod;
|
|
1019
921
|
|
|
1020
922
|
name: string;
|
|
1021
923
|
}
|
|
1022
924
|
|
|
1023
|
-
|
|
925
|
+
/**
|
|
926
|
+
* A policy for controlling wallet operations.
|
|
927
|
+
*/
|
|
928
|
+
export interface Policy {
|
|
1024
929
|
/**
|
|
1025
|
-
*
|
|
1026
|
-
*
|
|
930
|
+
* Unique ID of the created policy. This will be the primary identifier when using
|
|
931
|
+
* the policy in the future.
|
|
1027
932
|
*/
|
|
1028
|
-
|
|
1029
|
-
field: 'to' | 'value' | 'chain_id';
|
|
1030
|
-
|
|
1031
|
-
field_source: 'ethereum_transaction';
|
|
1032
|
-
|
|
1033
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1034
|
-
|
|
1035
|
-
value: string | Array<string>;
|
|
1036
|
-
}
|
|
933
|
+
id: string;
|
|
1037
934
|
|
|
1038
935
|
/**
|
|
1039
|
-
* The
|
|
1040
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
1041
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
936
|
+
* The wallet chain types.
|
|
1042
937
|
*/
|
|
1043
|
-
|
|
1044
|
-
abi: unknown;
|
|
1045
|
-
|
|
1046
|
-
field: string;
|
|
1047
|
-
|
|
1048
|
-
field_source: 'ethereum_calldata';
|
|
1049
|
-
|
|
1050
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1051
|
-
|
|
1052
|
-
value: string | Array<string>;
|
|
1053
|
-
}
|
|
938
|
+
chain_type: WalletsAPI.WalletChainType;
|
|
1054
939
|
|
|
1055
940
|
/**
|
|
1056
|
-
*
|
|
941
|
+
* Unix timestamp of when the policy was created in milliseconds.
|
|
1057
942
|
*/
|
|
1058
|
-
|
|
1059
|
-
field: 'chainId' | 'verifyingContract';
|
|
1060
|
-
|
|
1061
|
-
field_source: 'ethereum_typed_data_domain';
|
|
1062
|
-
|
|
1063
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1064
|
-
|
|
1065
|
-
value: string | Array<string>;
|
|
1066
|
-
}
|
|
943
|
+
created_at: number;
|
|
1067
944
|
|
|
1068
945
|
/**
|
|
1069
|
-
*
|
|
1070
|
-
* EIP-712.
|
|
946
|
+
* Name to assign to policy.
|
|
1071
947
|
*/
|
|
1072
|
-
|
|
1073
|
-
field: string;
|
|
1074
|
-
|
|
1075
|
-
field_source: 'ethereum_typed_data_message';
|
|
1076
|
-
|
|
1077
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1078
|
-
|
|
1079
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
1080
|
-
|
|
1081
|
-
value: string | Array<string>;
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
1085
|
-
export interface TypedData {
|
|
1086
|
-
primary_type: string;
|
|
1087
|
-
|
|
1088
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
1089
|
-
}
|
|
1090
|
-
|
|
1091
|
-
export namespace TypedData {
|
|
1092
|
-
export interface Type {
|
|
1093
|
-
name: string;
|
|
1094
|
-
|
|
1095
|
-
type: string;
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
}
|
|
948
|
+
name: string;
|
|
1099
949
|
|
|
1100
950
|
/**
|
|
1101
|
-
*
|
|
951
|
+
* The key quorum ID of the owner of the policy.
|
|
1102
952
|
*/
|
|
1103
|
-
|
|
1104
|
-
field: 'contract';
|
|
1105
|
-
|
|
1106
|
-
field_source: 'ethereum_7702_authorization';
|
|
1107
|
-
|
|
1108
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
953
|
+
owner_id: string | null;
|
|
1109
954
|
|
|
1110
|
-
|
|
1111
|
-
}
|
|
955
|
+
rules: Array<PolicyRuleResponse>;
|
|
1112
956
|
|
|
1113
957
|
/**
|
|
1114
|
-
*
|
|
958
|
+
* Version of the policy. Currently, 1.0 is the only version.
|
|
1115
959
|
*/
|
|
1116
|
-
|
|
1117
|
-
|
|
960
|
+
version: '1.0';
|
|
961
|
+
}
|
|
1118
962
|
|
|
1119
|
-
|
|
963
|
+
/**
|
|
964
|
+
* Unique ID of the policy to take actions on.
|
|
965
|
+
*/
|
|
966
|
+
export interface PolicyRequestBody {
|
|
967
|
+
policy_id: string;
|
|
968
|
+
}
|
|
1120
969
|
|
|
1121
|
-
|
|
970
|
+
/**
|
|
971
|
+
* Unique IDs of the policy and the rule within the policy to take actions on.
|
|
972
|
+
*/
|
|
973
|
+
export interface PolicyRuleRequestParams {
|
|
974
|
+
policy_id: string;
|
|
1122
975
|
|
|
1123
|
-
|
|
1124
|
-
|
|
976
|
+
rule_id: string;
|
|
977
|
+
}
|
|
1125
978
|
|
|
979
|
+
/**
|
|
980
|
+
* Headers required to authorize modifications to policies.
|
|
981
|
+
*/
|
|
982
|
+
export interface PolicyAuthorizationHeaders {
|
|
1126
983
|
/**
|
|
1127
|
-
*
|
|
1128
|
-
* fields.
|
|
984
|
+
* ID of your Privy app.
|
|
1129
985
|
*/
|
|
1130
|
-
|
|
1131
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
1132
|
-
|
|
1133
|
-
field_source: 'solana_system_program_instruction';
|
|
1134
|
-
|
|
1135
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1136
|
-
|
|
1137
|
-
value: string | Array<string>;
|
|
1138
|
-
}
|
|
986
|
+
'privy-app-id': string;
|
|
1139
987
|
|
|
1140
988
|
/**
|
|
1141
|
-
*
|
|
1142
|
-
*
|
|
989
|
+
* Request authorization signature. If multiple signatures are required, they
|
|
990
|
+
* should be comma separated.
|
|
1143
991
|
*/
|
|
1144
|
-
|
|
1145
|
-
field:
|
|
1146
|
-
| 'instructionName'
|
|
1147
|
-
| 'TransferChecked.source'
|
|
1148
|
-
| 'TransferChecked.destination'
|
|
1149
|
-
| 'TransferChecked.authority'
|
|
1150
|
-
| 'TransferChecked.amount'
|
|
1151
|
-
| 'TransferChecked.mint';
|
|
1152
|
-
|
|
1153
|
-
field_source: 'solana_token_program_instruction';
|
|
1154
|
-
|
|
1155
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1156
|
-
|
|
1157
|
-
value: string | Array<string>;
|
|
1158
|
-
}
|
|
992
|
+
'privy-authorization-signature'?: string;
|
|
1159
993
|
|
|
1160
994
|
/**
|
|
1161
|
-
*
|
|
995
|
+
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
996
|
+
* deadline by which the request must be processed.
|
|
1162
997
|
*/
|
|
1163
|
-
|
|
1164
|
-
|
|
998
|
+
'privy-request-expiry'?: string;
|
|
999
|
+
}
|
|
1165
1000
|
|
|
1166
|
-
|
|
1001
|
+
/**
|
|
1002
|
+
* Headers required to authorize modifications to condition sets.
|
|
1003
|
+
*/
|
|
1004
|
+
export interface ConditionSetAuthorizationHeaders {
|
|
1005
|
+
/**
|
|
1006
|
+
* ID of your Privy app.
|
|
1007
|
+
*/
|
|
1008
|
+
'privy-app-id': string;
|
|
1167
1009
|
|
|
1168
|
-
|
|
1010
|
+
/**
|
|
1011
|
+
* Request authorization signature. If multiple signatures are required, they
|
|
1012
|
+
* should be comma separated.
|
|
1013
|
+
*/
|
|
1014
|
+
'privy-authorization-signature'?: string;
|
|
1169
1015
|
|
|
1170
|
-
|
|
1171
|
-
|
|
1016
|
+
/**
|
|
1017
|
+
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
1018
|
+
* deadline by which the request must be processed.
|
|
1019
|
+
*/
|
|
1020
|
+
'privy-request-expiry'?: string;
|
|
1172
1021
|
}
|
|
1173
1022
|
|
|
1174
1023
|
export interface PolicyCreateParams {
|
|
1175
1024
|
/**
|
|
1176
|
-
* Body param: The chain
|
|
1025
|
+
* Body param: The wallet chain types.
|
|
1177
1026
|
*/
|
|
1178
|
-
chain_type:
|
|
1027
|
+
chain_type: WalletsAPI.WalletChainType;
|
|
1179
1028
|
|
|
1180
1029
|
/**
|
|
1181
1030
|
* Body param: Name to assign to policy.
|
|
@@ -1193,16 +1042,16 @@ export interface PolicyCreateParams {
|
|
|
1193
1042
|
version: '1.0';
|
|
1194
1043
|
|
|
1195
1044
|
/**
|
|
1196
|
-
* Body param: The owner of the resource
|
|
1197
|
-
*
|
|
1198
|
-
* set the owner to null to remove the owner.
|
|
1045
|
+
* Body param: The owner of the resource, specified as a Privy user ID, a P-256
|
|
1046
|
+
* public key, or null to remove the current owner.
|
|
1199
1047
|
*/
|
|
1200
|
-
owner?:
|
|
1048
|
+
owner?: SharedAPI.OwnerInput | null;
|
|
1201
1049
|
|
|
1202
1050
|
/**
|
|
1203
|
-
* Body param
|
|
1051
|
+
* Body param: The key quorum ID to set as the owner of the resource. If you
|
|
1052
|
+
* provide this, do not specify an owner.
|
|
1204
1053
|
*/
|
|
1205
|
-
owner_id?:
|
|
1054
|
+
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
1206
1055
|
|
|
1207
1056
|
/**
|
|
1208
1057
|
* Header param: Idempotency keys ensure API requests are executed only once within
|
|
@@ -1212,256 +1061,40 @@ export interface PolicyCreateParams {
|
|
|
1212
1061
|
}
|
|
1213
1062
|
|
|
1214
1063
|
export namespace PolicyCreateParams {
|
|
1215
|
-
/**
|
|
1216
|
-
* The rules that apply to each method the policy covers.
|
|
1217
|
-
*/
|
|
1218
1064
|
export interface Rule {
|
|
1219
1065
|
/**
|
|
1220
|
-
*
|
|
1066
|
+
* The action to take when a policy rule matches.
|
|
1221
1067
|
*/
|
|
1222
|
-
action:
|
|
1223
|
-
|
|
1224
|
-
conditions: Array<
|
|
1225
|
-
| Rule.EthereumTransactionCondition
|
|
1226
|
-
| Rule.EthereumCalldataCondition
|
|
1227
|
-
| Rule.EthereumTypedDataDomainCondition
|
|
1228
|
-
| Rule.EthereumTypedDataMessageCondition
|
|
1229
|
-
| Rule.Ethereum7702AuthorizationCondition
|
|
1230
|
-
| Rule.SolanaProgramInstructionCondition
|
|
1231
|
-
| Rule.SolanaSystemProgramInstructionCondition
|
|
1232
|
-
| Rule.SolanaTokenProgramInstructionCondition
|
|
1233
|
-
| Rule.SystemCondition
|
|
1234
|
-
| PoliciesAPI.TronTransactionCondition
|
|
1235
|
-
| PoliciesAPI.SuiTransactionCommandCondition
|
|
1236
|
-
| PoliciesAPI.SuiTransferObjectsCommandCondition
|
|
1237
|
-
>;
|
|
1068
|
+
action: PoliciesAPI.PolicyAction;
|
|
1069
|
+
|
|
1070
|
+
conditions: Array<PoliciesAPI.PolicyCondition>;
|
|
1238
1071
|
|
|
1239
1072
|
/**
|
|
1240
1073
|
* Method the rule applies to.
|
|
1241
1074
|
*/
|
|
1242
|
-
method:
|
|
1243
|
-
| 'eth_sendTransaction'
|
|
1244
|
-
| 'eth_signTransaction'
|
|
1245
|
-
| 'eth_signUserOperation'
|
|
1246
|
-
| 'eth_signTypedData_v4'
|
|
1247
|
-
| 'eth_sign7702Authorization'
|
|
1248
|
-
| 'signTransaction'
|
|
1249
|
-
| 'signAndSendTransaction'
|
|
1250
|
-
| 'exportPrivateKey'
|
|
1251
|
-
| 'signTransactionBytes'
|
|
1252
|
-
| '*';
|
|
1075
|
+
method: PoliciesAPI.PolicyMethod;
|
|
1253
1076
|
|
|
1254
1077
|
name: string;
|
|
1255
|
-
}
|
|
1256
|
-
|
|
1257
|
-
export namespace Rule {
|
|
1258
|
-
/**
|
|
1259
|
-
* The verbatim Ethereum transaction object in an eth_signTransaction or
|
|
1260
|
-
* eth_sendTransaction request.
|
|
1261
|
-
*/
|
|
1262
|
-
export interface EthereumTransactionCondition {
|
|
1263
|
-
field: 'to' | 'value' | 'chain_id';
|
|
1264
|
-
|
|
1265
|
-
field_source: 'ethereum_transaction';
|
|
1266
|
-
|
|
1267
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1268
|
-
|
|
1269
|
-
value: string | Array<string>;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
/**
|
|
1273
|
-
* The decoded calldata in a smart contract interaction as the smart contract
|
|
1274
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
1275
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
1276
|
-
*/
|
|
1277
|
-
export interface EthereumCalldataCondition {
|
|
1278
|
-
abi: unknown;
|
|
1279
|
-
|
|
1280
|
-
field: string;
|
|
1281
|
-
|
|
1282
|
-
field_source: 'ethereum_calldata';
|
|
1283
|
-
|
|
1284
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1285
|
-
|
|
1286
|
-
value: string | Array<string>;
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
/**
|
|
1290
|
-
* Attributes from the signing domain that will verify the signature.
|
|
1291
|
-
*/
|
|
1292
|
-
export interface EthereumTypedDataDomainCondition {
|
|
1293
|
-
field: 'chainId' | 'verifyingContract';
|
|
1294
|
-
|
|
1295
|
-
field_source: 'ethereum_typed_data_domain';
|
|
1296
|
-
|
|
1297
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1298
|
-
|
|
1299
|
-
value: string | Array<string>;
|
|
1300
|
-
}
|
|
1301
|
-
|
|
1302
|
-
/**
|
|
1303
|
-
* 'types' and 'primary_type' attributes of the TypedData JSON object defined in
|
|
1304
|
-
* EIP-712.
|
|
1305
|
-
*/
|
|
1306
|
-
export interface EthereumTypedDataMessageCondition {
|
|
1307
|
-
field: string;
|
|
1308
|
-
|
|
1309
|
-
field_source: 'ethereum_typed_data_message';
|
|
1310
|
-
|
|
1311
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1312
|
-
|
|
1313
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
1314
|
-
|
|
1315
|
-
value: string | Array<string>;
|
|
1316
|
-
}
|
|
1317
|
-
|
|
1318
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
1319
|
-
export interface TypedData {
|
|
1320
|
-
primary_type: string;
|
|
1321
|
-
|
|
1322
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
export namespace TypedData {
|
|
1326
|
-
export interface Type {
|
|
1327
|
-
name: string;
|
|
1328
|
-
|
|
1329
|
-
type: string;
|
|
1330
|
-
}
|
|
1331
|
-
}
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
* Allowed contract addresses for eth_sign7702Authorization requests.
|
|
1336
|
-
*/
|
|
1337
|
-
export interface Ethereum7702AuthorizationCondition {
|
|
1338
|
-
field: 'contract';
|
|
1339
|
-
|
|
1340
|
-
field_source: 'ethereum_7702_authorization';
|
|
1341
|
-
|
|
1342
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1343
|
-
|
|
1344
|
-
value: string | Array<string>;
|
|
1345
|
-
}
|
|
1346
|
-
|
|
1347
|
-
/**
|
|
1348
|
-
* Solana Program attributes, enables allowlisting Solana Programs.
|
|
1349
|
-
*/
|
|
1350
|
-
export interface SolanaProgramInstructionCondition {
|
|
1351
|
-
field: 'programId';
|
|
1352
|
-
|
|
1353
|
-
field_source: 'solana_program_instruction';
|
|
1354
|
-
|
|
1355
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1356
|
-
|
|
1357
|
-
value: string | Array<string>;
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
/**
|
|
1361
|
-
* Solana System Program attributes, including more granular Transfer instruction
|
|
1362
|
-
* fields.
|
|
1363
|
-
*/
|
|
1364
|
-
export interface SolanaSystemProgramInstructionCondition {
|
|
1365
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
1366
|
-
|
|
1367
|
-
field_source: 'solana_system_program_instruction';
|
|
1368
|
-
|
|
1369
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1370
|
-
|
|
1371
|
-
value: string | Array<string>;
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
/**
|
|
1375
|
-
* Solana Token Program attributes, including more granular TransferChecked
|
|
1376
|
-
* instruction fields.
|
|
1377
|
-
*/
|
|
1378
|
-
export interface SolanaTokenProgramInstructionCondition {
|
|
1379
|
-
field:
|
|
1380
|
-
| 'instructionName'
|
|
1381
|
-
| 'TransferChecked.source'
|
|
1382
|
-
| 'TransferChecked.destination'
|
|
1383
|
-
| 'TransferChecked.authority'
|
|
1384
|
-
| 'TransferChecked.amount'
|
|
1385
|
-
| 'TransferChecked.mint';
|
|
1386
|
-
|
|
1387
|
-
field_source: 'solana_token_program_instruction';
|
|
1388
|
-
|
|
1389
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1390
|
-
|
|
1391
|
-
value: string | Array<string>;
|
|
1392
|
-
}
|
|
1393
1078
|
|
|
1394
|
-
|
|
1395
|
-
* System attributes, including current unix timestamp (in seconds).
|
|
1396
|
-
*/
|
|
1397
|
-
export interface SystemCondition {
|
|
1398
|
-
field: 'current_unix_timestamp';
|
|
1399
|
-
|
|
1400
|
-
field_source: 'system';
|
|
1401
|
-
|
|
1402
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1403
|
-
|
|
1404
|
-
value: string | Array<string>;
|
|
1405
|
-
}
|
|
1406
|
-
}
|
|
1407
|
-
|
|
1408
|
-
/**
|
|
1409
|
-
* The P-256 public key of the owner of the resource, in base64-encoded DER format.
|
|
1410
|
-
* If you provide this, do not specify an owner_id as it will be generated
|
|
1411
|
-
* automatically.
|
|
1412
|
-
*/
|
|
1413
|
-
export interface PublicKeyOwner {
|
|
1414
|
-
public_key: string;
|
|
1415
|
-
}
|
|
1416
|
-
|
|
1417
|
-
/**
|
|
1418
|
-
* The user ID of the owner of the resource. The user must already exist, and this
|
|
1419
|
-
* value must start with "did:privy:". If you provide this, do not specify an
|
|
1420
|
-
* owner_id as it will be generated automatically.
|
|
1421
|
-
*/
|
|
1422
|
-
export interface UserOwner {
|
|
1423
|
-
user_id: string;
|
|
1079
|
+
id?: string;
|
|
1424
1080
|
}
|
|
1425
1081
|
}
|
|
1426
1082
|
|
|
1427
1083
|
export interface PolicyCreateRuleParams {
|
|
1428
1084
|
/**
|
|
1429
|
-
* Body param:
|
|
1085
|
+
* Body param: The action to take when a policy rule matches.
|
|
1430
1086
|
*/
|
|
1431
|
-
action:
|
|
1087
|
+
action: PolicyAction;
|
|
1432
1088
|
|
|
1433
1089
|
/**
|
|
1434
1090
|
* Body param
|
|
1435
1091
|
*/
|
|
1436
|
-
conditions: Array<
|
|
1437
|
-
| PolicyCreateRuleParams.EthereumTransactionCondition
|
|
1438
|
-
| PolicyCreateRuleParams.EthereumCalldataCondition
|
|
1439
|
-
| PolicyCreateRuleParams.EthereumTypedDataDomainCondition
|
|
1440
|
-
| PolicyCreateRuleParams.EthereumTypedDataMessageCondition
|
|
1441
|
-
| PolicyCreateRuleParams.Ethereum7702AuthorizationCondition
|
|
1442
|
-
| PolicyCreateRuleParams.SolanaProgramInstructionCondition
|
|
1443
|
-
| PolicyCreateRuleParams.SolanaSystemProgramInstructionCondition
|
|
1444
|
-
| PolicyCreateRuleParams.SolanaTokenProgramInstructionCondition
|
|
1445
|
-
| PolicyCreateRuleParams.SystemCondition
|
|
1446
|
-
| TronTransactionCondition
|
|
1447
|
-
| SuiTransactionCommandCondition
|
|
1448
|
-
| SuiTransferObjectsCommandCondition
|
|
1449
|
-
>;
|
|
1092
|
+
conditions: Array<PolicyCondition>;
|
|
1450
1093
|
|
|
1451
1094
|
/**
|
|
1452
1095
|
* Body param: Method the rule applies to.
|
|
1453
1096
|
*/
|
|
1454
|
-
method:
|
|
1455
|
-
| 'eth_sendTransaction'
|
|
1456
|
-
| 'eth_signTransaction'
|
|
1457
|
-
| 'eth_signUserOperation'
|
|
1458
|
-
| 'eth_signTypedData_v4'
|
|
1459
|
-
| 'eth_sign7702Authorization'
|
|
1460
|
-
| 'signTransaction'
|
|
1461
|
-
| 'signAndSendTransaction'
|
|
1462
|
-
| 'exportPrivateKey'
|
|
1463
|
-
| 'signTransactionBytes'
|
|
1464
|
-
| '*';
|
|
1097
|
+
method: PolicyMethod;
|
|
1465
1098
|
|
|
1466
1099
|
/**
|
|
1467
1100
|
* Body param
|
|
@@ -1473,157 +1106,12 @@ export interface PolicyCreateRuleParams {
|
|
|
1473
1106
|
* required, they should be comma separated.
|
|
1474
1107
|
*/
|
|
1475
1108
|
'privy-authorization-signature'?: string;
|
|
1476
|
-
}
|
|
1477
|
-
|
|
1478
|
-
export namespace PolicyCreateRuleParams {
|
|
1479
|
-
/**
|
|
1480
|
-
* The verbatim Ethereum transaction object in an eth_signTransaction or
|
|
1481
|
-
* eth_sendTransaction request.
|
|
1482
|
-
*/
|
|
1483
|
-
export interface EthereumTransactionCondition {
|
|
1484
|
-
field: 'to' | 'value' | 'chain_id';
|
|
1485
|
-
|
|
1486
|
-
field_source: 'ethereum_transaction';
|
|
1487
|
-
|
|
1488
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1489
|
-
|
|
1490
|
-
value: string | Array<string>;
|
|
1491
|
-
}
|
|
1492
|
-
|
|
1493
|
-
/**
|
|
1494
|
-
* The decoded calldata in a smart contract interaction as the smart contract
|
|
1495
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
1496
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
1497
|
-
*/
|
|
1498
|
-
export interface EthereumCalldataCondition {
|
|
1499
|
-
abi: unknown;
|
|
1500
|
-
|
|
1501
|
-
field: string;
|
|
1502
|
-
|
|
1503
|
-
field_source: 'ethereum_calldata';
|
|
1504
|
-
|
|
1505
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1506
|
-
|
|
1507
|
-
value: string | Array<string>;
|
|
1508
|
-
}
|
|
1509
|
-
|
|
1510
|
-
/**
|
|
1511
|
-
* Attributes from the signing domain that will verify the signature.
|
|
1512
|
-
*/
|
|
1513
|
-
export interface EthereumTypedDataDomainCondition {
|
|
1514
|
-
field: 'chainId' | 'verifyingContract';
|
|
1515
|
-
|
|
1516
|
-
field_source: 'ethereum_typed_data_domain';
|
|
1517
|
-
|
|
1518
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1519
|
-
|
|
1520
|
-
value: string | Array<string>;
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
/**
|
|
1524
|
-
* 'types' and 'primary_type' attributes of the TypedData JSON object defined in
|
|
1525
|
-
* EIP-712.
|
|
1526
|
-
*/
|
|
1527
|
-
export interface EthereumTypedDataMessageCondition {
|
|
1528
|
-
field: string;
|
|
1529
|
-
|
|
1530
|
-
field_source: 'ethereum_typed_data_message';
|
|
1531
|
-
|
|
1532
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1533
|
-
|
|
1534
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
1535
|
-
|
|
1536
|
-
value: string | Array<string>;
|
|
1537
|
-
}
|
|
1538
|
-
|
|
1539
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
1540
|
-
export interface TypedData {
|
|
1541
|
-
primary_type: string;
|
|
1542
|
-
|
|
1543
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
1544
|
-
}
|
|
1545
|
-
|
|
1546
|
-
export namespace TypedData {
|
|
1547
|
-
export interface Type {
|
|
1548
|
-
name: string;
|
|
1549
|
-
|
|
1550
|
-
type: string;
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
}
|
|
1554
|
-
|
|
1555
|
-
/**
|
|
1556
|
-
* Allowed contract addresses for eth_sign7702Authorization requests.
|
|
1557
|
-
*/
|
|
1558
|
-
export interface Ethereum7702AuthorizationCondition {
|
|
1559
|
-
field: 'contract';
|
|
1560
|
-
|
|
1561
|
-
field_source: 'ethereum_7702_authorization';
|
|
1562
|
-
|
|
1563
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1564
|
-
|
|
1565
|
-
value: string | Array<string>;
|
|
1566
|
-
}
|
|
1567
|
-
|
|
1568
|
-
/**
|
|
1569
|
-
* Solana Program attributes, enables allowlisting Solana Programs.
|
|
1570
|
-
*/
|
|
1571
|
-
export interface SolanaProgramInstructionCondition {
|
|
1572
|
-
field: 'programId';
|
|
1573
|
-
|
|
1574
|
-
field_source: 'solana_program_instruction';
|
|
1575
|
-
|
|
1576
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1577
|
-
|
|
1578
|
-
value: string | Array<string>;
|
|
1579
|
-
}
|
|
1580
|
-
|
|
1581
|
-
/**
|
|
1582
|
-
* Solana System Program attributes, including more granular Transfer instruction
|
|
1583
|
-
* fields.
|
|
1584
|
-
*/
|
|
1585
|
-
export interface SolanaSystemProgramInstructionCondition {
|
|
1586
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
1587
|
-
|
|
1588
|
-
field_source: 'solana_system_program_instruction';
|
|
1589
|
-
|
|
1590
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1591
|
-
|
|
1592
|
-
value: string | Array<string>;
|
|
1593
|
-
}
|
|
1594
|
-
|
|
1595
|
-
/**
|
|
1596
|
-
* Solana Token Program attributes, including more granular TransferChecked
|
|
1597
|
-
* instruction fields.
|
|
1598
|
-
*/
|
|
1599
|
-
export interface SolanaTokenProgramInstructionCondition {
|
|
1600
|
-
field:
|
|
1601
|
-
| 'instructionName'
|
|
1602
|
-
| 'TransferChecked.source'
|
|
1603
|
-
| 'TransferChecked.destination'
|
|
1604
|
-
| 'TransferChecked.authority'
|
|
1605
|
-
| 'TransferChecked.amount'
|
|
1606
|
-
| 'TransferChecked.mint';
|
|
1607
|
-
|
|
1608
|
-
field_source: 'solana_token_program_instruction';
|
|
1609
|
-
|
|
1610
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1611
|
-
|
|
1612
|
-
value: string | Array<string>;
|
|
1613
|
-
}
|
|
1614
1109
|
|
|
1615
1110
|
/**
|
|
1616
|
-
*
|
|
1111
|
+
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1112
|
+
* representing the deadline by which the request must be processed.
|
|
1617
1113
|
*/
|
|
1618
|
-
|
|
1619
|
-
field: 'current_unix_timestamp';
|
|
1620
|
-
|
|
1621
|
-
field_source: 'system';
|
|
1622
|
-
|
|
1623
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1624
|
-
|
|
1625
|
-
value: string | Array<string>;
|
|
1626
|
-
}
|
|
1114
|
+
'privy-request-expiry'?: string;
|
|
1627
1115
|
}
|
|
1628
1116
|
|
|
1629
1117
|
export interface PolicyDeleteParams {
|
|
@@ -1632,6 +1120,12 @@ export interface PolicyDeleteParams {
|
|
|
1632
1120
|
* should be comma separated.
|
|
1633
1121
|
*/
|
|
1634
1122
|
'privy-authorization-signature'?: string;
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* Request expiry. Value is a Unix timestamp in milliseconds representing the
|
|
1126
|
+
* deadline by which the request must be processed.
|
|
1127
|
+
*/
|
|
1128
|
+
'privy-request-expiry'?: string;
|
|
1635
1129
|
}
|
|
1636
1130
|
|
|
1637
1131
|
export interface PolicyDeleteRuleParams {
|
|
@@ -1645,6 +1139,12 @@ export interface PolicyDeleteRuleParams {
|
|
|
1645
1139
|
* required, they should be comma separated.
|
|
1646
1140
|
*/
|
|
1647
1141
|
'privy-authorization-signature'?: string;
|
|
1142
|
+
|
|
1143
|
+
/**
|
|
1144
|
+
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1145
|
+
* representing the deadline by which the request must be processed.
|
|
1146
|
+
*/
|
|
1147
|
+
'privy-request-expiry'?: string;
|
|
1648
1148
|
}
|
|
1649
1149
|
|
|
1650
1150
|
export interface PolicyUpdateParams {
|
|
@@ -1654,240 +1154,33 @@ export interface PolicyUpdateParams {
|
|
|
1654
1154
|
name?: string;
|
|
1655
1155
|
|
|
1656
1156
|
/**
|
|
1657
|
-
* Body param: The owner of the resource
|
|
1658
|
-
*
|
|
1659
|
-
* set the owner to null to remove the owner.
|
|
1157
|
+
* Body param: The owner of the resource, specified as a Privy user ID, a P-256
|
|
1158
|
+
* public key, or null to remove the current owner.
|
|
1660
1159
|
*/
|
|
1661
|
-
owner?:
|
|
1160
|
+
owner?: SharedAPI.OwnerInput | null;
|
|
1662
1161
|
|
|
1663
1162
|
/**
|
|
1664
|
-
* Body param
|
|
1163
|
+
* Body param: The key quorum ID to set as the owner of the resource. If you
|
|
1164
|
+
* provide this, do not specify an owner.
|
|
1665
1165
|
*/
|
|
1666
|
-
owner_id?:
|
|
1166
|
+
owner_id?: SharedAPI.OwnerIDInput | null;
|
|
1667
1167
|
|
|
1668
1168
|
/**
|
|
1669
1169
|
* Body param
|
|
1670
1170
|
*/
|
|
1671
|
-
rules?: Array<
|
|
1171
|
+
rules?: Array<PolicyRuleRequestBody>;
|
|
1672
1172
|
|
|
1673
1173
|
/**
|
|
1674
1174
|
* Header param: Request authorization signature. If multiple signatures are
|
|
1675
1175
|
* required, they should be comma separated.
|
|
1676
1176
|
*/
|
|
1677
1177
|
'privy-authorization-signature'?: string;
|
|
1678
|
-
}
|
|
1679
1178
|
|
|
1680
|
-
export namespace PolicyUpdateParams {
|
|
1681
1179
|
/**
|
|
1682
|
-
*
|
|
1683
|
-
*
|
|
1684
|
-
* automatically.
|
|
1180
|
+
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1181
|
+
* representing the deadline by which the request must be processed.
|
|
1685
1182
|
*/
|
|
1686
|
-
|
|
1687
|
-
public_key: string;
|
|
1688
|
-
}
|
|
1689
|
-
|
|
1690
|
-
/**
|
|
1691
|
-
* The user ID of the owner of the resource. The user must already exist, and this
|
|
1692
|
-
* value must start with "did:privy:". If you provide this, do not specify an
|
|
1693
|
-
* owner_id as it will be generated automatically.
|
|
1694
|
-
*/
|
|
1695
|
-
export interface UserOwner {
|
|
1696
|
-
user_id: string;
|
|
1697
|
-
}
|
|
1698
|
-
|
|
1699
|
-
/**
|
|
1700
|
-
* The rules that apply to each method the policy covers.
|
|
1701
|
-
*/
|
|
1702
|
-
export interface Rule {
|
|
1703
|
-
/**
|
|
1704
|
-
* Action to take if the conditions are true.
|
|
1705
|
-
*/
|
|
1706
|
-
action: 'ALLOW' | 'DENY';
|
|
1707
|
-
|
|
1708
|
-
conditions: Array<
|
|
1709
|
-
| Rule.EthereumTransactionCondition
|
|
1710
|
-
| Rule.EthereumCalldataCondition
|
|
1711
|
-
| Rule.EthereumTypedDataDomainCondition
|
|
1712
|
-
| Rule.EthereumTypedDataMessageCondition
|
|
1713
|
-
| Rule.Ethereum7702AuthorizationCondition
|
|
1714
|
-
| Rule.SolanaProgramInstructionCondition
|
|
1715
|
-
| Rule.SolanaSystemProgramInstructionCondition
|
|
1716
|
-
| Rule.SolanaTokenProgramInstructionCondition
|
|
1717
|
-
| Rule.SystemCondition
|
|
1718
|
-
| PoliciesAPI.TronTransactionCondition
|
|
1719
|
-
| PoliciesAPI.SuiTransactionCommandCondition
|
|
1720
|
-
| PoliciesAPI.SuiTransferObjectsCommandCondition
|
|
1721
|
-
>;
|
|
1722
|
-
|
|
1723
|
-
/**
|
|
1724
|
-
* Method the rule applies to.
|
|
1725
|
-
*/
|
|
1726
|
-
method:
|
|
1727
|
-
| 'eth_sendTransaction'
|
|
1728
|
-
| 'eth_signTransaction'
|
|
1729
|
-
| 'eth_signUserOperation'
|
|
1730
|
-
| 'eth_signTypedData_v4'
|
|
1731
|
-
| 'eth_sign7702Authorization'
|
|
1732
|
-
| 'signTransaction'
|
|
1733
|
-
| 'signAndSendTransaction'
|
|
1734
|
-
| 'exportPrivateKey'
|
|
1735
|
-
| 'signTransactionBytes'
|
|
1736
|
-
| '*';
|
|
1737
|
-
|
|
1738
|
-
name: string;
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
|
-
export namespace Rule {
|
|
1742
|
-
/**
|
|
1743
|
-
* The verbatim Ethereum transaction object in an eth_signTransaction or
|
|
1744
|
-
* eth_sendTransaction request.
|
|
1745
|
-
*/
|
|
1746
|
-
export interface EthereumTransactionCondition {
|
|
1747
|
-
field: 'to' | 'value' | 'chain_id';
|
|
1748
|
-
|
|
1749
|
-
field_source: 'ethereum_transaction';
|
|
1750
|
-
|
|
1751
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1752
|
-
|
|
1753
|
-
value: string | Array<string>;
|
|
1754
|
-
}
|
|
1755
|
-
|
|
1756
|
-
/**
|
|
1757
|
-
* The decoded calldata in a smart contract interaction as the smart contract
|
|
1758
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
1759
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
1760
|
-
*/
|
|
1761
|
-
export interface EthereumCalldataCondition {
|
|
1762
|
-
abi: unknown;
|
|
1763
|
-
|
|
1764
|
-
field: string;
|
|
1765
|
-
|
|
1766
|
-
field_source: 'ethereum_calldata';
|
|
1767
|
-
|
|
1768
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1769
|
-
|
|
1770
|
-
value: string | Array<string>;
|
|
1771
|
-
}
|
|
1772
|
-
|
|
1773
|
-
/**
|
|
1774
|
-
* Attributes from the signing domain that will verify the signature.
|
|
1775
|
-
*/
|
|
1776
|
-
export interface EthereumTypedDataDomainCondition {
|
|
1777
|
-
field: 'chainId' | 'verifyingContract';
|
|
1778
|
-
|
|
1779
|
-
field_source: 'ethereum_typed_data_domain';
|
|
1780
|
-
|
|
1781
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1782
|
-
|
|
1783
|
-
value: string | Array<string>;
|
|
1784
|
-
}
|
|
1785
|
-
|
|
1786
|
-
/**
|
|
1787
|
-
* 'types' and 'primary_type' attributes of the TypedData JSON object defined in
|
|
1788
|
-
* EIP-712.
|
|
1789
|
-
*/
|
|
1790
|
-
export interface EthereumTypedDataMessageCondition {
|
|
1791
|
-
field: string;
|
|
1792
|
-
|
|
1793
|
-
field_source: 'ethereum_typed_data_message';
|
|
1794
|
-
|
|
1795
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1796
|
-
|
|
1797
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
1798
|
-
|
|
1799
|
-
value: string | Array<string>;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
1803
|
-
export interface TypedData {
|
|
1804
|
-
primary_type: string;
|
|
1805
|
-
|
|
1806
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1809
|
-
export namespace TypedData {
|
|
1810
|
-
export interface Type {
|
|
1811
|
-
name: string;
|
|
1812
|
-
|
|
1813
|
-
type: string;
|
|
1814
|
-
}
|
|
1815
|
-
}
|
|
1816
|
-
}
|
|
1817
|
-
|
|
1818
|
-
/**
|
|
1819
|
-
* Allowed contract addresses for eth_sign7702Authorization requests.
|
|
1820
|
-
*/
|
|
1821
|
-
export interface Ethereum7702AuthorizationCondition {
|
|
1822
|
-
field: 'contract';
|
|
1823
|
-
|
|
1824
|
-
field_source: 'ethereum_7702_authorization';
|
|
1825
|
-
|
|
1826
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1827
|
-
|
|
1828
|
-
value: string | Array<string>;
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
/**
|
|
1832
|
-
* Solana Program attributes, enables allowlisting Solana Programs.
|
|
1833
|
-
*/
|
|
1834
|
-
export interface SolanaProgramInstructionCondition {
|
|
1835
|
-
field: 'programId';
|
|
1836
|
-
|
|
1837
|
-
field_source: 'solana_program_instruction';
|
|
1838
|
-
|
|
1839
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1840
|
-
|
|
1841
|
-
value: string | Array<string>;
|
|
1842
|
-
}
|
|
1843
|
-
|
|
1844
|
-
/**
|
|
1845
|
-
* Solana System Program attributes, including more granular Transfer instruction
|
|
1846
|
-
* fields.
|
|
1847
|
-
*/
|
|
1848
|
-
export interface SolanaSystemProgramInstructionCondition {
|
|
1849
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
1850
|
-
|
|
1851
|
-
field_source: 'solana_system_program_instruction';
|
|
1852
|
-
|
|
1853
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1854
|
-
|
|
1855
|
-
value: string | Array<string>;
|
|
1856
|
-
}
|
|
1857
|
-
|
|
1858
|
-
/**
|
|
1859
|
-
* Solana Token Program attributes, including more granular TransferChecked
|
|
1860
|
-
* instruction fields.
|
|
1861
|
-
*/
|
|
1862
|
-
export interface SolanaTokenProgramInstructionCondition {
|
|
1863
|
-
field:
|
|
1864
|
-
| 'instructionName'
|
|
1865
|
-
| 'TransferChecked.source'
|
|
1866
|
-
| 'TransferChecked.destination'
|
|
1867
|
-
| 'TransferChecked.authority'
|
|
1868
|
-
| 'TransferChecked.amount'
|
|
1869
|
-
| 'TransferChecked.mint';
|
|
1870
|
-
|
|
1871
|
-
field_source: 'solana_token_program_instruction';
|
|
1872
|
-
|
|
1873
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1874
|
-
|
|
1875
|
-
value: string | Array<string>;
|
|
1876
|
-
}
|
|
1877
|
-
|
|
1878
|
-
/**
|
|
1879
|
-
* System attributes, including current unix timestamp (in seconds).
|
|
1880
|
-
*/
|
|
1881
|
-
export interface SystemCondition {
|
|
1882
|
-
field: 'current_unix_timestamp';
|
|
1883
|
-
|
|
1884
|
-
field_source: 'system';
|
|
1885
|
-
|
|
1886
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1887
|
-
|
|
1888
|
-
value: string | Array<string>;
|
|
1889
|
-
}
|
|
1890
|
-
}
|
|
1183
|
+
'privy-request-expiry'?: string;
|
|
1891
1184
|
}
|
|
1892
1185
|
|
|
1893
1186
|
export interface PolicyUpdateRuleParams {
|
|
@@ -1897,42 +1190,19 @@ export interface PolicyUpdateRuleParams {
|
|
|
1897
1190
|
policy_id: string;
|
|
1898
1191
|
|
|
1899
1192
|
/**
|
|
1900
|
-
* Body param:
|
|
1193
|
+
* Body param: The action to take when a policy rule matches.
|
|
1901
1194
|
*/
|
|
1902
|
-
action:
|
|
1195
|
+
action: PolicyAction;
|
|
1903
1196
|
|
|
1904
1197
|
/**
|
|
1905
1198
|
* Body param
|
|
1906
1199
|
*/
|
|
1907
|
-
conditions: Array<
|
|
1908
|
-
| PolicyUpdateRuleParams.EthereumTransactionCondition
|
|
1909
|
-
| PolicyUpdateRuleParams.EthereumCalldataCondition
|
|
1910
|
-
| PolicyUpdateRuleParams.EthereumTypedDataDomainCondition
|
|
1911
|
-
| PolicyUpdateRuleParams.EthereumTypedDataMessageCondition
|
|
1912
|
-
| PolicyUpdateRuleParams.Ethereum7702AuthorizationCondition
|
|
1913
|
-
| PolicyUpdateRuleParams.SolanaProgramInstructionCondition
|
|
1914
|
-
| PolicyUpdateRuleParams.SolanaSystemProgramInstructionCondition
|
|
1915
|
-
| PolicyUpdateRuleParams.SolanaTokenProgramInstructionCondition
|
|
1916
|
-
| PolicyUpdateRuleParams.SystemCondition
|
|
1917
|
-
| TronTransactionCondition
|
|
1918
|
-
| SuiTransactionCommandCondition
|
|
1919
|
-
| SuiTransferObjectsCommandCondition
|
|
1920
|
-
>;
|
|
1200
|
+
conditions: Array<PolicyCondition>;
|
|
1921
1201
|
|
|
1922
1202
|
/**
|
|
1923
1203
|
* Body param: Method the rule applies to.
|
|
1924
1204
|
*/
|
|
1925
|
-
method:
|
|
1926
|
-
| 'eth_sendTransaction'
|
|
1927
|
-
| 'eth_signTransaction'
|
|
1928
|
-
| 'eth_signUserOperation'
|
|
1929
|
-
| 'eth_signTypedData_v4'
|
|
1930
|
-
| 'eth_sign7702Authorization'
|
|
1931
|
-
| 'signTransaction'
|
|
1932
|
-
| 'signAndSendTransaction'
|
|
1933
|
-
| 'exportPrivateKey'
|
|
1934
|
-
| 'signTransactionBytes'
|
|
1935
|
-
| '*';
|
|
1205
|
+
method: PolicyMethod;
|
|
1936
1206
|
|
|
1937
1207
|
/**
|
|
1938
1208
|
* Body param
|
|
@@ -1944,157 +1214,12 @@ export interface PolicyUpdateRuleParams {
|
|
|
1944
1214
|
* required, they should be comma separated.
|
|
1945
1215
|
*/
|
|
1946
1216
|
'privy-authorization-signature'?: string;
|
|
1947
|
-
}
|
|
1948
|
-
|
|
1949
|
-
export namespace PolicyUpdateRuleParams {
|
|
1950
|
-
/**
|
|
1951
|
-
* The verbatim Ethereum transaction object in an eth_signTransaction or
|
|
1952
|
-
* eth_sendTransaction request.
|
|
1953
|
-
*/
|
|
1954
|
-
export interface EthereumTransactionCondition {
|
|
1955
|
-
field: 'to' | 'value' | 'chain_id';
|
|
1956
|
-
|
|
1957
|
-
field_source: 'ethereum_transaction';
|
|
1958
|
-
|
|
1959
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1960
|
-
|
|
1961
|
-
value: string | Array<string>;
|
|
1962
|
-
}
|
|
1963
|
-
|
|
1964
|
-
/**
|
|
1965
|
-
* The decoded calldata in a smart contract interaction as the smart contract
|
|
1966
|
-
* method's parameters. Note that that 'ethereum_calldata' conditions must contain
|
|
1967
|
-
* an abi parameter with the JSON ABI of the smart contract.
|
|
1968
|
-
*/
|
|
1969
|
-
export interface EthereumCalldataCondition {
|
|
1970
|
-
abi: unknown;
|
|
1971
|
-
|
|
1972
|
-
field: string;
|
|
1973
|
-
|
|
1974
|
-
field_source: 'ethereum_calldata';
|
|
1975
|
-
|
|
1976
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1977
|
-
|
|
1978
|
-
value: string | Array<string>;
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1981
|
-
/**
|
|
1982
|
-
* Attributes from the signing domain that will verify the signature.
|
|
1983
|
-
*/
|
|
1984
|
-
export interface EthereumTypedDataDomainCondition {
|
|
1985
|
-
field: 'chainId' | 'verifyingContract';
|
|
1986
|
-
|
|
1987
|
-
field_source: 'ethereum_typed_data_domain';
|
|
1988
|
-
|
|
1989
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
1990
|
-
|
|
1991
|
-
value: string | Array<string>;
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
/**
|
|
1995
|
-
* 'types' and 'primary_type' attributes of the TypedData JSON object defined in
|
|
1996
|
-
* EIP-712.
|
|
1997
|
-
*/
|
|
1998
|
-
export interface EthereumTypedDataMessageCondition {
|
|
1999
|
-
field: string;
|
|
2000
|
-
|
|
2001
|
-
field_source: 'ethereum_typed_data_message';
|
|
2002
|
-
|
|
2003
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
2004
|
-
|
|
2005
|
-
typed_data: EthereumTypedDataMessageCondition.TypedData;
|
|
2006
|
-
|
|
2007
|
-
value: string | Array<string>;
|
|
2008
|
-
}
|
|
2009
|
-
|
|
2010
|
-
export namespace EthereumTypedDataMessageCondition {
|
|
2011
|
-
export interface TypedData {
|
|
2012
|
-
primary_type: string;
|
|
2013
|
-
|
|
2014
|
-
types: { [key: string]: Array<TypedData.Type> };
|
|
2015
|
-
}
|
|
2016
|
-
|
|
2017
|
-
export namespace TypedData {
|
|
2018
|
-
export interface Type {
|
|
2019
|
-
name: string;
|
|
2020
|
-
|
|
2021
|
-
type: string;
|
|
2022
|
-
}
|
|
2023
|
-
}
|
|
2024
|
-
}
|
|
2025
1217
|
|
|
2026
1218
|
/**
|
|
2027
|
-
*
|
|
1219
|
+
* Header param: Request expiry. Value is a Unix timestamp in milliseconds
|
|
1220
|
+
* representing the deadline by which the request must be processed.
|
|
2028
1221
|
*/
|
|
2029
|
-
|
|
2030
|
-
field: 'contract';
|
|
2031
|
-
|
|
2032
|
-
field_source: 'ethereum_7702_authorization';
|
|
2033
|
-
|
|
2034
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
2035
|
-
|
|
2036
|
-
value: string | Array<string>;
|
|
2037
|
-
}
|
|
2038
|
-
|
|
2039
|
-
/**
|
|
2040
|
-
* Solana Program attributes, enables allowlisting Solana Programs.
|
|
2041
|
-
*/
|
|
2042
|
-
export interface SolanaProgramInstructionCondition {
|
|
2043
|
-
field: 'programId';
|
|
2044
|
-
|
|
2045
|
-
field_source: 'solana_program_instruction';
|
|
2046
|
-
|
|
2047
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
2048
|
-
|
|
2049
|
-
value: string | Array<string>;
|
|
2050
|
-
}
|
|
2051
|
-
|
|
2052
|
-
/**
|
|
2053
|
-
* Solana System Program attributes, including more granular Transfer instruction
|
|
2054
|
-
* fields.
|
|
2055
|
-
*/
|
|
2056
|
-
export interface SolanaSystemProgramInstructionCondition {
|
|
2057
|
-
field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
|
|
2058
|
-
|
|
2059
|
-
field_source: 'solana_system_program_instruction';
|
|
2060
|
-
|
|
2061
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
2062
|
-
|
|
2063
|
-
value: string | Array<string>;
|
|
2064
|
-
}
|
|
2065
|
-
|
|
2066
|
-
/**
|
|
2067
|
-
* Solana Token Program attributes, including more granular TransferChecked
|
|
2068
|
-
* instruction fields.
|
|
2069
|
-
*/
|
|
2070
|
-
export interface SolanaTokenProgramInstructionCondition {
|
|
2071
|
-
field:
|
|
2072
|
-
| 'instructionName'
|
|
2073
|
-
| 'TransferChecked.source'
|
|
2074
|
-
| 'TransferChecked.destination'
|
|
2075
|
-
| 'TransferChecked.authority'
|
|
2076
|
-
| 'TransferChecked.amount'
|
|
2077
|
-
| 'TransferChecked.mint';
|
|
2078
|
-
|
|
2079
|
-
field_source: 'solana_token_program_instruction';
|
|
2080
|
-
|
|
2081
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
2082
|
-
|
|
2083
|
-
value: string | Array<string>;
|
|
2084
|
-
}
|
|
2085
|
-
|
|
2086
|
-
/**
|
|
2087
|
-
* System attributes, including current unix timestamp (in seconds).
|
|
2088
|
-
*/
|
|
2089
|
-
export interface SystemCondition {
|
|
2090
|
-
field: 'current_unix_timestamp';
|
|
2091
|
-
|
|
2092
|
-
field_source: 'system';
|
|
2093
|
-
|
|
2094
|
-
operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
|
|
2095
|
-
|
|
2096
|
-
value: string | Array<string>;
|
|
2097
|
-
}
|
|
1222
|
+
'privy-request-expiry'?: string;
|
|
2098
1223
|
}
|
|
2099
1224
|
|
|
2100
1225
|
export interface PolicyGetRuleParams {
|
|
@@ -2103,17 +1228,46 @@ export interface PolicyGetRuleParams {
|
|
|
2103
1228
|
|
|
2104
1229
|
export declare namespace Policies {
|
|
2105
1230
|
export {
|
|
1231
|
+
type ConditionSetRequestParams as ConditionSetRequestParams,
|
|
1232
|
+
type ConditionSetItemRequestParams as ConditionSetItemRequestParams,
|
|
1233
|
+
type ConditionSetRequestBody as ConditionSetRequestBody,
|
|
1234
|
+
type ConditionSet as ConditionSet,
|
|
1235
|
+
type UpdateConditionSetRequestBody as UpdateConditionSetRequestBody,
|
|
1236
|
+
type ConditionSetItemValueInput as ConditionSetItemValueInput,
|
|
1237
|
+
type ConditionSetItemsRequestBody as ConditionSetItemsRequestBody,
|
|
1238
|
+
type ConditionSetItem as ConditionSetItem,
|
|
1239
|
+
type ConditionSetItems as ConditionSetItems,
|
|
1240
|
+
type ConditionSetItemsResponse as ConditionSetItemsResponse,
|
|
1241
|
+
type PolicyAction as PolicyAction,
|
|
1242
|
+
type AbiParameter as AbiParameter,
|
|
1243
|
+
type AbiSchema as AbiSchema,
|
|
1244
|
+
type ConditionOperator as ConditionOperator,
|
|
1245
|
+
type ConditionValue as ConditionValue,
|
|
2106
1246
|
type SuiTransactionCommandOperator as SuiTransactionCommandOperator,
|
|
2107
1247
|
type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField,
|
|
1248
|
+
type EthereumTransactionCondition as EthereumTransactionCondition,
|
|
1249
|
+
type EthereumCalldataCondition as EthereumCalldataCondition,
|
|
1250
|
+
type EthereumTypedDataDomainCondition as EthereumTypedDataDomainCondition,
|
|
1251
|
+
type EthereumTypedDataMessageCondition as EthereumTypedDataMessageCondition,
|
|
1252
|
+
type Ethereum7702AuthorizationCondition as Ethereum7702AuthorizationCondition,
|
|
1253
|
+
type SolanaProgramInstructionCondition as SolanaProgramInstructionCondition,
|
|
1254
|
+
type SolanaSystemProgramInstructionCondition as SolanaSystemProgramInstructionCondition,
|
|
1255
|
+
type SolanaTokenProgramInstructionCondition as SolanaTokenProgramInstructionCondition,
|
|
1256
|
+
type SystemCondition as SystemCondition,
|
|
2108
1257
|
type TronTransactionCondition as TronTransactionCondition,
|
|
1258
|
+
type TronCalldataCondition as TronCalldataCondition,
|
|
2109
1259
|
type SuiTransactionCommandCondition as SuiTransactionCommandCondition,
|
|
2110
1260
|
type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition,
|
|
1261
|
+
type AggregationCondition as AggregationCondition,
|
|
1262
|
+
type PolicyCondition as PolicyCondition,
|
|
1263
|
+
type PolicyMethod as PolicyMethod,
|
|
1264
|
+
type PolicyRuleRequestBody as PolicyRuleRequestBody,
|
|
1265
|
+
type PolicyRuleResponse as PolicyRuleResponse,
|
|
2111
1266
|
type Policy as Policy,
|
|
2112
|
-
type
|
|
2113
|
-
type
|
|
2114
|
-
type
|
|
2115
|
-
type
|
|
2116
|
-
type PolicyGetRuleResponse as PolicyGetRuleResponse,
|
|
1267
|
+
type PolicyRequestBody as PolicyRequestBody,
|
|
1268
|
+
type PolicyRuleRequestParams as PolicyRuleRequestParams,
|
|
1269
|
+
type PolicyAuthorizationHeaders as PolicyAuthorizationHeaders,
|
|
1270
|
+
type ConditionSetAuthorizationHeaders as ConditionSetAuthorizationHeaders,
|
|
2117
1271
|
type PolicyCreateParams as PolicyCreateParams,
|
|
2118
1272
|
type PolicyCreateRuleParams as PolicyCreateRuleParams,
|
|
2119
1273
|
type PolicyDeleteParams as PolicyDeleteParams,
|