ADAPointerAddress.fromBip32 constructor

ADAPointerAddress.fromBip32({
  1. required CardanoByronLegacyBip32 bip32,
  2. required Pointer pointer,
  3. ADANetwork network = ADANetwork.mainnet,
})

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

Implementation

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