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

@nilfoundation/niljs/src/encoding/externalMessage.ts:66

Properties

authData

authData: Uint8Array;

The auth data attached to the message.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:53


chainId

chainId: number;

The chain ID.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:35


data

data: Uint8Array;

The message data.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:47


isDeploy

isDeploy: boolean;

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

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:23


seqno

seqno: number;

The message sequence number.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:41


to

to: Uint8Array;

The destination address of the message.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:29

Methods

encode()

encode(): Uint8Array

Encodes the external message into a Uint8Array.

Returns

Uint8Array

The encoded external message.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:87


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

@nilfoundation/niljs/src/encoding/externalMessage.ts:137


hash()

hash(): Uint8Array

Provides the hash tree root of the external message.

Returns

Uint8Array

The hash tree root of the external message.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:104


hexAddress()

hexAddress(): 0x${string}

Returns the hex address of the given bytes.

Returns

0x${string}

The hex address.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:183


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

@nilfoundation/niljs/src/encoding/externalMessage.ts:193


sign()

sign(signer): Promise<Uint8Array>

Signs the external message.

Parameters

ParameterTypeDescription

signer

ISigner

The message signer.

Returns

Promise<Uint8Array>

The message signature.

Async

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:162


signingHash()

signingHash(): Uint8Array

Provides the signing hash of the external message.

Returns

Uint8Array

The signing hash of the external message.

Defined

@nilfoundation/niljs/src/encoding/externalMessage.ts:114


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

@nilfoundation/niljs/src/encoding/externalMessage.ts:173