Module: NanoMemoTools/memo

NanoMemoTools.memo module
Source:

Classes

EncryptedMemo
Memo

Methods

(static) decrypt(encrypted_memo, decrypting_private_key) → {Memo}

This function converts an EncryptedMemo into a Memo Object
Parameters:
Name Type Description
encrypted_memo EncryptedMemo EncryptedMemo Object to convert
decrypting_private_key string 64-hex string representing a Nano Account's private key
Source:
Returns:
Memo Object with the message as plaintext
Type
Memo

(static) encrypt(memo, signing_private_key, decrypting_address, version_encryptopt) → {EncryptedMemo}

This function converts a Memo into an EncryptedMemo Object
Parameters:
Name Type Attributes Description
memo Memo Memo Object to convert
signing_private_key string 64-hex string representing a Nano Account's private key
decrypting_address string Nano address whose will be able to decrypt the memo
version_encrypt number <optional>
version of encryption algorithm - Versioning not yet implemented
Source:
Returns:
EncryptedMemo Object with the message encrypted
Type
EncryptedMemo

(async, inner) nodeValidated(memos, urlopt, usernameopt, passwordopt) → {object}

This function validates one or more Memos against the Nano Network; No username/password required if connecting to DEFAULT_SERVER or public API
Parameters:
Name Type Attributes Default Description
memos array Array of Memos to validate against the Nano Network
url string <optional>
node.DEFAULT_SERVER url of Nano Node RPC
username string <optional>
username for Nano Node RPC authentication
password string <optional>
password password for Nano Node RPC authentication
Source:
Returns:
{ valid: [], invalid: [], not_found: [] }; returns undefined on error
Type
object

(inner) validateAddress(address) → {boolean}

This function validates a given address
Parameters:
Name Type Description
address string Nano address
Source:
Returns:
true for validated address, false otherwise
Type
boolean

(inner) validateHash(hash) → {boolean}

This function validates a given hash
Parameters:
Name Type Description
hash string 64-hex string representing a Nano block hash
Source:
Returns:
true for validated hash, false otherwise
Type
boolean

(inner) validateKey(key) → {boolean}

This function validates a given key (public or private)
Parameters:
Name Type Description
key string 64-hex string representing a key
Source:
Returns:
true for validated key, false otherwise
Type
boolean

(inner) validateMessage(message, maxlengthopt) → {boolean}

This function validates a given message
Parameters:
Name Type Attributes Default Description
message string message to validate
maxlength number <optional>
512 configurable maxlength of message
Source:
Returns:
true for validated message, false otherwise
Type
boolean

(inner) validateSignature(signature) → {boolean}

This function validates a given signature
Parameters:
Name Type Description
signature string 128-hex string representing a signature
Source:
Returns:
true for validated signature, false otherwise
Type
boolean