ethutil

package
v0.0.0-...-37ca617 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ZeroAddress    = common.Address{}
	ZeroAddressHex = common.Address{}.Hex()

	ErrInvalidAddress = errors.New("invalid address")
)
View Source
var (
	ErrParseLogNilTopics    = errors.New("nil topics")
	ErrParseLogUnknownEvent = errors.New("unknown event")
	ErrParseErrInvalidData  = errors.New("invalid data")
	ErrParseErrUnknownError = errors.New("unknown error")
)

Functions

func Has0xPrefix

func Has0xPrefix(s string) bool

func Hex2X

func Hex2X[T *big.Int | uint64 | []byte](hex string) (x T, err error)

func HexOrString2X

func HexOrString2X[T *big.Int | uint64](hexOrString string) (x T, err error)

func IsAddress

func IsAddress(address string) bool

func IsHexHash

func IsHexHash(s string) bool

func PackLowHighByBig

func PackLowHighByBig(low128, high128 *big.Int) [32]byte

func ParseError

func ParseError(data []byte, errorMap map[string]abi.Error) (string, map[string]interface{}, error)

func ParseLog

func ParseLog(log types.Log, eventMap map[string]abi.Event) (string, map[string]interface{}, error)

func ParseMnemonic

func ParseMnemonic(mnemonic string, count uint32, derivationPath ...accounts.DerivationPath) ([]*ecdsa.PrivateKey, error)

func ParseMnemonic2

func ParseMnemonic2(mnemonic string, count uint32, derivationPath ...accounts.DerivationPath) ([]*ecdsa.PrivateKey, error)

func PvHex2Key

func PvHex2Key(privateKeyHex string) (*ecdsa.PrivateKey, error)

func PvKey2Address

func PvKey2Address(privateKey *ecdsa.PrivateKey) (common.Address, error)

func PvKey2Hex

func PvKey2Hex(privateKey *ecdsa.PrivateKey) (string, error)

func SignWithEncode

func SignWithEncode(tx *types.Transaction, signer types.Signer, prv *ecdsa.PrivateKey) (string, string, error)

func Signature

func Signature(message []byte, privateKey *ecdsa.PrivateKey) ([]byte, error)

eip-191

func Trim0x

func Trim0x(hex string) string

func VerifySignature

func VerifySignature(address common.Address, message []byte, signature []byte) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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