@coinbase/cdp-sdk 1.22.0 → 1.23.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.
- package/CHANGELOG.md +10 -0
- package/_cjs/client/evm/evm.js +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +37 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +14 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +31 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/index.msw.js +4 -4
- package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +246 -1
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js +14 -10
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js +34 -1
- package/_cjs/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_cjs/policies/schema.js +143 -1
- package/_cjs/policies/schema.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/client/evm/evm.js +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +35 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js +12 -0
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +28 -0
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
- package/_esm/openapi-client/generated/index.msw.js +4 -4
- package/_esm/openapi-client/generated/index.msw.js.map +1 -1
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +224 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js +12 -8
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.js.map +1 -1
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js +31 -0
- package/_esm/openapi-client/generated/solana-accounts/solana-accounts.msw.js.map +1 -1
- package/_esm/policies/schema.js +142 -0
- package/_esm/policies/schema.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/actions/evm/types.d.ts +2 -2
- package/_types/actions/evm/types.d.ts.map +1 -1
- package/_types/client/evm/evm.d.ts +1 -1
- package/_types/client/evm/evm.types.d.ts +1 -1
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +166 -3
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts +7 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts +2 -0
- package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/index.msw.d.ts +4 -4
- package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts +21 -1
- package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts +7 -6
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.d.ts.map +1 -1
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts +2 -0
- package/_types/openapi-client/generated/solana-accounts/solana-accounts.msw.d.ts.map +1 -1
- package/_types/openapi-client/index.d.ts +4 -10
- package/_types/openapi-client/index.d.ts.map +1 -1
- package/_types/policies/schema.d.ts +1606 -44
- package/_types/policies/schema.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/actions/evm/types.ts +2 -2
- package/client/evm/evm.ts +1 -1
- package/client/evm/evm.types.ts +1 -0
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +213 -2
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +46 -0
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.ts +23 -0
- package/openapi-client/generated/index.msw.ts +4 -4
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +349 -0
- package/openapi-client/generated/solana-accounts/solana-accounts.msw.ts +51 -0
- package/openapi-client/generated/solana-accounts/solana-accounts.ts +22 -20
- package/package.json +1 -1
- package/policies/schema.ts +170 -0
- package/version.ts +1 -1
package/policies/schema.ts
CHANGED
|
@@ -121,6 +121,152 @@ export const EvmMessageCriterionSchema = z.object({
|
|
|
121
121
|
});
|
|
122
122
|
export type EvmMessageCriterion = z.infer<typeof EvmMessageCriterionSchema>;
|
|
123
123
|
|
|
124
|
+
/**
|
|
125
|
+
* Schema for EVM typed address conditions
|
|
126
|
+
*/
|
|
127
|
+
export const EvmTypedAddressConditionSchema = z.object({
|
|
128
|
+
/**
|
|
129
|
+
* Array of EVM addresses to compare against.
|
|
130
|
+
* Each address must be a 0x-prefixed 40-character hexadecimal string.
|
|
131
|
+
* Limited to a maximum of 100 addresses per condition.
|
|
132
|
+
*/
|
|
133
|
+
addresses: z.array(Address).max(100),
|
|
134
|
+
/**
|
|
135
|
+
* The operator to use for evaluating addresses.
|
|
136
|
+
* "in" checks if an address is in the provided list.
|
|
137
|
+
* "not in" checks if an address is not in the provided list.
|
|
138
|
+
*/
|
|
139
|
+
operator: EvmAddressOperatorEnum,
|
|
140
|
+
/**
|
|
141
|
+
* The path to the field to compare against this criterion.
|
|
142
|
+
* To reference deeply nested fields, use dot notation (e.g., "order.buyer").
|
|
143
|
+
*/
|
|
144
|
+
path: z.string().min(1),
|
|
145
|
+
});
|
|
146
|
+
export type EvmTypedAddressCondition = z.infer<typeof EvmTypedAddressConditionSchema>;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Schema for EVM typed numerical conditions
|
|
150
|
+
*/
|
|
151
|
+
export const EvmTypedNumericalConditionSchema = z.object({
|
|
152
|
+
/**
|
|
153
|
+
* The numerical value to compare against, as a string.
|
|
154
|
+
* Must contain only digits.
|
|
155
|
+
*/
|
|
156
|
+
value: z.string().regex(/^[0-9]+$/),
|
|
157
|
+
/**
|
|
158
|
+
* The comparison operator to use.
|
|
159
|
+
*/
|
|
160
|
+
operator: EthValueOperatorEnum,
|
|
161
|
+
/**
|
|
162
|
+
* The path to the field to compare against this criterion.
|
|
163
|
+
* To reference deeply nested fields, use dot notation (e.g., "order.price").
|
|
164
|
+
*/
|
|
165
|
+
path: z.string().min(1),
|
|
166
|
+
});
|
|
167
|
+
export type EvmTypedNumericalCondition = z.infer<typeof EvmTypedNumericalConditionSchema>;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Schema for EVM typed string conditions
|
|
171
|
+
*/
|
|
172
|
+
export const EvmTypedStringConditionSchema = z.object({
|
|
173
|
+
/**
|
|
174
|
+
* A regular expression the string field is matched against.
|
|
175
|
+
* Accepts valid regular expression syntax described by [RE2](https://github.com/google/re2/wiki/Syntax).
|
|
176
|
+
*/
|
|
177
|
+
match: z.string().min(1),
|
|
178
|
+
/**
|
|
179
|
+
* The path to the field to compare against this criterion.
|
|
180
|
+
* To reference deeply nested fields, use dot notation (e.g., "metadata.description").
|
|
181
|
+
*/
|
|
182
|
+
path: z.string().min(1),
|
|
183
|
+
});
|
|
184
|
+
export type EvmTypedStringCondition = z.infer<typeof EvmTypedStringConditionSchema>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Schema for SignEvmTypedData field criterion
|
|
188
|
+
*/
|
|
189
|
+
export const SignEvmTypedDataFieldCriterionSchema = z.object({
|
|
190
|
+
/** The type of criterion, must be "evmTypedDataField" for typed data field-based rules. */
|
|
191
|
+
type: z.literal("evmTypedDataField"),
|
|
192
|
+
/**
|
|
193
|
+
* The EIP-712 type definitions for the typed data.
|
|
194
|
+
* Must include at minimum the primary type being signed.
|
|
195
|
+
*/
|
|
196
|
+
types: z.object({
|
|
197
|
+
/**
|
|
198
|
+
* EIP-712 compliant map of model names to model definitions.
|
|
199
|
+
*/
|
|
200
|
+
types: z.record(
|
|
201
|
+
z.array(
|
|
202
|
+
z.object({
|
|
203
|
+
name: z.string(),
|
|
204
|
+
type: z.string(),
|
|
205
|
+
}),
|
|
206
|
+
),
|
|
207
|
+
),
|
|
208
|
+
/**
|
|
209
|
+
* The name of the root EIP-712 type. This value must be included in the `types` object.
|
|
210
|
+
*/
|
|
211
|
+
primaryType: z.string(),
|
|
212
|
+
}),
|
|
213
|
+
/**
|
|
214
|
+
* Array of conditions to apply against typed data fields.
|
|
215
|
+
* Each condition specifies how to validate a specific field within the typed data.
|
|
216
|
+
*/
|
|
217
|
+
conditions: z
|
|
218
|
+
.array(
|
|
219
|
+
z.union([
|
|
220
|
+
EvmTypedAddressConditionSchema,
|
|
221
|
+
EvmTypedNumericalConditionSchema,
|
|
222
|
+
EvmTypedStringConditionSchema,
|
|
223
|
+
]),
|
|
224
|
+
)
|
|
225
|
+
.min(1),
|
|
226
|
+
});
|
|
227
|
+
export type SignEvmTypedDataFieldCriterion = z.infer<typeof SignEvmTypedDataFieldCriterionSchema>;
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Schema for SignEvmTypedData verifying contract criterion
|
|
231
|
+
*/
|
|
232
|
+
export const SignEvmTypedDataVerifyingContractCriterionSchema = z.object({
|
|
233
|
+
/** The type of criterion, must be "evmTypedDataVerifyingContract" for verifying contract-based rules. */
|
|
234
|
+
type: z.literal("evmTypedDataVerifyingContract"),
|
|
235
|
+
/**
|
|
236
|
+
* Array of EVM addresses allowed or disallowed as verifying contracts.
|
|
237
|
+
* Each address must be a 0x-prefixed 40-character hexadecimal string.
|
|
238
|
+
* Limited to a maximum of 100 addresses per criterion.
|
|
239
|
+
*/
|
|
240
|
+
addresses: z.array(Address).max(100),
|
|
241
|
+
/**
|
|
242
|
+
* The operator to use for evaluating verifying contract addresses.
|
|
243
|
+
* "in" checks if the verifying contract is in the provided list.
|
|
244
|
+
* "not in" checks if the verifying contract is not in the provided list.
|
|
245
|
+
*/
|
|
246
|
+
operator: EvmAddressOperatorEnum,
|
|
247
|
+
});
|
|
248
|
+
export type SignEvmTypedDataVerifyingContractCriterion = z.infer<
|
|
249
|
+
typeof SignEvmTypedDataVerifyingContractCriterionSchema
|
|
250
|
+
>;
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Schema for criteria used in SignEvmTypedData operations
|
|
254
|
+
*/
|
|
255
|
+
export const SignEvmTypedDataCriteriaSchema = z
|
|
256
|
+
.array(
|
|
257
|
+
z.discriminatedUnion("type", [
|
|
258
|
+
SignEvmTypedDataFieldCriterionSchema,
|
|
259
|
+
SignEvmTypedDataVerifyingContractCriterionSchema,
|
|
260
|
+
]),
|
|
261
|
+
)
|
|
262
|
+
.max(10)
|
|
263
|
+
.min(1);
|
|
264
|
+
/**
|
|
265
|
+
* Type representing a set of criteria for the signEvmTypedData operation.
|
|
266
|
+
* Can contain up to 10 individual criterion objects for typed data field or verifying contract checks.
|
|
267
|
+
*/
|
|
268
|
+
export type SignEvmTypedDataCriteria = z.infer<typeof SignEvmTypedDataCriteriaSchema>;
|
|
269
|
+
|
|
124
270
|
/**
|
|
125
271
|
* A list of comparables to apply against encoded arguments in the transaction's `data` field.
|
|
126
272
|
*/
|
|
@@ -382,6 +528,29 @@ export const SignEvmMessageRuleSchema = z.object({
|
|
|
382
528
|
});
|
|
383
529
|
export type SignEvmMessageRule = z.infer<typeof SignEvmMessageRuleSchema>;
|
|
384
530
|
|
|
531
|
+
/**
|
|
532
|
+
* Type representing a 'signEvmTypedData' policy rule that can accept or reject specific operations
|
|
533
|
+
* based on a set of criteria.
|
|
534
|
+
*/
|
|
535
|
+
export const SignEvmTypedDataRuleSchema = z.object({
|
|
536
|
+
/**
|
|
537
|
+
* Determines whether matching the rule will cause a request to be rejected or accepted.
|
|
538
|
+
* "accept" will allow the signing, "reject" will block it.
|
|
539
|
+
*/
|
|
540
|
+
action: ActionEnum,
|
|
541
|
+
/**
|
|
542
|
+
* The operation to which this rule applies.
|
|
543
|
+
* Must be "signEvmTypedData".
|
|
544
|
+
*/
|
|
545
|
+
operation: z.literal("signEvmTypedData"),
|
|
546
|
+
/**
|
|
547
|
+
* The set of criteria that must be matched for this rule to apply.
|
|
548
|
+
* Must be compatible with the specified operation type.
|
|
549
|
+
*/
|
|
550
|
+
criteria: SignEvmTypedDataCriteriaSchema,
|
|
551
|
+
});
|
|
552
|
+
export type SignEvmTypedDataRule = z.infer<typeof SignEvmTypedDataRuleSchema>;
|
|
553
|
+
|
|
385
554
|
/**
|
|
386
555
|
* Type representing a 'sendEvmTransaction' policy rule that can accept or reject specific operations
|
|
387
556
|
* based on a set of criteria.
|
|
@@ -435,6 +604,7 @@ export const RuleSchema = z.discriminatedUnion("operation", [
|
|
|
435
604
|
SignEvmTransactionRuleSchema,
|
|
436
605
|
SignEvmHashRuleSchema,
|
|
437
606
|
SignEvmMessageRuleSchema,
|
|
607
|
+
SignEvmTypedDataRuleSchema,
|
|
438
608
|
SendEvmTransactionRuleSchema,
|
|
439
609
|
SignSolTransactionRuleSchema,
|
|
440
610
|
]);
|
package/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = "1.
|
|
1
|
+
export const version = "1.23.0";
|