keeper

package
v0.0.0-...-8551cdf Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CoinAccountsFromDenom = types.CoinAccountsFromDenom
	CoinDenom             = types.CoinDenom
)

Functions

func NewQuerier

func NewQuerier(keeper AssetViewKeeper) sdk.Querier

NewQuerier creates a querier for auth REST endpoints

Types

type AccountEnsurer

type AccountEnsurer interface {
	EnsureAccount(ctx sdk.Context, account types.AccountID) error
}

type AssetCoinsKeeper

type AssetCoinsKeeper interface {
	AssetViewKeeper
	AssetTransfer

	Create(ctx sdk.Context, creator, symbol types.Name, maxSupply types.Coin, canIssue, canLock bool, issue2Height int64, initSupply types.Coin, desc []byte) error
	Issue(ctx sdk.Context, creator, symbol types.Name, amount types.Coin) error
	Burn(ctx sdk.Context, id types.AccountID, amt sdk.Coin) error
	Retire(ctx sdk.Context, creator, symbol types.Name, amount types.Coin) error

	LockCoins(ctx sdk.Context, account types.AccountID, unlockBlockHeight int64, coins types.Coins) error
	UnLockCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error
}

AssetCoinsKeeper keeper interface for asset module

type AssetKeeper

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

AssetKeeper for asset state

func NewAssetKeeper

func NewAssetKeeper(cdc *codec.Codec, key sdk.StoreKey, ak AccountEnsurer) AssetKeeper

NewAssetKeeper new asset keeper

func (AssetKeeper) BlacklistedAddr

func (a AssetKeeper) BlacklistedAddr(addr sdk.AccAddress) bool

BlacklistedAddr checks if a given address is blacklisted (i.e restricted from receiving funds)

func (AssetKeeper) Burn

func (a AssetKeeper) Burn(ctx sdk.Context, id types.AccountID, amount types.Coin) error

func (AssetKeeper) BurnCoinPower

func (a AssetKeeper) BurnCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coins) (sdk.Coins, error)

BurnCoinPower sub coin power from account, if has no power return error

func (AssetKeeper) Cdc

func (ak AssetKeeper) Cdc() *codec.Codec

Cdc get cdc

func (AssetKeeper) CheckIsCanUseCoins

func (a AssetKeeper) CheckIsCanUseCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error

CheckIsCanUseCoins check if the account can use this coins

func (AssetKeeper) CoinsToPower

func (a AssetKeeper) CoinsToPower(ctx sdk.Context, from, to types.AccountID, amt sdk.Coins) error

CoinsToPower accounts coins to coin power, so that it can be send to module account

func (AssetKeeper) Create

func (a AssetKeeper) Create(ctx sdk.Context, creator, symbol types.Name, max_supply types.Coin, canIssue, canLock bool, issue2Height int64, initSupply types.Coin, desc []byte) error

func (AssetKeeper) ExerciseCoinPower

func (a AssetKeeper) ExerciseCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coin) error

ExerciseCoinPower exercise coin power to get coins to account

func (AssetKeeper) GenesisCoins

func (a AssetKeeper) GenesisCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error

func (AssetKeeper) GetAllBalances

func (a AssetKeeper) GetAllBalances(ctx sdk.Context, ID types.AccountID) sdk.Coins

GetAllBalances get all coins for a account

func (AssetKeeper) GetBalance

func (a AssetKeeper) GetBalance(ctx sdk.Context, ID types.AccountID, denom string) sdk.Coin

GetBalance get coins balance for account

func (AssetKeeper) GetCoin

func (a AssetKeeper) GetCoin(ctx sdk.Context, account types.AccountID, creator, symbol types.Name) (types.Coin, error)

GetCoin get coin by account id and coin demon

func (AssetKeeper) GetCoinDesc

func (a AssetKeeper) GetCoinDesc(ctx sdk.Context, creator, symbol types.Name) (*types.CoinDescription, error)

GetCoinDesc get coin description by coin demon

func (AssetKeeper) GetCoinPower

func (a AssetKeeper) GetCoinPower(ctx sdk.Context, account types.AccountID, creator, symbol types.Name) (types.Coin, error)

GetCoinPower get coin power by account id and coin demon

func (AssetKeeper) GetCoinPowerByDenomd

func (a AssetKeeper) GetCoinPowerByDenomd(ctx sdk.Context, account types.AccountID, denomd string) types.Coin

GetCoinPower get coin power by account id and coin demon

func (AssetKeeper) GetCoinPowers

func (a AssetKeeper) GetCoinPowers(ctx sdk.Context, account types.AccountID) types.Coins

GetCoinPowers get coin powers by account id

func (AssetKeeper) GetCoinStat

func (a AssetKeeper) GetCoinStat(ctx sdk.Context, creator, symbol types.Name) (*types.CoinStat, error)

GetCoinStat get coin stat data by coin demon

func (AssetKeeper) GetCoinTotalSupply

func (a AssetKeeper) GetCoinTotalSupply(ctx sdk.Context, creator, symbol types.Name) types.Coin

GetCoinTotalSupply get coin stat data by coin demon

func (AssetKeeper) GetCoins

func (a AssetKeeper) GetCoins(ctx sdk.Context, account types.AccountID) (types.Coins, error)

GetCoins get coins by account id

func (AssetKeeper) GetCoinsTotalSupply

func (a AssetKeeper) GetCoinsTotalSupply(ctx sdk.Context) types.Coins

GetCoinsTotalSupply get all coin stat data

func (AssetKeeper) GetLockCoins

func (a AssetKeeper) GetLockCoins(ctx sdk.Context, account types.AccountID) (types.Coins, []LockedCoins, error)

GetLockCoins get locked data

func (AssetKeeper) Issue

func (a AssetKeeper) Issue(ctx sdk.Context, creator, symbol types.Name, amount types.Coin) error

func (AssetKeeper) IssueCoinPower

func (a AssetKeeper) IssueCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coins) (sdk.Coins, error)

IssueCoinPower add coin power to account, if a account has coin power, it can gen coins by power

func (AssetKeeper) IterateAllCoinPowers

func (a AssetKeeper) IterateAllCoinPowers(ctx sdk.Context, cb func(address types.AccountID, balance sdk.Coins) (stop bool))

IterateAllCoins iterate all account 's coins

func (AssetKeeper) IterateAllCoins

func (a AssetKeeper) IterateAllCoins(ctx sdk.Context, cb func(address types.AccountID, balance sdk.Coins) (stop bool))

IterateAllCoins iterate all account 's coins

func (AssetKeeper) LockCoins

func (a AssetKeeper) LockCoins(ctx sdk.Context, account types.AccountID, unlockBlockHeight int64, coins types.Coins) error

LockCoins lock coins for a account

func (AssetKeeper) Logger

func (ak AssetKeeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (AssetKeeper) PayFee

func (a AssetKeeper) PayFee(ctx sdk.Context, payer types.AccountID, fee types.Coins) error

func (AssetKeeper) Retire

func (a AssetKeeper) Retire(ctx sdk.Context, creator, symbol types.Name, amount types.Coin) error

func (AssetKeeper) SendCoinPower

func (a AssetKeeper) SendCoinPower(ctx sdk.Context, from, to types.AccountID, amt sdk.Coins) error

SendCoinPower sub coin power from account, if has no power return error

func (AssetKeeper) SpendableCoins

func (a AssetKeeper) SpendableCoins(ctx sdk.Context, ID types.AccountID) sdk.Coins

SpendableCoins return account spendable coins

func (AssetKeeper) Transfer

func (a AssetKeeper) Transfer(ctx sdk.Context, from, to types.AccountID, amount types.Coins) error

func (AssetKeeper) UnLockCoins

func (a AssetKeeper) UnLockCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error

type AssetTransfer

type AssetTransfer = types.AssetTransfer

type AssetViewKeeper

type AssetViewKeeper interface {
	Cdc() *codec.Codec

	GetCoins(ctx sdk.Context, account types.AccountID) (types.Coins, error)
	GetCoin(ctx sdk.Context, account types.AccountID, creator, symbol types.Name) (types.Coin, error)
	GetCoinPowers(ctx sdk.Context, account types.AccountID) types.Coins
	GetCoinPower(ctx sdk.Context, account types.AccountID, creator, symbol types.Name) (types.Coin, error)
	GetCoinDesc(ctx sdk.Context, creator, symbol types.Name) (*types.CoinDescription, error)
	GetCoinStat(ctx sdk.Context, creator, symbol types.Name) (*types.CoinStat, error)
	GetLockCoins(ctx sdk.Context, account types.AccountID) (types.Coins, []LockedCoins, error)
}

AssetViewKeeper keeper view interface for asset module

type Context

type Context = types.Context

type LockedCoins

type LockedCoins = types.LockedCoins

Jump to

Keyboard shortcuts

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