Documentation ¶
Index ¶
- Constants
- Variables
- func GetMetadataDescription(tokenId string) (string, error)
- func GetMetadataImage(tokenId string) (string, error)
- func GetMetadataName(tokenId string) (string, error)
- type ChainInfo
- type Core
- func (c *Core) AddKYC(opts *bind.TransactOpts, tokenId uint64, KYCProvider common.Address, ...) (*types.Transaction, error)
- func (c *Core) GetAvatarByDIDName(opts *bind.CallOpts, didName string, chainList map[string]*ChainInfo) (string, error)
- func (c *Core) GetAvatarByTokenId(opts *bind.CallOpts, tokenId uint64, chainList map[string]*ChainInfo) (string, error)
- func (c *Core) GetDIDNameByAddr(opts *bind.CallOpts, address common.Address) (string, error)
- func (c *Core) GetDIDNameByAddrForce(opts *bind.CallOpts, address common.Address) (string, error)
- func (c *Core) GetKYCInfo(opts *bind.CallOpts, tokenId uint64, KYCProvider common.Address, KYCId uint64) (*KYCInfo, error)
- func (c *Core) GetMetadataAvatarByDIDName(opts *bind.CallOpts, didName string) (string, error)
- func (c *Core) GetMetadataAvatarByTokenId(opts *bind.CallOpts, tokenId uint64) (string, error)
- func (c *Core) IssueDG(opts *bind.TransactOpts, name string, symbol string, baseUri string, ...) (*types.Transaction, error)
- func (c *Core) IssueNFT(opts *bind.TransactOpts, name string, symbol string, baseUri string, ...) (*types.Transaction, error)
- func (c *Core) SetNFTSupply(opts *bind.TransactOpts, NFTAddr common.Address, supply uint64) (*types.Transaction, error)
- func (c *Core) SetReverse(status bool) error
- func (c *Core) SetTokenSupply(opts *bind.TransactOpts, DGAddr common.Address, tokenId *big.Int, ...) (*types.Transaction, error)
- type KYCInfo
- type Metadata
Constants ¶
const DefaultDIDContractAddr = "0x7fDd3f96cBDE51737A9E24b461E7E92A057C3BBf"
const DefaultDIDResolverContractAddr = "0x606729294604A1c71f4BFc001894E4f8095Ec2eF"
const DefaultPlatONUrl = "https://openapi2.platon.network/rpc"
Variables ¶
var ( ErrAddrNotClaimed = fmt.Errorf("this address has not claimed a did") ErrAddrNotSetReverse = fmt.Errorf("this address has not set reverse record") ErrDidNotClaimed = fmt.Errorf("this did name has not been claimed") ErrTokenIdNotMinted = fmt.Errorf("this tokenId has not been minted") ErrAvatarNotSet = fmt.Errorf("the avatar text has not been set on this did") ErrInvalidAvatarText = fmt.Errorf("the avatar text is invalid") ErrInvalidTokenURI = fmt.Errorf("the tokenURI of avatar is invalid") ErrInvalidTokenId = fmt.Errorf("the token id is invalid") ErrTimeExpired = fmt.Errorf("the time has expired") ErrInvalidEvidence = fmt.Errorf("the evidence is invalid") )
var (
Big0 = new(big.Int).SetUint64(0)
)
var ChainList = map[string]*ChainInfo{
"1": {"Ethereum", "https://eth-mainnet.nodereal.io/v1/1659dfb40aa24bbb8153a677b98064d7"},
"137": {"Polygon", "https://matic-mainnet-archive-rpc.bwarelabs.com"},
"8217": {"Klaytn", "https://klaytn01.fandom.finance"},
"210425": {"PlatON", "https://openapi2.platon.network/rpc"},
}
ChainList is a map contains the infos of chain by the index of chainId
Functions ¶
func GetMetadataDescription ¶
GetMetadataDescription returns the description in metadata by tokenId
func GetMetadataImage ¶
GetMetadataImage returns the image url in metadata by tokenId
func GetMetadataName ¶
GetMetadataName returns the name in metadata by tokenId
Types ¶
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core is structure for basic interaction with contracts
func NewDIDCore ¶
NewDIDCore Creates a did-go core with give addresses
func (*Core) AddKYC ¶ added in v0.0.3
func (c *Core) AddKYC(opts *bind.TransactOpts, tokenId uint64, KYCProvider common.Address, KYCId uint64, status bool, updateTime uint64, expireTime uint64, evidence []byte) (*types.Transaction, error)
AddKYC add KYC information for specific token id
func (*Core) GetAvatarByDIDName ¶
func (c *Core) GetAvatarByDIDName(opts *bind.CallOpts, didName string, chainList map[string]*ChainInfo) (string, error)
GetAvatarByDIDName returns the image url in resolver text queried by did name
func (*Core) GetAvatarByTokenId ¶
func (c *Core) GetAvatarByTokenId(opts *bind.CallOpts, tokenId uint64, chainList map[string]*ChainInfo) (string, error)
GetAvatarByTokenId returns the image url in resolver text queried by tokenId
func (*Core) GetDIDNameByAddr ¶
GetDIDNameByAddr returns the did name by address when user set reverse
func (*Core) GetDIDNameByAddrForce ¶
GetDIDNameByAddrForce returns the did name by address
func (*Core) GetKYCInfo ¶ added in v0.0.3
func (c *Core) GetKYCInfo(opts *bind.CallOpts, tokenId uint64, KYCProvider common.Address, KYCId uint64) (*KYCInfo, error)
GetKYCInfo returns the KYC information for specific token id from DID
func (*Core) GetMetadataAvatarByDIDName ¶
GetMetadataAvatarByDIDName returns the image url in metadata queried by did name
func (*Core) GetMetadataAvatarByTokenId ¶
GetMetadataAvatarByTokenId returns the image url in metadata queried by tokenId
func (*Core) IssueDG ¶ added in v0.0.3
func (c *Core) IssueDG(opts *bind.TransactOpts, name string, symbol string, baseUri string, evidence []byte, transferable bool) (*types.Transaction, error)
IssueDG issue a new DeedGrain token
func (*Core) IssueNFT ¶ added in v0.0.3
func (c *Core) IssueNFT(opts *bind.TransactOpts, name string, symbol string, baseUri string, evidence []byte, supply uint64) (*types.Transaction, error)
IssueNFT issue a new DeedGrain NFT
func (*Core) SetNFTSupply ¶ added in v0.0.3
func (c *Core) SetNFTSupply(opts *bind.TransactOpts, NFTAddr common.Address, supply uint64) (*types.Transaction, error)
SetNFTSupply set NFT supply
func (*Core) SetReverse ¶
SetReverse sets the reverse status for address
func (*Core) SetTokenSupply ¶ added in v0.0.3
func (c *Core) SetTokenSupply(opts *bind.TransactOpts, DGAddr common.Address, tokenId *big.Int, supply uint64) (*types.Transaction, error)
SetTokenSupply set every kind of token's supply