diff --git a/basicswap/bin/prepare.py b/basicswap/bin/prepare.py index 0e440e9..247425e 100755 --- a/basicswap/bin/prepare.py +++ b/basicswap/bin/prepare.py @@ -2106,7 +2106,12 @@ def initialise_wallets( continue try: ci = swap_client.ci(c) - if hasattr(ci, "canExportToElectrum") and ci.canExportToElectrum(): + coin_settings = settings["chainclients"].get(coin_name, {}) + is_electrum = coin_settings.get("connection_type") == "electrum" + can_export = ( + hasattr(ci, "canExportToElectrum") and ci.canExportToElectrum() + ) + if can_export or (is_electrum and hasattr(ci, "getAccountKey")): seed_key = swap_client.getWalletKey(c, 1) account_key = ci.getAccountKey(seed_key, zprv_prefix) extended_keys[getCoinName(c)] = account_key diff --git a/basicswap/templates/wallet.html b/basicswap/templates/wallet.html index f3de993..0293a75 100644 --- a/basicswap/templates/wallet.html +++ b/basicswap/templates/wallet.html @@ -337,6 +337,16 @@ {{ w.expected_seed }} {% endif %} + {% if w.account_key %} + + Extended Private Key: + + •••••••••••••••• + + + + + {% endif %} diff --git a/basicswap/ui/page_wallet.py b/basicswap/ui/page_wallet.py index 8b4ff4f..449d349 100644 --- a/basicswap/ui/page_wallet.py +++ b/basicswap/ui/page_wallet.py @@ -473,6 +473,15 @@ def page_wallet(self, url_split, post_string): getattr(ci, "_connection_type", "rpc") == "electrum" ) + if hasattr(ci, "getAccountKey") and k not in (Coins.XMR, Coins.WOW): + try: + chain = swap_client.chain + zprv_prefix = 0x04B2430C if chain == "mainnet" else 0x045F18BC + seed_key = swap_client.getWalletKey(k, 1) + wallet_data["account_key"] = ci.getAccountKey(seed_key, zprv_prefix) + except Exception: + pass + fee_rate, fee_src = swap_client.getFeeRateForCoin(k) est_fee = swap_client.estimateWithdrawFee(k, fee_rate) wallet_data["fee_rate"] = ci.format_amount(int(fee_rate * ci.COIN()))