Documentation
¶
Index ¶
- Constants
- func ParseAccount(acc Account) error
- func ParseAsset(ass Asset) error
- func ParseMonetary(mon Monetary) error
- func ValidatePortionSpecific(p Portion) error
- func ValueEquals(lhs, rhs Value) bool
- type Account
- type Address
- type Allotment
- type Asset
- type Funding
- func (f Funding) Concat(other Funding) (Funding, error)
- func (lhs Funding) Equals(rhs Funding) bool
- func (f Funding) GetAsset() Asset
- func (Funding) GetType() Type
- func (f Funding) Reverse() Funding
- func (f Funding) String() string
- func (f Funding) Take(amount *MonetaryInt) (Funding, Funding, error)
- func (f Funding) TakeMax(amount *MonetaryInt) (Funding, Funding)
- func (f Funding) Total() *MonetaryInt
- type FundingPart
- type HasAsset
- type Monetary
- type MonetaryInt
- func (a *MonetaryInt) Add(b *MonetaryInt) *MonetaryInt
- func (a *MonetaryInt) Cmp(b *MonetaryInt) int
- func (a *MonetaryInt) Eq(b *MonetaryInt) bool
- func (a *MonetaryInt) Equal(b *MonetaryInt) bool
- func (MonetaryInt) GetType() Type
- func (a *MonetaryInt) Gt(b *MonetaryInt) bool
- func (a *MonetaryInt) Gte(b *MonetaryInt) bool
- func (a *MonetaryInt) Lt(b *MonetaryInt) bool
- func (a *MonetaryInt) Lte(b *MonetaryInt) bool
- func (a *MonetaryInt) Ltz() bool
- func (a *MonetaryInt) MarshalJSON() ([]byte, error)
- func (a *MonetaryInt) MarshalText() ([]byte, error)
- func (a *MonetaryInt) Neg() *MonetaryInt
- func (a *MonetaryInt) OrZero() *MonetaryInt
- func (a *MonetaryInt) String() string
- func (a *MonetaryInt) Sub(b *MonetaryInt) *MonetaryInt
- func (a *MonetaryInt) Uint64() uint64
- func (a *MonetaryInt) UnmarshalJSON(b []byte) error
- func (a *MonetaryInt) UnmarshalText(b []byte) error
- type Number
- type Portion
- type String
- type Type
- type Value
- type ValueJSON
Constants ¶
View Source
const ( TypeAccount = Type(iota + 1) // address of an account TypeAsset // name of an asset TypeNumber // 64bit unsigned integer TypeString // string TypeMonetary // [asset number] TypePortion // rational number between 0 and 1 both exclusive TypeAllotment // list of portions TypeAmount // either ALL or a SPECIFIC number TypeFunding // (asset, []{amount, account}) )
Variables ¶
This section is empty.
Functions ¶
func ParseAccount ¶ added in v1.4.1
func ParseAsset ¶ added in v1.4.1
func ParseMonetary ¶ added in v1.4.1
func ValidatePortionSpecific ¶ added in v1.4.1
func ValueEquals ¶
Types ¶
type Address ¶
type Address uint16
Address represents an address in the machine's resources, which include constants (literals) and variables passed to the program
func NewAddress ¶
type Allotment ¶
func NewAllotment ¶
func (Allotment) Allocate ¶
func (a Allotment) Allocate(amount *MonetaryInt) []*MonetaryInt
type Funding ¶
type Funding struct {
Asset Asset
Parts []FundingPart
}
func (Funding) Total ¶
func (f Funding) Total() *MonetaryInt
type FundingPart ¶
type FundingPart struct {
Amount *MonetaryInt
Account Account
}
func (FundingPart) Equals ¶
func (lhs FundingPart) Equals(rhs FundingPart) bool
type Monetary ¶
type Monetary struct {
Asset Asset `json:"asset"`
Amount *MonetaryInt `json:"amount"`
}
type MonetaryInt ¶
func NewMonetaryInt ¶
func NewMonetaryInt(i int64) *MonetaryInt
func ParseMonetaryInt ¶
func ParseMonetaryInt(s string) (*MonetaryInt, error)
func (*MonetaryInt) Add ¶
func (a *MonetaryInt) Add(b *MonetaryInt) *MonetaryInt
func (*MonetaryInt) Cmp ¶
func (a *MonetaryInt) Cmp(b *MonetaryInt) int
func (*MonetaryInt) Eq ¶
func (a *MonetaryInt) Eq(b *MonetaryInt) bool
func (*MonetaryInt) Equal ¶
func (a *MonetaryInt) Equal(b *MonetaryInt) bool
func (MonetaryInt) GetType ¶
func (MonetaryInt) GetType() Type
func (*MonetaryInt) Gt ¶
func (a *MonetaryInt) Gt(b *MonetaryInt) bool
func (*MonetaryInt) Gte ¶
func (a *MonetaryInt) Gte(b *MonetaryInt) bool
func (*MonetaryInt) Lt ¶
func (a *MonetaryInt) Lt(b *MonetaryInt) bool
func (*MonetaryInt) Lte ¶
func (a *MonetaryInt) Lte(b *MonetaryInt) bool
func (*MonetaryInt) Ltz ¶
func (a *MonetaryInt) Ltz() bool
func (*MonetaryInt) MarshalJSON ¶
func (a *MonetaryInt) MarshalJSON() ([]byte, error)
func (*MonetaryInt) MarshalText ¶
func (a *MonetaryInt) MarshalText() ([]byte, error)
func (*MonetaryInt) Neg ¶
func (a *MonetaryInt) Neg() *MonetaryInt
func (*MonetaryInt) OrZero ¶
func (a *MonetaryInt) OrZero() *MonetaryInt
func (*MonetaryInt) String ¶
func (a *MonetaryInt) String() string
func (*MonetaryInt) Sub ¶
func (a *MonetaryInt) Sub(b *MonetaryInt) *MonetaryInt
func (*MonetaryInt) Uint64 ¶
func (a *MonetaryInt) Uint64() uint64
func (*MonetaryInt) UnmarshalJSON ¶
func (a *MonetaryInt) UnmarshalJSON(b []byte) error
func (*MonetaryInt) UnmarshalText ¶
func (a *MonetaryInt) UnmarshalText(b []byte) error
type Portion ¶
func NewPortionRemaining ¶
func NewPortionRemaining() Portion
func ParsePortionSpecific ¶
type Value ¶
type Value interface {
GetType() Type
}
func NewValueFromJSON ¶
func NewValueFromJSON(typ Type, data json.RawMessage) (*Value, error)
func NewValueFromTypedJSON ¶
func NewValueFromTypedJSON(rawInput json.RawMessage) (*Value, error)
type ValueJSON ¶
type ValueJSON struct {
Type string `json:"type"`
Value json.RawMessage `json:"value"`
}
Click to show internal directories.
Click to hide internal directories.