keeper

package
v1.1.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: LGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(k *Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the token-convert MsgServer interface.

func NewQuerierImpl

func NewQuerierImpl(k *Keeper) types.QueryServer

NewQuerierImpl returns an implementation of the token-convert QueryServer interface.

Types

type Keeper

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

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec,
	key storetypes.StoreKey,
	ak types.AccountKeeper,
	bk types.BankKeeper,
	instant string,
) Keeper

func (Keeper) ConvertTabi

func (k Keeper) ConvertTabi(ctx sdk.Context, sender sdk.AccAddress, coin sdk.Coin) error

ConvertTabi converts tabi to vetabi.

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdktypes.Context) *types.GenesisState

ExportGenesis returns a GenesisState

func (Keeper) GetStrategies

func (k Keeper) GetStrategies(ctx sdk.Context) (strategies []types.Strategy)

GetStrategies gets all strategies

func (Keeper) GetStrategy

func (k Keeper) GetStrategy(ctx sdk.Context, name string) (types.Strategy, bool)

GetStrategy gets a strategy by strategy id

func (Keeper) GetVoucher

func (k Keeper) GetVoucher(ctx sdk.Context, voucherID string) (types.Voucher, bool)

GetVoucher gets a voucher by voucher id

func (Keeper) GetVoucherSeq

func (k Keeper) GetVoucherSeq(ctx sdk.Context) uint64

GetVoucherSeq returns the next usable voucher seq

func (Keeper) GetVouchers

func (k Keeper) GetVouchers(ctx sdk.Context) (vouchers []types.Voucher)

GetVouchers gets all vouchers

func (Keeper) HasStrategy

func (k Keeper) HasStrategy(ctx sdk.Context, name string) bool

HasStrategy checks if a strategy exists

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdktypes.Context, state types.GenesisState)

InitGenesis sets the initial state of the module

func (Keeper) InstantWithdrawVetabi

func (k Keeper) InstantWithdrawVetabi(ctx sdk.Context, sender sdk.AccAddress, coin sdk.Coin) error

InstantWithdrawVetabi convert vetabi to tabi with instant strategy.

func (Keeper) LockVetabiAndCreateVoucher

func (k Keeper) LockVetabiAndCreateVoucher(ctx sdk.Context, sender sdk.AccAddress, strategy types.Strategy, coin sdk.Coin) (string, string, error)

LockVetabiAndCreateVoucher locks vetabi and creates a voucher for future withdraw.

func (Keeper) WithdrawTabi

func (k Keeper) WithdrawTabi(ctx sdk.Context, sender sdk.AccAddress, voucher types.Voucher) (sdk.Coin, sdk.Coin, error)

WithdrawTabi withdraws tabi according to the given voucher.

type Querier

type Querier struct {
	*Keeper
}

func (Querier) Strategies

Strategies queries all strategies

func (Querier) Strategy

Strategy queries the strategy of a given name

func (Querier) Voucher

Voucher queries a voucher by its id

func (Querier) VoucherStatus

VoucherStatus queries the lock status of a given voucher

func (Querier) Vouchers

Vouchers queries all vouchers

Jump to

Keyboard shortcuts

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