@coinbase/cdp-sdk 1.31.1 → 1.33.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 (63) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +9 -7
  3. package/_cjs/client/policies/policies.js +72 -5
  4. package/_cjs/client/policies/policies.js.map +1 -1
  5. package/_cjs/index.js +3 -3
  6. package/_cjs/index.js.map +1 -1
  7. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +65 -2
  8. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  9. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +259 -5
  10. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
  11. package/_cjs/policies/{schema.js → evmSchema.js} +28 -112
  12. package/_cjs/policies/evmSchema.js.map +1 -0
  13. package/_cjs/policies/solanaSchema.js +183 -0
  14. package/_cjs/policies/solanaSchema.js.map +1 -0
  15. package/_cjs/policies/types.js +60 -0
  16. package/_cjs/policies/types.js.map +1 -1
  17. package/_cjs/version.js +1 -1
  18. package/_esm/client/policies/policies.js +70 -3
  19. package/_esm/client/policies/policies.js.map +1 -1
  20. package/_esm/index.js +1 -1
  21. package/_esm/index.js.map +1 -1
  22. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +63 -0
  23. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  24. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +237 -3
  25. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
  26. package/_esm/policies/{schema.js → evmSchema.js} +27 -111
  27. package/_esm/policies/evmSchema.js.map +1 -0
  28. package/_esm/policies/solanaSchema.js +180 -0
  29. package/_esm/policies/solanaSchema.js.map +1 -0
  30. package/_esm/policies/types.js +59 -1
  31. package/_esm/policies/types.js.map +1 -1
  32. package/_esm/version.js +1 -1
  33. package/_types/client/policies/policies.d.ts +69 -2
  34. package/_types/client/policies/policies.d.ts.map +1 -1
  35. package/_types/client/policies/policies.types.d.ts +1 -2
  36. package/_types/client/policies/policies.types.d.ts.map +1 -1
  37. package/_types/index.d.ts +1 -1
  38. package/_types/index.d.ts.map +1 -1
  39. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +171 -4
  40. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  41. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +21 -1
  42. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
  43. package/_types/policies/evmSchema.d.ts +4519 -0
  44. package/_types/policies/evmSchema.d.ts.map +1 -0
  45. package/_types/policies/solanaSchema.d.ts +758 -0
  46. package/_types/policies/solanaSchema.d.ts.map +1 -0
  47. package/_types/policies/types.d.ts +6743 -1
  48. package/_types/policies/types.d.ts.map +1 -1
  49. package/_types/version.d.ts +1 -1
  50. package/client/policies/policies.ts +70 -4
  51. package/client/policies/policies.types.ts +1 -2
  52. package/index.ts +1 -1
  53. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +240 -3
  54. package/openapi-client/generated/policy-engine/policy-engine.msw.ts +338 -3
  55. package/package.json +1 -1
  56. package/policies/{schema.ts → evmSchema.ts} +28 -158
  57. package/policies/solanaSchema.ts +251 -0
  58. package/policies/types.ts +94 -1
  59. package/version.ts +1 -1
  60. package/_cjs/policies/schema.js.map +0 -1
  61. package/_esm/policies/schema.js.map +0 -1
  62. package/_types/policies/schema.d.ts +0 -11599
  63. package/_types/policies/schema.d.ts.map +0 -1
@@ -0,0 +1,180 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * Enum for Action types
4
+ */
5
+ export const ActionEnum = z.enum(["reject", "accept"]);
6
+ /**
7
+ * Enum for SolAddressOperator values
8
+ */
9
+ export const SolAddressOperatorEnum = z.enum(["in", "not in"]);
10
+ /**
11
+ * Enum for SolValueOperator values
12
+ */
13
+ export const SolValueOperatorEnum = z.enum([">", ">=", "<", "<=", "=="]);
14
+ /**
15
+ * Enum for SplAddressOperator values
16
+ */
17
+ export const SplAddressOperatorEnum = z.enum(["in", "not in"]);
18
+ /**
19
+ * Enum for SplValueOperator values
20
+ */
21
+ export const SplValueOperatorEnum = z.enum([">", ">=", "<", "<=", "=="]);
22
+ /**
23
+ * Enum for MintAddressOperator values
24
+ */
25
+ export const MintAddressOperatorEnum = z.enum(["in", "not in"]);
26
+ /**
27
+ * Schema for Solana address criterions
28
+ */
29
+ export const SolAddressCriterionSchema = z.object({
30
+ /** The type of criterion, must be "solAddress" for Solana address-based rules. */
31
+ type: z.literal("solAddress"),
32
+ /**
33
+ * Array of Solana addresses to compare against.
34
+ * Each address must be a valid Base58-encoded Solana address (32-44 characters).
35
+ */
36
+ addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
37
+ /**
38
+ * The operator to use for evaluating transaction addresses.
39
+ * "in" checks if an address is in the provided list.
40
+ * "not in" checks if an address is not in the provided list.
41
+ */
42
+ operator: SolAddressOperatorEnum,
43
+ });
44
+ /**
45
+ * Schema for SOL value criterions
46
+ */
47
+ export const SolValueCriterionSchema = z.object({
48
+ /** The type of criterion, must be "solValue" for SOL value-based rules. */
49
+ type: z.literal("solValue"),
50
+ /**
51
+ * The SOL value amount in lamports to compare against, as a string.
52
+ * Must contain only digits.
53
+ */
54
+ solValue: z.string().regex(/^[0-9]+$/),
55
+ /** The comparison operator to use for evaluating transaction SOL values against the threshold. */
56
+ operator: SolValueOperatorEnum,
57
+ });
58
+ /**
59
+ * Schema for SPL address criterions
60
+ */
61
+ export const SplAddressCriterionSchema = z.object({
62
+ /** The type of criterion, must be "splAddress" for SPL address-based rules. */
63
+ type: z.literal("splAddress"),
64
+ /**
65
+ * Array of Solana addresses to compare against for SPL token transfer recipients.
66
+ * Each address must be a valid Base58-encoded Solana address (32-44 characters).
67
+ */
68
+ addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
69
+ /**
70
+ * The operator to use for evaluating SPL token transfer recipient addresses.
71
+ * "in" checks if an address is in the provided list.
72
+ * "not in" checks if an address is not in the provided list.
73
+ */
74
+ operator: SplAddressOperatorEnum,
75
+ });
76
+ /**
77
+ * Schema for SPL value criterions
78
+ */
79
+ export const SplValueCriterionSchema = z.object({
80
+ /** The type of criterion, must be "splValue" for SPL token value-based rules. */
81
+ type: z.literal("splValue"),
82
+ /**
83
+ * The SPL token value amount to compare against, as a string.
84
+ * Must contain only digits.
85
+ */
86
+ splValue: z.string().regex(/^[0-9]+$/),
87
+ /** The comparison operator to use for evaluating SPL token values against the threshold. */
88
+ operator: SplValueOperatorEnum,
89
+ });
90
+ /**
91
+ * Schema for mint address criterions
92
+ */
93
+ export const MintAddressCriterionSchema = z.object({
94
+ /** The type of criterion, must be "mintAddress" for token mint address-based rules. */
95
+ type: z.literal("mintAddress"),
96
+ /**
97
+ * Array of Solana addresses to compare against for token mint addresses.
98
+ * Each address must be a valid Base58-encoded Solana address (32-44 characters).
99
+ */
100
+ addresses: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
101
+ /**
102
+ * The operator to use for evaluating token mint addresses.
103
+ * "in" checks if an address is in the provided list.
104
+ * "not in" checks if an address is not in the provided list.
105
+ */
106
+ operator: MintAddressOperatorEnum,
107
+ });
108
+ /**
109
+ * Schema for criteria used in SignSolTransaction operations
110
+ */
111
+ export const SignSolTransactionCriteriaSchema = z
112
+ .array(z.discriminatedUnion("type", [
113
+ SolAddressCriterionSchema,
114
+ SolValueCriterionSchema,
115
+ SplAddressCriterionSchema,
116
+ SplValueCriterionSchema,
117
+ MintAddressCriterionSchema,
118
+ ]))
119
+ .max(10)
120
+ .min(1);
121
+ /**
122
+ * Schema for criteria used in SendSolTransaction operations
123
+ */
124
+ export const SendSolTransactionCriteriaSchema = z
125
+ .array(z.discriminatedUnion("type", [
126
+ SolAddressCriterionSchema,
127
+ SolValueCriterionSchema,
128
+ SplAddressCriterionSchema,
129
+ SplValueCriterionSchema,
130
+ MintAddressCriterionSchema,
131
+ ]))
132
+ .max(10)
133
+ .min(1);
134
+ /**
135
+ * Enum for Solana Operation types
136
+ */
137
+ export const SolOperationEnum = z.enum(["signSolTransaction", "sendSolTransaction"]);
138
+ /**
139
+ * Type representing a 'signSolTransaction' policy rule that can accept or reject specific operations
140
+ * based on a set of criteria.
141
+ */
142
+ export const SignSolTransactionRuleSchema = z.object({
143
+ /**
144
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
145
+ * "accept" will allow the transaction, "reject" will block it.
146
+ */
147
+ action: ActionEnum,
148
+ /**
149
+ * The operation to which this rule applies.
150
+ * Must be "signSolTransaction".
151
+ */
152
+ operation: z.literal("signSolTransaction"),
153
+ /**
154
+ * The set of criteria that must be matched for this rule to apply.
155
+ * Must be compatible with the specified operation type.
156
+ */
157
+ criteria: SignSolTransactionCriteriaSchema,
158
+ });
159
+ /**
160
+ * Type representing a 'sendSolTransaction' policy rule that can accept or reject specific operations
161
+ * based on a set of criteria.
162
+ */
163
+ export const SendSolTransactionRuleSchema = z.object({
164
+ /**
165
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
166
+ * "accept" will allow the transaction, "reject" will block it.
167
+ */
168
+ action: ActionEnum,
169
+ /**
170
+ * The operation to which this rule applies.
171
+ * Must be "sendSolTransaction".
172
+ */
173
+ operation: z.literal("sendSolTransaction"),
174
+ /**
175
+ * The set of criteria that must be matched for this rule to apply.
176
+ * Must be compatible with the specified operation type.
177
+ */
178
+ criteria: SendSolTransactionCriteriaSchema,
179
+ });
180
+ //# sourceMappingURL=solanaSchema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solanaSchema.js","sourceRoot":"","sources":["../../policies/solanaSchema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;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BAAyB;IACzB,uBAAuB;IACvB,yBAAyB;IACzB,uBAAuB;IACvB,0BAA0B;CAC3B,CAAC,CACH;KACA,GAAG,CAAC,EAAE,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,CAAC;AAOV;;GAEG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,CAAC;KAC9C,KAAK,CACJ,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC3B,yBAAyB;IACzB,uBAAuB;IACvB,yBAAyB;IACzB,uBAAuB;IACvB,0BAA0B;CAC3B,CAAC,CACH;KACA,GAAG,CAAC,EAAE,CAAC;KACP,GAAG,CAAC,CAAC,CAAC,CAAC;AAOV;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,CAAC,CAAC;AAOrF;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD;;;OAGG;IACH,MAAM,EAAE,UAAU;IAClB;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,EAAE,gCAAgC;CAC3C,CAAC,CAAC;AAGH;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD;;;OAGG;IACH,MAAM,EAAE,UAAU;IAClB;;;OAGG;IACH,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,CAAC;IAC1C;;;OAGG;IACH,QAAQ,EAAE,gCAAgC;CAC3C,CAAC,CAAC"}
@@ -1,2 +1,60 @@
1
- export {};
1
+ import { z } from "zod";
2
+ import { PrepareUserOperationRuleSchema, SendEvmTransactionRuleSchema, SignEvmHashRuleSchema, SignEvmMessageRuleSchema, SignEvmTransactionRuleSchema, SignEvmTypedDataRuleSchema, SendUserOperationRuleSchema, } from "./evmSchema.js";
3
+ import { SendSolTransactionRuleSchema, SignSolTransactionRuleSchema } from "./solanaSchema.js";
4
+ /**
5
+ * Enum for policy scopes
6
+ */
7
+ export const PolicyScopeEnum = z.enum(["project", "account"]);
8
+ /**
9
+ * Schema for policy rules
10
+ */
11
+ export const RuleSchema = z.discriminatedUnion("operation", [
12
+ SignEvmTransactionRuleSchema,
13
+ SignEvmHashRuleSchema,
14
+ SignEvmMessageRuleSchema,
15
+ SignEvmTypedDataRuleSchema,
16
+ SendEvmTransactionRuleSchema,
17
+ SignSolTransactionRuleSchema,
18
+ SendSolTransactionRuleSchema,
19
+ PrepareUserOperationRuleSchema,
20
+ SendUserOperationRuleSchema,
21
+ ]);
22
+ /**
23
+ * Schema for creating or updating a Policy.
24
+ */
25
+ export const CreatePolicyBodySchema = z.object({
26
+ /**
27
+ * The scope of the policy.
28
+ * "project" applies to the entire project, "account" applies to specific accounts.
29
+ */
30
+ scope: PolicyScopeEnum,
31
+ /**
32
+ * An optional human-readable description for the policy.
33
+ * Limited to 50 characters of alphanumeric characters, spaces, commas, and periods.
34
+ */
35
+ description: z
36
+ .string()
37
+ .regex(/^[A-Za-z0-9 ,.]{1,50}$/)
38
+ .optional(),
39
+ /**
40
+ * Array of rules that comprise the policy.
41
+ * Limited to a maximum of 10 rules per policy.
42
+ */
43
+ rules: z.array(RuleSchema).max(10).min(1),
44
+ });
45
+ export const UpdatePolicyBodySchema = z.object({
46
+ /**
47
+ * An optional human-readable description for the policy.
48
+ * Limited to 50 characters of alphanumeric characters, spaces, commas, and periods.
49
+ */
50
+ description: z
51
+ .string()
52
+ .regex(/^[A-Za-z0-9 ,.]{1,50}$/)
53
+ .optional(),
54
+ /**
55
+ * Array of rules that comprise the policy.
56
+ * Limited to a maximum of 10 rules per policy.
57
+ */
58
+ rules: z.array(RuleSchema).max(10).min(1),
59
+ });
2
60
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../policies/types.ts"],"names":[],"m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;;OAGG;IACH,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CAC1C,CAAC,CAAC"}
package/_esm/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const version = "1.31.1";
1
+ export const version = "1.33.0";
2
2
  //# sourceMappingURL=version.js.map
@@ -54,7 +54,7 @@ export declare class PoliciesClient implements PoliciesClientInterface {
54
54
  * @returns {Promise<Policy>} The created policy
55
55
  * @throws {ZodError<typeof CreatePolicyBodySchema>} When the policy is invalid
56
56
  *
57
- * @example **Creating a new policy**
57
+ * @example **Creating a new EVM policy**
58
58
  * ```ts
59
59
  * const policy = await cdp.policies.createPolicy({
60
60
  * policy: {
@@ -77,6 +77,45 @@ export declare class PoliciesClient implements PoliciesClientInterface {
77
77
  * });
78
78
  * ```
79
79
  *
80
+ * @example **Creating a new Solana policy**
81
+ * ```ts
82
+ * const policy = await cdp.policies.createPolicy({
83
+ * policy: {
84
+ * scope: "account",
85
+ * description: "Limits SOL transfers and SPL token operations",
86
+ * rules: [
87
+ * {
88
+ * action: "reject",
89
+ * operation: "signSolTransaction",
90
+ * criteria: [
91
+ * {
92
+ * type: "solValue",
93
+ * solValue: "1000000000", // 1 SOL in lamports
94
+ * operator: ">",
95
+ * },
96
+ * {
97
+ * type: "solAddress",
98
+ * addresses: ["9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"],
99
+ * operator: "in",
100
+ * },
101
+ * ],
102
+ * },
103
+ * {
104
+ * action: "accept",
105
+ * operation: "sendSolTransaction",
106
+ * criteria: [
107
+ * {
108
+ * type: "mintAddress",
109
+ * addresses: ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"], // USDC mint
110
+ * operator: "in",
111
+ * },
112
+ * ],
113
+ * },
114
+ * ],
115
+ * }
116
+ * });
117
+ * ```
118
+ *
80
119
  * @example **With idempotency key**
81
120
  * ```ts
82
121
  * const idempotencyKey = uuidv4();
@@ -173,7 +212,7 @@ export declare class PoliciesClient implements PoliciesClientInterface {
173
212
  * @returns {Promise<Policy>} The updated policy
174
213
  * @throws {ZodError<typeof UpdatePolicyBodySchema>} When the updated policy is invalid
175
214
  *
176
- * @example **Updating a policy**
215
+ * @example **Updating an EVM policy**
177
216
  * ```ts
178
217
  * const updatedPolicy = await cdp.policies.updatePolicy({
179
218
  * id: "__ID__",
@@ -196,6 +235,34 @@ export declare class PoliciesClient implements PoliciesClientInterface {
196
235
  * });
197
236
  * ```
198
237
  *
238
+ * @example **Updating a Solana policy**
239
+ * ```ts
240
+ * const updatedPolicy = await cdp.policies.updatePolicy({
241
+ * id: "__ID__",
242
+ * policy: {
243
+ * description: "Updated Solana transaction limits",
244
+ * rules: [
245
+ * {
246
+ * action: "reject",
247
+ * operation: "signSolTransaction",
248
+ * criteria: [
249
+ * {
250
+ * type: "splValue",
251
+ * splValue: "1000000", // SPL token amount
252
+ * operator: ">=",
253
+ * },
254
+ * {
255
+ * type: "mintAddress",
256
+ * addresses: ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"], // USDC mint
257
+ * operator: "in",
258
+ * },
259
+ * ],
260
+ * },
261
+ * ],
262
+ * },
263
+ * });
264
+ * ```
265
+ *
199
266
  * @example **With idempotency key**
200
267
  * ```ts
201
268
  * const idempotencyKey = uuidv4();
@@ -1 +1 @@
1
- {"version":3,"file":"policies.d.ts","sourceRoot":"","sources":["../../../client/policies/policies.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;GAEG;AACH,qBAAa,cAAe,YAAW,uBAAuB;IAC5D;;;;;;;;;;;;;;;;;;;;;;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AAmB,GAAG,OAAO,CAAC,MAAM,CAAC;IAiBjE;;;;;;;;;;;;;;;;;OAiBG;IACG,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC;IAQnE;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+EG;IACG,YAAY,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC;CAalE"}
@@ -1,6 +1,5 @@
1
1
  import { OpenApiPoliciesMethods } from "../../openapi-client/index.js";
2
- import { CreatePolicyBody, PolicyScope, UpdatePolicyBody } from "../../policies/schema.js";
3
- import { Policy } from "../../policies/types.js";
2
+ import { CreatePolicyBody, Policy, PolicyScope, UpdatePolicyBody } from "../../policies/types.js";
4
3
  /**
5
4
  * The PoliciesClient type, where all OpenApiPoliciesMethods methods are wrapped.
6
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"policies.types.d.ts","sourceRoot":"","sources":["../../../client/policies/policies.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,OAAO,sBAAsB,EAC3B,cAAc,GACd,cAAc,GACd,eAAe,GACf,cAAc,GACd,cAAc,CACjB,GAAG;IACF,YAAY,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC5E,YAAY,EAAE,CAAC,OA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oB;IACnC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;OAGG;IACH,MAAM,EAAE,gBAAgB,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
package/_types/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CdpClient } from "./client/cdp.js";
2
2
  export type { EvmServerAccount, EvmSmartAccount } from "./accounts/evm/types.js";
3
3
  export type { Policy } from "./policies/types.js";
4
- export { CreatePolicyBodySchema, UpdatePolicyBodySchema, type CreatePolicyBody, type UpdatePolicyBody, } from "./policies/schema.js";
4
+ export { CreatePolicyBodySchema, UpdatePolicyBodySchema, type CreatePolicyBody, type UpdatePolicyBody, } from "./policies/types.js";
5
5
  export { NetworkError } from "./openapi-client/errors.js";
6
6
  export type { SpendPermission } from "./spend-permissions/types.js";
7
7
  export { SPEND_PERMISSION_MANAGER_ABI as spendPermissionManagerAbi, SPEND_PERMISSION_MANAGER_ADDRESS as spendPermissionManagerAddress, } from "./spend-permissions/constants.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,4BAA4B,IAAI,yBAAyB,EACzD,gCAAgC,IAAI,6BAA6B,GAClE,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACjF,YAAY,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,YAAY,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EACL,4BAA4B,IAAI,yBAAyB,EACzD,gCAAgC,IAAI,6BAA6B,GAClE,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC"}
@@ -820,7 +820,36 @@ export interface EvmDataCriterion {
820
820
  /** A list of conditions to apply against the function and encoded arguments in the transaction's `data` field. Each condition must be met in order for this policy to be accepted or rejected. */
821
821
  conditions: EvmDataCondition[];
822
822
  }
823
- export type SignEvmTransactionCriteriaItem = EthValueCriterion | EvmAddressCriterion | EvmDataCriterion;
823
+ /**
824
+ * The type of criterion to use. This should be `netUSDChange`.
825
+ */
826
+ export type NetUSDChangeCriterionType = (typeof NetUSDChangeCriterionType)[keyof typeof NetUSDChangeCriterionType];
827
+ export declare const NetUSDChangeCriterionType: {
828
+ readonly netUSDChange: "netUSDChange";
829
+ };
830
+ /**
831
+ * The operator to use for the comparison. The total value of a transaction's asset transfer will be on the left-hand side of the operator, and the `changeCents` field will be on the right-hand side.
832
+ */
833
+ export type NetUSDChangeCriterionOperator = (typeof NetUSDChangeCriterionOperator)[keyof typeof NetUSDChangeCriterionOperator];
834
+ export declare const NetUSDChangeCriterionOperator: {
835
+ readonly ">": ">";
836
+ readonly ">=": ">=";
837
+ readonly "<": "<";
838
+ readonly "<=": "<=";
839
+ readonly "==": "==";
840
+ };
841
+ /**
842
+ * A schema for specifying a criterion for the USD denominated asset transfer or exposure for a transaction. This includes native transfers, as well as token transfers.
843
+ */
844
+ export interface NetUSDChangeCriterion {
845
+ /** The type of criterion to use. This should be `netUSDChange`. */
846
+ type: NetUSDChangeCriterionType;
847
+ /** The amount of USD, in cents, that the total value of a transaction's asset transfer should be compared to. */
848
+ changeCents: number;
849
+ /** The operator to use for the comparison. The total value of a transaction's asset transfer will be on the left-hand side of the operator, and the `changeCents` field will be on the right-hand side. */
850
+ operator: NetUSDChangeCriterionOperator;
851
+ }
852
+ export type SignEvmTransactionCriteriaItem = EthValueCriterion | EvmAddressCriterion | EvmDataCriterion | NetUSDChangeCriterion;
824
853
  /**
825
854
  * A schema for specifying criteria for the SignEvmTransaction operation.
826
855
  */
@@ -881,7 +910,7 @@ export interface EvmNetworkCriterion {
881
910
  /** The operator to use for the comparison. The transaction's intended `network` will be on the left-hand side of the operator, and the `networks` field will be on the right-hand side. */
882
911
  operator: EvmNetworkCriterionOperator;
883
912
  }
884
- export type SendEvmTransactionCriteriaItem = EthValueCriterion | EvmAddressCriterion | EvmNetworkCriterion | EvmDataCriterion;
913
+ export type SendEvmTransactionCriteriaItem = EthValueCriterion | EvmAddressCriterion | EvmNetworkCriterion | EvmDataCriterion | NetUSDChangeCriterion;
885
914
  /**
886
915
  * A schema for specifying criteria for the SignEvmTransaction operation.
887
916
  */
@@ -1119,10 +1148,121 @@ export interface SolAddressCriterion {
1119
1148
  /** The operator to use for the comparison. Each of the native transfer recipient addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side. */
1120
1149
  operator: SolAddressCriterionOperator;
1121
1150
  }
1151
+ /**
1152
+ * The type of criterion to use. This should be `solValue`.
1153
+ */
1154
+ export type SolValueCriterionType = (typeof SolValueCriterionType)[keyof typeof SolValueCriterionType];
1155
+ export declare const SolValueCriterionType: {
1156
+ readonly solValue: "solValue";
1157
+ };
1158
+ /**
1159
+ * The operator to use for the comparison. The transaction instruction's `value` field will be on the left-hand side of the operator, and the `solValue` field will be on the right-hand side.
1160
+ */
1161
+ export type SolValueCriterionOperator = (typeof SolValueCriterionOperator)[keyof typeof SolValueCriterionOperator];
1162
+ export declare const SolValueCriterionOperator: {
1163
+ readonly ">": ">";
1164
+ readonly ">=": ">=";
1165
+ readonly "<": "<";
1166
+ readonly "<=": "<=";
1167
+ readonly "==": "==";
1168
+ };
1169
+ /**
1170
+ * The criterion for the SOL value in lamports of a native transfer instruction in a Solana transaction.
1171
+ */
1172
+ export interface SolValueCriterion {
1173
+ /** The type of criterion to use. This should be `solValue`. */
1174
+ type: SolValueCriterionType;
1175
+ /** The amount of SOL in lamports that the transaction instruction's `value` field should be compared to. */
1176
+ solValue: string;
1177
+ /** The operator to use for the comparison. The transaction instruction's `value` field will be on the left-hand side of the operator, and the `solValue` field will be on the right-hand side. */
1178
+ operator: SolValueCriterionOperator;
1179
+ }
1180
+ /**
1181
+ * The type of criterion to use. This should be `splAddress`.
1182
+ */
1183
+ export type SplAddressCriterionType = (typeof SplAddressCriterionType)[keyof typeof SplAddressCriterionType];
1184
+ export declare const SplAddressCriterionType: {
1185
+ readonly splAddress: "splAddress";
1186
+ };
1187
+ /**
1188
+ * The operator to use for the comparison. Each of the SPL token transfer recipient addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side.
1189
+ */
1190
+ export type SplAddressCriterionOperator = (typeof SplAddressCriterionOperator)[keyof typeof SplAddressCriterionOperator];
1191
+ export declare const SplAddressCriterionOperator: {
1192
+ readonly in: "in";
1193
+ readonly not_in: "not in";
1194
+ };
1195
+ /**
1196
+ * The criterion for the recipient addresses of a Solana transaction's SPL token transfer instructions.
1197
+ */
1198
+ export interface SplAddressCriterion {
1199
+ /** The type of criterion to use. This should be `splAddress`. */
1200
+ type: SplAddressCriterionType;
1201
+ /** The Solana addresses that are compared to the list of SPL token transfer recipient addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array. */
1202
+ addresses: string[];
1203
+ /** The operator to use for the comparison. Each of the SPL token transfer recipient addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side. */
1204
+ operator: SplAddressCriterionOperator;
1205
+ }
1206
+ /**
1207
+ * The type of criterion to use. This should be `splValue`.
1208
+ */
1209
+ export type SplValueCriterionType = (typeof SplValueCriterionType)[keyof typeof SplValueCriterionType];
1210
+ export declare const SplValueCriterionType: {
1211
+ readonly splValue: "splValue";
1212
+ };
1213
+ /**
1214
+ * The operator to use for the comparison. The transaction instruction's `value` field will be on the left-hand side of the operator, and the `splValue` field will be on the right-hand side.
1215
+ */
1216
+ export type SplValueCriterionOperator = (typeof SplValueCriterionOperator)[keyof typeof SplValueCriterionOperator];
1217
+ export declare const SplValueCriterionOperator: {
1218
+ readonly ">": ">";
1219
+ readonly ">=": ">=";
1220
+ readonly "<": "<";
1221
+ readonly "<=": "<=";
1222
+ readonly "==": "==";
1223
+ };
1224
+ /**
1225
+ * The criterion for the SPL token value of a SPL token transfer instruction in a Solana transaction.
1226
+ */
1227
+ export interface SplValueCriterion {
1228
+ /** The type of criterion to use. This should be `splValue`. */
1229
+ type: SplValueCriterionType;
1230
+ /** The amount of the SPL token that the transaction instruction's `value` field should be compared to. */
1231
+ splValue: string;
1232
+ /** The operator to use for the comparison. The transaction instruction's `value` field will be on the left-hand side of the operator, and the `splValue` field will be on the right-hand side. */
1233
+ operator: SplValueCriterionOperator;
1234
+ }
1235
+ /**
1236
+ * The type of criterion to use. This should be `mintAddress`.
1237
+ */
1238
+ export type MintAddressCriterionType = (typeof MintAddressCriterionType)[keyof typeof MintAddressCriterionType];
1239
+ export declare const MintAddressCriterionType: {
1240
+ readonly mintAddress: "mintAddress";
1241
+ };
1242
+ /**
1243
+ * The operator to use for the comparison. Each of the token mint addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side.
1244
+ */
1245
+ export type MintAddressCriterionOperator = (typeof MintAddressCriterionOperator)[keyof typeof MintAddressCriterionOperator];
1246
+ export declare const MintAddressCriterionOperator: {
1247
+ readonly in: "in";
1248
+ readonly not_in: "not in";
1249
+ };
1250
+ /**
1251
+ * The criterion for the token mint addresses of a Solana transaction's SPL token transfer instructions.
1252
+ */
1253
+ export interface MintAddressCriterion {
1254
+ /** The type of criterion to use. This should be `mintAddress`. */
1255
+ type: MintAddressCriterionType;
1256
+ /** The Solana addresses that are compared to the list of token mint addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array. */
1257
+ addresses: string[];
1258
+ /** The operator to use for the comparison. Each of the token mint addresses in the transaction's `accountKeys` (for legacy transactions) or `staticAccountKeys` (for V0 transactions) array will be on the left-hand side of the operator, and the `addresses` field will be on the right-hand side. */
1259
+ operator: MintAddressCriterionOperator;
1260
+ }
1261
+ export type SignSolTransactionCriteriaItem = SolAddressCriterion | SolValueCriterion | SplAddressCriterion | SplValueCriterion | MintAddressCriterion;
1122
1262
  /**
1123
1263
  * A schema for specifying criteria for the SignSolTransaction operation.
1124
1264
  */
1125
- export type SignSolTransactionCriteria = SolAddressCriterion[];
1265
+ export type SignSolTransactionCriteria = SignSolTransactionCriteriaItem[];
1126
1266
  /**
1127
1267
  * Whether matching the rule will cause the request to be rejected or accepted.
1128
1268
  */
@@ -1145,6 +1285,33 @@ export interface SignSolTransactionRule {
1145
1285
  operation: SignSolTransactionRuleOperation;
1146
1286
  criteria: SignSolTransactionCriteria;
1147
1287
  }
1288
+ export type SendSolTransactionCriteriaItem = SolAddressCriterion | SolValueCriterion | SplAddressCriterion | SplValueCriterion | MintAddressCriterion;
1289
+ /**
1290
+ * A schema for specifying criteria for the SendSolTransaction operation.
1291
+ */
1292
+ export type SendSolTransactionCriteria = SendSolTransactionCriteriaItem[];
1293
+ /**
1294
+ * Whether matching the rule will cause the request to be rejected or accepted.
1295
+ */
1296
+ export type SendSolTransactionRuleAction = (typeof SendSolTransactionRuleAction)[keyof typeof SendSolTransactionRuleAction];
1297
+ export declare const SendSolTransactionRuleAction: {
1298
+ readonly reject: "reject";
1299
+ readonly accept: "accept";
1300
+ };
1301
+ /**
1302
+ * The operation to which the rule applies. Every element of the `criteria` array must match the specified operation.
1303
+ */
1304
+ export type SendSolTransactionRuleOperation = (typeof SendSolTransactionRuleOperation)[keyof typeof SendSolTransactionRuleOperation];
1305
+ export declare const SendSolTransactionRuleOperation: {
1306
+ readonly sendSolTransaction: "sendSolTransaction";
1307
+ };
1308
+ export interface SendSolTransactionRule {
1309
+ /** Whether matching the rule will cause the request to be rejected or accepted. */
1310
+ action: SendSolTransactionRuleAction;
1311
+ /** The operation to which the rule applies. Every element of the `criteria` array must match the specified operation. */
1312
+ operation: SendSolTransactionRuleOperation;
1313
+ criteria: SendSolTransactionCriteria;
1314
+ }
1148
1315
  /**
1149
1316
  * Whether any attempts to sign a hash will be accepted or rejected. This rule does not accept any criteria.
1150
1317
  */
@@ -1223,7 +1390,7 @@ export interface SendUserOperationRule {
1223
1390
  /**
1224
1391
  * A rule that limits the behavior of an account.
1225
1392
  */
1226
- export type Rule = SignEvmTransactionRule | SendEvmTransactionRule | SignEvmMessageRule | SignEvmTypedDataRule | SignSolTransactionRule | SignEvmHashRule | PrepareUserOperationRule | SendUserOperationRule;
1393
+ export type Rule = SignEvmTransactionRule | SendEvmTransactionRule | SignEvmMessageRule | SignEvmTypedDataRule | SignSolTransactionRule | SendSolTransactionRule | SignEvmHashRule | PrepareUserOperationRule | SendUserOperationRule;
1227
1394
  /**
1228
1395
  * The scope of the policy. Only one project-level policy can exist at any time.
1229
1396
  */