1.1.0 • Published 1 year ago
hashkeydid-js v1.1.0
HashKey DID JS SDK
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
is 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})
}