Documentation ¶
Index ¶
- func ArrayReverse(b []byte) []byte
- type Fixed8
- func (f Fixed8) Add(g Fixed8) Fixed8
- func (f Fixed8) CompareTo(g Fixed8) int
- func (f Fixed8) Div(i int64) Fixed8
- func (f Fixed8) Equal(g Fixed8) bool
- func (f Fixed8) FloatValue() float64
- func (f Fixed8) GreaterThan(g Fixed8) bool
- func (f Fixed8) Int64Value() int64
- func (f Fixed8) LessThan(g Fixed8) bool
- func (f Fixed8) MarshalJSON() ([]byte, error)
- func (f Fixed8) String() string
- func (f Fixed8) Sub(g Fixed8) Fixed8
- func (f *Fixed8) UnmarshalJSON(data []byte) error
- type Uint160
- type Uint256
- func (u Uint256) Bytes() []byte
- func (u Uint256) BytesReverse() []byte
- func (u Uint256) CompareTo(other Uint256) int
- func (u Uint256) Equals(other Uint256) bool
- func (u Uint256) MarshalJSON() ([]byte, error)
- func (u Uint256) Reverse() Uint256
- func (u Uint256) ReverseString() string
- func (u Uint256) String() string
- func (u *Uint256) UnmarshalJSON(data []byte) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArrayReverse ¶
ArrayReverse return a reversed version of the given byte slice.
Types ¶
type Fixed8 ¶
type Fixed8 int64
Fixed8 represents a fixed-point number with precision 10^-8.
func Fixed8FromFloat ¶
Fixed8FromFloat returns a new Fixed8 type multiplied by decimals.
func Fixed8FromInt64 ¶
Fixed8FromInt64 returns a new Fixed8 type multiplied by decimals.
func Fixed8FromString ¶
Fixed8FromString parses s which must be a fixed point number with precision up to 10^-8
func (Fixed8) CompareTo ¶
CompareTo returns the difference between the f and g. difference < 0 implies f < g. difference = 0 implies f = g. difference > 0 implies f > g.
func (Fixed8) FloatValue ¶
FloatValue returns the original value representing Fixed8 as float64.
func (Fixed8) GreaterThan ¶
GreaterThan implements Fixd8 < operator.
func (Fixed8) Int64Value ¶
Int64Value returns the original value representing Fixed8 as int64.
func (Fixed8) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (*Fixed8) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type Uint160 ¶
type Uint160 [uint160Size]uint8
Uint160 is a 20 byte long unsigned integer.
func Uint160DecodeBytes ¶
Uint160DecodeBytes attempts to decode the given bytes into an Uint160.
func Uint160DecodeString ¶
Uint160DecodeString attempts to decode the given string into an Uint160.
func (Uint160) BytesReverse ¶
BytesReverse return a reversed byte representation of u.
func (Uint160) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (Uint160) ReverseString ¶
ReverseString is the same as String, but returnes an inversed representation.
func (*Uint160) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type Uint256 ¶
type Uint256 [uint256Size]uint8
Uint256 is a 32 byte long unsigned integer.
func Uint256DecodeBytes ¶
Uint256DecodeBytes attempts to decode the given string (in BE representation) into an Uint256.
func Uint256DecodeReverseBytes ¶
Uint256DecodeReverseBytes attempts to decode the given string (in LE representation) into an Uint256.
func Uint256DecodeReverseString ¶
Uint256DecodeReverseString attempts to decode the given string (in LE representation) into an Uint256.
func (Uint256) BytesReverse ¶
BytesReverse return a reversed byte representation of u.
func (Uint256) CompareTo ¶
CompareTo compares two Uint256 with each other. Possible output: 1, -1, 0
1 implies u > other.
-1 implies u < other.
0 implies u = other.
func (Uint256) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (Uint256) ReverseString ¶
ReverseString produces string representation of Uint256 with LE byte order.
func (*Uint256) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.