Documentation ¶
Index ¶
- Variables
- func NewQuerier(keeper AssetViewKeeper) sdk.Querier
- type AccountEnsurer
- type AssetCoinsKeeper
- type AssetKeeper
- func (a AssetKeeper) BlacklistedAddr(addr sdk.AccAddress) bool
- func (a AssetKeeper) Burn(ctx sdk.Context, id types.AccountID, amount types.Coin) error
- func (a AssetKeeper) BurnCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coins) (sdk.Coins, error)
- func (ak AssetKeeper) Cdc() *codec.Codec
- func (a AssetKeeper) CheckIsCanUseCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error
- func (a AssetKeeper) CoinsToPower(ctx sdk.Context, from, to types.AccountID, amt sdk.Coins) error
- func (a AssetKeeper) Create(ctx sdk.Context, creator, symbol types.Name, max_supply types.Coin, ...) error
- func (a AssetKeeper) ExerciseCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coin) error
- func (a AssetKeeper) GenesisCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error
- func (a AssetKeeper) GetAllBalances(ctx sdk.Context, ID types.AccountID) sdk.Coins
- func (a AssetKeeper) GetBalance(ctx sdk.Context, ID types.AccountID, denom string) sdk.Coin
- func (a AssetKeeper) GetCoin(ctx sdk.Context, account types.AccountID, creator, symbol types.Name) (types.Coin, error)
- func (a AssetKeeper) GetCoinDesc(ctx sdk.Context, creator, symbol types.Name) (*types.CoinDescription, error)
- func (a AssetKeeper) GetCoinPower(ctx sdk.Context, account types.AccountID, creator, symbol types.Name) (types.Coin, error)
- func (a AssetKeeper) GetCoinPowerByDenomd(ctx sdk.Context, account types.AccountID, denomd string) types.Coin
- func (a AssetKeeper) GetCoinPowers(ctx sdk.Context, account types.AccountID) types.Coins
- func (a AssetKeeper) GetCoinStat(ctx sdk.Context, creator, symbol types.Name) (*types.CoinStat, error)
- func (a AssetKeeper) GetCoinTotalSupply(ctx sdk.Context, creator, symbol types.Name) types.Coin
- func (a AssetKeeper) GetCoins(ctx sdk.Context, account types.AccountID) (types.Coins, error)
- func (a AssetKeeper) GetCoinsTotalSupply(ctx sdk.Context) types.Coins
- func (a AssetKeeper) GetLockCoins(ctx sdk.Context, account types.AccountID) (types.Coins, []LockedCoins, error)
- func (a AssetKeeper) Issue(ctx sdk.Context, creator, symbol types.Name, amount types.Coin) error
- func (a AssetKeeper) IssueCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coins) (sdk.Coins, error)
- func (a AssetKeeper) IterateAllCoinPowers(ctx sdk.Context, ...)
- func (a AssetKeeper) IterateAllCoins(ctx sdk.Context, ...)
- func (a AssetKeeper) LockCoins(ctx sdk.Context, account types.AccountID, unlockBlockHeight int64, ...) error
- func (ak AssetKeeper) Logger(ctx sdk.Context) log.Logger
- func (a AssetKeeper) PayFee(ctx sdk.Context, payer types.AccountID, fee types.Coins) error
- func (a AssetKeeper) Retire(ctx sdk.Context, creator, symbol types.Name, amount types.Coin) error
- func (a AssetKeeper) SendCoinPower(ctx sdk.Context, from, to types.AccountID, amt sdk.Coins) error
- func (a AssetKeeper) SpendableCoins(ctx sdk.Context, ID types.AccountID) sdk.Coins
- func (a AssetKeeper) Transfer(ctx sdk.Context, from, to types.AccountID, amount types.Coins) error
- func (a AssetKeeper) UnLockCoins(ctx sdk.Context, account types.AccountID, coins types.Coins) error
- type AssetTransfer
- type AssetViewKeeper
- type Context
- type LockedCoins
Constants ¶
This section is empty.
Variables ¶
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 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) 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) 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 ¶
CoinsToPower accounts coins to coin power, so that it can be send to module account
func (AssetKeeper) ExerciseCoinPower ¶
ExerciseCoinPower exercise coin power to get coins to account
func (AssetKeeper) GenesisCoins ¶
func (AssetKeeper) GetAllBalances ¶
GetAllBalances get all coins for a account
func (AssetKeeper) GetBalance ¶
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 ¶
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 ¶
GetCoinTotalSupply get coin stat data by coin demon
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) 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) SendCoinPower ¶
SendCoinPower sub coin power from account, if has no power return error
func (AssetKeeper) SpendableCoins ¶
SpendableCoins return account spendable coins
func (AssetKeeper) UnLockCoins ¶
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 LockedCoins ¶
type LockedCoins = types.LockedCoins