v0_13

package
v0.14.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ModuleName The name that will be used throughout the module
	ModuleName = "issuance"

	// StoreKey Top level store key where all module items will be stored
	StoreKey = ModuleName

	// RouterKey Top level router key
	RouterKey = ModuleName

	// DefaultParamspace default name for parameter store
	DefaultParamspace = ModuleName

	// QuerierRoute route used for abci queries
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	KeyAssets            = []byte("Assets")
	DefaultAssets        = Assets{}
	ModuleAccountName    = ModuleName
	AssetSupplyPrefix    = []byte{0x01}
	PreviousBlockTimeKey = []byte{0x02}
)

Parameter keys and default values

Functions

This section is empty.

Types

type Asset

type Asset struct {
	Owner            sdk.AccAddress   `json:"owner" yaml:"owner"`
	Denom            string           `json:"denom" yaml:"denom"`
	BlockedAddresses []sdk.AccAddress `json:"blocked_addresses" yaml:"blocked_addresses"`
	Paused           bool             `json:"paused" yaml:"paused"`
	Blockable        bool             `json:"blockable" yaml:"blockable"`
	RateLimit        RateLimit        `json:"rate_limit" yaml:"rate_limit"`
}

Asset type for assets in the issuance module

func NewAsset

func NewAsset(owner sdk.AccAddress, denom string, blockedAddresses []sdk.AccAddress, paused bool, blockable bool, limit RateLimit) Asset

NewAsset returns a new Asset

func (Asset) Validate

func (a Asset) Validate() error

Validate performs a basic check of asset fields

type AssetSupplies

type AssetSupplies []AssetSupply

AssetSupplies is a slice of AssetSupply

type AssetSupply

type AssetSupply struct {
	CurrentSupply sdk.Coin      `json:"current_supply"  yaml:"current_supply"`
	TimeElapsed   time.Duration `json:"time_elapsed" yaml:"time_elapsed"`
}

AssetSupply contains information about an asset's rate-limited supply (the total supply of the asset is tracked in the top-level supply module)

func NewAssetSupply

func NewAssetSupply(currentSupply sdk.Coin, timeElapsed time.Duration) AssetSupply

NewAssetSupply initializes a new AssetSupply

func (AssetSupply) GetDenom

func (a AssetSupply) GetDenom() string

GetDenom getter method for the denom of the asset supply

func (AssetSupply) String

func (a AssetSupply) String() string

String implements stringer

func (AssetSupply) Validate

func (a AssetSupply) Validate() error

Validate performs a basic validation of an asset supply fields.

type Assets

type Assets []Asset

Assets array of Asset

func (Assets) Validate

func (as Assets) Validate() error

Validate checks if all assets are valid and there are no duplicate entries

type GenesisState

type GenesisState struct {
	Params   Params        `json:"params" yaml:"params"`
	Supplies AssetSupplies `json:"supplies" yaml:"supplies"`
}

GenesisState is the state that must be provided at genesis for the issuance module

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns the default GenesisState for the issuance module

func NewGenesisState

func NewGenesisState(params Params, supplies AssetSupplies) GenesisState

NewGenesisState returns a new GenesisState

type Params

type Params struct {
	Assets Assets `json:"assets" yaml:"assets"`
}

Params governance parameters for the issuance module

func DefaultParams

func DefaultParams() Params

DefaultParams returns default params for issuance module

func NewParams

func NewParams(assets Assets) Params

NewParams returns a new params object

type RateLimit

type RateLimit struct {
	Active     bool          `json:"active" yaml:"active"`
	Limit      sdk.Int       `json:"limit" yaml:"limit"`
	TimePeriod time.Duration `json:"time_period" yaml:"time_period"`
}

RateLimit parameters for rate-limiting the supply of an issued asset

func NewRateLimit

func NewRateLimit(active bool, limit sdk.Int, timePeriod time.Duration) RateLimit

NewRateLimit initializes a new RateLimit

Jump to

Keyboard shortcuts

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