def send(self, window, addr): from electrum_dash import paymentrequest r = window.wallet.receive_requests.get(addr) message = r.get('memo', '') if r.get('signature'): pr = paymentrequest.serialize_request(r) else: pr = paymentrequest.make_request(self.config, r) if not pr: return recipient, ok = QInputDialog.getText(window, 'Send request', 'Email invoice to:') if not ok: return recipient = str(recipient) payload = pr.SerializeToString() self.print_error('sending mail to', recipient) try: # FIXME this runs in the GUI thread and blocks it... self.processor.send(recipient, message, payload) except BaseException as e: traceback.print_exc(file=sys.stderr) window.show_message(str(e)) else: window.show_message(_('Request sent.'))
def send(self, window: ElectrumWindow, addr): from electrum_dash import paymentrequest req = window.wallet.receive_requests.get(addr) if not isinstance(req, OnchainInvoice): window.show_error("Only on-chain requests are supported.") return message = req.message if req.bip70: payload = bytes.fromhex(req.bip70) else: pr = paymentrequest.make_request(self.config, req) payload = pr.SerializeToString() if not payload: return recipient, ok = QInputDialog.getText(window, 'Send request', 'Email invoice to:') if not ok: return recipient = str(recipient) self.logger.info(f'sending mail to {recipient}') try: # FIXME this runs in the GUI thread and blocks it... self.processor.send(recipient, message, payload) except BaseException as e: self.logger.exception('') window.show_message(repr(e)) else: window.show_message(_('Request sent.'))
def send(self, addr): from electrum_dash import paymentrequest r = self.wallet.receive_requests.get(addr) message = r.get('memo', '') if r.get('signature'): pr = paymentrequest.serialize_request(r) else: pr = paymentrequest.make_request(self.config, r) if not pr: return recipient, ok = QtGui.QInputDialog.getText(self.win, 'Send request', 'Email invoice to:') if not ok: return recipient = str(recipient) payload = pr.SerializeToString() self.print_error('sending mail to', recipient) try: self.processor.send(recipient, message, payload) except BaseException as e: self.win.show_message(str(e)) return self.win.show_message(_('Request sent.'))