ADARewardAddress.fromCredential constructor

ADARewardAddress.fromCredential({
  1. required StakeCred credential,
  2. ADANetwork network = ADANetwork.mainnet,
})

Factory method to create an ADARewardAddress instance from a payment credential.

Implementation

factory ADARewardAddress.fromCredential(
    {required StakeCred credential,
    ADANetwork network = ADANetwork.mainnet}) {
  final encode = AdaShelleyStakingAddrEncoder().encodeCredential(
      AdaAddressUtils.toAdaStakeCredential(credential), {"net_tag": network});
  return ADARewardAddress._(
      paymentCredential: credential, address: encode, network: network);
}