wallet

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IDSize is the size of a wallet ID in bytes.
	// NOTE: The length of wallet ID's string is IDSize * 2.
	IDSize = 3
)

Variables

View Source
var (
	// ErrMalformedID is the error returned when a wallet ID is malformed.
	ErrMalformedID = errors.New("wallet: malformed ID")
)

Functions

This section is empty.

Types

type ID

type ID [IDSize]byte

ID is a wallet ID computed as a truncated hash of a public key for a specific BIP32 path.

func NewID

func NewID(data []byte) (id ID)

NewID creates a new wallet ID the given data.

func (ID) Equal

func (id ID) Equal(cmp ID) bool

Equal compares vs another wallet ID for equality.

func (ID) IsValid

func (id ID) IsValid() bool

IsValid checks whether a wallet ID is well-formed.

func (ID) MarshalBinary

func (id ID) MarshalBinary() (data []byte, err error)

MarshalBinary encodes a wallet ID into binary form.

func (ID) String

func (id ID) String() string

String returns the string representation of a wallet ID.

func (*ID) UnmarshalBinary

func (id *ID) UnmarshalBinary(data []byte) error

UnmarshalBinary decodes a binary marshaled wallet ID.

func (*ID) UnmarshalHex

func (id *ID) UnmarshalHex(text string) error

UnmarshalHex deserializes a hexadecimal text string into wallet ID.

Jump to

Keyboard shortcuts

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