@coinbase/cdp-sdk 1.31.0 → 1.32.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 (104) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js +61 -0
  3. package/_cjs/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  4. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js +21 -0
  5. package/_cjs/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  6. package/_cjs/actions/evm/listSpendPermissions.js +18 -0
  7. package/_cjs/actions/evm/listSpendPermissions.js.map +1 -0
  8. package/_cjs/actions/evm/listTokenBalances.js +2 -0
  9. package/_cjs/actions/evm/listTokenBalances.js.map +1 -1
  10. package/_cjs/client/evm/evm.js +157 -60
  11. package/_cjs/client/evm/evm.js.map +1 -1
  12. package/_cjs/client/policies/policies.js +72 -5
  13. package/_cjs/client/policies/policies.js.map +1 -1
  14. package/_cjs/client/solana/solana.js +47 -27
  15. package/_cjs/client/solana/solana.js.map +1 -1
  16. package/_cjs/index.js +3 -3
  17. package/_cjs/index.js.map +1 -1
  18. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +53 -2
  19. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  20. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +215 -5
  21. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
  22. package/_cjs/policies/{schema.js → evmSchema.js} +11 -112
  23. package/_cjs/policies/evmSchema.js.map +1 -0
  24. package/_cjs/policies/solanaSchema.js +183 -0
  25. package/_cjs/policies/solanaSchema.js.map +1 -0
  26. package/_cjs/policies/types.js +60 -0
  27. package/_cjs/policies/types.js.map +1 -1
  28. package/_cjs/version.js +1 -1
  29. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js +61 -0
  30. package/_esm/accounts/evm/toNetworkScopedEvmServerAccount.js.map +1 -1
  31. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js +21 -0
  32. package/_esm/accounts/evm/toNetworkScopedEvmSmartAccount.js.map +1 -1
  33. package/_esm/actions/evm/listSpendPermissions.js +15 -0
  34. package/_esm/actions/evm/listSpendPermissions.js.map +1 -0
  35. package/_esm/actions/evm/listTokenBalances.js +2 -0
  36. package/_esm/actions/evm/listTokenBalances.js.map +1 -1
  37. package/_esm/client/evm/evm.js +157 -60
  38. package/_esm/client/evm/evm.js.map +1 -1
  39. package/_esm/client/policies/policies.js +70 -3
  40. package/_esm/client/policies/policies.js.map +1 -1
  41. package/_esm/client/solana/solana.js +47 -27
  42. package/_esm/client/solana/solana.js.map +1 -1
  43. package/_esm/index.js +1 -1
  44. package/_esm/index.js.map +1 -1
  45. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +51 -0
  46. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  47. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +197 -3
  48. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
  49. package/_esm/policies/{schema.js → evmSchema.js} +10 -111
  50. package/_esm/policies/evmSchema.js.map +1 -0
  51. package/_esm/policies/solanaSchema.js +180 -0
  52. package/_esm/policies/solanaSchema.js.map +1 -0
  53. package/_esm/policies/types.js +59 -1
  54. package/_esm/policies/types.js.map +1 -1
  55. package/_esm/version.js +1 -1
  56. package/_types/accounts/evm/toNetworkScopedEvmServerAccount.d.ts.map +1 -1
  57. package/_types/accounts/evm/toNetworkScopedEvmSmartAccount.d.ts.map +1 -1
  58. package/_types/actions/evm/listSpendPermissions.d.ts +12 -0
  59. package/_types/actions/evm/listSpendPermissions.d.ts.map +1 -0
  60. package/_types/actions/evm/listTokenBalances.d.ts.map +1 -1
  61. package/_types/client/evm/evm.d.ts +66 -1
  62. package/_types/client/evm/evm.d.ts.map +1 -1
  63. package/_types/client/evm/evm.types.d.ts +2 -1
  64. package/_types/client/evm/evm.types.d.ts.map +1 -1
  65. package/_types/client/policies/policies.d.ts +69 -2
  66. package/_types/client/policies/policies.d.ts.map +1 -1
  67. package/_types/client/policies/policies.types.d.ts +1 -2
  68. package/_types/client/policies/policies.types.d.ts.map +1 -1
  69. package/_types/client/solana/solana.d.ts +16 -0
  70. package/_types/client/solana/solana.d.ts.map +1 -1
  71. package/_types/index.d.ts +1 -1
  72. package/_types/index.d.ts.map +1 -1
  73. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +140 -2
  74. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  75. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +17 -1
  76. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
  77. package/_types/policies/evmSchema.d.ts +4367 -0
  78. package/_types/policies/evmSchema.d.ts.map +1 -0
  79. package/_types/policies/solanaSchema.d.ts +758 -0
  80. package/_types/policies/solanaSchema.d.ts.map +1 -0
  81. package/_types/policies/types.d.ts +6591 -1
  82. package/_types/policies/types.d.ts.map +1 -1
  83. package/_types/version.d.ts +1 -1
  84. package/accounts/evm/toNetworkScopedEvmServerAccount.ts +69 -0
  85. package/accounts/evm/toNetworkScopedEvmSmartAccount.ts +22 -0
  86. package/actions/evm/listSpendPermissions.ts +20 -0
  87. package/actions/evm/listTokenBalances.ts +2 -0
  88. package/client/evm/evm.ts +200 -81
  89. package/client/evm/evm.types.ts +4 -0
  90. package/client/policies/policies.ts +70 -4
  91. package/client/policies/policies.types.ts +1 -2
  92. package/client/solana/solana.ts +60 -38
  93. package/index.ts +1 -1
  94. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +198 -1
  95. package/openapi-client/generated/policy-engine/policy-engine.msw.ts +285 -3
  96. package/package.json +1 -1
  97. package/policies/{schema.ts → evmSchema.ts} +9 -158
  98. package/policies/solanaSchema.ts +251 -0
  99. package/policies/types.ts +94 -1
  100. package/version.ts +1 -1
  101. package/_cjs/policies/schema.js.map +0 -1
  102. package/_esm/policies/schema.js.map +0 -1
  103. package/_types/policies/schema.d.ts +0 -11599
  104. package/_types/policies/schema.d.ts.map +0 -1
@@ -31,16 +31,6 @@ export const EvmNetworkOperatorEnum = z.enum(["in", "not in"]);
31
31
  */
32
32
  export type EvmNetworkOperator = z.infer<typeof EvmNetworkOperatorEnum>;
33
33
 
34
- /**
35
- * Enum for SolAddressOperator values
36
- */
37
- export const SolAddressOperatorEnum = z.enum(["in", "not in"]);
38
- /**
39
- * Type representing the operators that can be used for Solana address comparisons.
40
- * These operators determine how transaction addresses are evaluated against a list.
41
- */
42
- export type SolAddressOperator = z.infer<typeof SolAddressOperatorEnum>;
43
-
44
34
  /**
45
35
  * Schema for ETH value criterions
46
36
  */
@@ -351,26 +341,6 @@ export const EvmDataCriterionSchema = z.object({
351
341
  });
352
342
  export type EvmDataCriterion = z.infer<typeof EvmDataCriterionSchema>;
353
343
 
354
- /**
355
- * Schema for Solana address criterions
356
- */
357
- export const SolAddressCriterionSchema = z.object({
358
- /** The type of criterion, must be "solAddress" for Solana address-based rules. */
359
- type: z.literal("solAddress"),
360
- /**
361
- * Array of Solana addresses to compare against.
362
- * Each address must be a valid Base58-encoded Solana address (32-44 characters).
363
- */
364
- addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
365
- /**
366
- * The operator to use for evaluating transaction addresses.
367
- * "in" checks if an address is in the provided list.
368
- * "not in" checks if an address is not in the provided list.
369
- */
370
- operator: SolAddressOperatorEnum,
371
- });
372
- export type SolAddressCriterion = z.infer<typeof SolAddressCriterionSchema>;
373
-
374
344
  /**
375
345
  * Schema for criteria used in SignEvmTransaction operations
376
346
  */
@@ -421,19 +391,6 @@ export const SendEvmTransactionCriteriaSchema = z
421
391
  // Type representing a set of criteria for the sendEvmTransaction operation. Can contain up to 10 individual criterion objects of ETH value or EVM address types.
422
392
  export type SendEvmTransactionCriteria = z.infer<typeof SendEvmTransactionCriteriaSchema>;
423
393
 
424
- /**
425
- * Schema for criteria used in SignSolTransaction operations
426
- */
427
- export const SignSolTransactionCriteriaSchema = z
428
- .array(z.discriminatedUnion("type", [SolAddressCriterionSchema]))
429
- .max(10)
430
- .min(1);
431
- /**
432
- * Type representing a set of criteria for the signSolTransaction operation.
433
- * Can contain up to 10 individual Solana address criterion objects.
434
- */
435
- export type SignSolTransactionCriteria = z.infer<typeof SignSolTransactionCriteriaSchema>;
436
-
437
394
  /**
438
395
  * Schema for criteria used in PrepareUserOperation operations
439
396
  */
@@ -473,20 +430,18 @@ export const SendUserOperationCriteriaSchema = z
473
430
  */
474
431
  export type SendUserOperationCriteria = z.infer<typeof SendUserOperationCriteriaSchema>;
475
432
 
476
- /**
477
- * Enum for Solana Operation types
478
- */
479
- export const SolOperationEnum = z.enum(["signSolTransaction"]);
480
- /**
481
- * Type representing the operations that can be governed by a policy.
482
- * Defines what Solana operations the policy applies to.
483
- */
484
- export type SolOperation = z.infer<typeof SolOperationEnum>;
485
-
486
433
  /**
487
434
  * Enum for Evm Operation types
488
435
  */
489
- export const EvmOperationEnum = z.enum(["signEvmTransaction"]);
436
+ export const EvmOperationEnum = z.enum([
437
+ "signEvmTransaction",
438
+ "sendEvmTransaction",
439
+ "signEvmMessage",
440
+ "signEvmTypedData",
441
+ "signEvmHash",
442
+ "prepareUserOperation",
443
+ "sendUserOperation",
444
+ ]);
490
445
  /**
491
446
  * Type representing the operations that can be governed by a policy.
492
447
  * Defines what EVM operations the policy applies to.
@@ -613,29 +568,6 @@ export const SendEvmTransactionRuleSchema = z.object({
613
568
  });
614
569
  export type SendEvmTransactionRule = z.infer<typeof SendEvmTransactionRuleSchema>;
615
570
 
616
- /**
617
- * Type representing a 'signSolTransaction' policy rule that can accept or reject specific operations
618
- * based on a set of criteria.
619
- */
620
- export const SignSolTransactionRuleSchema = z.object({
621
- /**
622
- * Determines whether matching the rule will cause a request to be rejected or accepted.
623
- * "accept" will allow the transaction, "reject" will block it.
624
- */
625
- action: ActionEnum,
626
- /**
627
- * The operation to which this rule applies.
628
- * Must be "signSolTransaction".
629
- */
630
- operation: z.literal("signSolTransaction"),
631
- /**
632
- * The set of criteria that must be matched for this rule to apply.
633
- * Must be compatible with the specified operation type.
634
- */
635
- criteria: SignSolTransactionCriteriaSchema,
636
- });
637
- export type SignSolTransactionRule = z.infer<typeof SignSolTransactionRuleSchema>;
638
-
639
571
  /**
640
572
  * Type representing a 'prepareUserOperation' policy rule that can accept or reject specific operations
641
573
  * based on a set of criteria.
@@ -681,84 +613,3 @@ export const SendUserOperationRuleSchema = z.object({
681
613
  criteria: SendUserOperationCriteriaSchema,
682
614
  });
683
615
  export type SendUserOperationRule = z.infer<typeof SendUserOperationRuleSchema>;
684
-
685
- /**
686
- * Schema for policy rules
687
- */
688
- export const RuleSchema = z.discriminatedUnion("operation", [
689
- SignEvmTransactionRuleSchema,
690
- SignEvmHashRuleSchema,
691
- SignEvmMessageRuleSchema,
692
- SignEvmTypedDataRuleSchema,
693
- SendEvmTransactionRuleSchema,
694
- SignSolTransactionRuleSchema,
695
- PrepareUserOperationRuleSchema,
696
- SendUserOperationRuleSchema,
697
- ]);
698
-
699
- /**
700
- * Type representing a policy rule that can accept or reject specific operations
701
- * based on a set of criteria.
702
- */
703
- export type Rule = z.infer<typeof RuleSchema>;
704
-
705
- /**
706
- * Enum for policy scopes
707
- */
708
- export const PolicyScopeEnum = z.enum(["project", "account"]);
709
- /**
710
- * Type representing the scope of a policy.
711
- * Determines whether the policy applies at the project level or account level.
712
- */
713
- export type PolicyScope = z.infer<typeof PolicyScopeEnum>;
714
-
715
- /**
716
- * Schema for creating or updating a Policy.
717
- */
718
- export const CreatePolicyBodySchema = z.object({
719
- /**
720
- * The scope of the policy.
721
- * "project" applies to the entire project, "account" applies to specific accounts.
722
- */
723
- scope: PolicyScopeEnum,
724
- /**
725
- * An optional human-readable description for the policy.
726
- * Limited to 50 characters of alphanumeric characters, spaces, commas, and periods.
727
- */
728
- description: z
729
- .string()
730
- .regex(/^[A-Za-z0-9 ,.]{1,50}$/)
731
- .optional(),
732
- /**
733
- * Array of rules that comprise the policy.
734
- * Limited to a maximum of 10 rules per policy.
735
- */
736
- rules: z.array(RuleSchema).max(10).min(1),
737
- });
738
- /**
739
- * Type representing the request body for creating a new policy.
740
- * Contains the scope, optional description, and rules for the policy.
741
- */
742
- export type CreatePolicyBody = z.infer<typeof CreatePolicyBodySchema>;
743
-
744
- export const UpdatePolicyBodySchema = z.object({
745
- /**
746
- * An optional human-readable description for the policy.
747
- * Limited to 50 characters of alphanumeric characters, spaces, commas, and periods.
748
- */
749
- description: z
750
- .string()
751
- .regex(/^[A-Za-z0-9 ,.]{1,50}$/)
752
- .optional(),
753
- /**
754
- * Array of rules that comprise the policy.
755
- * Limited to a maximum of 10 rules per policy.
756
- */
757
- rules: z.array(RuleSchema).max(10).min(1),
758
- });
759
- /**
760
- * Type representing the request body for updating an existing policy.
761
- * Contains the optional description and rules for the updated policy.
762
- * Note that the scope cannot be changed once a policy is created.
763
- */
764
- export type UpdatePolicyBody = z.infer<typeof UpdatePolicyBodySchema>;
@@ -0,0 +1,251 @@
1
+ import { z } from "zod";
2
+
3
+ /**
4
+ * Enum for Action types
5
+ */
6
+ export const ActionEnum = z.enum(["reject", "accept"]);
7
+ /**
8
+ * Type representing the possible policy actions.
9
+ * Determines whether matching the rule will cause a request to be accepted or rejected.
10
+ */
11
+ export type Action = z.infer<typeof ActionEnum>;
12
+
13
+ /**
14
+ * Enum for SolAddressOperator values
15
+ */
16
+ export const SolAddressOperatorEnum = z.enum(["in", "not in"]);
17
+ /**
18
+ * Type representing the operators that can be used for Solana address comparisons.
19
+ * These operators determine how transaction addresses are evaluated against a list.
20
+ */
21
+ export type SolAddressOperator = z.infer<typeof SolAddressOperatorEnum>;
22
+
23
+ /**
24
+ * Enum for SolValueOperator values
25
+ */
26
+ export const SolValueOperatorEnum = z.enum([">", ">=", "<", "<=", "=="]);
27
+ /**
28
+ * Type representing the operators that can be used for SOL value comparisons.
29
+ * These operators determine how transaction SOL values are compared against thresholds.
30
+ */
31
+ export type SolValueOperator = z.infer<typeof SolValueOperatorEnum>;
32
+
33
+ /**
34
+ * Enum for SplAddressOperator values
35
+ */
36
+ export const SplAddressOperatorEnum = z.enum(["in", "not in"]);
37
+ /**
38
+ * Type representing the operators that can be used for SPL address comparisons.
39
+ * These operators determine how SPL token transfer recipient addresses are evaluated against a list.
40
+ */
41
+ export type SplAddressOperator = z.infer<typeof SplAddressOperatorEnum>;
42
+
43
+ /**
44
+ * Enum for SplValueOperator values
45
+ */
46
+ export const SplValueOperatorEnum = z.enum([">", ">=", "<", "<=", "=="]);
47
+ /**
48
+ * Type representing the operators that can be used for SPL token value comparisons.
49
+ * These operators determine how SPL token values are compared against thresholds.
50
+ */
51
+ export type SplValueOperator = z.infer<typeof SplValueOperatorEnum>;
52
+
53
+ /**
54
+ * Enum for MintAddressOperator values
55
+ */
56
+ export const MintAddressOperatorEnum = z.enum(["in", "not in"]);
57
+ /**
58
+ * Type representing the operators that can be used for mint address comparisons.
59
+ * These operators determine how token mint addresses are evaluated against a list.
60
+ */
61
+ export type MintAddressOperator = z.infer<typeof MintAddressOperatorEnum>;
62
+
63
+ /**
64
+ * Schema for Solana address criterions
65
+ */
66
+ export const SolAddressCriterionSchema = z.object({
67
+ /** The type of criterion, must be "solAddress" for Solana address-based rules. */
68
+ type: z.literal("solAddress"),
69
+ /**
70
+ * Array of Solana addresses to compare against.
71
+ * Each address must be a valid Base58-encoded Solana address (32-44 characters).
72
+ */
73
+ addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
74
+ /**
75
+ * The operator to use for evaluating transaction addresses.
76
+ * "in" checks if an address is in the provided list.
77
+ * "not in" checks if an address is not in the provided list.
78
+ */
79
+ operator: SolAddressOperatorEnum,
80
+ });
81
+ export type SolAddressCriterion = z.infer<typeof SolAddressCriterionSchema>;
82
+
83
+ /**
84
+ * Schema for SOL value criterions
85
+ */
86
+ export const SolValueCriterionSchema = z.object({
87
+ /** The type of criterion, must be "solValue" for SOL value-based rules. */
88
+ type: z.literal("solValue"),
89
+ /**
90
+ * The SOL value amount in lamports to compare against, as a string.
91
+ * Must contain only digits.
92
+ */
93
+ solValue: z.string().regex(/^[0-9]+$/),
94
+ /** The comparison operator to use for evaluating transaction SOL values against the threshold. */
95
+ operator: SolValueOperatorEnum,
96
+ });
97
+ export type SolValueCriterion = z.infer<typeof SolValueCriterionSchema>;
98
+
99
+ /**
100
+ * Schema for SPL address criterions
101
+ */
102
+ export const SplAddressCriterionSchema = z.object({
103
+ /** The type of criterion, must be "splAddress" for SPL address-based rules. */
104
+ type: z.literal("splAddress"),
105
+ /**
106
+ * Array of Solana addresses to compare against for SPL token transfer recipients.
107
+ * Each address must be a valid Base58-encoded Solana address (32-44 characters).
108
+ */
109
+ addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
110
+ /**
111
+ * The operator to use for evaluating SPL token transfer recipient addresses.
112
+ * "in" checks if an address is in the provided list.
113
+ * "not in" checks if an address is not in the provided list.
114
+ */
115
+ operator: SplAddressOperatorEnum,
116
+ });
117
+ export type SplAddressCriterion = z.infer<typeof SplAddressCriterionSchema>;
118
+
119
+ /**
120
+ * Schema for SPL value criterions
121
+ */
122
+ export const SplValueCriterionSchema = z.object({
123
+ /** The type of criterion, must be "splValue" for SPL token value-based rules. */
124
+ type: z.literal("splValue"),
125
+ /**
126
+ * The SPL token value amount to compare against, as a string.
127
+ * Must contain only digits.
128
+ */
129
+ splValue: z.string().regex(/^[0-9]+$/),
130
+ /** The comparison operator to use for evaluating SPL token values against the threshold. */
131
+ operator: SplValueOperatorEnum,
132
+ });
133
+ export type SplValueCriterion = z.infer<typeof SplValueCriterionSchema>;
134
+
135
+ /**
136
+ * Schema for mint address criterions
137
+ */
138
+ export const MintAddressCriterionSchema = z.object({
139
+ /** The type of criterion, must be "mintAddress" for token mint address-based rules. */
140
+ type: z.literal("mintAddress"),
141
+ /**
142
+ * Array of Solana addresses to compare against for token mint addresses.
143
+ * Each address must be a valid Base58-encoded Solana address (32-44 characters).
144
+ */
145
+ addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
146
+ /**
147
+ * The operator to use for evaluating token mint addresses.
148
+ * "in" checks if an address is in the provided list.
149
+ * "not in" checks if an address is not in the provided list.
150
+ */
151
+ operator: MintAddressOperatorEnum,
152
+ });
153
+ export type MintAddressCriterion = z.infer<typeof MintAddressCriterionSchema>;
154
+
155
+ /**
156
+ * Schema for criteria used in SignSolTransaction operations
157
+ */
158
+ export const SignSolTransactionCriteriaSchema = z
159
+ .array(
160
+ z.discriminatedUnion("type", [
161
+ SolAddressCriterionSchema,
162
+ SolValueCriterionSchema,
163
+ SplAddressCriterionSchema,
164
+ SplValueCriterionSchema,
165
+ MintAddressCriterionSchema,
166
+ ]),
167
+ )
168
+ .max(10)
169
+ .min(1);
170
+ /**
171
+ * Type representing a set of criteria for the signSolTransaction operation.
172
+ * Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, and mint addresses.
173
+ */
174
+ export type SignSolTransactionCriteria = z.infer<typeof SignSolTransactionCriteriaSchema>;
175
+
176
+ /**
177
+ * Schema for criteria used in SendSolTransaction operations
178
+ */
179
+ export const SendSolTransactionCriteriaSchema = z
180
+ .array(
181
+ z.discriminatedUnion("type", [
182
+ SolAddressCriterionSchema,
183
+ SolValueCriterionSchema,
184
+ SplAddressCriterionSchema,
185
+ SplValueCriterionSchema,
186
+ MintAddressCriterionSchema,
187
+ ]),
188
+ )
189
+ .max(10)
190
+ .min(1);
191
+ /**
192
+ * Type representing a set of criteria for the sendSolTransaction operation.
193
+ * Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, and mint addresses.
194
+ */
195
+ export type SendSolTransactionCriteria = z.infer<typeof SendSolTransactionCriteriaSchema>;
196
+
197
+ /**
198
+ * Enum for Solana Operation types
199
+ */
200
+ export const SolOperationEnum = z.enum(["signSolTransaction", "sendSolTransaction"]);
201
+ /**
202
+ * Type representing the operations that can be governed by a policy.
203
+ * Defines what Solana operations the policy applies to.
204
+ */
205
+ export type SolOperation = z.infer<typeof SolOperationEnum>;
206
+
207
+ /**
208
+ * Type representing a 'signSolTransaction' policy rule that can accept or reject specific operations
209
+ * based on a set of criteria.
210
+ */
211
+ export const SignSolTransactionRuleSchema = z.object({
212
+ /**
213
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
214
+ * "accept" will allow the transaction, "reject" will block it.
215
+ */
216
+ action: ActionEnum,
217
+ /**
218
+ * The operation to which this rule applies.
219
+ * Must be "signSolTransaction".
220
+ */
221
+ operation: z.literal("signSolTransaction"),
222
+ /**
223
+ * The set of criteria that must be matched for this rule to apply.
224
+ * Must be compatible with the specified operation type.
225
+ */
226
+ criteria: SignSolTransactionCriteriaSchema,
227
+ });
228
+ export type SignSolTransactionRule = z.infer<typeof SignSolTransactionRuleSchema>;
229
+
230
+ /**
231
+ * Type representing a 'sendSolTransaction' policy rule that can accept or reject specific operations
232
+ * based on a set of criteria.
233
+ */
234
+ export const SendSolTransactionRuleSchema = z.object({
235
+ /**
236
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
237
+ * "accept" will allow the transaction, "reject" will block it.
238
+ */
239
+ action: ActionEnum,
240
+ /**
241
+ * The operation to which this rule applies.
242
+ * Must be "sendSolTransaction".
243
+ */
244
+ operation: z.literal("sendSolTransaction"),
245
+ /**
246
+ * The set of criteria that must be matched for this rule to apply.
247
+ * Must be compatible with the specified operation type.
248
+ */
249
+ criteria: SendSolTransactionCriteriaSchema,
250
+ });
251
+ export type SendSolTransactionRule = z.infer<typeof SendSolTransactionRuleSchema>;
package/policies/types.ts CHANGED
@@ -1,4 +1,15 @@
1
- import { PolicyScope, Rule } from "./schema.js";
1
+ import { z } from "zod";
2
+
3
+ import {
4
+ PrepareUserOperationRuleSchema,
5
+ SendEvmTransactionRuleSchema,
6
+ SignEvmHashRuleSchema,
7
+ SignEvmMessageRuleSchema,
8
+ SignEvmTransactionRuleSchema,
9
+ SignEvmTypedDataRuleSchema,
10
+ SendUserOperationRuleSchema,
11
+ } from "./evmSchema.js";
12
+ import { SendSolTransactionRuleSchema, SignSolTransactionRuleSchema } from "./solanaSchema.js";
2
13
 
3
14
  /**
4
15
  * A single Policy that can be used to govern the behavior of projects and accounts.
@@ -17,3 +28,85 @@ export type Policy = {
17
28
  /** The ISO 8601 timestamp at which the Policy was last updated. */
18
29
  updatedAt: string;
19
30
  };
31
+
32
+ /**
33
+ * Enum for policy scopes
34
+ */
35
+ export const PolicyScopeEnum = z.enum(["project", "account"]);
36
+ /**
37
+ * Type representing the scope of a policy.
38
+ * Determines whether the policy applies at the project level or account level.
39
+ */
40
+ export type PolicyScope = z.infer<typeof PolicyScopeEnum>;
41
+
42
+ /**
43
+ * Schema for policy rules
44
+ */
45
+ export const RuleSchema = z.discriminatedUnion("operation", [
46
+ SignEvmTransactionRuleSchema,
47
+ SignEvmHashRuleSchema,
48
+ SignEvmMessageRuleSchema,
49
+ SignEvmTypedDataRuleSchema,
50
+ SendEvmTransactionRuleSchema,
51
+ SignSolTransactionRuleSchema,
52
+ SendSolTransactionRuleSchema,
53
+ PrepareUserOperationRuleSchema,
54
+ SendUserOperationRuleSchema,
55
+ ]);
56
+
57
+ /**
58
+ * Type representing a policy rule that can accept or reject specific operations
59
+ * based on a set of criteria.
60
+ */
61
+ export type Rule = z.infer<typeof RuleSchema>;
62
+
63
+ /**
64
+ * Schema for creating or updating a Policy.
65
+ */
66
+ export const CreatePolicyBodySchema = z.object({
67
+ /**
68
+ * The scope of the policy.
69
+ * "project" applies to the entire project, "account" applies to specific accounts.
70
+ */
71
+ scope: PolicyScopeEnum,
72
+ /**
73
+ * An optional human-readable description for the policy.
74
+ * Limited to 50 characters of alphanumeric characters, spaces, commas, and periods.
75
+ */
76
+ description: z
77
+ .string()
78
+ .regex(/^[A-Za-z0-9 ,.]{1,50}$/)
79
+ .optional(),
80
+ /**
81
+ * Array of rules that comprise the policy.
82
+ * Limited to a maximum of 10 rules per policy.
83
+ */
84
+ rules: z.array(RuleSchema).max(10).min(1),
85
+ });
86
+ /**
87
+ * Type representing the request body for creating a new policy.
88
+ * Contains the scope, optional description, and rules for the policy.
89
+ */
90
+ export type CreatePolicyBody = z.infer<typeof CreatePolicyBodySchema>;
91
+
92
+ export const UpdatePolicyBodySchema = z.object({
93
+ /**
94
+ * An optional human-readable description for the policy.
95
+ * Limited to 50 characters of alphanumeric characters, spaces, commas, and periods.
96
+ */
97
+ description: z
98
+ .string()
99
+ .regex(/^[A-Za-z0-9 ,.]{1,50}$/)
100
+ .optional(),
101
+ /**
102
+ * Array of rules that comprise the policy.
103
+ * Limited to a maximum of 10 rules per policy.
104
+ */
105
+ rules: z.array(RuleSchema).max(10).min(1),
106
+ });
107
+ /**
108
+ * Type representing the request body for updating an existing policy.
109
+ * Contains the optional description and rules for the updated policy.
110
+ * Note that the scope cannot be changed once a policy is created.
111
+ */
112
+ export type UpdatePolicyBody = z.infer<typeof UpdatePolicyBodySchema>;
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.31.0";
1
+ export const version = "1.32.0";
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../policies/schema.ts"],"names":[],"mappings":";;;AAAA,qCAA2C;AAC3C,6BAAwB;AAExB;;GAEG;AACU,QAAA,oBAAoB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAOzE;;GAEG;AACU,QAAA,sBAAsB,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;AAO/D;;GAEG;AACU,QAAA,sBAAsB,GAAG,OA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