Documentation ¶
Index ¶
- Variables
- type Eth
- func (e *Eth) Cmp(y *Eth) int
- func (e *Eth) IsZero() bool
- func (e Eth) MarshalJSON() ([]byte, error)
- func (e *Eth) MarshalText() ([]byte, error)
- func (e *Eth) Scan(value interface{}) error
- func (e *Eth) SetInt64(w int64) *Eth
- func (e *Eth) SetString(s string, base int) (*Eth, bool)
- func (e *Eth) String() string
- func (*Eth) Symbol() string
- func (e *Eth) ToInt() *big.Int
- func (e *Eth) UnmarshalJSON(data []byte) error
- func (e *Eth) UnmarshalText(text []byte) error
- func (e Eth) Value() (driver.Value, error)
- type Link
- func (l *Link) Add(x, y *Link) *Link
- func (l *Link) Cmp(y *Link) int
- func (l *Link) IsZero() bool
- func (l *Link) Link() string
- func (l Link) MarshalJSON() ([]byte, error)
- func (l *Link) MarshalText() ([]byte, error)
- func (l *Link) Scan(value interface{}) error
- func (l *Link) Set(x *Link) *Link
- func (l *Link) SetInt64(w int64) *Link
- func (l *Link) SetString(s string, base int) (*Link, bool)
- func (l *Link) String() string
- func (*Link) Symbol() string
- func (l *Link) Text(base int) string
- func (l *Link) ToHash() common.Hash
- func (l *Link) ToInt() *big.Int
- func (l *Link) UnmarshalJSON(data []byte) error
- func (l *Link) UnmarshalText(text []byte) error
- func (l Link) Value() (driver.Value, error)
- type Wei
- func (w *Wei) Add(y *Wei) *Wei
- func (w *Wei) AddPercentage(percentage uint16) *Wei
- func (w *Wei) Cmp(y *Wei) int
- func (w *Wei) Equal(y *Wei) bool
- func (w *Wei) Int64() int64
- func (w *Wei) IsNegative() bool
- func (w *Wei) IsZero() bool
- func (w *Wei) MarshalText() ([]byte, error)
- func (w *Wei) Mul(y *big.Int) *Wei
- func (w *Wei) Scan(value interface{}) error
- func (w *Wei) String() string
- func (w *Wei) Sub(y *Wei) *Wei
- func (w *Wei) Text(suffix string) string
- func (w *Wei) ToInt() *big.Int
- func (w *Wei) UnmarshalText(b []byte) error
- func (w Wei) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
var ErrNoQuotesForCurrency = errors.New("cannot unmarshal json.Number into currency")
Functions ¶
This section is empty.
Types ¶
type Eth ¶
Eth contains a field to represent the smallest units of ETH
func NewEthValue ¶ added in v0.8.7
NewEthValue returns a new struct to represent ETH from it's smallest unit (wei)
func NewEthValueS ¶ added in v0.8.8
NewEthValueS returns a new struct to represent ETH from a string value of Eth (not wei) the underlying value is still wei
func (Eth) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Eth) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Eth) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Eth) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Link ¶
Link contains a field to represent the smallest units of LINK
func NewLinkFromJuels ¶ added in v1.1.0
NewLinkFromJuels returns a new struct to represent LINK from it's smallest unit
func (Link) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (*Link) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*Link) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*Link) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
type Wei ¶ added in v0.10.10
Wei extends utils.Big to implement encoding.TextMarshaler and encoding.TextUnmarshaler with support for unit suffixes, as well as additional functions
func Ether ¶ added in v0.10.10
func Ether[T constraints.Signed](n T) *Wei
func GWei ¶ added in v0.10.10
func GWei[T constraints.Signed](n T) *Wei
func NewWeiI ¶ added in v1.10.0
func NewWeiI[T constraints.Signed](i T) *Wei
func UEther ¶ added in v1.1.0
func UEther[T constraints.Signed](n T) *Wei
UEther converts units of micro-ether (terawei) into wei