Documentation ¶
Overview ¶
Package address provides utility functionality to encode and decode bech32 based addresses.
Index ¶
Constants ¶
View Source
const ( // OutputIDLength defines the length of an OutputID. OutputIDLength = blake2b.Size256 + 2 // Blake2b160Length defines the size of a BLAKE2b-160 hash in bytes. Blake2b160Length = 20 )
Variables ¶
View Source
var ( ErrInvalidPrefix = errors.New("invalid prefix") ErrInvalidVersion = errors.New("invalid version") ErrInvalidLength = errors.New("invalid length") )
Errors returned during address parsing.
Functions ¶
Types ¶
type AliasAddress ¶
type AliasAddress struct {
// contains filtered or unexported fields
}
func AliasAddressFromOutputID ¶
func AliasAddressFromOutputID(outputID [OutputIDLength]byte) AliasAddress
AliasAddressFromOutputID returns the alias address computed from a given OutputID.
func (AliasAddress) Bytes ¶
func (a AliasAddress) Bytes() []byte
func (AliasAddress) String ¶
func (a AliasAddress) String() string
func (AliasAddress) Version ¶
func (AliasAddress) Version() Version
type Ed25519Address ¶
type Ed25519Address struct {
// contains filtered or unexported fields
}
func AddressFromPublicKey ¶
func AddressFromPublicKey(key ed25519.PublicKey) Ed25519Address
AddressFromPublicKey creates an address from a 32-byte hash.
func (Ed25519Address) Bytes ¶
func (a Ed25519Address) Bytes() []byte
func (Ed25519Address) String ¶
func (a Ed25519Address) String() string
func (Ed25519Address) Version ¶
func (Ed25519Address) Version() Version
type NFTAddress ¶
type NFTAddress struct {
// contains filtered or unexported fields
}
func NFTAddressFromOutputID ¶
func NFTAddressFromOutputID(outputID [OutputIDLength]byte) NFTAddress
NFTAddressFromOutputID returns the alias address computed from a given OutputID.
func (NFTAddress) Bytes ¶
func (a NFTAddress) Bytes() []byte
func (NFTAddress) String ¶
func (a NFTAddress) String() string
func (NFTAddress) Version ¶
func (NFTAddress) Version() Version
Click to show internal directories.
Click to hide internal directories.