ADAPointerAddress.fromCip1852 constructor

ADAPointerAddress.fromCip1852({
  1. required Cip1852 cip1585,
  2. required Pointer pointer,
  3. ADANetwork network = ADANetwork.mainnet,
})

Factory constructor to create an ADAPointerAddress instance from a CIP1852 structure and a pointer.

Implementation

factory ADAPointerAddress.fromCip1852(
    {required Cip1852 cip1585,
    required Pointer pointer,
    ADANetwork network = ADANetwork.mainnet}) {
  final credential =
      AdaAddressUtils.publicKeyToCredential(cip1585.publicKey.compressed);
  final encode = AdaPointerAddrEncoder().encodeCredential(
      AdaAddressUtils.toAdaStakeCredential(credential),
      {"pointer": pointer, "net_tag": network});
  return ADAPointerAddress._(
      paymentCredential: credential,
      pointer: pointer,
      address: encode,
      network: network);
}