types

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSpaceAuthX sdk.CodespaceType = "authx"

	// 201 ~ 299
	CodeInvalidMinGasPriceLimit sdk.CodeType = 201
	CodeGasPriceTooLow          sdk.CodeType = 202
)
View Source
const (
	// StoreKey is string representation of the store key for authx
	StoreKey = "accx"
	// QuerierRoute is the querier route for accx
	QuerierRoute = StoreKey
)
View Source
const (
	// DefaultMinGasPrice of the network
	// Make token transfer/send tx to costs around 0.01CET
	// activated account send to self,                  costs 38883 gas
	// activated account send to non-activated account, costs 48951 gas
	// activated account send to other activated addr,  costs 33903 gas
	// consider it takes 50000 to do transfer/send tx
	// so, min_gas_price = 100000000sato.CET * 0.01 / 50000 = 20 sato.CET
	DefaultMinGasPriceLimit = "20.0"
)

Default parameter values

View Source
const DefaultParamspace = ModuleName

DefaultParamspace defines the default authx module parameter subspace

View Source
const ModuleName = "authx"
View Source
const (
	QueryAccountX = "accountx"
)

query endpoints supported by the auth Querier

Variables

View Source
var (
	KeyMinGasPriceLimit = []byte("MinGasPriceLimit")
)

Parameter keys

View Source
var ModuleCdc = codec.New()

Functions

func ErrGasPriceTooLow

func ErrGasPriceTooLow(required, actual sdk.Dec) sdk.Error

func ErrInvalidMinGasPriceLimit

func ErrInvalidMinGasPriceLimit(limit sdk.Dec) sdk.Error

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for authx module

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the codec

Types

type AccountAll

type AccountAll struct {
	Account  auth.Account `json:"account"`
	AccountX AccountX     `json:"account_x"`
}

func (AccountAll) String

func (accAll AccountAll) String() string

type AccountMix

type AccountMix struct {
	Address       sdk.AccAddress `json:"address"`
	Coins         sdk.Coins      `json:"coins"`
	LockedCoins   LockedCoins    `json:"locked_coins"`
	FrozenCoins   sdk.Coins      `json:"frozen_coins"`
	PubKey        crypto.PubKey  `json:"public_key"`
	AccountNumber uint64         `json:"account_number"`
	Sequence      uint64         `json:"sequence"`
	MemoRequired  bool           `json:"memo_required"` // if memo is required for receiving coins
}

func NewAccountMix

func NewAccountMix(acc auth.Account, x AccountX) AccountMix

type AccountX

type AccountX struct {
	Address      sdk.AccAddress `json:"address"`
	MemoRequired bool           `json:"memo_required"` // if memo is required for receiving coins
	LockedCoins  LockedCoins    `json:"locked_coins"`
	FrozenCoins  sdk.Coins      `json:"frozen_coins"`
}

func NewAccountX

func NewAccountX(address sdk.AccAddress, memoRequired bool, lockedCoins LockedCoins, frozenCoins sdk.Coins) AccountX

func NewAccountXWithAddress

func NewAccountXWithAddress(addr sdk.AccAddress) AccountX

func (*AccountX) AddLockedCoins

func (acc *AccountX) AddLockedCoins(coins LockedCoins)

func (*AccountX) GetAddress

func (acc *AccountX) GetAddress() sdk.AccAddress

func (*AccountX) GetAllCoins

func (acc *AccountX) GetAllCoins() sdk.Coins

func (*AccountX) GetAllLockedCoins

func (acc *AccountX) GetAllLockedCoins() LockedCoins

func (*AccountX) GetAllUnlockedCoinsAtTheTime

func (acc *AccountX) GetAllUnlockedCoinsAtTheTime(time int64) LockedCoins

func (*AccountX) GetLockedCoinsByDemon

func (acc *AccountX) GetLockedCoinsByDemon(demon string) LockedCoins

func (*AccountX) GetUnlockedCoinsAtTheTime

func (acc *AccountX) GetUnlockedCoinsAtTheTime(demon string, time int64) LockedCoins

func (*AccountX) IsMemoRequired

func (acc *AccountX) IsMemoRequired() bool

func (*AccountX) SetAddress

func (acc *AccountX) SetAddress(address sdk.AccAddress)

func (*AccountX) SetMemoRequired

func (acc *AccountX) SetMemoRequired(b bool)

func (AccountX) String

func (acc AccountX) String() string

type AccountXs

type AccountXs []AccountX

type LockedCoin

type LockedCoin struct {
	Coin       sdk.Coin `json:"coin"`
	UnlockTime int64    `json:"unlock_time"`
}

func NewLockedCoin

func NewLockedCoin(denom string, amount sdk.Int, unlockTime int64) LockedCoin

func (LockedCoin) String

func (coin LockedCoin) String() string

type LockedCoins

type LockedCoins []LockedCoin

func (LockedCoins) String

func (coins LockedCoins) String() string

type Params

type Params struct {
	MinGasPriceLimit sdk.Dec `json:"min_gas_price_limit"`
}

Params defines the parameters for the authx module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters.

func NewParams

func NewParams(minGasPriceLimit sdk.Dec) Params

func (Params) Equal

func (p Params) Equal(p2 Params) bool

Equal returns a boolean determining if two Params types are identical.

func (*Params) ParamSetPairs

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

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

func (Params) String

func (p Params) String() string

String implements the stringer interface.

Jump to

Keyboard shortcuts

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