ADAByronAddress.fromPublicKey constructor
ADAByronAddress.fromPublicKey({})
Factory constructor to create an ADAByronAddress instance from a public key and chaincode.
Implementation
factory ADAByronAddress.fromPublicKey(
{required List<int> publicKey,
required List<int> chaincode,
List<int>? hdPathKey,
String? hdPath,
ADANetwork network = ADANetwork.mainnet}) {
if (hdPath != null && hdPathKey != null) {
return ADAByronAddress.legacy(
publicKey: publicKey,
chaincode: chaincode,
hdPathKey: hdPathKey,
hdPath: hdPath,
network: network);
}
final encode = AdaByronIcarusAddrEncoder().encodeKeyWithInfo(
publicKey, {"net_tag": network, "chain_code": chaincode});
return ADAByronAddress._(encode.encode(), encode, network);
}