Skip to main content

Class: ExternalMessageEnvelope

The envelope for an external message (a message sent by a user, a dApp, etc.)

ExternalMessageEnvelope

Constructors

new ExternalMessageEnvelope()

new ExternalMessageEnvelope(param0): ExternalMessageEnvelope

Creates an instance of ExternalMessageEnvelope.

Parameters

ParameterTypeDescription

param0

ExternalMessage

The object representing the external message.

Returns

ExternalMessageEnvelope

Defined in

nil/nil.js/src/encoding/externalMessage.ts:65

Properties

authData

authData: Uint8Array;

The auth data attached to the message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:52


chainId

chainId: number;

The chain ID.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:34


data

data: Uint8Array;

The message data.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:46


isDeploy

isDeploy: boolean;

The flag that determines whether the external message is a deployment message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:22


seqno

seqno: number;

The message sequence number.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:40


to

to: Uint8Array;

The destination address of the message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:28

Methods

encode()

encode(): Uint8Array

Encodes the external message into a Uint8Array.

Returns

Uint8Array

The encoded external message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:86


encodeWithSignature()

encodeWithSignature(signer): Promise<object>

Encodes the external message with its signature.

Parameters

ParameterTypeDescription

signer

ISigner

The message signer.

Returns

Promise<object>

The object containing the encoded message and its hash.

hash
hash: Uint8Array;
raw
raw: Uint8Array;

Async

Defined in

nil/nil.js/src/encoding/externalMessage.ts:139


hash()

hash(): Uint8Array

Provides the hash tree root of the external message.

Returns

Uint8Array

The hash tree root of the external message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:102


hexAddress()

hexAddress(): `0x${string}`

Returns the hex address of the given bytes.

Returns

`0x${string}`

The hex address.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:191


send()

send(client): Promise<`0x${string}`>

Sends the external message.

Parameters

ParameterTypeDescription

client

PublicClient

The client sending the message.

Returns

Promise<`0x${string}`>

The hash of the external message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:201


sign()

sign(signer): Promise<Uint8Array>

Signs the external message.

Parameters

ParameterTypeDescription

signer

ISigner

The message signer.

Returns

Promise<Uint8Array>

The message signature.

Async

Defined in

nil/nil.js/src/encoding/externalMessage.ts:170


signingHash()

signingHash(): Uint8Array

Provides the signing hash of the external message.

Returns

Uint8Array

The signing hash of the external message.

Defined in

nil/nil.js/src/encoding/externalMessage.ts:118


updateAuthdata()

updateAuthdata(signer): Promise<Uint8Array>

Updates the authentication data in the external message and returns the result.

Parameters

ParameterTypeDescription

signer

ISigner

The auth data signer.

Returns

Promise<Uint8Array>

The signed auth data.

Async

Defined in

nil/nil.js/src/encoding/externalMessage.ts:181