Documentation ¶
Index ¶
- Constants
- func CalculatePubKeyHash(pubKey [PubKeyLength]byte) ([PubKeyHashLength]byte, error)
- type Address
- func (a Address) Equal(other wallet.Address) bool
- func (a Address) GetMainnetAddressOfPubKey() (string, error)
- func (a Address) GetMainnetAddressOfPubKeyHash() (string, error)
- func (a Address) GetPubKey() [PubKeyLength]byte
- func (a Address) GetPubKeyHash() [PubKeyHashLength]byte
- func (a Address) GetPubKeyHashSlice() []byte
- func (a Address) GetPubKeySlice() []byte
- func (a Address) GetTestnetAddressOfPubKey() (string, error)
- func (a Address) GetTestnetAddressOfPubKeyHash() (string, error)
- func (a Address) MarshalBinary() ([]byte, error)
- func (a *Address) SetPaymentPubKeyHash(paymentPubKeyHash [PubKeyHashLength]byte)
- func (a *Address) SetPaymentPubKeyHashFromHexString(paymentPubKeyHash string) error
- func (a *Address) SetPaymentPubKeyHashFromSlice(paymentPubKeyHash []byte) error
- func (a Address) String() string
- func (a *Address) UnmarshalBinary(data []byte) error
Constants ¶
const AddressLength = PubKeyLength + PubKeyHashLength
const MainnetIdentifier = "addr"
const PubKeyHashLength = blake2b224.Size224
PubKeyHashLength is the length of Cardano public key hashes using blake2b-224.
const PubKeyLength = 32
PubKeyLength is the length of the public verification key part of a Cardano `ed25519` keypair in bytes.
const TestnetIdentifier = "addr_test"
Variables ¶
This section is empty.
Functions ¶
func CalculatePubKeyHash ¶
func CalculatePubKeyHash(pubKey [PubKeyLength]byte) ([PubKeyHashLength]byte, error)
Types ¶
type Address ¶
type Address struct {
// contains filtered or unexported fields
}
Address carries a public key that represents the public verification key part of a Cardano `ed25519` keypair.
func MakeAddressFromPubKeyByteArray ¶
func MakeAddressFromPubKeyByteArray(pubKey [PubKeyLength]byte) Address
MakeAddressFromPubKeyByteArray returns a new Address for the given public key bytes. Note: This does not set the public key hash!
func MakeAddressFromPubKeyByteSlice ¶
MakeAddressFromPubKeyByteSlice returns a new Address for the given public key bytes. Note: This does not set the public key hash!
func MakeAddressFromSinglePubKey ¶
MakeAddressFromSinglePubKey creates an Address from a single public key. This means the payment and signing public keys are the same. The (payment) public key hash is the blake2b-224 hash of the given public key.
func (Address) Equal ¶
Equal returns true, iff the given address is of type Address and their public keys are equal.
func (Address) GetMainnetAddressOfPubKey ¶
GetMainnetAddressOfPubKey returns the mainnet address string representation of this addresses' public key (i.e. `addr1...`).
func (Address) GetMainnetAddressOfPubKeyHash ¶
GetMainnetAddressOfPubKeyHash returns the mainnet address string representation of this addresses' payment public key hash (i.e. `addr1...`).
func (Address) GetPubKey ¶
func (a Address) GetPubKey() [PubKeyLength]byte
GetPubKey returns the public key of this address.
func (Address) GetPubKeyHash ¶
func (a Address) GetPubKeyHash() [PubKeyHashLength]byte
GetPubKeyHash returns the public key hash associated with payments to this address.
func (Address) GetPubKeyHashSlice ¶
func (Address) GetPubKeySlice ¶
GetPubKeySlice returns the public key of this address. The returned slice is of length PubKeyLength.
func (Address) GetTestnetAddressOfPubKey ¶
GetTestnetAddressOfPubKey returns the testnet address string representation of this addresses' public key (i.e. `addr_test1...`).
func (Address) GetTestnetAddressOfPubKeyHash ¶
GetTestnetAddressOfPubKeyHash returns the testnet address string representation of this addresses' payment public key hash (i.e. `addr1...`).
func (Address) MarshalBinary ¶
MarshalBinary decodes this address into its byte representation. The returned byte slice has length PubKeyLength + PubKeyHashLength.
func (*Address) SetPaymentPubKeyHash ¶
func (a *Address) SetPaymentPubKeyHash(paymentPubKeyHash [PubKeyHashLength]byte)
func (*Address) SetPaymentPubKeyHashFromHexString ¶
func (*Address) SetPaymentPubKeyHashFromSlice ¶
func (*Address) UnmarshalBinary ¶
UnmarshalBinary expects a byte slice of length PubKeyLength + PubKeyHashLength and decodes it into the receiver Address.