types

package
v0.0.2-0...-13a971e Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultCodespace codespace for the module
	DefaultCodespace sdk.CodespaceType = ModuleName

	// CodeEmptyInput error code for empty input errors
	CodeNoPOA sdk.CodeType = 1
)
View Source
const (
	// ModuleName The name that will be used throughout the module
	ModuleName = "market"

	// StoreKey Top level store key where all module items will be stored
	StoreKey = ModuleName

	// RouterKey Top level router key
	RouterKey = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName

	ModuleNominees = "marketnominees"
)

Variables

View Source
var (
	// ParamStoreKeyAuctionParams Param store key for auction params
	KeyMarkets  = []byte(ModuleName)
	KeyNominees = []byte(ModuleNominees)
)

Parameter keys

View Source
var ModuleCdc *codec.Codec

Functions

func ErrNoPOA

func ErrNoPOA(codespace sdk.CodespaceType) sdk.Error

ErrEmptyInput Error constructor

func ParamKeyTable

func ParamKeyTable() subspace.KeyTable

ParamKeyTable Key declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Types

type ListQueryResult

type ListQueryResult struct {
	Markets []NamedMarket `json:"markets"`
}

func (ListQueryResult) String

func (l ListQueryResult) String() string

type Market

type Market struct {
	ID              store.EntityID `json:"id" yaml:"id"`
	BaseAssetDenom  string         `json:"base_asset_denom" yaml:"base_asset_denom"`
	QuoteAssetDenom string         `json:"quote_asset_denom" yaml:"quote_asset_denom"`
}

func NewMarket

func NewMarket(
	id store.EntityID,
	baseAsset string,
	quoteAsset string,
) Market

func (Market) String

func (m Market) String() string

implement fmt.Stringer

type Markets

type Markets []Market

type MsgCreateMarket

type MsgCreateMarket struct {
	Nominee    sdk.AccAddress `json:"nominee" yaml:"nominee"`
	BaseAsset  string         `json:"base_asset" yaml:"base_asset"`
	QuoteAsset string         `json:"quote_asset" yaml:"quote_asset"`
}

func NewMsgCreateMarket

func NewMsgCreateMarket(
	nominee sdk.AccAddress,
	baseAsset string,
	quoteAsset string,
) MsgCreateMarket

func (MsgCreateMarket) GetSignBytes

func (msg MsgCreateMarket) GetSignBytes() []byte

func (MsgCreateMarket) GetSigners

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

func (MsgCreateMarket) Route

func (msg MsgCreateMarket) Route() string

func (MsgCreateMarket) Type

func (msg MsgCreateMarket) Type() string

func (MsgCreateMarket) ValidateBasic

func (msg MsgCreateMarket) ValidateBasic() sdk.Error

type NamedMarket

type NamedMarket struct {
	ID              string
	BaseAssetDenom  string
	QuoteAssetDenom string
	Name            string
}

type ParamSubspace

type ParamSubspace interface {
	Get(ctx sdk.Context, key []byte, ptr interface{})
	Set(ctx sdk.Context, key []byte, param interface{})
}

ParamSubspace defines the expected Subspace interface for parameters

type Params

type Params struct {
	Markets  []Market
	Nominees []string
}

func DefaultParams

func DefaultParams() Params

DefaultParams default params

func NewParams

func NewParams(markets []Market, nominees []string) Params

NewParams creates a new Params object

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() subspace.ParamSetPairs

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint

func (Params) String

func (p Params) String() string

String implements fmt.stringer

func (Params) Validate

func (p Params) Validate() error

Validate ensure that params have valid values

Jump to

Keyboard shortcuts

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