keeper

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

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

func NewQuerier

func NewQuerier(k Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier

creates a querier for legacy rest endpoints

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey sdk.StoreKey,
	params paramtypes.Subspace,
	bankKeeper types.BankKeeper,
) Keeper

func (*Keeper) AlreadySwapped

func (k *Keeper) AlreadySwapped(ctx sdk.Context, txHash string) bool

AlreadySwapped returns true if tx hash has existed

func (*Keeper) GetParams

func (k *Keeper) GetParams(ctx sdk.Context) types.Params

func (Keeper) GetSwap

func (k Keeper) GetSwap(ctx sdk.Context, txHash string) (swap types.Tokenswap, err error)

GetSwap returns a tokenswap item by tx hash

func (Keeper) GetSwappedAmount added in v0.2.3

func (k Keeper) GetSwappedAmount(ctx sdk.Context) int64

GetSwappedAmount returns current tokenswap amount

func (*Keeper) Limit added in v0.2.3

func (k *Keeper) Limit(ctx sdk.Context) (limit int64)

Total returns maximum swappable amount

func (Keeper) Logger

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

func (*Keeper) SetParams

func (k *Keeper) SetParams(ctx sdk.Context, params types.Params)

func (Keeper) SetSwap

func (k Keeper) SetSwap(ctx sdk.Context, swap types.Tokenswap)

SetSwap stores a tokenswap item with tx hash as a key

func (Keeper) SetSwappedAmount added in v0.2.3

func (k Keeper) SetSwappedAmount(ctx sdk.Context, amt types.SwappedAmount)

SetSwappedAmount updates current tokenswap amount

func (*Keeper) Signer

func (k *Keeper) Signer(ctx sdk.Context) (signer string)

Signer returns authorized signer

func (*Keeper) Store

func (k *Keeper) Store(ctx sdk.Context) sdk.KVStore

func (Keeper) Swap

func (k Keeper) Swap(ctx sdk.Context, swap types.Tokenswap) error

Swap processes a tokenswap by mint tokens and send them to proper receiver

func (*Keeper) Swappable

func (k *Keeper) Swappable(ctx sdk.Context) (swappable bool)

Swappable returns the tokenswap is enabled or not

type Migrator added in v0.3.0

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

Migrator is a struct for handling in-place store migrations.

func NewMigrator added in v0.3.0

func NewMigrator(keeper Keeper) Migrator

NewMigrator returns a new Migrator.

func (Migrator) Migrate1to2 added in v0.3.0

func (m Migrator) Migrate1to2(ctx sdk.Context) error

Migrate1to2 migtates from version 1 to 2.

type Querier

type Querier struct {
	Keeper
}

func (Querier) Params

Params queries the parameters of tokenswap

func (Querier) SwappedAmount added in v0.2.3

SwappedAmount queries current swapped amount of tokenswap

func (Querier) Tokenswap

Tokenswap queries a tokenswap item by tx hash

Jump to

Keyboard shortcuts

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