Documentation ¶
Index ¶
- Constants
- Variables
- func DtagStoreKey(dtag string) []byte
- func DtagTransferRequestStoreKey(address sdk.AccAddress) []byte
- func ProfileStoreKey(address sdk.AccAddress) []byte
- func RegisterModelsCodec(cdc *codec.Codec)
- type DTagTransferRequest
- type Pictures
- type Profile
- func (profile Profile) Equals(other Profile) bool
- func (profile Profile) String() string
- func (profile Profile) Validate() error
- func (profile Profile) WithBio(bio *string) Profile
- func (profile Profile) WithDTag(dtag string) Profile
- func (profile Profile) WithMoniker(moniker *string) Profile
- func (profile Profile) WithPictures(profilePic, coverPic *string) Profile
- type Profiles
Constants ¶
const ( ModuleName = "profiles" RouterKey = ModuleName StoreKey = ModuleName ActionSaveProfile = "save_profile" ActionDeleteProfile = "delete_profile" ActionRequestDtag = "request_dtag" ActionAcceptDtagTransfer = "accept_dtag_request" //Queries QuerierRoute = ModuleName QueryProfile = "profile" QueryProfiles = "all" QueryDTagRequests = "dtag-requests" QueryParams = "params" )
Variables ¶
var ( ProfileStorePrefix = []byte("profile") DtagStorePrefix = []byte("dtag") DTagTransferRequestsPrefix = []byte("transfer_requests") )
var ModelsCdc = codec.New()
ModelsCdc is the codec
Functions ¶
func DtagStoreKey ¶
DtagStoreKey turns a dtag to a key used to store a dtag -> address couple
func DtagTransferRequestStoreKey ¶ added in v0.12.0
func DtagTransferRequestStoreKey(address sdk.AccAddress) []byte
DtagTransferRequestStoreKey turns an address to a key used to store a transfer request into the profiles store
func ProfileStoreKey ¶
func ProfileStoreKey(address sdk.AccAddress) []byte
ProfileStoreKey turns an address to a key used to store a profile into the profiles store
func RegisterModelsCodec ¶
RegisterModelsCodec registers concrete types on the Amino codec
Types ¶
type DTagTransferRequest ¶ added in v0.12.0
type DTagTransferRequest struct { DTagToTrade string `json:"dtag_to_trade" yaml:"dtag_to_trade"` CurrentOwner sdk.AccAddress `json:"current_owner" yaml:"current_owner"` ReceivingUser sdk.AccAddress `json:"receiving_user" yaml:"receiving_user"` }
DTagTransferRequest represent a dtag transfer request between two users
func NewDTagTransferRequest ¶ added in v0.12.0
func NewDTagTransferRequest(dtagToTrade string, currentOwner, receivingUser sdk.AccAddress) DTagTransferRequest
func (DTagTransferRequest) Equals ¶ added in v0.12.0
func (dtagTR DTagTransferRequest) Equals(other DTagTransferRequest) bool
Equals returns true if the two requests are equals. False otherwise
func (DTagTransferRequest) String ¶ added in v0.12.0
func (dtagTR DTagTransferRequest) String() string
String implement fmt.Stringer
func (DTagTransferRequest) Validate ¶ added in v0.12.0
func (dtagTR DTagTransferRequest) Validate() error
Validate checks the request validity
type Pictures ¶
type Pictures struct { Profile *string `json:"profile,omitempty" yaml:"profile,omitempty"` Cover *string `json:"cover,omitempty" yaml:"cover,omitempty"` }
Pictures contains the data of a user profile's related pictures
func NewPictures ¶
NewPictures is a constructor function for Pictures
type Profile ¶
type Profile struct { DTag string `json:"dtag" yaml:"dtag"` Moniker *string `json:"moniker,omitempty" yaml:"moniker,omitempty"` Bio *string `json:"bio,omitempty" yaml:"bio,omitempty"` Pictures *Pictures `json:"pictures,omitempty" yaml:"pictures,omitempty"` Creator sdk.AccAddress `json:"creator" yaml:"creator"` CreationDate time.Time `json:"creation_date" yaml:"creation_date"` }
Profile represents a generic first on Desmos, containing the information of a single user
func NewProfile ¶
func (Profile) WithMoniker ¶
WithMoniker updates profile's moniker with the given one
func (Profile) WithPictures ¶
WithPicture updates profile's pictures with the given one