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
- func (macc ModuleAccount) GetAccountNumber() uint64
- func (macc ModuleAccount) GetAddress() types.AccAddress
- func (macc ModuleAccount) GetCodeHash() []byte
- func (macc ModuleAccount) GetCoins() types.Coins
- func (macc ModuleAccount) GetContractType() string
- func (macc ModuleAccount) GetIsModule() bool
- func (macc ModuleAccount) GetName() string
- func (macc ModuleAccount) GetPermissions() []string
- func (macc ModuleAccount) GetPubKey() crypto.PubKey
- func (macc ModuleAccount) GetSequence() uint64
- func (macc ModuleAccount) HasPermission(perm string) bool
- func (macc *ModuleAccount) SetAccountNumber(n uint64) error
- func (macc *ModuleAccount) SetAddress(acc types.AccAddress) error
- func (macc *ModuleAccount) SetCodeHash(hash []byte)
- func (macc *ModuleAccount) SetCoins(c types.Coins) error
- func (macc *ModuleAccount) SetContractType(c string) error
- func (macc ModuleAccount) SetIsModule(flag bool) error
- func (macc *ModuleAccount) SetPermissions(perms []string)
- func (macc *ModuleAccount) SetPubKey(key crypto.PubKey) error
- func (macc *ModuleAccount) SetSequence(s uint64) error
- func (macc ModuleAccount) SpendableCoins(bt time.Time) types.Coins
- func (macc ModuleAccount) String() string
- 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 NewModuleAccountFromBaseAccount ¶ added in v1.5.70
func NewModuleAccountFromBaseAccount(acc *types2.BaseAccount, name string, permissions ...string) *ModuleAccount
func (ModuleAccount) GetAccountNumber ¶ added in v1.5.53
func (macc ModuleAccount) GetAccountNumber() uint64
func (ModuleAccount) GetAddress ¶ added in v1.5.53
func (macc ModuleAccount) GetAddress() types.AccAddress
func (ModuleAccount) GetCodeHash ¶ added in v1.5.53
func (macc ModuleAccount) GetCodeHash() []byte
func (ModuleAccount) GetCoins ¶ added in v1.5.53
func (macc ModuleAccount) GetCoins() types.Coins
func (ModuleAccount) GetContractType ¶ added in v1.5.53
func (macc ModuleAccount) GetContractType() string
func (ModuleAccount) GetIsModule ¶ added in v1.5.53
func (macc ModuleAccount) GetIsModule() bool
func (ModuleAccount) GetName ¶
func (macc ModuleAccount) GetName() string
func (ModuleAccount) GetPermissions ¶
func (macc ModuleAccount) GetPermissions() []string
func (ModuleAccount) GetPubKey ¶ added in v1.5.53
func (macc ModuleAccount) GetPubKey() crypto.PubKey
func (ModuleAccount) GetSequence ¶ added in v1.5.53
func (macc ModuleAccount) GetSequence() uint64
func (ModuleAccount) HasPermission ¶
func (macc ModuleAccount) HasPermission(perm string) bool
func (*ModuleAccount) SetAccountNumber ¶ added in v1.5.53
func (macc *ModuleAccount) SetAccountNumber(n uint64) error
func (*ModuleAccount) SetAddress ¶ added in v1.5.53
func (macc *ModuleAccount) SetAddress(acc types.AccAddress) error
func (*ModuleAccount) SetCodeHash ¶ added in v1.5.53
func (macc *ModuleAccount) SetCodeHash(hash []byte)
func (*ModuleAccount) SetCoins ¶ added in v1.5.53
func (macc *ModuleAccount) SetCoins(c types.Coins) error
func (*ModuleAccount) SetContractType ¶ added in v1.5.53
func (macc *ModuleAccount) SetContractType(c string) error
func (ModuleAccount) SetIsModule ¶ added in v1.5.53
func (macc ModuleAccount) SetIsModule(flag bool) error
func (*ModuleAccount) SetPermissions ¶ added in v1.5.70
func (macc *ModuleAccount) SetPermissions(perms []string)
func (*ModuleAccount) SetPubKey ¶ added in v1.5.53
func (macc *ModuleAccount) SetPubKey(key crypto.PubKey) error
func (*ModuleAccount) SetSequence ¶ added in v1.5.53
func (macc *ModuleAccount) SetSequence(s uint64) error
func (ModuleAccount) SpendableCoins ¶ added in v1.5.53
func (macc ModuleAccount) SpendableCoins(bt time.Time) types.Coins
func (ModuleAccount) String ¶ added in v1.5.53
func (macc ModuleAccount) String() string
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.