types

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeTransfer = "transfer"

	AttributeKeyRecipient = "recipient"
	AttributeKeySender    = "sender"

	AttributeValueCategory = ModuleName
)

bank module event types

View Source
const (
	// module name
	ModuleName   = "bank"
	QuerierRoute = ModuleName
)
View Source
const (
	// DefaultParamspace for params keeper
	DefaultParamspace = ModuleName
	// DefaultSendEnabled enabled
	DefaultSendEnabled = true
)
View Source
const RouterKey = ModuleName

RouterKey is they name of the bank module

Variables

View Source
var (
	ErrNoInputs            = sdkerrors.Register(ModuleName, 1, "no inputs to send transaction")
	ErrNoOutputs           = sdkerrors.Register(ModuleName, 2, "no outputs to send transaction")
	ErrInputOutputMismatch = sdkerrors.Register(ModuleName, 3, "sum inputs != sum outputs")
	ErrSendDisabled        = sdkerrors.Register(ModuleName, 4, "send transactions are disabled")
)

x/bank module sentinel errors

View Source
var ModuleCdc *codec.Codec
View Source
var ParamStoreKeySendEnabled = []byte("sendenabled")

ParamStoreKeySendEnabled is store's key for SendEnabled

Functions

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable type declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register 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.

func ValidateInputsOutputs

func ValidateInputsOutputs(inputs []Input, outputs []Output) error

ValidateInputsOutputs validates that each respective input and output is valid and that the sum of inputs is equal to the sum of outputs.

Types

type AccountKeeper

type AccountKeeper interface {
	NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) exported.Account

	GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account
	GetAllAccounts(ctx sdk.Context) []exported.Account
	SetAccount(ctx sdk.Context, acc exported.Account)

	IterateAccounts(ctx sdk.Context, process func(exported.Account) bool)
}

AccountKeeper defines the account contract that must be fulfilled when creating a x/bank keeper.

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 sdk.AccAddress `json:"address" yaml:"address"`
	Coins   sdk.Coins      `json:"coins" yaml:"coins"`
}

Input models transaction input

func NewInput

func NewInput(addr sdk.AccAddress, coins sdk.Coins) Input

NewInput - create a transaction input, used with MsgMultiSend

func (Input) ValidateBasic

func (in Input) ValidateBasic() error

ValidateBasic - validate transaction input

type MsgMultiSend

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

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) Route

func (msg MsgMultiSend) Route() string

Route Implements Msg

func (MsgMultiSend) Type

func (msg MsgMultiSend) Type() string

Type Implements Msg

func (MsgMultiSend) ValidateBasic

func (msg MsgMultiSend) ValidateBasic() error

ValidateBasic Implements Msg.

type MsgSend

type MsgSend struct {
	FromAddress sdk.AccAddress `json:"from_address" yaml:"from_address"`
	ToAddress   sdk.AccAddress `json:"to_address" yaml:"to_address"`
	Amount      sdk.Coins      `json:"amount" yaml:"amount"`
}

MsgSend - high level transaction of the coin module

func NewMsgSend

func NewMsgSend(fromAddr, toAddr sdk.AccAddress, amount sdk.Coins) MsgSend

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

func (MsgSend) GetSignBytes

func (msg MsgSend) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgSend) GetSigners

func (msg MsgSend) GetSigners() []sdk.AccAddress

GetSigners Implements Msg.

func (MsgSend) Route

func (msg MsgSend) Route() string

Route Implements Msg.

func (MsgSend) Type

func (msg MsgSend) Type() string

Type Implements Msg.

func (MsgSend) ValidateBasic

func (msg MsgSend) ValidateBasic() error

ValidateBasic Implements Msg.

type Output

type Output struct {
	Address sdk.AccAddress `json:"address" yaml:"address"`
	Coins   sdk.Coins      `json:"coins" yaml:"coins"`
}

Output models transaction outputs

func NewOutput

func NewOutput(addr sdk.AccAddress, coins sdk.Coins) Output

NewOutput - create a transaction output, used with MsgMultiSend

func (Output) ValidateBasic

func (out Output) ValidateBasic() error

ValidateBasic - validate transaction output

type QueryBalanceParams

type QueryBalanceParams struct {
	Address sdk.AccAddress
}

QueryBalanceParams defines the params for querying an account balance.

func NewQueryBalanceParams

func NewQueryBalanceParams(addr sdk.AccAddress) QueryBalanceParams

NewQueryBalanceParams creates a new instance of QueryBalanceParams.

Jump to

Keyboard shortcuts

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