PolicyBuilder
Fluent builder for Callcium policies.
PolicyBuilder
Fluent builder for constructing Callcium policies.
Methods
create
Create a builder from a function signature.
function create(signature: string): PolicyBuilder;Parameters
| Name | Type | Description |
|---|---|---|
signature | string | ABI function signature, e.g. "transfer(address,uint256)". |
Returns
PolicyBuilder
createRaw
Create a selectorless builder from a raw type string.
function createRaw(typesCsv: string): PolicyBuilder;Parameters
| Name | Type | Description |
|---|---|---|
typesCsv | string | Comma-separated ABI type strings, e.g. "address,uint256". |
Returns
PolicyBuilder
add
Add a constraint to the current group.
function add(constraint: Constraint | ConstraintBuilder): this;Parameters
| Name | Type | Description |
|---|---|---|
constraint | `Constraint | ConstraintBuilder` |
Returns
this
or
Start a new constraint group (OR branch).
function or(): this;Returns
this
build
Build the policy into an encoded binary blob with strict validation. Throws on any issue, regardless of severity. Use validate to inspect issues, or buildUnsafe to encode without validation.
function build(): templateLiteral;Returns
templateLiteral — The policy as a 0x-prefixed hex string.
buildUnsafe
Build the policy into an encoded binary blob without validation. The resulting policy may be invalid. Prefer build; use this only to knowingly bypass a reported issue.
function buildUnsafe(): templateLiteral;Returns
templateLiteral — The policy as a 0x-prefixed hex string.
validate
Validate the policy without encoding.
function validate(): Issue[];Returns
Issue[] — All validation issues found.