Documentation ¶
Index ¶
- Constants
- func Abs(x int64) int64
- func BigIntFromNeoBytes(ba []byte) *big.Int
- func BigIntToNeoBytes(data *big.Int) []byte
- func BytesToHex(b []byte) string
- func BytesToUInt32(bs []byte) uint32
- func BytesToUInt64(bs []byte) uint64
- func ConcatBytes(b1 []byte, b2 []byte) []byte
- func Fixed8ToFloat64(f Fixed8) float64
- func Fixed8ToInt64(f Fixed8) int64
- func Fixed8ToString(input Fixed8) string
- func HexToBytes(hexstring string) (b []byte)
- func Int64ToBytes(n int64) []byte
- func PadRight(data []byte, length int) []byte
- func ReverseBytes(data []byte) []byte
- func ReverseString(input string) string
- func ScriptHashToAddress(scriptHash UInt160) string
- func ToNibbles(data []byte) []byte
- func UInt32ToBytes(n uint32) []byte
- type Fixed8
- func (f Fixed8) Abs() Fixed8
- func (f Fixed8) Add(g Fixed8) Fixed8
- func (f Fixed8) Ceiling() Fixed8
- func (f Fixed8) Div(g Fixed8) Fixed8
- func (f Fixed8) Equal(g Fixed8) bool
- func (f Fixed8) GreaterThan(g Fixed8) bool
- func (f Fixed8) LessThan(g Fixed8) bool
- func (f Fixed8) Mul(g Fixed8) (Fixed8, error)
- func (f Fixed8) String() string
- func (f Fixed8) Sub(g Fixed8) Fixed8
- type UInt160
- type UInt256
- type VarInt
Constants ¶
const D = 100000000
const PRECISION = 8
const ZeroScriptHashString = "0000000000000000000000000000000000000000"
Variables ¶
This section is empty.
Functions ¶
func BigIntFromNeoBytes ¶
func BigIntToNeoBytes ¶
func BytesToUInt32 ¶
func BytesToUInt64 ¶
func Fixed8ToFloat64 ¶
Fixed8ToFloat64 returns the decimal value of a Fixed8 type.
func Fixed8ToInt64 ¶
Fixed8ToInt64 returns the original value representing Fixed8 as int64.
func Fixed8ToString ¶
Fixed8ToString converts a Fixed8 to a decimal string
func HexToBytes ¶
HexToBytes Simple hex string to bytes
func ReverseBytes ¶
ReverseBytes without change original slice
func ScriptHashToAddress ¶
Types ¶
type Fixed8 ¶
type Fixed8 struct {
Value int64
}
func Fixed8FromFloat64 ¶
Fixed8FromFloat64 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) GreaterThan ¶
GreaterThan implements Fixed8 > operator.
type UInt160 ¶
type UInt160 [uint160Size]uint8
UInt160 is a 20 byte long unsigned integer. little endian
func AddressToScriptHash ¶
func BytesToScriptHash ¶
func UInt160FromBytes ¶
UInt160FromBytes attempts to decode the given bytes into an UInt160.
func UInt160FromString ¶
UInt160FromString attempts to decode the given big endian string into an UInt160.
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) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type UInt256 ¶
type UInt256 [uint256Size]uint8
UInt256 is a 32 byte long unsigned integer.
func UInt256FromBytes ¶
UInt256FromBytes attempts to decode the given bytes (in LE representation) into an UInt256.
func UInt256FromString ¶
UInt256FromString attempts to decode the given string (in BE 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) MarshalJSON ¶
MarshalJSON implements the json marshaller interface.
func (*UInt256) UnmarshalJSON ¶
UnmarshalJSON implements the json unmarshaller interface.
type VarInt ¶
type VarInt struct {
Value uint64
}
VarInt
func ParseVarInt ¶
ParseVarInt parse the serialized bytes of the var int and return VarInt