types

package
v1.0.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OneAMOUint64 = 1000000000000000000 // in decimal

)
View Source
const ParcelAminoName = "amo/ParcelValue"
View Source
const RequestAminoName = "amo/RequestValue"
View Source
const UsageAminoName = "amo/UsageValue"

Variables

This section is empty.

Functions

This section is empty.

Types

type Currency

type Currency struct {
	big.Int
}

Currency uses big endian for compatibility to big.Int

func (*Currency) Add

func (c *Currency) Add(a *Currency) *Currency

func (Currency) Equals

func (c Currency) Equals(a *Currency) bool

func (Currency) GreaterThan

func (c Currency) GreaterThan(a *Currency) bool

func (Currency) LessThan

func (c Currency) LessThan(a *Currency) bool

func (Currency) MarshalJSON

func (c Currency) MarshalJSON() ([]byte, error)

func (*Currency) Set

func (c *Currency) Set(x uint64) *Currency

func (*Currency) SetAMO

func (c *Currency) SetAMO(x float64) *Currency

func (*Currency) SetString

func (c *Currency) SetString(x string, base int) (*Currency, error)

func (Currency) String

func (c Currency) String() string

func (*Currency) Sub

func (c *Currency) Sub(a *Currency) *Currency

func (*Currency) UnmarshalJSON

func (c *Currency) UnmarshalJSON(data []byte) error

type Delegate

type Delegate struct {
	Holder    crypto.Address
	Amount    Currency       `json:"amount"`
	Delegator crypto.Address `json:"delegator"`
}

type ParcelValue

type ParcelValue struct {
	Owner   crypto.Address `json:"owner"`
	Custody cmn.HexBytes   `json:"custody"`
	Info    cmn.HexBytes   `json:"info,omitempty"`
}

func (*ParcelValue) Deserialize

func (value *ParcelValue) Deserialize(data []byte) error

func (ParcelValue) Serialize

func (value ParcelValue) Serialize() ([]byte, error)

type RequestValue

type RequestValue struct {
	Payment Currency  `json:"payment"`
	Exp     time.Time `json:"exp"`
}

func (*RequestValue) Deserialize

func (value *RequestValue) Deserialize(data []byte) error

func (RequestValue) IsExpired

func (value RequestValue) IsExpired() bool

func (RequestValue) Serialize

func (value RequestValue) Serialize() ([]byte, error)

type Stake

type Stake struct {
	Amount    Currency              `json:"amount"`
	Validator ed25519.PubKeyEd25519 `json:"validator"`
}

type UsageValue

type UsageValue struct {
	Custody cmn.HexBytes `json:"custody"`
	Exp     time.Time    `json:"exp"`
}

func (*UsageValue) Deserialize

func (value *UsageValue) Deserialize(data []byte) error

func (UsageValue) IsExpired

func (value UsageValue) IsExpired() bool

func (UsageValue) Serialize

func (value UsageValue) Serialize() ([]byte, error)

Jump to

Keyboard shortcuts

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