getAddress method
String
getAddress(
- Bip32KeyIndex firstIndex,
- Bip32KeyIndex secondIndex, {
- ADANetwork network = ADANetwork.mainnet,
Computes and returns a Cardano Byron Legacy address based on two key indices, 'firstIndex' and 'secondIndex'.
Parameters:
- 'firstIndex': The first key index for address derivation.
- 'secondIndex': The second key index for address derivation.
Implementation
String getAddress(
Bip32KeyIndex firstIndex,
Bip32KeyIndex secondIndex, {
ADANetwork network = ADANetwork.mainnet,
}) {
final pubKey = getPublicKey(
firstIndex: firstIndex,
secondIndex: secondIndex,
);
final hdPath = _getDerivationPath(firstIndex, secondIndex);
return AdaByronLegacyAddrEncoder().encodeKey(
pubKey.key.compressed,
chainCode: pubKey.keyData.chainCode.toBytes(),
path: hdPath,
hdPathKey: hdPathKey,
network: network,
);
}