address

package
v0.0.0-...-29e199f Latest Latest
Warning

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

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

Documentation

Overview

Package address defines the custom Ethereum address data type of the signare.

Index

Constants

This section is empty.

Variables

View Source
var ZeroAddress = Address{}

ZeroAddress is an empty address

Functions

This section is empty.

Types

type Address

type Address [addressLength]byte

Address represents an ethereum account address

func MustNewFromHexString

func MustNewFromHexString(address string) Address

MustNewFromHexString returns an Address. If the address input is invalid, a ZeroAddress will be returned. Suitable for tests.

func NewFromHexString

func NewFromHexString(address string) (Address, error)

NewFromHexString creates a new Address from the provided hex string. If an error is returned, the Address will have a ZeroAddress value.

func NewFromRawBytes

func NewFromRawBytes(b []byte) (*Address, error)

NewFromRawBytes creates a new address from raw unencoded bytes. If b is larger than len(a), b will be cropped from the left

func (Address) IsEmpty

func (a Address) IsEmpty() bool

IsEmpty checks if the Address is empty

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaller

func (Address) String

func (a Address) String() string

String returns an EIP55-compliant hex encoded string representation of the Address. String implements fmt.Stringer

func (*Address) UnmarshalJSON

func (a *Address) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler

Jump to

Keyboard shortcuts

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