Skip to main content
Version: v2.0_alpha

Minimal Anti Collusion Infrastructure (MACI) v2.0.0-alpha / Message

Class: Message

Notice

An encrypted command and signature.

Constructors

new Message()

new Message(data): Message

Create a new instance of a Message

Parameters

data: bigint[]

the data of the message

Returns

Message

Defined in

message.ts:21

Properties

data

data: bigint[]

Defined in

message.ts:12


DATA_LENGTH

static DATA_LENGTH: number = 10

Defined in

message.ts:14

Methods

asCircuitInputs()

asCircuitInputs(): bigint[]

Return the message as a circuit input

Returns

bigint[]

the message as a circuit input

Defined in

message.ts:44


asContractParam()

asContractParam(): IMessageContractParams

Return the message as a contract param

Returns

IMessageContractParams

the message as a contract param

Defined in

message.ts:36


copy()

copy(): Message

Create a copy of the message

Returns

Message

a copy of the message

Defined in

message.ts:57


equals()

equals(m): boolean

Check if two messages are equal

Parameters

m: Message

the message to compare with

Returns

boolean

the result of the comparison

Defined in

message.ts:64


hash()

hash(encPubKey): bigint

Hash the message data and a public key

Parameters

encPubKey: PubKey

the public key that is used to encrypt this message

Returns

bigint

the hash of the message data and the public key

Defined in

message.ts:51


toJSON()

toJSON(): IMessageContractParams

Serialize to a JSON object

Returns

IMessageContractParams

Defined in

message.ts:75


fromJSON()

static fromJSON(json): Message

Deserialize into a Message instance

Parameters

json: IMessageContractParams

the json representation

Returns

Message

the deserialized object as a Message instance

Defined in

message.ts:84