Go module to work with HashKey DID Protocol.
go get github.com/hashkeydid/hashkeydid-go
hashkeydid-go
provides simple access to the HashKey DID Contracts.
hashkeydid-go.Core
is the core struct of this project to use this SDK function.
core, err := hashkeydid.NewDIDCore("rpc url")
To query the historical info of DID, SDK provides an option arg called opts
.
User can query the status with a custom block height.
// query the status on Block 40069811
opts := &bind.CallOpts{BlockNumber: big.NewInt(40069811)}
// after user set reverse
name, err := core.GetDIDNameByAddr(opts, address)
In HashKey DID, avatarUrl
supports many forms (Detail).
chainList
is a map which includes information of chains.
SDK provides a default chainList for user to query on-chain status.
User can provide a list with custom chainIds and RPCUrls.
chainList
in args can be nil.
// query by DID name
avatar, err := core.GetAvatarByDIDName(opts, name)
// query by tokenId
avatar, err := core.GetAvatarByTokenId(opts, tokenId)