assets

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 7 Imported by: 20

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoQuotesForCurrency = errors.New("cannot unmarshal json.Number into currency")

Functions

func Format

func Format(i *big.Int, precision int) string

Types

type Link big.Int

Link contains a field to represent the smallest units of LINK

func NewLinkFromJuels

func NewLinkFromJuels(w int64) *Link

NewLinkFromJuels returns a new struct to represent LINK from it's smallest unit

func (*Link) Add

func (l *Link) Add(x, y *Link) *Link

Add defers to big.Int Add

func (*Link) Cmp

func (l *Link) Cmp(y *Link) int

Cmp defers to big.Int Cmp

func (*Link) IsZero

func (l *Link) IsZero() bool

IsZero returns true when the value is 0 and false otherwise

func (l *Link) Link() string

Link returns Link formatted as a string, in LINK units

func (Link) MarshalJSON

func (l Link) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (*Link) MarshalText

func (l *Link) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Link) Scan

func (l *Link) Scan(value interface{}) error

Scan reads the database value and returns an instance.

func (*Link) Set

func (l *Link) Set(x *Link) *Link

Set delegates to *big.Int.Set

func (*Link) SetInt64

func (l *Link) SetInt64(w int64) *Link

SetInt64 delegates to *big.Int.SetInt64

func (*Link) SetString

func (l *Link) SetString(s string, base int) (*Link, bool)

SetString delegates to *big.Int.SetString

func (*Link) String

func (l *Link) String() string

String returns Link formatted as a string.

func (*Link) Symbol

func (*Link) Symbol() string

Symbol returns LINK

func (*Link) Text

func (l *Link) Text(base int) string

Text defers to big.Int Text

func (*Link) ToInt

func (l *Link) ToInt() *big.Int

ToInt returns the Link value as a *big.Int.

func (*Link) UnmarshalJSON

func (l *Link) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

func (*Link) UnmarshalText

func (l *Link) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Link) Value

func (l Link) Value() (driver.Value, error)

Value returns the Link value for serialization to database.

Jump to

Keyboard shortcuts

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