@coinbase/cdp-sdk 1.36.1 → 1.37.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 (55) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +73 -1
  3. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  4. package/_cjs/openapi-client/generated/onchain-data/onchain-data.js +1 -39
  5. package/_cjs/openapi-client/generated/onchain-data/onchain-data.js.map +1 -1
  6. package/_cjs/openapi-client/generated/onramp/onramp.js +29 -1
  7. package/_cjs/openapi-client/generated/onramp/onramp.js.map +1 -1
  8. package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +43 -0
  9. package/_cjs/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -0
  10. package/_cjs/openapi-client/index.js +1 -0
  11. package/_cjs/openapi-client/index.js.map +1 -1
  12. package/_cjs/policies/solanaSchema.js +92 -2
  13. package/_cjs/policies/solanaSchema.js.map +1 -1
  14. package/_cjs/policies/types.js +1 -0
  15. package/_cjs/policies/types.js.map +1 -1
  16. package/_cjs/version.js +1 -1
  17. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +71 -0
  18. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  19. package/_esm/openapi-client/generated/onchain-data/onchain-data.js +0 -37
  20. package/_esm/openapi-client/generated/onchain-data/onchain-data.js.map +1 -1
  21. package/_esm/openapi-client/generated/onramp/onramp.js +27 -0
  22. package/_esm/openapi-client/generated/onramp/onramp.js.map +1 -1
  23. package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js +39 -0
  24. package/_esm/openapi-client/generated/sql-api-alpha/sql-api-alpha.js.map +1 -0
  25. package/_esm/openapi-client/index.js +1 -0
  26. package/_esm/openapi-client/index.js.map +1 -1
  27. package/_esm/policies/solanaSchema.js +91 -1
  28. package/_esm/policies/solanaSchema.js.map +1 -1
  29. package/_esm/policies/types.js +2 -1
  30. package/_esm/policies/types.js.map +1 -1
  31. package/_esm/version.js +1 -1
  32. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +224 -4
  33. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  34. package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts +1 -32
  35. package/_types/openapi-client/generated/onchain-data/onchain-data.d.ts.map +1 -1
  36. package/_types/openapi-client/generated/onramp/onramp.d.ts +22 -1
  37. package/_types/openapi-client/generated/onramp/onramp.d.ts.map +1 -1
  38. package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts +43 -0
  39. package/_types/openapi-client/generated/sql-api-alpha/sql-api-alpha.d.ts.map +1 -0
  40. package/_types/openapi-client/index.d.ts +1 -1
  41. package/_types/openapi-client/index.d.ts.map +1 -1
  42. package/_types/policies/solanaSchema.d.ts +325 -3
  43. package/_types/policies/solanaSchema.d.ts.map +1 -1
  44. package/_types/policies/types.d.ts +337 -0
  45. package/_types/policies/types.d.ts.map +1 -1
  46. package/_types/version.d.ts +1 -1
  47. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +291 -3
  48. package/openapi-client/generated/onchain-data/onchain-data.ts +0 -46
  49. package/openapi-client/generated/onramp/onramp.ts +38 -0
  50. package/openapi-client/generated/sql-api-alpha/sql-api-alpha.ts +60 -0
  51. package/openapi-client/index.ts +1 -0
  52. package/package.json +1 -1
  53. package/policies/solanaSchema.ts +124 -3
  54. package/policies/types.ts +6 -1
  55. package/version.ts +1 -1
@@ -60,6 +60,35 @@ export const MintAddressOperatorEnum = z.enum(["in", "not in"]);
60
60
  */
61
61
  export type MintAddressOperator = z.infer<typeof MintAddressOperatorEnum>;
62
62
 
63
+ /**
64
+ * Enum for ProgramIdOperator values
65
+ */
66
+ export const ProgramIdOperatorEnum = z.enum(["in", "not in"]);
67
+ /**
68
+ * Type representing the operators that can be used for program ID comparisons.
69
+ * These operators determine how transaction program IDs are evaluated against a list.
70
+ */
71
+ export type ProgramIdOperator = z.infer<typeof ProgramIdOperatorEnum>;
72
+
73
+ /**
74
+ * Enum for SolNetworkOperator values
75
+ */
76
+ export const SolNetworkOperatorEnum = z.enum(["in", "not in"]);
77
+ /**
78
+ * Type representing the operators that can be used for Solana network comparisons.
79
+ * These operators determine how transaction networks are evaluated against a list.
80
+ */
81
+ export type SolNetworkOperator = z.infer<typeof SolNetworkOperatorEnum>;
82
+
83
+ /**
84
+ * Enum for supported Solana networks
85
+ */
86
+ export const SolNetworkEnum = z.enum(["solana-devnet", "solana"]);
87
+ /**
88
+ * Type representing the supported Solana networks.
89
+ */
90
+ export type SolNetwork = z.infer<typeof SolNetworkEnum>;
91
+
63
92
  /**
64
93
  * Enum for KnownIdlType values
65
94
  */
@@ -250,6 +279,58 @@ export const SolDataCriterionSchema = z.object({
250
279
  });
251
280
  export type SolDataCriterion = z.infer<typeof SolDataCriterionSchema>;
252
281
 
282
+ /**
283
+ * Schema for program ID criterions
284
+ */
285
+ export const ProgramIdCriterionSchema = z.object({
286
+ /** The type of criterion, must be "programId" for program ID-based rules. */
287
+ type: z.literal("programId"),
288
+ /**
289
+ * Array of Solana program IDs to compare against.
290
+ * Each program ID must be a valid Base58-encoded Solana address (32-44 characters).
291
+ */
292
+ programIds: z.array(z.string().regex(/^[1-9A-HJ-NP-Za-km-z]{32,44}$/)),
293
+ /**
294
+ * The operator to use for evaluating transaction program IDs.
295
+ * "in" checks if a program ID is in the provided list.
296
+ * "not in" checks if a program ID is not in the provided list.
297
+ */
298
+ operator: ProgramIdOperatorEnum,
299
+ });
300
+ export type ProgramIdCriterion = z.infer<typeof ProgramIdCriterionSchema>;
301
+
302
+ /**
303
+ * Schema for Solana network criterions
304
+ */
305
+ export const SolNetworkCriterionSchema = z.object({
306
+ /** The type of criterion, must be "solNetwork" for network-based rules. */
307
+ type: z.literal("solNetwork"),
308
+ /**
309
+ * Array of Solana networks to compare against.
310
+ */
311
+ networks: z.array(SolNetworkEnum),
312
+ /**
313
+ * The operator to use for evaluating transaction network.
314
+ * "in" checks if the network is in the provided list.
315
+ * "not in" checks if the network is not in the provided list.
316
+ */
317
+ operator: SolNetworkOperatorEnum,
318
+ });
319
+ export type SolNetworkCriterion = z.infer<typeof SolNetworkCriterionSchema>;
320
+
321
+ /**
322
+ * Schema for Solana message criterions
323
+ */
324
+ export const SolMessageCriterionSchema = z.object({
325
+ /** The type of criterion, must be "solMessage" for message-based rules. */
326
+ type: z.literal("solMessage"),
327
+ /**
328
+ * A regular expression pattern to match against the message.
329
+ */
330
+ match: z.string(),
331
+ });
332
+ export type SolMessageCriterion = z.infer<typeof SolMessageCriterionSchema>;
333
+
253
334
  /**
254
335
  * Schema for criteria used in SignSolTransaction operations
255
336
  */
@@ -262,13 +343,14 @@ export const SignSolTransactionCriteriaSchema = z
262
343
  SplValueCriterionSchema,
263
344
  MintAddressCriterionSchema,
264
345
  SolDataCriterionSchema,
346
+ ProgramIdCriterionSchema,
265
347
  ]),
266
348
  )
267
349
  .max(10)
268
350
  .min(1);
269
351
  /**
270
352
  * Type representing a set of criteria for the signSolTransaction operation.
271
- * Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, and mint addresses.
353
+ * Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, mint addresses, Solana data, and program IDs.
272
354
  */
273
355
  export type SignSolTransactionCriteria = z.infer<typeof SignSolTransactionCriteriaSchema>;
274
356
 
@@ -284,20 +366,26 @@ export const SendSolTransactionCriteriaSchema = z
284
366
  SplValueCriterionSchema,
285
367
  MintAddressCriterionSchema,
286
368
  SolDataCriterionSchema,
369
+ ProgramIdCriterionSchema,
370
+ SolNetworkCriterionSchema,
287
371
  ]),
288
372
  )
289
373
  .max(10)
290
374
  .min(1);
291
375
  /**
292
376
  * Type representing a set of criteria for the sendSolTransaction operation.
293
- * Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, and mint addresses.
377
+ * Can contain up to 10 individual criterion objects for Solana addresses, SOL values, SPL addresses, SPL values, mint addresses, Solana data, program IDs, and network restrictions.
294
378
  */
295
379
  export type SendSolTransactionCriteria = z.infer<typeof SendSolTransactionCriteriaSchema>;
296
380
 
297
381
  /**
298
382
  * Enum for Solana Operation types
299
383
  */
300
- export const SolOperationEnum = z.enum(["signSolTransaction", "sendSolTransaction"]);
384
+ export const SolOperationEnum = z.enum([
385
+ "signSolTransaction",
386
+ "sendSolTransaction",
387
+ "signSolMessage",
388
+ ]);
301
389
  /**
302
390
  * Type representing the operations that can be governed by a policy.
303
391
  * Defines what Solana operations the policy applies to.
@@ -349,3 +437,36 @@ export const SendSolTransactionRuleSchema = z.object({
349
437
  criteria: SendSolTransactionCriteriaSchema,
350
438
  });
351
439
  export type SendSolTransactionRule = z.infer<typeof SendSolTransactionRuleSchema>;
440
+
441
+ /**
442
+ * Schema for criteria used in SignSolMessage operations
443
+ */
444
+ export const SignSolMessageCriteriaSchema = z.array(SolMessageCriterionSchema).max(10).min(1);
445
+ /**
446
+ * Type representing a set of criteria for the signSolMessage operation.
447
+ * Can contain up to 10 individual criterion objects for Solana message matching.
448
+ */
449
+ export type SignSolMessageCriteria = z.infer<typeof SignSolMessageCriteriaSchema>;
450
+
451
+ /**
452
+ * Type representing a 'signSolMessage' policy rule that can accept or reject specific operations
453
+ * based on a set of criteria.
454
+ */
455
+ export const SignSolMessageRuleSchema = z.object({
456
+ /**
457
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
458
+ * "accept" will allow the message signing, "reject" will block it.
459
+ */
460
+ action: ActionEnum,
461
+ /**
462
+ * The operation to which this rule applies.
463
+ * Must be "signSolMessage".
464
+ */
465
+ operation: z.literal("signSolMessage"),
466
+ /**
467
+ * The set of criteria that must be matched for this rule to apply.
468
+ * Must be compatible with the specified operation type.
469
+ */
470
+ criteria: SignSolMessageCriteriaSchema,
471
+ });
472
+ export type SignSolMessageRule = z.infer<typeof SignSolMessageRuleSchema>;
package/policies/types.ts CHANGED
@@ -9,7 +9,11 @@ import {
9
9
  SignEvmTypedDataRuleSchema,
10
10
  SendUserOperationRuleSchema,
11
11
  } from "./evmSchema.js";
12
- import { SendSolTransactionRuleSchema, SignSolTransactionRuleSchema } from "./solanaSchema.js";
12
+ import {
13
+ SendSolTransactionRuleSchema,
14
+ SignSolTransactionRuleSchema,
15
+ SignSolMessageRuleSchema,
16
+ } from "./solanaSchema.js";
13
17
 
14
18
  /**
15
19
  * A single Policy that can be used to govern the behavior of projects and accounts.
@@ -50,6 +54,7 @@ export const RuleSchema = z.discriminatedUnion("operation", [
50
54
  SendEvmTransactionRuleSchema,
51
55
  SignSolTransactionRuleSchema,
52
56
  SendSolTransactionRuleSchema,
57
+ SignSolMessageRuleSchema,
53
58
  PrepareUserOperationRuleSchema,
54
59
  SendUserOperationRuleSchema,
55
60
  ]);
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.36.1";
1
+ export const version = "1.37.0";