Documentation ¶
Index ¶
- Constants
- Variables
- func ParamKeyTable() params.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func ValidateGenesis(data GenesisState) error
- type BankKeeper
- type GenesisState
- type MsgBuyName
- type MsgDeleteName
- type MsgSetName
- type ParamSubspace
- type Params
- type QueryResNames
- type QueryResResolve
- type Whois
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "nameservice" // 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 )
const (
AttributeValueCategory = ModuleName
)
nameservice module event types
const (
DefaultParamspace = ModuleName
)
Default parameter namespace
Variables ¶
var (
ErrNameDoesNotExist = sdkerrors.Register(ModuleName, 1, "name does not exist")
)
custom error handler for names that do not exist
var MinNamePrice = sdk.Coins{sdk.NewInt64Coin("nametoken", 1)}
MinNamePrice is Initial Starting Price for a name that was never previously owned
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis validates the nameservice genesis parameters
Types ¶
type BankKeeper ¶
type BankKeeper interface { // keepers to subtract and send coins to others SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error) SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error }
When a module wishes to interact with another module it is good practice to define what it will use as an interface so the module can not use things that are not permitted.
type GenesisState ¶
type GenesisState struct { }
GenesisState - all nameservice state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - default GenesisState used by Cosmos Hub
func NewGenesisState ¶
func NewGenesisState() GenesisState
NewGenesisState creates a new GenesisState object
type MsgBuyName ¶
type MsgBuyName struct { Name string `json:"name"` Bid sdk.Coins `json:"bid"` Buyer sdk.AccAddress `json:"buyer"` }
MsgBuyName defines the BuyName message
func NewMsgBuyName ¶
func NewMsgBuyName(name string, bid sdk.Coins, buyer sdk.AccAddress) MsgBuyName
NewMsgBuyName is the constructor function for MsgBuyName
func (MsgBuyName) GetSignBytes ¶
func (msg MsgBuyName) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgBuyName) GetSigners ¶
func (msg MsgBuyName) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgBuyName) Route ¶
func (msg MsgBuyName) Route() string
Route should return the name of the module
func (MsgBuyName) ValidateBasic ¶
func (msg MsgBuyName) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgDeleteName ¶
type MsgDeleteName struct { Name string `json:"name"` Owner sdk.AccAddress `json:"owner"` }
MsgDeleteName defines a DeleteName message
func NewMsgDeleteName ¶
func NewMsgDeleteName(name string, owner sdk.AccAddress) MsgDeleteName
NewMsgDeleteName is a constructor function for MsgDeleteName
func (MsgDeleteName) GetSignBytes ¶
func (msg MsgDeleteName) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgDeleteName) GetSigners ¶
func (msg MsgDeleteName) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgDeleteName) Route ¶
func (msg MsgDeleteName) Route() string
Route should return the name of the module
func (MsgDeleteName) ValidateBasic ¶
func (msg MsgDeleteName) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgSetName ¶
type MsgSetName struct { Name string `json:"name"` Value string `json:"value"` Owner sdk.AccAddress `json:"owner"` }
MsgSetName defines a SetName message
func NewMsgSetName ¶
func NewMsgSetName(name string, value string, owner sdk.AccAddress) MsgSetName
NewMsgSetName is a constructor function for MsgSetName
func (MsgSetName) GetSignBytes ¶
func (msg MsgSetName) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgSetName) GetSigners ¶
func (msg MsgSetName) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgSetName) Route ¶
func (msg MsgSetName) Route() string
Route should return the name of the module
func (MsgSetName) ValidateBasic ¶
func (msg MsgSetName) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type ParamSubspace ¶
type ParamSubspace interface { WithKeyTable(table params.KeyTable) params.Subspace Get(ctx sdk.Context, key []byte, ptr interface{}) GetParamSet(ctx sdk.Context, ps params.ParamSet) SetParamSet(ctx sdk.Context, ps params.ParamSet) }
ParamSubspace defines the expected Subspace interfacace
type Params ¶
type Params struct { }
Params - used for initializing default parameter for nameservice at genesis
func DefaultParams ¶
func DefaultParams() Params
DefaultParams defines the parameters for this module
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() params.ParamSetPairs
ParamSetPairs - Implements params.ParamSet
type QueryResNames ¶
type QueryResNames []string
QueryResNames Queries Result Payload for a names query
type QueryResResolve ¶
type QueryResResolve struct {
Value string `json:"value"`
}
QueryResResolve Queries Result Payload for a resolve query