Documentation
¶
Overview ¶
nolint
Index ¶
- func ErrInsufficientCoins(msg string) sdk.Error
- func ErrInvalidAddress(msg string) sdk.Error
- func ErrInvalidCoins(msg string) sdk.Error
- func ErrInvalidInput(msg string) sdk.Error
- func ErrInvalidOutput(msg string) sdk.Error
- func ErrInvalidSequence(msg string) sdk.Error
- func ErrNoInputs() sdk.Error
- func ErrNoOutputs() sdk.Error
- func ErrUnknownAddress(msg string) sdk.Error
- func ErrUnknownRequest(msg string) sdk.Error
- func NewHandler(ck CoinKeeper) sdk.Handler
- func RegisterWire(cdc *wire.Codec)
- type CodeType
- type CoinKeeper
- type Input
- type IssueMsg
- type Output
- type SendMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrInsufficientCoins ¶ added in v0.9.0
func ErrInsufficientCoins(msg string) sdk.Error
func ErrInvalidAddress ¶ added in v0.9.0
func ErrInvalidAddress(msg string) sdk.Error
func ErrInvalidCoins ¶ added in v0.9.0
func ErrInvalidCoins(msg string) sdk.Error
func ErrInvalidInput ¶
func ErrInvalidInput(msg string) sdk.Error
func ErrInvalidOutput ¶
func ErrInvalidOutput(msg string) sdk.Error
func ErrInvalidSequence ¶ added in v0.9.0
func ErrInvalidSequence(msg string) sdk.Error
func ErrNoInputs ¶
func ErrNoInputs() sdk.Error
func ErrNoOutputs ¶
func ErrNoOutputs() sdk.Error
func ErrUnknownAddress ¶ added in v0.9.0
func ErrUnknownAddress(msg string) sdk.Error
func ErrUnknownRequest ¶ added in v0.9.0
func ErrUnknownRequest(msg string) sdk.Error
func RegisterWire ¶
func RegisterWire(cdc *wire.Codec)
Types ¶
type CodeType ¶ added in v0.9.0
type CodeType = sdk.CodeType
const (
// Coin errors reserve 100 ~ 199.
CodeInvalidInput CodeType = 101
CodeInvalidOutput CodeType = 102
CodeInvalidAddress CodeType = 103
CodeUnknownAddress CodeType = 104
CodeInsufficientCoins CodeType = 105
CodeInvalidCoins CodeType = 106
CodeUnknownRequest CodeType = sdk.CodeUnknownRequest
)
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 crypto.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)
AddCoins adds amt to the coins at the addr.
func (CoinKeeper) SubtractCoins ¶
func (ck CoinKeeper) SubtractCoins(ctx sdk.Context, addr crypto.Address, amt sdk.Coins) (sdk.Coins, sdk.Error)
SubtractCoins subtracts amt from the coins at the addr.
type Input ¶
type Input struct {
Address crypto.Address `json:"address"`
Coins sdk.Coins `json:"coins"`
Sequence int64 `json:"sequence"`
// contains filtered or unexported fields
}
func NewInput ¶
func NewInput(addr crypto.Address, coins sdk.Coins) Input
NewInput - create a transaction input, used with SendMsg
func NewInputWithSequence ¶ added in v0.9.0
func NewInputWithSequence(addr crypto.Address, coins sdk.Coins, seq int64) Input
NewInputWithSequence - 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 crypto.Address `json:"banker"`
Outputs []Output `json:"outputs"`
}
IssueMsg - high level transaction of the coin module
func NewIssueMsg ¶
func NewIssueMsg(banker crypto.Address, out []Output) IssueMsg
NewIssueMsg - construct arbitrary multi-in, multi-out send msg.
type Output ¶
type Output struct {
Address crypto.Address `json:"address"`
Coins sdk.Coins `json:"coins"`
}
func NewOutput ¶
func NewOutput(addr crypto.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.