keeper

package
v1.4.5 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryBalance = "balance"
	QueryPool    = "pool"
	QueryHistory = "history"
)

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier creates a new querier for token clients.

Types

type Balance added in v1.3.0

type Balance struct {
	Balance      sdk.Dec `json:"balance"`
	BalanceDelta sdk.Dec `json:"balanceDelta"`
	IsBanned     bool    `json:"isBanned,omitempty"`
}

type Keeper

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

Keeper maintains the link to data storage and exposes getter/setter methods for the various parts of the state machine

func NewKeeper

func NewKeeper(
	cdc *codec.Codec,
	storeKey sdk.StoreKey,
	paramSpace params.Subspace,
	accountKeeper auth.AccountKeeper,
	distributionKeeper distribution.Keeper,
) Keeper

NewKeeper creates new instances of the token Keeper

func (*Keeper) AddRewardDistribution added in v1.4.0

func (k *Keeper) AddRewardDistribution(ctx sdk.Context, address sdk.AccAddress, height int64, coins sdk.Coins)

func (Keeper) AddTokens

func (k Keeper) AddTokens(ctx sdk.Context, owner sdk.AccAddress, amount sdk.Int)

AddTokens adds token to the given owner

func (Keeper) DistributeRewards added in v1.4.0

func (k Keeper) DistributeRewards(ctx sdk.Context)

func (Keeper) GetBalance

func (k Keeper) GetBalance(ctx sdk.Context, address sdk.AccAddress) sdk.Int

GetBalance returns token balance for the given address

func (Keeper) GetBalanceDelta added in v1.4.0

func (k Keeper) GetBalanceDelta(ctx sdk.Context, address sdk.AccAddress) sdk.Int

func (Keeper) GetBalanceIterator

func (k Keeper) GetBalanceIterator(ctx sdk.Context) sdk.Iterator

GetBalanceIterator gets an iterator over all balances in which the keys are the accounts and the values are their balance

func (Keeper) GetDeltasIterator added in v1.4.0

func (k Keeper) GetDeltasIterator(ctx sdk.Context) sdk.Iterator

GetDeltasIterator gets an iterator over all balance deltas

func (Keeper) GetParams added in v1.4.0

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

GetParams gets the operations module's parameters.

func (*Keeper) GetRewardsDistributionHistory added in v1.4.0

func (k *Keeper) GetRewardsDistributionHistory(ctx sdk.Context, address sdk.AccAddress) []types.RewardDistribution

func (Keeper) GetRewardsDistributionIterator added in v1.4.0

func (k Keeper) GetRewardsDistributionIterator(ctx sdk.Context) sdk.Iterator

GetRewardsDistributionIterator gets an iterator over all accounts' history

func (Keeper) GetTotalSupply

func (k Keeper) GetTotalSupply(ctx sdk.Context) sdk.Int

GetTotalSupply returns total token supply

func (Keeper) IncBalanceDelta added in v1.4.0

func (k Keeper) IncBalanceDelta(ctx sdk.Context, address sdk.AccAddress, amount sdk.Int)

func (Keeper) IsBanned added in v1.4.0

func (k Keeper) IsBanned(ctx sdk.Context, address sdk.AccAddress) bool

IsBanned returns is address banned

func (Keeper) IsInitialBalanceSet added in v1.3.0

func (k Keeper) IsInitialBalanceSet(ctx sdk.Context, owner sdk.AccAddress) bool

func (Keeper) Logger added in v1.3.0

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

Logger returns a module-specific logger.

func (Keeper) ResetAccount added in v1.4.0

func (k Keeper) ResetAccount(ctx sdk.Context, addr sdk.AccAddress)

func (Keeper) SetBalance added in v1.0.0

func (k Keeper) SetBalance(ctx sdk.Context, owner sdk.AccAddress, amount sdk.Int)

SetBalance set balance to the given user

func (Keeper) SetBan added in v1.4.0

func (k Keeper) SetBan(ctx sdk.Context, address sdk.AccAddress, ban bool)

SetBan bans/unbans address

func (Keeper) SetParams added in v1.4.0

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

SetParams sets the token module's parameters.

type Pool added in v1.4.0

type Pool struct {
	Size                   sdk.DecCoins `json:"size"`
	TotalDelta             sdk.Dec      `json:"totalDelta"`
	NextDistributionHeight int64        `json:"nextDistributionHeight"`
}

Jump to

Keyboard shortcuts

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