bank

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2018 License: Apache-2.0 Imports: 5 Imported by: 2,319

Documentation

Overview

nolint

Index

Constants

View Source
const (
	CodeInvalidInput  sdk.CodeType = 101
	CodeInvalidOutput sdk.CodeType = 102
)

Coin errors reserve 100 ~ 199.

Variables

This section is empty.

Functions

func ErrInvalidInput added in v0.2.0

func ErrInvalidInput(msg string) sdk.Error

func ErrInvalidOutput added in v0.2.0

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

Handle all "bank" type messages.

func RegisterWire added in v0.2.0

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec

Types

type CoinKeeper added in v0.2.0

type CoinKeeper struct {
	// contains filtered or unexported fields
}

CoinKeeper manages transfers between accounts

func NewCoinKeeper added in v0.2.0

func NewCoinKeeper(am sdk.AccountMapper) CoinKeeper

NewCoinKeeper returns a new CoinKeeper

func (CoinKeeper) AddCoins added in v0.2.0

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) SubtractCoins added in v0.2.0

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) String added in v0.2.0

func (in Input) String() string

func (Input) ValidateBasic added in v0.2.0

func (in Input) ValidateBasic() sdk.Error

ValidateBasic - validate transaction input

type IssueMsg added in v0.2.0

type IssueMsg struct {
	Banker  sdk.Address `json:"banker"`
	Outputs []Output    `json:"outputs"`
}

IssueMsg - high level transaction of the coin module

func NewIssueMsg added in v0.2.0

func NewIssueMsg(banker sdk.Address, out []Output) IssueMsg

NewIssueMsg - construct arbitrary multi-in, multi-out send msg.

func (IssueMsg) Get added in v0.2.0

func (msg IssueMsg) Get(key interface{}) (value interface{})

Implements Msg.

func (IssueMsg) GetSignBytes added in v0.2.0

func (msg IssueMsg) GetSignBytes() []byte

Implements Msg.

func (IssueMsg) GetSigners added in v0.2.0

func (msg IssueMsg) GetSigners() []sdk.Address

Implements Msg.

func (IssueMsg) String added in v0.2.0

func (msg IssueMsg) String() string

func (IssueMsg) Type added in v0.2.0

func (msg IssueMsg) Type() string

Implements Msg.

func (IssueMsg) ValidateBasic added in v0.2.0

func (msg IssueMsg) ValidateBasic() sdk.Error

Implements 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) String added in v0.2.0

func (out Output) String() string

func (Output) ValidateBasic added in v0.2.0

func (out Output) ValidateBasic() sdk.Error

ValidateBasic - validate transaction output

type SendMsg added in v0.2.0

type SendMsg struct {
	Inputs  []Input  `json:"inputs"`
	Outputs []Output `json:"outputs"`
}

SendMsg - high level transaction of the coin module

func NewSendMsg added in v0.2.0

func NewSendMsg(in []Input, out []Output) SendMsg

NewSendMsg - construct arbitrary multi-in, multi-out send msg.

func (SendMsg) Get added in v0.2.0

func (msg SendMsg) Get(key interface{}) (value interface{})

Implements Msg.

func (SendMsg) GetSignBytes added in v0.2.0

func (msg SendMsg) GetSignBytes() []byte

Implements Msg.

func (SendMsg) GetSigners added in v0.2.0

func (msg SendMsg) GetSigners() []sdk.Address

Implements Msg.

func (SendMsg) String added in v0.2.0

func (msg SendMsg) String() string

func (SendMsg) Type added in v0.2.0

func (msg SendMsg) Type() string

Implements Msg.

func (SendMsg) ValidateBasic added in v0.2.0

func (msg SendMsg) ValidateBasic() sdk.Error

Implements Msg.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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