@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
@@ -287,44 +287,87 @@ export class Policies extends APIResource {
287
287
  }
288
288
 
289
289
  /**
290
- * Unique ID of the condition set to take actions on.
290
+ * A parameter in a Solidity ABI function or event definition.
291
291
  */
292
- export interface ConditionSetRequestParams {
293
- condition_set_id: string;
292
+ export interface AbiParameter {
293
+ type: string;
294
+
295
+ components?: Array<{ [key: string]: unknown }>;
296
+
297
+ indexed?: boolean;
298
+
299
+ internalType?: string;
300
+
301
+ name?: string;
294
302
  }
295
303
 
296
304
  /**
297
- * Unique IDs of the condition set and the condition set item within the condition
298
- * set to take actions on.
305
+ * A Solidity ABI definition for decoding smart contract calldata.
299
306
  */
300
- export interface ConditionSetItemRequestParams {
301
- condition_set_id: string;
307
+ export type AbiSchema = Array<AbiSchema.AbiSchemaItem>;
302
308
 
303
- condition_set_item_id: string;
309
+ export namespace AbiSchema {
310
+ export interface AbiSchemaItem {
311
+ type: 'function' | 'constructor' | 'event' | 'fallback' | 'receive';
312
+
313
+ anonymous?: boolean;
314
+
315
+ inputs?: Array<PoliciesAPI.AbiParameter>;
316
+
317
+ name?: string;
318
+
319
+ outputs?: Array<PoliciesAPI.AbiParameter>;
320
+
321
+ stateMutability?: 'pure' | 'view' | 'nonpayable' | 'payable';
322
+ }
304
323
  }
305
324
 
306
325
  /**
307
- * Request body for creating a condition set.
326
+ * Condition on the original wallet action API request body fields.
308
327
  */
309
- export interface ConditionSetRequestBody {
328
+ export interface ActionRequestBodyCondition {
329
+ field: string;
330
+
331
+ field_source: 'action_request_body';
332
+
310
333
  /**
311
- * Name to assign to condition set.
334
+ * Operator to use for policy conditions.
312
335
  */
313
- name: string;
336
+ operator: ConditionOperator;
314
337
 
315
338
  /**
316
- * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
317
- * null to remove the current owner.
339
+ * Value to compare against in a policy condition. Can be a single string or an
340
+ * array of strings.
318
341
  */
319
- owner?: SharedAPI.OwnerInput | null;
342
+ value: ConditionValue;
343
+ }
344
+
345
+ /**
346
+ * Condition referencing an aggregation value. The field must start with
347
+ * "aggregation." followed by the aggregation ID.
348
+ */
349
+ export interface AggregationCondition {
350
+ field: string;
351
+
352
+ field_source: 'reference';
320
353
 
321
354
  /**
322
- * The key quorum ID to set as the owner of the resource. If you provide this, do
323
- * not specify an owner.
355
+ * Operator to use for policy conditions.
324
356
  */
325
- owner_id?: SharedAPI.OwnerIDInput | null;
357
+ operator: ConditionOperator;
358
+
359
+ /**
360
+ * Value to compare against in a policy condition. Can be a single string or an
361
+ * array of strings.
362
+ */
363
+ value: ConditionValue;
326
364
  }
327
365
 
366
+ /**
367
+ * Operator to use for policy conditions.
368
+ */
369
+ export type ConditionOperator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
370
+
328
371
  /**
329
372
  * A condition set for grouping related condition values.
330
373
  */
@@ -352,39 +395,27 @@ export interface ConditionSet {
352
395
  }
353
396
 
354
397
  /**
355
- * Request body for updating a condition set.
398
+ * Headers required to authorize modifications to condition sets.
356
399
  */
357
- export interface UpdateConditionSetRequestBody {
400
+ export interface ConditionSetAuthorizationHeaders {
358
401
  /**
359
- * Name to assign to condition set.
402
+ * ID of your Privy app.
360
403
  */
361
- name?: string;
404
+ 'privy-app-id': string;
362
405
 
363
406
  /**
364
- * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
365
- * null to remove the current owner.
407
+ * Request authorization signature. If multiple signatures are required, they
408
+ * should be comma separated.
366
409
  */
367
- owner?: SharedAPI.OwnerInput | null;
410
+ 'privy-authorization-signature'?: string;
368
411
 
369
412
  /**
370
- * The key quorum ID to set as the owner of the resource. If you provide this, do
371
- * not specify an owner.
413
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
414
+ * deadline by which the request must be processed.
372
415
  */
373
- owner_id?: SharedAPI.OwnerIDInput | null;
374
- }
375
-
376
- /**
377
- * A single value to add to a condition set.
378
- */
379
- export interface ConditionSetItemValueInput {
380
- value: string;
416
+ 'privy-request-expiry'?: string;
381
417
  }
382
418
 
383
- /**
384
- * Array of values to add to the condition set. Maximum 100 items per request.
385
- */
386
- export type ConditionSetItemsRequestBody = Array<ConditionSetItemValueInput>;
387
-
388
419
  /**
389
420
  * A single item in a condition set.
390
421
  */
@@ -410,11 +441,33 @@ export interface ConditionSetItem {
410
441
  value: string;
411
442
  }
412
443
 
444
+ /**
445
+ * Unique IDs of the condition set and the condition set item within the condition
446
+ * set to take actions on.
447
+ */
448
+ export interface ConditionSetItemRequestParams {
449
+ condition_set_id: string;
450
+
451
+ condition_set_item_id: string;
452
+ }
453
+
454
+ /**
455
+ * A single value to add to a condition set.
456
+ */
457
+ export interface ConditionSetItemValueInput {
458
+ value: string;
459
+ }
460
+
413
461
  /**
414
462
  * Array of condition set items.
415
463
  */
416
464
  export type ConditionSetItems = Array<ConditionSetItem>;
417
465
 
466
+ /**
467
+ * Array of values to add to the condition set. Maximum 100 items per request.
468
+ */
469
+ export type ConditionSetItemsRequestBody = Array<ConditionSetItemValueInput>;
470
+
418
471
  /**
419
472
  * Paginated list of condition set items.
420
473
  */
@@ -431,51 +484,34 @@ export interface ConditionSetItemsResponse {
431
484
  }
432
485
 
433
486
  /**
434
- * The action to take when a policy rule matches.
435
- */
436
- export type PolicyAction = 'ALLOW' | 'DENY';
437
-
438
- /**
439
- * A parameter in a Solidity ABI function or event definition.
487
+ * Request body for creating a condition set.
440
488
  */
441
- export interface AbiParameter {
442
- type: string;
443
-
444
- components?: Array<unknown>;
445
-
446
- indexed?: boolean;
489
+ export interface ConditionSetRequestBody {
490
+ /**
491
+ * Name to assign to condition set.
492
+ */
493
+ name: string;
447
494
 
448
- internalType?: string;
495
+ /**
496
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
497
+ * null to remove the current owner.
498
+ */
499
+ owner?: SharedAPI.OwnerInput | null;
449
500
 
450
- name?: string;
501
+ /**
502
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
503
+ * not specify an owner.
504
+ */
505
+ owner_id?: SharedAPI.OwnerIDInput | null;
451
506
  }
452
507
 
453
508
  /**
454
- * A Solidity ABI definition for decoding smart contract calldata.
509
+ * Unique ID of the condition set to take actions on.
455
510
  */
456
- export type AbiSchema = Array<AbiSchema.AbiSchemaItem>;
457
-
458
- export namespace AbiSchema {
459
- export interface AbiSchemaItem {
460
- type: 'function' | 'constructor' | 'event' | 'fallback' | 'receive';
461
-
462
- anonymous?: boolean;
463
-
464
- inputs?: Array<PoliciesAPI.AbiParameter>;
465
-
466
- name?: string;
467
-
468
- outputs?: Array<PoliciesAPI.AbiParameter>;
469
-
470
- stateMutability?: 'pure' | 'view' | 'nonpayable' | 'payable';
471
- }
511
+ export interface ConditionSetRequestParams {
512
+ condition_set_id: string;
472
513
  }
473
514
 
474
- /**
475
- * Operator to use for policy conditions.
476
- */
477
- export type ConditionOperator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_condition_set';
478
-
479
515
  /**
480
516
  * Value to compare against in a policy condition. Can be a single string or an
481
517
  * array of strings.
@@ -483,25 +519,12 @@ export type ConditionOperator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte' | 'in' | 'in_
483
519
  export type ConditionValue = string | Array<string>;
484
520
 
485
521
  /**
486
- * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
487
- * supported for command names.
488
- */
489
- export type SuiTransactionCommandOperator = 'eq' | 'in';
490
-
491
- /**
492
- * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
493
- * and 'amount' are supported.
494
- */
495
- export type SuiTransferObjectsCommandField = 'recipient' | 'amount';
496
-
497
- /**
498
- * The verbatim Ethereum transaction object in an eth_signTransaction or
499
- * eth_sendTransaction request.
522
+ * Allowed contract addresses for eth_sign7702Authorization requests.
500
523
  */
501
- export interface EthereumTransactionCondition {
502
- field: 'to' | 'value' | 'chain_id';
524
+ export interface Ethereum7702AuthorizationCondition {
525
+ field: 'contract';
503
526
 
504
- field_source: 'ethereum_transaction';
527
+ field_source: 'ethereum_7702_authorization';
505
528
 
506
529
  /**
507
530
  * Operator to use for policy conditions.
@@ -517,8 +540,8 @@ export interface EthereumTransactionCondition {
517
540
 
518
541
  /**
519
542
  * The decoded calldata in a smart contract interaction as the smart contract
520
- * method's parameters. Note that that 'ethereum_calldata' conditions must contain
521
- * an abi parameter with the JSON ABI of the smart contract.
543
+ * method's parameters. Note that 'ethereum_calldata' conditions must contain an
544
+ * abi parameter with the JSON ABI of the smart contract.
522
545
  */
523
546
  export interface EthereumCalldataCondition {
524
547
  /**
@@ -542,6 +565,27 @@ export interface EthereumCalldataCondition {
542
565
  value: ConditionValue;
543
566
  }
544
567
 
568
+ /**
569
+ * The verbatim Ethereum transaction object in an eth_signTransaction or
570
+ * eth_sendTransaction request.
571
+ */
572
+ export interface EthereumTransactionCondition {
573
+ field: 'to' | 'value' | 'chain_id';
574
+
575
+ field_source: 'ethereum_transaction';
576
+
577
+ /**
578
+ * Operator to use for policy conditions.
579
+ */
580
+ operator: ConditionOperator;
581
+
582
+ /**
583
+ * Value to compare against in a policy condition. Can be a single string or an
584
+ * array of strings.
585
+ */
586
+ value: ConditionValue;
587
+ }
588
+
545
589
  /**
546
590
  * Attributes from the signing domain that will verify the signature.
547
591
  */
@@ -597,118 +641,176 @@ export namespace EthereumTypedDataMessageCondition {
597
641
  }
598
642
 
599
643
  /**
600
- * Allowed contract addresses for eth_sign7702Authorization requests.
644
+ * A policy for controlling wallet operations.
601
645
  */
602
- export interface Ethereum7702AuthorizationCondition {
603
- field: 'contract';
646
+ export interface Policy {
647
+ /**
648
+ * Unique ID of the created policy. This will be the primary identifier when using
649
+ * the policy in the future.
650
+ */
651
+ id: string;
604
652
 
605
- field_source: 'ethereum_7702_authorization';
653
+ /**
654
+ * The wallet chain types.
655
+ */
656
+ chain_type: WalletsAPI.WalletChainType;
606
657
 
607
658
  /**
608
- * Operator to use for policy conditions.
659
+ * Unix timestamp of when the policy was created in milliseconds.
609
660
  */
610
- operator: ConditionOperator;
661
+ created_at: number;
611
662
 
612
663
  /**
613
- * Value to compare against in a policy condition. Can be a single string or an
614
- * array of strings.
664
+ * Name to assign to policy.
615
665
  */
616
- value: ConditionValue;
666
+ name: string;
667
+
668
+ /**
669
+ * The key quorum ID of the owner of the policy.
670
+ */
671
+ owner_id: string | null;
672
+
673
+ rules: Array<PolicyRuleResponse>;
674
+
675
+ /**
676
+ * Version of the policy. Currently, 1.0 is the only version.
677
+ */
678
+ version: '1.0';
617
679
  }
618
680
 
619
681
  /**
620
- * Solana Program attributes, enables allowlisting Solana Programs.
682
+ * The action to take when a policy rule matches.
621
683
  */
622
- export interface SolanaProgramInstructionCondition {
623
- field: 'programId';
684
+ export type PolicyAction = 'ALLOW' | 'DENY';
624
685
 
625
- field_source: 'solana_program_instruction';
686
+ /**
687
+ * Headers required to authorize modifications to policies.
688
+ */
689
+ export interface PolicyAuthorizationHeaders {
690
+ /**
691
+ * ID of your Privy app.
692
+ */
693
+ 'privy-app-id': string;
626
694
 
627
695
  /**
628
- * Operator to use for policy conditions.
696
+ * Request authorization signature. If multiple signatures are required, they
697
+ * should be comma separated.
629
698
  */
630
- operator: ConditionOperator;
699
+ 'privy-authorization-signature'?: string;
631
700
 
632
701
  /**
633
- * Value to compare against in a policy condition. Can be a single string or an
634
- * array of strings.
702
+ * Request expiry. Value is a Unix timestamp in milliseconds representing the
703
+ * deadline by which the request must be processed.
635
704
  */
636
- value: ConditionValue;
705
+ 'privy-request-expiry'?: string;
637
706
  }
638
707
 
639
708
  /**
640
- * Solana System Program attributes, including more granular Transfer instruction
641
- * fields.
709
+ * A condition that must be true for the rule action to be applied.
642
710
  */
643
- export interface SolanaSystemProgramInstructionCondition {
644
- field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
711
+ export type PolicyCondition =
712
+ | EthereumTransactionCondition
713
+ | EthereumCalldataCondition
714
+ | EthereumTypedDataDomainCondition
715
+ | EthereumTypedDataMessageCondition
716
+ | Ethereum7702AuthorizationCondition
717
+ | SolanaProgramInstructionCondition
718
+ | SolanaSystemProgramInstructionCondition
719
+ | SolanaTokenProgramInstructionCondition
720
+ | SystemCondition
721
+ | TronTransactionCondition
722
+ | TronCalldataCondition
723
+ | SuiTransactionCommandCondition
724
+ | SuiTransferObjectsCommandCondition
725
+ | ActionRequestBodyCondition
726
+ | AggregationCondition;
645
727
 
646
- field_source: 'solana_system_program_instruction';
728
+ /**
729
+ * Method the rule applies to.
730
+ */
731
+ export type PolicyMethod =
732
+ | 'eth_sendTransaction'
733
+ | 'eth_signTransaction'
734
+ | 'eth_signUserOperation'
735
+ | 'eth_signTypedData_v4'
736
+ | 'eth_sign7702Authorization'
737
+ | 'personal_sign'
738
+ | 'wallet_sendCalls'
739
+ | 'signTransaction'
740
+ | 'signAndSendTransaction'
741
+ | 'signMessage'
742
+ | 'exportPrivateKey'
743
+ | 'exportSeedPhrase'
744
+ | 'signTransactionBytes'
745
+ | 'earn_deposit'
746
+ | 'earn_withdraw'
747
+ | 'transfer'
748
+ | '*';
749
+
750
+ /**
751
+ * Unique ID of the policy to take actions on.
752
+ */
753
+ export interface PolicyRequestBody {
754
+ policy_id: string;
755
+ }
647
756
 
757
+ /**
758
+ * The rules that apply to each method the policy covers.
759
+ */
760
+ export interface PolicyRuleRequestBody {
648
761
  /**
649
- * Operator to use for policy conditions.
762
+ * The action to take when a policy rule matches.
650
763
  */
651
- operator: ConditionOperator;
764
+ action: PolicyAction;
765
+
766
+ conditions: Array<PolicyCondition>;
652
767
 
653
768
  /**
654
- * Value to compare against in a policy condition. Can be a single string or an
655
- * array of strings.
769
+ * Method the rule applies to.
656
770
  */
657
- value: ConditionValue;
771
+ method: PolicyMethod;
772
+
773
+ name: string;
658
774
  }
659
775
 
660
776
  /**
661
- * Solana Token Program attributes, including more granular TransferChecked
662
- * instruction fields.
777
+ * Unique IDs of the policy and the rule within the policy to take actions on.
663
778
  */
664
- export interface SolanaTokenProgramInstructionCondition {
665
- field:
666
- | 'instructionName'
667
- | 'Transfer.source'
668
- | 'Transfer.destination'
669
- | 'Transfer.authority'
670
- | 'Transfer.amount'
671
- | 'TransferChecked.source'
672
- | 'TransferChecked.destination'
673
- | 'TransferChecked.authority'
674
- | 'TransferChecked.amount'
675
- | 'TransferChecked.mint'
676
- | 'Burn.account'
677
- | 'Burn.mint'
678
- | 'Burn.authority'
679
- | 'Burn.amount'
680
- | 'MintTo.mint'
681
- | 'MintTo.account'
682
- | 'MintTo.authority'
683
- | 'MintTo.amount'
684
- | 'CloseAccount.account'
685
- | 'CloseAccount.destination'
686
- | 'CloseAccount.authority'
687
- | 'InitializeAccount3.account'
688
- | 'InitializeAccount3.mint'
689
- | 'InitializeAccount3.owner';
779
+ export interface PolicyRuleRequestParams {
780
+ policy_id: string;
690
781
 
691
- field_source: 'solana_token_program_instruction';
782
+ rule_id: string;
783
+ }
784
+
785
+ /**
786
+ * A rule that defines the conditions and action to take if the conditions are
787
+ * true.
788
+ */
789
+ export interface PolicyRuleResponse {
790
+ id: string;
692
791
 
693
792
  /**
694
- * Operator to use for policy conditions.
793
+ * The action to take when a policy rule matches.
695
794
  */
696
- operator: ConditionOperator;
795
+ action: PolicyAction;
796
+
797
+ conditions: Array<PolicyCondition>;
697
798
 
698
799
  /**
699
- * Value to compare against in a policy condition. Can be a single string or an
700
- * array of strings.
800
+ * Method the rule applies to.
701
801
  */
702
- value: ConditionValue;
802
+ method: PolicyMethod;
803
+
804
+ name: string;
703
805
  }
704
806
 
705
807
  /**
706
- * System attributes, including current unix timestamp (in seconds).
808
+ * Solana Program attributes, enables allowlisting Solana Programs.
707
809
  */
708
- export interface SystemCondition {
709
- field: 'current_unix_timestamp';
810
+ export interface SolanaProgramInstructionCondition {
811
+ field: 'programId';
710
812
 
711
- field_source: 'system';
813
+ field_source: 'solana_program_instruction';
712
814
 
713
815
  /**
714
816
  * Operator to use for policy conditions.
@@ -723,22 +825,13 @@ export interface SystemCondition {
723
825
  }
724
826
 
725
827
  /**
726
- * TRON transaction fields for TransferContract and TriggerSmartContract
727
- * transaction types.
828
+ * Solana System Program attributes, including more granular Transfer instruction
829
+ * fields.
728
830
  */
729
- export interface TronTransactionCondition {
730
- /**
731
- * Supported TRON transaction fields in format "TransactionType.field_name"
732
- */
733
- field:
734
- | 'TransferContract.to_address'
735
- | 'TransferContract.amount'
736
- | 'TriggerSmartContract.contract_address'
737
- | 'TriggerSmartContract.call_value'
738
- | 'TriggerSmartContract.token_id'
739
- | 'TriggerSmartContract.call_token_value';
831
+ export interface SolanaSystemProgramInstructionCondition {
832
+ field: 'instructionName' | 'Transfer.from' | 'Transfer.to' | 'Transfer.lamports';
740
833
 
741
- field_source: 'tron_transaction';
834
+ field_source: 'solana_system_program_instruction';
742
835
 
743
836
  /**
744
837
  * Operator to use for policy conditions.
@@ -753,17 +846,37 @@ export interface TronTransactionCondition {
753
846
  }
754
847
 
755
848
  /**
756
- * Decoded calldata from a TRON TriggerSmartContract interaction.
849
+ * Solana Token Program attributes, including more granular TransferChecked
850
+ * instruction fields.
757
851
  */
758
- export interface TronCalldataCondition {
759
- /**
760
- * A Solidity ABI definition for decoding smart contract calldata.
761
- */
762
- abi: AbiSchema;
763
-
764
- field: string;
852
+ export interface SolanaTokenProgramInstructionCondition {
853
+ field:
854
+ | 'instructionName'
855
+ | 'Transfer.source'
856
+ | 'Transfer.destination'
857
+ | 'Transfer.authority'
858
+ | 'Transfer.amount'
859
+ | 'TransferChecked.source'
860
+ | 'TransferChecked.destination'
861
+ | 'TransferChecked.authority'
862
+ | 'TransferChecked.amount'
863
+ | 'TransferChecked.mint'
864
+ | 'Burn.account'
865
+ | 'Burn.mint'
866
+ | 'Burn.authority'
867
+ | 'Burn.amount'
868
+ | 'MintTo.mint'
869
+ | 'MintTo.account'
870
+ | 'MintTo.authority'
871
+ | 'MintTo.amount'
872
+ | 'CloseAccount.account'
873
+ | 'CloseAccount.destination'
874
+ | 'CloseAccount.authority'
875
+ | 'InitializeAccount3.account'
876
+ | 'InitializeAccount3.mint'
877
+ | 'InitializeAccount3.owner';
765
878
 
766
- field_source: 'tron_trigger_smart_contract_data';
879
+ field_source: 'solana_token_program_instruction';
767
880
 
768
881
  /**
769
882
  * Operator to use for policy conditions.
@@ -800,6 +913,12 @@ export interface SuiTransactionCommandCondition {
800
913
  value: WalletsAPI.SuiCommandName | Array<WalletsAPI.SuiCommandName>;
801
914
  }
802
915
 
916
+ /**
917
+ * Operator to use for SUI transaction command conditions. Only 'eq' and 'in' are
918
+ * supported for command names.
919
+ */
920
+ export type SuiTransactionCommandOperator = 'eq' | 'in';
921
+
803
922
  /**
804
923
  * SUI TransferObjects command attributes, including recipient and amount fields.
805
924
  */
@@ -825,13 +944,18 @@ export interface SuiTransferObjectsCommandCondition {
825
944
  }
826
945
 
827
946
  /**
828
- * Condition referencing an aggregation value. The field must start with
829
- * "aggregation." followed by the aggregation ID.
947
+ * Supported fields for SUI TransferObjects command conditions. Only 'recipient'
948
+ * and 'amount' are supported.
830
949
  */
831
- export interface AggregationCondition {
832
- field: string;
950
+ export type SuiTransferObjectsCommandField = 'recipient' | 'amount';
833
951
 
834
- field_source: 'reference';
952
+ /**
953
+ * System attributes, including current unix timestamp (in seconds).
954
+ */
955
+ export interface SystemCondition {
956
+ field: 'current_unix_timestamp';
957
+
958
+ field_source: 'system';
835
959
 
836
960
  /**
837
961
  * Operator to use for policy conditions.
@@ -846,178 +970,80 @@ export interface AggregationCondition {
846
970
  }
847
971
 
848
972
  /**
849
- * A condition that must be true for the rule action to be applied.
850
- */
851
- export type PolicyCondition =
852
- | EthereumTransactionCondition
853
- | EthereumCalldataCondition
854
- | EthereumTypedDataDomainCondition
855
- | EthereumTypedDataMessageCondition
856
- | Ethereum7702AuthorizationCondition
857
- | SolanaProgramInstructionCondition
858
- | SolanaSystemProgramInstructionCondition
859
- | SolanaTokenProgramInstructionCondition
860
- | SystemCondition
861
- | TronTransactionCondition
862
- | TronCalldataCondition
863
- | SuiTransactionCommandCondition
864
- | SuiTransferObjectsCommandCondition
865
- | AggregationCondition;
866
-
867
- /**
868
- * Method the rule applies to.
869
- */
870
- export type PolicyMethod =
871
- | 'eth_sendTransaction'
872
- | 'eth_signTransaction'
873
- | 'eth_signUserOperation'
874
- | 'eth_signTypedData_v4'
875
- | 'eth_sign7702Authorization'
876
- | 'wallet_sendCalls'
877
- | 'signTransaction'
878
- | 'signAndSendTransaction'
879
- | 'exportPrivateKey'
880
- | 'exportSeedPhrase'
881
- | 'signTransactionBytes'
882
- | '*';
883
-
884
- /**
885
- * The rules that apply to each method the policy covers.
973
+ * Decoded calldata from a TRON TriggerSmartContract interaction.
886
974
  */
887
- export interface PolicyRuleRequestBody {
888
- /**
889
- * The action to take when a policy rule matches.
890
- */
891
- action: PolicyAction;
892
-
893
- conditions: Array<PolicyCondition>;
894
-
975
+ export interface TronCalldataCondition {
895
976
  /**
896
- * Method the rule applies to.
977
+ * A Solidity ABI definition for decoding smart contract calldata.
897
978
  */
898
- method: PolicyMethod;
979
+ abi: AbiSchema;
899
980
 
900
- name: string;
901
- }
981
+ field: string;
902
982
 
903
- /**
904
- * A rule that defines the conditions and action to take if the conditions are
905
- * true.
906
- */
907
- export interface PolicyRuleResponse {
908
- id: string;
983
+ field_source: 'tron_trigger_smart_contract_data';
909
984
 
910
985
  /**
911
- * The action to take when a policy rule matches.
986
+ * Operator to use for policy conditions.
912
987
  */
913
- action: PolicyAction;
914
-
915
- conditions: Array<PolicyCondition>;
988
+ operator: ConditionOperator;
916
989
 
917
990
  /**
918
- * Method the rule applies to.
991
+ * Value to compare against in a policy condition. Can be a single string or an
992
+ * array of strings.
919
993
  */
920
- method: PolicyMethod;
921
-
922
- name: string;
994
+ value: ConditionValue;
923
995
  }
924
996
 
925
997
  /**
926
- * A policy for controlling wallet operations.
998
+ * TRON transaction fields for TransferContract and TriggerSmartContract
999
+ * transaction types.
927
1000
  */
928
- export interface Policy {
929
- /**
930
- * Unique ID of the created policy. This will be the primary identifier when using
931
- * the policy in the future.
932
- */
933
- id: string;
934
-
935
- /**
936
- * The wallet chain types.
937
- */
938
- chain_type: WalletsAPI.WalletChainType;
939
-
940
- /**
941
- * Unix timestamp of when the policy was created in milliseconds.
942
- */
943
- created_at: number;
944
-
945
- /**
946
- * Name to assign to policy.
947
- */
948
- name: string;
949
-
950
- /**
951
- * The key quorum ID of the owner of the policy.
952
- */
953
- owner_id: string | null;
954
-
955
- rules: Array<PolicyRuleResponse>;
956
-
1001
+ export interface TronTransactionCondition {
957
1002
  /**
958
- * Version of the policy. Currently, 1.0 is the only version.
1003
+ * Supported TRON transaction fields in format "TransactionType.field_name"
959
1004
  */
960
- version: '1.0';
961
- }
962
-
963
- /**
964
- * Unique ID of the policy to take actions on.
965
- */
966
- export interface PolicyRequestBody {
967
- policy_id: string;
968
- }
969
-
970
- /**
971
- * Unique IDs of the policy and the rule within the policy to take actions on.
972
- */
973
- export interface PolicyRuleRequestParams {
974
- policy_id: string;
975
-
976
- rule_id: string;
977
- }
1005
+ field:
1006
+ | 'TransferContract.to_address'
1007
+ | 'TransferContract.amount'
1008
+ | 'TriggerSmartContract.contract_address'
1009
+ | 'TriggerSmartContract.call_value'
1010
+ | 'TriggerSmartContract.token_id'
1011
+ | 'TriggerSmartContract.call_token_value';
978
1012
 
979
- /**
980
- * Headers required to authorize modifications to policies.
981
- */
982
- export interface PolicyAuthorizationHeaders {
983
- /**
984
- * ID of your Privy app.
985
- */
986
- 'privy-app-id': string;
1013
+ field_source: 'tron_transaction';
987
1014
 
988
1015
  /**
989
- * Request authorization signature. If multiple signatures are required, they
990
- * should be comma separated.
1016
+ * Operator to use for policy conditions.
991
1017
  */
992
- 'privy-authorization-signature'?: string;
1018
+ operator: ConditionOperator;
993
1019
 
994
1020
  /**
995
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
996
- * deadline by which the request must be processed.
1021
+ * Value to compare against in a policy condition. Can be a single string or an
1022
+ * array of strings.
997
1023
  */
998
- 'privy-request-expiry'?: string;
1024
+ value: ConditionValue;
999
1025
  }
1000
1026
 
1001
1027
  /**
1002
- * Headers required to authorize modifications to condition sets.
1028
+ * Request body for updating a condition set.
1003
1029
  */
1004
- export interface ConditionSetAuthorizationHeaders {
1030
+ export interface UpdateConditionSetRequestBody {
1005
1031
  /**
1006
- * ID of your Privy app.
1032
+ * Name to assign to condition set.
1007
1033
  */
1008
- 'privy-app-id': string;
1034
+ name?: string;
1009
1035
 
1010
1036
  /**
1011
- * Request authorization signature. If multiple signatures are required, they
1012
- * should be comma separated.
1037
+ * The owner of the resource, specified as a Privy user ID, a P-256 public key, or
1038
+ * null to remove the current owner.
1013
1039
  */
1014
- 'privy-authorization-signature'?: string;
1040
+ owner?: SharedAPI.OwnerInput | null;
1015
1041
 
1016
1042
  /**
1017
- * Request expiry. Value is a Unix timestamp in milliseconds representing the
1018
- * deadline by which the request must be processed.
1043
+ * The key quorum ID to set as the owner of the resource. If you provide this, do
1044
+ * not specify an owner.
1019
1045
  */
1020
- 'privy-request-expiry'?: string;
1046
+ owner_id?: SharedAPI.OwnerIDInput | null;
1021
1047
  }
1022
1048
 
1023
1049
  export interface PolicyCreateParams {
@@ -1228,46 +1254,47 @@ export interface PolicyGetRuleParams {
1228
1254
 
1229
1255
  export declare namespace Policies {
1230
1256
  export {
1231
- type ConditionSetRequestParams as ConditionSetRequestParams,
1232
- type ConditionSetItemRequestParams as ConditionSetItemRequestParams,
1233
- type ConditionSetRequestBody as ConditionSetRequestBody,
1257
+ type AbiParameter as AbiParameter,
1258
+ type AbiSchema as AbiSchema,
1259
+ type ActionRequestBodyCondition as ActionRequestBodyCondition,
1260
+ type AggregationCondition as AggregationCondition,
1261
+ type ConditionOperator as ConditionOperator,
1234
1262
  type ConditionSet as ConditionSet,
1235
- type UpdateConditionSetRequestBody as UpdateConditionSetRequestBody,
1236
- type ConditionSetItemValueInput as ConditionSetItemValueInput,
1237
- type ConditionSetItemsRequestBody as ConditionSetItemsRequestBody,
1263
+ type ConditionSetAuthorizationHeaders as ConditionSetAuthorizationHeaders,
1238
1264
  type ConditionSetItem as ConditionSetItem,
1265
+ type ConditionSetItemRequestParams as ConditionSetItemRequestParams,
1266
+ type ConditionSetItemValueInput as ConditionSetItemValueInput,
1239
1267
  type ConditionSetItems as ConditionSetItems,
1268
+ type ConditionSetItemsRequestBody as ConditionSetItemsRequestBody,
1240
1269
  type ConditionSetItemsResponse as ConditionSetItemsResponse,
1241
- type PolicyAction as PolicyAction,
1242
- type AbiParameter as AbiParameter,
1243
- type AbiSchema as AbiSchema,
1244
- type ConditionOperator as ConditionOperator,
1270
+ type ConditionSetRequestBody as ConditionSetRequestBody,
1271
+ type ConditionSetRequestParams as ConditionSetRequestParams,
1245
1272
  type ConditionValue as ConditionValue,
1246
- type SuiTransactionCommandOperator as SuiTransactionCommandOperator,
1247
- type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField,
1248
- type EthereumTransactionCondition as EthereumTransactionCondition,
1273
+ type Ethereum7702AuthorizationCondition as Ethereum7702AuthorizationCondition,
1249
1274
  type EthereumCalldataCondition as EthereumCalldataCondition,
1275
+ type EthereumTransactionCondition as EthereumTransactionCondition,
1250
1276
  type EthereumTypedDataDomainCondition as EthereumTypedDataDomainCondition,
1251
1277
  type EthereumTypedDataMessageCondition as EthereumTypedDataMessageCondition,
1252
- type Ethereum7702AuthorizationCondition as Ethereum7702AuthorizationCondition,
1278
+ type Policy as Policy,
1279
+ type PolicyAction as PolicyAction,
1280
+ type PolicyAuthorizationHeaders as PolicyAuthorizationHeaders,
1281
+ type PolicyCondition as PolicyCondition,
1282
+ type PolicyMethod as PolicyMethod,
1283
+ type PolicyRequestBody as PolicyRequestBody,
1284
+ type PolicyRuleRequestBody as PolicyRuleRequestBody,
1285
+ type PolicyRuleRequestParams as PolicyRuleRequestParams,
1286
+ type PolicyRuleResponse as PolicyRuleResponse,
1253
1287
  type SolanaProgramInstructionCondition as SolanaProgramInstructionCondition,
1254
1288
  type SolanaSystemProgramInstructionCondition as SolanaSystemProgramInstructionCondition,
1255
1289
  type SolanaTokenProgramInstructionCondition as SolanaTokenProgramInstructionCondition,
1256
- type SystemCondition as SystemCondition,
1257
- type TronTransactionCondition as TronTransactionCondition,
1258
- type TronCalldataCondition as TronCalldataCondition,
1259
1290
  type SuiTransactionCommandCondition as SuiTransactionCommandCondition,
1291
+ type SuiTransactionCommandOperator as SuiTransactionCommandOperator,
1260
1292
  type SuiTransferObjectsCommandCondition as SuiTransferObjectsCommandCondition,
1261
- type AggregationCondition as AggregationCondition,
1262
- type PolicyCondition as PolicyCondition,
1263
- type PolicyMethod as PolicyMethod,
1264
- type PolicyRuleRequestBody as PolicyRuleRequestBody,
1265
- type PolicyRuleResponse as PolicyRuleResponse,
1266
- type Policy as Policy,
1267
- type PolicyRequestBody as PolicyRequestBody,
1268
- type PolicyRuleRequestParams as PolicyRuleRequestParams,
1269
- type PolicyAuthorizationHeaders as PolicyAuthorizationHeaders,
1270
- type ConditionSetAuthorizationHeaders as ConditionSetAuthorizationHeaders,
1293
+ type SuiTransferObjectsCommandField as SuiTransferObjectsCommandField,
1294
+ type SystemCondition as SystemCondition,
1295
+ type TronCalldataCondition as TronCalldataCondition,
1296
+ type TronTransactionCondition as TronTransactionCondition,
1297
+ type UpdateConditionSetRequestBody as UpdateConditionSetRequestBody,
1271
1298
  type PolicyCreateParams as PolicyCreateParams,
1272
1299
  type PolicyCreateRuleParams as PolicyCreateRuleParams,
1273
1300
  type PolicyDeleteParams as PolicyDeleteParams,