types

package
v0.0.0-...-845e4b4 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address string

Address to designate a wallet

func AddressFromString

func AddressFromString(s string) Address

func (Address) String

func (a Address) String() string

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(b []byte) error

func (Address) Value

func (a Address) Value() (sqlDriver.Value, error)

type Data

type Data string

Data to designate a large byte array

func DataFromBytes

func DataFromBytes(b []byte) Data

func DataFromString

func DataFromString(s string) Data

func (Data) Bytes

func (d Data) Bytes() ([]byte, error)

func (Data) String

func (a Data) String() string

func (Data) Value

func (d Data) Value() (sqlDriver.Value, error)

type Hash

type Hash string

Hash from a transaction

func HashFromString

func HashFromString(s string) Hash

func (Hash) String

func (h Hash) String() string

func (Hash) Value

func (h Hash) Value() (sqlDriver.Value, error)

type Number

type Number struct{ *big.Int }

Number that represents something informational (ie, a large block number)

func EmptyNumber

func EmptyNumber() Number

func NumberFromBase10

func NumberFromBase10(v string) (*Number, error)

func NumberFromBig

func NumberFromBig(v *big.Int) Number

func NumberFromHex

func NumberFromHex(v string) (*Number, error)

func NumberFromInt32

func NumberFromInt32(v int32) Number

func NumberFromInt64

func NumberFromInt64(v int64) Number

func NumberFromUint64

func NumberFromUint64(v uint64) Number

func (Number) Big

func (u Number) Big() *big.Int

func (Number) Hex

func (u Number) Hex() string

func (*Number) Scan

func (int *Number) Scan(v interface{}) error

Scan types into Number, supporting NUMERIC(78, 0), int64, uint64, string

func (Number) String

func (u Number) String() string

String the Number, printing its base10

func (Number) Value

func (u Number) Value() (sqlDriver.Value, error)

type UnscaledNumber

type UnscaledNumber struct{ *big.Int }

UnscaledNumber that's representing a large number that needs to be divided by the decimals

func EmptyUnscaledNumber

func EmptyUnscaledNumber() UnscaledNumber

func UnscaledNumberFromBase10

func UnscaledNumberFromBase10(v string) (*UnscaledNumber, error)

func UnscaledNumberFromBig

func UnscaledNumberFromBig(v *big.Int) UnscaledNumber

func UnscaledNumberFromHex

func UnscaledNumberFromHex(v string) (*UnscaledNumber, error)

func UnscaledNumberFromInt64

func UnscaledNumberFromInt64(v int64) UnscaledNumber

func (UnscaledNumber) Big

func (u UnscaledNumber) Big() *big.Int

func (UnscaledNumber) Hex

func (u UnscaledNumber) Hex() string

func (UnscaledNumber) Scale

func (u UnscaledNumber) Scale(decimals int) *big.Float

Scale a number for visualisation or low-stakes math.

func (UnscaledNumber) ScaleStr

func (u UnscaledNumber) ScaleStr(d int) string

ScaleStr to show a user or to send over the graph, scaling with 4 decimal places.

func (*UnscaledNumber) Scan

func (u *UnscaledNumber) Scan(v interface{}) error

func (UnscaledNumber) String

func (u UnscaledNumber) String() string

String the UnscaledNumber, printing its base 10 form

func (UnscaledNumber) Value

func (u UnscaledNumber) Value() (sqlDriver.Value, error)

type UsdNumber

type UsdNumber struct{ *big.Rat }

UsdNumber conversion of an amount at the time

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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