types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeCreateIssuer  = "create-issuer"
	EventTypeMintToken     = "mint-token"
	EventTypeBurnToken     = "burn-token"
	EventTypeFreezeToken   = "freeze-token"
	EventTypeUnfreezeToken = "unfreeze-token"
	EventTypeWithdrawToken = "withdraw-token"
	EventTypeFreezeAccount = "freeze-account"

	AttributeKeyIssuerAddress = "issuer-address"
	AttributeKeyIssuerAmount  = "issuer-amount"
	AttributeKeyMinterAddress = "minter-address"
	AttributeKeyMinterAmount  = "minter-amount"
	AttributeKeyBurnerAddress = "minter-address"
	AttributeKeyBurnerAmount  = "burner-amount"

	AttributeValueCategory = ModuleName
)

issuer module event types

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "issuer"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	// RouterKey to be used for routing msgs
	RouterKey = ModuleName

	// QuerierRoute to be used for querier msgs
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	IssuersKey  = []byte{0x51} // prefix for each key to a Issuer
	TokensKey   = []byte{0x52} // prefix for each key to a Token
	AccountsKey = []byte{0x53} // prefix for each key to a Issuer
)
View Source
var (
	ErrInvalid = sdkerrors.Register(ModuleName, 1, "custom error message")
)

Functions

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the issuer genesis parameters

Types

type Account

type Account struct {
	State   AccountState   `json:"state" yaml:"state"`
	Address sdk.AccAddress `json:"address" yaml:"address"`
}

func NewAccount

func NewAccount(address sdk.AccAddress, state AccountState) Account

NewAccount - initialize a new issuer

type AccountState

type AccountState string
const (
	APPROVED      AccountState = "approved"
	PENDING       AccountState = "pending"
	FROZENACCOUNT AccountState = "frozen"
)

type BankKeeper

type BankKeeper interface {
	SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error
	SubtractCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error)
	AddCoins(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coins) (sdk.Coins, error)
}

BankKeeper defines the expected bank keeper (noalias)

type GenesisState

type GenesisState struct {
}

GenesisState - all issuer state that must be provided at genesis

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - default GenesisState used by Cosmos Hub

func NewGenesisState

func NewGenesisState() GenesisState

NewGenesisState creates a new GenesisState object

type Issuer

type Issuer struct {
	Name    string         `json:"name" yaml:"name"`
	Token   string         `json:"token" yaml:"token"`
	Fee     uint16         `json:"fee" yaml:"fee"`
	State   IssuerState    `json:"state" yaml:"state"`
	Address sdk.AccAddress `json:"address" yaml:"address"`
}

func NewIssuer

func NewIssuer(name string, address sdk.AccAddress, token string) Issuer

NewIssuer - initialize a new issuer

type IssuerState

type IssuerState string
const (
	ACCEPTED IssuerState = "accepted"
	FROZEN   IssuerState = "frozen"
)

type MsgBurnToken

type MsgBurnToken struct {
	Token  string         `json:"token"`
	Amount string         `json:"amount"`
	Issuer sdk.AccAddress `json:"issuer"`
}

Vote messages

func NewMsgBurnToken

func NewMsgBurnToken(token string, amount string, issuer sdk.AccAddress) MsgBurnToken

func (MsgBurnToken) GetSignBytes

func (msg MsgBurnToken) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgBurnToken) GetSigners

func (msg MsgBurnToken) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgBurnToken) Route

func (msg MsgBurnToken) Route() string

Route should return the name of the module

func (MsgBurnToken) Type

func (msg MsgBurnToken) Type() string

Type should return the action

func (MsgBurnToken) ValidateBasic

func (msg MsgBurnToken) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgCreateIssuer

type MsgCreateIssuer struct {
	Name    string         `json:"name"`
	Address sdk.AccAddress `json:"issuer"`
	Token   string         `json:"token"`
	Amount  string         `json:"amount"`
	Owner   sdk.AccAddress `json:"owner"`
}

Vote messages

func NewMsgCreateIssuer

func NewMsgCreateIssuer(name string, address sdk.AccAddress, token string, amount string, owner sdk.AccAddress) MsgCreateIssuer

func (MsgCreateIssuer) GetSignBytes

func (msg MsgCreateIssuer) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgCreateIssuer) GetSigners

func (msg MsgCreateIssuer) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgCreateIssuer) Route

func (msg MsgCreateIssuer) Route() string

Route should return the name of the module

func (MsgCreateIssuer) Type

func (msg MsgCreateIssuer) Type() string

Type should return the action

func (MsgCreateIssuer) ValidateBasic

func (msg MsgCreateIssuer) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgFreezeAccount

type MsgFreezeAccount struct {
	Account sdk.AccAddress `json:"account"`
	Issuer  sdk.AccAddress `json:"issuer"`
}

Vote messages

func NewMsgFreezeAccount

func NewMsgFreezeAccount(account sdk.AccAddress, issuer sdk.AccAddress) MsgFreezeAccount

func (MsgFreezeAccount) GetSignBytes

func (msg MsgFreezeAccount) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgFreezeAccount) GetSigners

func (msg MsgFreezeAccount) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgFreezeAccount) Route

func (msg MsgFreezeAccount) Route() string

Route should return the name of the module

func (MsgFreezeAccount) Type

func (msg MsgFreezeAccount) Type() string

Type should return the action

func (MsgFreezeAccount) ValidateBasic

func (msg MsgFreezeAccount) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgFreezeToken

type MsgFreezeToken struct {
	Token  string         `json:"token"`
	Issuer sdk.AccAddress `json:"issuer"`
}

Vote messages

func NewMsgFreezeToken

func NewMsgFreezeToken(token string, issuer sdk.AccAddress) MsgFreezeToken

func (MsgFreezeToken) GetSignBytes

func (msg MsgFreezeToken) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgFreezeToken) GetSigners

func (msg MsgFreezeToken) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgFreezeToken) Route

func (msg MsgFreezeToken) Route() string

Route should return the name of the module

func (MsgFreezeToken) Type

func (msg MsgFreezeToken) Type() string

Type should return the action

func (MsgFreezeToken) ValidateBasic

func (msg MsgFreezeToken) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgMintToken

type MsgMintToken struct {
	Token  string         `json:"token"`
	Amount string         `json:"amount"`
	Issuer sdk.AccAddress `json:"issuer"`
}

Vote messages

func NewMsgMintToken

func NewMsgMintToken(token string, amount string, issuer sdk.AccAddress) MsgMintToken

func (MsgMintToken) GetSignBytes

func (msg MsgMintToken) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgMintToken) GetSigners

func (msg MsgMintToken) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgMintToken) Route

func (msg MsgMintToken) Route() string

Route should return the name of the module

func (MsgMintToken) Type

func (msg MsgMintToken) Type() string

Type should return the action

func (MsgMintToken) ValidateBasic

func (msg MsgMintToken) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgUnfreezeToken

type MsgUnfreezeToken struct {
	Token  string         `json:"token"`
	Issuer sdk.AccAddress `json:"issuer"`
}

Vote messages

func NewMsgUnfreezeToken

func NewMsgUnfreezeToken(token string, issuer sdk.AccAddress) MsgUnfreezeToken

func (MsgUnfreezeToken) GetSignBytes

func (msg MsgUnfreezeToken) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgUnfreezeToken) GetSigners

func (msg MsgUnfreezeToken) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgUnfreezeToken) Route

func (msg MsgUnfreezeToken) Route() string

Route should return the name of the module

func (MsgUnfreezeToken) Type

func (msg MsgUnfreezeToken) Type() string

Type should return the action

func (MsgUnfreezeToken) ValidateBasic

func (msg MsgUnfreezeToken) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type MsgWithdrawToken

type MsgWithdrawToken struct {
	Token  string         `json:"token"`
	Amount string         `json:"amount"`
	Owner  sdk.AccAddress `json:"owner"`
}

Vote messages

func NewMsgWithdrawToken

func NewMsgWithdrawToken(token string, amount string, owner sdk.AccAddress) MsgWithdrawToken

func (MsgWithdrawToken) GetSignBytes

func (msg MsgWithdrawToken) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgWithdrawToken) GetSigners

func (msg MsgWithdrawToken) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgWithdrawToken) Route

func (msg MsgWithdrawToken) Route() string

Route should return the name of the module

func (MsgWithdrawToken) Type

func (msg MsgWithdrawToken) Type() string

Type should return the action

func (MsgWithdrawToken) ValidateBasic

func (msg MsgWithdrawToken) ValidateBasic() error

ValidateBasic runs stateless checks on the message

type ParamSubspace

type ParamSubspace interface {
	WithKeyTable(table params.KeyTable) params.Subspace
	Get(ctx sdk.Context, key []byte, ptr interface{})
	GetParamSet(ctx sdk.Context, ps params.ParamSet)
	SetParamSet(ctx sdk.Context, ps params.ParamSet)
}

ParamSubspace defines the expected Subspace interfacace

type Token

type Token struct {
	Name string `json:"Name" yaml:"Name"`
}

Jump to

Keyboard shortcuts

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