Character
Extends
- {
"value"
:Field
; }
Constructors
new Character()
new Character(value: number | Field): Character
Parameters
• value: number
| Field
Returns
Overrides
Struct({ value: Field }).constructor
Source
Properties
value
value: Field = Field;
Inherited from
Struct({ value: Field }).value
Source
_isStruct
static _isStruct: true;
Inherited from
Struct({ value: Field })._isStruct
Source
lib/provable/types/struct.ts:145
empty()
static empty: () => {
"value": Field;
};
Returns
{
"value": Field;
}
value
value: Field = Field;
Inherited from
Struct({ value: Field }).empty
Source
lib/provable/types/struct.ts:155
fromFields()
static fromFields: (fields: Field[]) => {
"value": Field;
};
Parameters
• fields: Field
[]
Returns
{
"value": Field;
}
value
value: Field = Field;
Inherited from
Struct({ value: Field }).fromFields
Source
lib/provable/types/provable-intf.ts:87
fromJSON()
static fromJSON: (x: {
"value": Field;
}) => {
"value": Field;
};
Parameters
• x
• x.value: string
= Field
Returns
{
"value": Field;
}
value
value: Field = Field;
Inherited from
Struct({ value: Field }).fromJSON
Source
lib/provable/types/struct.ts:154
fromValue
static fromValue: (x: {
"value": Field;
} | {
"value": Field;
}) => {
"value": Field;
} & (value: {
"value": Field;
}) => {
"value": Field;
};
Convert provable type from a normal JS type.
Inherited from
Struct({ value: Field }).fromValue
Source
lib/provable/types/provable-intf.ts:76
toAuxiliary()
static toAuxiliary: (value?: {
"value": Field;
}) => any[];
A function that takes value
(optional), an element of type T
, as argument and
returns an array of any type that make up the "auxiliary" (non-provable) data of value
.
Parameters
• value?
the element of type T
to generate the auxiliary data array from, optional.
If not provided, a default value for auxiliary data is returned.
• value.value?: Field
= Field
Returns
any
[]
Inherited from
Struct({ value: Field }).toAuxiliary
Source
lib/provable/types/provable-intf.ts:37
toFields()
static toFields: (value: {
"value": Field;
}) => Field[];
A function that takes value
, an element of type T
, as argument and returns
an array of Field elements that make up the provable data of value
.
Parameters
• value
the element of type T
to generate the Field array from.
• value.value: Field
= Field
Returns
Field
[]
Inherited from
Struct({ value: Field }).toFields
Source
lib/provable/types/provable-intf.ts:26
toInput()
static toInput: (x: {
"value": Field;
}) => {
"fields": Field[];
"packed": [Field, number][];
};
Parameters
• x
• x.value: Field
= Field
Returns
{
"fields": Field[];
"packed": [Field, number][];
}
fields?
optional fields: Field[];
packed?
optional packed: [Field, number][];
Inherited from
Struct({ value: Field }).toInput
Source
lib/provable/types/struct.ts:149
toJSON()
static toJSON: (x: {
"value": Field;
}) => {
"value": Field;
};
Parameters
• x
• x.value: Field
= Field
Returns
{
"value": Field;
}
value
value: string = Field;
Inherited from
Struct({ value: Field }).toJSON
Source
lib/provable/types/struct.ts:153
toValue()
static toValue: (x: {
"value": Field;
}) => {
"value": Field;
};
Convert provable type to a normal JS type.
Parameters
• x
• x.value: Field
= Field
Returns
{
"value": Field;
}
value
value: bigint = Field;
Inherited from
Struct({ value: Field }).toValue
Source
lib/provable/types/provable-intf.ts:71
Methods
isNull()
isNull(): Bool
Returns
Source
toField()
toField(): Field
Returns
Source
toString()
toString(): string
Returns
string
Source
check()
static check(c: {
"value": Field;
}): void
Parameters
• c
• c.value: Field
Returns
void
Overrides
Struct({ value: Field }).check
Source
fromString()
static fromString(str: string): Character
Parameters
• str: string
Returns
Source
sizeInFields()
static sizeInFields(): number
Return the size of the T
type in terms of Field type, as Field is the primitive type.
Returns
number
A number
representing the size of the T
type in terms of Field type.
Inherited from
Struct({ value: Field }).sizeInFields