def create_request(self, amount_sat: Optional[int], message: Optional[str], exp_delay: Optional[int], address: Optional[str]):
        """ will create a lightning request if address is None """
        # for receiving
        amount_sat = amount_sat or 0
        assert isinstance(amount_sat, int), f"{amount_sat!r}"
        amount_msat = None if not amount_sat else amount_sat * 1000  # amount_sat in [None, 0] implies undefined.
        message = message or ''
        address = address or None  # converts "" to None
        exp_delay = exp_delay or 0
        timestamp = int(Request._get_cur_time())
        if address is None:
            assert self.has_lightning()
            payment_hash = self.lnworker.create_payment_info(amount_msat=amount_msat, write_to_disk=False)
        else:
            payment_hash = None
        outputs = [PartialTxOutput.from_address_and_value(address, amount_sat)] if address else []
        height = self.adb.get_local_height()
        req = Request(
            outputs=outputs,
            message=message,
            time=timestamp,
            amount_msat=amount_msat,
            exp=exp_delay,
            height=height,
            bip70=None,
            payment_hash=payment_hash,
        )
        key = self.add_payment_request(req)
        return key
 will create a lightning request if address is None 
electrum/wallet.py