toBech32Address function

String toBech32Address(
  1. String address
)

Implementation

String toBech32Address(String address) {
  if (address.length == 64) {
    address = crc32Del(address.toU8a()).toHex();
  }
  List<int> addrBz = _convertBits(
    address.toU8a(),
    8,
    5,
  );

  var b32Class = Bech32(HRP, addrBz);

  return bech32.encode(b32Class);
}