conv

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromEther

func FromEther(n *big.Float) *big.Int

FromEther converts values in Ether to wei.

func FromGwei

func FromGwei(n *big.Float) *big.Int

FromGwei converts values in Gwei to wei.

func HexToBytes

func HexToBytes(s string) ([]byte, error)

HexToInt converts string format of a series of hex value to byte slice.

func HexToInt

func HexToInt(s string) (int64, error)

HexToInt converts string format of a hex value to int64.

func PackArgument added in v0.2.0

func PackArgument(t abi.Type, v any) (string, error)

PackArgument packs a single argument into a string

func ToEther

func ToEther(wei *big.Int) *big.Float

ToEther converts values in wei to ether.

func ToGwei

func ToGwei(wei *big.Int) *big.Int

ToGwei converts values in wei to Gwei.

func Trim0xPrefix

func Trim0xPrefix(s string) string

Trim0xPrefix removes '0x' prefix if any

func UnpackArgument

func UnpackArgument(t abi.Type, s string) (any, error)

UnpackArgument converts string format of a value into the Go type corresponding to given argument type.

Types

This section is empty.

Jump to

Keyboard shortcuts

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