keeper

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QueryBalance = "balance"
)

query endpoints supported by the token Querier

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier creates a new querier for token clients.

func TokenToFloat64 added in v0.1.2

func TokenToFloat64(token sdk.Int) float64

TokenToFloat64 converts token to its float64 representation

Types

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) Keeper

NewKeeper creates new instances of the token Keeper

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) GetBalance

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

GetBalance returns token balance for the given owner

func (Keeper) GetBalanceIterator

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

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

func (Keeper) GetTotalSupply

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

GetTotalSupply returns total token supply

func (Keeper) IncreaseTotalSupply

func (k Keeper) IncreaseTotalSupply(ctx sdk.Context, amount sdk.Int)

IncreaseTotalSupply increase total supply with the given amount of tokens

Jump to

Keyboard shortcuts

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