@privy-io/api-types 0.9.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 (153) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/client.d.mts +33 -30
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +33 -30
  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 +23 -9
  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/package.json +1 -1
  15. package/resources/accounts.d.mts +128 -86
  16. package/resources/accounts.d.mts.map +1 -1
  17. package/resources/accounts.d.ts +128 -86
  18. package/resources/accounts.d.ts.map +1 -1
  19. package/resources/aggregations.d.mts +43 -43
  20. package/resources/aggregations.d.mts.map +1 -1
  21. package/resources/aggregations.d.ts +43 -43
  22. package/resources/aggregations.d.ts.map +1 -1
  23. package/resources/apps.d.mts +169 -135
  24. package/resources/apps.d.mts.map +1 -1
  25. package/resources/apps.d.ts +169 -135
  26. package/resources/apps.d.ts.map +1 -1
  27. package/resources/client-auth.d.mts +646 -644
  28. package/resources/client-auth.d.mts.map +1 -1
  29. package/resources/client-auth.d.ts +646 -644
  30. package/resources/client-auth.d.ts.map +1 -1
  31. package/resources/embedded-wallets.d.mts +114 -114
  32. package/resources/embedded-wallets.d.mts.map +1 -1
  33. package/resources/embedded-wallets.d.ts +114 -114
  34. package/resources/embedded-wallets.d.ts.map +1 -1
  35. package/resources/funding.d.mts +42 -42
  36. package/resources/funding.d.mts.map +1 -1
  37. package/resources/funding.d.ts +42 -42
  38. package/resources/funding.d.ts.map +1 -1
  39. package/resources/index.d.mts +19 -18
  40. package/resources/index.d.mts.map +1 -1
  41. package/resources/index.d.ts +19 -18
  42. package/resources/index.d.ts.map +1 -1
  43. package/resources/index.js +3 -1
  44. package/resources/index.js.map +1 -1
  45. package/resources/index.mjs +2 -1
  46. package/resources/index.mjs.map +1 -1
  47. package/resources/intents.d.mts +269 -265
  48. package/resources/intents.d.mts.map +1 -1
  49. package/resources/intents.d.ts +269 -265
  50. package/resources/intents.d.ts.map +1 -1
  51. package/resources/key-quorums.d.mts +20 -20
  52. package/resources/key-quorums.d.mts.map +1 -1
  53. package/resources/key-quorums.d.ts +20 -20
  54. package/resources/key-quorums.d.ts.map +1 -1
  55. package/resources/kraken-embed.d.mts +12 -20
  56. package/resources/kraken-embed.d.mts.map +1 -1
  57. package/resources/kraken-embed.d.ts +12 -20
  58. package/resources/kraken-embed.d.ts.map +1 -1
  59. package/resources/organizations.d.mts +65 -0
  60. package/resources/organizations.d.mts.map +1 -0
  61. package/resources/organizations.d.ts +65 -0
  62. package/resources/organizations.d.ts.map +1 -0
  63. package/resources/organizations.js +9 -0
  64. package/resources/organizations.js.map +1 -0
  65. package/resources/organizations.mjs +5 -0
  66. package/resources/organizations.mjs.map +1 -0
  67. package/resources/policies.d.mts +258 -240
  68. package/resources/policies.d.mts.map +1 -1
  69. package/resources/policies.d.ts +258 -240
  70. package/resources/policies.d.ts.map +1 -1
  71. package/resources/shared.d.mts +28 -28
  72. package/resources/shared.d.mts.map +1 -1
  73. package/resources/shared.d.ts +28 -28
  74. package/resources/shared.d.ts.map +1 -1
  75. package/resources/swaps.d.mts +6 -9
  76. package/resources/swaps.d.mts.map +1 -1
  77. package/resources/swaps.d.ts +6 -9
  78. package/resources/swaps.d.ts.map +1 -1
  79. package/resources/swaps.js.map +1 -1
  80. package/resources/swaps.mjs.map +1 -1
  81. package/resources/transactions.d.mts +53 -53
  82. package/resources/transactions.d.mts.map +1 -1
  83. package/resources/transactions.d.ts +53 -53
  84. package/resources/transactions.d.ts.map +1 -1
  85. package/resources/users.d.mts +468 -459
  86. package/resources/users.d.mts.map +1 -1
  87. package/resources/users.d.ts +468 -459
  88. package/resources/users.d.ts.map +1 -1
  89. package/resources/wallet-actions.d.mts +302 -145
  90. package/resources/wallet-actions.d.mts.map +1 -1
  91. package/resources/wallet-actions.d.ts +302 -145
  92. package/resources/wallet-actions.d.ts.map +1 -1
  93. package/resources/wallets/index.d.mts +1 -1
  94. package/resources/wallets/index.d.mts.map +1 -1
  95. package/resources/wallets/index.d.ts +1 -1
  96. package/resources/wallets/index.d.ts.map +1 -1
  97. package/resources/wallets/index.js.map +1 -1
  98. package/resources/wallets/index.mjs.map +1 -1
  99. package/resources/wallets/transactions.d.mts +7 -2
  100. package/resources/wallets/transactions.d.mts.map +1 -1
  101. package/resources/wallets/transactions.d.ts +7 -2
  102. package/resources/wallets/transactions.d.ts.map +1 -1
  103. package/resources/wallets/transactions.js +1 -1
  104. package/resources/wallets/transactions.mjs +1 -1
  105. package/resources/wallets/wallets.d.mts +1424 -1227
  106. package/resources/wallets/wallets.d.mts.map +1 -1
  107. package/resources/wallets/wallets.d.ts +1424 -1227
  108. package/resources/wallets/wallets.d.ts.map +1 -1
  109. package/resources/wallets/wallets.js +4 -1
  110. package/resources/wallets/wallets.js.map +1 -1
  111. package/resources/wallets/wallets.mjs +4 -1
  112. package/resources/wallets/wallets.mjs.map +1 -1
  113. package/resources/webhooks.d.mts +935 -877
  114. package/resources/webhooks.d.mts.map +1 -1
  115. package/resources/webhooks.d.ts +935 -877
  116. package/resources/webhooks.d.ts.map +1 -1
  117. package/resources/yield.d.mts +157 -157
  118. package/resources/yield.d.mts.map +1 -1
  119. package/resources/yield.d.ts +157 -157
  120. package/resources/yield.d.ts.map +1 -1
  121. package/src/client.ts +594 -516
  122. package/src/internal/types.ts +6 -8
  123. package/src/resources/accounts.ts +157 -103
  124. package/src/resources/aggregations.ts +55 -55
  125. package/src/resources/apps.ts +221 -178
  126. package/src/resources/client-auth.ts +887 -887
  127. package/src/resources/embedded-wallets.ts +150 -150
  128. package/src/resources/funding.ts +66 -66
  129. package/src/resources/index.ts +504 -475
  130. package/src/resources/intents.ts +326 -322
  131. package/src/resources/key-quorums.ts +23 -23
  132. package/src/resources/kraken-embed.ts +14 -22
  133. package/src/resources/organizations.ts +82 -0
  134. package/src/resources/policies.ts +379 -352
  135. package/src/resources/shared.ts +34 -34
  136. package/src/resources/swaps.ts +5 -10
  137. package/src/resources/transactions.ts +86 -86
  138. package/src/resources/users.ts +707 -696
  139. package/src/resources/wallet-actions.ts +392 -185
  140. package/src/resources/wallets/index.ts +157 -148
  141. package/src/resources/wallets/transactions.ts +18 -3
  142. package/src/resources/wallets/wallets.ts +1937 -1686
  143. package/src/resources/webhooks.ts +1172 -1100
  144. package/src/resources/yield.ts +188 -188
  145. package/src/version.ts +1 -1
  146. package/version.d.mts +1 -1
  147. package/version.d.mts.map +1 -1
  148. package/version.d.ts +1 -1
  149. package/version.d.ts.map +1 -1
  150. package/version.js +1 -1
  151. package/version.js.map +1 -1
  152. package/version.mjs +1 -1
  153. 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,59 +306,41 @@ 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
- /**
299
- * Operator to use for policy conditions.
300
- */
301
- export type ConditionOperator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
302
333
  /**
303
334
  * Value to compare against in a policy condition. Can be a single string or an
304
335
  * array of strings.
305
336
  */
306
337
  export type ConditionValue = string | Array<string>;
307
338
  /**
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.
339
+ * Allowed contract addresses for eth_sign7702Authorization requests.
320
340
  */
321
- export interface EthereumTransactionCondition {
322
- field: 'to' | 'value' | 'chain_id';
323
- field_source: 'ethereum_transaction';
341
+ export interface Ethereum7702AuthorizationCondition {
342
+ field: 'contract';
343
+ field_source: 'ethereum_7702_authorization';
324
344
  /**
325
345
  * Operator to use for policy conditions.
326
346
  */
@@ -333,8 +353,8 @@ export interface EthereumTransactionCondition {
333
353
  }
334
354
  /**
335
355
  * 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.
356
+ * method's parameters. Note that 'ethereum_calldata' conditions must contain an
357
+ * abi parameter with the JSON ABI of the smart contract.
338
358
  */
339
359
  export interface EthereumCalldataCondition {
340
360
  /**
@@ -353,6 +373,23 @@ export interface EthereumCalldataCondition {
353
373
  */
354
374
  value: ConditionValue;
355
375
  }
376
+ /**
377
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
378
+ * eth_sendTransaction request.
379
+ */
380
+ export interface EthereumTransactionCondition {
381
+ field: 'to' | 'value' | 'chain_id';
382
+ field_source: 'ethereum_transaction';
383
+ /**
384
+ * Operator to use for policy conditions.
385
+ */
386
+ operator: ConditionOperator;
387
+ /**
388
+ * Value to compare against in a policy condition. Can be a single string or an
389
+ * array of strings.
390
+ */
391
+ value: ConditionValue;
392
+ }
356
393
  /**
357
394
  * Attributes from the signing domain that will verify the signature.
358
395
  */
@@ -397,77 +434,118 @@ export declare namespace EthereumTypedDataMessageCondition {
397
434
  }
398
435
  }
399
436
  /**
400
- * Allowed contract addresses for eth_sign7702Authorization requests.
437
+ * A policy for controlling wallet operations.
401
438
  */
402
- export interface Ethereum7702AuthorizationCondition {
403
- field: 'contract';
404
- field_source: 'ethereum_7702_authorization';
439
+ export interface Policy {
405
440
  /**
406
- * Operator to use for policy conditions.
441
+ * Unique ID of the created policy. This will be the primary identifier when using
442
+ * the policy in the future.
407
443
  */
408
- operator: ConditionOperator;
444
+ id: string;
409
445
  /**
410
- * Value to compare against in a policy condition. Can be a single string or an
411
- * array of strings.
446
+ * The wallet chain types.
412
447
  */
413
- value: ConditionValue;
448
+ chain_type: WalletsAPI.WalletChainType;
449
+ /**
450
+ * Unix timestamp of when the policy was created in milliseconds.
451
+ */
452
+ created_at: number;
453
+ /**
454
+ * Name to assign to policy.
455
+ */
456
+ name: string;
457
+ /**
458
+ * The key quorum ID of the owner of the policy.
459
+ */
460
+ owner_id: string | null;
461
+ rules: Array<PolicyRuleResponse>;
462
+ /**
463
+ * Version of the policy. Currently, 1.0 is the only version.
464
+ */
465
+ version: '1.0';
414
466
  }
415
467
  /**
416
- * Solana Program attributes, enables allowlisting Solana Programs.
468
+ * The action to take when a policy rule matches.
417
469
  */
418
- export interface SolanaProgramInstructionCondition {
419
- field: 'programId';
420
- field_source: 'solana_program_instruction';
470
+ export type PolicyAction = 'ALLOW' | 'DENY';
471
+ /**
472
+ * Headers required to authorize modifications to policies.
473
+ */
474
+ export interface PolicyAuthorizationHeaders {
421
475
  /**
422
- * Operator to use for policy conditions.
476
+ * ID of your Privy app.
423
477
  */
424
- operator: ConditionOperator;
478
+ 'privy-app-id': string;
425
479
  /**
426
- * Value to compare against in a policy condition. Can be a single string or an
427
- * array of strings.
480
+ * Request authorization signature. If multiple signatures are required, they
481
+ * should be comma separated.
428
482
  */
429
- value: ConditionValue;
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;
430
489
  }
431
490
  /**
432
- * Solana System Program attributes, including more granular Transfer instruction
433
- * fields.
491
+ * A condition that must be true for the rule action to be applied.
434
492
  */
435
- export interface SolanaSystemProgramInstructionCondition {
436
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
437
- field_source: 'solana_system_program_instruction';
493
+ export type PolicyCondition = EthereumTransactionCondition | EthereumCalldataCondition | EthereumTypedDataDomainCondition | EthereumTypedDataMessageCondition | Ethereum7702AuthorizationCondition | SolanaProgramInstructionCondition | SolanaSystemProgramInstructionCondition | SolanaTokenProgramInstructionCondition | SystemCondition | TronTransactionCondition | TronCalldataCondition | SuiTransactionCommandCondition | SuiTransferObjectsCommandCondition | ActionRequestBodyCondition | AggregationCondition;
494
+ /**
495
+ * Method the rule applies to.
496
+ */
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
+ }
504
+ /**
505
+ * The rules that apply to each method the policy covers.
506
+ */
507
+ export interface PolicyRuleRequestBody {
438
508
  /**
439
- * Operator to use for policy conditions.
509
+ * The action to take when a policy rule matches.
440
510
  */
441
- operator: ConditionOperator;
511
+ action: PolicyAction;
512
+ conditions: Array<PolicyCondition>;
442
513
  /**
443
- * Value to compare against in a policy condition. Can be a single string or an
444
- * array of strings.
514
+ * Method the rule applies to.
445
515
  */
446
- value: ConditionValue;
516
+ method: PolicyMethod;
517
+ name: string;
447
518
  }
448
519
  /**
449
- * Solana Token Program attributes, including more granular TransferChecked
450
- * instruction fields.
520
+ * Unique IDs of the policy and the rule within the policy to take actions on.
451
521
  */
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';
522
+ export interface PolicyRuleRequestParams {
523
+ policy_id: string;
524
+ rule_id: string;
525
+ }
526
+ /**
527
+ * A rule that defines the conditions and action to take if the conditions are
528
+ * true.
529
+ */
530
+ export interface PolicyRuleResponse {
531
+ id: string;
455
532
  /**
456
- * Operator to use for policy conditions.
533
+ * The action to take when a policy rule matches.
457
534
  */
458
- operator: ConditionOperator;
535
+ action: PolicyAction;
536
+ conditions: Array<PolicyCondition>;
459
537
  /**
460
- * Value to compare against in a policy condition. Can be a single string or an
461
- * array of strings.
538
+ * Method the rule applies to.
462
539
  */
463
- value: ConditionValue;
540
+ method: PolicyMethod;
541
+ name: string;
464
542
  }
465
543
  /**
466
- * System attributes, including current unix timestamp (in seconds).
544
+ * Solana Program attributes, enables allowlisting Solana Programs.
467
545
  */
468
- export interface SystemCondition {
469
- field: 'current_unix_timestamp';
470
- field_source: 'system';
546
+ export interface SolanaProgramInstructionCondition {
547
+ field: 'programId';
548
+ field_source: 'solana_program_instruction';
471
549
  /**
472
550
  * Operator to use for policy conditions.
473
551
  */
@@ -479,15 +557,12 @@ export interface SystemCondition {
479
557
  value: ConditionValue;
480
558
  }
481
559
  /**
482
- * TRON transaction fields for TransferContract and TriggerSmartContract
483
- * transaction types.
560
+ * Solana System Program attributes, including more granular Transfer instruction
561
+ * fields.
484
562
  */
485
- export interface TronTransactionCondition {
486
- /**
487
- * Supported TRON transaction fields in format "TransactionType.field_name"
488
- */
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';
563
+ export interface SolanaSystemProgramInstructionCondition {
564
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
565
+ field_source: 'solana_system_program_instruction';
491
566
  /**
492
567
  * Operator to use for policy conditions.
493
568
  */
@@ -499,15 +574,12 @@ export interface TronTransactionCondition {
499
574
  value: ConditionValue;
500
575
  }
501
576
  /**
502
- * Decoded calldata from a TRON TriggerSmartContract interaction.
577
+ * Solana Token Program attributes, including more granular TransferChecked
578
+ * instruction fields.
503
579
  */
504
- export interface TronCalldataCondition {
505
- /**
506
- * A Solidity ABI definition for decoding smart contract calldata.
507
- */
508
- abi: AbiSchema;
509
- field: string;
510
- field_source: 'tron_trigger_smart_contract_data';
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';
511
583
  /**
512
584
  * Operator to use for policy conditions.
513
585
  */
@@ -537,6 +609,11 @@ export interface SuiTransactionCommandCondition {
537
609
  */
538
610
  value: WalletsAPI.SuiCommandName | Array<WalletsAPI.SuiCommandName>;
539
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';
540
617
  /**
541
618
  * SUI TransferObjects command attributes, including recipient and amount fields.
542
619
  */
@@ -558,12 +635,16 @@ export interface SuiTransferObjectsCommandCondition {
558
635
  value: ConditionValue;
559
636
  }
560
637
  /**
561
- * Condition referencing an aggregation value. The field must start with
562
- * "aggregation." followed by the aggregation ID.
638
+ * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
639
+ * and 'amount' are supported.
563
640
  */
564
- export interface AggregationCondition {
565
- field: string;
566
- field_source: 'reference';
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';
567
648
  /**
568
649
  * Operator to use for policy conditions.
569
650
  */
@@ -575,126 +656,63 @@ export interface AggregationCondition {
575
656
  value: ConditionValue;
576
657
  }
577
658
  /**
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;
599
- }
600
- /**
601
- * A rule that defines the conditions and action to take if the conditions are
602
- * true.
603
- */
604
- export interface PolicyRuleResponse {
605
- id: string;
606
- /**
607
- * The action to take when a policy rule matches.
608
- */
609
- action: PolicyAction;
610
- conditions: Array<PolicyCondition>;
611
- /**
612
- * Method the rule applies to.
613
- */
614
- method: PolicyMethod;
615
- name: string;
616
- }
617
- /**
618
- * A policy for controlling wallet operations.
659
+ * Decoded calldata from a TRON TriggerSmartContract interaction.
619
660
  */
620
- export interface Policy {
621
- /**
622
- * Unique ID of the created policy. This will be the primary identifier when using
623
- * the policy in the future.
624
- */
625
- id: string;
626
- /**
627
- * The wallet chain types.
628
- */
629
- chain_type: WalletsAPI.WalletChainType;
630
- /**
631
- * Unix timestamp of when the policy was created in milliseconds.
632
- */
633
- created_at: number;
661
+ export interface TronCalldataCondition {
634
662
  /**
635
- * Name to assign to policy.
663
+ * A Solidity ABI definition for decoding smart contract calldata.
636
664
  */
637
- name: string;
665
+ abi: AbiSchema;
666
+ field: string;
667
+ field_source: 'tron_trigger_smart_contract_data';
638
668
  /**
639
- * The key quorum ID of the owner of the policy.
669
+ * Operator to use for policy conditions.
640
670
  */
641
- owner_id: string | null;
642
- rules: Array<PolicyRuleResponse>;
671
+ operator: ConditionOperator;
643
672
  /**
644
- * Version of the policy. Currently, 1.0 is the only version.
673
+ * Value to compare against in a policy condition. Can be a single string or an
674
+ * array of strings.
645
675
  */
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;
676
+ value: ConditionValue;
660
677
  }
661
678
  /**
662
- * Headers required to authorize modifications to policies.
679
+ * TRON transaction fields for TransferContract and TriggerSmartContract
680
+ * transaction types.
663
681
  */
664
- export interface PolicyAuthorizationHeaders {
682
+ export interface TronTransactionCondition {
665
683
  /**
666
- * ID of your Privy app.
684
+ * Supported TRON transaction fields in format "TransactionType.field_name"
667
685
  */
668
- 'privy-app-id': string;
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';
669
688
  /**
670
- * Request authorization signature. If multiple signatures are required, they
671
- * should be comma separated.
689
+ * Operator to use for policy conditions.
672
690
  */
673
- 'privy-authorization-signature'?: string;
691
+ operator: ConditionOperator;
674
692
  /**
675
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
676
- * deadline by which the request must be processed.
693
+ * Value to compare against in a policy condition. Can be a single string or an
694
+ * array of strings.
677
695
  */
678
- 'privy-request-expiry'?: string;
696
+ value: ConditionValue;
679
697
  }
680
698
  /**
681
- * Headers required to authorize modifications to condition sets.
699
+ * Request body for updating a condition set.
682
700
  */
683
- export interface ConditionSetAuthorizationHeaders {
701
+ export interface UpdateConditionSetRequestBody {
684
702
  /**
685
- * ID of your Privy app.
703
+ * Name to assign to condition set.
686
704
  */
687
- 'privy-app-id': string;
705
+ name?: string;
688
706
  /**
689
- * Request authorization signature. If multiple signatures are required, they
690
- * should be comma separated.
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.
691
709
  */
692
- 'privy-authorization-signature'?: string;
710
+ owner?: SharedAPI.OwnerInput | null;
693
711
  /**
694
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
695
- * deadline by which the request must be processed.
712
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
713
+ * not specify an owner.
696
714
  */
697
- 'privy-request-expiry'?: string;
715
+ owner_id?: SharedAPI.OwnerIDInput | null;
698
716
  }
699
717
  export interface PolicyCreateParams {
700
718
  /**
@@ -866,6 +884,6 @@ export interface PolicyGetRuleParams {
866
884
  policy_id: string;
867
885
  }
868
886
  export declare namespace Policies {
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, };
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, };
870
888
  }
871
889
  //# sourceMappingURL=policies.d.ts.map