hdPathFromAddress method

Bip32Path hdPathFromAddress(
  1. String address
)

Decodes and retrieves the BIP32 HD path from a Cardano Byron Legacy address.

This method takes a Cardano Byron Legacy address, decodes it, and decrypts the embedded HD path using the provided hdPathKey.

Parameters:

  • address: The Cardano Byron Legacy address to decode and extract the HD path from.

Returns:

  • A BIP32Path object representing the hierarchical deterministic (HD) path.

Implementation

Bip32Path hdPathFromAddress(String address) {
  final addrDecBytes = AdaByronAddrDecoder().decodeAddr(address);
  final hdPathDecBytes = AdaByronAddrDecoder.decryptHdPath(
    AdaByronAddrDecoder.splitDecodedBytes(addrDecBytes).item2,
    hdPathKey,
  );
  return hdPathDecBytes;
}