types

package
v0.0.0-...-7df83c2 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

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

	// RouterKey is the module name router key
	RouterKey = ModuleName

	// QuerierRoute to be used for querierer msgs
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	ErrNameDoesNotExist = sdkerrors.Register(ModuleName, 1, "name does not exist")
)
View Source
var MinNamePrice = sdk.Coins{sdk.NewInt64Coin("nametoken", 1)}

MinNamePrice is Initial Starting Price for a name that was never previously owned

View Source
var ModuleCdc = codec.New()

ModuleCdc is the codec for the module

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

Types

type BankKeeper

type BankKeeper interface {
	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 an otehr 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 {
	WhoisRecords []Whois `json:"whois_records"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

func NewGenesisState

func NewGenesisState(whoIsRecords []Whois) GenesisState

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) Type

func (msg MsgBuyName) Type() string

Type should return the action

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) Type

func (msg MsgDeleteName) Type() string

Type should return the action

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) Type

func (msg MsgSetName) Type() string

Type should return the action

func (MsgSetName) ValidateBasic

func (msg MsgSetName) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type QueryResNames

type QueryResNames []string

QueryResNames Queries Result Payload for a names query

func (QueryResNames) String

func (n QueryResNames) String() string

implement fmt.Stringer

type QueryResResolve

type QueryResResolve struct {
	Value string `json:"value"`
}

QueryResResolve Queries Result Payload for a resolve query

func (QueryResResolve) String

func (r QueryResResolve) String() string

implement fmt.Stringer

type Whois

type Whois struct {
	Value string         `json:"value"`
	Owner sdk.AccAddress `json:"owner"`
	Price sdk.Coins      `json:"price"`
}

Whois is a struct that contains all the metadata of a name

func NewWhois

func NewWhois() Whois

NewWhois returns a new Whois with the minprice as the price

func (Whois) String

func (w Whois) String() string

implement fmt.Stringer

Jump to

Keyboard shortcuts

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