cardano::ByronAddress class

A Cardano Byron era address object.

Public types

struct Attributes
The attributes of a ByronAddress.
enum class Type { pubkey, script, redeem }
Address type enum contained within the ByronAddress class scope.

Public static functions

static auto fromBase58(std::string addr) →  ByronAddress
static auto fromCBOR(std::span<const uint8_t> cbor_data) →  ByronAddress
Factory method to create a ByronAddress object from a CBOR encoded address.
static auto fromRootKey(const bip32_ed25519::PrivateKey& xprv, std::span<const uint32_t> derivation_path, uint32_t network_magic = 0) →  ByronAddress
Factory method to create a ByronAddress object from a root key.

Constructors, destructors, conversion operators

ByronAddress(std::array<uint8_t, KEY_HASH_LENGTH> root, ByronAddress::Attributes attrs, ByronAddress::Type type)
Constructor - take ownership of the inputs.

Public functions

auto toBase58() const →  std::string
Serialize to Base58 encoded string.
auto toCBOR() const →  std::vector<uint8_t>
Serialize to vector of CBOR bytes.

Function documentation

static ByronAddress cardano::ByronAddress::fromBase58(std::string addr)

Parameters
addr The base58 encoded address.
Returns The created ByronAddress object.

Factory method to create a ByronAddress object from a base58 encoded address.

static ByronAddress cardano::ByronAddress::fromCBOR(std::span<const uint8_t> cbor_data)

Factory method to create a ByronAddress object from a CBOR encoded address.

Parameters
cbor_data The CBOR encoded address.
Returns The created ByronAddress object.

static ByronAddress cardano::ByronAddress::fromRootKey(const bip32_ed25519::PrivateKey& xprv, std::span<const uint32_t> derivation_path, uint32_t network_magic = 0)

Factory method to create a ByronAddress object from a root key.

Parameters
xprv The root private key.
derivation_path The address derivation path.
network_magic The network magic (if not 0, then its a testnet).
Returns The created ByronAddress object.