1.2.0 • Published 5 years ago

@tangleid/mnid v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

@tangleid/mnid

Utilities for Multi Network Identifier (MNID).

Installation

Install using npm:

npm install @tangleid/mnid

or using yarn:

yarn add @tangleid/mnid

Network Identifiers

Used to describe which Tangle network interacts.

IdentitierNetwork
0x1Tangle Mainnet
0x2Tangle Devnet

API Reference

mnid~generateChecksum(payload)

ParamTypeDescription
payloadArray.<Buffer>payload.

Generate checksum from the payload

Returns: - 4-bytes checksum of the payload.

mnid~encodeToMnid(params)

ParamTypeDescription
paramsobjectEncode parameters.
params.networkstringNetwork identifier.
params.addressstringAddress in 81-trytes format.

Encode MNID with specific network and address.

Returns: string - MNID

mnid~decodeFromMnid(mnid)

ParamTypeDescription
mnidstringMNID will be decoded.

Decode infromation of network and address from MNID.

Returns: Object - The infromation of network and address.