ADABaseAddress.fromPublicKey constructor
ADABaseAddress.fromPublicKey({})
Factory method to create an ADABaseAddress instance from base and stake public keys.
Implementation
factory ADABaseAddress.fromPublicKey(
{required List<int> basePubkeyBytes,
required List<int> stakePubkeyBytes,
ADANetwork network = ADANetwork.mainnet}) {
final baseCredential =
AdaAddressUtils.publicKeyToCredential(basePubkeyBytes);
final stakeCredential =
AdaAddressUtils.publicKeyToCredential(stakePubkeyBytes);
final encode = AdaShelleyAddrEncoder().encodeCredential(
AdaAddressUtils.toAdaStakeCredential(baseCredential), {
"net_tag": network,
"pub_skey": AdaAddressUtils.toAdaStakeCredential(stakeCredential)
});
return ADABaseAddress._(
paymentCredential: baseCredential,
stakeCredential: stakeCredential,
address: encode,
network: network);
}