1.2.0 • Published 6 years ago
@tangleid/mnid v1.2.0
@tangleid/mnid
Utilities for Multi Network Identifier (MNID).
Installation
Install using npm:
npm install @tangleid/mnidor using yarn:
yarn add @tangleid/mnidNetwork 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.