Pre-release — The API surface may change. Unaudited.
Callcium LogoCallcium
API

PolicyBuilder

Fluent builder for Callcium policies.

PolicyBuilder

Fluent builder for constructing Callcium policies.

Git Source

Methods

create

Create a builder from a function signature.

Git Source

function create(signature: string): PolicyBuilder;

Parameters

NameTypeDescription
signaturestringABI function signature, e.g. "transfer(address,uint256)".

Returns

PolicyBuilder

createRaw

Create a selectorless builder from a raw type string.

Git Source

function createRaw(typesCsv: string): PolicyBuilder;

Parameters

NameTypeDescription
typesCsvstringComma-separated ABI type strings, e.g. "address,uint256".

Returns

PolicyBuilder

add

Add a constraint to the current group.

Git Source

function add(constraint: Constraint | ConstraintBuilder): this;

Parameters

NameTypeDescription
constraint`ConstraintConstraintBuilder`

Returns

this

or

Start a new constraint group (OR branch).

Git Source

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.

Git Source

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.

Git Source

function buildUnsafe(): templateLiteral;

Returns

templateLiteral — The policy as a 0x-prefixed hex string.

validate

Validate the policy without encoding.

Git Source

function validate(): Issue[];

Returns

Issue[] — All validation issues found.

On this page