keepers

package
v0.0.14 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	QueryBancorInfo = "bancor-info"
	QueryParameters = "parameters"
)
View Source
const SymbolSeparator = "/"

Variables

View Source
var (
	BancorInfoKey    = []byte{0x10}
	BancorInfoKeyEnd = []byte{0x11}
)

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

creates a querier for asset REST endpoints

Types

type BancorInfo

type BancorInfo struct {
	Owner              sdk.AccAddress `json:"sender"`
	Stock              string         `json:"stock"`
	Money              string         `json:"money"`
	InitPrice          sdk.Dec        `json:"init_price"`
	MaxSupply          sdk.Int        `json:"max_supply"`
	MaxPrice           sdk.Dec        `json:"max_price"`
	Price              sdk.Dec        `json:"price"`
	StockInPool        sdk.Int        `json:"stock_in_pool"`
	MoneyInPool        sdk.Int        `json:"money_in_pool"`
	EarliestCancelTime int64          `json:"earliest_cancel_time"`
}

func (*BancorInfo) IsConsistent

func (bi *BancorInfo) IsConsistent() bool

func (*BancorInfo) UpdateStockInPool

func (bi *BancorInfo) UpdateStockInPool(stockInPool sdk.Int) bool

type BancorInfoDisplay

type BancorInfoDisplay struct {
	Stock              string `json:"stock"`
	Money              string `json:"money"`
	InitPrice          string `json:"init_price"`
	MaxSupply          string `json:"max_supply"`
	MaxPrice           string `json:"max_price"`
	CurrentPrice       string `json:"current_price"`
	StockInPool        string `json:"stock_in_pool"`
	MoneyInPool        string `json:"money_in_pool"`
	EarliestCancelTime string `json:"earliest_cancel_time"`
}

func NewBancorInfoDisplay

func NewBancorInfoDisplay(bi *BancorInfo) BancorInfoDisplay

type BancorInfoKeeper

type BancorInfoKeeper struct {
	// contains filtered or unexported fields
}

func NewBancorInfoKeeper

func NewBancorInfoKeeper(key sdk.StoreKey, cdc *codec.Codec, paramSubspace params.Subspace) *BancorInfoKeeper

func (*BancorInfoKeeper) GetParams added in v0.0.13

func (keeper *BancorInfoKeeper) GetParams(ctx sdk.Context) (param types.Params)

func (*BancorInfoKeeper) Iterate

func (keeper *BancorInfoKeeper) Iterate(ctx sdk.Context, biProc func(bi *BancorInfo))

func (*BancorInfoKeeper) Load

func (keeper *BancorInfoKeeper) Load(ctx sdk.Context, symbol string) *BancorInfo

key: stock/money pair

func (*BancorInfoKeeper) Remove

func (keeper *BancorInfoKeeper) Remove(ctx sdk.Context, bi *BancorInfo)

func (*BancorInfoKeeper) Save

func (keeper *BancorInfoKeeper) Save(ctx sdk.Context, bi *BancorInfo)

func (*BancorInfoKeeper) SetParams added in v0.0.13

func (keeper *BancorInfoKeeper) SetParams(ctx sdk.Context, params types.Params)

type QueryBancorInfoParam

type QueryBancorInfoParam struct {
	Symbol string `json:"symbol"`
}

Jump to

Keyboard shortcuts

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