MessageEncoder

MessageEncoder

Encrypts and encodes messages between two parties.

Constructor

new MessageEncoder(keyPair)

Description:
  • Creates message encoder around key pair.

Source:
Parameters:
Name Type Description
keyPair KeyPair

Key pair.

Members

publicKey

Description:
  • Public key used for message encoding.

Source:

Public key used for message encoding.

publicKey

Description:
  • Public key used for message encoding.

Source:

Public key used for message encoding.

Methods

encode(recipientPublicKey, message) → {Message}

Description:
  • Encodes message to recipient using recommended format.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Message

encode(recipientPublicKey, message) → {Uint8Array}

Description:
  • Encodes message to recipient using recommended format.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Uint8Array

encodeDeprecated(recipientPublicKey, message) → {Message}

Description:
  • Encodes message to recipient using recommended format.

Source:
Deprecated:
  • This function is only provided for compatability with older NEM messages. Please use `encode` in any new code.
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Message

encodeDeprecated(recipientPublicKey, message) → {Uint8Array}

Description:
  • Encodes message to recipient using (deprecated) wallet format.

Source:
Deprecated:
  • This function is only provided for compatability with the original Symbol wallets. Please use `encode` in any new code.
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Uint8Array

encodePersistentHarvestingDelegation(nodePublicKey, remoteKeyPair, vrfKeyPair) → {Uint8Array}

Description:
  • Encodes persistent harvesting delegation to node.

Source:
Parameters:
Name Type Description
nodePublicKey PublicKey

Node public key.

remoteKeyPair KeyPair

Remote key pair.

vrfKeyPair KeyPair

Vrf key pair.

Returns:

Encrypted and encoded harvesting delegation request.

Type
Uint8Array

tryDecode(recipientPublicKey, encodedMessage) → {TryDecodeResult}

Description:
  • Tries to decode encoded message.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

encodedMessage Message

Encoded message.

Returns:

Tuple containing decoded status and message.

Type
TryDecodeResult

tryDecode(recipientPublicKey, encodedMessage) → {TryDecodeResult}

Description:
  • Tries to decode encoded message.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient's public key.

encodedMessage Uint8Array

Encoded message.

Returns:

Tuple containing decoded status and message.

Type
TryDecodeResult

tryDecodeDeprecated(recipientPublicKey, encodedMessage) → {TryDecodeResult}

Description:
  • Tries to decode encoded message.

Source:
Deprecated:
  • This function is only provided for compatability with the original Symbol wallets. Please use `tryDecode` in any new code.
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient's public key.

encodedMessage Uint8Array

Encoded message

Returns:

Tuple containing decoded status and message.

Type
TryDecodeResult

MessageEncoder

Encrypts and encodes messages between two parties.

Constructor

new MessageEncoder(keyPair)

Description:
  • Creates message encoder around key pair.

Source:
Parameters:
Name Type Description
keyPair KeyPair

Key pair.

Members

publicKey

Description:
  • Public key used for message encoding.

Source:

Public key used for message encoding.

publicKey

Description:
  • Public key used for message encoding.

Source:

Public key used for message encoding.

Methods

encode(recipientPublicKey, message) → {Message}

Description:
  • Encodes message to recipient using recommended format.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Message

encode(recipientPublicKey, message) → {Uint8Array}

Description:
  • Encodes message to recipient using recommended format.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Uint8Array

encodeDeprecated(recipientPublicKey, message) → {Message}

Description:
  • Encodes message to recipient using recommended format.

Source:
Deprecated:
  • This function is only provided for compatability with older NEM messages. Please use `encode` in any new code.
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Message

encodeDeprecated(recipientPublicKey, message) → {Uint8Array}

Description:
  • Encodes message to recipient using (deprecated) wallet format.

Source:
Deprecated:
  • This function is only provided for compatability with the original Symbol wallets. Please use `encode` in any new code.
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

message Uint8Array

Message to encode.

Returns:

Encrypted and encoded message.

Type
Uint8Array

encodePersistentHarvestingDelegation(nodePublicKey, remoteKeyPair, vrfKeyPair) → {Uint8Array}

Description:
  • Encodes persistent harvesting delegation to node.

Source:
Parameters:
Name Type Description
nodePublicKey PublicKey

Node public key.

remoteKeyPair KeyPair

Remote key pair.

vrfKeyPair KeyPair

Vrf key pair.

Returns:

Encrypted and encoded harvesting delegation request.

Type
Uint8Array

tryDecode(recipientPublicKey, encodedMessage) → {TryDecodeResult}

Description:
  • Tries to decode encoded message.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient public key.

encodedMessage Message

Encoded message.

Returns:

Tuple containing decoded status and message.

Type
TryDecodeResult

tryDecode(recipientPublicKey, encodedMessage) → {TryDecodeResult}

Description:
  • Tries to decode encoded message.

Source:
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient's public key.

encodedMessage Uint8Array

Encoded message.

Returns:

Tuple containing decoded status and message.

Type
TryDecodeResult

tryDecodeDeprecated(recipientPublicKey, encodedMessage) → {TryDecodeResult}

Description:
  • Tries to decode encoded message.

Source:
Deprecated:
  • This function is only provided for compatability with the original Symbol wallets. Please use `tryDecode` in any new code.
Parameters:
Name Type Description
recipientPublicKey PublicKey

Recipient's public key.

encodedMessage Uint8Array

Encoded message

Returns:

Tuple containing decoded status and message.

Type
TryDecodeResult