toAddress method

String toAddress(
  1. NetworkInfo networkType
)

returns the address's string encoding (Bech32)

Implementation

String toAddress(NetworkInfo networkType) {
  final bytes = hexToBytes(_program);
  final sw = bech32.encodeBech32(networkType.bech32, segwitNumVersion, bytes);
  if (sw == null) {
    throw ArgumentError("invalid address");
  }

  return sw;
}