keeper

package
v0.5.6-x.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2022 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultGenesisState

func DefaultGenesisState() *coinswaptypes.GenesisState

DefaultGenesisState returns the default oracle genesis state.

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k Keeper) coinswaptypes.GenesisState

ExportGenesis returns a GenesisState for a given context and keeper.

func GetGenesisStateFromAppState

func GetGenesisStateFromAppState(cdc *codec.LegacyAmino, appState map[string]json.RawMessage) coinswaptypes.GenesisState

GetGenesisStateFromAppState returns x/coinswap GenesisState given raw application genesis state.

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, data coinswaptypes.GenesisState) []abci.ValidatorUpdate

InitGenesis performs genesis initialization for the oracle module.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) coinswaptypes.MsgServer

NewMsgServerImpl returns an implementation of the coinswap MsgServer interface for the provided Keeper.

func NewQuerier

func NewQuerier(keeper Keeper, cdc *codec.LegacyAmino) sdk.Querier

Types

type Keeper

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

func (Keeper) ExchangeDenom

func (k Keeper) ExchangeDenom(
	ctx sdk.Context,
	fromDenom, toDenom string,
	amt sdk.Coin,
	requester sdk.AccAddress,
	additionalExchangeRates ...coinswaptypes.Exchange,
) error

ExchangeDenom exchanges given amount

func (Keeper) GetDecParam

func (k Keeper) GetDecParam(ctx sdk.Context, key []byte) (res sdk.Dec)

GetDecParam returns the parameter as specified by key as sdk.Dec

func (Keeper) GetExchanges

func (k Keeper) GetExchanges(ctx sdk.Context) (res []coinswaptypes.Exchange)

func (Keeper) GetInitialRate

func (k Keeper) GetInitialRate(ctx sdk.Context) (rate sdk.Dec)

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params coinswaptypes.Params)

GetParams returns all current parameters as a types.Params instance.

func (Keeper) GetRate

func (k Keeper) GetRate(
	ctx sdk.Context,
	fromDenom, toDenom string,
	additionalExchangeRates ...coinswaptypes.Exchange,
) (sdk.Dec, error)

GetRate returns the exchange rate for the given pair

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) SetExchanges

func (k Keeper) SetExchanges(ctx sdk.Context, value []coinswaptypes.Exchange)

func (Keeper) SetInitialRate

func (k Keeper) SetInitialRate(ctx sdk.Context, value sdk.Dec)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, value coinswaptypes.Params)

SetParams saves the given key-value parameter to the store.

type Querier

type Querier struct {
	Keeper
}

Jump to

Keyboard shortcuts

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