types

package
v0.0.0-...-962cb54 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 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
	CodeInvalidTokenSymbol              sdk.CodeType = 314
)
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

func ErrInsufficientCETForActivatingFee() sdk.Error

func ErrInvalidActivatingFee

func ErrInvalidActivatingFee() sdk.Error

func ErrInvalidLockCoinsFee

func ErrInvalidLockCoinsFee() sdk.Error

func ErrInvalidLockCoinsFreeTime

func ErrInvalidLockCoinsFreeTime() sdk.Error

func ErrInvalidOperation

func ErrInvalidOperation() sdk.Error

func ErrInvalidTokenSymbol

func ErrInvalidTokenSymbol(symbol string) sdk.Error

func ErrLockedCoinNotFound

func ErrLockedCoinNotFound() sdk.Error

func ErrMemoMissing

func ErrMemoMissing() sdk.Error

func ErrNoInputs

func ErrNoInputs() sdk.Error

func ErrNoOutputs

func ErrNoOutputs() sdk.Error

func ErrRewardExceedsAmount

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 {
	IsForbiddenByTokenIssuer(ctx sdk.Context, symbol string, addr sdk.AccAddress) bool
	IsTokenExists(ctx sdk.Context, symbol string) bool
	UpdateTokenSendLock(ctx sdk.Context, symbol string, amount sdk.Int, lock bool) sdk.Error
}

type LockedSendMsg

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

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

func NewSupervisedSendMsg

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

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

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

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

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

func (msg MsgSupervisedSend) GetSignBytes() []byte

GetSignBytes Implements Msg.

func (MsgSupervisedSend) GetSigners

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

GetSigners Implements Msg.

func (MsgSupervisedSend) Route

func (msg MsgSupervisedSend) Route() string

Route Implements Msg

func (*MsgSupervisedSend) SetAccAddress

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

func (MsgSupervisedSend) Type

func (msg MsgSupervisedSend) Type() string

Type Implements Msg

func (MsgSupervisedSend) ValidateBasic

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

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

func (*Params) ParamSetPairs

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

func (Params) String

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