Skip to content

hashkeydid/hashkeydid-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HashKey DID JS SDK

Tag License

Javascript module to work with HashKey DID Protocol.

Installation

npm install hashkeydid-js

Usage

hashkeydid-js provides simple access to the HashKey DID Contracts.

DID

DIDSigner and DIDResolverSigner are the core objects to send transactions with HashKey DID Contracts.

didSigner = new DIDSigner("private_key")
resolverSigner = new ResolverSigner("private_key")

Example1-Register

Registering HashKey DID account with JS SDK

didSigner.Claim("xxx.key")

Example2-GetName

Querying user address with did name

import {GetAddrByDIDName} from "hashkeydid-js"
// DID name: herro.key
// overrides(optional): {"blockTag": 16513266} (search at block number 16513266)
async function QueryAddrByDIDName(){
    let addr = await GetAddrByDIDName("herro.key", {"blockTag": 16513266})
}

About

the js sdk for HashKey DID

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors