types

package
v0.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 29, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "profile"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// QuerierRoute to be used for querierer msgs
	QuerierRoute = ModuleName
)
View Source
const DateFormat = "2006-01-02"

Variables

View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func IsValidAvatar added in v0.3.0

func IsValidAvatar(str string) bool

func IsValidDate

func IsValidDate(s string) bool

func IsValidGender

func IsValidGender(str string) bool

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on codec

Types

type Gender

type Gender string
const (
	GenderMale   Gender = "male"
	GenderFemale Gender = "female"
)

type MsgSetPrivate

type MsgSetPrivate struct {
	Owner   sdk.AccAddress `json:"owner"`
	Private []byte         `json:"private"`
}

MsgSetPrivate defines a SetPrivate message

func NewMsgSetPrivate

func NewMsgSetPrivate(data []byte, owner sdk.AccAddress) MsgSetPrivate

NewMsgSetSettings is a constructor function for MsgSetPrivate

func (MsgSetPrivate) GetSignBytes

func (msg MsgSetPrivate) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetPrivate) GetSigners

func (msg MsgSetPrivate) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgSetPrivate) Route

func (msg MsgSetPrivate) Route() string

Route should return the name of the module

func (MsgSetPrivate) Type

func (msg MsgSetPrivate) Type() string

Type should return the action

func (MsgSetPrivate) ValidateBasic

func (msg MsgSetPrivate) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgSetPublic

type MsgSetPublic struct {
	Owner  sdk.AccAddress `json:"owner"`
	Public Public         `json:"public"`
}

MsgSetPrivate defines a SetPrivate message

func NewMsgSetPublic

func NewMsgSetPublic(public Public, owner sdk.AccAddress) MsgSetPublic

NewMsgSetSettings is a constructor function for MsgSetPublic

func (MsgSetPublic) GetSignBytes

func (msg MsgSetPublic) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSetPublic) GetSigners

func (msg MsgSetPublic) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgSetPublic) Route

func (msg MsgSetPublic) Route() string

Route should return the name of the module

func (MsgSetPublic) Type

func (msg MsgSetPublic) Type() string

Type should return the action

func (MsgSetPublic) ValidateBasic

func (msg MsgSetPublic) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type Profile

type Profile struct {
	// Owner is Profile owner
	Owner sdk.AccAddress `json:"owner"`
	// Public profile data
	Public Public `json:"public"`
	// Encrypted profile data such as emails, phones, nicknames
	Private []byte `json:"private"`
}

Profile represent an account settings storage

type Public

type Public struct {
	FirstName    string `json:"firstName"`
	LastName     string `json:"lastName"`
	Avatar       string `json:"avatar"`
	Gender       Gender `json:"gender"`
	Birthday     string `json:"birthday"`
	RegisteredAt int64  `json:"registeredAt"`
}

Public profile data

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL