@@ -627,6 +627,10 @@ pub async fn handle_offline_wallet_subcommand(
627627 //TODO: return status of wallet registration
628628 Ok ( json ! ( { "hmac" : hmac } ) )
629629 }
630+ HwiSubCommand :: Address => {
631+ let address = wallet. next_unused_address ( KeychainKind :: External ) ;
632+ Ok ( json ! ( { "address" : address. address } ) )
633+ }
630634 } ,
631635 }
632636}
@@ -1192,9 +1196,9 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
11921196 }
11931197 } ;
11941198
1195- let mut wallet = new_persisted_wallet ( network, & mut persister, & wallet_opts) ?;
1199+ let mut wallet = new_persisted_wallet ( network, & mut persister, wallet_opts) ?;
11961200 let result =
1197- handle_offline_wallet_subcommand ( & mut wallet, & wallet_opts, & cli_opts, offline_subcommand. clone ( ) )
1201+ handle_offline_wallet_subcommand ( & mut wallet, wallet_opts, & cli_opts, offline_subcommand. clone ( ) )
11981202 . await ?;
11991203 wallet. persist ( & mut persister) ?;
12001204 result
@@ -1359,6 +1363,7 @@ async fn respond(
13591363 ReplSubCommand :: Exit => None ,
13601364 } ;
13611365 if let Some ( value) = response {
1366+ let value = serde_json:: to_string_pretty ( & value) . map_err ( |e| e. to_string ( ) ) ?;
13621367 writeln ! ( std:: io:: stdout( ) , "{value}" ) . map_err ( |e| e. to_string ( ) ) ?;
13631368 std:: io:: stdout ( ) . flush ( ) . map_err ( |e| e. to_string ( ) ) ?;
13641369 Ok ( false )
0 commit comments