ethtypes

package
v1.1.18 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 13 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BigIntegerFromString added in v1.1.14

func BigIntegerFromString(ctx context.Context, s string) (*big.Int, error)

func UnmarshalBigInt added in v1.1.14

func UnmarshalBigInt(ctx context.Context, b []byte) (*big.Int, error)

Types

type Address0xHex

type Address0xHex [20]byte

Address0xHex formats with an 0x prefix, but no checksum (lower case)

func MustNewAddress

func MustNewAddress(s string) *Address0xHex

func NewAddress

func NewAddress(s string) (*Address0xHex, error)

func (Address0xHex) MarshalJSON

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

func (*Address0xHex) SetString

func (a *Address0xHex) SetString(s string) error

func (Address0xHex) String

func (a Address0xHex) String() string

func (*Address0xHex) UnmarshalJSON

func (a *Address0xHex) UnmarshalJSON(b []byte) error

type AddressPlainHex

type AddressPlainHex AddressWithChecksum

AddressPlainHex can parse the same, but formats as just flat hex (no prefix)

func (AddressPlainHex) MarshalJSON

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

func (AddressPlainHex) String

func (a AddressPlainHex) String() string

func (*AddressPlainHex) UnmarshalJSON

func (a *AddressPlainHex) UnmarshalJSON(b []byte) error

type AddressWithChecksum

type AddressWithChecksum Address0xHex

AddressWithChecksum uses full 0x prefixed checksum address format

func NewAddressWithChecksum

func NewAddressWithChecksum(s string) (*AddressWithChecksum, error)

func (AddressWithChecksum) MarshalJSON

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

func (AddressWithChecksum) String

func (a AddressWithChecksum) String() string

func (*AddressWithChecksum) UnmarshalJSON

func (a *AddressWithChecksum) UnmarshalJSON(b []byte) error

type HexBytes0xPrefix

type HexBytes0xPrefix []byte

HexBytes0xPrefix are serialized to JSON as hex with an `0x` prefix

func MustNewHexBytes0xPrefix

func MustNewHexBytes0xPrefix(s string) HexBytes0xPrefix

func NewHexBytes0xPrefix

func NewHexBytes0xPrefix(s string) (HexBytes0xPrefix, error)

func (HexBytes0xPrefix) Equals added in v1.1.14

func (h HexBytes0xPrefix) Equals(h2 HexBytes0xPrefix) bool

func (HexBytes0xPrefix) MarshalJSON

func (h HexBytes0xPrefix) MarshalJSON() ([]byte, error)

func (HexBytes0xPrefix) String

func (h HexBytes0xPrefix) String() string

func (*HexBytes0xPrefix) UnmarshalJSON

func (h *HexBytes0xPrefix) UnmarshalJSON(b []byte) error

type HexBytesPlain

type HexBytesPlain []byte

HexBytesPlain is simple bytes that are JSON stored/retrieved as hex

func (HexBytesPlain) Equals added in v1.1.14

func (h HexBytesPlain) Equals(h2 HexBytesPlain) bool

func (HexBytesPlain) MarshalJSON

func (h HexBytesPlain) MarshalJSON() ([]byte, error)

func (HexBytesPlain) String

func (h HexBytesPlain) String() string

func (*HexBytesPlain) UnmarshalJSON

func (h *HexBytesPlain) UnmarshalJSON(b []byte) error

type HexInteger

type HexInteger big.Int

HexInteger is a positive integer - serializes to JSON as an 0x hex string (no leading zeros), and parses flexibly depending on the prefix (so 0x for hex, or base 10 for plain string / float64)

func NewHexInteger

func NewHexInteger(i *big.Int) *HexInteger

func NewHexInteger64

func NewHexInteger64(i int64) *HexInteger

func NewHexIntegerU64 added in v1.1.11

func NewHexIntegerU64(i uint64) *HexInteger

func (*HexInteger) BigInt

func (h *HexInteger) BigInt() *big.Int

func (*HexInteger) Int64 added in v1.1.11

func (h *HexInteger) Int64() int64

func (HexInteger) MarshalJSON

func (h HexInteger) MarshalJSON() ([]byte, error)

func (*HexInteger) Scan added in v1.1.11

func (h *HexInteger) Scan(src interface{}) error

func (*HexInteger) String

func (h *HexInteger) String() string

func (*HexInteger) Uint64 added in v1.1.11

func (h *HexInteger) Uint64() uint64

func (*HexInteger) UnmarshalJSON

func (h *HexInteger) UnmarshalJSON(b []byte) error

type HexUint64 added in v1.1.14

type HexUint64 uint64

HexUint64 is a positive integer - serializes to JSON as an 0x hex string (no leading zeros), and parses flexibly depending on the prefix (so 0x for hex, or base 10 for plain string / float64)

func (HexUint64) MarshalJSON added in v1.1.14

func (h HexUint64) MarshalJSON() ([]byte, error)

func (*HexUint64) Scan added in v1.1.14

func (h *HexUint64) Scan(src interface{}) error

func (*HexUint64) String added in v1.1.14

func (h *HexUint64) String() string

func (HexUint64) Uint64 added in v1.1.14

func (h HexUint64) Uint64() uint64

func (*HexUint64) Uint64OrZero added in v1.1.14

func (h *HexUint64) Uint64OrZero() uint64

func (*HexUint64) UnmarshalJSON added in v1.1.14

func (h *HexUint64) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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