account

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2024 License: MIT Imports: 4 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ZeroAddress = common.HexToAddress("0x0000000000000000000000000000000000000000")

	EthAddressRegex = regexp.MustCompile(ethAddressRegexString)
)
View Source
var (
	ErrInvalidAddress         = fmt.Errorf("invalid Ethereum address")
	ErrInvalidNumVisibleChars = fmt.Errorf("number of visible characters must be even")
	ErrInvalidMaskedChars     = fmt.Errorf("invalid number of masked characters")
)

Functions

func IsValidAddress

func IsValidAddress(iAddress any) bool

IsValidAddress validate hex address

func IsZeroAddress

func IsZeroAddress(iAddress any) bool

IsZeroAddress validate if it's a 0 address

func MaskAddress added in v0.8.0

func MaskAddress(address string, numVisibleChars int, maskedCharacter rune) (string, error)

MaskAddress masks the middle part of an Ethereum address with a number of masked characters and returns the masked address. The number of visible characters must be even. The number of masked characters must be greater than 0. The masked character can be any character. @param address: The Ethereum address to mask @param numVisibleChars: The number of visible characters to keep at the start and end of the address @param maskedCharacter: The character to use for masking the middle part of the address @return The masked address and error if any

Types

This section is empty.

Jump to

Keyboard shortcuts

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