Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInputOutputMismatch(codespace sdk.CodespaceType) sdk.Error
- func ErrNoBalanceToWithdraw(codespace sdk.CodespaceType) sdk.Error
- func ErrNoInputs(codespace sdk.CodespaceType) sdk.Error
- func ErrNoOutputs(codespace sdk.CodespaceType) sdk.Error
- func ErrNoValidatorTopup(codespace sdk.CodespaceType) sdk.Error
- func ErrSendDisabled(codespace sdk.CodespaceType) sdk.Error
- func ParamKeyTable() subspace.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func RegisterPulp(pulp *authTypes.Pulp)
- func ValidateGenesis(data GenesisState) error
- func ValidateInputsOutputs(inputs []Input, outputs []Output) sdk.Error
- type GenesisState
- type Input
- type MsgMultiSend
- type MsgSend
- type Output
- type QueryBalanceParams
Constants ¶
const ( CodeSendDisabled sdk.CodeType = 101 CodeInvalidInputsOutputs sdk.CodeType = 102 CodeNoValidatorTopup sdk.CodeType = 103 CodeNoBalanceToWithdraw sdk.CodeType = 104 )
Bank errors reserve 100 ~ 199.
const ( EventTypeTransfer = "transfer" AttributeKeyRecipient = "recipient" AttributeKeySender = "sender" AttributeValueCategory = ModuleName )
bank module event types
const ( // ModuleName is the name of the module ModuleName = "bank" // StoreKey is the store key string for bor StoreKey = ModuleName // RouterKey is the message route for bor RouterKey = ModuleName // QuerierRoute is the querier route for bor QuerierRoute = ModuleName // DefaultParamspace default name for parameter store DefaultParamspace = ModuleName // DefaultCodespace default code space DefaultCodespace sdk.CodespaceType = ModuleName )
const ( // DefaultSendEnabled enabled DefaultSendEnabled = true )
const (
QueryBalance = "balances"
)
Variables ¶
var ModuleCdc = codec.New()
ModuleCdc module cdc
var ParamStoreKeySendEnabled = []byte("sendenabled")
ParamStoreKeySendEnabled is store's key for SendEnabled
Functions ¶
func ErrInputOutputMismatch ¶
func ErrInputOutputMismatch(codespace sdk.CodespaceType) sdk.Error
ErrInputOutputMismatch is an error
func ErrNoBalanceToWithdraw ¶
func ErrNoBalanceToWithdraw(codespace sdk.CodespaceType) sdk.Error
ErrNoBalanceToWithdraw is an error for validator topup withdraw
func ErrNoOutputs ¶
func ErrNoOutputs(codespace sdk.CodespaceType) sdk.Error
ErrNoOutputs is an error
func ErrNoValidatorTopup ¶
func ErrNoValidatorTopup(codespace sdk.CodespaceType) sdk.Error
ErrNoValidatorTopup is an error for validator topup
func ErrSendDisabled ¶
func ErrSendDisabled(codespace sdk.CodespaceType) sdk.Error
ErrSendDisabled is an error
func ParamKeyTable ¶
ParamKeyTable type declaration for parameters
func RegisterCodec ¶
RegisterCodec registers concrete types on codec codec
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of bank genesis data returning an error for any failed validation criteria.
Types ¶
type GenesisState ¶
type GenesisState struct {
SendEnabled bool `json:"send_enabled" yaml:"send_enabled"`
}
GenesisState is the bank state that must be provided at genesis.
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState returns a default genesis state
func NewGenesisState ¶
func NewGenesisState(sendEnabled bool) GenesisState
NewGenesisState creates a new genesis state.
type Input ¶
type Input struct { Address types.HeimdallAddress `json:"address"` Coins sdk.Coins `json:"coins"` }
Input models transaction input
func NewInput ¶
func NewInput(addr types.HeimdallAddress, coins sdk.Coins) Input
NewInput - create a transaction input, used with MsgMultiSend
func (Input) ValidateBasic ¶
ValidateBasic - validate transaction input
type MsgMultiSend ¶
MsgMultiSend - high level transaction of the coin module
func NewMsgMultiSend ¶
func NewMsgMultiSend(in []Input, out []Output) MsgMultiSend
NewMsgMultiSend - construct arbitrary multi-in, multi-out send msg.
func (MsgMultiSend) GetSignBytes ¶
func (msg MsgMultiSend) GetSignBytes() []byte
GetSignBytes Implements Msg.
func (MsgMultiSend) GetSigners ¶
func (msg MsgMultiSend) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgMultiSend) ValidateBasic ¶
func (msg MsgMultiSend) ValidateBasic() sdk.Error
ValidateBasic Implements Msg.
type MsgSend ¶
type MsgSend struct { FromAddress types.HeimdallAddress `json:"from_address"` ToAddress types.HeimdallAddress `json:"to_address"` Amount sdk.Coins `json:"amount"` }
MsgSend - high level transaction of the coin module
func NewMsgSend ¶
func NewMsgSend(fromAddr, toAddr types.HeimdallAddress, amount sdk.Coins) MsgSend
NewMsgSend - construct arbitrary multi-in, multi-out send msg.
func (MsgSend) GetSigners ¶
func (msg MsgSend) GetSigners() []sdk.AccAddress
GetSigners Implements Msg.
func (MsgSend) ValidateBasic ¶
ValidateBasic Implements Msg.
type Output ¶
type Output struct { Address types.HeimdallAddress `json:"address"` Coins sdk.Coins `json:"coins"` }
Output models transaction outputs
func NewOutput ¶
func NewOutput(addr types.HeimdallAddress, coins sdk.Coins) Output
NewOutput - create a transaction output, used with MsgMultiSend
func (Output) ValidateBasic ¶
ValidateBasic - validate transaction output
type QueryBalanceParams ¶
type QueryBalanceParams struct {
Address hmTyps.HeimdallAddress
}
QueryBalanceParams defines the params for querying an account balance.
func NewQueryBalanceParams ¶
func NewQueryBalanceParams(addr hmTyps.HeimdallAddress) QueryBalanceParams
NewQueryBalanceParams creates a new instance of QueryBalanceParams.