keeper

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

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

Types

type Keeper

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

Keeper implements the module data storaging.

func NewKeeper

func NewKeeper(
	cdc codec.BinaryCodec,
	storeKey sdk.StoreKey,
	ps paramtypes.Subspace,
	accountKeeper auth.AccountKeeperI,
	bankKeeper bank.Keeper,
) *Keeper

NewKeeper creates new Keeper instance.

func (Keeper) BuyCoin

func (k Keeper) BuyCoin(goCtx context.Context, msg *types.MsgBuyCoin) (*types.MsgBuyCoinResponse, error)

func (Keeper) Check

func (*Keeper) CheckFutureChanges

func (k *Keeper) CheckFutureChanges(ctx sdk.Context, coinInfo types.Coin, amount sdk.Int) error

Check than buy/sell/fee deduct operations will not violate coin constants: minimal volume, limit volume, minimal reserve It includes check balance of auth.FeeCollectorName Positive amount = buy = increase volume and reserve Negative amount = sell/deduct = decrease volume and reserve

func (Keeper) Checks

func (*Keeper) ClearCoinCache

func (k *Keeper) ClearCoinCache()

func (Keeper) Coin

func (Keeper) Coins

func (Keeper) CreateCoin

func (k Keeper) CreateCoin(goCtx context.Context, msg *types.MsgCreateCoin) (*types.MsgCreateCoinResponse, error)

func (*Keeper) DeleteLegacyBalance

func (k *Keeper) DeleteLegacyBalance(ctx sdk.Context, legacyAddress string)

DeleteLegacyBalance delete balance for old address. Must call in return transaction

func (*Keeper) EditCoin

func (k *Keeper) EditCoin(ctx sdk.Context, coin types.Coin, reserve sdk.Int, volume sdk.Int)

Edit updates current coin reserve and volume and writes coin to KVStore.

func (*Keeper) GetBaseDenom

func (k *Keeper) GetBaseDenom(ctx sdk.Context) (symbol string)

func (*Keeper) GetCheck

func (k *Keeper) GetCheck(ctx sdk.Context, checkHash []byte) (check types.Check, err error)

func (*Keeper) GetChecks

func (k *Keeper) GetChecks(ctx sdk.Context) (checks []types.Check)

GetChecks returns all checks existing in KVStore.

func (*Keeper) GetChecksIterator

func (k *Keeper) GetChecksIterator(ctx sdk.Context) sdk.Iterator

GetChecksIterator returns iterator over all checks existing in KVStore.

func (*Keeper) GetCoin

func (k *Keeper) GetCoin(ctx sdk.Context, symbol string) (coin types.Coin, err error)

GetCoin returns the coin if exists in KVStore.

func (*Keeper) GetCoinCache

func (k *Keeper) GetCoinCache(symbol string) bool

func (*Keeper) GetCoins

func (k *Keeper) GetCoins(ctx sdk.Context) (coins []types.Coin)

GetCoins returns all coins existing in KVStore.

func (*Keeper) GetCoinsIterator

func (k *Keeper) GetCoinsIterator(ctx sdk.Context) sdk.Iterator

GetCoinsIterator returns iterator over all coins existing in KVStore.

func (*Keeper) GetCommission

func (k *Keeper) GetCommission(ctx sdk.Context, feeAmountBase sdk.Int) (sdk.Int, string, error)

func (*Keeper) GetLegacyBalance

func (k *Keeper) GetLegacyBalance(ctx sdk.Context, legacyAddress string) (balance types.LegacyBalance, err error)

GetLegacyBalance returns balance for legacy address if exists in KVStore.

func (*Keeper) GetLegacyBalances

func (k *Keeper) GetLegacyBalances(ctx sdk.Context) (balances []types.LegacyBalance)

GetLegacyBalance returns balance for old address if exists in KVStore.

func (*Keeper) GetLegacyBalancesIterator

func (k *Keeper) GetLegacyBalancesIterator(ctx sdk.Context) sdk.Iterator

GetLegacyBalancesIterator returns iterator over all legacy balances existing in KVStore.

func (*Keeper) GetParams

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

GetParams returns the total set of the module parameters.

func (*Keeper) IsCheckRedeemed

func (k *Keeper) IsCheckRedeemed(ctx sdk.Context, check *types.Check) bool

func (*Keeper) IsCoinBase

func (k *Keeper) IsCoinBase(ctx sdk.Context, symbol string) bool

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) MultiSendCoin

func (Keeper) Params

func (Keeper) RedeemCheck

func (Keeper) SellAllCoin

func (Keeper) SellCoin

func (k Keeper) SellCoin(goCtx context.Context, msg *types.MsgSellCoin) (*types.MsgSellCoinResponse, error)

func (Keeper) SendCoin

func (k Keeper) SendCoin(goCtx context.Context, msg *types.MsgSendCoin) (*types.MsgSendCoinResponse, error)

SendCoin creates new custom coin.

func (*Keeper) SetCachedCoin

func (k *Keeper) SetCachedCoin(coin string)

func (*Keeper) SetCheck

func (k *Keeper) SetCheck(ctx sdk.Context, check *types.Check)

SetCheck writes check to KVStore.

func (*Keeper) SetCoin

func (k *Keeper) SetCoin(ctx sdk.Context, coin types.Coin)

SetCoin writes coin to KVStore.

func (*Keeper) SetLegacyBalance

func (k *Keeper) SetLegacyBalance(ctx sdk.Context, balance types.LegacyBalance)

SetLegacyBalance store legacy balance for legacy address. Must call only in genesis

func (*Keeper) SetParams

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

SetParams sets the module parameters to the param space.

func (Keeper) UpdateCoin

func (k Keeper) UpdateCoin(goCtx context.Context, msg *types.MsgUpdateCoin) (*types.MsgUpdateCoinResponse, error)

Jump to

Keyboard shortcuts

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