@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.
- package/CHANGELOG.md +12 -0
- package/README.md +2 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js +1 -0
- package/_cjs/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_cjs/actions/evm/getUserOperation.js +2 -1
- package/_cjs/actions/evm/getUserOperation.js.map +1 -1
- package/_cjs/client/evm/evm.js +22 -0
- package/_cjs/client/evm/evm.js.map +1 -1
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +20 -2
- package/_cjs/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_cjs/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +20 -0
- 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 +76 -0
- package/_cjs/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_cjs/policies/schema.js +68 -1
- package/_cjs/policies/schema.js.map +1 -1
- package/_cjs/version.js +1 -1
- package/_esm/accounts/evm/toEvmSmartAccount.js +1 -0
- package/_esm/accounts/evm/toEvmSmartAccount.js.map +1 -1
- package/_esm/actions/evm/getUserOperation.js +2 -1
- package/_esm/actions/evm/getUserOperation.js.map +1 -1
- package/_esm/client/evm/evm.js +22 -0
- package/_esm/client/evm/evm.js.map +1 -1
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js +18 -0
- package/_esm/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.js.map +1 -1
- package/_esm/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.js +20 -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 +76 -0
- package/_esm/openapi-client/generated/policy-engine/policy-engine.msw.js.map +1 -1
- package/_esm/policies/schema.js +67 -0
- package/_esm/policies/schema.js.map +1 -1
- package/_esm/version.js +1 -1
- package/_types/accounts/evm/toEvmSmartAccount.d.ts.map +1 -1
- package/_types/accounts/evm/types.d.ts +2 -0
- package/_types/accounts/evm/types.d.ts.map +1 -1
- package/_types/actions/evm/getUserOperation.d.ts.map +1 -1
- package/_types/client/evm/evm.d.ts +14 -1
- package/_types/client/evm/evm.d.ts.map +1 -1
- package/_types/client/evm/evm.types.d.ts +18 -4
- package/_types/client/evm/evm.types.d.ts.map +1 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts +57 -1
- package/_types/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.d.ts.map +1 -1
- 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.map +1 -1
- package/_types/policies/schema.d.ts +6604 -2230
- package/_types/policies/schema.d.ts.map +1 -1
- package/_types/version.d.ts +1 -1
- package/accounts/evm/toEvmSmartAccount.ts +1 -0
- package/accounts/evm/types.ts +2 -0
- package/actions/evm/getUserOperation.ts +4 -1
- package/client/evm/evm.ts +31 -0
- package/client/evm/evm.types.ts +20 -4
- package/openapi-client/generated/coinbaseDeveloperPlatformAPIs.schemas.ts +88 -1
- package/openapi-client/generated/evm-smart-accounts/evm-smart-accounts.msw.ts +40 -0
- package/openapi-client/generated/index.msw.ts +4 -4
- package/openapi-client/generated/policy-engine/policy-engine.msw.ts +116 -0
- package/package.json +1 -1
- package/policies/schema.ts +87 -0
- package/version.ts +1 -1
package/policies/schema.ts
CHANGED
|
@@ -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.
|
|
1
|
+
export const version = "1.24.0";
|