Documentation
¶
Overview ¶
nolint
Index ¶
- Constants
- func ErrInvalidInput(msg string) sdk.Error
- func ErrInvalidOutput(msg string) sdk.Error
- func ErrNoInputs() sdk.Error
- func ErrNoOutputs() sdk.Error
- func NewHandler(ck CoinKeeper) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type CoinKeeper
- func (ck CoinKeeper) AddCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)
- func (ck CoinKeeper) GetCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) sdk.Coins
- func (ck CoinKeeper) InputOutputCoins(ctx sdk.Context, inputs []Input, outputs []Output) sdk.Error
- func (ck CoinKeeper) SendCoins(ctx sdk.Context, fromAddr sdk.Address, toAddr sdk.Address, amt sdk.Coins) sdk.Error
- func (ck CoinKeeper) SubtractCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)
- type Input
- type IssueMsg
- type Output
- type SendMsg
Constants ¶
const (
CodeInvalidInput sdk.CodeType = 101
CodeInvalidOutput sdk.CodeType = 102
)
Coin errors reserve 100 ~ 199.
Variables ¶
This section is empty.
Functions ¶
func ErrInvalidInput ¶
func ErrInvalidInput(msg string) sdk.Error
func ErrInvalidOutput ¶
func ErrInvalidOutput(msg string) sdk.Error
func ErrNoInputs ¶
func ErrNoInputs() sdk.Error
func ErrNoOutputs ¶
func ErrNoOutputs() sdk.Error
func NewHandler ¶
func NewHandler(ck CoinKeeper) sdk.Handler
NewHandler returns a handler for "bank" type messages.
Types ¶
type CoinKeeper ¶
type CoinKeeper struct {
// contains filtered or unexported fields
}
CoinKeeper manages transfers between accounts
func NewCoinKeeper ¶
func NewCoinKeeper(am sdk.AccountMapper) CoinKeeper
NewCoinKeeper returns a new CoinKeeper
func (CoinKeeper) AddCoins ¶
func (ck CoinKeeper) AddCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)
AddCoins adds amt to the coins at the addr.
func (CoinKeeper) GetCoins ¶
func (ck CoinKeeper) GetCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) sdk.Coins
GetCoins returns the coins at the addr.
func (CoinKeeper) InputOutputCoins ¶
func (ck CoinKeeper) InputOutputCoins(ctx sdk.Context, inputs []Input, outputs []Output) sdk.Error
InputOutputCoins handles a list of inputs and outputs
func (CoinKeeper) SendCoins ¶
func (ck CoinKeeper) SendCoins(ctx sdk.Context, fromAddr sdk.Address, toAddr sdk.Address, amt sdk.Coins) sdk.Error
SendCoins moves coins from one account to another
func (CoinKeeper) SubtractCoins ¶
func (ck CoinKeeper) SubtractCoins(ctx sdk.Context, addr sdk.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)
SubtractCoins subtracts amt from the coins at the addr.
type Input ¶
type Input struct {
Address sdk.Address `json:"address"`
Coins sdk.Coins `json:"coins"`
}
Transaction Output
func NewInput ¶
func NewInput(addr sdk.Address, coins sdk.Coins) Input
NewInput - create a transaction input, used with SendMsg
func (Input) ValidateBasic ¶
func (in Input) ValidateBasic() sdk.Error
ValidateBasic - validate transaction input
type IssueMsg ¶
type IssueMsg struct {
Banker sdk.Address `json:"banker"`
Outputs []Output `json:"outputs"`
}
IssueMsg - high level transaction of the coin module
func NewIssueMsg ¶
func NewIssueMsg(banker sdk.Address, out []Output) IssueMsg
NewIssueMsg - construct arbitrary multi-in, multi-out send msg.
type Output ¶
type Output struct {
Address sdk.Address `json:"address"`
Coins sdk.Coins `json:"coins"`
}
Transaction Output
func NewOutput ¶
func NewOutput(addr sdk.Address, coins sdk.Coins) Output
NewOutput - create a transaction output, used with SendMsg
func (Output) ValidateBasic ¶
func (out Output) ValidateBasic() sdk.Error
ValidateBasic - validate transaction output
type SendMsg ¶
type SendMsg struct {
Inputs []Input `json:"inputs"`
Outputs []Output `json:"outputs"`
}
SendMsg - high level transaction of the coin module
func NewSendMsg ¶
func NewSendMsg(in []Input, out []Output) SendMsg
NewSendMsg - construct arbitrary multi-in, multi-out send msg.