@@ -351,10 +351,44 @@ impl Backend {
351351
352352 ( wallet_data, accounts_info, best_block)
353353 }
354+ #[ cfg( feature = "ledger" ) ]
355+ ( WalletType :: Ledger , ColdHotNodeController :: Hot ( controller) ) => {
356+ let handles_client = WalletHandlesClient :: new (
357+ controller. chainstate . clone ( ) ,
358+ controller. mempool . clone ( ) ,
359+ controller. block_prod . clone ( ) ,
360+ controller. p2p . clone ( ) ,
361+ )
362+ . await
363+ . map_err ( |e| BackendError :: WalletError ( e. to_string ( ) ) ) ?;
364+
365+ let ( wallet_rpc, command_handler, best_block, accounts_info, accounts_data) = self
366+ . create_wallet (
367+ handles_client,
368+ file_path. clone ( ) ,
369+ wallet_args,
370+ import,
371+ wallet_events,
372+ )
373+ . await ?;
374+
375+ let wallet_data = WalletData {
376+ controller : GuiHotColdController :: Hot ( wallet_rpc, command_handler) ,
377+ accounts : accounts_data,
378+ best_block,
379+ updated : false ,
380+ } ;
381+
382+ ( wallet_data, accounts_info, best_block)
383+ }
354384 #[ cfg( feature = "trezor" ) ]
355385 ( WalletType :: Trezor , ColdHotNodeController :: Cold ) => {
356386 return Err ( BackendError :: ColdTrezorNotSupported )
357387 }
388+ #[ cfg( feature = "ledger" ) ]
389+ ( WalletType :: Ledger , ColdHotNodeController :: Cold ) => {
390+ return Err ( BackendError :: ColdTrezorNotSupported )
391+ }
358392 ( WalletType :: Hot , ColdHotNodeController :: Cold ) => {
359393 return Err ( BackendError :: HotNotSupported )
360394 }
@@ -563,10 +597,50 @@ impl Backend {
563597
564598 ( wallet_data, accounts_info, best_block, encryption_state)
565599 }
600+ #[ cfg( feature = "ledger" ) ]
601+ ( WalletType :: Ledger , ColdHotNodeController :: Hot ( controller) ) => {
602+ let handles_client = WalletHandlesClient :: new (
603+ controller. chainstate . clone ( ) ,
604+ controller. mempool . clone ( ) ,
605+ controller. block_prod . clone ( ) ,
606+ controller. p2p . clone ( ) ,
607+ )
608+ . await
609+ . map_err ( |e| BackendError :: WalletError ( e. to_string ( ) ) ) ?;
610+
611+ let (
612+ wallet_rpc,
613+ command_handler,
614+ encryption_state,
615+ best_block,
616+ accounts_info,
617+ accounts_data,
618+ ) = self
619+ . open_wallet (
620+ handles_client,
621+ file_path. clone ( ) ,
622+ wallet_events,
623+ Some ( HardwareWalletType :: Ledger ) ,
624+ )
625+ . await ?;
626+
627+ let wallet_data = WalletData {
628+ controller : GuiHotColdController :: Hot ( wallet_rpc, command_handler) ,
629+ accounts : accounts_data,
630+ best_block,
631+ updated : false ,
632+ } ;
633+
634+ ( wallet_data, accounts_info, best_block, encryption_state)
635+ }
566636 #[ cfg( feature = "trezor" ) ]
567637 ( WalletType :: Trezor , ColdHotNodeController :: Cold ) => {
568638 return Err ( BackendError :: ColdTrezorNotSupported )
569639 }
640+ #[ cfg( feature = "ledger" ) ]
641+ ( WalletType :: Ledger , ColdHotNodeController :: Cold ) => {
642+ return Err ( BackendError :: ColdTrezorNotSupported )
643+ }
570644 ( WalletType :: Hot , ColdHotNodeController :: Cold ) => {
571645 return Err ( BackendError :: HotNotSupported )
572646 }
0 commit comments