@tangleid/mnid
v1.2.0
Published
Utilities for generating Multi Network Identifier (MNID)
Downloads
3
Readme
@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.
| Identitier | Network | | ---------- | -------------- | | 0x1 | Tangle Mainnet | | 0x2 | Tangle Devnet |
API Reference
mnid~generateChecksum(payload)
| Param | Type | Description | | --- | --- | --- | | payload | Array.<Buffer> | payload. |
Generate checksum from the payload
Returns: - 4-bytes checksum of the payload.
mnid~encodeToMnid(params)
| Param | Type | Description | | --- | --- | --- | | params | object | Encode parameters. | | params.network | string | Network identifier. | | params.address | string | Address in 81-trytes format. |
Encode MNID with specific network and address.
Returns: string - MNID
mnid~decodeFromMnid(mnid)
| Param | Type | Description | | --- | --- | --- | | mnid | string | MNID will be decoded. |
Decode infromation of network and address from MNID.
Returns: Object - The infromation of network and address.