types

package
v0.18.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Amount

type Amount struct {
	*big.Int
}

Amount represense a NEAR yocto

func NewAmount

func NewAmount(src string) Amount

NewAmount returns a new amount from the given string

func NewInt64Amount added in v0.2.0

func NewInt64Amount(val int64) Amount

NewInt64Amount returns a new amount for the given int64 value

func (Amount) Add added in v0.14.0

func (a Amount) Add(b Amount) Amount

func (Amount) Compare added in v0.3.0

func (a Amount) Compare(b Amount) int

Compare compares two amounts

func (Amount) MarshalJSON

func (a Amount) MarshalJSON() ([]byte, error)

MarshalJSON returns a JSON representation of amount

func (*Amount) Scan

func (a *Amount) Scan(value interface{}) error

Scan assigns the value from interface

func (Amount) String

func (a Amount) String() string

func (Amount) Sub added in v0.3.0

func (a Amount) Sub(b Amount) Amount

Sub substitutes a given amount from the current one

func (Amount) Value

func (a Amount) Value() (driver.Value, error)

Value returns a serialized value

type Height

type Height uint64

Height represents a block height

func HeightFromString

func HeightFromString(src string) Height

HeightFromString returns a new height parsed from a string

func (Height) String added in v0.3.0

func (h Height) String() string

String returns height text representation

func (Height) Valid

func (h Height) Valid() bool

Valid returns true if height value is valid

type Map added in v0.3.0

type Map map[string]interface{}

Map implements a database-compatible map

func NewMap added in v0.3.0

func NewMap() Map

NewMap returns a new map

func (*Map) Scan added in v0.3.0

func (m *Map) Scan(src interface{}) error

Scan scants the given value into the map

func (Map) Value added in v0.3.0

func (m Map) Value() (driver.Value, error)

Value returns the db driver value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL