Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterCodec(cdc *codec.Codec)
- type Account
- type AccountID
- type AccountKeeper
- type BankKeeper
- type GenesisState
- type ModuleAccount
- type PermissionsForAddress
- type QuerySupplyOfParams
- type QueryTotalSupplyParams
- type Supply
- func (*Supply) Descriptor() ([]byte, []int)
- func (this *Supply) Equal(that interface{}) bool
- func (supply Supply) GetTotal() sdk.Coins
- func (m *Supply) Marshal() (dAtA []byte, err error)
- func (m *Supply) MarshalTo(dAtA []byte) (int, error)
- func (m *Supply) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*Supply) ProtoMessage()
- func (m *Supply) Reset()
- func (supply *Supply) SetTotal(total sdk.Coins)
- func (m *Supply) Size() (n int)
- func (supply Supply) String() string
- func (m *Supply) Unmarshal(dAtA []byte) error
- func (supply Supply) ValidateBasic() error
- func (m *Supply) XXX_DiscardUnknown()
- func (m *Supply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Supply) XXX_Merge(src proto.Message)
- func (m *Supply) XXX_Size() int
- func (m *Supply) XXX_Unmarshal(b []byte) error
Constants ¶
const ( Minter = accountTypes.Minter Burner = accountTypes.Burner Staking = accountTypes.Staking )
const ( // ModuleName is the module name constant used in many places ModuleName = "supply" // StoreKey is the store key string for supply StoreKey = ModuleName // RouterKey is the message route for supply RouterKey = ModuleName // QuerierRoute is the querier route for supply QuerierRoute = ModuleName BlackHole = "blackhole" )
const ( QueryTotalSupply = "total_supply" QuerySupplyOf = "supply_of" )
query endpoints supported by the supply Querier
Variables ¶
var ( MustName = types.MustName NewAccountIDFromName = types.NewAccountIDFromName )
var ( NewEmptyModuleAccount = accountTypes.NewEmptyModuleAccount NewPermissionsForAddress = accountTypes.NewPermissionsForAddress )
var ( ErrInvalidLengthTypes = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTypes = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group") )
var ModuleCdc *codec.Codec
ModuleCdc generic sealed codec to be used throughout module
Functions ¶
func RegisterCodec ¶
RegisterCodec registers the account types and interface
Types ¶
type Account ¶
type Account = accountExported.Account
type AccountKeeper ¶
type AccountKeeper interface { NewAccount(ctx sdk.Context, acc Account) Account GetAccount(sdk.Context, types.AccountID) Account // can return nil. SetAccount(ctx sdk.Context, acc exported.Account) IterateAccounts(ctx sdk.Context, cb func(account Account) (stop bool)) }
AccountKeeper defines the expected account keeper
type BankKeeper ¶
type BankKeeper interface { SendCoinPower(ctx sdk.Context, from, to types.AccountID, amt sdk.Coins) error IssueCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coins) (sdk.Coins, error) BurnCoinPower(ctx sdk.Context, id types.AccountID, amt sdk.Coins) (sdk.Coins, error) CoinsToPower(ctx sdk.Context, from, to types.AccountID, amt sdk.Coins) error GetCoinsTotalSupply(ctx sdk.Context) types.Coins GetCoinTotalSupply(ctx sdk.Context, creator, symbol types.Name) types.Coin IterateAllCoins(ctx sdk.Context, cb func(address types.AccountID, balance sdk.Coins) (stop bool)) IterateAllCoinPowers(ctx sdk.Context, cb func(address types.AccountID, balance sdk.Coins) (stop bool)) }
BankKeeper defines the expected bank keeper (noalias)
type GenesisState ¶
GenesisState is the supply state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func NewGenesisState ¶
func NewGenesisState(supply sdk.Coins) GenesisState
NewGenesisState creates a new genesis state.
type ModuleAccount ¶
type ModuleAccount = accountTypes.ModuleAccount
type PermissionsForAddress ¶
type PermissionsForAddress = accountTypes.PermissionsForAddress
type QuerySupplyOfParams ¶
type QuerySupplyOfParams struct {
Denom string
}
QuerySupplyOfParams defines the params for the following queries:
- 'custom/supply/totalSupplyOf'
func NewQuerySupplyOfParams ¶
func NewQuerySupplyOfParams(denom string) QuerySupplyOfParams
NewQuerySupplyOfParams creates a new instance to query the total supply of a given denomination
type QueryTotalSupplyParams ¶
type QueryTotalSupplyParams struct {
Page, Limit int
}
QueryTotalSupply defines the params for the following queries:
- 'custom/supply/totalSupply'
func NewQueryTotalSupplyParams ¶
func NewQueryTotalSupplyParams(page, limit int) QueryTotalSupplyParams
NewQueryTotalSupplyParams creates a new instance to query the total supply
type Supply ¶
type Supply struct {
Total github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=total,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"total"`
}
Supply represents a struct that passively keeps track of the total supply amounts in the network.
func (*Supply) Descriptor ¶
func (*Supply) MarshalToSizedBuffer ¶
func (*Supply) ProtoMessage ¶
func (*Supply) ProtoMessage()
func (Supply) ValidateBasic ¶
ValidateBasic validates the Supply coins and returns error if invalid
func (*Supply) XXX_DiscardUnknown ¶
func (m *Supply) XXX_DiscardUnknown()