common

package
v0.0.0-...-ad1ab37 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: MIT Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BalanceIsValid

func BalanceIsValid(balance *big.Int) (bool, error)

BalanceIsValid will return an error and a boolean

func BalanceMustBeValid

func BalanceMustBeValid(balance *big.Int) bool

BalanceMustBeValid will panic in case there is an error when processing the balance

func GetAddressFromPrivateKey

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

func IsValidAddress

func IsValidAddress(iaddress interface{}) bool

func IsZeroAddress

func IsZeroAddress(iaddress interface{}) bool

func MustGetAddressFromPrivateKey

func MustGetAddressFromPrivateKey(privateKey *ecdsa.PrivateKey) common.Address

func SafeBalanceIsValid

func SafeBalanceIsValid(balance *big.Int) bool

SafeBalanceIsValid Use this function when you want to behave with a normal bool check

func ValidateAddress

func ValidateAddress(address interface{}) bool

func ValidateAddresses

func ValidateAddresses(addresses []interface{}) (
	[]interface{},
	[]interface{},
	bool,
)

Types

type PrivateAddress

type PrivateAddress string

func (PrivateAddress) IsValid

func (a PrivateAddress) IsValid() bool

func (*PrivateAddress) ToECDSA

func (a *PrivateAddress) ToECDSA() (pk *ecdsa.PrivateKey, err error)

func (PrivateAddress) ToString

func (a PrivateAddress) ToString() string

type RawAddress

type RawAddress string

RawAddress Used for declaring ethereum addresses that is not common.Address type

func (RawAddress) IsValid

func (a RawAddress) IsValid() bool

func (RawAddress) ToCommonAddress

func (a RawAddress) ToCommonAddress() common.Address

func (RawAddress) ToString

func (a RawAddress) ToString() string

Jump to

Keyboard shortcuts

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