toSegwitAddress method

P2wpkhAddress toSegwitAddress({
  1. bool compressed = true,
})

returns the corresponding P2wpkhAddress object

Implementation

P2wpkhAddress toSegwitAddress({bool compressed = true}) {
  final h16 = _toHash160(compressed: compressed);
  final toHex = bytesToHex(h16);

  return P2wpkhAddress(program: toHex);
}