Versions in this module Expand all Collapse all v1 v1.1.2 Sep 16, 2021 Changes in this version + const AddressLength + const HashLength + const PubkeyHashLength + var ErrAddressCollision = errors.New("address collision") + var ErrChecksumMismatch = errors.New("checksum mismatch") + var ErrUnknownAddressType = errors.New("unknown address type") + var ErrUnsupportedWitnessProgLen = errors.New("unsupported witness program length") + var ErrUnsupportedWitnessVer = errors.New("unsupported witness version") + func Bytes2Hex(d []byte) string + func BytesToUnit64(b []byte) uint64 + func EmptyHash(h Hash) bool + func FromHex(s string) []byte + func Hex2Bytes(str string) []byte + func Unit64ToBytes(n uint64) []byte + type Address interface + EncodeAddress func() string + IsForNet func(*consensus.Params) bool + ScriptAddress func() []byte + String func() string + func DecodeAddress(addr string, param *consensus.Params) (Address, error) + type AddressWitnessPubKeyHash struct + func NewAddressWitnessPubKeyHash(witnessProg []byte, param *consensus.Params) (*AddressWitnessPubKeyHash, error) + func (a *AddressWitnessPubKeyHash) EncodeAddress() string + func (a *AddressWitnessPubKeyHash) Hash160() *[20]byte + func (a *AddressWitnessPubKeyHash) Hrp() string + func (a *AddressWitnessPubKeyHash) IsForNet(param *consensus.Params) bool + func (a *AddressWitnessPubKeyHash) ScriptAddress() []byte + func (a *AddressWitnessPubKeyHash) String() string + func (a *AddressWitnessPubKeyHash) WitnessProgram() []byte + func (a *AddressWitnessPubKeyHash) WitnessVersion() byte + type AddressWitnessScriptHash struct + func NewAddressWitnessScriptHash(witnessProg []byte, param *consensus.Params) (*AddressWitnessScriptHash, error) + func (a *AddressWitnessScriptHash) EncodeAddress() string + func (a *AddressWitnessScriptHash) Hrp() string + func (a *AddressWitnessScriptHash) IsForNet(param *consensus.Params) bool + func (a *AddressWitnessScriptHash) ScriptAddress() []byte + func (a *AddressWitnessScriptHash) Sha256() *[32]byte + func (a *AddressWitnessScriptHash) String() string + func (a *AddressWitnessScriptHash) WitnessProgram() []byte + func (a *AddressWitnessScriptHash) WitnessVersion() byte + type Hash [HashLength]byte + func BigToHash(b *big.Int) Hash + func BytesToHash(b []byte) Hash + func StringToHash(s string) Hash + func (h *Hash) Set(other Hash) + func (h *Hash) SetBytes(b []byte) + func (h *Hash) UnmarshalJSON(input []byte) error + func (h Hash) Bytes() []byte + func (h Hash) Generate(rand *rand.Rand, size int) reflect.Value + func (h Hash) Hex() string + func (h Hash) MarshalJSON() ([]byte, error) + func (h Hash) Str() string + type TimeSorter []uint64 + func (s TimeSorter) Len() int + func (s TimeSorter) Less(i, j int) bool + func (s TimeSorter) Swap(i, j int)