Skip to main content

Class: Bool

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new Bool(x)

Parameters

NameType
xboolean | Bool

Defined in

snarky.d.ts:363

Properties

Unsafe

Static Unsafe: Object

Type declaration

NameType
ofField(x: string | number | boolean | Field) => Bool

Defined in

snarky.d.ts:443

Methods

and

and(y): Bool

Parameters

NameTypeDescription
yboolean | BoolA [[Bool]] to AND with this [[Bool]].

Returns

Bool

a new [[Bool]] that is set to true only if this [[Bool]] and y are also true.

Defined in

snarky.d.ts:380


assertEquals

assertEquals(y): void

Proves that this [[Bool]] is equal to y.

Parameters

NameTypeDescription
yboolean | Boola [[Bool]].

Returns

void

Defined in

snarky.d.ts:393


assertFalse

assertFalse(): void

Proves that this [[Bool]] is false.

Returns

void

Defined in

snarky.d.ts:403


assertTrue

assertTrue(): void

Proves that this [[Bool]] is true.

Returns

void

Defined in

snarky.d.ts:398


equals

equals(y): Bool

Returns true if this [[Bool]] is equal to y.

Parameters

NameTypeDescription
yboolean | Boola [[Bool]].

Returns

Bool

Defined in

snarky.d.ts:409


not

not(): Bool

Returns

Bool

a new [[Bool]] that is the negation of this [[Bool]].

Defined in

snarky.d.ts:373


or

or(y): Bool

Parameters

NameTypeDescription
yboolean | Boola [[Bool]] to OR with this [[Bool]].

Returns

Bool

a new [[Bool]] that is set to true if either this [[Bool]] or y is true.

Defined in

snarky.d.ts:387


sizeInFields

sizeInFields(): number

Returns

number

Defined in

snarky.d.ts:411


toBoolean

toBoolean(): boolean

This converts the [[Bool]] to a javascript boolean. This can only be called on non-witness values.

Returns

boolean

Defined in

snarky.d.ts:429


toField

toField(): Field

Converts a [[Bool]] to a [[Field]]. false becomes 0 and true becomes 1.

Returns

Field

Defined in

snarky.d.ts:368


toFields

toFields(): Field[]

Returns

Field[]

Defined in

snarky.d.ts:412


toJSON

toJSON(): JSONValue

Serialize the [[Bool]] to a JSON string. This operation does NOT affect the circuit and can't be used to prove anything about the string representation of the Field.

Returns

JSONValue

Defined in

snarky.d.ts:423


toString

toString(): string

Serialize the [[Bool]] to a string, e.g. for printing. This operation does NOT affect the circuit and can't be used to prove anything about the string representation of the Field.

Returns

string

Defined in

snarky.d.ts:418


and

Static and(x, y): Bool

Parameters

NameType
xboolean | Bool
yboolean | Bool

Returns

Bool

Defined in

snarky.d.ts:454


assertEqual

Static assertEqual(x, y): void

Parameters

NameType
xboolean | Bool
yboolean | Bool

Returns

void

Defined in

snarky.d.ts:457


check

Static check(x): void

Parameters

NameType
xBool

Returns

void

Defined in

snarky.d.ts:469


count

Static count(x): Field

Parameters

NameType
xboolean[] | Bool

Returns

Field

Defined in

snarky.d.ts:461


equal

Static equal(x, y): Bool

Parameters

NameType
xboolean | Bool
yboolean | Bool

Returns

Bool

Defined in

snarky.d.ts:459


fromJSON

Static fromJSON(x): null | Bool

Parameters

NameType
xJSONValue

Returns

null | Bool

Defined in

snarky.d.ts:468


not

Static not(x): Bool

Parameters

NameType
xboolean | Bool

Returns

Bool

Defined in

snarky.d.ts:453


ofFields

Static ofFields(fields): Bool

Parameters

NameType
fieldsField[]

Returns

Bool

Defined in

snarky.d.ts:465


or

Static or(x, y): Bool

Parameters

NameType
xboolean | Bool
yboolean | Bool

Returns

Bool

Defined in

snarky.d.ts:455


sizeInFields

Static sizeInFields(): number

Returns

number

Defined in

snarky.d.ts:463


toField

Static toField(x): Field

The constant [[Bool]] that is false.

Parameters

NameType
xboolean | Bool

Returns

Field

Defined in

snarky.d.ts:441


toFields

Static toFields(x): Field[]

Parameters

NameType
xBool

Returns

Field[]

Defined in

snarky.d.ts:464


toInput

Static toInput(x): Object

Parameters

NameType
xBool

Returns

Object

NameType
packed[Field, number][]

Defined in

snarky.d.ts:472


toJSON

Static toJSON(x): JSONValue

Parameters

NameType
xBool

Returns

JSONValue

Defined in

snarky.d.ts:467