conversions

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const SolidityIntSize uint = 256

SolidityIntSize is the size of a Solidity int in bits.

Variables

This section is empty.

Functions

func FloatToNumeric

func FloatToNumeric(f *big.Float) (pgtype.Numeric, error)

func IntToNumeric

func IntToNumeric(i *big.Int) (pgtype.Numeric, error)

func MapValsToArr

func MapValsToArr[T comparable, U any](m map[T]U) []U

func MustFloatToNumeric

func MustFloatToNumeric(f *big.Float) pgtype.Numeric

func MustIntToNumeric

func MustIntToNumeric(i *big.Int) pgtype.Numeric

func MustNumericToInt

func MustNumericToInt(n pgtype.Numeric) *big.Int

func NewLargeFloat

func NewLargeFloat() *big.Float

NewLargeFloat creates a new big.Float with a mantissa large enough to accurately represent the 256-bit integers used in Solidity.

func NumericToFloat

func NumericToFloat(n pgtype.Numeric) (*big.Float, error)

func NumericToInt

func NumericToInt(n pgtype.Numeric) (*big.Int, error)

func NumericToRat

func NumericToRat(n pgtype.Numeric) (*big.Rat, error)

func RatToNumeric

func RatToNumeric(r *big.Rat) (pgtype.Numeric, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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