Documentation ¶
Index ¶
- Constants
- Variables
- func GetDidPrefixKey(did exported.Did) []byte
- func RegisterCodec(cdc *codec.Codec)
- func UnmarshalIxoDid(jsonIxoDid string) (exported.IxoDid, error)
- func ValidateGenesis(data GenesisState) error
- type BaseDidDoc
- func (dd *BaseDidDoc) AddCredential(cred exported.DidCredential)
- func (dd BaseDidDoc) Address() sdk.AccAddress
- func (dd BaseDidDoc) GetCredentials() []exported.DidCredential
- func (dd BaseDidDoc) GetDid() exported.Did
- func (dd BaseDidDoc) GetPubKey() string
- func (dd BaseDidDoc) SetDid(did exported.Did) error
- func (dd BaseDidDoc) SetPubKey(pubKey string) error
- type Credential
- type GenesisState
- type MsgAddCredential
- func (msg MsgAddCredential) GetSignBytes() []byte
- func (msg MsgAddCredential) GetSignerDid() exported.Did
- func (msg MsgAddCredential) GetSigners() []sdk.AccAddress
- func (msg MsgAddCredential) Route() string
- func (msg MsgAddCredential) String() string
- func (msg MsgAddCredential) Type() string
- func (msg MsgAddCredential) ValidateBasic() error
- type MsgAddDid
Constants ¶
View Source
const ( EventTypeAddDidDoc = "add_did_doc" EventTypeAddCredential = "add_credential" AttributeKeyDid = "did" AttributeKeyPubKey = "pub_key" AttributeKeyCredType = "cred_type" AttributeKeyIssuer = "issuer" AttributeKeyIssued = "issued" AttributeKeyClaimID = "claim" AttributeKeyKYCValidated = "kyc_validated" AttributeValueCategory = ModuleName )
View Source
const ( ModuleName = "did" StoreKey = ModuleName RouterKey = ModuleName QuerierRoute = ModuleName )
View Source
const ( TypeMsgAddDid = "add-did" TypeMsgAddCredential = "add-credential" )
View Source
const (
DefaultCodespace = ModuleName
)
Variables ¶
View Source
var ( ErrInvalidDid = sdkerrors.Register(DefaultCodespace, 2, "invalid did") ErrInvalidPubKey = sdkerrors.Register(DefaultCodespace, 3, "invalid pubKey") ErrDidPubKeyMismatch = sdkerrors.Register(DefaultCodespace, 4, "did pubKey mismatch") ErrInvalidIssuer = sdkerrors.Register(DefaultCodespace, 5, "invalid issuer") ErrInvalidCredentials = sdkerrors.Register(DefaultCodespace, 6, "invalid credentials") ErrInvalidClaimId = sdkerrors.Register(DefaultCodespace, 7, "invalid claim ID") )
View Source
var ( ValidDid = regexp.MustCompile(`^did:(ixo:|sov:)([a-zA-Z0-9]){21,22}([/][a-zA-Z0-9:]+|)$`) ValidPubKey = regexp.MustCompile(`^[123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ]{43,44}$`) IsValidDid = ValidDid.MatchString IsValidPubKey = ValidPubKey.MatchString )
View Source
var DidKey = []byte{0x01}
View Source
var (
EmptyDid = ""
)
View Source
var ModuleCdc *codec.Codec
ModuleCdc is the codec for the module
View Source
var ValidDidDoc = BaseDidDoc{ Did: "FrNMgb6xmPoVfWoFk5zDGn", PubKey: "96UYka2KZEw3nNb58GfP48wPeBUjPrUFrM4AnFhoBzqx", Credentials: []exported.DidCredential{}, }
Functions ¶
func GetDidPrefixKey ¶
func RegisterCodec ¶
Types ¶
type BaseDidDoc ¶
type BaseDidDoc struct { Did exported.Did `json:"did" yaml:"did"` PubKey string `json:"pubKey" yaml:"pubKey"` Credentials []exported.DidCredential `json:"credentials" yaml:"credentials"` }
func NewBaseDidDoc ¶
func NewBaseDidDoc(did exported.Did, pubKey string) BaseDidDoc
func (*BaseDidDoc) AddCredential ¶
func (dd *BaseDidDoc) AddCredential(cred exported.DidCredential)
func (BaseDidDoc) Address ¶
func (dd BaseDidDoc) Address() sdk.AccAddress
func (BaseDidDoc) GetCredentials ¶
func (dd BaseDidDoc) GetCredentials() []exported.DidCredential
func (BaseDidDoc) GetDid ¶
func (dd BaseDidDoc) GetDid() exported.Did
func (BaseDidDoc) GetPubKey ¶
func (dd BaseDidDoc) GetPubKey() string
func (BaseDidDoc) SetPubKey ¶
func (dd BaseDidDoc) SetPubKey(pubKey string) error
type Credential ¶
type Credential struct{}
type GenesisState ¶
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
func NewGenesisState ¶
func NewGenesisState(didDocs []exported.DidDoc) GenesisState
type MsgAddCredential ¶
type MsgAddCredential struct {
DidCredential exported.DidCredential `json:"credential" yaml:"credential"`
}
func NewMsgAddCredential ¶
func NewMsgAddCredential(did string, credType []string, issuer string, issued string) MsgAddCredential
func (MsgAddCredential) GetSignBytes ¶
func (msg MsgAddCredential) GetSignBytes() []byte
func (MsgAddCredential) GetSignerDid ¶
func (msg MsgAddCredential) GetSignerDid() exported.Did
func (MsgAddCredential) GetSigners ¶
func (msg MsgAddCredential) GetSigners() []sdk.AccAddress
func (MsgAddCredential) Route ¶
func (msg MsgAddCredential) Route() string
func (MsgAddCredential) String ¶
func (msg MsgAddCredential) String() string
func (MsgAddCredential) Type ¶
func (msg MsgAddCredential) Type() string
func (MsgAddCredential) ValidateBasic ¶
func (msg MsgAddCredential) ValidateBasic() error
type MsgAddDid ¶
type MsgAddDid struct { Did exported.Did `json:"did" yaml:"did"` PubKey string `json:"pubKey" yaml:"pubKey"` }
func NewMsgAddDid ¶
func (MsgAddDid) GetSignBytes ¶
func (MsgAddDid) GetSignerDid ¶
func (MsgAddDid) GetSigners ¶
func (msg MsgAddDid) GetSigners() []sdk.AccAddress
func (MsgAddDid) ValidateBasic ¶
Click to show internal directories.
Click to hide internal directories.