account

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoQOSAccount

func ProtoQOSAccount() account.Account

func RegisterCodec

func RegisterCodec(cdc *go_amino.Codec)

为包内定义结构注册codec

Types

type QOSAccount

type QOSAccount struct {
	account.BaseAccount `json:"base_account"` // inherits BaseAccount
	QOS                 btypes.BigInt         `json:"qos"`  // coins in public chain
	QSCs                types.QSCs            `json:"qscs"` // varied QSCs
}

func NewQOSAccount added in v0.0.2

func NewQOSAccount(addr btypes.Address, qos btypes.BigInt, qscs types.QSCs) *QOSAccount

func NewQOSAccountWithAddress added in v0.0.3

func NewQOSAccountWithAddress(addr btypes.Address) *QOSAccount

func NewQOSAccountZero added in v0.0.3

func NewQOSAccountZero() *QOSAccount

func ParseAccounts added in v0.0.3

func ParseAccounts(str string) ([]*QOSAccount, error)

Parse accounts from string address16lwp3kykkjdc2gdknpjy6u9uhfpa9q4vj78ytd,1000000qos,1000000qstars. Multiple accounts separated by ';'

func (*QOSAccount) EnoughOf added in v0.0.3

func (account *QOSAccount) EnoughOf(qos btypes.BigInt, qscs types.QSCs) bool

func (*QOSAccount) EnoughOfQOS added in v0.0.3

func (account *QOSAccount) EnoughOfQOS(qos btypes.BigInt) bool

是否有足够QOS

func (*QOSAccount) EnoughOfQSC added in v0.0.3

func (account *QOSAccount) EnoughOfQSC(qsc types.QSC) bool

是否有足够QSC

func (*QOSAccount) EnoughOfQSCs added in v0.0.3

func (account *QOSAccount) EnoughOfQSCs(qscs types.QSCs) bool

是否有足够QSCs

func (*QOSAccount) GetQOS

func (account *QOSAccount) GetQOS() btypes.BigInt

func (*QOSAccount) GetQSC

func (account *QOSAccount) GetQSC(qscName string) (qsc types.QSC, exists bool)

返回指定币种币值

func (*QOSAccount) GetQSCs added in v0.0.3

func (account *QOSAccount) GetQSCs() types.QSCs

func (*QOSAccount) Minus added in v0.0.3

func (account *QOSAccount) Minus(qos btypes.BigInt, qscs types.QSCs) error

减少QOS,QSCs

func (*QOSAccount) MinusQOS added in v0.0.3

func (account *QOSAccount) MinusQOS(qos btypes.BigInt) error

减少QOS,减少量小于0或结果小于0时返回错误

func (*QOSAccount) MinusQSC added in v0.0.3

func (account *QOSAccount) MinusQSC(qsc types.QSC) error

减少QSC

func (*QOSAccount) MinusQSCs added in v0.0.3

func (account *QOSAccount) MinusQSCs(qscs types.QSCs) error

减少QSCs

func (*QOSAccount) MustMinus added in v0.0.3

func (account *QOSAccount) MustMinus(qos btypes.BigInt, qscs types.QSCs)

func (*QOSAccount) MustMinusQOS added in v0.0.3

func (account *QOSAccount) MustMinusQOS(qos btypes.BigInt)

减少QOS,返回错误panic

func (*QOSAccount) MustMinusQSC added in v0.0.3

func (account *QOSAccount) MustMinusQSC(qsc types.QSC)

func (*QOSAccount) MustMinusQSCs added in v0.0.3

func (account *QOSAccount) MustMinusQSCs(qscs types.QSCs)

func (*QOSAccount) MustPlus added in v0.0.3

func (account *QOSAccount) MustPlus(qos btypes.BigInt, qscs types.QSCs)

func (*QOSAccount) MustPlusQOS added in v0.0.3

func (account *QOSAccount) MustPlusQOS(qos btypes.BigInt)

增加QOS,返回错误时panic

func (*QOSAccount) MustPlusQSC added in v0.0.3

func (account *QOSAccount) MustPlusQSC(qsc types.QSC)

func (*QOSAccount) MustPlusQSCs added in v0.0.3

func (account *QOSAccount) MustPlusQSCs(qscs types.QSCs)

func (*QOSAccount) Plus added in v0.0.3

func (account *QOSAccount) Plus(qos btypes.BigInt, qscs types.QSCs) error

增加QOS,QSCs

func (*QOSAccount) PlusQOS added in v0.0.3

func (account *QOSAccount) PlusQOS(qos btypes.BigInt) error

增加QOS,增加量小于0时返回错误

func (*QOSAccount) PlusQSC added in v0.0.3

func (account *QOSAccount) PlusQSC(qsc types.QSC) error

增加QSC

func (*QOSAccount) PlusQSCs added in v0.0.3

func (account *QOSAccount) PlusQSCs(qscs types.QSCs) error

增加QSCs

func (*QOSAccount) RemoveQSC added in v0.0.3

func (account *QOSAccount) RemoveQSC(qscName string)

移除QSC

func (*QOSAccount) SetQOS

func (account *QOSAccount) SetQOS(qos btypes.BigInt) error

设置QOS,币值必须大于等于0

func (*QOSAccount) SetQSC

func (account *QOSAccount) SetQSC(qsc types.QSC) error

设置币种币值

Jump to

Keyboard shortcuts

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