addressAt method

String addressAt(
  1. DiversifierIndex index, {
  2. Bip44Changes scope = Bip44Changes.chainExt,
})

Implementation

String addressAt(
  DiversifierIndex index, {
  Bip44Changes scope = Bip44Changes.chainExt,
}) {
  final viewKey = getViewKey(scope: scope);
  final addressBytes = viewKey.addressAt(index).toBytes();
  switch (coinConf.type) {
    case EllipticCurveTypes.redJubJub:
      return coinConf.encodeAddress(
        EncodeAddressDefaultParams(pubKey: addressBytes),
      );
    default:
      return ZCashUnifiedAddrEncoder().encodeUnifiedReceivers([
        ReceiverOrchard(
          data: addressBytes,
          mode: UnifiedReceiverMode.address,
        ),
      ]);
  }
}