Documentation
¶
Index ¶
- Variables
- func ConvertHexToBigInt(hexStr string) (*big.Int, error)
- func ConvertToEtherDecimal(amount string, decimal int) (string, error)
- func DecodeBig(input string) (*big.Int, error)
- func DivideLargeNumbers(numeratorStr, denominatorStr string, precision int) (string, error)
- func EtherToWei(amountStr string) (*big.Int, error)
- func FormatHex(hex string) (string, error)
- func FormatHexToEther(hex string, precision ...int) (string, error)
- func HexToDecimal(hexStr string) (*big.Int, error)
- func HexToString(hexStr string, precision ...int) (string, error)
- func HexToText(hexString string) (string, error)
- func MultiplyDecimal(denominatorStr string, precision int) (string, error)
- func ParseEther(big string, precision ...int) (string, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrEmptyString = &decError{"empty hex string"} ErrSyntax = &decError{"invalid hex string"} ErrMissingPrefix = &decError{"hex string without 0x prefix"} ErrOddLength = &decError{"hex string of odd length"} ErrEmptyNumber = &decError{"hex string \"0x\""} ErrLeadingZero = &decError{"hex number with leading zero digits"} ErrUint64Range = &decError{"hex number > 64 bits"} ErrUintRange = &decError{fmt.Sprintf("hex number > %d bits", uintBits)} ErrBig256Range = &decError{"hex number > 256 bits"} )
Functions ¶
func ConvertToEtherDecimal ¶ added in v0.0.10
func DecodeBig ¶ added in v0.0.10
DecodeBig decodes a hex string with 0x prefix as a quantity. Numbers larger than 256 bits are not accepted.
func DivideLargeNumbers ¶ added in v0.0.10
func EtherToWei ¶ added in v0.1.0
This function converts ether to wei
func FormatHexToEther ¶ added in v0.1.0
This util converts Hex value to ethers and return it as ether format in 18 decimals
func MultiplyDecimal ¶ added in v0.0.10
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.