ethutils

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddressRegexp = regexp.MustCompile("^0x[0-9a-fA-F]{40}$")
View Source
var ErrInvalidSignatureLength = fmt.Errorf("signature must be 65 bytes long")

Functions

func EtherToWei added in v0.2.0

func EtherToWei(eth *big.Int) *big.Int

func FloatEtherToWei added in v0.2.0

func FloatEtherToWei(eth *big.Float) *big.Int

FloatEtherToWei formats Eth value argument to Wei big.Float

func IsStringAddress

func IsStringAddress(address string) bool

func LoadEthKeyFromFile

func LoadEthKeyFromFile(path string, auth string) (*keystore.Key, error)

func NewEthRandomKey

func NewEthRandomKey() (*keystore.Key, error)

func ParseBigFloat added in v0.2.0

func ParseBigFloat(value string) (*big.Float, error)

ParseBigFloat parse string value to big.Float

func PrivateKeyStringToKey

func PrivateKeyStringToKey(pkString string) (*keystore.Key, error)

func SaveEthKeyToFile

func SaveEthKeyToFile(key *keystore.Key, path string, auth string) error

func VerifyEcRecover

func VerifyEcRecover(payload, sig []byte, address common.Address) error

func VerifySign

func VerifySign(payload, sig []byte, address common.Address) error

func VerifySignNoRecoverId added in v0.2.0

func VerifySignNoRecoverId(payload, sig []byte, address common.Address) error

func WeiToEther added in v0.2.0

func WeiToEther(eth *big.Int) *big.Int

func WeiToFloatEther added in v0.2.0

func WeiToFloatEther(eth *big.Int) *big.Float

Types

This section is empty.

Jump to

Keyboard shortcuts

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