def get_card(self, item: Invoice): status = self.app.wallet.get_invoice_status(item) status_str = item.get_status_str(status) assert isinstance(item, OnchainInvoice) key = item.id address = item.get_address() is_bip70 = bool(item.bip70) return { 'is_bip70': is_bip70, 'screen': self, 'status': status, 'status_str': status_str, 'key': key, 'memo': item.message or _('No Description'), 'address': address, 'amount': self.app.format_amount_and_units(item.get_amount_sat() or 0), }
def get_card(self, req: Invoice) -> Dict[str, Any]: assert isinstance(req, OnchainInvoice) address = req.get_address() key = address amount = req.get_amount_sat() description = req.message status = self.app.wallet.get_request_status(key) status_str = req.get_status_str(status) ci = {} ci['screen'] = self ci['address'] = address ci['key'] = key ci['amount'] = self.app.format_amount_and_units(amount) if amount else '' ci['memo'] = description or _('No Description') ci['status'] = status ci['status_str'] = status_str return ci
def update_item(self, key, invoice: Invoice): model = self.std_model for row in range(0, model.rowCount()): item = model.item(row, 0) if item.data(ROLE_REQUEST_ID) == key: break else: return status_item = model.item(row, self.Columns.STATUS) status = self.parent.wallet.get_invoice_status(invoice) status_str = invoice.get_status_str(status) status_item.setText(status_str) status_item.setIcon(read_QIcon(pr_icons.get(status)))
def get_card(self, item: Invoice) -> Dict[str, Any]: invoice_ext = self.app.wallet.get_invoice_ext(item.id) status = self.app.wallet.get_invoice_status(item) status_str = item.get_status_str(status) key = self.app.wallet.get_key_for_outgoing_invoice(item) assert isinstance(item, OnchainInvoice) address = item.get_address() is_bip70 = bool(item.bip70) amount_str = self.app.format_amount_and_units(item.get_amount_sat() or 0) if invoice_ext.is_ps: amount_str = _('PrivateSend') + ' ' + amount_str return { 'is_bip70': is_bip70, 'screen': self, 'status': status, 'status_str': status_str, 'key': key, 'memo': item.message or _('No Description'), 'address': address, 'amount': amount_str, }