Documentation ¶
Index ¶
- Constants
- Variables
- func ValidateGenesis(data GenesisState) error
- type Account
- type AccountState
- type BankKeeper
- type GenesisState
- type Issuer
- type IssuerState
- type MsgBurnToken
- type MsgCreateIssuer
- type MsgFreezeAccount
- type MsgFreezeToken
- type MsgMintToken
- type MsgUnfreezeToken
- type MsgWithdrawToken
- type ParamSubspace
- type Token
Constants ¶
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
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 ¶
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 )
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"` }
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) 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) 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) 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