@privy-io/api-types 0.6.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/client.d.mts +53 -29
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +53 -29
  5. package/client.d.ts.map +1 -1
  6. package/client.js +32 -7
  7. package/client.js.map +1 -1
  8. package/client.mjs +34 -9
  9. package/client.mjs.map +1 -1
  10. package/package.json +12 -1
  11. package/resources/accounts.d.mts +146 -4
  12. package/resources/accounts.d.mts.map +1 -1
  13. package/resources/accounts.d.ts +146 -4
  14. package/resources/accounts.d.ts.map +1 -1
  15. package/resources/accounts.js.map +1 -1
  16. package/resources/accounts.mjs.map +1 -1
  17. package/resources/aggregations.d.mts +18 -392
  18. package/resources/aggregations.d.mts.map +1 -1
  19. package/resources/aggregations.d.ts +18 -392
  20. package/resources/aggregations.d.ts.map +1 -1
  21. package/resources/aggregations.js.map +1 -1
  22. package/resources/aggregations.mjs.map +1 -1
  23. package/resources/apps.d.mts +197 -70
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +197 -70
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/apps.js.map +1 -1
  28. package/resources/apps.mjs.map +1 -1
  29. package/resources/client-auth.d.mts +975 -463
  30. package/resources/client-auth.d.mts.map +1 -1
  31. package/resources/client-auth.d.ts +975 -463
  32. package/resources/client-auth.d.ts.map +1 -1
  33. package/resources/client-auth.js.map +1 -1
  34. package/resources/client-auth.mjs.map +1 -1
  35. package/resources/cross-app.d.mts +14 -13
  36. package/resources/cross-app.d.mts.map +1 -1
  37. package/resources/cross-app.d.ts +14 -13
  38. package/resources/cross-app.d.ts.map +1 -1
  39. package/resources/embedded-wallets.d.mts +165 -81
  40. package/resources/embedded-wallets.d.mts.map +1 -1
  41. package/resources/embedded-wallets.d.ts +165 -81
  42. package/resources/embedded-wallets.d.ts.map +1 -1
  43. package/resources/embedded-wallets.js.map +1 -1
  44. package/resources/embedded-wallets.mjs.map +1 -1
  45. package/resources/funding.d.mts +150 -64
  46. package/resources/funding.d.mts.map +1 -1
  47. package/resources/funding.d.ts +150 -64
  48. package/resources/funding.d.ts.map +1 -1
  49. package/resources/funding.js.map +1 -1
  50. package/resources/funding.mjs.map +1 -1
  51. package/resources/index.d.mts +18 -14
  52. package/resources/index.d.mts.map +1 -1
  53. package/resources/index.d.ts +18 -14
  54. package/resources/index.d.ts.map +1 -1
  55. package/resources/index.js +9 -1
  56. package/resources/index.js.map +1 -1
  57. package/resources/index.mjs +6 -2
  58. package/resources/index.mjs.map +1 -1
  59. package/resources/intents.d.mts +446 -31
  60. package/resources/intents.d.mts.map +1 -1
  61. package/resources/intents.d.ts +446 -31
  62. package/resources/intents.d.ts.map +1 -1
  63. package/resources/intents.js.map +1 -1
  64. package/resources/intents.mjs.map +1 -1
  65. package/resources/key-quorums.d.mts +108 -17
  66. package/resources/key-quorums.d.mts.map +1 -1
  67. package/resources/key-quorums.d.ts +108 -17
  68. package/resources/key-quorums.d.ts.map +1 -1
  69. package/resources/key-quorums.js +26 -9
  70. package/resources/key-quorums.js.map +1 -1
  71. package/resources/key-quorums.mjs +26 -9
  72. package/resources/key-quorums.mjs.map +1 -1
  73. package/resources/kraken-embed.d.mts +62 -0
  74. package/resources/kraken-embed.d.mts.map +1 -0
  75. package/resources/kraken-embed.d.ts +62 -0
  76. package/resources/kraken-embed.d.ts.map +1 -0
  77. package/resources/kraken-embed.js +9 -0
  78. package/resources/kraken-embed.js.map +1 -0
  79. package/resources/kraken-embed.mjs +5 -0
  80. package/resources/kraken-embed.mjs.map +1 -0
  81. package/resources/policies.d.mts +342 -926
  82. package/resources/policies.d.mts.map +1 -1
  83. package/resources/policies.d.ts +342 -926
  84. package/resources/policies.d.ts.map +1 -1
  85. package/resources/policies.js +51 -41
  86. package/resources/policies.js.map +1 -1
  87. package/resources/policies.mjs +51 -41
  88. package/resources/policies.mjs.map +1 -1
  89. package/resources/shared.d.mts +59 -0
  90. package/resources/shared.d.mts.map +1 -0
  91. package/resources/shared.d.ts +59 -0
  92. package/resources/shared.d.ts.map +1 -0
  93. package/resources/shared.js +9 -0
  94. package/resources/shared.js.map +1 -0
  95. package/resources/shared.mjs +5 -0
  96. package/resources/shared.mjs.map +1 -0
  97. package/resources/swaps.d.mts +108 -0
  98. package/resources/swaps.d.mts.map +1 -0
  99. package/resources/swaps.d.ts +108 -0
  100. package/resources/swaps.d.ts.map +1 -0
  101. package/resources/swaps.js +9 -0
  102. package/resources/swaps.js.map +1 -0
  103. package/resources/swaps.mjs +5 -0
  104. package/resources/swaps.mjs.map +1 -0
  105. package/resources/transactions.d.mts +158 -93
  106. package/resources/transactions.d.mts.map +1 -1
  107. package/resources/transactions.d.ts +158 -93
  108. package/resources/transactions.d.ts.map +1 -1
  109. package/resources/transactions.js +3 -0
  110. package/resources/transactions.js.map +1 -1
  111. package/resources/transactions.mjs +3 -0
  112. package/resources/transactions.mjs.map +1 -1
  113. package/resources/users.d.mts +64 -94
  114. package/resources/users.d.mts.map +1 -1
  115. package/resources/users.d.ts +64 -94
  116. package/resources/users.d.ts.map +1 -1
  117. package/resources/users.js +3 -0
  118. package/resources/users.js.map +1 -1
  119. package/resources/users.mjs +3 -0
  120. package/resources/users.mjs.map +1 -1
  121. package/resources/wallet-actions.d.mts +187 -0
  122. package/resources/wallet-actions.d.mts.map +1 -0
  123. package/resources/wallet-actions.d.ts +187 -0
  124. package/resources/wallet-actions.d.ts.map +1 -0
  125. package/resources/wallet-actions.js +9 -0
  126. package/resources/wallet-actions.js.map +1 -0
  127. package/resources/wallet-actions.mjs +5 -0
  128. package/resources/wallet-actions.mjs.map +1 -0
  129. package/resources/wallets/balance.d.mts +7 -4
  130. package/resources/wallets/balance.d.mts.map +1 -1
  131. package/resources/wallets/balance.d.ts +7 -4
  132. package/resources/wallets/balance.d.ts.map +1 -1
  133. package/resources/wallets/balance.js +3 -0
  134. package/resources/wallets/balance.js.map +1 -1
  135. package/resources/wallets/balance.mjs +3 -0
  136. package/resources/wallets/balance.mjs.map +1 -1
  137. package/resources/wallets/index.d.mts +1 -1
  138. package/resources/wallets/index.d.mts.map +1 -1
  139. package/resources/wallets/index.d.ts +1 -1
  140. package/resources/wallets/index.d.ts.map +1 -1
  141. package/resources/wallets/index.js.map +1 -1
  142. package/resources/wallets/index.mjs.map +1 -1
  143. package/resources/wallets/transactions.d.mts +10 -6
  144. package/resources/wallets/transactions.d.mts.map +1 -1
  145. package/resources/wallets/transactions.d.ts +10 -6
  146. package/resources/wallets/transactions.d.ts.map +1 -1
  147. package/resources/wallets/transactions.js +3 -0
  148. package/resources/wallets/transactions.js.map +1 -1
  149. package/resources/wallets/transactions.mjs +3 -0
  150. package/resources/wallets/transactions.mjs.map +1 -1
  151. package/resources/wallets/wallets.d.mts +2399 -936
  152. package/resources/wallets/wallets.d.mts.map +1 -1
  153. package/resources/wallets/wallets.d.ts +2399 -936
  154. package/resources/wallets/wallets.d.ts.map +1 -1
  155. package/resources/wallets/wallets.js +28 -10
  156. package/resources/wallets/wallets.js.map +1 -1
  157. package/resources/wallets/wallets.mjs +28 -10
  158. package/resources/wallets/wallets.mjs.map +1 -1
  159. package/resources/webhooks.d.mts +780 -339
  160. package/resources/webhooks.d.mts.map +1 -1
  161. package/resources/webhooks.d.ts +780 -339
  162. package/resources/webhooks.d.ts.map +1 -1
  163. package/resources/webhooks.js.map +1 -1
  164. package/resources/webhooks.mjs.map +1 -1
  165. package/resources/yield.d.mts +50 -9
  166. package/resources/yield.d.mts.map +1 -1
  167. package/resources/yield.d.ts +50 -9
  168. package/resources/yield.d.ts.map +1 -1
  169. package/src/client.ts +884 -99
  170. package/src/resources/accounts.ts +179 -3
  171. package/src/resources/aggregations.ts +18 -702
  172. package/src/resources/apps.ts +250 -85
  173. package/src/resources/client-auth.ts +1453 -786
  174. package/src/resources/cross-app.ts +19 -15
  175. package/src/resources/embedded-wallets.ts +219 -123
  176. package/src/resources/funding.ts +263 -173
  177. package/src/resources/index.ts +444 -61
  178. package/src/resources/intents.ts +575 -37
  179. package/src/resources/key-quorums.ts +137 -21
  180. package/src/resources/kraken-embed.ts +85 -0
  181. package/src/resources/policies.ts +582 -1550
  182. package/src/resources/shared.ts +79 -0
  183. package/src/resources/swaps.ts +136 -0
  184. package/src/resources/transactions.ts +188 -91
  185. package/src/resources/users.ts +82 -132
  186. package/src/resources/wallet-actions.ts +251 -0
  187. package/src/resources/wallets/balance.ts +9 -2
  188. package/src/resources/wallets/index.ts +146 -16
  189. package/src/resources/wallets/transactions.ts +12 -4
  190. package/src/resources/wallets/wallets.ts +2922 -974
  191. package/src/resources/webhooks.ts +970 -454
  192. package/src/resources/yield.ts +68 -10
  193. package/src/version.ts +1 -1
  194. package/version.d.mts +1 -1
  195. package/version.d.ts +1 -1
  196. package/version.js +1 -1
  197. package/version.mjs +1 -1
@@ -1,8 +1,12 @@
1
1
  import { APIResource } from "../core/resource.js";
2
2
  import * as PoliciesAPI from "./policies.js";
3
+ import * as SharedAPI from "./shared.js";
3
4
  import * as WalletsAPI from "./wallets/wallets.js";
4
5
  import { APIPromise } from "../core/api-promise.js";
5
6
  import { RequestOptions } from "../internal/request-options.js";
7
+ /**
8
+ * Operations related to policies
9
+ */
6
10
  export declare class Policies extends APIResource {
7
11
  /**
8
12
  * Create a new policy.
@@ -37,48 +41,49 @@ export declare class Policies extends APIResource {
37
41
  *
38
42
  * @example
39
43
  * ```ts
40
- * const response = await client.policies._createRule(
41
- * 'xxxxxxxxxxxxxxxxxxxxxxxx',
42
- * {
43
- * action: 'ALLOW',
44
- * conditions: [
45
- * {
46
- * field: 'to',
47
- * field_source: 'ethereum_transaction',
48
- * operator: 'eq',
49
- * value: 'string',
50
- * },
51
- * ],
52
- * method: 'eth_sendTransaction',
53
- * name: 'x',
54
- * },
55
- * );
44
+ * const policyRuleResponse =
45
+ * await client.policies._createRule(
46
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
47
+ * {
48
+ * action: 'ALLOW',
49
+ * conditions: [
50
+ * {
51
+ * field: 'to',
52
+ * field_source: 'ethereum_transaction',
53
+ * operator: 'eq',
54
+ * value: 'string',
55
+ * },
56
+ * ],
57
+ * method: 'eth_sendTransaction',
58
+ * name: 'x',
59
+ * },
60
+ * );
56
61
  * ```
57
62
  */
58
- _createRule(policyID: string, params: PolicyCreateRuleParams, options?: RequestOptions): APIPromise<PolicyCreateRuleResponse>;
63
+ _createRule(policyID: string, params: PolicyCreateRuleParams, options?: RequestOptions): APIPromise<PolicyRuleResponse>;
59
64
  /**
60
65
  * Delete a policy by policy ID.
61
66
  *
62
67
  * @example
63
68
  * ```ts
64
- * const response = await client.policies._delete(
69
+ * const successResponse = await client.policies._delete(
65
70
  * 'xxxxxxxxxxxxxxxxxxxxxxxx',
66
71
  * );
67
72
  * ```
68
73
  */
69
- _delete(policyID: string, params?: PolicyDeleteParams | null | undefined, options?: RequestOptions): APIPromise<PolicyDeleteResponse>;
74
+ _delete(policyID: string, params?: PolicyDeleteParams | null | undefined, options?: RequestOptions): APIPromise<SharedAPI.SuccessResponse>;
70
75
  /**
71
76
  * Delete a rule by policy ID and rule ID.
72
77
  *
73
78
  * @example
74
79
  * ```ts
75
- * const response = await client.policies._deleteRule(
80
+ * const successResponse = await client.policies._deleteRule(
76
81
  * 'xxxxxxxxxxxxxxxxxxxxxxxx',
77
82
  * { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
78
83
  * );
79
84
  * ```
80
85
  */
81
- _deleteRule(ruleID: string, params: PolicyDeleteRuleParams, options?: RequestOptions): APIPromise<PolicyDeleteRuleResponse>;
86
+ _deleteRule(ruleID: string, params: PolicyDeleteRuleParams, options?: RequestOptions): APIPromise<SharedAPI.SuccessResponse>;
82
87
  /**
83
88
  * Update a policy by policy ID.
84
89
  *
@@ -95,26 +100,27 @@ export declare class Policies extends APIResource {
95
100
  *
96
101
  * @example
97
102
  * ```ts
98
- * const response = await client.policies._updateRule(
99
- * 'xxxxxxxxxxxxxxxxxxxxxxxx',
100
- * {
101
- * policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
102
- * action: 'ALLOW',
103
- * conditions: [
104
- * {
105
- * field: 'to',
106
- * field_source: 'ethereum_transaction',
107
- * operator: 'eq',
108
- * value: 'string',
109
- * },
110
- * ],
111
- * method: 'eth_sendTransaction',
112
- * name: 'x',
113
- * },
114
- * );
103
+ * const policyRuleResponse =
104
+ * await client.policies._updateRule(
105
+ * 'xxxxxxxxxxxxxxxxxxxxxxxx',
106
+ * {
107
+ * policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx',
108
+ * action: 'ALLOW',
109
+ * conditions: [
110
+ * {
111
+ * field: 'to',
112
+ * field_source: 'ethereum_transaction',
113
+ * operator: 'eq',
114
+ * value: 'string',
115
+ * },
116
+ * ],
117
+ * method: 'eth_sendTransaction',
118
+ * name: 'x',
119
+ * },
120
+ * );
115
121
  * ```
116
122
  */
117
- _updateRule(ruleID: string, params: PolicyUpdateRuleParams, options?: RequestOptions): APIPromise<PolicyUpdateRuleResponse>;
123
+ _updateRule(ruleID: string, params: PolicyUpdateRuleParams, options?: RequestOptions): APIPromise<PolicyRuleResponse>;
118
124
  /**
119
125
  * Get a policy by policy ID.
120
126
  *
@@ -131,13 +137,163 @@ export declare class Policies extends APIResource {
131
137
  *
132
138
  * @example
133
139
  * ```ts
134
- * const response = await client.policies.getRule(
140
+ * const policyRuleResponse = await client.policies.getRule(
135
141
  * 'xxxxxxxxxxxxxxxxxxxxxxxx',
136
142
  * { policy_id: 'xxxxxxxxxxxxxxxxxxxxxxxx' },
137
143
  * );
138
144
  * ```
139
145
  */
140
- getRule(ruleID: string, params: PolicyGetRuleParams, options?: RequestOptions): APIPromise<PolicyGetRuleResponse>;
146
+ getRule(ruleID: string, params: PolicyGetRuleParams, options?: RequestOptions): APIPromise<PolicyRuleResponse>;
147
+ }
148
+ /**
149
+ * Unique ID of the condition set to take actions on.
150
+ */
151
+ export interface ConditionSetRequestParams {
152
+ condition_set_id: string;
153
+ }
154
+ /**
155
+ * Unique IDs of the condition set and the condition set item within the condition
156
+ * set to take actions on.
157
+ */
158
+ export interface ConditionSetItemRequestParams {
159
+ condition_set_id: string;
160
+ condition_set_item_id: string;
161
+ }
162
+ /**
163
+ * Request body for creating a condition set.
164
+ */
165
+ export interface ConditionSetRequestBody {
166
+ /**
167
+ * Name to assign to condition set.
168
+ */
169
+ name: string;
170
+ /**
171
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
172
+ * null to remove the current owner.
173
+ */
174
+ owner?: SharedAPI.OwnerInput | null;
175
+ /**
176
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
177
+ * not specify an owner.
178
+ */
179
+ owner_id?: SharedAPI.OwnerIDInput | null;
180
+ }
181
+ /**
182
+ * A condition set for grouping related condition values.
183
+ */
184
+ export interface ConditionSet {
185
+ /**
186
+ * Unique ID of the created condition set. This will be the primary identifier when
187
+ * using the condition set in the future.
188
+ */
189
+ id: string;
190
+ /**
191
+ * Unix timestamp of when the condition set was created in milliseconds.
192
+ */
193
+ created_at: number;
194
+ /**
195
+ * Name of the condition set.
196
+ */
197
+ name: string;
198
+ /**
199
+ * A unique identifier for a key quorum.
200
+ */
201
+ owner_id: SharedAPI.KeyQuorumID;
202
+ }
203
+ /**
204
+ * Request body for updating a condition set.
205
+ */
206
+ export interface UpdateConditionSetRequestBody {
207
+ /**
208
+ * Name to assign to condition set.
209
+ */
210
+ name?: string;
211
+ /**
212
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
213
+ * null to remove the current owner.
214
+ */
215
+ owner?: SharedAPI.OwnerInput | null;
216
+ /**
217
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
218
+ * not specify an owner.
219
+ */
220
+ owner_id?: SharedAPI.OwnerIDInput | null;
221
+ }
222
+ /**
223
+ * A single value to add to a condition set.
224
+ */
225
+ export interface ConditionSetItemValueInput {
226
+ value: string;
227
+ }
228
+ /**
229
+ * Array of values to add to the condition set. Maximum 100 items per request.
230
+ */
231
+ export type ConditionSetItemsRequestBody = Array<ConditionSetItemValueInput>;
232
+ /**
233
+ * A single item in a condition set.
234
+ */
235
+ export interface ConditionSetItem {
236
+ /**
237
+ * Unique ID of the created condition set item.
238
+ */
239
+ id: string;
240
+ /**
241
+ * Unique ID of the condition set this item belongs to.
242
+ */
243
+ condition_set_id: string;
244
+ /**
245
+ * Unix timestamp of when the condition set item was created in milliseconds.
246
+ */
247
+ created_at: number;
248
+ /**
249
+ * The value stored in this condition set item.
250
+ */
251
+ value: string;
252
+ }
253
+ /**
254
+ * Array of condition set items.
255
+ */
256
+ export type ConditionSetItems = Array<ConditionSetItem>;
257
+ /**
258
+ * Paginated list of condition set items.
259
+ */
260
+ export interface ConditionSetItemsResponse {
261
+ /**
262
+ * List of condition set items.
263
+ */
264
+ items: Array<ConditionSetItem>;
265
+ /**
266
+ * Cursor for pagination. Null if there are no more items.
267
+ */
268
+ next_cursor: string | null;
269
+ }
270
+ /**
271
+ * The action to take when a policy rule matches.
272
+ */
273
+ export type PolicyAction = 'ALLOW' | 'DENY';
274
+ /**
275
+ * A parameter in a Solidity ABI function or event definition.
276
+ */
277
+ export interface AbiParameter {
278
+ type: string;
279
+ components?: Array<unknown>;
280
+ indexed?: boolean;
281
+ internalType?: string;
282
+ name?: string;
283
+ }
284
+ /**
285
+ * A Solidity ABI definition for decoding smart contract calldata.
286
+ */
287
+ export type AbiSchema = Array<AbiSchema.AbiSchemaItem>;
288
+ export declare namespace AbiSchema {
289
+ interface AbiSchemaItem {
290
+ type: 'function' | 'constructor' | 'event' | 'fallback' | 'receive';
291
+ anonymous?: boolean;
292
+ inputs?: Array<PoliciesAPI.AbiParameter>;
293
+ name?: string;
294
+ outputs?: Array<PoliciesAPI.AbiParameter>;
295
+ stateMutability?: 'pure' | 'view' | 'nonpayable' | 'payable';
296
+ }
141
297
  }
142
298
  /**
143
299
  * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
@@ -162,6 +318,19 @@ export interface TronTransactionCondition {
162
318
  operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
163
319
  value: string | Array<string>;
164
320
  }
321
+ /**
322
+ * Decoded calldata from a TRON TriggerSmartContract interaction.
323
+ */
324
+ export interface TronCalldataCondition {
325
+ /**
326
+ * A Solidity ABI definition for decoding smart contract calldata.
327
+ */
328
+ abi: AbiSchema;
329
+ field: string;
330
+ field_source: 'tron_trigger_smart_contract_data';
331
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
332
+ value: string | Array<string>;
333
+ }
165
334
  /**
166
335
  * SUI transaction command attributes, enables allowlisting specific command types.
167
336
  * Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and
@@ -195,178 +364,20 @@ export interface SuiTransferObjectsCommandCondition {
195
364
  value: string | Array<string>;
196
365
  }
197
366
  /**
198
- * A policy for controlling wallet operations.
367
+ * Condition referencing an aggregation value. The field must start with
368
+ * "aggregation." followed by the aggregation ID.
199
369
  */
200
- export interface Policy {
201
- /**
202
- * Unique ID of the created policy. This will be the primary identifier when using
203
- * the policy in the future.
204
- */
205
- id: string;
206
- /**
207
- * The chain type the policy applies to.
208
- */
209
- chain_type: 'ethereum' | 'solana' | 'tron' | 'sui';
210
- /**
211
- * Unix timestamp of when the policy was created in milliseconds.
212
- */
213
- created_at: number;
214
- /**
215
- * Name to assign to policy.
216
- */
217
- name: string;
218
- /**
219
- * The key quorum ID of the owner of the policy.
220
- */
221
- owner_id: string | null;
222
- rules: Array<Policy.Rule>;
223
- /**
224
- * Version of the policy. Currently, 1.0 is the only version.
225
- */
226
- version: '1.0';
227
- }
228
- export declare namespace Policy {
229
- /**
230
- * A rule that defines the conditions and action to take if the conditions are
231
- * true.
232
- */
233
- interface Rule {
234
- id: string;
235
- /**
236
- * Action to take if the conditions are true.
237
- */
238
- action: 'ALLOW' | 'DENY';
239
- conditions: Array<Rule.EthereumTransactionCondition | Rule.EthereumCalldataCondition | Rule.EthereumTypedDataDomainCondition | Rule.EthereumTypedDataMessageCondition | Rule.Ethereum7702AuthorizationCondition | Rule.SolanaProgramInstructionCondition | Rule.SolanaSystemProgramInstructionCondition | Rule.SolanaTokenProgramInstructionCondition | Rule.SystemCondition | PoliciesAPI.TronTransactionCondition | PoliciesAPI.SuiTransactionCommandCondition | PoliciesAPI.SuiTransferObjectsCommandCondition>;
240
- /**
241
- * Method the rule applies to.
242
- */
243
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
244
- name: string;
245
- }
246
- namespace Rule {
247
- /**
248
- * The verbatim Ethereum transaction object in an eth_signTransaction or
249
- * eth_sendTransaction request.
250
- */
251
- interface EthereumTransactionCondition {
252
- field: 'to' | 'value' | 'chain_id';
253
- field_source: 'ethereum_transaction';
254
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
255
- value: string | Array<string>;
256
- }
257
- /**
258
- * The decoded calldata in a smart contract interaction as the smart contract
259
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
260
- * an abi parameter with the JSON ABI of the smart contract.
261
- */
262
- interface EthereumCalldataCondition {
263
- abi: unknown;
264
- field: string;
265
- field_source: 'ethereum_calldata';
266
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
267
- value: string | Array<string>;
268
- }
269
- /**
270
- * Attributes from the signing domain that will verify the signature.
271
- */
272
- interface EthereumTypedDataDomainCondition {
273
- field: 'chainId' | 'verifyingContract';
274
- field_source: 'ethereum_typed_data_domain';
275
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
276
- value: string | Array<string>;
277
- }
278
- /**
279
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
280
- * EIP-712.
281
- */
282
- interface EthereumTypedDataMessageCondition {
283
- field: string;
284
- field_source: 'ethereum_typed_data_message';
285
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
286
- typed_data: EthereumTypedDataMessageCondition.TypedData;
287
- value: string | Array<string>;
288
- }
289
- namespace EthereumTypedDataMessageCondition {
290
- interface TypedData {
291
- primary_type: string;
292
- types: {
293
- [key: string]: Array<TypedData.Type>;
294
- };
295
- }
296
- namespace TypedData {
297
- interface Type {
298
- name: string;
299
- type: string;
300
- }
301
- }
302
- }
303
- /**
304
- * Allowed contract addresses for eth_sign7702Authorization requests.
305
- */
306
- interface Ethereum7702AuthorizationCondition {
307
- field: 'contract';
308
- field_source: 'ethereum_7702_authorization';
309
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
310
- value: string | Array<string>;
311
- }
312
- /**
313
- * Solana Program attributes, enables allowlisting Solana Programs.
314
- */
315
- interface SolanaProgramInstructionCondition {
316
- field: 'programId';
317
- field_source: 'solana_program_instruction';
318
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
319
- value: string | Array<string>;
320
- }
321
- /**
322
- * Solana System Program attributes, including more granular Transfer instruction
323
- * fields.
324
- */
325
- interface SolanaSystemProgramInstructionCondition {
326
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
327
- field_source: 'solana_system_program_instruction';
328
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
329
- value: string | Array<string>;
330
- }
331
- /**
332
- * Solana Token Program attributes, including more granular TransferChecked
333
- * instruction fields.
334
- */
335
- interface SolanaTokenProgramInstructionCondition {
336
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
337
- field_source: 'solana_token_program_instruction';
338
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
339
- value: string | Array<string>;
340
- }
341
- /**
342
- * System attributes, including current unix timestamp (in seconds).
343
- */
344
- interface SystemCondition {
345
- field: 'current_unix_timestamp';
346
- field_source: 'system';
347
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
348
- value: string | Array<string>;
349
- }
350
- }
370
+ export interface AggregationCondition {
371
+ field: string;
372
+ field_source: 'reference';
373
+ operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
374
+ value: string | Array<string>;
351
375
  }
352
376
  /**
353
- * A rule that defines the conditions and action to take if the conditions are
354
- * true.
377
+ * A condition that must be true for the rule action to be applied.
355
378
  */
356
- export interface PolicyCreateRuleResponse {
357
- id: string;
358
- /**
359
- * Action to take if the conditions are true.
360
- */
361
- action: 'ALLOW' | 'DENY';
362
- conditions: Array<PolicyCreateRuleResponse.EthereumTransactionCondition | PolicyCreateRuleResponse.EthereumCalldataCondition | PolicyCreateRuleResponse.EthereumTypedDataDomainCondition | PolicyCreateRuleResponse.EthereumTypedDataMessageCondition | PolicyCreateRuleResponse.Ethereum7702AuthorizationCondition | PolicyCreateRuleResponse.SolanaProgramInstructionCondition | PolicyCreateRuleResponse.SolanaSystemProgramInstructionCondition | PolicyCreateRuleResponse.SolanaTokenProgramInstructionCondition | PolicyCreateRuleResponse.SystemCondition | TronTransactionCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition>;
363
- /**
364
- * Method the rule applies to.
365
- */
366
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
367
- name: string;
368
- }
369
- export declare namespace PolicyCreateRuleResponse {
379
+ export type PolicyCondition = PolicyCondition.EthereumTransactionCondition | PolicyCondition.EthereumCalldataCondition | PolicyCondition.EthereumTypedDataDomainCondition | PolicyCondition.EthereumTypedDataMessageCondition | PolicyCondition.Ethereum7702AuthorizationCondition | PolicyCondition.SolanaProgramInstructionCondition | PolicyCondition.SolanaSystemProgramInstructionCondition | PolicyCondition.SolanaTokenProgramInstructionCondition | PolicyCondition.SystemCondition | TronTransactionCondition | TronCalldataCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition | AggregationCondition;
380
+ export declare namespace PolicyCondition {
370
381
  /**
371
382
  * The verbatim Ethereum transaction object in an eth_signTransaction or
372
383
  * eth_sendTransaction request.
@@ -383,7 +394,10 @@ export declare namespace PolicyCreateRuleResponse {
383
394
  * an abi parameter with the JSON ABI of the smart contract.
384
395
  */
385
396
  interface EthereumCalldataCondition {
386
- abi: unknown;
397
+ /**
398
+ * A Solidity ABI definition for decoding smart contract calldata.
399
+ */
400
+ abi: PoliciesAPI.AbiSchema;
387
401
  field: string;
388
402
  field_source: 'ethereum_calldata';
389
403
  operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
@@ -393,7 +407,7 @@ export declare namespace PolicyCreateRuleResponse {
393
407
  * Attributes from the signing domain that will verify the signature.
394
408
  */
395
409
  interface EthereumTypedDataDomainCondition {
396
- field: 'chainId' | 'verifyingContract';
410
+ field: 'chainId' | 'verifyingContract' | 'chain_id' | 'verifying_contract';
397
411
  field_source: 'ethereum_typed_data_domain';
398
412
  operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
399
413
  value: string | Array<string>;
@@ -412,15 +426,10 @@ export declare namespace PolicyCreateRuleResponse {
412
426
  namespace EthereumTypedDataMessageCondition {
413
427
  interface TypedData {
414
428
  primary_type: string;
415
- types: {
416
- [key: string]: Array<TypedData.Type>;
417
- };
418
- }
419
- namespace TypedData {
420
- interface Type {
421
- name: string;
422
- type: string;
423
- }
429
+ /**
430
+ * The type definitions for EIP-712 typed data signing.
431
+ */
432
+ types: WalletsAPI.TypedDataTypesInputParams;
424
433
  }
425
434
  }
426
435
  /**
@@ -456,7 +465,7 @@ export declare namespace PolicyCreateRuleResponse {
456
465
  * instruction fields.
457
466
  */
458
467
  interface SolanaTokenProgramInstructionCondition {
459
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
468
+ field: 'instructionName' | 'Transfer.source' | 'Transfer.destination' | 'Transfer.authority' | 'Transfer.amount' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint' | 'Burn.account' | 'Burn.mint' | 'Burn.authority' | 'Burn.amount' | 'MintTo.mint' | 'MintTo.account' | 'MintTo.authority' | 'MintTo.amount' | 'CloseAccount.account' | 'CloseAccount.destination' | 'CloseAccount.authority' | 'InitializeAccount3.account' | 'InitializeAccount3.mint' | 'InitializeAccount3.owner';
460
469
  field_source: 'solana_token_program_instruction';
461
470
  operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
462
471
  value: string | Array<string>;
@@ -471,263 +480,116 @@ export declare namespace PolicyCreateRuleResponse {
471
480
  value: string | Array<string>;
472
481
  }
473
482
  }
474
- export interface PolicyDeleteResponse {
483
+ /**
484
+ * Method the rule applies to.
485
+ */
486
+ export type PolicyMethod = 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'wallet_sendCalls' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'exportSeedPhrase' | 'signTransactionBytes' | '*';
487
+ /**
488
+ * The rules that apply to each method the policy covers.
489
+ */
490
+ export interface PolicyRuleRequestBody {
475
491
  /**
476
- * Whether the policy was deleted successfully.
492
+ * The action to take when a policy rule matches.
477
493
  */
478
- success: boolean;
479
- }
480
- export interface PolicyDeleteRuleResponse {
494
+ action: PolicyAction;
495
+ conditions: Array<PolicyCondition>;
481
496
  /**
482
- * Whether the rule was deleted successfully.
497
+ * Method the rule applies to.
483
498
  */
484
- success: boolean;
499
+ method: PolicyMethod;
500
+ name: string;
485
501
  }
486
- export interface PolicyUpdateRuleResponse {
502
+ /**
503
+ * A rule that defines the conditions and action to take if the conditions are
504
+ * true.
505
+ */
506
+ export interface PolicyRuleResponse {
487
507
  id: string;
488
508
  /**
489
- * Action to take if the conditions are true.
509
+ * The action to take when a policy rule matches.
490
510
  */
491
- action: 'ALLOW' | 'DENY';
492
- conditions: Array<PolicyUpdateRuleResponse.EthereumTransactionCondition | PolicyUpdateRuleResponse.EthereumCalldataCondition | PolicyUpdateRuleResponse.EthereumTypedDataDomainCondition | PolicyUpdateRuleResponse.EthereumTypedDataMessageCondition | PolicyUpdateRuleResponse.Ethereum7702AuthorizationCondition | PolicyUpdateRuleResponse.SolanaProgramInstructionCondition | PolicyUpdateRuleResponse.SolanaSystemProgramInstructionCondition | PolicyUpdateRuleResponse.SolanaTokenProgramInstructionCondition | PolicyUpdateRuleResponse.SystemCondition | TronTransactionCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition>;
511
+ action: PolicyAction;
512
+ conditions: Array<PolicyCondition>;
493
513
  /**
494
514
  * Method the rule applies to.
495
515
  */
496
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
516
+ method: PolicyMethod;
497
517
  name: string;
498
518
  }
499
- export declare namespace PolicyUpdateRuleResponse {
519
+ /**
520
+ * A policy for controlling wallet operations.
521
+ */
522
+ export interface Policy {
500
523
  /**
501
- * The verbatim Ethereum transaction object in an eth_signTransaction or
502
- * eth_sendTransaction request.
524
+ * Unique ID of the created policy. This will be the primary identifier when using
525
+ * the policy in the future.
503
526
  */
504
- interface EthereumTransactionCondition {
505
- field: 'to' | 'value' | 'chain_id';
506
- field_source: 'ethereum_transaction';
507
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
508
- value: string | Array<string>;
509
- }
527
+ id: string;
510
528
  /**
511
- * The decoded calldata in a smart contract interaction as the smart contract
512
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
513
- * an abi parameter with the JSON ABI of the smart contract.
529
+ * The wallet chain types.
514
530
  */
515
- interface EthereumCalldataCondition {
516
- abi: unknown;
517
- field: string;
518
- field_source: 'ethereum_calldata';
519
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
520
- value: string | Array<string>;
521
- }
531
+ chain_type: WalletsAPI.WalletChainType;
522
532
  /**
523
- * Attributes from the signing domain that will verify the signature.
533
+ * Unix timestamp of when the policy was created in milliseconds.
524
534
  */
525
- interface EthereumTypedDataDomainCondition {
526
- field: 'chainId' | 'verifyingContract';
527
- field_source: 'ethereum_typed_data_domain';
528
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
529
- value: string | Array<string>;
530
- }
535
+ created_at: number;
531
536
  /**
532
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
533
- * EIP-712.
537
+ * Name to assign to policy.
534
538
  */
535
- interface EthereumTypedDataMessageCondition {
536
- field: string;
537
- field_source: 'ethereum_typed_data_message';
538
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
539
- typed_data: EthereumTypedDataMessageCondition.TypedData;
540
- value: string | Array<string>;
541
- }
542
- namespace EthereumTypedDataMessageCondition {
543
- interface TypedData {
544
- primary_type: string;
545
- types: {
546
- [key: string]: Array<TypedData.Type>;
547
- };
548
- }
549
- namespace TypedData {
550
- interface Type {
551
- name: string;
552
- type: string;
553
- }
554
- }
555
- }
539
+ name: string;
556
540
  /**
557
- * Allowed contract addresses for eth_sign7702Authorization requests.
558
- */
559
- interface Ethereum7702AuthorizationCondition {
560
- field: 'contract';
561
- field_source: 'ethereum_7702_authorization';
562
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
563
- value: string | Array<string>;
564
- }
565
- /**
566
- * Solana Program attributes, enables allowlisting Solana Programs.
567
- */
568
- interface SolanaProgramInstructionCondition {
569
- field: 'programId';
570
- field_source: 'solana_program_instruction';
571
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
572
- value: string | Array<string>;
573
- }
574
- /**
575
- * Solana System Program attributes, including more granular Transfer instruction
576
- * fields.
577
- */
578
- interface SolanaSystemProgramInstructionCondition {
579
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
580
- field_source: 'solana_system_program_instruction';
581
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
582
- value: string | Array<string>;
583
- }
584
- /**
585
- * Solana Token Program attributes, including more granular TransferChecked
586
- * instruction fields.
541
+ * The key quorum ID of the owner of the policy.
587
542
  */
588
- interface SolanaTokenProgramInstructionCondition {
589
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
590
- field_source: 'solana_token_program_instruction';
591
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
592
- value: string | Array<string>;
593
- }
543
+ owner_id: string | null;
544
+ rules: Array<PolicyRuleResponse>;
594
545
  /**
595
- * System attributes, including current unix timestamp (in seconds).
546
+ * Version of the policy. Currently, 1.0 is the only version.
596
547
  */
597
- interface SystemCondition {
598
- field: 'current_unix_timestamp';
599
- field_source: 'system';
600
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
601
- value: string | Array<string>;
602
- }
548
+ version: '1.0';
603
549
  }
604
550
  /**
605
- * A rule that defines the conditions and action to take if the conditions are
606
- * true.
551
+ * Headers required to authorize modifications to policies.
607
552
  */
608
- export interface PolicyGetRuleResponse {
609
- id: string;
610
- /**
611
- * Action to take if the conditions are true.
612
- */
613
- action: 'ALLOW' | 'DENY';
614
- conditions: Array<PolicyGetRuleResponse.EthereumTransactionCondition | PolicyGetRuleResponse.EthereumCalldataCondition | PolicyGetRuleResponse.EthereumTypedDataDomainCondition | PolicyGetRuleResponse.EthereumTypedDataMessageCondition | PolicyGetRuleResponse.Ethereum7702AuthorizationCondition | PolicyGetRuleResponse.SolanaProgramInstructionCondition | PolicyGetRuleResponse.SolanaSystemProgramInstructionCondition | PolicyGetRuleResponse.SolanaTokenProgramInstructionCondition | PolicyGetRuleResponse.SystemCondition | TronTransactionCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition>;
615
- /**
616
- * Method the rule applies to.
617
- */
618
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
619
- name: string;
620
- }
621
- export declare namespace PolicyGetRuleResponse {
622
- /**
623
- * The verbatim Ethereum transaction object in an eth_signTransaction or
624
- * eth_sendTransaction request.
625
- */
626
- interface EthereumTransactionCondition {
627
- field: 'to' | 'value' | 'chain_id';
628
- field_source: 'ethereum_transaction';
629
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
630
- value: string | Array<string>;
631
- }
632
- /**
633
- * The decoded calldata in a smart contract interaction as the smart contract
634
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
635
- * an abi parameter with the JSON ABI of the smart contract.
636
- */
637
- interface EthereumCalldataCondition {
638
- abi: unknown;
639
- field: string;
640
- field_source: 'ethereum_calldata';
641
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
642
- value: string | Array<string>;
643
- }
644
- /**
645
- * Attributes from the signing domain that will verify the signature.
646
- */
647
- interface EthereumTypedDataDomainCondition {
648
- field: 'chainId' | 'verifyingContract';
649
- field_source: 'ethereum_typed_data_domain';
650
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
651
- value: string | Array<string>;
652
- }
553
+ export interface PolicyAuthorizationHeaders {
653
554
  /**
654
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
655
- * EIP-712.
555
+ * ID of your Privy app.
656
556
  */
657
- interface EthereumTypedDataMessageCondition {
658
- field: string;
659
- field_source: 'ethereum_typed_data_message';
660
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
661
- typed_data: EthereumTypedDataMessageCondition.TypedData;
662
- value: string | Array<string>;
663
- }
664
- namespace EthereumTypedDataMessageCondition {
665
- interface TypedData {
666
- primary_type: string;
667
- types: {
668
- [key: string]: Array<TypedData.Type>;
669
- };
670
- }
671
- namespace TypedData {
672
- interface Type {
673
- name: string;
674
- type: string;
675
- }
676
- }
677
- }
557
+ 'privy-app-id': string;
678
558
  /**
679
- * Allowed contract addresses for eth_sign7702Authorization requests.
559
+ * Request authorization signature. If multiple signatures are required, they
560
+ * should be comma separated.
680
561
  */
681
- interface Ethereum7702AuthorizationCondition {
682
- field: 'contract';
683
- field_source: 'ethereum_7702_authorization';
684
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
685
- value: string | Array<string>;
686
- }
562
+ 'privy-authorization-signature'?: string;
687
563
  /**
688
- * Solana Program attributes, enables allowlisting Solana Programs.
564
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
565
+ * deadline by which the request must be processed.
689
566
  */
690
- interface SolanaProgramInstructionCondition {
691
- field: 'programId';
692
- field_source: 'solana_program_instruction';
693
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
694
- value: string | Array<string>;
695
- }
567
+ 'privy-request-expiry'?: string;
568
+ }
569
+ /**
570
+ * Headers required to authorize modifications to condition sets.
571
+ */
572
+ export interface ConditionSetAuthorizationHeaders {
696
573
  /**
697
- * Solana System Program attributes, including more granular Transfer instruction
698
- * fields.
574
+ * ID of your Privy app.
699
575
  */
700
- interface SolanaSystemProgramInstructionCondition {
701
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
702
- field_source: 'solana_system_program_instruction';
703
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
704
- value: string | Array<string>;
705
- }
576
+ 'privy-app-id': string;
706
577
  /**
707
- * Solana Token Program attributes, including more granular TransferChecked
708
- * instruction fields.
578
+ * Request authorization signature. If multiple signatures are required, they
579
+ * should be comma separated.
709
580
  */
710
- interface SolanaTokenProgramInstructionCondition {
711
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
712
- field_source: 'solana_token_program_instruction';
713
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
714
- value: string | Array<string>;
715
- }
581
+ 'privy-authorization-signature'?: string;
716
582
  /**
717
- * System attributes, including current unix timestamp (in seconds).
583
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
584
+ * deadline by which the request must be processed.
718
585
  */
719
- interface SystemCondition {
720
- field: 'current_unix_timestamp';
721
- field_source: 'system';
722
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
723
- value: string | Array<string>;
724
- }
586
+ 'privy-request-expiry'?: string;
725
587
  }
726
588
  export interface PolicyCreateParams {
727
589
  /**
728
- * Body param: The chain type the policy applies to.
590
+ * Body param: The wallet chain types.
729
591
  */
730
- chain_type: 'ethereum' | 'solana' | 'tron' | 'sui';
592
+ chain_type: WalletsAPI.WalletChainType;
731
593
  /**
732
594
  * Body param: Name to assign to policy.
733
595
  */
@@ -741,15 +603,15 @@ export interface PolicyCreateParams {
741
603
  */
742
604
  version: '1.0';
743
605
  /**
744
- * Body param: The owner of the resource. If you provide this, do not specify an
745
- * owner_id as it will be generated automatically. When updating a wallet, you can
746
- * set the owner to null to remove the owner.
606
+ * Body param: The owner of the resource, specified as a Privy user ID, a P-256
607
+ * public key, or null to remove the current owner.
747
608
  */
748
- owner?: PolicyCreateParams.PublicKeyOwner | PolicyCreateParams.UserOwner | null;
609
+ owner?: SharedAPI.OwnerInput | null;
749
610
  /**
750
- * Body param
611
+ * Body param: The key quorum ID to set as the owner of the resource. If you
612
+ * provide this, do not specify an owner.
751
613
  */
752
- owner_id?: string | null;
614
+ owner_id?: SharedAPI.OwnerIDInput | null;
753
615
  /**
754
616
  * Header param: Idempotency keys ensure API requests are executed only once within
755
617
  * a 24-hour window.
@@ -757,156 +619,33 @@ export interface PolicyCreateParams {
757
619
  'privy-idempotency-key'?: string;
758
620
  }
759
621
  export declare namespace PolicyCreateParams {
760
- /**
761
- * The rules that apply to each method the policy covers.
762
- */
763
622
  interface Rule {
764
623
  /**
765
- * Action to take if the conditions are true.
624
+ * The action to take when a policy rule matches.
766
625
  */
767
- action: 'ALLOW' | 'DENY';
768
- conditions: Array<Rule.EthereumTransactionCondition | Rule.EthereumCalldataCondition | Rule.EthereumTypedDataDomainCondition | Rule.EthereumTypedDataMessageCondition | Rule.Ethereum7702AuthorizationCondition | Rule.SolanaProgramInstructionCondition | Rule.SolanaSystemProgramInstructionCondition | Rule.SolanaTokenProgramInstructionCondition | Rule.SystemCondition | PoliciesAPI.TronTransactionCondition | PoliciesAPI.SuiTransactionCommandCondition | PoliciesAPI.SuiTransferObjectsCommandCondition>;
626
+ action: PoliciesAPI.PolicyAction;
627
+ conditions: Array<PoliciesAPI.PolicyCondition>;
769
628
  /**
770
629
  * Method the rule applies to.
771
630
  */
772
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
631
+ method: PoliciesAPI.PolicyMethod;
773
632
  name: string;
774
- }
775
- namespace Rule {
776
- /**
777
- * The verbatim Ethereum transaction object in an eth_signTransaction or
778
- * eth_sendTransaction request.
779
- */
780
- interface EthereumTransactionCondition {
781
- field: 'to' | 'value' | 'chain_id';
782
- field_source: 'ethereum_transaction';
783
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
784
- value: string | Array<string>;
785
- }
786
- /**
787
- * The decoded calldata in a smart contract interaction as the smart contract
788
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
789
- * an abi parameter with the JSON ABI of the smart contract.
790
- */
791
- interface EthereumCalldataCondition {
792
- abi: unknown;
793
- field: string;
794
- field_source: 'ethereum_calldata';
795
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
796
- value: string | Array<string>;
797
- }
798
- /**
799
- * Attributes from the signing domain that will verify the signature.
800
- */
801
- interface EthereumTypedDataDomainCondition {
802
- field: 'chainId' | 'verifyingContract';
803
- field_source: 'ethereum_typed_data_domain';
804
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
805
- value: string | Array<string>;
806
- }
807
- /**
808
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
809
- * EIP-712.
810
- */
811
- interface EthereumTypedDataMessageCondition {
812
- field: string;
813
- field_source: 'ethereum_typed_data_message';
814
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
815
- typed_data: EthereumTypedDataMessageCondition.TypedData;
816
- value: string | Array<string>;
817
- }
818
- namespace EthereumTypedDataMessageCondition {
819
- interface TypedData {
820
- primary_type: string;
821
- types: {
822
- [key: string]: Array<TypedData.Type>;
823
- };
824
- }
825
- namespace TypedData {
826
- interface Type {
827
- name: string;
828
- type: string;
829
- }
830
- }
831
- }
832
- /**
833
- * Allowed contract addresses for eth_sign7702Authorization requests.
834
- */
835
- interface Ethereum7702AuthorizationCondition {
836
- field: 'contract';
837
- field_source: 'ethereum_7702_authorization';
838
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
839
- value: string | Array<string>;
840
- }
841
- /**
842
- * Solana Program attributes, enables allowlisting Solana Programs.
843
- */
844
- interface SolanaProgramInstructionCondition {
845
- field: 'programId';
846
- field_source: 'solana_program_instruction';
847
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
848
- value: string | Array<string>;
849
- }
850
- /**
851
- * Solana System Program attributes, including more granular Transfer instruction
852
- * fields.
853
- */
854
- interface SolanaSystemProgramInstructionCondition {
855
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
856
- field_source: 'solana_system_program_instruction';
857
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
858
- value: string | Array<string>;
859
- }
860
- /**
861
- * Solana Token Program attributes, including more granular TransferChecked
862
- * instruction fields.
863
- */
864
- interface SolanaTokenProgramInstructionCondition {
865
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
866
- field_source: 'solana_token_program_instruction';
867
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
868
- value: string | Array<string>;
869
- }
870
- /**
871
- * System attributes, including current unix timestamp (in seconds).
872
- */
873
- interface SystemCondition {
874
- field: 'current_unix_timestamp';
875
- field_source: 'system';
876
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
877
- value: string | Array<string>;
878
- }
879
- }
880
- /**
881
- * The P-256 public key of the owner of the resource, in base64-encoded DER format.
882
- * If you provide this, do not specify an owner_id as it will be generated
883
- * automatically.
884
- */
885
- interface PublicKeyOwner {
886
- public_key: string;
887
- }
888
- /**
889
- * The user ID of the owner of the resource. The user must already exist, and this
890
- * value must start with "did:privy:". If you provide this, do not specify an
891
- * owner_id as it will be generated automatically.
892
- */
893
- interface UserOwner {
894
- user_id: string;
633
+ id?: string;
895
634
  }
896
635
  }
897
636
  export interface PolicyCreateRuleParams {
898
637
  /**
899
- * Body param: Action to take if the conditions are true.
638
+ * Body param: The action to take when a policy rule matches.
900
639
  */
901
- action: 'ALLOW' | 'DENY';
640
+ action: PolicyAction;
902
641
  /**
903
642
  * Body param
904
643
  */
905
- conditions: Array<PolicyCreateRuleParams.EthereumTransactionCondition | PolicyCreateRuleParams.EthereumCalldataCondition | PolicyCreateRuleParams.EthereumTypedDataDomainCondition | PolicyCreateRuleParams.EthereumTypedDataMessageCondition | PolicyCreateRuleParams.Ethereum7702AuthorizationCondition | PolicyCreateRuleParams.SolanaProgramInstructionCondition | PolicyCreateRuleParams.SolanaSystemProgramInstructionCondition | PolicyCreateRuleParams.SolanaTokenProgramInstructionCondition | PolicyCreateRuleParams.SystemCondition | TronTransactionCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition>;
644
+ conditions: Array<PolicyCondition>;
906
645
  /**
907
646
  * Body param: Method the rule applies to.
908
647
  */
909
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
648
+ method: PolicyMethod;
910
649
  /**
911
650
  * Body param
912
651
  */
@@ -916,111 +655,11 @@ export interface PolicyCreateRuleParams {
916
655
  * required, they should be comma separated.
917
656
  */
918
657
  'privy-authorization-signature'?: string;
919
- }
920
- export declare namespace PolicyCreateRuleParams {
921
- /**
922
- * The verbatim Ethereum transaction object in an eth_signTransaction or
923
- * eth_sendTransaction request.
924
- */
925
- interface EthereumTransactionCondition {
926
- field: 'to' | 'value' | 'chain_id';
927
- field_source: 'ethereum_transaction';
928
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
929
- value: string | Array<string>;
930
- }
931
- /**
932
- * The decoded calldata in a smart contract interaction as the smart contract
933
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
934
- * an abi parameter with the JSON ABI of the smart contract.
935
- */
936
- interface EthereumCalldataCondition {
937
- abi: unknown;
938
- field: string;
939
- field_source: 'ethereum_calldata';
940
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
941
- value: string | Array<string>;
942
- }
943
- /**
944
- * Attributes from the signing domain that will verify the signature.
945
- */
946
- interface EthereumTypedDataDomainCondition {
947
- field: 'chainId' | 'verifyingContract';
948
- field_source: 'ethereum_typed_data_domain';
949
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
950
- value: string | Array<string>;
951
- }
952
- /**
953
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
954
- * EIP-712.
955
- */
956
- interface EthereumTypedDataMessageCondition {
957
- field: string;
958
- field_source: 'ethereum_typed_data_message';
959
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
960
- typed_data: EthereumTypedDataMessageCondition.TypedData;
961
- value: string | Array<string>;
962
- }
963
- namespace EthereumTypedDataMessageCondition {
964
- interface TypedData {
965
- primary_type: string;
966
- types: {
967
- [key: string]: Array<TypedData.Type>;
968
- };
969
- }
970
- namespace TypedData {
971
- interface Type {
972
- name: string;
973
- type: string;
974
- }
975
- }
976
- }
977
- /**
978
- * Allowed contract addresses for eth_sign7702Authorization requests.
979
- */
980
- interface Ethereum7702AuthorizationCondition {
981
- field: 'contract';
982
- field_source: 'ethereum_7702_authorization';
983
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
984
- value: string | Array<string>;
985
- }
986
- /**
987
- * Solana Program attributes, enables allowlisting Solana Programs.
988
- */
989
- interface SolanaProgramInstructionCondition {
990
- field: 'programId';
991
- field_source: 'solana_program_instruction';
992
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
993
- value: string | Array<string>;
994
- }
995
- /**
996
- * Solana System Program attributes, including more granular Transfer instruction
997
- * fields.
998
- */
999
- interface SolanaSystemProgramInstructionCondition {
1000
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1001
- field_source: 'solana_system_program_instruction';
1002
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1003
- value: string | Array<string>;
1004
- }
1005
- /**
1006
- * Solana Token Program attributes, including more granular TransferChecked
1007
- * instruction fields.
1008
- */
1009
- interface SolanaTokenProgramInstructionCondition {
1010
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
1011
- field_source: 'solana_token_program_instruction';
1012
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1013
- value: string | Array<string>;
1014
- }
1015
658
  /**
1016
- * System attributes, including current unix timestamp (in seconds).
659
+ * Header param: Request expiry. Value is a Unix timestamp in milliseconds
660
+ * representing the deadline by which the request must be processed.
1017
661
  */
1018
- interface SystemCondition {
1019
- field: 'current_unix_timestamp';
1020
- field_source: 'system';
1021
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1022
- value: string | Array<string>;
1023
- }
662
+ 'privy-request-expiry'?: string;
1024
663
  }
1025
664
  export interface PolicyDeleteParams {
1026
665
  /**
@@ -1028,6 +667,11 @@ export interface PolicyDeleteParams {
1028
667
  * should be comma separated.
1029
668
  */
1030
669
  'privy-authorization-signature'?: string;
670
+ /**
671
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
672
+ * deadline by which the request must be processed.
673
+ */
674
+ 'privy-request-expiry'?: string;
1031
675
  }
1032
676
  export interface PolicyDeleteRuleParams {
1033
677
  /**
@@ -1039,6 +683,11 @@ export interface PolicyDeleteRuleParams {
1039
683
  * required, they should be comma separated.
1040
684
  */
1041
685
  'privy-authorization-signature'?: string;
686
+ /**
687
+ * Header param: Request expiry. Value is a Unix timestamp in milliseconds
688
+ * representing the deadline by which the request must be processed.
689
+ */
690
+ 'privy-request-expiry'?: string;
1042
691
  }
1043
692
  export interface PolicyUpdateParams {
1044
693
  /**
@@ -1046,162 +695,29 @@ export interface PolicyUpdateParams {
1046
695
  */
1047
696
  name?: string;
1048
697
  /**
1049
- * Body param: The owner of the resource. If you provide this, do not specify an
1050
- * owner_id as it will be generated automatically. When updating a wallet, you can
1051
- * set the owner to null to remove the owner.
698
+ * Body param: The owner of the resource, specified as a Privy user ID, a P-256
699
+ * public key, or null to remove the current owner.
1052
700
  */
1053
- owner?: PolicyUpdateParams.PublicKeyOwner | PolicyUpdateParams.UserOwner | null;
701
+ owner?: SharedAPI.OwnerInput | null;
1054
702
  /**
1055
- * Body param
703
+ * Body param: The key quorum ID to set as the owner of the resource. If you
704
+ * provide this, do not specify an owner.
1056
705
  */
1057
- owner_id?: string | null;
706
+ owner_id?: SharedAPI.OwnerIDInput | null;
1058
707
  /**
1059
708
  * Body param
1060
709
  */
1061
- rules?: Array<PolicyUpdateParams.Rule>;
710
+ rules?: Array<PolicyRuleRequestBody>;
1062
711
  /**
1063
712
  * Header param: Request authorization signature. If multiple signatures are
1064
713
  * required, they should be comma separated.
1065
714
  */
1066
715
  'privy-authorization-signature'?: string;
1067
- }
1068
- export declare namespace PolicyUpdateParams {
1069
- /**
1070
- * The P-256 public key of the owner of the resource, in base64-encoded DER format.
1071
- * If you provide this, do not specify an owner_id as it will be generated
1072
- * automatically.
1073
- */
1074
- interface PublicKeyOwner {
1075
- public_key: string;
1076
- }
1077
- /**
1078
- * The user ID of the owner of the resource. The user must already exist, and this
1079
- * value must start with "did:privy:". If you provide this, do not specify an
1080
- * owner_id as it will be generated automatically.
1081
- */
1082
- interface UserOwner {
1083
- user_id: string;
1084
- }
1085
716
  /**
1086
- * The rules that apply to each method the policy covers.
717
+ * Header param: Request expiry. Value is a Unix timestamp in milliseconds
718
+ * representing the deadline by which the request must be processed.
1087
719
  */
1088
- interface Rule {
1089
- /**
1090
- * Action to take if the conditions are true.
1091
- */
1092
- action: 'ALLOW' | 'DENY';
1093
- conditions: Array<Rule.EthereumTransactionCondition | Rule.EthereumCalldataCondition | Rule.EthereumTypedDataDomainCondition | Rule.EthereumTypedDataMessageCondition | Rule.Ethereum7702AuthorizationCondition | Rule.SolanaProgramInstructionCondition | Rule.SolanaSystemProgramInstructionCondition | Rule.SolanaTokenProgramInstructionCondition | Rule.SystemCondition | PoliciesAPI.TronTransactionCondition | PoliciesAPI.SuiTransactionCommandCondition | PoliciesAPI.SuiTransferObjectsCommandCondition>;
1094
- /**
1095
- * Method the rule applies to.
1096
- */
1097
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
1098
- name: string;
1099
- }
1100
- namespace Rule {
1101
- /**
1102
- * The verbatim Ethereum transaction object in an eth_signTransaction or
1103
- * eth_sendTransaction request.
1104
- */
1105
- interface EthereumTransactionCondition {
1106
- field: 'to' | 'value' | 'chain_id';
1107
- field_source: 'ethereum_transaction';
1108
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1109
- value: string | Array<string>;
1110
- }
1111
- /**
1112
- * The decoded calldata in a smart contract interaction as the smart contract
1113
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1114
- * an abi parameter with the JSON ABI of the smart contract.
1115
- */
1116
- interface EthereumCalldataCondition {
1117
- abi: unknown;
1118
- field: string;
1119
- field_source: 'ethereum_calldata';
1120
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1121
- value: string | Array<string>;
1122
- }
1123
- /**
1124
- * Attributes from the signing domain that will verify the signature.
1125
- */
1126
- interface EthereumTypedDataDomainCondition {
1127
- field: 'chainId' | 'verifyingContract';
1128
- field_source: 'ethereum_typed_data_domain';
1129
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1130
- value: string | Array<string>;
1131
- }
1132
- /**
1133
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1134
- * EIP-712.
1135
- */
1136
- interface EthereumTypedDataMessageCondition {
1137
- field: string;
1138
- field_source: 'ethereum_typed_data_message';
1139
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1140
- typed_data: EthereumTypedDataMessageCondition.TypedData;
1141
- value: string | Array<string>;
1142
- }
1143
- namespace EthereumTypedDataMessageCondition {
1144
- interface TypedData {
1145
- primary_type: string;
1146
- types: {
1147
- [key: string]: Array<TypedData.Type>;
1148
- };
1149
- }
1150
- namespace TypedData {
1151
- interface Type {
1152
- name: string;
1153
- type: string;
1154
- }
1155
- }
1156
- }
1157
- /**
1158
- * Allowed contract addresses for eth_sign7702Authorization requests.
1159
- */
1160
- interface Ethereum7702AuthorizationCondition {
1161
- field: 'contract';
1162
- field_source: 'ethereum_7702_authorization';
1163
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1164
- value: string | Array<string>;
1165
- }
1166
- /**
1167
- * Solana Program attributes, enables allowlisting Solana Programs.
1168
- */
1169
- interface SolanaProgramInstructionCondition {
1170
- field: 'programId';
1171
- field_source: 'solana_program_instruction';
1172
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1173
- value: string | Array<string>;
1174
- }
1175
- /**
1176
- * Solana System Program attributes, including more granular Transfer instruction
1177
- * fields.
1178
- */
1179
- interface SolanaSystemProgramInstructionCondition {
1180
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1181
- field_source: 'solana_system_program_instruction';
1182
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1183
- value: string | Array<string>;
1184
- }
1185
- /**
1186
- * Solana Token Program attributes, including more granular TransferChecked
1187
- * instruction fields.
1188
- */
1189
- interface SolanaTokenProgramInstructionCondition {
1190
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
1191
- field_source: 'solana_token_program_instruction';
1192
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1193
- value: string | Array<string>;
1194
- }
1195
- /**
1196
- * System attributes, including current unix timestamp (in seconds).
1197
- */
1198
- interface SystemCondition {
1199
- field: 'current_unix_timestamp';
1200
- field_source: 'system';
1201
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1202
- value: string | Array<string>;
1203
- }
1204
- }
720
+ 'privy-request-expiry'?: string;
1205
721
  }
1206
722
  export interface PolicyUpdateRuleParams {
1207
723
  /**
@@ -1209,17 +725,17 @@ export interface PolicyUpdateRuleParams {
1209
725
  */
1210
726
  policy_id: string;
1211
727
  /**
1212
- * Body param: Action to take if the conditions are true.
728
+ * Body param: The action to take when a policy rule matches.
1213
729
  */
1214
- action: 'ALLOW' | 'DENY';
730
+ action: PolicyAction;
1215
731
  /**
1216
732
  * Body param
1217
733
  */
1218
- conditions: Array<PolicyUpdateRuleParams.EthereumTransactionCondition | PolicyUpdateRuleParams.EthereumCalldataCondition | PolicyUpdateRuleParams.EthereumTypedDataDomainCondition | PolicyUpdateRuleParams.EthereumTypedDataMessageCondition | PolicyUpdateRuleParams.Ethereum7702AuthorizationCondition | PolicyUpdateRuleParams.SolanaProgramInstructionCondition | PolicyUpdateRuleParams.SolanaSystemProgramInstructionCondition | PolicyUpdateRuleParams.SolanaTokenProgramInstructionCondition | PolicyUpdateRuleParams.SystemCondition | TronTransactionCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition>;
734
+ conditions: Array<PolicyCondition>;
1219
735
  /**
1220
736
  * Body param: Method the rule applies to.
1221
737
  */
1222
- method: 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'signTransactionBytes' | '*';
738
+ method: PolicyMethod;
1223
739
  /**
1224
740
  * Body param
1225
741
  */
@@ -1229,116 +745,16 @@ export interface PolicyUpdateRuleParams {
1229
745
  * required, they should be comma separated.
1230
746
  */
1231
747
  'privy-authorization-signature'?: string;
1232
- }
1233
- export declare namespace PolicyUpdateRuleParams {
1234
- /**
1235
- * The verbatim Ethereum transaction object in an eth_signTransaction or
1236
- * eth_sendTransaction request.
1237
- */
1238
- interface EthereumTransactionCondition {
1239
- field: 'to' | 'value' | 'chain_id';
1240
- field_source: 'ethereum_transaction';
1241
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1242
- value: string | Array<string>;
1243
- }
1244
- /**
1245
- * The decoded calldata in a smart contract interaction as the smart contract
1246
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
1247
- * an abi parameter with the JSON ABI of the smart contract.
1248
- */
1249
- interface EthereumCalldataCondition {
1250
- abi: unknown;
1251
- field: string;
1252
- field_source: 'ethereum_calldata';
1253
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1254
- value: string | Array<string>;
1255
- }
1256
- /**
1257
- * Attributes from the signing domain that will verify the signature.
1258
- */
1259
- interface EthereumTypedDataDomainCondition {
1260
- field: 'chainId' | 'verifyingContract';
1261
- field_source: 'ethereum_typed_data_domain';
1262
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1263
- value: string | Array<string>;
1264
- }
1265
748
  /**
1266
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
1267
- * EIP-712.
749
+ * Header param: Request expiry. Value is a Unix timestamp in milliseconds
750
+ * representing the deadline by which the request must be processed.
1268
751
  */
1269
- interface EthereumTypedDataMessageCondition {
1270
- field: string;
1271
- field_source: 'ethereum_typed_data_message';
1272
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1273
- typed_data: EthereumTypedDataMessageCondition.TypedData;
1274
- value: string | Array<string>;
1275
- }
1276
- namespace EthereumTypedDataMessageCondition {
1277
- interface TypedData {
1278
- primary_type: string;
1279
- types: {
1280
- [key: string]: Array<TypedData.Type>;
1281
- };
1282
- }
1283
- namespace TypedData {
1284
- interface Type {
1285
- name: string;
1286
- type: string;
1287
- }
1288
- }
1289
- }
1290
- /**
1291
- * Allowed contract addresses for eth_sign7702Authorization requests.
1292
- */
1293
- interface Ethereum7702AuthorizationCondition {
1294
- field: 'contract';
1295
- field_source: 'ethereum_7702_authorization';
1296
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1297
- value: string | Array<string>;
1298
- }
1299
- /**
1300
- * Solana Program attributes, enables allowlisting Solana Programs.
1301
- */
1302
- interface SolanaProgramInstructionCondition {
1303
- field: 'programId';
1304
- field_source: 'solana_program_instruction';
1305
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1306
- value: string | Array<string>;
1307
- }
1308
- /**
1309
- * Solana System Program attributes, including more granular Transfer instruction
1310
- * fields.
1311
- */
1312
- interface SolanaSystemProgramInstructionCondition {
1313
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
1314
- field_source: 'solana_system_program_instruction';
1315
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1316
- value: string | Array<string>;
1317
- }
1318
- /**
1319
- * Solana Token Program attributes, including more granular TransferChecked
1320
- * instruction fields.
1321
- */
1322
- interface SolanaTokenProgramInstructionCondition {
1323
- field: 'instructionName' | 'TransferChecked.source' | 'TransferChecked.destination' | 'TransferChecked.authority' | 'TransferChecked.amount' | 'TransferChecked.mint';
1324
- field_source: 'solana_token_program_instruction';
1325
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1326
- value: string | Array<string>;
1327
- }
1328
- /**
1329
- * System attributes, including current unix timestamp (in seconds).
1330
- */
1331
- interface SystemCondition {
1332
- field: 'current_unix_timestamp';
1333
- field_source: 'system';
1334
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
1335
- value: string | Array<string>;
1336
- }
752
+ 'privy-request-expiry'?: string;
1337
753
  }
1338
754
  export interface PolicyGetRuleParams {
1339
755
  policy_id: string;
1340
756
  }
1341
757
  export declare namespace Policies {
1342
- export { type SuiTransactionCommandOperator as SuiTransactionCommandOperator, type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField, type TronTransactionCondition as TronTransactionCondition, type SuiTransactionCommandCondition as SuiTransactionCommandCondition, type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition, type Policy as Policy, type PolicyCreateRuleResponse as PolicyCreateRuleResponse, type PolicyDeleteResponse as PolicyDeleteResponse, type PolicyDeleteRuleResponse as PolicyDeleteRuleResponse, type PolicyUpdateRuleResponse as PolicyUpdateRuleResponse, type PolicyGetRuleResponse as PolicyGetRuleResponse, type PolicyCreateParams as PolicyCreateParams, type PolicyCreateRuleParams as PolicyCreateRuleParams, type PolicyDeleteParams as PolicyDeleteParams, type PolicyDeleteRuleParams as PolicyDeleteRuleParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyUpdateRuleParams as PolicyUpdateRuleParams, type PolicyGetRuleParams as PolicyGetRuleParams, };
758
+ export { type ConditionSetRequestParams as ConditionSetRequestParams, type ConditionSetItemRequestParams as ConditionSetItemRequestParams, type ConditionSetRequestBody as ConditionSetRequestBody, type ConditionSet as ConditionSet, type UpdateConditionSetRequestBody as UpdateConditionSetRequestBody, type ConditionSetItemValueInput as ConditionSetItemValueInput, type ConditionSetItemsRequestBody as ConditionSetItemsRequestBody, type ConditionSetItem as ConditionSetItem, type ConditionSetItems as ConditionSetItems, type ConditionSetItemsResponse as ConditionSetItemsResponse, type PolicyAction as PolicyAction, type AbiParameter as AbiParameter, type AbiSchema as AbiSchema, type SuiTransactionCommandOperator as SuiTransactionCommandOperator, type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField, type TronTransactionCondition as TronTransactionCondition, type TronCalldataCondition as TronCalldataCondition, type SuiTransactionCommandCondition as SuiTransactionCommandCondition, type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition, type AggregationCondition as AggregationCondition, type PolicyCondition as PolicyCondition, type PolicyMethod as PolicyMethod, type PolicyRuleRequestBody as PolicyRuleRequestBody, type PolicyRuleResponse as PolicyRuleResponse, type Policy as Policy, type PolicyAuthorizationHeaders as PolicyAuthorizationHeaders, type ConditionSetAuthorizationHeaders as ConditionSetAuthorizationHeaders, type PolicyCreateParams as PolicyCreateParams, type PolicyCreateRuleParams as PolicyCreateRuleParams, type PolicyDeleteParams as PolicyDeleteParams, type PolicyDeleteRuleParams as PolicyDeleteRuleParams, type PolicyUpdateParams as PolicyUpdateParams, type PolicyUpdateRuleParams as PolicyUpdateRuleParams, type PolicyGetRuleParams as PolicyGetRuleParams, };
1343
759
  }
1344
760
  //# sourceMappingURL=policies.d.ts.map