ADAPointerAddress.fromPublicKey constructor

ADAPointerAddress.fromPublicKey({
  1. required List<int> pubkeyBytes,
  2. required Pointer pointer,
  3. ADANetwork network = ADANetwork.mainnet,
})

Factory constructor to create an ADAPointerAddress instance from a public key and a pointer.

Implementation

factory ADAPointerAddress.fromPublicKey(
    {required List<int> pubkeyBytes,
    required Pointer pointer,
    ADANetwork network = ADANetwork.mainnet}) {
  final credential = AdaAddressUtils.publicKeyToCredential(pubkeyBytes);
  final encode = AdaPointerAddrEncoder().encodeCredential(
      AdaAddressUtils.toAdaStakeCredential(credential),
      {"pointer": pointer, "net_tag": network});
  return ADAPointerAddress._(
      paymentCredential: credential,
      pointer: pointer,
      address: encode,
      network: network);
}