types

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2019 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeSpaceBankx sdk.CodespaceType = ModuleName

	// 301 ~ 399
	CodeMemoMissing                     sdk.CodeType = 301
	CodeInsufficientCETForActivationFee sdk.CodeType = 302
	CodeInvalidActivationFee            sdk.CodeType = 303
	CodeInvalidUnlockTime               sdk.CodeType = 304
	CodeTokenForbiddenByOwner           sdk.CodeType = 305
	CodeInvalidLockCoinsFee             sdk.CodeType = 306
	CodeNoInputs                        sdk.CodeType = 307
	CodeNoOutputs                       sdk.CodeType = 308
	CodeInputOutputMismatch             sdk.CodeType = 309
	CodeInvalidLockCoinsFreeTime        sdk.CodeType = 310
	CodeInvalidOperation                sdk.CodeType = 311
	CodeRewardExceedsAmount             sdk.CodeType = 312
	CodeLockedCoinNotFound              sdk.CodeType = 313
)
View Source
const (
	EventTypeTransfer = "transfer"

	AttributeKeyRecipient = "recipient"
	AttributeKeySender    = "sender"
	AttributeKeyAmount    = "amount"

	AttributeValueCategory = ModuleName
)
View Source
const (
	ModuleName        = "bankx"
	StoreKey          = ModuleName
	DefaultParamspace = ModuleName
	RouterKey         = ModuleName

	AttributeKeyAddr         = "address"
	AttributeKeyMemoRequired = "memo-required"

	Topic = ModuleName
)
View Source
const (
	Create                    byte = 0
	Return                    byte = 1
	EarlierUnlockBySender     byte = 2
	EarlierUnlockBySupervisor byte = 3
)

Variables

View Source
var (
	KeyActivationFee      = []byte("ActivationFee")
	KeyLockCoinsFreeTime  = []byte("LockCoinsFreeTime")
	KeyLockCoinsFeePerDay = []byte("LockCoinsFeePerDay")
)
View Source
var ModuleCdc = codec.New()

Functions

func ErrInputOutputMismatch

func ErrInputOutputMismatch(msg string) sdk.Error

func ErrInsufficientCETForActivatingFee added in v0.0.19

func ErrInsufficientCETForActivatingFee() sdk.Error

func ErrInvalidActivatingFee added in v0.0.19

func ErrInvalidActivatingFee() sdk.Error

func ErrInvalidLockCoinsFee added in v0.0.19

func ErrInvalidLockCoinsFee() sdk.Error

func ErrInvalidLockCoinsFreeTime added in v0.0.19

func ErrInvalidLockCoinsFreeTime() sdk.Error

func ErrInvalidOperation added in v0.0.19

func ErrInvalidOperation() sdk.Error

func ErrLockedCoinNotFound added in v0.0.19

func ErrLockedCoinNotFound() sdk.Error

func ErrMemoMissing

func ErrMemoMissing() sdk.Error

func ErrNoInputs

func ErrNoInputs() sdk.Error

func ErrNoOutputs

func ErrNoOutputs() sdk.Error

func ErrRewardExceedsAmount added in v0.0.19

func ErrRewardExceedsAmount() sdk.Error

func ErrTokenForbiddenByOwner

func ErrTokenForbiddenByOwner() sdk.Error

func ErrUnlockTime

func ErrUnlockTime(msg string) sdk.Error

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable type declaration for parameters

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the codec

func ValidateInputsOutputs

func ValidateInputsOutputs(inputs []bank.Input, outputs []bank.Output) sdk.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 ExpectedAccountXKeeper

type ExpectedAccountXKeeper interface {
	GetOrCreateAccountX(ctx sdk.Context, addr sdk.AccAddress) authx.AccountX
	GetAccountX(ctx sdk.Context, addr sdk.AccAddress) (ax authx.AccountX, ok bool)
	SetAccountX(ctx sdk.Context, ax authx.AccountX)
	IterateAccounts(ctx sdk.Context, process func(authx.AccountX) (stop bool))
	InsertUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)
	RemoveFromUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)
}

type ExpectedAssetStatusKeeper

type ExpectedAssetStatusKeeper interface {
	IsTokenForbidden(ctx sdk.Context, symbol string) bool
	IsForbiddenByTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool
	UpdateTokenSendLock(ctx sdk.Context, symbol string, amount sdk.Int, lock bool) sdk.Error
}

type LockedSendMsg added in v0.0.18

type LockedSendMsg struct {
	FromAddress sdk.AccAddress `json:"from_address"`
	ToAddress   sdk.AccAddress `json:"to_address"`
	Amount      sdk.Coins      `json:"amount"`
	UnlockTime  int64          `json:"unlock_time"`
	Supervisor  sdk.AccAddress `json:"supervisor,omitempty"`
	Reward      int64          `json:"reward,omitempty"`
}

func NewLockedSendMsg added in v0.0.18

func NewLockedSendMsg(fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amount sdk.Coins, unlockTime int64) LockedSendMsg

func NewSupervisedSendMsg added in v0.0.18

func NewSupervisedSendMsg(fromAddr, toAddr, supervisor sdk.AccAddress, amount sdk.Coin, unlockTime int64, reward int64) LockedSendMsg

type MsgMultiSend

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

MsgMultiSend - high level transaction of the coin module

func NewMsgMultiSend

func NewMsgMultiSend(in []bank.Input, out []bank.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() sdk.Error

ValidateBasic Implements Msg.

type MsgSend

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

func NewMsgSend

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

func (MsgSend) GetSignBytes

func (msg MsgSend) GetSignBytes() []byte

func (MsgSend) GetSigners

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

func (MsgSend) Route

func (msg MsgSend) Route() string

func (*MsgSend) SetAccAddress added in v0.0.15

func (msg *MsgSend) SetAccAddress(addr sdk.AccAddress)

func (MsgSend) Type

func (msg MsgSend) Type() string

func (MsgSend) ValidateBasic

func (msg MsgSend) ValidateBasic() sdk.Error

type MsgSetMemoRequired

type MsgSetMemoRequired struct {
	Address  sdk.AccAddress `json:"address"`
	Required bool           `json:"required"`
}

func NewMsgSetTransferMemoRequired

func NewMsgSetTransferMemoRequired(addr sdk.AccAddress, required bool) MsgSetMemoRequired

func (MsgSetMemoRequired) GetSignBytes

func (msg MsgSetMemoRequired) GetSignBytes() []byte

func (MsgSetMemoRequired) GetSigners

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

func (MsgSetMemoRequired) Route

func (msg MsgSetMemoRequired) Route() string

func (*MsgSetMemoRequired) SetAccAddress added in v0.0.15

func (msg *MsgSetMemoRequired) SetAccAddress(addr sdk.AccAddress)

func (MsgSetMemoRequired) Type

func (msg MsgSetMemoRequired) Type() string

func (MsgSetMemoRequired) ValidateBasic

func (msg MsgSetMemoRequired) ValidateBasic() sdk.Error

type MsgSupervisedSend added in v0.0.18

type MsgSupervisedSend struct {
	FromAddress sdk.AccAddress `json:"from_address"`
	Supervisor  sdk.AccAddress `json:"supervisor,omitempty"`
	ToAddress   sdk.AccAddress `json:"to_address"`
	Amount      sdk.Coin       `json:"amount"`
	UnlockTime  int64          `json:"unlock_time"`
	Reward      int64          `json:"reward"`
	Operation   byte           `json:"operation"`
}

MsgSupervisedSend

func NewMsgSupervisedSend added in v0.0.18

func NewMsgSupervisedSend(fromAddress sdk.AccAddress, supervisor sdk.AccAddress, toAddress sdk.AccAddress, amount sdk.Coin,
	unlockTime int64, reward int64, operation byte) MsgSupervisedSend

NewMsgSupervisedSend

func (MsgSupervisedSend) GetSignBytes added in v0.0.18

func (msg MsgSupervisedSend) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgSupervisedSend) GetSigners added in v0.0.18

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

GetSigners Implements Msg.

func (MsgSupervisedSend) Route added in v0.0.18

func (msg MsgSupervisedSend) Route() string

Route Implements Msg

func (*MsgSupervisedSend) SetAccAddress added in v0.0.18

func (msg *MsgSupervisedSend) SetAccAddress(addr sdk.AccAddress)

func (MsgSupervisedSend) Type added in v0.0.18

func (msg MsgSupervisedSend) Type() string

Type Implements Msg

func (MsgSupervisedSend) ValidateBasic added in v0.0.18

func (msg MsgSupervisedSend) ValidateBasic() sdk.Error

ValidateBasic Implements Msg.

type Params

type Params struct {
	ActivationFee      int64 `json:"activation_fee"`
	LockCoinsFreeTime  int64 `json:"lock_coins_free_time"`
	LockCoinsFeePerDay int64 `json:"lock_coins_fee_per_day"`
}

func DefaultParams

func DefaultParams() Params

func NewParams added in v0.0.15

func NewParams(activation int64, freeTime, lock int64) Params

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

func (Params) String added in v0.0.13

func (p Params) String() string

type SupplyKeeper

type SupplyKeeper interface {
	SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
}

SupplyKeeper defines the expected supply keeper

Jump to

Keyboard shortcuts

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