@@ -132,15 +132,10 @@ class Options:
132132 ss58_address = typer .Option (
133133 None , "--ss58" , "--ss58-address" , help = "The SS58 address of the coldkey."
134134 )
135- overwrite_coldkey = typer .Option (
135+ overwrite = typer .Option (
136136 False ,
137- help = "Overwrite the old coldkey with the newly generated coldkey." ,
138- prompt = True ,
139- )
140- overwrite_hotkey = typer .Option (
141- False ,
142- help = "Overwrite the old hotkey with the newly generated hotkey." ,
143- prompt = True ,
137+ "--overwrite/--no-overwrite" ,
138+ help = "Overwrite the existing wallet file with the new one." ,
144139 )
145140 network = typer .Option (
146141 None ,
@@ -1725,6 +1720,7 @@ def wallet_regen_coldkey(
17251720 json : Optional [str ] = Options .json ,
17261721 json_password : Optional [str ] = Options .json_password ,
17271722 use_password : Optional [bool ] = Options .use_password ,
1723+ overwrite : bool = Options .overwrite ,
17281724 quiet : bool = Options .quiet ,
17291725 verbose : bool = Options .verbose ,
17301726 ):
@@ -1770,6 +1766,7 @@ def wallet_regen_coldkey(
17701766 json ,
17711767 json_password ,
17721768 use_password ,
1769+ overwrite ,
17731770 )
17741771 )
17751772
@@ -1780,6 +1777,7 @@ def wallet_regen_coldkey_pub(
17801777 wallet_hotkey : Optional [str ] = Options .wallet_hotkey ,
17811778 public_key_hex : Optional [str ] = Options .public_hex_key ,
17821779 ss58_address : Optional [str ] = Options .ss58_address ,
1780+ overwrite : bool = Options .overwrite ,
17831781 quiet : bool = Options .quiet ,
17841782 verbose : bool = Options .verbose ,
17851783 ):
@@ -1826,7 +1824,7 @@ def wallet_regen_coldkey_pub(
18261824 rich .print ("[red]Error: Invalid SS58 address or public key![/red]" )
18271825 raise typer .Exit ()
18281826 return self ._run_command (
1829- wallets .regen_coldkey_pub (wallet , ss58_address , public_key_hex )
1827+ wallets .regen_coldkey_pub (wallet , ss58_address , public_key_hex , overwrite )
18301828 )
18311829
18321830 def wallet_regen_hotkey (
@@ -1842,6 +1840,7 @@ def wallet_regen_hotkey(
18421840 False , # Overriden to False
18431841 help = "Set to 'True' to protect the generated Bittensor key with a password." ,
18441842 ),
1843+ overwrite : bool = Options .overwrite ,
18451844 quiet : bool = Options .quiet ,
18461845 verbose : bool = Options .verbose ,
18471846 ):
@@ -1880,6 +1879,7 @@ def wallet_regen_hotkey(
18801879 json ,
18811880 json_password ,
18821881 use_password ,
1882+ overwrite ,
18831883 )
18841884 )
18851885
@@ -1898,6 +1898,7 @@ def wallet_new_hotkey(
18981898 False , # Overriden to False
18991899 help = "Set to 'True' to protect the generated Bittensor key with a password." ,
19001900 ),
1901+ overwrite : bool = Options .overwrite ,
19011902 quiet : bool = Options .quiet ,
19021903 verbose : bool = Options .verbose ,
19031904 ):
@@ -1935,7 +1936,9 @@ def wallet_new_hotkey(
19351936 validate = WV .WALLET ,
19361937 )
19371938 n_words = get_n_words (n_words )
1938- return self ._run_command (wallets .new_hotkey (wallet , n_words , use_password ))
1939+ return self ._run_command (
1940+ wallets .new_hotkey (wallet , n_words , use_password , overwrite )
1941+ )
19391942
19401943 def wallet_new_coldkey (
19411944 self ,
@@ -1949,6 +1952,7 @@ def wallet_new_coldkey(
19491952 help = "The number of words used in the mnemonic. Options: [12, 15, 18, 21, 24]" ,
19501953 ),
19511954 use_password : Optional [bool ] = Options .use_password ,
1955+ overwrite : bool = Options .overwrite ,
19521956 quiet : bool = Options .quiet ,
19531957 verbose : bool = Options .verbose ,
19541958 ):
@@ -1985,7 +1989,9 @@ def wallet_new_coldkey(
19851989 validate = WV .NONE ,
19861990 )
19871991 n_words = get_n_words (n_words )
1988- return self ._run_command (wallets .new_coldkey (wallet , n_words , use_password ))
1992+ return self ._run_command (
1993+ wallets .new_coldkey (wallet , n_words , use_password , overwrite )
1994+ )
19891995
19901996 def wallet_check_ck_swap (
19911997 self ,
@@ -2019,6 +2025,7 @@ def wallet_create_wallet(
20192025 wallet_hotkey : Optional [str ] = Options .wallet_hotkey ,
20202026 n_words : Optional [int ] = None ,
20212027 use_password : bool = Options .use_password ,
2028+ overwrite : bool = Options .overwrite ,
20222029 quiet : bool = Options .quiet ,
20232030 verbose : bool = Options .verbose ,
20242031 ):
@@ -2064,6 +2071,7 @@ def wallet_create_wallet(
20642071 wallet ,
20652072 n_words ,
20662073 use_password ,
2074+ overwrite ,
20672075 )
20682076 )
20692077
0 commit comments