From a739a062ca44005a1613f072f8f99def3c71c6c0 Mon Sep 17 00:00:00 2001 From: Manolis Mandrapilias <70536101+moneymanolis@users.noreply.github.com> Date: Thu, 10 Nov 2022 09:10:08 +0000 Subject: [PATCH] Feature: QR support for Jade (#1964) --- src/cryptoadvance/specter/devices/jade.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cryptoadvance/specter/devices/jade.py b/src/cryptoadvance/specter/devices/jade.py index 6de58d7de4..2e77736574 100644 --- a/src/cryptoadvance/specter/devices/jade.py +++ b/src/cryptoadvance/specter/devices/jade.py @@ -10,6 +10,9 @@ class Jade(HWIDevice): name = "Jade" icon = "img/devices/jade_icon.svg" + qr_code_support = True + supported_qr_code_format = "crypto-psbt" + sd_card_support = False supports_hwi_toggle_passphrase = False supports_hwi_multisig_display_address = True liquid_support = True @@ -31,3 +34,10 @@ def no_key_found_reason(self, wallet_type, network="main"): if wallet_type == "multisig" and is_liquid(network): return "Jade does not support multisig wallets on Liquid." return super().no_key_found_reason(wallet_type, network) + + # For signing PSBTs via QR code on the Jade + def create_psbts(self, base64_psbt, wallet): + psbts = super().create_psbts(base64_psbt, wallet) + qr_psbt = wallet.fill_psbt(base64_psbt, non_witness=False, xpubs=False) + psbts["qrcode"] = f"{self.supported_qr_code_format}:{qr_psbt}" + return psbts