Documentation ¶
Index ¶
- Variables
- type HumanAmount
- type RawAmount
- func (a *RawAmount) Add(b *RawAmount) *RawAmount
- func (a *RawAmount) Compare(b *RawAmount) int
- func (a *RawAmount) Divide(b *RawAmount) *RawAmount
- func (a *RawAmount) IsValid() bool
- func (d *RawAmount) MarshalJSON() ([]byte, error)
- func (a *RawAmount) Multiply(b *RawAmount) *RawAmount
- func (a *RawAmount) Subtract(b *RawAmount) *RawAmount
- func (a *RawAmount) ToBytes() []byte
- func (a *RawAmount) ToHex() string
- func (a *RawAmount) ToString() string
- func (d *RawAmount) UnmarshalJSON(data []byte) (err error)
- type UnitBase
Constants ¶
This section is empty.
Variables ¶
View Source
var INT128_LIMIT = new(big.Int).SetBytes([]byte{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff})
Functions ¶
This section is empty.
Types ¶
type HumanAmount ¶
type HumanAmount struct {
// contains filtered or unexported fields
}
func NewHumanFromRaw ¶
func NewHumanFromRaw(n *RawAmount) *HumanAmount
func NewHumanFromString ¶
func NewHumanFromString(n string, base UnitBase) *HumanAmount
func (*HumanAmount) ConvertToBase ¶
func (n *HumanAmount) ConvertToBase(base UnitBase, scale int) (string, error)
func (*HumanAmount) ConvertToRawAmount ¶
func (n *HumanAmount) ConvertToRawAmount() (*RawAmount, error)
type RawAmount ¶
type RawAmount struct {
// contains filtered or unexported fields
}
func NewRawFromBytes ¶
NewRawFromBytes creates an RawAmount from byte-array. It returns an non-nil error if the string is invalid and nil successful.
func NewRawFromHex ¶
NewRawFromHex creates an RawAmount from hexadecimal string. It returns an non-nil error if the value is invalid.
func NewRawFromString ¶
NewRawFromString creates an RawAmount from numeric string. It returns an error if the string is invalid and nil successful.
func (*RawAmount) MarshalJSON ¶
func (*RawAmount) ToBytes ¶
ToBytes transforms the RawAmount to 16 byte, left zero-padded. It can be used in block signature and in RPC.
func (*RawAmount) ToHex ¶
ToPaddedHex transforms the RawAmount to hexadecimal string with 16 byte, left zero-padded. It can be used in RPC.
func (*RawAmount) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.