16
16
group_subnets ,
17
17
get_subnet_name ,
18
18
unlock_key ,
19
+ get_hotkey_pub_ss58 ,
19
20
)
20
21
21
22
if TYPE_CHECKING :
@@ -343,8 +344,9 @@ async def stake_swap_selection(
343
344
344
345
# Filter stakes for this hotkey
345
346
hotkey_stakes = {}
347
+ hotkey_ss58 = get_hotkey_pub_ss58 (wallet )
346
348
for stake in stakes :
347
- if stake .hotkey_ss58 == wallet . hotkey . ss58_address and stake .stake .tao > 0 :
349
+ if stake .hotkey_ss58 == hotkey_ss58 and stake .stake .tao > 0 :
348
350
hotkey_stakes [stake .netuid ] = {
349
351
"stake" : stake .stake ,
350
352
"is_registered" : stake .is_registered ,
@@ -357,12 +359,12 @@ async def stake_swap_selection(
357
359
# Display available stakes
358
360
table = Table (
359
361
title = f"\n [{ COLOR_PALETTE .G .HEADER } ]Available Stakes for Hotkey\n [/{ COLOR_PALETTE .G .HEADER } ]"
360
- f"[{ COLOR_PALETTE .G .HK } ]{ wallet .hotkey_str } : { wallet . hotkey . ss58_address } [/{ COLOR_PALETTE .G .HK } ]\n " ,
362
+ f"[{ COLOR_PALETTE .G .HK } ]{ wallet .hotkey_str } : { hotkey_ss58 } [/{ COLOR_PALETTE .G .HK } ]\n " ,
361
363
show_edge = False ,
362
364
header_style = "bold white" ,
363
365
border_style = "bright_black" ,
364
366
title_justify = "center" ,
365
- width = len (wallet . hotkey . ss58_address ) + 20 ,
367
+ width = len (hotkey_ss58 ) + 20 ,
366
368
)
367
369
368
370
table .add_column ("Index" , justify = "right" , style = "cyan" )
@@ -817,7 +819,7 @@ async def swap_stake(
817
819
Returns:
818
820
bool: True if the swap was successful, False otherwise.
819
821
"""
820
- hotkey_ss58 = wallet . hotkey . ss58_address
822
+ hotkey_ss58 = get_hotkey_pub_ss58 ( wallet )
821
823
if interactive_selection :
822
824
try :
823
825
selection = await stake_swap_selection (subtensor , wallet )
0 commit comments