keeper

package
v0.0.0-...-aa2a1f9 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QuerySymbols = "symbols"
	QueryToken   = "token"
)

query endpoints supported by the assetmanagement Querier

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier is the module level router for state queries

Types

type Keeper

type Keeper struct {
	AccountKeeper auth.AccountKeeper
	CoinKeeper    bank.Keeper
	// 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(accountKeeper auth.AccountKeeper, coinKeeper bank.Keeper, storeKey sdk.StoreKey,
	cdc *codec.Codec) Keeper

NewKeeper creates new instances of the assetmanagement Keeper

func (Keeper) DeleteToken

func (k Keeper) DeleteToken(ctx sdk.Context, symbol string)

DeleteToken - deletes the entire Token metadata struct by symbol

func (Keeper) GetOwner

func (k Keeper) GetOwner(ctx sdk.Context, symbol string) (sdk.AccAddress, error)

GetOwner - get the current owner of a symbol

func (Keeper) GetToken

func (k Keeper) GetToken(ctx sdk.Context, symbol string) (*types.Token, error)

GetToken gets the entire Token metadata struct by symbol. False if not found, true otherwise

func (Keeper) GetTokensIterator

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

GetTokensIterator - Get an iterator over all symbols in which the keys are the symbols and the values are the token

func (Keeper) GetTotalSupply

func (k Keeper) GetTotalSupply(ctx sdk.Context, symbol string) (sdk.Coins, error)

GetTotalSupply - gets the current total supply of a symbol

func (Keeper) HasOwner

func (k Keeper) HasOwner(ctx sdk.Context, symbol string) (bool, error)

HasOwner - returns whether or not the symbol already has an owner

func (Keeper) IsSymbolPresent

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

IsSymbolPresent - Check if the symbol is present in the store or not

func (Keeper) ResolveName

func (k Keeper) ResolveName(ctx sdk.Context, symbol string) (string, error)

ResolveName - returns the name string that the symbol resolves to

func (Keeper) SetName

func (k Keeper) SetName(ctx sdk.Context, symbol string, name string) error

SetName - sets the name string that a symbol resolves to

func (Keeper) SetOwner

func (k Keeper) SetOwner(ctx sdk.Context, symbol string, owner sdk.AccAddress) error

SetOwner - sets the current owner of a symbol

func (Keeper) SetToken

func (k Keeper) SetToken(ctx sdk.Context, symbol string, token *types.Token) error

SetToken sets the entire Token metadata struct by symbol. Owner must be set. Returns success

func (Keeper) SetTotalSupply

func (k Keeper) SetTotalSupply(ctx sdk.Context, symbol string, totalSupply sdk.Coins) error

SetTotalSupply - sets the current total supply of a symbol

Jump to

Keyboard shortcuts

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