SaplingViewingKey.fromBytes constructor

SaplingViewingKey.fromBytes(
  1. List<int> bytes
)

Implementation

factory SaplingViewingKey.fromBytes(List<int> bytes) {
  bytes = bytes.exc(
    operation: "SaplingViewingKey",
    name: "bytes",
    reason: "Invalid viewing key bytes length.",
    length: 64,
  );
  final ak = SaplingSpendVerificationKey.fromBytes(bytes.sublist(0, 32));
  final nk = SaplingNullifierDerivingKey.fromBytes(bytes.sublist(32));
  return SaplingViewingKey(ak: ak, nk: nk);
}