types

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2021 License: Apache-2.0 Imports: 4 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

func NewInt64Amount(val int64) Amount

NewInt64Amount returns a new amount for the given int64 value

func (Amount) Add

func (a Amount) Add(b Amount) Amount

Add adds two numbers

func (Amount) Compare

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) Mul

func (a Amount) Mul(b Amount) Amount

Mul multiplies two numbers

func (Amount) PercentOf

func (a Amount) PercentOf(b Amount) float64

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

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

Jump to

Keyboard shortcuts

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