Documentation ¶
Index ¶
- Constants
- func ArrayReverse(b []byte) []byte
- func FixedNFromString(s string, precision int) (int64, error)
- type Fixed8
- func (f Fixed8) Add(g Fixed8) Fixed8
- func (f Fixed8) CompareTo(g Fixed8) int
- func (f *Fixed8) DecodeBinary(r *io.BinReader)
- func (f Fixed8) Div(i int64) Fixed8
- func (f *Fixed8) EncodeBinary(w *io.BinWriter)
- func (f Fixed8) Equal(g Fixed8) bool
- func (f Fixed8) FloatValue() float64
- func (f Fixed8) FractionalValue() int32
- func (f Fixed8) GreaterThan(g Fixed8) bool
- func (f Fixed8) IntegralValue() int64
- func (f Fixed8) LessThan(g Fixed8) bool
- func (f Fixed8) MarshalJSON() ([]byte, error)
- func (f Fixed8) MarshalYAML() (interface{}, error)
- func (f Fixed8) String() string
- func (f Fixed8) Sub(g Fixed8) Fixed8
- func (f *Fixed8) UnmarshalJSON(data []byte) error
- func (f *Fixed8) UnmarshalYAML(unmarshal func(interface{}) error) error
- type Uint160
- func (u Uint160) BytesBE() []byte
- func (u Uint160) BytesLE() []byte
- func (u *Uint160) DecodeBinary(br *io.BinReader)
- func (u *Uint160) EncodeBinary(bw *io.BinWriter)
- func (u Uint160) Equals(other Uint160) bool
- func (u Uint160) Less(other Uint160) bool
- func (u Uint160) MarshalJSON() ([]byte, error)
- func (u Uint160) Reverse() (r Uint160)
- func (u Uint160) String() string
- func (u Uint160) StringBE() string
- func (u Uint160) StringLE() string
- func (u *Uint160) UnmarshalJSON(data []byte) (err error)
- type Uint256
- func (u Uint256) BytesBE() []byte
- func (u Uint256) BytesLE() []byte
- func (u Uint256) CompareTo(other Uint256) int
- func (u *Uint256) DecodeBinary(r *io.BinReader)
- func (u *Uint256) EncodeBinary(w *io.BinWriter)
- func (u Uint256) Equals(other Uint256) bool
- func (u Uint256) MarshalJSON() ([]byte, error)
- func (u Uint256) Reverse() Uint256
- func (u Uint256) String() string
- func (u Uint256) StringBE() string
- func (u Uint256) StringLE() string
- func (u *Uint256) UnmarshalJSON(data []byte) (err error)
Constants ¶
const Uint160Size = 20
Uint160Size is the size of Uint160 in bytes.
const Uint256Size = 32
Uint256Size is the size of Uint256 in bytes.
Variables ¶
This section is empty.
Functions ¶
func ArrayReverse ¶
ArrayReverse returns 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) DecodeBinary ¶
DecodeBinary implements the io.Serializable interface.
func (*Fixed8) EncodeBinary ¶
EncodeBinary implements the io.Serializable interface.
func (Fixed8) FloatValue ¶
FloatValue returns the original value representing Fixed8 as float64.
func (Fixed8) FractionalValue ¶
FractionalValue returns decimal part of the original value. It has the same sign as f, so that f = f.IntegralValue() + f.FractionalValue().
func (Fixed8) GreaterThan ¶
GreaterThan implements Fixd8 < operator.
func (Fixed8) IntegralValue ¶
IntegralValue returns integer part of the original value representing Fixed8 as int64.
func (Fixed8) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (Fixed8) MarshalYAML ¶
MarshalYAML implements the yaml marshaller interface.
func (*Fixed8) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
func (*Fixed8) UnmarshalYAML ¶
UnmarshalYAML implements the yaml unmarshaler interface.
type Uint160 ¶
type Uint160 [Uint160Size]uint8
Uint160 is a 20 byte long unsigned integer.
func Uint160DecodeBytesBE ¶
Uint160DecodeBytesBE attempts to decode the given bytes into an Uint160.
func Uint160DecodeBytesLE ¶
Uint160DecodeBytesLE attempts to decode the given bytes in little-endian into an Uint160.
func Uint160DecodeStringBE ¶
Uint160DecodeStringBE attempts to decode the given string into an Uint160.
func Uint160DecodeStringLE ¶
Uint160DecodeStringLE attempts to decode the given string in little-endian hex encoding into an Uint160.
func (*Uint160) DecodeBinary ¶ added in v0.90.0
DecodeBinary implements Serializable interface.
func (*Uint160) EncodeBinary ¶ added in v0.90.0
EncodeBinary implements Serializable interface.
func (Uint160) Less ¶
Less returns true if this value is less than given Uint160 value. It's primarily intended to be used for sorting purposes.
func (Uint160) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (Uint160) StringLE ¶
StringLE returns string representations of u with little-endian byte order.
func (*Uint160) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type Uint256 ¶
type Uint256 [Uint256Size]uint8
Uint256 is a 32 byte long unsigned integer.
func Uint256DecodeBytesBE ¶
Uint256DecodeBytesBE attempts to decode the given string (in BE representation) into an Uint256.
func Uint256DecodeBytesLE ¶
Uint256DecodeBytesLE attempts to decode the given string (in LE representation) into an Uint256.
func Uint256DecodeStringBE ¶
Uint256DecodeStringBE attempts to decode the given string (in BE representation) into an Uint256.
func Uint256DecodeStringLE ¶
Uint256DecodeStringLE attempts to decode the given string (in LE representation) into an Uint256.
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) DecodeBinary ¶
DecodeBinary implements io.Serializable interface.
func (*Uint256) EncodeBinary ¶
EncodeBinary implements io.Serializable interface.
func (Uint256) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (*Uint256) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.