Categorygithub.com/hashkeydid/hashkeydid-go
modulepackage
2.0.0+incompatible
Repository: https://github.com/hashkeydid/hashkeydid-go.git
Documentation: pkg.go.dev

# README

HashKey DID Go SDK

Tag Go Reference License Go Report Card

Go module to work with HashKey DID Protocol.

Installation

go get github.com/hashkeydid/hashkeydid-go

Usage

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

Core

hashkeydid-go.Core is the core struct of this project to use this SDK function.

core, err := hashkeydid.NewDIDCore("rpc url")

Opts

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)}

Sample1-GetName

// after user set reverse
name, err := core.GetDIDNameByAddr(opts, address)

Sample2-GetAvatar

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)

# Packages

No description provided by the author

# Functions

GetMetadata returns the Metadata by tokenId.
GetMetadataImage returns the image url in metadata by tokenId.
NewDIDCore Creates a did-go core with give rpc url.

# Variables

No description provided by the author
ChainList is a map contains the infos of chain by the index of chainId.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author
Core is structure for basic interaction with contracts.
No description provided by the author
No description provided by the author