ADABaseAddress.fromCredential constructor

ADABaseAddress.fromCredential({
  1. required StakeCred baseCredential,
  2. required StakeCred stakeCredential,
  3. ADANetwork network = ADANetwork.mainnet,
})

Factory method to create an ADABaseAddress instance from payment and stake credentials.

Implementation

factory ADABaseAddress.fromCredential(
    {required StakeCred baseCredential,
    required StakeCred stakeCredential,
    ADANetwork network = ADANetwork.mainnet}) {
  final encode = AdaShelleyAddrEncoder().encodeCredential(
      AdaAddressUtils.toAdaStakeCredential(baseCredential), {
    "net_tag": network,
    "pub_skey": AdaAddressUtils.toAdaStakeCredential(stakeCredential)
  });
  return ADABaseAddress._(
      paymentCredential: baseCredential,
      address: encode,
      stakeCredential: stakeCredential,
      network: network);
}