convert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const EtherDecimals = 18

EtherDecimals for Ether is expressed in 18 decimals

Variables

This section is empty.

Functions

func HexToByteArray

func HexToByteArray(hexString string) ([]byte, error)

func HexToInt

func HexToInt(hexString string) (*big.Int, error)

func ToDenomination

func ToDenomination(amount string, decimals int) (*big.Int, error)

ToDenomination converts amount to denomination based on decimals. e.g. set decimals to 18 to convert amount in eth to wei.

func TrimHexPrefix

func TrimHexPrefix(hexString string) (string, error)

TrimHexPrefix removes the prefix `0x` from the given hex string.

Types

This section is empty.

Jump to

Keyboard shortcuts

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