function _toFutureSegwitAddress(output, network) {
  const data = output.slice(2);
  if (
    data.length < FUTURE_SEGWIT_MIN_SIZE ||
    data.length > FUTURE_SEGWIT_MAX_SIZE
  )
    throw new TypeError('Invalid program length for segwit address');
  const version = output[0] - FUTURE_SEGWIT_VERSION_DIFF;
  if (
    version < FUTURE_SEGWIT_MIN_VERSION ||
    version > FUTURE_SEGWIT_MAX_VERSION
  )
    throw new TypeError('Invalid version for segwit address');
  if (output[1] !== data.length)
    throw new TypeError('Invalid script for segwit address');
  if (WARNING_STATES[0] === false) {
    console.warn(FUTURE_SEGWIT_VERSION_WARNING);
    WARNING_STATES[0] = true;
  }
  return toBech32(data, version, network.bech32);
}
Converts an output buffer to a future segwit address.
@param output - The output buffer.
@param network - The network object.
@returns The future segwit address.
@throws {TypeError} If the program length or version is invalid for segwit address.