exchange

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryExchange = "exchange"
)

Variables

This section is empty.

Functions

func GetStoreKey

func GetStoreKey(fromDenom string, toDenom string) []byte

GetStoreKey return keys to be used as key for store

func NewHandler

func NewHandler(k Keeper) sdkTypes.Handler

func NewQuerier added in v0.2.3

func NewQuerier(k Keeper, cdc *amino.Codec) sdk.Querier

func RegisterCodec

func RegisterCodec(cdc *amino.Codec) *amino.Codec

RegisterWire registers messages into the amino.codec

Types

type Keeper

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

Keeper to store ExchangeRate

func NewKeeper

func NewKeeper(key sdk.StoreKey, bk bank.Keeper) Keeper

NewKeeper - Return a new keeper

func (Keeper) BuyCoin

func (k Keeper) BuyCoin(
	ctx sdk.Context,
	account sdk.AccAddress,
	reserveAddress sdk.AccAddress,
	fromDenom string,
	toDenom string,
	buyingAmount types.Dec,
) (err error)

func (Keeper) CreateExchangeRate

func (k Keeper) CreateExchangeRate(
	ctx sdk.Context,
	msg messages.MsgCreate,
) (ex etypes.ExchangeRate, err error)

func (Keeper) Delete

func (k Keeper) Delete(
	ctx sdk.Context,
	fromDenom string,
	toDenom string,
) (e etypes.ExchangeRate, err error)

func (Keeper) DeleteExchangeRate

func (k Keeper) DeleteExchangeRate(
	ctx sdk.Context,
	msg messages.MsgDelete,
) (ex etypes.ExchangeRate, err error)

func (Keeper) Get

func (k Keeper) Get(
	ctx sdk.Context,
	fromDenom string,
	toDenom string,
) (e etypes.ExchangeRate, err error)

GetExchangeRate - get exchangeRate from a store

func (Keeper) RetrieveExchangeRate

func (k Keeper) RetrieveExchangeRate(
	ctx sdk.Context,
	fromDenom string,
	toDenom string,
) (ex etypes.ExchangeRate, err error)

func (Keeper) SellCoin

func (k Keeper) SellCoin(
	ctx sdk.Context,
	account sdk.AccAddress,
	reserveAddress sdk.AccAddress,
	fromDenom string,
	toDenom string,
	sellingAmount types.Dec,
) (err error)

func (Keeper) Store

func (k Keeper) Store(ctx sdk.Context, e etypes.ExchangeRate) error

StoreExchangeRate - store exchangeRate

func (Keeper) UpdateExchangeRate

func (k Keeper) UpdateExchangeRate(
	ctx sdk.Context,
	msg messages.MsgUpdate,
) (ex etypes.ExchangeRate, err error)

type QueryExchangeParams added in v0.2.3

type QueryExchangeParams struct {
	FromDenom string
	ToDenom   string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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