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)
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()
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)
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