DocsReference@proto-kit/protocolClassesOutgoingMessageArgument

@proto-kit/protocolDocs


Documentation / @proto-kit/protocol / OutgoingMessageArgument

Class: OutgoingMessageArgument

Extends

  • object

Constructors

new OutgoingMessageArgument()

new OutgoingMessageArgument(value): OutgoingMessageArgument

Parameters

value

value.data: Unconstrained<any> = ...

value.messageType: Field = Field

value.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

OutgoingMessageArgument

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).constructor

Defined in

node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:103

Properties

data

data: Unconstrained<any>

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).data

Defined in

packages/protocol/src/settlement/messages/OutgoingMessageArgument.ts:29


messageType

messageType: Field = Field

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).messageType

Defined in

packages/protocol/src/settlement/messages/OutgoingMessageArgument.ts:28


witness

witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).witness

Defined in

packages/protocol/src/settlement/messages/OutgoingMessageArgument.ts:27


_isStruct

static _isStruct: true

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, })._isStruct

Defined in

node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:104


check()

static check: (value) => void

Add assertions to the proof to check if value is a valid member of type T. This function does not return anything, instead it creates any number of assertions to prove that value is a valid member of the type T.

For instance, calling check function on the type Bool asserts that the value of the element is either 1 or 0.

Parameters

value

the element of type T to put assertions on.

value.data: Unconstrained<any> = ...

value.messageType: Field = Field

value.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

void

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).check

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:60


empty()

static empty: () => object

Returns

object

data

data: Unconstrained<any>

messageType

messageType: Field = Field

witness

witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).empty

Defined in

node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:113


fromFields()

static fromFields: (fields, aux) => object

A function that returns an element of type T from the given provable and “auxiliary” data.

This function is the reverse operation of calling toFields and toAuxiliary methods on an element of type T.

Parameters

fields: Field[]

an array of Field elements describing the provable data of the new T element.

aux: any[]

an array of any type describing the “auxiliary” data of the new T element, optional.

Returns

object

An element of type T generated from the given provable and “auxiliary” data.

data

data: Unconstrained<any>

messageType

messageType: Field = Field

witness

witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).fromFields

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:45


fromJSON()

static fromJSON: (x) => object

Parameters

x

x.data = ...

x.data.prototype

x.data.prototype.get

x.data.prototype.set

x.data.prototype.setTo

x.data.prototype.updateAsProver

x.data.provable

x.data.provable.check

Add assertions to the proof to check if value is a valid member of type T. This function does not return anything, instead it creates any number of assertions to prove that value is a valid member of the type T.

For instance, calling check function on the type Bool asserts that the value of the element is either 1 or 0.

Param

the element of type T to put assertions on.

x.data.provable.empty

x.data.provable.fromFields

A function that returns an element of type T from the given provable and “auxiliary” data.

This function is the reverse operation of calling toFields and toAuxiliary methods on an element of type T.

Param

an array of Field elements describing the provable data of the new T element.

Param

an array of any type describing the “auxiliary” data of the new T element, optional.

x.data.provable.fromValue

Convert provable type from a normal JS type.

x.data.provable.toAuxiliary

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.

Param

the element of type T to generate the auxiliary data array from, optional. If not provided, a default value for auxiliary data is returned.

x.data.provable.toCanonical?: null | object

Optional method which transforms a provable type into its canonical representation.

This is needed for types that have multiple representations of the same underlying value, and might even not have perfect completeness for some of those representations.

An example is the ForeignField class, which allows non-native field elements to exist in unreduced form. The unreduced form is not perfectly complete, for example, addition of two unreduced field elements can cause a prover error.

Specific protocols need to be able to protect themselves against incomplete operations at all costs. For example, when using actions and reducer, the reducer must be able to produce a proof regardless of the input action. toCanonical() converts any input into a safe form and enables us to handle cases like this generically.

Note: For most types, this method is the identity function. The identity function will also be used when the toCanonical() is not present on a type.

x.data.provable.toFields

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.

Param

the element of type T to generate the Field array from.

x.data.provable.toInput

x.data.provable.toValue

Convert provable type to a normal JS type.

x.data.provable.sizeInFields

x.data.from

x.data.withEmpty

x.data.witness

x.messageType: string = Field

x.witness = LinkedMerkleTreeReadWitness

x.witness.leaf

x.witness.leaf.nextPath: string

x.witness.leaf.path: string

x.witness.leaf.value: string

x.witness.merkleWitness

x.witness.merkleWitness.isLeft: boolean[]

x.witness.merkleWitness.path: string[]

Returns

object

data

data: Unconstrained<any>

messageType

messageType: Field = Field

witness

witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).fromJSON

Defined in

node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:112


fromValue

static fromValue: (x) => object & (value) => object

Convert provable type from a normal JS type.

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).fromValue

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:68


toAuxiliary()

static toAuxiliary: (value?) => 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.data?: Unconstrained<any> = ...

value.messageType?: Field = Field

value.witness?: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

any[]

An array of any type describing how this T element is made up of “auxiliary” (non-provable) data.

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).toAuxiliary

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:34


toCanonical()?

static optional toCanonical: (x) => object

Optional method which transforms a provable type into its canonical representation.

This is needed for types that have multiple representations of the same underlying value, and might even not have perfect completeness for some of those representations.

An example is the ForeignField class, which allows non-native field elements to exist in unreduced form. The unreduced form is not perfectly complete, for example, addition of two unreduced field elements can cause a prover error.

Specific protocols need to be able to protect themselves against incomplete operations at all costs. For example, when using actions and reducer, the reducer must be able to produce a proof regardless of the input action. toCanonical() converts any input into a safe form and enables us to handle cases like this generically.

Note: For most types, this method is the identity function. The identity function will also be used when the toCanonical() is not present on a type.

Parameters

x

x.data: Unconstrained<any> = ...

x.messageType: Field = Field

x.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

object

data

data: Unconstrained<any>

messageType

messageType: Field = Field

witness

witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).toCanonical

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:85


toFields()

static toFields: (value) => 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.data: Unconstrained<any> = ...

value.messageType: Field = Field

value.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

Field[]

A Field array describing how this T element is made up of Field elements.

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).toFields

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:24


toInput()

static toInput: (x) => object

Parameters

x

x.data: Unconstrained<any> = ...

x.messageType: Field = Field

x.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

object

fields?

optional fields: Field[]

packed?

optional packed: [Field, number][]

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).toInput

Defined in

node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:107


toJSON()

static toJSON: (x) => object

Parameters

x

x.data: Unconstrained<any> = ...

x.messageType: Field = Field

x.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

object

data

data: object

data.prototype

data.prototype: object

data.prototype.get

data.prototype.get

data.prototype.set

data.prototype.set

data.prototype.setTo

data.prototype.setTo

data.prototype.updateAsProver

data.prototype.updateAsProver

data.provable

data.provable: object

data.provable.check

data.provable.check: object

Add assertions to the proof to check if value is a valid member of type T. This function does not return anything, instead it creates any number of assertions to prove that value is a valid member of the type T.

For instance, calling check function on the type Bool asserts that the value of the element is either 1 or 0.

Param

the element of type T to put assertions on.

data.provable.empty

data.provable.empty: object

data.provable.fromFields

data.provable.fromFields: object

A function that returns an element of type T from the given provable and “auxiliary” data.

This function is the reverse operation of calling toFields and toAuxiliary methods on an element of type T.

Param

an array of Field elements describing the provable data of the new T element.

Param

an array of any type describing the “auxiliary” data of the new T element, optional.

Returns

An element of type T generated from the given provable and “auxiliary” data.

data.provable.fromValue

data.provable.fromValue: object

Convert provable type from a normal JS type.

data.provable.toAuxiliary

data.provable.toAuxiliary: object

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.

Param

the element of type T to generate the auxiliary data array from, optional. If not provided, a default value for auxiliary data is returned.

Returns

An array of any type describing how this T element is made up of “auxiliary” (non-provable) data.

data.provable.toCanonical?

optional data.provable.toCanonical: null | object

Optional method which transforms a provable type into its canonical representation.

This is needed for types that have multiple representations of the same underlying value, and might even not have perfect completeness for some of those representations.

An example is the ForeignField class, which allows non-native field elements to exist in unreduced form. The unreduced form is not perfectly complete, for example, addition of two unreduced field elements can cause a prover error.

Specific protocols need to be able to protect themselves against incomplete operations at all costs. For example, when using actions and reducer, the reducer must be able to produce a proof regardless of the input action. toCanonical() converts any input into a safe form and enables us to handle cases like this generically.

Note: For most types, this method is the identity function. The identity function will also be used when the toCanonical() is not present on a type.

data.provable.toFields

data.provable.toFields: object

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.

Param

the element of type T to generate the Field array from.

Returns

A Field array describing how this T element is made up of Field elements.

data.provable.toInput

data.provable.toInput: object

data.provable.toValue

data.provable.toValue: object

Convert provable type to a normal JS type.

data.provable.sizeInFields

data.provable.sizeInFields

data.from

data.from

data.withEmpty

data.withEmpty

data.witness

data.witness

messageType

messageType: string = Field

witness

witness: object = LinkedMerkleTreeReadWitness

witness.leaf

witness.leaf: object

witness.leaf.nextPath

witness.leaf.nextPath: string

witness.leaf.path

witness.leaf.path: string

witness.leaf.value

witness.leaf.value: string

witness.merkleWitness

witness.merkleWitness: object

witness.merkleWitness.isLeft

witness.merkleWitness.isLeft: boolean[]

witness.merkleWitness.path

witness.merkleWitness.path: string[]

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).toJSON

Defined in

node_modules/o1js/dist/node/lib/provable/types/struct.d.ts:111


toValue()

static toValue: (x) => object

Convert provable type to a normal JS type.

Parameters

x

x.data: Unconstrained<any> = ...

x.messageType: Field = Field

x.witness: LinkedMerkleTreeReadWitness = LinkedMerkleTreeReadWitness

Returns

object

data

data: any

messageType

messageType: bigint = Field

witness

witness: object = LinkedMerkleTreeReadWitness

witness.leaf

witness.leaf: object

witness.leaf.nextPath

witness.leaf.nextPath: bigint

witness.leaf.path

witness.leaf.path: bigint

witness.leaf.value

witness.leaf.value: bigint

witness.merkleWitness

witness.merkleWitness: object

witness.merkleWitness.isLeft

witness.merkleWitness.isLeft: boolean[]

witness.merkleWitness.path

witness.merkleWitness.path: bigint[]

Inherited from

Struct({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).toValue

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:64

Methods

dummy()

static dummy(): OutgoingMessageArgument

Returns

OutgoingMessageArgument

Defined in

packages/protocol/src/settlement/messages/OutgoingMessageArgument.ts:31


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({ witness: LinkedMerkleTreeReadWitness, messageType: Field, data: Unconstrained<string[]>, }).sizeInFields

Defined in

node_modules/o1js/dist/node/lib/provable/types/provable-intf.d.ts:51