@privy-io/api-types 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/client.d.mts +35 -32
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +35 -32
  5. package/client.d.ts.map +1 -1
  6. package/client.js +22 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +22 -8
  9. package/client.mjs.map +1 -1
  10. package/internal/types.d.mts +6 -6
  11. package/internal/types.d.mts.map +1 -1
  12. package/internal/types.d.ts +6 -6
  13. package/internal/types.d.ts.map +1 -1
  14. package/internal/utils/env.js +2 -2
  15. package/internal/utils/env.js.map +1 -1
  16. package/internal/utils/env.mjs +2 -2
  17. package/internal/utils/env.mjs.map +1 -1
  18. package/package.json +1 -1
  19. package/resources/accounts.d.mts +128 -86
  20. package/resources/accounts.d.mts.map +1 -1
  21. package/resources/accounts.d.ts +128 -86
  22. package/resources/accounts.d.ts.map +1 -1
  23. package/resources/aggregations.d.mts +43 -43
  24. package/resources/aggregations.d.mts.map +1 -1
  25. package/resources/aggregations.d.ts +43 -43
  26. package/resources/aggregations.d.ts.map +1 -1
  27. package/resources/apps.d.mts +177 -129
  28. package/resources/apps.d.mts.map +1 -1
  29. package/resources/apps.d.ts +177 -129
  30. package/resources/apps.d.ts.map +1 -1
  31. package/resources/client-auth.d.mts +650 -648
  32. package/resources/client-auth.d.mts.map +1 -1
  33. package/resources/client-auth.d.ts +650 -648
  34. package/resources/client-auth.d.ts.map +1 -1
  35. package/resources/embedded-wallets.d.mts +84 -84
  36. package/resources/embedded-wallets.d.mts.map +1 -1
  37. package/resources/embedded-wallets.d.ts +84 -84
  38. package/resources/embedded-wallets.d.ts.map +1 -1
  39. package/resources/funding.d.mts +42 -42
  40. package/resources/funding.d.mts.map +1 -1
  41. package/resources/funding.d.ts +42 -42
  42. package/resources/funding.d.ts.map +1 -1
  43. package/resources/index.d.mts +19 -18
  44. package/resources/index.d.mts.map +1 -1
  45. package/resources/index.d.ts +19 -18
  46. package/resources/index.d.ts.map +1 -1
  47. package/resources/index.js +3 -1
  48. package/resources/index.js.map +1 -1
  49. package/resources/index.mjs +2 -1
  50. package/resources/index.mjs.map +1 -1
  51. package/resources/intents.d.mts +270 -266
  52. package/resources/intents.d.mts.map +1 -1
  53. package/resources/intents.d.ts +270 -266
  54. package/resources/intents.d.ts.map +1 -1
  55. package/resources/key-quorums.d.mts +20 -20
  56. package/resources/key-quorums.d.mts.map +1 -1
  57. package/resources/key-quorums.d.ts +20 -20
  58. package/resources/key-quorums.d.ts.map +1 -1
  59. package/resources/kraken-embed.d.mts +62 -19
  60. package/resources/kraken-embed.d.mts.map +1 -1
  61. package/resources/kraken-embed.d.ts +62 -19
  62. package/resources/kraken-embed.d.ts.map +1 -1
  63. package/resources/organizations.d.mts +65 -0
  64. package/resources/organizations.d.mts.map +1 -0
  65. package/resources/organizations.d.ts +65 -0
  66. package/resources/organizations.d.ts.map +1 -0
  67. package/resources/organizations.js +9 -0
  68. package/resources/organizations.js.map +1 -0
  69. package/resources/organizations.mjs +5 -0
  70. package/resources/organizations.mjs.map +1 -0
  71. package/resources/policies.d.mts +360 -231
  72. package/resources/policies.d.mts.map +1 -1
  73. package/resources/policies.d.ts +360 -231
  74. package/resources/policies.d.ts.map +1 -1
  75. package/resources/shared.d.mts +28 -28
  76. package/resources/shared.d.mts.map +1 -1
  77. package/resources/shared.d.ts +28 -28
  78. package/resources/shared.d.ts.map +1 -1
  79. package/resources/swaps.d.mts +8 -11
  80. package/resources/swaps.d.mts.map +1 -1
  81. package/resources/swaps.d.ts +8 -11
  82. package/resources/swaps.d.ts.map +1 -1
  83. package/resources/swaps.js.map +1 -1
  84. package/resources/swaps.mjs.map +1 -1
  85. package/resources/transactions.d.mts +56 -66
  86. package/resources/transactions.d.mts.map +1 -1
  87. package/resources/transactions.d.ts +56 -66
  88. package/resources/transactions.d.ts.map +1 -1
  89. package/resources/users.d.mts +457 -448
  90. package/resources/users.d.mts.map +1 -1
  91. package/resources/users.d.ts +457 -448
  92. package/resources/users.d.ts.map +1 -1
  93. package/resources/wallet-actions.d.mts +450 -41
  94. package/resources/wallet-actions.d.mts.map +1 -1
  95. package/resources/wallet-actions.d.ts +450 -41
  96. package/resources/wallet-actions.d.ts.map +1 -1
  97. package/resources/wallets/balance.d.mts +2 -1
  98. package/resources/wallets/balance.d.mts.map +1 -1
  99. package/resources/wallets/balance.d.ts +2 -1
  100. package/resources/wallets/balance.d.ts.map +1 -1
  101. package/resources/wallets/balance.js.map +1 -1
  102. package/resources/wallets/balance.mjs.map +1 -1
  103. package/resources/wallets/index.d.mts +1 -1
  104. package/resources/wallets/index.d.mts.map +1 -1
  105. package/resources/wallets/index.d.ts +1 -1
  106. package/resources/wallets/index.d.ts.map +1 -1
  107. package/resources/wallets/index.js.map +1 -1
  108. package/resources/wallets/index.mjs.map +1 -1
  109. package/resources/wallets/transactions.d.mts +16 -31
  110. package/resources/wallets/transactions.d.mts.map +1 -1
  111. package/resources/wallets/transactions.d.ts +16 -31
  112. package/resources/wallets/transactions.d.ts.map +1 -1
  113. package/resources/wallets/transactions.js +1 -1
  114. package/resources/wallets/transactions.js.map +1 -1
  115. package/resources/wallets/transactions.mjs +1 -1
  116. package/resources/wallets/transactions.mjs.map +1 -1
  117. package/resources/wallets/wallets.d.mts +1475 -1172
  118. package/resources/wallets/wallets.d.mts.map +1 -1
  119. package/resources/wallets/wallets.d.ts +1475 -1172
  120. package/resources/wallets/wallets.d.ts.map +1 -1
  121. package/resources/wallets/wallets.js +10 -6
  122. package/resources/wallets/wallets.js.map +1 -1
  123. package/resources/wallets/wallets.mjs +10 -6
  124. package/resources/wallets/wallets.mjs.map +1 -1
  125. package/resources/webhooks.d.mts +1345 -582
  126. package/resources/webhooks.d.mts.map +1 -1
  127. package/resources/webhooks.d.ts +1345 -582
  128. package/resources/webhooks.d.ts.map +1 -1
  129. package/resources/yield.d.mts +157 -157
  130. package/resources/yield.d.mts.map +1 -1
  131. package/resources/yield.d.ts +157 -157
  132. package/resources/yield.d.ts.map +1 -1
  133. package/src/client.ts +661 -455
  134. package/src/internal/types.ts +6 -8
  135. package/src/internal/utils/env.ts +2 -2
  136. package/src/resources/accounts.ts +157 -103
  137. package/src/resources/aggregations.ts +55 -55
  138. package/src/resources/apps.ts +232 -166
  139. package/src/resources/client-auth.ts +890 -890
  140. package/src/resources/embedded-wallets.ts +123 -123
  141. package/src/resources/funding.ts +66 -66
  142. package/src/resources/index.ts +521 -431
  143. package/src/resources/intents.ts +326 -322
  144. package/src/resources/key-quorums.ts +23 -23
  145. package/src/resources/kraken-embed.ts +116 -19
  146. package/src/resources/organizations.ts +82 -0
  147. package/src/resources/policies.ts +495 -339
  148. package/src/resources/shared.ts +34 -34
  149. package/src/resources/swaps.ts +9 -14
  150. package/src/resources/transactions.ts +88 -115
  151. package/src/resources/users.ts +664 -653
  152. package/src/resources/wallet-actions.ts +585 -56
  153. package/src/resources/wallets/balance.ts +2 -1
  154. package/src/resources/wallets/index.ts +158 -138
  155. package/src/resources/wallets/transactions.ts +20 -83
  156. package/src/resources/wallets/wallets.ts +1997 -1563
  157. package/src/resources/webhooks.ts +1652 -700
  158. package/src/resources/yield.ts +188 -188
  159. package/src/version.ts +1 -1
  160. package/version.d.mts +1 -1
  161. package/version.d.mts.map +1 -1
  162. package/version.d.ts +1 -1
  163. package/version.d.ts.map +1 -1
  164. package/version.js +1 -1
  165. package/version.js.map +1 -1
  166. package/version.mjs +1 -1
  167. package/version.mjs.map +1 -1
@@ -146,38 +146,68 @@ export declare class Policies extends APIResource {
146
146
  getRule(ruleID: string, params: PolicyGetRuleParams, options?: RequestOptions): APIPromise<PolicyRuleResponse>;
147
147
  }
148
148
  /**
149
- * Unique ID of the condition set to take actions on.
149
+ * A parameter in a Solidity ABI function or event definition.
150
150
  */
151
- export interface ConditionSetRequestParams {
152
- condition_set_id: string;
151
+ export interface AbiParameter {
152
+ type: string;
153
+ components?: Array<{
154
+ [key: string]: unknown;
155
+ }>;
156
+ indexed?: boolean;
157
+ internalType?: string;
158
+ name?: string;
153
159
  }
154
160
  /**
155
- * Unique IDs of the condition set and the condition set item within the condition
156
- * set to take actions on.
161
+ * A Solidity ABI definition for decoding smart contract calldata.
157
162
  */
158
- export interface ConditionSetItemRequestParams {
159
- condition_set_id: string;
160
- condition_set_item_id: string;
163
+ export type AbiSchema = Array<AbiSchema.AbiSchemaItem>;
164
+ export declare namespace AbiSchema {
165
+ interface AbiSchemaItem {
166
+ type: 'function' | 'constructor' | 'event' | 'fallback' | 'receive';
167
+ anonymous?: boolean;
168
+ inputs?: Array<PoliciesAPI.AbiParameter>;
169
+ name?: string;
170
+ outputs?: Array<PoliciesAPI.AbiParameter>;
171
+ stateMutability?: 'pure' | 'view' | 'nonpayable' | 'payable';
172
+ }
161
173
  }
162
174
  /**
163
- * Request body for creating a condition set.
175
+ * Condition on the original wallet action API request body fields.
164
176
  */
165
- export interface ConditionSetRequestBody {
177
+ export interface ActionRequestBodyCondition {
178
+ field: string;
179
+ field_source: 'action_request_body';
166
180
  /**
167
- * Name to assign to condition set.
181
+ * Operator to use for policy conditions.
168
182
  */
169
- name: string;
183
+ operator: ConditionOperator;
170
184
  /**
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.
185
+ * Value to compare against in a policy condition. Can be a single string or an
186
+ * array of strings.
173
187
  */
174
- owner?: SharedAPI.OwnerInput | null;
188
+ value: ConditionValue;
189
+ }
190
+ /**
191
+ * Condition referencing an aggregation value. The field must start with
192
+ * "aggregation." followed by the aggregation ID.
193
+ */
194
+ export interface AggregationCondition {
195
+ field: string;
196
+ field_source: 'reference';
175
197
  /**
176
- * The key quorum ID to set as the owner of the resource. If you provide this, do
177
- * not specify an owner.
198
+ * Operator to use for policy conditions.
178
199
  */
179
- owner_id?: SharedAPI.OwnerIDInput | null;
200
+ operator: ConditionOperator;
201
+ /**
202
+ * Value to compare against in a policy condition. Can be a single string or an
203
+ * array of strings.
204
+ */
205
+ value: ConditionValue;
180
206
  }
207
+ /**
208
+ * Operator to use for policy conditions.
209
+ */
210
+ export type ConditionOperator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
181
211
  /**
182
212
  * A condition set for grouping related condition values.
183
213
  */
@@ -201,34 +231,24 @@ export interface ConditionSet {
201
231
  owner_id: SharedAPI.KeyQuorumID;
202
232
  }
203
233
  /**
204
- * Request body for updating a condition set.
234
+ * Headers required to authorize modifications to condition sets.
205
235
  */
206
- export interface UpdateConditionSetRequestBody {
236
+ export interface ConditionSetAuthorizationHeaders {
207
237
  /**
208
- * Name to assign to condition set.
238
+ * ID of your Privy app.
209
239
  */
210
- name?: string;
240
+ 'privy-app-id': string;
211
241
  /**
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.
242
+ * Request authorization signature. If multiple signatures are required, they
243
+ * should be comma separated.
214
244
  */
215
- owner?: SharedAPI.OwnerInput | null;
245
+ 'privy-authorization-signature'?: string;
216
246
  /**
217
- * The key quorum ID to set as the owner of the resource. If you provide this, do
218
- * not specify an owner.
247
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
248
+ * deadline by which the request must be processed.
219
249
  */
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;
250
+ 'privy-request-expiry'?: string;
227
251
  }
228
- /**
229
- * Array of values to add to the condition set. Maximum 100 items per request.
230
- */
231
- export type ConditionSetItemsRequestBody = Array<ConditionSetItemValueInput>;
232
252
  /**
233
253
  * A single item in a condition set.
234
254
  */
@@ -250,10 +270,28 @@ export interface ConditionSetItem {
250
270
  */
251
271
  value: string;
252
272
  }
273
+ /**
274
+ * Unique IDs of the condition set and the condition set item within the condition
275
+ * set to take actions on.
276
+ */
277
+ export interface ConditionSetItemRequestParams {
278
+ condition_set_id: string;
279
+ condition_set_item_id: string;
280
+ }
281
+ /**
282
+ * A single value to add to a condition set.
283
+ */
284
+ export interface ConditionSetItemValueInput {
285
+ value: string;
286
+ }
253
287
  /**
254
288
  * Array of condition set items.
255
289
  */
256
290
  export type ConditionSetItems = Array<ConditionSetItem>;
291
+ /**
292
+ * Array of values to add to the condition set. Maximum 100 items per request.
293
+ */
294
+ export type ConditionSetItemsRequestBody = Array<ConditionSetItemValueInput>;
257
295
  /**
258
296
  * Paginated list of condition set items.
259
297
  */
@@ -268,222 +306,201 @@ export interface ConditionSetItemsResponse {
268
306
  next_cursor: string | null;
269
307
  }
270
308
  /**
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.
309
+ * Request body for creating a condition set.
276
310
  */
277
- export interface AbiParameter {
278
- type: string;
279
- components?: Array<unknown>;
280
- indexed?: boolean;
281
- internalType?: string;
282
- name?: string;
311
+ export interface ConditionSetRequestBody {
312
+ /**
313
+ * Name to assign to condition set.
314
+ */
315
+ name: string;
316
+ /**
317
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
318
+ * null to remove the current owner.
319
+ */
320
+ owner?: SharedAPI.OwnerInput | null;
321
+ /**
322
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
323
+ * not specify an owner.
324
+ */
325
+ owner_id?: SharedAPI.OwnerIDInput | null;
283
326
  }
284
327
  /**
285
- * A Solidity ABI definition for decoding smart contract calldata.
328
+ * Unique ID of the condition set to take actions on.
286
329
  */
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
- }
330
+ export interface ConditionSetRequestParams {
331
+ condition_set_id: string;
297
332
  }
298
333
  /**
299
- * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
300
- * supported for command names.
334
+ * Value to compare against in a policy condition. Can be a single string or an
335
+ * array of strings.
301
336
  */
302
- export type SuiTransactionCommandOperator = 'eq' | 'in';
337
+ export type ConditionValue = string | Array<string>;
303
338
  /**
304
- * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
305
- * and 'amount' are supported.
306
- */
307
- export type SuiTransferObjectsCommandField = 'recipient' | 'amount';
308
- /**
309
- * TRON transaction fields for TransferContract and TriggerSmartContract
310
- * transaction types.
339
+ * Allowed contract addresses for eth_sign7702Authorization requests.
311
340
  */
312
- export interface TronTransactionCondition {
341
+ export interface Ethereum7702AuthorizationCondition {
342
+ field: 'contract';
343
+ field_source: 'ethereum_7702_authorization';
313
344
  /**
314
- * Supported TRON transaction fields in format "TransactionType.field_name"
345
+ * Operator to use for policy conditions.
315
346
  */
316
- field: 'TransferContract.to_address' | 'TransferContract.amount' | 'TriggerSmartContract.contract_address' | 'TriggerSmartContract.call_value' | 'TriggerSmartContract.token_id' | 'TriggerSmartContract.call_token_value';
317
- field_source: 'tron_transaction';
318
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
319
- value: string | Array<string>;
347
+ operator: ConditionOperator;
348
+ /**
349
+ * Value to compare against in a policy condition. Can be a single string or an
350
+ * array of strings.
351
+ */
352
+ value: ConditionValue;
320
353
  }
321
354
  /**
322
- * Decoded calldata from a TRON TriggerSmartContract interaction.
355
+ * The decoded calldata in a smart contract interaction as the smart contract
356
+ * method's parameters. Note that 'ethereum_calldata' conditions must contain an
357
+ * abi parameter with the JSON ABI of the smart contract.
323
358
  */
324
- export interface TronCalldataCondition {
359
+ export interface EthereumCalldataCondition {
325
360
  /**
326
361
  * A Solidity ABI definition for decoding smart contract calldata.
327
362
  */
328
363
  abi: AbiSchema;
329
364
  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>;
365
+ field_source: 'ethereum_calldata';
366
+ /**
367
+ * Operator to use for policy conditions.
368
+ */
369
+ operator: ConditionOperator;
370
+ /**
371
+ * Value to compare against in a policy condition. Can be a single string or an
372
+ * array of strings.
373
+ */
374
+ value: ConditionValue;
333
375
  }
334
376
  /**
335
- * SUI transaction command attributes, enables allowlisting specific command types.
336
- * Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and
337
- * 'in' operators are supported.
377
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
378
+ * eth_sendTransaction request.
338
379
  */
339
- export interface SuiTransactionCommandCondition {
340
- field: 'commandName';
341
- field_source: 'sui_transaction_command';
380
+ export interface EthereumTransactionCondition {
381
+ field: 'to' | 'value' | 'chain_id';
382
+ field_source: 'ethereum_transaction';
342
383
  /**
343
- * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
344
- * supported for command names.
384
+ * Operator to use for policy conditions.
345
385
  */
346
- operator: SuiTransactionCommandOperator;
386
+ operator: ConditionOperator;
347
387
  /**
348
- * Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins',
349
- * 'MergeCoins'
388
+ * Value to compare against in a policy condition. Can be a single string or an
389
+ * array of strings.
350
390
  */
351
- value: WalletsAPI.SuiCommandName | Array<WalletsAPI.SuiCommandName>;
391
+ value: ConditionValue;
352
392
  }
353
393
  /**
354
- * SUI TransferObjects command attributes, including recipient and amount fields.
394
+ * Attributes from the signing domain that will verify the signature.
355
395
  */
356
- export interface SuiTransferObjectsCommandCondition {
396
+ export interface EthereumTypedDataDomainCondition {
397
+ field: 'chainId' | 'verifyingContract' | 'chain_id' | 'verifying_contract';
398
+ field_source: 'ethereum_typed_data_domain';
357
399
  /**
358
- * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
359
- * and 'amount' are supported.
400
+ * Operator to use for policy conditions.
360
401
  */
361
- field: SuiTransferObjectsCommandField;
362
- field_source: 'sui_transfer_objects_command';
363
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
364
- value: string | Array<string>;
402
+ operator: ConditionOperator;
403
+ /**
404
+ * Value to compare against in a policy condition. Can be a single string or an
405
+ * array of strings.
406
+ */
407
+ value: ConditionValue;
365
408
  }
366
409
  /**
367
- * Condition referencing an aggregation value. The field must start with
368
- * "aggregation." followed by the aggregation ID.
410
+ * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
411
+ * EIP-712.
369
412
  */
370
- export interface AggregationCondition {
413
+ export interface EthereumTypedDataMessageCondition {
371
414
  field: string;
372
- field_source: 'reference';
373
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
374
- value: string | Array<string>;
375
- }
376
- /**
377
- * A condition that must be true for the rule action to be applied.
378
- */
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 {
415
+ field_source: 'ethereum_typed_data_message';
381
416
  /**
382
- * The verbatim Ethereum transaction object in an eth_signTransaction or
383
- * eth_sendTransaction request.
417
+ * Operator to use for policy conditions.
384
418
  */
385
- interface EthereumTransactionCondition {
386
- field: 'to' | 'value' | 'chain_id';
387
- field_source: 'ethereum_transaction';
388
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
389
- value: string | Array<string>;
390
- }
419
+ operator: ConditionOperator;
420
+ typed_data: EthereumTypedDataMessageCondition.TypedData;
391
421
  /**
392
- * The decoded calldata in a smart contract interaction as the smart contract
393
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
394
- * an abi parameter with the JSON ABI of the smart contract.
422
+ * Value to compare against in a policy condition. Can be a single string or an
423
+ * array of strings.
395
424
  */
396
- interface EthereumCalldataCondition {
425
+ value: ConditionValue;
426
+ }
427
+ export declare namespace EthereumTypedDataMessageCondition {
428
+ interface TypedData {
429
+ primary_type: string;
397
430
  /**
398
- * A Solidity ABI definition for decoding smart contract calldata.
431
+ * The type definitions for EIP-712 typed data signing.
399
432
  */
400
- abi: PoliciesAPI.AbiSchema;
401
- field: string;
402
- field_source: 'ethereum_calldata';
403
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
404
- value: string | Array<string>;
433
+ types: WalletsAPI.TypedDataTypesInputParams;
405
434
  }
435
+ }
436
+ /**
437
+ * A policy for controlling wallet operations.
438
+ */
439
+ export interface Policy {
406
440
  /**
407
- * Attributes from the signing domain that will verify the signature.
441
+ * Unique ID of the created policy. This will be the primary identifier when using
442
+ * the policy in the future.
408
443
  */
409
- interface EthereumTypedDataDomainCondition {
410
- field: 'chainId' | 'verifyingContract' | 'chain_id' | 'verifying_contract';
411
- field_source: 'ethereum_typed_data_domain';
412
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
413
- value: string | Array<string>;
414
- }
444
+ id: string;
415
445
  /**
416
- * 'types' and 'primary_type' attributes of the TypedData JSON object defined in
417
- * EIP-712.
446
+ * The wallet chain types.
418
447
  */
419
- interface EthereumTypedDataMessageCondition {
420
- field: string;
421
- field_source: 'ethereum_typed_data_message';
422
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
423
- typed_data: EthereumTypedDataMessageCondition.TypedData;
424
- value: string | Array<string>;
425
- }
426
- namespace EthereumTypedDataMessageCondition {
427
- interface TypedData {
428
- primary_type: string;
429
- /**
430
- * The type definitions for EIP-712 typed data signing.
431
- */
432
- types: WalletsAPI.TypedDataTypesInputParams;
433
- }
434
- }
448
+ chain_type: WalletsAPI.WalletChainType;
435
449
  /**
436
- * Allowed contract addresses for eth_sign7702Authorization requests.
450
+ * Unix timestamp of when the policy was created in milliseconds.
437
451
  */
438
- interface Ethereum7702AuthorizationCondition {
439
- field: 'contract';
440
- field_source: 'ethereum_7702_authorization';
441
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
442
- value: string | Array<string>;
443
- }
452
+ created_at: number;
444
453
  /**
445
- * Solana Program attributes, enables allowlisting Solana Programs.
454
+ * Name to assign to policy.
446
455
  */
447
- interface SolanaProgramInstructionCondition {
448
- field: 'programId';
449
- field_source: 'solana_program_instruction';
450
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
451
- value: string | Array<string>;
452
- }
456
+ name: string;
453
457
  /**
454
- * Solana System Program attributes, including more granular Transfer instruction
455
- * fields.
458
+ * The key quorum ID of the owner of the policy.
456
459
  */
457
- interface SolanaSystemProgramInstructionCondition {
458
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
459
- field_source: 'solana_system_program_instruction';
460
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
461
- value: string | Array<string>;
462
- }
460
+ owner_id: string | null;
461
+ rules: Array<PolicyRuleResponse>;
463
462
  /**
464
- * Solana Token Program attributes, including more granular TransferChecked
465
- * instruction fields.
463
+ * Version of the policy. Currently, 1.0 is the only version.
466
464
  */
467
- interface SolanaTokenProgramInstructionCondition {
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';
469
- field_source: 'solana_token_program_instruction';
470
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
471
- value: string | Array<string>;
472
- }
465
+ version: '1.0';
466
+ }
467
+ /**
468
+ * The action to take when a policy rule matches.
469
+ */
470
+ export type PolicyAction = 'ALLOW' | 'DENY';
471
+ /**
472
+ * Headers required to authorize modifications to policies.
473
+ */
474
+ export interface PolicyAuthorizationHeaders {
473
475
  /**
474
- * System attributes, including current unix timestamp (in seconds).
476
+ * ID of your Privy app.
475
477
  */
476
- interface SystemCondition {
477
- field: 'current_unix_timestamp';
478
- field_source: 'system';
479
- operator: 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
480
- value: string | Array<string>;
481
- }
478
+ 'privy-app-id': string;
479
+ /**
480
+ * Request authorization signature. If multiple signatures are required, they
481
+ * should be comma separated.
482
+ */
483
+ 'privy-authorization-signature'?: string;
484
+ /**
485
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
486
+ * deadline by which the request must be processed.
487
+ */
488
+ 'privy-request-expiry'?: string;
482
489
  }
490
+ /**
491
+ * A condition that must be true for the rule action to be applied.
492
+ */
493
+ export type PolicyCondition = EthereumTransactionCondition | EthereumCalldataCondition | EthereumTypedDataDomainCondition | EthereumTypedDataMessageCondition | Ethereum7702AuthorizationCondition | SolanaProgramInstructionCondition | SolanaSystemProgramInstructionCondition | SolanaTokenProgramInstructionCondition | SystemCondition | TronTransactionCondition | TronCalldataCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition | ActionRequestBodyCondition | AggregationCondition;
483
494
  /**
484
495
  * Method the rule applies to.
485
496
  */
486
- export type PolicyMethod = 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'wallet_sendCalls' | 'signTransaction' | 'signAndSendTransaction' | 'exportPrivateKey' | 'exportSeedPhrase' | 'signTransactionBytes' | '*';
497
+ export type PolicyMethod = 'eth_sendTransaction' | 'eth_signTransaction' | 'eth_signUserOperation' | 'eth_signTypedData_v4' | 'eth_sign7702Authorization' | 'personal_sign' | 'wallet_sendCalls' | 'signTransaction' | 'signAndSendTransaction' | 'signMessage' | 'exportPrivateKey' | 'exportSeedPhrase' | 'signTransactionBytes' | 'earn_deposit' | 'earn_withdraw' | 'transfer' | '*';
498
+ /**
499
+ * Unique ID of the policy to take actions on.
500
+ */
501
+ export interface PolicyRequestBody {
502
+ policy_id: string;
503
+ }
487
504
  /**
488
505
  * The rules that apply to each method the policy covers.
489
506
  */
@@ -499,6 +516,13 @@ export interface PolicyRuleRequestBody {
499
516
  method: PolicyMethod;
500
517
  name: string;
501
518
  }
519
+ /**
520
+ * Unique IDs of the policy and the rule within the policy to take actions on.
521
+ */
522
+ export interface PolicyRuleRequestParams {
523
+ policy_id: string;
524
+ rule_id: string;
525
+ }
502
526
  /**
503
527
  * A rule that defines the conditions and action to take if the conditions are
504
528
  * true.
@@ -517,73 +541,178 @@ export interface PolicyRuleResponse {
517
541
  name: string;
518
542
  }
519
543
  /**
520
- * A policy for controlling wallet operations.
544
+ * Solana Program attributes, enables allowlisting Solana Programs.
521
545
  */
522
- export interface Policy {
546
+ export interface SolanaProgramInstructionCondition {
547
+ field: 'programId';
548
+ field_source: 'solana_program_instruction';
523
549
  /**
524
- * Unique ID of the created policy. This will be the primary identifier when using
525
- * the policy in the future.
550
+ * Operator to use for policy conditions.
526
551
  */
527
- id: string;
552
+ operator: ConditionOperator;
528
553
  /**
529
- * The wallet chain types.
554
+ * Value to compare against in a policy condition. Can be a single string or an
555
+ * array of strings.
530
556
  */
531
- chain_type: WalletsAPI.WalletChainType;
557
+ value: ConditionValue;
558
+ }
559
+ /**
560
+ * Solana System Program attributes, including more granular Transfer instruction
561
+ * fields.
562
+ */
563
+ export interface SolanaSystemProgramInstructionCondition {
564
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
565
+ field_source: 'solana_system_program_instruction';
532
566
  /**
533
- * Unix timestamp of when the policy was created in milliseconds.
567
+ * Operator to use for policy conditions.
534
568
  */
535
- created_at: number;
569
+ operator: ConditionOperator;
536
570
  /**
537
- * Name to assign to policy.
571
+ * Value to compare against in a policy condition. Can be a single string or an
572
+ * array of strings.
538
573
  */
539
- name: string;
574
+ value: ConditionValue;
575
+ }
576
+ /**
577
+ * Solana Token Program attributes, including more granular TransferChecked
578
+ * instruction fields.
579
+ */
580
+ export interface SolanaTokenProgramInstructionCondition {
581
+ 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';
582
+ field_source: 'solana_token_program_instruction';
540
583
  /**
541
- * The key quorum ID of the owner of the policy.
584
+ * Operator to use for policy conditions.
542
585
  */
543
- owner_id: string | null;
544
- rules: Array<PolicyRuleResponse>;
586
+ operator: ConditionOperator;
545
587
  /**
546
- * Version of the policy. Currently, 1.0 is the only version.
588
+ * Value to compare against in a policy condition. Can be a single string or an
589
+ * array of strings.
547
590
  */
548
- version: '1.0';
591
+ value: ConditionValue;
549
592
  }
550
593
  /**
551
- * Headers required to authorize modifications to policies.
594
+ * SUI transaction command attributes, enables allowlisting specific command types.
595
+ * Allowed commands: 'TransferObjects', 'SplitCoins', 'MergeCoins'. Only 'eq' and
596
+ * 'in' operators are supported.
552
597
  */
553
- export interface PolicyAuthorizationHeaders {
598
+ export interface SuiTransactionCommandCondition {
599
+ field: 'commandName';
600
+ field_source: 'sui_transaction_command';
554
601
  /**
555
- * ID of your Privy app.
602
+ * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
603
+ * supported for command names.
556
604
  */
557
- 'privy-app-id': string;
605
+ operator: SuiTransactionCommandOperator;
558
606
  /**
559
- * Request authorization signature. If multiple signatures are required, they
560
- * should be comma separated.
607
+ * Command name(s) to match. Must be one of: 'TransferObjects', 'SplitCoins',
608
+ * 'MergeCoins'
561
609
  */
562
- 'privy-authorization-signature'?: string;
610
+ value: WalletsAPI.SuiCommandName | Array<WalletsAPI.SuiCommandName>;
611
+ }
612
+ /**
613
+ * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
614
+ * supported for command names.
615
+ */
616
+ export type SuiTransactionCommandOperator = 'eq' | 'in';
617
+ /**
618
+ * SUI TransferObjects command attributes, including recipient and amount fields.
619
+ */
620
+ export interface SuiTransferObjectsCommandCondition {
563
621
  /**
564
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
565
- * deadline by which the request must be processed.
622
+ * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
623
+ * and 'amount' are supported.
566
624
  */
567
- 'privy-request-expiry'?: string;
625
+ field: SuiTransferObjectsCommandField;
626
+ field_source: 'sui_transfer_objects_command';
627
+ /**
628
+ * Operator to use for policy conditions.
629
+ */
630
+ operator: ConditionOperator;
631
+ /**
632
+ * Value to compare against in a policy condition. Can be a single string or an
633
+ * array of strings.
634
+ */
635
+ value: ConditionValue;
568
636
  }
569
637
  /**
570
- * Headers required to authorize modifications to condition sets.
638
+ * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
639
+ * and 'amount' are supported.
571
640
  */
572
- export interface ConditionSetAuthorizationHeaders {
641
+ export type SuiTransferObjectsCommandField = 'recipient' | 'amount';
642
+ /**
643
+ * System attributes, including current unix timestamp (in seconds).
644
+ */
645
+ export interface SystemCondition {
646
+ field: 'current_unix_timestamp';
647
+ field_source: 'system';
573
648
  /**
574
- * ID of your Privy app.
649
+ * Operator to use for policy conditions.
575
650
  */
576
- 'privy-app-id': string;
651
+ operator: ConditionOperator;
577
652
  /**
578
- * Request authorization signature. If multiple signatures are required, they
579
- * should be comma separated.
653
+ * Value to compare against in a policy condition. Can be a single string or an
654
+ * array of strings.
580
655
  */
581
- 'privy-authorization-signature'?: string;
656
+ value: ConditionValue;
657
+ }
658
+ /**
659
+ * Decoded calldata from a TRON TriggerSmartContract interaction.
660
+ */
661
+ export interface TronCalldataCondition {
582
662
  /**
583
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
584
- * deadline by which the request must be processed.
663
+ * A Solidity ABI definition for decoding smart contract calldata.
585
664
  */
586
- 'privy-request-expiry'?: string;
665
+ abi: AbiSchema;
666
+ field: string;
667
+ field_source: 'tron_trigger_smart_contract_data';
668
+ /**
669
+ * Operator to use for policy conditions.
670
+ */
671
+ operator: ConditionOperator;
672
+ /**
673
+ * Value to compare against in a policy condition. Can be a single string or an
674
+ * array of strings.
675
+ */
676
+ value: ConditionValue;
677
+ }
678
+ /**
679
+ * TRON transaction fields for TransferContract and TriggerSmartContract
680
+ * transaction types.
681
+ */
682
+ export interface TronTransactionCondition {
683
+ /**
684
+ * Supported TRON transaction fields in format "TransactionType.field_name"
685
+ */
686
+ field: 'TransferContract.to_address' | 'TransferContract.amount' | 'TriggerSmartContract.contract_address' | 'TriggerSmartContract.call_value' | 'TriggerSmartContract.token_id' | 'TriggerSmartContract.call_token_value';
687
+ field_source: 'tron_transaction';
688
+ /**
689
+ * Operator to use for policy conditions.
690
+ */
691
+ operator: ConditionOperator;
692
+ /**
693
+ * Value to compare against in a policy condition. Can be a single string or an
694
+ * array of strings.
695
+ */
696
+ value: ConditionValue;
697
+ }
698
+ /**
699
+ * Request body for updating a condition set.
700
+ */
701
+ export interface UpdateConditionSetRequestBody {
702
+ /**
703
+ * Name to assign to condition set.
704
+ */
705
+ name?: string;
706
+ /**
707
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
708
+ * null to remove the current owner.
709
+ */
710
+ owner?: SharedAPI.OwnerInput | null;
711
+ /**
712
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
713
+ * not specify an owner.
714
+ */
715
+ owner_id?: SharedAPI.OwnerIDInput | null;
587
716
  }
588
717
  export interface PolicyCreateParams {
589
718
  /**
@@ -755,6 +884,6 @@ export interface PolicyGetRuleParams {
755
884
  policy_id: string;
756
885
  }
757
886
  export declare namespace Policies {
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, };
887
+ export { type AbiParameter as AbiParameter, type AbiSchema as AbiSchema, type ActionRequestBodyCondition as ActionRequestBodyCondition, type AggregationCondition as AggregationCondition, type ConditionOperator as ConditionOperator, type ConditionSet as ConditionSet, type ConditionSetAuthorizationHeaders as ConditionSetAuthorizationHeaders, type ConditionSetItem as ConditionSetItem, type ConditionSetItemRequestParams as ConditionSetItemRequestParams, type ConditionSetItemValueInput as ConditionSetItemValueInput, type ConditionSetItems as ConditionSetItems, type ConditionSetItemsRequestBody as ConditionSetItemsRequestBody, type ConditionSetItemsResponse as ConditionSetItemsResponse, type ConditionSetRequestBody as ConditionSetRequestBody, type ConditionSetRequestParams as ConditionSetRequestParams, type ConditionValue as ConditionValue, type Ethereum7702AuthorizationCondition as Ethereum7702AuthorizationCondition, type EthereumCalldataCondition as EthereumCalldataCondition, type EthereumTransactionCondition as EthereumTransactionCondition, type EthereumTypedDataDomainCondition as EthereumTypedDataDomainCondition, type EthereumTypedDataMessageCondition as EthereumTypedDataMessageCondition, type Policy as Policy, type PolicyAction as PolicyAction, type PolicyAuthorizationHeaders as PolicyAuthorizationHeaders, type PolicyCondition as PolicyCondition, type PolicyMethod as PolicyMethod, type PolicyRequestBody as PolicyRequestBody, type PolicyRuleRequestBody as PolicyRuleRequestBody, type PolicyRuleRequestParams as PolicyRuleRequestParams, type PolicyRuleResponse as PolicyRuleResponse, type SolanaProgramInstructionCondition as SolanaProgramInstructionCondition, type SolanaSystemProgramInstructionCondition as SolanaSystemProgramInstructionCondition, type SolanaTokenProgramInstructionCondition as SolanaTokenProgramInstructionCondition, type SuiTransactionCommandCondition as SuiTransactionCommandCondition, type SuiTransactionCommandOperator as SuiTransactionCommandOperator, type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition, type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField, type SystemCondition as SystemCondition, type TronCalldataCondition as TronCalldataCondition, type TronTransactionCondition as TronTransactionCondition, type UpdateConditionSetRequestBody as UpdateConditionSetRequestBody, 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, };
759
888
  }
760
889
  //# sourceMappingURL=policies.d.ts.map