utils

package
v0.0.0-...-cf96749 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddressToString

func AddressToString(address common.Address) string

AddressToString converts an address to a string

func GeneratePrivateKey

func GeneratePrivateKey() (*ecdsa.PrivateKey, error)

GeneratePrivateKey generates a new private key

func GetAccountFromPrivateKey

func GetAccountFromPrivateKey(privateKey *ecdsa.PrivateKey) (accounts.Account, error)

GetAccountFromPrivateKey gets an account from a private key

func GetAddressFromPublicKey

func GetAddressFromPublicKey(publicKey *ecdsa.PublicKey) (common.Address, error)

GetAddressFromPublicKey gets an address from a public key

func GetPublicKeyFromPrivateKey

func GetPublicKeyFromPrivateKey(privateKey *ecdsa.PrivateKey) (*ecdsa.PublicKey, error)

GetPublicKeyFromPrivateKey gets a public key from a private key

func HexToAddress

func HexToAddress(hexString string) (common.Address, error)

HexToAddress converts a hex string to an address

func HexToPrivateKey

func HexToPrivateKey(hexString string) (*ecdsa.PrivateKey, error)

HexToPrivateKey converts a hex string to a private key

func PrivateKeyToString

func PrivateKeyToString(privateKey *ecdsa.PrivateKey) string

PrivateKeyToString converts a private key to a string

func PublicKeyToString

func PublicKeyToString(publicKey *ecdsa.PublicKey) string

PublicKeyToString converts a public key to a string

func RandomHex

func RandomHex(length int) (string, error)

RandomHex generates a random hex string

func SplitAddress

func SplitAddress(address common.Address) (string, string, error)

SplitAddress splits an address into its components

Types

This section is empty.

Jump to

Keyboard shortcuts

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