ADAByronAddress.fromBip32 constructor

ADAByronAddress.fromBip32({
  1. required CardanoByronLegacyBip32 bip32,
  2. ADANetwork network = ADANetwork.mainnet,
})

Factory constructor to create an ADAByronAddress instance from a Bip32 structure.

Implementation

factory ADAByronAddress.fromBip32(
    {required CardanoByronLegacyBip32 bip32,
    ADANetwork network = ADANetwork.mainnet}) {
  final encode = AdaByronIcarusAddrEncoder().encodeKeyWithInfo(
      bip32.publicKey.compressed, {
    "net_tag": network,
    "chain_code": bip32.publicKey.chainCode.toBytes()
  });
  return ADAByronAddress._(encode.encode(), encode, network);
}