Repository: mintlayer/mintlayer-core (rust)

Issue:
[Feature] Add Option to Disable QR Code Output in the Mintlayer wallet-cli
# Add Option to Disable QR Code Output in the Mintlayer wallet-cli

## Summary
Currently, the Mintlayer wallet-cli displays transaction data in both binary form and as an ASCII QR code (for example, in account-`sign-raw-transaction` or `transaction-create-from-cold-input`). While the QR code can be useful for air-gapped cold wallet implementations, it can also clutter the output and make it more difficult to locate and read the binary transaction data. This feature request proposes adding a command-line option or environment variable to enable or disable QR code output, giving users more control over the CLI’s appearance and improving its readability.

---

## Proposed Solution

1. **Command-Line Option**  
   Introduce a `--no-qr` or `--disable-qr` flag when launching `wallet-cli`

2. **Environment Variable**  
   Allow an environment variable (e.g., `ML_DISABLE_QR=false`) to globally disable QR code output.  
  

Pull request description:
Add option to not show QR code in Wallet CLI
Add a startup option for Wallet CLI to disable the output of QR codes in responses.

Closes #1859 

Patch:
diff --git a/Cargo.lock b/Cargo.lock
index c9bbfcc28..b3fdc4652 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -462,7 +462,7 @@ dependencies = [
  "wayland-backend",
  "wayland-client",
  "wayland-protocols",
- "zbus 5.5.0",
+ "zbus 5.4.0",
 ]
 
 [[package]]
@@ -1123,9 +1123,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
 
 [[package]]
 name = "cc"
-version = "1.2.13"
+version = "1.2.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda"
+checksum = "755717a7de9ec452bf7f3f1a3099085deabd7f2962b861dae91ecd7a365903d2"
 dependencies = [
  "jobserver",
  "libc",
@@ -1611,26 +1611,6 @@ dependencies = [
  "utxo",
 ]
 
-[[package]]
-name = "const_format"
-version = "0.2.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd"
-dependencies = [
- "const_format_proc_macros",
-]
-
-[[package]]
-name = "const_format_proc_macros"
-version = "0.2.34"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-xid",
-]
-
 [[package]]
 name = "constraints-value-accumulator"
 version = "1.0.2"
@@ -2085,9 +2065,9 @@ dependencies = [
 
 [[package]]
 name = "data-encoding"
-version = "2.8.0"
+version = "2.7.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010"
+checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f"
 
 [[package]]
 name = "dconf_rs"
@@ -3220,9 +3200,9 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df"
 
 [[package]]
 name = "hickory-client"
-version = "0.24.3"
+version = "0.24.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ea0169f8b21726527197c7190e5a23b7fd514a3e04f99c571e05631e1f8a9c8"
+checksum = "949d2fef0bbdd31a0f6affc6bf390b4a0017492903eff6f7516cb382d9e85536"
 dependencies = [
  "cfg-if",
  "data-encoding",
@@ -3239,9 +3219,9 @@ dependencies = [
 
 [[package]]
 name = "hickory-proto"
-version = "0.24.3"
+version = "0.24.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ad3d6d98c648ed628df039541a5577bee1a7c83e9e16fe3dbedeea4cdfeb971"
+checksum = "447afdcdb8afb9d0a852af6dc65d9b285ce720ed7a59e42a8bf2e931c67bc1b5"
 dependencies = [
  "async-trait",
  "cfg-if",
@@ -3263,9 +3243,9 @@ dependencies = [
 
 [[package]]
 name = "hickory-server"
-version = "0.24.3"
+version = "0.24.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b75179158e7267618f0a587d2337f05e9d71ab3cb03ac2bde2ea5969bc65695"
+checksum = "35e6d1c2df0614595224b32479c72dd6fc82c9bda85962907c45fdb95a691489"
 dependencies = [
  "async-trait",
  "bytes",
@@ -3524,7 +3504,7 @@ dependencies = [
  "num-traits",
  "once_cell",
  "palette",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "smol_str",
  "thiserror",
  "web-time",
@@ -3548,7 +3528,7 @@ dependencies = [
  "futures",
  "iced_core",
  "log",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "tokio",
  "wasm-bindgen-futures",
  "wasm-timer",
@@ -3563,7 +3543,7 @@ dependencies = [
  "cosmic-text",
  "etagere",
  "lru",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "wgpu",
 ]
 
@@ -3583,7 +3563,7 @@ dependencies = [
  "lyon_path",
  "once_cell",
  "raw-window-handle",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "thiserror",
  "unicode-segmentation",
 ]
@@ -3625,7 +3605,7 @@ dependencies = [
  "iced_graphics",
  "kurbo",
  "log",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "softbuffer",
  "tiny-skia",
 ]
@@ -3646,7 +3626,7 @@ dependencies = [
  "log",
  "lyon",
  "once_cell",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "thiserror",
  "wgpu",
 ]
@@ -3662,7 +3642,7 @@ dependencies = [
  "num-traits",
  "once_cell",
  "ouroboros",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "thiserror",
  "unicode-segmentation",
 ]
@@ -3677,7 +3657,7 @@ dependencies = [
  "iced_graphics",
  "iced_runtime",
  "log",
- "rustc-hash 2.1.1",
+ "rustc-hash 2.1.0",
  "thiserror",
  "tracing",
  "wasm-bindgen-futures",
@@ -5321,9 +5301,9 @@ dependencies = [
 
 [[package]]
 name = "once_cell"
-version = "1.20.3"
+version = "1.20.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e"
+checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775"
 
 [[package]]
 name = "oneshot"
@@ -5611,30 +5591,28 @@ dependencies = [
 
 [[package]]
 name = "parity-scale-codec"
-version = "3.7.4"
+version = "3.6.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9fde3d0718baf5bc92f577d652001da0f8d54cd03a7974e118d04fc888dc23d"
+checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee"
 dependencies = [
  "arrayvec",
  "bitvec",
  "byte-slice-cast",
- "const_format",
  "impl-trait-for-tuples",
  "parity-scale-codec-derive",
- "rustversion",
  "serde",
 ]
 
 [[package]]
 name = "parity-scale-codec-derive"
-version = "3.7.4"
+version = "3.6.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "581c837bb6b9541ce7faa9377c20616e4fb7650f6b0f68bc93c827ee504fb7b3"
+checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2",
  "quote",
- "syn 2.0.98",
+ "syn 1.0.109",
 ]
 
 [[package]]
@@ -6071,9 +6049,9 @@ dependencies = [
 
 [[package]]
 name = "psl"
-version = "2.1.83"
+version = "2.1.82"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91c0f85b904f55a9a0bfc0394a7606114bcaf456d4183183cb8c00150deb67ff"
+checksum = "2d460333b9d744945e0b9abd5469056aa925d526d48a458d6afc06eea9cbe206"
 dependencies = [
  "psl-types",
 ]
@@ -6182,7 +6160,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
 dependencies = [
  "rand_chacha 0.9.0",
  "rand_core 0.9.0",
- "zerocopy 0.8.17",
+ "zerocopy 0.8.16",
 ]
 
 [[package]]
@@ -6240,7 +6218,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff"
 dependencies = [
  "getrandom 0.3.1",
- "zerocopy 0.8.17",
+ "zerocopy 0.8.16",
 ]
 
 [[package]]
@@ -6757,9 +6735,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
 
 [[package]]
 name = "rustc-hash"
-version = "2.1.1"
+version = "2.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
+checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497"
 
 [[package]]
 name = "rustc-hex"
@@ -6937,9 +6915,9 @@ dependencies = [
 
 [[package]]
 name = "scc"
-version = "2.3.3"
+version = "2.3.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea091f6cac2595aa38993f04f4ee692ed43757035c36e67c180b6828356385b1"
+checksum = "bef5b45d2864e2f8158e9d1e3d3284add4aeed8cd67e59009d05905b67d5b2d7"
 dependencies = [
  "sdd",
 ]
@@ -9876,9 +9854,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
 
 [[package]]
 name = "winit"
-version = "0.30.9"
+version = "0.30.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a809eacf18c8eca8b6635091543f02a5a06ddf3dad846398795460e6e0ae3cc0"
+checksum = "f5d74280aabb958072864bff6cfbcf9025cf8bfacdde5e32b5e12920ef703b0f"
 dependencies = [
  "ahash 0.8.11",
  "android-activity",
@@ -9928,9 +9906,9 @@ dependencies = [
 
 [[package]]
 name = "winnow"
-version = "0.7.2"
+version = "0.7.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603"
+checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f"
 dependencies = [
  "memchr",
 ]
@@ -10154,9 +10132,9 @@ dependencies = [
 
 [[package]]
 name = "zbus"
-version = "5.5.0"
+version = "5.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59c333f648ea1b647bc95dc1d34807c8e25ed7a6feff3394034dc4776054b236"
+checksum = "cbddd8b6cb25d5d8ec1b23277b45299a98bfb220f1761ca11e186d5c702507f8"
 dependencies = [
  "async-broadcast",
  "async-recursion",
@@ -10164,7 +10142,7 @@ dependencies = [
  "enumflags2",
  "event-listener",
  "futures-core",
- "futures-lite",
+ "futures-util",
  "hex",
  "nix",
  "ordered-stream",
@@ -10177,9 +10155,9 @@ dependencies = [
  "windows-sys 0.59.0",
  "winnow",
  "xdg-home",
- "zbus_macros 5.5.0",
+ "zbus_macros 5.4.0",
  "zbus_names 4.2.0",
- "zvariant 5.4.0",
+ "zvariant 5.3.0",
 ]
 
 [[package]]
@@ -10197,16 +10175,16 @@ dependencies = [
 
 [[package]]
 name = "zbus_macros"
-version = "5.5.0"
+version = "5.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f325ad10eb0d0a3eb060203494c3b7ec3162a01a59db75d2deee100339709fc0"
+checksum = "dac404d48b4e9cf193c8b49589f3280ceca5ff63519e7e64f55b4cf9c47ce146"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2",
  "quote",
  "syn 2.0.98",
  "zbus_names 4.2.0",
- "zvariant 5.4.0",
+ "zvariant 5.3.0",
  "zvariant_utils 3.2.0",
 ]
 
@@ -10230,7 +10208,7 @@ dependencies = [
  "serde",
  "static_assertions",
  "winnow",
- "zvariant 5.4.0",
+ "zvariant 5.3.0",
 ]
 
 [[package]]
@@ -10251,11 +10229,11 @@ dependencies = [
 
 [[package]]
 name = "zerocopy"
-version = "0.8.17"
+version = "0.8.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa91407dacce3a68c56de03abe2760159582b846c6a4acd2f456618087f12713"
+checksum = "7b8c07a70861ce02bad1607b5753ecb2501f67847b9f9ada7c160fff0ec6300c"
 dependencies = [
- "zerocopy-derive 0.8.17",
+ "zerocopy-derive 0.8.16",
 ]
 
 [[package]]
@@ -10271,9 +10249,9 @@ dependencies = [
 
 [[package]]
 name = "zerocopy-derive"
-version = "0.8.17"
+version = "0.8.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06718a168365cad3d5ff0bb133aad346959a2074bd4a85c121255a11304a8626"
+checksum = "5226bc9a9a9836e7428936cde76bb6b22feea1a8bfdbc0d241136e4d13417e25"
 dependencies = [
  "proc-macro2",
  "quote",
@@ -10358,9 +10336,9 @@ dependencies = [
 
 [[package]]
 name = "zvariant"
-version = "5.4.0"
+version = "5.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2df9ee044893fcffbdc25de30546edef3e32341466811ca18421e3cd6c5a3ac"
+checksum = "31c951c21879c6e1d46ac5adfc34f698fefb465d498cf4ac87545849bd71bb5a"
 dependencies = [
  "endi",
  "enumflags2",
@@ -10368,7 +10346,7 @@ dependencies = [
  "static_assertions",
  "url",
  "winnow",
- "zvariant_derive 5.4.0",
+ "zvariant_derive 5.3.0",
  "zvariant_utils 3.2.0",
 ]
 
@@ -10387,9 +10365,9 @@ dependencies = [
 
 [[package]]
 name = "zvariant_derive"
-version = "5.4.0"
+version = "5.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "74170caa85b8b84cc4935f2d56a57c7a15ea6185ccdd7eadb57e6edd90f94b2f"
+checksum = "9eeb539471af098d9e63faf428c71ac4cd4efe0b5baa3c8a6b991c5f2543b70e"
 dependencies = [
  "proc-macro-crate",
  "proc-macro2",
diff --git a/node-gui/backend/src/backend_impl.rs b/node-gui/backend/src/backend_impl.rs
index 5fbe59f57..c3bb30227 100644
--- a/node-gui/backend/src/backend_impl.rs
+++ b/node-gui/backend/src/backend_impl.rs
@@ -387,6 +387,7 @@ impl Backend {
                 broadcast_to_mempool: true,
             },
             WalletRpcHandlesClient::new(wallet_rpc.clone(), None),
+            None,
         )
         .await;
         let best_block = wallet_rpc
@@ -545,6 +546,7 @@ impl Backend {
                 broadcast_to_mempool: true,
             },
             WalletRpcHandlesClient::new(wallet_rpc.clone(), None),
+            None,
         )
         .await;
         let encryption_state = match wallet_rpc.remove_private_key_encryption().await {
diff --git a/wallet/wallet-cli-commands/src/command_handler/mod.rs b/wallet/wallet-cli-commands/src/command_handler/mod.rs
index 78ba75027..712b0c862 100644
--- a/wallet/wallet-cli-commands/src/command_handler/mod.rs
+++ b/wallet/wallet-cli-commands/src/command_handler/mod.rs
@@ -61,16 +61,19 @@ pub struct CommandHandler<W> {
     config: ControllerConfig,
 
     wallet: WalletWithState<W>,
+
+    no_qr: bool,
 }
 
 impl<W, E> CommandHandler<W>
 where
     W: WalletInterface<Error = E> + Send + Sync + 'static,
 {
-    pub async fn new(config: ControllerConfig, wallet: W) -> Self {
+    pub async fn new(config: ControllerConfig, wallet: W, no_qr: Option<bool>) -> Self {
         CommandHandler {
             config,
             wallet: WalletWithState::new(wallet).await,
+            no_qr: no_qr.unwrap_or(false),
         }
     }
 
@@ -537,19 +540,29 @@ where
                         let summary = signed_tx.transaction().text_summary(chain_config);
                         let result_hex: HexEncoded<SignedTransaction> = signed_tx.into();
 
-                        let qr_code_string = qrcode_or_error_string(&result_hex.to_string());
+                        let qr_code_string = (!self.no_qr)
+                            .then(|| {
+                                let qr_code = qrcode_or_error_string(&result_hex.to_string());
+                                format!("\n\nOr scan the Qr code with it:\n\n{qr_code}")
+                            })
+                            .unwrap_or_default();
 
                         format!(
                             "The transaction has been fully signed and is ready to be broadcast to network. \
                              You can use the command `node-submit-transaction` in a wallet connected to the internet (this one or elsewhere). \
-                             Pass the following data to the wallet to broadcast:\n\n{result_hex}\n\n\
-                             Or scan the Qr code with it:\n\n{qr_code_string}\n\n{summary}")
+                             Pass the following data to the wallet to broadcast:\n\n{result_hex}\
+                             {qr_code_string}\n\n{summary}")
                     }
                     PartialOrSignedTx::Partial(partially_signed_tx) => {
                         let result_hex: HexEncoded<PartiallySignedTransaction> =
                             partially_signed_tx.into();
 
-                        let qr_code_string = qrcode_or_error_string(&result_hex.to_string());
+                        let qr_code_string = (!self.no_qr)
+                            .then(|| {
+                                let qr_code = qrcode_or_error_string(&result_hex.to_string());
+                                format!("\n\nOr scan the Qr code with it:\n\n{qr_code}")
+                            })
+                            .unwrap_or_default();
 
                         let prev_sigs = result
                             .previous_signatures
@@ -568,8 +581,8 @@ where
                             "Not all transaction inputs have been signed. This wallet does not have all the keys for that.\n\
                              The signatures states before signing were:\n{prev_sigs}\n\
                              and the current signature states are:\n{current_sigs}\n\
-                             Pass the following string into the wallet that has appropriate keys for the inputs to sign what is left:\n\n{result_hex}\n\n\
-                             Or scan the Qr code with it:\n\n{qr_code_string}"
+                             Pass the following string into the wallet that has appropriate keys for the inputs to sign what is left:\n\n{result_hex}\
+                             {qr_code_string}"
                         )
                     }
                 };
@@ -585,12 +598,15 @@ where
                 let result =
                     wallet.sign_challenge_hex(selected_account, challenge, address).await?;
 
-                let qr_code_string = qrcode_or_error_string(&result);
+                let qr_code_string = (!self.no_qr)
+                    .then(|| {
+                        let qr_code = qrcode_or_error_string(&result);
+                        format!("\n\nThe following qr code also contains the signature for easy transport:\n{qr_code}")
+                    })
+                    .unwrap_or_default();
 
                 Ok(ConsoleCommand::Print(format!(
-                    "The generated hex encoded signature is\n\n{result}
-                    \n\n\
-                    The following qr code also contains the signature for easy transport:\n{qr_code_string}",
+                    "The generated hex encoded signature is\n\n{result}{qr_code_string}",
                 )))
             }
 
@@ -601,12 +617,15 @@ where
                 let (wallet, selected_account) = wallet_and_selected_acc(&mut self.wallet).await?;
                 let result = wallet.sign_challenge(selected_account, challenge, address).await?;
 
-                let qr_code_string = qrcode_or_error_string(&result);
+                let qr_code_string = (!self.no_qr)
+                    .then(|| {
+                        let qr_code = qrcode_or_error_string(&result);
+                        format!("\n\nThe following qr code also contains the signature for easy transport:\n{qr_code}")
+                    })
+                    .unwrap_or_default();
 
                 Ok(ConsoleCommand::Print(format!(
-                    "The generated hex encoded signature is\n\n{result}
-                    \n\n\
-                    The following qr code also contains the signature for easy transport:\n{qr_code_string}",
+                    "The generated hex encoded signature is\n\n{result}{qr_code_string}",
                 )))
             }
 
@@ -1314,12 +1333,17 @@ where
 
                 let summary = tx.tx().text_summary(chain_config);
 
-                let qr_code_string = qrcode_or_error_string(&hex);
+                let qr_code_string = (!self.no_qr)
+                    .then(|| {
+                        let qr_code = qrcode_or_error_string(&hex);
+                        format!("\n\nOr scan the Qr code with it:\n\n{qr_code}")
+                    })
+                    .unwrap_or_default();
 
                 let mut output_str = format!(
                     "Send transaction created. \
-                    Pass the following string into the cold wallet with private key to sign:\n\n{hex}\n\n\
-                    Or scan the Qr code with it:\n\n{qr_code_string}\n\n{summary}\n"
+                    Pass the following string into the cold wallet with private key to sign:\n\n{hex}\
+                    {qr_code_string}\n\n{summary}\n"
                 );
                 format_fees(&mut output_str, &fees);
 
@@ -1597,12 +1621,17 @@ where
                     )
                     .await?;
 
-                let qr_code_string = qrcode_or_error_string(&result_hex.to_string());
+                let qr_code_string = (!self.no_qr)
+                    .then(|| {
+                        let qr_code = qrcode_or_error_string(&result_hex.to_string());
+                        format!("\n\nOr scan the Qr code with it:\n\n{qr_code}")
+                    })
+                    .unwrap_or_default();
 
                 let output_str = format!(
                     "Decommission transaction created. \
-                    Pass the following string into the wallet with private key to sign:\n\n{result_hex}\n\n\
-                    Or scan the Qr code with it:\n\n{qr_code_string}"
+                    Pass the following string into the wallet with private key to sign:\n\n{result_hex}\
+                    {qr_code_string}"
                 );
                 Ok(ConsoleCommand::Print(output_str))
             }
diff --git a/wallet/wallet-cli-lib/src/cli_event_loop.rs b/wallet/wallet-cli-lib/src/cli_event_loop.rs
index a18ac644d..10709faa4 100644
--- a/wallet/wallet-cli-lib/src/cli_event_loop.rs
+++ b/wallet/wallet-cli-lib/src/cli_event_loop.rs
@@ -52,6 +52,7 @@ pub async fn run<N: NodeInterface + Clone + Send + Sync + Debug + 'static>(
     in_top_x_mb: usize,
     wallet_type: WalletType<N>,
     cold_wallet: bool,
+    no_qr: bool,
 ) -> Result<(), WalletCliError<N>> {
     match wallet_type {
         WalletType::Local {
@@ -95,6 +96,7 @@ pub async fn run<N: NodeInterface + Clone + Send + Sync + Debug + 'static>(
                     broadcast_to_mempool: true,
                 },
                 wallet,
+                Some(no_qr),
             )
             .await;
 
@@ -126,6 +128,7 @@ pub async fn run<N: NodeInterface + Clone + Send + Sync + Debug + 'static>(
                     broadcast_to_mempool: true,
                 },
                 wallet,
+                Some(no_qr),
             )
             .await;
 
diff --git a/wallet/wallet-cli-lib/src/config.rs b/wallet/wallet-cli-lib/src/config.rs
index 436d7844a..06821a3a4 100644
--- a/wallet/wallet-cli-lib/src/config.rs
+++ b/wallet/wallet-cli-lib/src/config.rs
@@ -182,6 +182,10 @@ pub struct CliArgs {
     /// For a remote RPC wallet, this will not use any authentication
     #[arg(long, conflicts_with_all(["remote_rpc_wallet_password", "remote_rpc_wallet_username", "remote_rpc_wallet_cookie_file"]))]
     pub remote_rpc_wallet_no_authentication: bool,
+
+    /// Disable QR code output for wallet commands
+    #[arg(long)]
+    pub no_qr: bool,
 }
 
 impl From<&Network> for ChainType {
diff --git a/wallet/wallet-cli-lib/src/lib.rs b/wallet/wallet-cli-lib/src/lib.rs
index abac29347..151cd90a8 100644
--- a/wallet/wallet-cli-lib/src/lib.rs
+++ b/wallet/wallet-cli-lib/src/lib.rs
@@ -155,6 +155,7 @@ async fn start_hot_wallet(
         cli_args.node_rpc_address.clone().unwrap_or(default_addr)
     };
 
+    let no_qr = cli_args.no_qr;
     let (repl_handle, wallet_rpc_config) =
         setup_events_and_repl(cli_args, mode, output, input, event_tx, chain_type)?;
 
@@ -168,6 +169,7 @@ async fn start_hot_wallet(
             wallet_rpc_config,
         },
         false,
+        no_qr,
     )
     .await?;
     Ok(repl_handle.join().expect("Should not panic")?)
@@ -183,6 +185,7 @@ async fn start_cold_wallet(
 ) -> Result<(), Box<dyn std::error::Error>> {
     let (event_tx, event_rx) = mpsc::unbounded_channel();
 
+    let no_qr = cli_args.no_qr;
     let (repl_handle, wallet_rpc_config) = setup_events_and_repl(
         cli_args,
         mode,
@@ -201,6 +204,7 @@ async fn start_cold_wallet(
             wallet_rpc_config,
         },
         true,
+        no_qr,
     )
     .await?;
     Ok(repl_handle.join().expect("Should not panic")?)
@@ -241,6 +245,7 @@ async fn connect_to_rpc_wallet(
         _ => panic!("Should not happen due to arg constraints"),
     };
 
+    let no_qr = cli_args.no_qr;
     let remote_socket_address = cli_args.remote_rpc_wallet_address.clone().expect("checked");
     let (repl_handle, _wallet_rpc_config) =
         setup_events_and_repl(cli_args, mode, output, input, event_tx, chain_type)?;
@@ -254,6 +259,7 @@ async fn connect_to_rpc_wallet(
             rpc_auth,
         },
         false,
+        no_qr,
     )
     .await?;
     Ok(repl_handle.join().expect("Should not panic")?)


Test patch:
diff --git a/wallet/wallet-cli-lib/tests/cli_test_framework.rs b/wallet/wallet-cli-lib/tests/cli_test_framework.rs
index 13af81d10..2723e1ec7 100644
--- a/wallet/wallet-cli-lib/tests/cli_test_framework.rs
+++ b/wallet/wallet-cli-lib/tests/cli_test_framework.rs
@@ -121,6 +121,7 @@ impl CliTestFramework {
                     remote_rpc_wallet_password: None,
                     remote_rpc_wallet_cookie_file: None,
                     remote_rpc_wallet_no_authentication: true,
+                    no_qr: false,
                 },
             }))),
             run_options: wallet_cli_lib::config::CliArgs {
@@ -150,6 +151,7 @@ impl CliTestFramework {
                 remote_rpc_wallet_password: None,
                 remote_rpc_wallet_cookie_file: None,
                 remote_rpc_wallet_no_authentication: true,
+                no_qr: false,
             },
         };