types

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: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Minter  = accountTypes.Minter
	Burner  = accountTypes.Burner
	Staking = accountTypes.Staking
)
View Source
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"
)
View Source
const (
	QueryTotalSupply = "total_supply"
	QuerySupplyOf    = "supply_of"
)

query endpoints supported by the supply Querier

Variables

View Source
var (
	MustName             = types.MustName
	NewAccountIDFromName = types.NewAccountIDFromName
)
View Source
var (
	NewEmptyModuleAccount    = accountTypes.NewEmptyModuleAccount
	NewPermissionsForAddress = accountTypes.NewPermissionsForAddress
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var ModuleCdc *codec.Codec

ModuleCdc generic sealed codec to be used throughout module

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers the account types and interface

Types

type Account

type Account = accountExported.Account

type AccountID

type AccountID = types.AccountID

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

type GenesisState struct {
	Supply sdk.Coins `json:"supply" yaml:"supply"`
}

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 DefaultSupply

func DefaultSupply() *Supply

DefaultSupply creates an empty Supply

func NewSupply

func NewSupply(total sdk.Coins) *Supply

NewSupply creates a new Supply instance

func (*Supply) Descriptor

func (*Supply) Descriptor() ([]byte, []int)

func (*Supply) Equal

func (this *Supply) Equal(that interface{}) bool

func (Supply) GetTotal

func (supply Supply) GetTotal() sdk.Coins

GetTotal returns the supply total.

func (*Supply) Marshal

func (m *Supply) Marshal() (dAtA []byte, err error)

func (*Supply) MarshalTo

func (m *Supply) MarshalTo(dAtA []byte) (int, error)

func (*Supply) MarshalToSizedBuffer

func (m *Supply) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Supply) ProtoMessage

func (*Supply) ProtoMessage()

func (*Supply) Reset

func (m *Supply) Reset()

func (*Supply) SetTotal

func (supply *Supply) SetTotal(total sdk.Coins)

SetTotal sets the total supply.

func (*Supply) Size

func (m *Supply) Size() (n int)

func (Supply) String

func (supply Supply) String() string

String returns a human readable string representation of a supplier.

func (*Supply) Unmarshal

func (m *Supply) Unmarshal(dAtA []byte) error

func (Supply) ValidateBasic

func (supply Supply) ValidateBasic() error

ValidateBasic validates the Supply coins and returns error if invalid

func (*Supply) XXX_DiscardUnknown

func (m *Supply) XXX_DiscardUnknown()

func (*Supply) XXX_Marshal

func (m *Supply) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Supply) XXX_Merge

func (m *Supply) XXX_Merge(src proto.Message)

func (*Supply) XXX_Size

func (m *Supply) XXX_Size() int

func (*Supply) XXX_Unmarshal

func (m *Supply) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

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