Callcium
API

PolicyBuilder

Fluent builder for Callcium policies.

PolicyBuilder

Fluent API for drafting policies from constraints.

Git Source

Methods

create

Create a builder from a function signature.

Git Source

function create(signature: string): PolicyBuilder;

Parameters

NameTypeDescription
signaturestringThe function signature (for example "transfer(address,uint256)").

Returns

PolicyBuilder — A new builder.

createRaw

Create a selectorless builder from a comma-separated type list.

Git Source

function createRaw(typesCsv: string): PolicyBuilder;

Parameters

NameTypeDescription
typesCsvstringThe comma-separated ABI types (for example "uint256,address").

Returns

PolicyBuilder — A new builder.

add

Add a constraint to the active group. A path through Quantifier.ALL or Quantifier.ANY adds its operators to the body of the group's loop over that array with that quantifier.

Git Source

function add(constraint: Constraint): this;

Parameters

NameTypeDescription
constraintConstraintThe constraint to add.

Returns

this — This builder.

or

Start a new constraint group (OR semantics between groups).

Git Source

function or(): this;

Returns

this — This builder.

build

Build the policy blob and validate it.

Git Source

function build(): `0x${string}`;

Returns

`0x${string}` — The encoded policy.

validate

Validate the policy the builder contains.

Git Source

function validate(): Issue[];

Returns

Issue[] — Every issue validation reports on the encoded policy.

buildUnsafe

Build the policy blob without validation. The resulting policy can be invalid.

Git Source

function buildUnsafe(): `0x${string}`;

Returns

`0x${string}` — The encoded policy.

On this page