Versions in this module Expand all Collapse all v0 v0.12.17 Sep 12, 2024 Changes in this version + const PublicKeySize + const PublicKeySizeECDSA + var ErrUnknownAddressType = errors.New("unknown address type") + func AppDir(appName string, roaming bool) string + func HashBlake2b(buf []byte) []byte + type Address interface + EncodeAddress func() string + IsForPrefix func(prefix Bech32Prefix) bool + Prefix func() Bech32Prefix + ScriptAddress func() []byte + String func() string + func DecodeAddress(addr string, expectedPrefix Bech32Prefix) (Address, error) + type AddressPublicKey struct + func NewAddressPublicKey(publicKey []byte, prefix Bech32Prefix) (*AddressPublicKey, error) + func (a *AddressPublicKey) EncodeAddress() string + func (a *AddressPublicKey) IsForPrefix(prefix Bech32Prefix) bool + func (a *AddressPublicKey) Prefix() Bech32Prefix + func (a *AddressPublicKey) ScriptAddress() []byte + func (a *AddressPublicKey) String() string + type AddressPublicKeyECDSA struct + func NewAddressPublicKeyECDSA(publicKey []byte, prefix Bech32Prefix) (*AddressPublicKeyECDSA, error) + func (a *AddressPublicKeyECDSA) EncodeAddress() string + func (a *AddressPublicKeyECDSA) IsForPrefix(prefix Bech32Prefix) bool + func (a *AddressPublicKeyECDSA) Prefix() Bech32Prefix + func (a *AddressPublicKeyECDSA) ScriptAddress() []byte + func (a *AddressPublicKeyECDSA) String() string + type AddressScriptHash struct + func NewAddressScriptHash(serializedScript []byte, prefix Bech32Prefix) (*AddressScriptHash, error) + func NewAddressScriptHashFromHash(scriptHash []byte, prefix Bech32Prefix) (*AddressScriptHash, error) + func (a *AddressScriptHash) EncodeAddress() string + func (a *AddressScriptHash) HashBlake2b() *[blake2b.Size256]byte + func (a *AddressScriptHash) IsForPrefix(prefix Bech32Prefix) bool + func (a *AddressScriptHash) Prefix() Bech32Prefix + func (a *AddressScriptHash) ScriptAddress() []byte + func (a *AddressScriptHash) String() string + type Amount uint64 + func NewAmount(f float64) (Amount, error) + func (a Amount) Format(u AmountUnit) string + func (a Amount) MulF64(f float64) Amount + func (a Amount) String() string + func (a Amount) ToKAS() float64 + func (a Amount) ToUnit(u AmountUnit) float64 + type AmountUnit int + const AmountKAS + const AmountKiloKAS + const AmountMegaKAS + const AmountMicroKAS + const AmountMilliKAS + const AmountSompi + func (u AmountUnit) String() string + type Bech32Prefix int + const Bech32PrefixKaspa + const Bech32PrefixKaspaDev + const Bech32PrefixKaspaSim + const Bech32PrefixKaspaTest + const Bech32PrefixUnknown + func ParsePrefix(prefixString string) (Bech32Prefix, error) + func (prefix Bech32Prefix) String() string