diff --git a/typescript/.changeset/spicy-clouds-drop.md b/typescript/.changeset/spicy-clouds-drop.md new file mode 100644 index 000000000..1df067dd7 --- /dev/null +++ b/typescript/.changeset/spicy-clouds-drop.md @@ -0,0 +1,5 @@ +--- +"@coinbase/cdp-sdk": minor +--- + +Added SignEvmHashRule to policies schema diff --git a/typescript/src/policies/evmSchema.ts b/typescript/src/policies/evmSchema.ts index 61e5e0812..67d09bb6e 100644 --- a/typescript/src/policies/evmSchema.ts +++ b/typescript/src/policies/evmSchema.ts @@ -855,3 +855,21 @@ export const SignEndUserEvmTypedDataRuleSchema = z.object({ criteria: SignEndUserEvmTypedDataCriteriaSchema, }); export type SignEndUserEvmTypedDataRule = z.infer; + +/** + * Type representing a 'signEndUserEvmHash' policy rule that can accept or reject + * end-user EVM hash signing operations. + */ +export const SignEndUserEvmHashRuleSchema = z.object({ + /** + * Determines whether matching the rule will cause a request to be rejected or accepted. + * "accept" will allow the signing, "reject" will block it. + */ + action: ActionEnum, + /** + * The operation to which this rule applies. + * Must be "signEndUserEvmHash". + */ + operation: z.literal("signEndUserEvmHash"), +}); +export type SignEndUserEvmHashRule = z.infer; diff --git a/typescript/src/policies/types.ts b/typescript/src/policies/types.ts index 164f14756..542c54f2c 100644 --- a/typescript/src/policies/types.ts +++ b/typescript/src/policies/types.ts @@ -12,6 +12,7 @@ import { SendEndUserEvmTransactionRuleSchema, SignEndUserEvmMessageRuleSchema, SignEndUserEvmTypedDataRuleSchema, + SignEndUserEvmHashRuleSchema, } from "./evmSchema.js"; import { SendSolTransactionRuleSchema, @@ -68,6 +69,7 @@ export const RuleSchema = z.discriminatedUnion("operation", [ SendEndUserEvmTransactionRuleSchema, SignEndUserEvmMessageRuleSchema, SignEndUserEvmTypedDataRuleSchema, + SignEndUserEvmHashRuleSchema, SignEndUserSolTransactionRuleSchema, SendEndUserSolTransactionRuleSchema, SignEndUserSolMessageRuleSchema,