Пример #1
0
 def get_card(self, req: Invoice) -> Dict[str, Any]:
     assert isinstance(req, OnchainInvoice)
     address = req.get_address()
     key = self.app.wallet.get_key_for_receive_request(req)
     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
Пример #2
0
 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),
     }
Пример #3
0
 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,
     }