@coinbase/cdp-sdk 1.23.0 → 1.24.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 (65) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +2 -0
  3. package/_cjs/accounts/evm/toEvmSmartAccount.js +1 -0
  4. package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
  5. package/_cjs/actions/evm/getUserOperation.js +2 -1
  6. package/_cjs/actions/evm/getUserOperation.js.map +1 -1
  7. package/_cjs/client/evm/evm.js +22 -0
  8. package/_cjs/client/evm/evm.js.map +1 -1
  9. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +20 -2
  10. package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  11. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +20 -0
  12. package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  13. package/_cjs/openapi-client/generated/index.msw.js +4 -4
  14. package/_cjs/openapi-client/generated/index.msw.js.map +1 -1
  15. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js +76 -0
  16. package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
  17. package/_cjs/policies/schema.js +68 -1
  18. package/_cjs/policies/schema.js.map +1 -1
  19. package/_cjs/version.js +1 -1
  20. package/_esm/accounts/evm/toEvmSmartAccount.js +1 -0
  21. package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
  22. package/_esm/actions/evm/getUserOperation.js +2 -1
  23. package/_esm/actions/evm/getUserOperation.js.map +1 -1
  24. package/_esm/client/evm/evm.js +22 -0
  25. package/_esm/client/evm/evm.js.map +1 -1
  26. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +18 -0
  27. package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
  28. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +20 -0
  29. package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js.map +1 -1
  30. package/_esm/openapi-client/generated/index.msw.js +4 -4
  31. package/_esm/openapi-client/generated/index.msw.js.map +1 -1
  32. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js +76 -0
  33. package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
  34. package/_esm/policies/schema.js +67 -0
  35. package/_esm/policies/schema.js.map +1 -1
  36. package/_esm/version.js +1 -1
  37. package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
  38. package/_types/accounts/evm/types.d.ts +2 -0
  39. package/_types/accounts/evm/types.d.ts.map +1 -1
  40. package/_types/actions/evm/getUserOperation.d.ts.map +1 -1
  41. package/_types/client/evm/evm.d.ts +14 -1
  42. package/_types/client/evm/evm.d.ts.map +1 -1
  43. package/_types/client/evm/evm.types.d.ts +18 -4
  44. package/_types/client/evm/evm.types.d.ts.map +1 -1
  45. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +57 -1
  46. package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
  47. package/_types/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.d.ts.map +1 -1
  48. package/_types/openapi-client/generated/index.msw.d.ts +4 -4
  49. package/_types/openapi-client/generated/index.msw.d.ts.map +1 -1
  50. package/_types/openapi-client/generated/policy-engine/policy-engine.msw.d.ts.map +1 -1
  51. package/_types/policies/schema.d.ts +6604 -2230
  52. package/_types/policies/schema.d.ts.map +1 -1
  53. package/_types/version.d.ts +1 -1
  54. package/accounts/evm/toEvmSmartAccount.ts +1 -0
  55. package/accounts/evm/types.ts +2 -0
  56. package/actions/evm/getUserOperation.ts +4 -1
  57. package/client/evm/evm.ts +31 -0
  58. package/client/evm/evm.types.ts +20 -4
  59. package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +88 -1
  60. package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +40 -0
  61. package/openapi-client/generated/index.msw.ts +4 -4
  62. package/openapi-client/generated/policy-engine/policy-engine.msw.ts +116 -0
  63. package/package.json +1 -1
  64. package/policies/schema.ts +87 -0
  65. package/version.ts +1 -1
@@ -434,6 +434,45 @@ export const SignSolTransactionCriteriaSchema = z
434
434
  */
435
435
  export type SignSolTransactionCriteria = z.infer<typeof SignSolTransactionCriteriaSchema>;
436
436
 
437
+ /**
438
+ * Schema for criteria used in PrepareUserOperation operations
439
+ */
440
+ export const PrepareUserOperationCriteriaSchema = z
441
+ .array(
442
+ z.discriminatedUnion("type", [
443
+ EthValueCriterionSchema,
444
+ EvmAddressCriterionSchema,
445
+ EvmNetworkCriterionSchema,
446
+ EvmDataCriterionSchema,
447
+ ]),
448
+ )
449
+ .max(10)
450
+ .min(1);
451
+ /**
452
+ * Type representing a set of criteria for the prepareUserOperation operation.
453
+ * Can contain up to 10 individual criterion objects of ETH value, EVM address, EVM network, or EVM data types.
454
+ */
455
+ export type PrepareUserOperationCriteria = z.infer<typeof PrepareUserOperationCriteriaSchema>;
456
+
457
+ /**
458
+ * Schema for criteria used in SendUserOperation operations
459
+ */
460
+ export const SendUserOperationCriteriaSchema = z
461
+ .array(
462
+ z.discriminatedUnion("type", [
463
+ EthValueCriterionSchema,
464
+ EvmAddressCriterionSchema,
465
+ EvmDataCriterionSchema,
466
+ ]),
467
+ )
468
+ .max(10)
469
+ .min(1);
470
+ /**
471
+ * Type representing a set of criteria for the sendUserOperation operation.
472
+ * Can contain up to 10 individual criterion objects of ETH value, EVM address, or EVM data types.
473
+ */
474
+ export type SendUserOperationCriteria = z.infer<typeof SendUserOperationCriteriaSchema>;
475
+
437
476
  /**
438
477
  * Enum for Solana Operation types
439
478
  */
@@ -597,6 +636,52 @@ export const SignSolTransactionRuleSchema = z.object({
597
636
  });
598
637
  export type SignSolTransactionRule = z.infer<typeof SignSolTransactionRuleSchema>;
599
638
 
639
+ /**
640
+ * Type representing a 'prepareUserOperation' policy rule that can accept or reject specific operations
641
+ * based on a set of criteria.
642
+ */
643
+ export const PrepareUserOperationRuleSchema = z.object({
644
+ /**
645
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
646
+ * "accept" will allow the operation, "reject" will block it.
647
+ */
648
+ action: ActionEnum,
649
+ /**
650
+ * The operation to which this rule applies.
651
+ * Must be "prepareUserOperation".
652
+ */
653
+ operation: z.literal("prepareUserOperation"),
654
+ /**
655
+ * The set of criteria that must be matched for this rule to apply.
656
+ * Must be compatible with the specified operation type.
657
+ */
658
+ criteria: PrepareUserOperationCriteriaSchema,
659
+ });
660
+ export type PrepareUserOperationRule = z.infer<typeof PrepareUserOperationRuleSchema>;
661
+
662
+ /**
663
+ * Type representing a 'sendUserOperation' policy rule that can accept or reject specific operations
664
+ * based on a set of criteria.
665
+ */
666
+ export const SendUserOperationRuleSchema = z.object({
667
+ /**
668
+ * Determines whether matching the rule will cause a request to be rejected or accepted.
669
+ * "accept" will allow the operation, "reject" will block it.
670
+ */
671
+ action: ActionEnum,
672
+ /**
673
+ * The operation to which this rule applies.
674
+ * Must be "sendUserOperation".
675
+ */
676
+ operation: z.literal("sendUserOperation"),
677
+ /**
678
+ * The set of criteria that must be matched for this rule to apply.
679
+ * Must be compatible with the specified operation type.
680
+ */
681
+ criteria: SendUserOperationCriteriaSchema,
682
+ });
683
+ export type SendUserOperationRule = z.infer<typeof SendUserOperationRuleSchema>;
684
+
600
685
  /**
601
686
  * Schema for policy rules
602
687
  */
@@ -607,6 +692,8 @@ export const RuleSchema = z.discriminatedUnion("operation", [
607
692
  SignEvmTypedDataRuleSchema,
608
693
  SendEvmTransactionRuleSchema,
609
694
  SignSolTransactionRuleSchema,
695
+ PrepareUserOperationRuleSchema,
696
+ SendUserOperationRuleSchema,
610
697
  ]);
611
698
 
612
699
  /**
package/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = "1.23.0";
1
+ export const version = "1.24.0";