encodeBech32Address static method
String
encodeBech32Address({
- required List<
int> bytes, - required String hrp,
- required ZcashAddressType type,
Implementation
static String encodeBech32Address({
required List<int> bytes,
required String hrp,
required ZcashAddressType type,
}) {
assert([ZcashAddressType.sapling, ZcashAddressType.tex].contains(type));
if (bytes.length != type.lengthInBytes) {
throw AddressConverterException.addressBytesValidationFailed(
reason: "Invalid address bytes length.",
);
}
return ZcashEncodingUtils.encodeBech32Address(
bytes: bytes,
hrp: hrp,
encoding:
type == ZcashAddressType.tex
? Bech32Encodings.bech32m
: Bech32Encodings.bech32,
);
}