@@ -2274,6 +2274,7 @@ def wallet_associate_hotkey(
2274
2274
wallet_path : Optional [str ] = Options .wallet_path ,
2275
2275
wallet_hotkey : Optional [str ] = Options .wallet_hotkey_ss58 ,
2276
2276
network : Optional [list [str ]] = Options .network ,
2277
+ prompt : bool = Options .prompt ,
2277
2278
quiet : bool = Options .quiet ,
2278
2279
verbose : bool = Options .verbose ,
2279
2280
):
@@ -2296,33 +2297,33 @@ def wallet_associate_hotkey(
2296
2297
default = self .config .get ("wallet_name" ) or defaults .wallet .name ,
2297
2298
)
2298
2299
if not wallet_hotkey :
2299
- hotkey_or_wallet = Prompt .ask (
2300
+ wallet_hotkey = Prompt .ask (
2300
2301
"Enter the [blue]hotkey[/blue] name or "
2301
2302
"[blue]hotkey ss58 address[/blue] [dim](to associate with your coldkey)[/dim]"
2302
2303
)
2303
- if is_valid_ss58_address (hotkey_or_wallet ):
2304
- hotkey_ss58 = hotkey_or_wallet
2305
- wallet = self .wallet_ask (
2306
- wallet_name ,
2307
- wallet_path ,
2308
- wallet_hotkey ,
2309
- ask_for = [WO .NAME , WO .PATH ],
2310
- validate = WV .WALLET ,
2311
- )
2312
- else :
2313
- wallet = self .wallet_ask (
2314
- wallet_name ,
2315
- wallet_path ,
2316
- hotkey_or_wallet ,
2317
- ask_for = [WO .NAME , WO .PATH , WO .HOTKEY ],
2318
- validate = WV .WALLET_AND_HOTKEY ,
2319
- )
2320
- hotkey_ss58 = wallet .hotkey .ss58_address
2304
+
2305
+ if is_valid_ss58_address (wallet_hotkey ):
2306
+ hotkey_ss58 = wallet_hotkey
2307
+ wallet = self .wallet_ask (
2308
+ wallet_name ,
2309
+ wallet_path ,
2310
+ None ,
2311
+ ask_for = [WO .NAME , WO .PATH ],
2312
+ validate = WV .WALLET ,
2313
+ )
2314
+ else :
2315
+ wallet = self .wallet_ask (
2316
+ wallet_name ,
2317
+ wallet_path ,
2318
+ wallet_hotkey ,
2319
+ ask_for = [WO .NAME , WO .PATH , WO .HOTKEY ],
2320
+ validate = WV .WALLET_AND_HOTKEY ,
2321
+ )
2322
+ hotkey_ss58 = wallet .hotkey .ss58_address
2323
+
2321
2324
return self ._run_command (
2322
2325
wallets .associate_hotkey (
2323
- wallet ,
2324
- self .initialize_chain (network ),
2325
- hotkey_ss58 ,
2326
+ wallet , self .initialize_chain (network ), hotkey_ss58 , prompt
2326
2327
)
2327
2328
)
2328
2329
0 commit comments