Documentation
¶
Index ¶
Constants ¶
const ( // ERC721DIDMethod is the method for a ERC721 NFT DID. ERC721DIDMethod = "erc721" // EthrDIDMethod is the method for a Ethereum Address DID. EthrDIDMethod = "ethr" // ERC20DIDMethod is the method for a ERC20 token DID. ERC20DIDMethod = "erc20" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ERC20DID ¶
type ERC20DID struct {
ChainID uint64 `json:"chainId"`
ContractAddress common.Address `json:"contract"`
}
ERC20DID is a Decentralized Identifier for an ERC20 token.
func DecodeERC20DID ¶
DecodeERC20DID decodes a ERC20 DID string into a DID struct.
func (ERC20DID) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*ERC20DID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
type ERC721DID ¶
type ERC721DID struct {
ChainID uint64 `json:"chainId"`
ContractAddress common.Address `json:"contract"`
TokenID *big.Int `json:"tokenId"`
}
ERC721DID is a Decentralized Identifier for a ERC721 NFT.
func DecodeERC721DID ¶
DecodeERC721DID decodes a DID string into a DID struct.
func DecodeERC721orNFTDID ¶
DecodeERC721orNFTDID attempts to decode a DID string as an ERC721DID or falls back to a legacy NFT DID.
func DecodeLegacyNFTDID ¶
DecodeLegacyNFTDID decodes a legacy NFT DID using the format "did:nft:1:0xAddr_1". You most likely want to use DecodeERC721DID instead.
func (ERC721DID) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*ERC721DID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler
type EthrDID ¶
type EthrDID struct {
ChainID uint64 `json:"chainId"`
ContractAddress common.Address `json:"contract"`
}
EthrDID is a Decentralized Identifier for an Ethereum contract.
func DecodeEthrDID ¶
DecodeEthrDID decodes a Ethr DID string into a DID struct.
func (EthrDID) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*EthrDID) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler