We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c19e0f commit 714cafbCopy full SHA for 714cafb
bittensor_cli/src/bittensor/utils.py
@@ -1431,3 +1431,15 @@ def blocks_to_duration(blocks: int) -> str:
1431
results.append(f"{unit_count}{unit}")
1432
# Return only the first two non-zero units
1433
return " ".join(results[:2]) or "0s"
1434
+
1435
1436
+def get_hotkey_pub_ss58(wallet: Wallet) -> str:
1437
+ """
1438
+ Helper fn to retrieve the hotkeypub ss58 of a wallet that may have been created before
1439
+ bt-wallet 3.1.1 and thus not have a wallet hotkeypub. In this case, it will return the hotkey
1440
+ SS58.
1441
1442
+ try:
1443
+ return wallet.hotkeypub.ss58_address
1444
+ except KeyFileError:
1445
+ return wallet.hotkey.ss58_address
0 commit comments