utils

package
v0.0.0-...-5fc2af4 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ZeroAddress = "0x0000000000000000000000000000000000000000"

Variables

This section is empty.

Functions

func AppendNotEmpty

func AppendNotEmpty(slice []string, str string) []string

func CleanUpHex

func CleanUpHex(s string) string

func HexStrToBigInt

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

HexStrToBigInt transforms a hex sting like "0xff" to a big.Int. Arbitrary length values are possible.

func HexStrToBigIntStr

func HexStrToBigIntStr(hexString string) (string, error)

HexStrToBigIntStr transforms a hex sting like "0xff" to a big int string like "15". Arbitrary length values are possible.

func HumanDuration

func HumanDuration(seconds int64) string

func JoinInterfaces

func JoinInterfaces(sep string, values ...interface{}) string

func NormalizeAddress

func NormalizeAddress(addr string) string

func NormalizeAddresses

func NormalizeAddresses(addrs []string) []string

func PrettyBond

func PrettyBond(d decimal.Decimal) string

func PrettyPercent

func PrettyPercent(d decimal.Decimal) string

func PrettyToken

func PrettyToken(d decimal.Decimal, precision int64) string

func Topic2Address

func Topic2Address(topic string) string

func Trim0x

func Trim0x(str string) string

Trim0x removes the "0x" prefix of hexes if it exists

func ValidateAccount

func ValidateAccount(accountAddress string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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