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:67

Properties

authData

authData: Uint8Array;

The auth data attached to the message.

Defined

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


chainId

chainId: number;

The chain ID.

Defined

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


data

data: Uint8Array;

The message data.

Defined

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


isDeploy

isDeploy: boolean;

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

Defined

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


seqno

seqno: number;

The message sequence number.

Defined

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


to

to: Uint8Array;

The destination address of the message.

Defined

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

Methods

encode()

encode(): Uint8Array

Encodes the external message into a Uint8Array.

Returns

Uint8Array

The encoded external message.

Defined

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


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:133


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:98


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:181


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:191


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:160


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:110


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:171