Types
Core TypeScript types exported by the SDK.
Types
Hex
Hex-encoded byte string, 0x-prefixed.
Prop
Type
Address
Ethereum address, 0x-prefixed.
Prop
Type
Span
Byte range in a source blob.
Prop
Type
Field
A decoded value with its byte position in the source blob.
Prop
Type
PolicyData
Canonical structured representation of a policy.
Prop
Type
Constraint
A collection of operators targeting a specific value.
Prop
Type
DecodedPolicy
Structural representation of a decoded policy with full byte-level spans.
Prop
Type
DecodedGroup
Structural representation of a decoded group with metadata spans.
Prop
Type
DecodedRule
Structural representation of a decoded rule with per-field spans.
Prop
Type
DecodedParam
Structural representation of a decoded parameter within the descriptor.
Prop
Type
Issue
A single validation issue found during policy analysis.
Prop
Type
IssueSeverity
Severity of a validation issue.
Prop
Type
IssueCategory
Category of a validation issue.
Prop
Type
Context
Execution context for context-scoped rules. Each property maps to a well-known EVM execution environment value. Only the properties referenced by the policy need to be supplied.
Prop
Type
EnforceResult
Result of enforcing a policy: pass with matched group index, or fail with one violation per failed group.
Prop
Type
Violation
Structured details of a single rule failure during enforcement.
Carries semantic data only — message strings are the consumer's responsibility.
Discriminate on code to narrow to the matching variant.
Prop
Type
ViolationCode
Machine-readable reason code for an enforcement violation. Derived from Violation to prevent drift.
Prop
Type
NavigationViolationCode
Subset of violation codes emitted by reader/navigation primitives.
MissingSelectorViolation
Calldata is shorter than the policy's selector slot.
Prop
Type
SelectorMismatchViolation
Calldata selector does not match the policy's expected selector.
Prop
Type
MissingContextViolation
A context-scoped rule referenced a property not supplied in the execution context.
opCode and operandData may be added in future versions as diagnostic context
without breaking the contract; consumers should tolerate their presence.
Prop
Type
ValueMismatchViolation
A rule's operator returned false against the loaded value.
Field combinations:
resolvedValuepresent,elementIndexabsent — scalar leaf or context value that failed the operator.resolvedValuepresent,elementIndexpresent — universal-quantifier per-element failure.resolvedValueabsent,elementIndexabsent — existential-aggregate failure (no element satisfied).resolvedValueabsent,elementIndexpresent — per-element failure where the leaf could not be loaded.
For length operations (isLengthOp(opCode)), resolvedValue is a hex-encoded count
rather than a 32-byte ABI word.
Prop
Type
CalldataNavigationViolation
Calldata structure prevented the rule from being evaluated.
The operator was never applied; opCode, operandData, typeCode, and elementIndex
are diagnostic context describing the failing site, not a constraint claim. Renderers
must not summarise these as "constraint violated".
Encoded as a union of per-code variants so consumers can narrow on a single code via
Extract<Violation, { code: "..." }>.
QuantifierLimitExceededViolation
A quantified array exceeded Limits.MAX_QUANTIFIED_ARRAY_LENGTH.
Prop
Type
QuantifierEmptyArrayViolation
A quantifier (ANY or ALL) was applied to an empty array.
Prop
Type