decodeSaplingExtendedFullViewKey static method

List<int> decodeSaplingExtendedFullViewKey(
  1. String extendedKey, {
  2. String? hrp,
})

Implementation

static List<int> decodeSaplingExtendedFullViewKey(
  String extendedKey, {
  String? hrp,
}) {
  try {
    final decode = Bech32Decoder.decodeWithoutHRP(extendedKey);
    if (hrp != null && decode.$1 == hrp) return decode.$2;
    throw ZcashKeyEncodingError.invalidKeyData(
      "Sapling full view.",
      reason: "Missmatch network hrp.",
    );
  } on ZcashKeyEncodingError {
    rethrow;
  } catch (_) {
    throw ZcashKeyEncodingError.invalidKeyData("Sapling full view.");
  }
}