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