@tangleid/did
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

@tangleid/did

Utilities for the coding of decentralized identifiers.

Installation

Install using npm:

npm install @tangleid/did

or using yarn:

yarn add @tangleid/did

Network Identifiers

Used to describe which Tangle network interacts.

Identitier Network
0x1 Tangle Mainnet
0x2 Tangle Devnet

API Reference

did~encodeToDid(params)

Link: https://w3c-ccg.github.io/did-spec/#the-generic-did-scheme DID Document}.

Param Type Description
params object Encode parameters.
params.network string Network identifier.
params.address string Address in 81-trytes format.

Encode TangleID DID with specific network and address.

Returns: string - TangleID which follow the DID scheme

did~decodeFromDid(tangleid)

Param Type Description
tangleid string TangleID which follow the DID scheme DID Document.

Decode infromation of network and address from TangleID.

Returns: Object - } The infromation of network and address.

did~isDidUrl(url)

Param Type Description
url string the URL to be checked.

Checks if given URL is a DID URL.

Returns: boolean - The boolean that represent the url whether DID URL.

did~decodeFromDidUrl(url)

Param Type Description
url string the DID URL that will be decoded.

Decode information of the DID URL.

Returns: Object - The information of the DID URL. https://w3c-ccg.github.io/did-spec/#generic-did-syntax

did~createMetaPublicKeys(controller, publicKeyPems)

Param Type Description
controller string DID of the controller.
publicKeyPems Array.<string> PEM-formatted public Keys.

Create metadata of public keys from PEM-formatted public Keys.

Returns: Array.<Object> - Public keys

Readme

Keywords

none

Package Sidebar

Install

npm i @tangleid/did

Weekly Downloads

7

Version

1.2.0

License

MIT

Unpacked Size

36.5 kB

Total Files

22

Last publish

Collaborators

  • ender503