示例#1
0
 def do_paste(self):
     data = self.app._clipboard.paste()
     if not data:
         self.app.show_info(_("Clipboard is empty"))
         return
     # try to decode as transaction
     try:
         raw_tx = tx_from_str(data)
         tx = Transaction(raw_tx)
         tx.deserialize()
     except:
         tx = None
     if tx:
         self.app.tx_dialog(tx)
         return
     # try to decode as URI/address
     self.set_URI(data)
示例#2
0
 def do_paste(self):
     data = self.app._clipboard.paste()
     if not data:
         self.app.show_info(_("Clipboard is empty"))
         return
     # try to decode as transaction
     try:
         raw_tx = tx_from_str(data)
         tx = Transaction(raw_tx)
         tx.deserialize()
     except:
         tx = None
     if tx:
         self.app.tx_dialog(tx)
         return
     # try to decode as URI/address
     if data.startswith('ln'):
         self.set_ln_invoice(data.rstrip())
     else:
         self.set_URI(data)
         # save automatically
         self.save_invoice()
示例#3
0
 def do_paste(self):
     data = self.app._clipboard.paste().strip()
     if not data:
         self.app.show_info(_("Clipboard is empty"))
         return
     # try to decode as transaction
     try:
         raw_tx = tx_from_str(data)
         tx = Transaction(raw_tx)
         tx.deserialize()
     except:
         tx = None
     if tx:
         self.app.tx_dialog(tx)
         return
     lower = data.lower()
     if lower.startswith('lightning:ln'):
         lower = lower[10:]
     # try to decode as URI/address
     if lower.startswith('ln'):
         self.set_ln_invoice(lower)
     else:
         self.set_URI(data)
示例#4
0
def combine_transactions(transaction_bin):
    transactions = list(
        map(lambda tx_bin: Transaction(tx_from_str(tx_bin)), transaction_bin))
    tx0 = transactions[0]
    tx0.deserialize(True)
    return tx0