Skip to content

adamant-api / index / encodeMessage

Function: encodeMessage()

ts
function encodeMessage(
   msg, 
   keypair, 
   recipientPublicKey): {
  message: string;
  own_message: string;
};

Defined in: src/helpers/encryptor.ts:70

Encrypts a message for an ADM recipient using the established NaCl format.

Parameters

ParameterType
msgstring
keypairKeyPair
recipientPublicKeystring | Uint8Array<ArrayBufferLike>

Returns

ts
{
  message: string;
  own_message: string;
}

message

ts
message: string;

own_message

ts
own_message: string;

Released under the GPL-3.0 License.