File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -537,6 +537,8 @@ pub enum HwiSubCommand {
537537 Devices ,
538538 /// Register hardware wallet
539539 Register ,
540+ /// Generate address
541+ Address ,
540542}
541543
542544/// Subcommands available in REPL mode.
Original file line number Diff line number Diff line change @@ -638,6 +638,10 @@ pub async fn handle_offline_wallet_subcommand(
638638 //TODO: return status of wallet registration
639639 Ok ( json ! ( { "hmac" : hmac } ) )
640640 }
641+ HwiSubCommand :: Address => {
642+ let address = wallet. next_unused_address ( KeychainKind :: External ) ;
643+ Ok ( json ! ( { "address" : address. address } ) )
644+ }
641645 } ,
642646 }
643647}
@@ -1540,6 +1544,7 @@ async fn respond(
15401544 ReplSubCommand :: Exit => None ,
15411545 } ;
15421546 if let Some ( value) = response {
1547+ let value = serde_json:: to_string_pretty ( & value) . map_err ( |e| e. to_string ( ) ) ?;
15431548 writeln ! ( std:: io:: stdout( ) , "{value}" ) . map_err ( |e| e. to_string ( ) ) ?;
15441549 std:: io:: stdout ( ) . flush ( ) . map_err ( |e| e. to_string ( ) ) ?;
15451550 Ok ( false )
You can’t perform that action at this time.
0 commit comments