Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultSupply() exported.SupplyI
- func DenomMetadataKey(denom string) []byte
- func NewModuleAddress(name string) types.AccAddress
- func NewSupply(total sdk.Coins) exported.SupplyI
- func RegisterCodec(cdc *codec.Codec)
- type DenomUnit
- type GenesisState
- type Metadata
- type ModuleAccount
- type PermissionsForAddress
- type Supply
- func (supply Supply) Deflate(amount sdk.Coins) exported.SupplyI
- func (supply Supply) GetTotal() sdk.Coins
- func (supply Supply) Inflate(amount sdk.Coins) exported.SupplyI
- func (supply Supply) SetTotal(total sdk.Coins) exported.SupplyI
- func (supply Supply) String() string
- func (supply Supply) ValidateBasic() error
Constants ¶
View Source
const ( Minter = "minter" Burner = "burner" Staking = "staking" )
permissions
View Source
const ModuleName = "supply"
Variables ¶
View Source
var ( SupplyKey = []byte{0x00} BalancesPrefix = []byte("balances") DenomMetadataPrefix = []byte{0x1} )
View Source
var ModuleCdc *codec.Codec
Functions ¶
func DenomMetadataKey ¶
DenomMetadataKey returns the denomination metadata key.
func NewModuleAddress ¶
func NewModuleAddress(name string) types.AccAddress
func RegisterCodec ¶
RegisterCodec registers the account types and interface
Types ¶
type DenomUnit ¶
type DenomUnit struct { // denom represents the string name of the given denom unit (e.g uatom). Denom string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"` // exponent represents power of 10 exponent that one must // raise the base_denom to in order to equal the given DenomUnit's denom // 1 denom = 1^exponent base_denom // (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with // exponent = 6, thus: 1 atom = 10^6 uatom). Exponent uint32 `protobuf:"varint,2,opt,name=exponent,proto3" json:"exponent,omitempty"` // aliases is a list of string aliases for the given denom Aliases []string `protobuf:"bytes,3,rep,name=aliases,proto3" json:"aliases,omitempty"` }
type GenesisState ¶
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 Metadata ¶
type Metadata struct { Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"` // denom_units represents the list of DenomUnit's for a given coin DenomUnits []*DenomUnit `protobuf:"bytes,2,rep,name=denom_units,json=denomUnits,proto3" json:"denom_units,omitempty"` // base represents the base denom (should be the DenomUnit with exponent = 0). Base string `protobuf:"bytes,3,opt,name=base,proto3" json:"base,omitempty"` // display indicates the suggested denom that should be // displayed in clients. Display string `protobuf:"bytes,4,opt,name=display,proto3" json:"display,omitempty"` }
type ModuleAccount ¶
type ModuleAccount struct { *account.BaseAccount Name string `json:"name" yaml:"name"` Permissions []string `json:"permissions" yaml:"permissions"` }
func NewEmptyModuleAccount ¶
func NewEmptyModuleAccount(name string, permissions ...string) *ModuleAccount
func (ModuleAccount) GetName ¶
func (macc ModuleAccount) GetName() string
func (ModuleAccount) GetPermissions ¶
func (macc ModuleAccount) GetPermissions() []string
func (ModuleAccount) HasPermission ¶
func (macc ModuleAccount) HasPermission(perm string) bool
type PermissionsForAddress ¶
type PermissionsForAddress struct {
// contains filtered or unexported fields
}
func NewPermissionForAddress ¶
func NewPermissionForAddress(name string, permissions []string) PermissionsForAddress
func (PermissionsForAddress) GetAddress ¶
func (pa PermissionsForAddress) GetAddress() sdk.AccAddress
GetAddress returns the address of the PermissionsForAddress object
func (PermissionsForAddress) GetPermissions ¶
func (pa PermissionsForAddress) GetPermissions() []string
GetPermissions returns the permissions granted to the address
func (PermissionsForAddress) HasPermission ¶
func (pa PermissionsForAddress) HasPermission(permission string) bool
HasPermission returns whether the PermissionsForAddress contains permission.
type Supply ¶
type Supply struct {
Total sdk.Coins `json:"total"` // total supply of tokens registered on the chain
}
func (Supply) ValidateBasic ¶
ValidateBasic validates the Supply coins and returns error if invalid
Click to show internal directories.
Click to hide internal directories.