bittensor-cli 8.4.1__py3-none-any.whl → 8.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- bittensor_cli/__init__.py +1 -1
- bittensor_cli/cli.py +21 -13
- bittensor_cli/src/commands/stake/children_hotkeys.py +2 -6
- bittensor_cli/src/commands/wallets.py +13 -7
- {bittensor_cli-8.4.1.dist-info → bittensor_cli-8.4.3.dist-info}/METADATA +2 -2
- {bittensor_cli-8.4.1.dist-info → bittensor_cli-8.4.3.dist-info}/RECORD +9 -9
- {bittensor_cli-8.4.1.dist-info → bittensor_cli-8.4.3.dist-info}/WHEEL +0 -0
- {bittensor_cli-8.4.1.dist-info → bittensor_cli-8.4.3.dist-info}/entry_points.txt +0 -0
- {bittensor_cli-8.4.1.dist-info → bittensor_cli-8.4.3.dist-info}/top_level.txt +0 -0
bittensor_cli/__init__.py
CHANGED
bittensor_cli/cli.py
CHANGED
@@ -58,7 +58,7 @@ except ImportError:
|
|
58
58
|
pass
|
59
59
|
|
60
60
|
|
61
|
-
__version__ = "8.4.
|
61
|
+
__version__ = "8.4.3"
|
62
62
|
|
63
63
|
|
64
64
|
_core_version = re.match(r"^\d+\.\d+\.\d+", __version__).group(0)
|
@@ -132,15 +132,10 @@ class Options:
|
|
132
132
|
ss58_address = typer.Option(
|
133
133
|
None, "--ss58", "--ss58-address", help="The SS58 address of the coldkey."
|
134
134
|
)
|
135
|
-
|
135
|
+
overwrite = typer.Option(
|
136
136
|
False,
|
137
|
-
|
138
|
-
|
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.",
|
144
139
|
)
|
145
140
|
network = typer.Option(
|
146
141
|
None,
|
@@ -1725,6 +1720,7 @@ class CLIManager:
|
|
1725
1720
|
json: Optional[str] = Options.json,
|
1726
1721
|
json_password: Optional[str] = Options.json_password,
|
1727
1722
|
use_password: Optional[bool] = Options.use_password,
|
1723
|
+
overwrite: bool = Options.overwrite,
|
1728
1724
|
quiet: bool = Options.quiet,
|
1729
1725
|
verbose: bool = Options.verbose,
|
1730
1726
|
):
|
@@ -1770,6 +1766,7 @@ class CLIManager:
|
|
1770
1766
|
json,
|
1771
1767
|
json_password,
|
1772
1768
|
use_password,
|
1769
|
+
overwrite,
|
1773
1770
|
)
|
1774
1771
|
)
|
1775
1772
|
|
@@ -1780,6 +1777,7 @@ class CLIManager:
|
|
1780
1777
|
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
|
1781
1778
|
public_key_hex: Optional[str] = Options.public_hex_key,
|
1782
1779
|
ss58_address: Optional[str] = Options.ss58_address,
|
1780
|
+
overwrite: bool = Options.overwrite,
|
1783
1781
|
quiet: bool = Options.quiet,
|
1784
1782
|
verbose: bool = Options.verbose,
|
1785
1783
|
):
|
@@ -1826,7 +1824,7 @@ class CLIManager:
|
|
1826
1824
|
rich.print("[red]Error: Invalid SS58 address or public key![/red]")
|
1827
1825
|
raise typer.Exit()
|
1828
1826
|
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)
|
1830
1828
|
)
|
1831
1829
|
|
1832
1830
|
def wallet_regen_hotkey(
|
@@ -1842,6 +1840,7 @@ class CLIManager:
|
|
1842
1840
|
False, # Overriden to False
|
1843
1841
|
help="Set to 'True' to protect the generated Bittensor key with a password.",
|
1844
1842
|
),
|
1843
|
+
overwrite: bool = Options.overwrite,
|
1845
1844
|
quiet: bool = Options.quiet,
|
1846
1845
|
verbose: bool = Options.verbose,
|
1847
1846
|
):
|
@@ -1880,6 +1879,7 @@ class CLIManager:
|
|
1880
1879
|
json,
|
1881
1880
|
json_password,
|
1882
1881
|
use_password,
|
1882
|
+
overwrite,
|
1883
1883
|
)
|
1884
1884
|
)
|
1885
1885
|
|
@@ -1898,6 +1898,7 @@ class CLIManager:
|
|
1898
1898
|
False, # Overriden to False
|
1899
1899
|
help="Set to 'True' to protect the generated Bittensor key with a password.",
|
1900
1900
|
),
|
1901
|
+
overwrite: bool = Options.overwrite,
|
1901
1902
|
quiet: bool = Options.quiet,
|
1902
1903
|
verbose: bool = Options.verbose,
|
1903
1904
|
):
|
@@ -1935,7 +1936,9 @@ class CLIManager:
|
|
1935
1936
|
validate=WV.WALLET,
|
1936
1937
|
)
|
1937
1938
|
n_words = get_n_words(n_words)
|
1938
|
-
return self._run_command(
|
1939
|
+
return self._run_command(
|
1940
|
+
wallets.new_hotkey(wallet, n_words, use_password, overwrite)
|
1941
|
+
)
|
1939
1942
|
|
1940
1943
|
def wallet_new_coldkey(
|
1941
1944
|
self,
|
@@ -1949,6 +1952,7 @@ class CLIManager:
|
|
1949
1952
|
help="The number of words used in the mnemonic. Options: [12, 15, 18, 21, 24]",
|
1950
1953
|
),
|
1951
1954
|
use_password: Optional[bool] = Options.use_password,
|
1955
|
+
overwrite: bool = Options.overwrite,
|
1952
1956
|
quiet: bool = Options.quiet,
|
1953
1957
|
verbose: bool = Options.verbose,
|
1954
1958
|
):
|
@@ -1985,7 +1989,9 @@ class CLIManager:
|
|
1985
1989
|
validate=WV.NONE,
|
1986
1990
|
)
|
1987
1991
|
n_words = get_n_words(n_words)
|
1988
|
-
return self._run_command(
|
1992
|
+
return self._run_command(
|
1993
|
+
wallets.new_coldkey(wallet, n_words, use_password, overwrite)
|
1994
|
+
)
|
1989
1995
|
|
1990
1996
|
def wallet_check_ck_swap(
|
1991
1997
|
self,
|
@@ -2019,6 +2025,7 @@ class CLIManager:
|
|
2019
2025
|
wallet_hotkey: Optional[str] = Options.wallet_hotkey,
|
2020
2026
|
n_words: Optional[int] = None,
|
2021
2027
|
use_password: bool = Options.use_password,
|
2028
|
+
overwrite: bool = Options.overwrite,
|
2022
2029
|
quiet: bool = Options.quiet,
|
2023
2030
|
verbose: bool = Options.verbose,
|
2024
2031
|
):
|
@@ -2064,6 +2071,7 @@ class CLIManager:
|
|
2064
2071
|
wallet,
|
2065
2072
|
n_words,
|
2066
2073
|
use_password,
|
2074
|
+
overwrite,
|
2067
2075
|
)
|
2068
2076
|
)
|
2069
2077
|
|
@@ -2345,8 +2353,8 @@ class CLIManager:
|
|
2345
2353
|
twitter_url,
|
2346
2354
|
info_,
|
2347
2355
|
validator_id,
|
2348
|
-
prompt,
|
2349
2356
|
subnet_netuid,
|
2357
|
+
prompt,
|
2350
2358
|
)
|
2351
2359
|
)
|
2352
2360
|
|
@@ -229,7 +229,7 @@ async def get_childkey_take(subtensor, hotkey: str, netuid: int) -> Optional[int
|
|
229
229
|
params=[hotkey, netuid],
|
230
230
|
)
|
231
231
|
if childkey_take_:
|
232
|
-
return int(childkey_take_
|
232
|
+
return int(childkey_take_)
|
233
233
|
|
234
234
|
except SubstrateRequestException as e:
|
235
235
|
err_console.print(f"Error querying ChildKeys: {format_error_message(e)}")
|
@@ -299,11 +299,7 @@ async def get_children(
|
|
299
299
|
params=[hotkey],
|
300
300
|
reuse_block_hash=True,
|
301
301
|
)
|
302
|
-
stake = (
|
303
|
-
Balance.from_rao(_result.value)
|
304
|
-
if getattr(_result, "value", None)
|
305
|
-
else Balance(0)
|
306
|
-
)
|
302
|
+
stake = Balance.from_rao(_result) if _result is not None else Balance(0)
|
307
303
|
if parent:
|
308
304
|
console.print(
|
309
305
|
f"\nYour Hotkey: [bright_magenta]{hotkey}[/bright_magenta] | Total Stake: [dark_orange]{stake}t[/dark_orange]\n",
|
@@ -69,6 +69,7 @@ async def regen_coldkey(
|
|
69
69
|
json_path: Optional[str] = None,
|
70
70
|
json_password: Optional[str] = "",
|
71
71
|
use_password: Optional[bool] = True,
|
72
|
+
overwrite: Optional[bool] = False,
|
72
73
|
):
|
73
74
|
"""Creates a new coldkey under this wallet"""
|
74
75
|
json_str: Optional[str] = None
|
@@ -83,7 +84,7 @@ async def regen_coldkey(
|
|
83
84
|
seed=seed,
|
84
85
|
json=(json_str, json_password) if all([json_str, json_password]) else None,
|
85
86
|
use_password=use_password,
|
86
|
-
overwrite=
|
87
|
+
overwrite=overwrite,
|
87
88
|
)
|
88
89
|
|
89
90
|
if isinstance(new_wallet, Wallet):
|
@@ -101,13 +102,14 @@ async def regen_coldkey_pub(
|
|
101
102
|
wallet: Wallet,
|
102
103
|
ss58_address: str,
|
103
104
|
public_key_hex: str,
|
105
|
+
overwrite: Optional[bool] = False,
|
104
106
|
):
|
105
107
|
"""Creates a new coldkeypub under this wallet."""
|
106
108
|
try:
|
107
109
|
new_coldkeypub = wallet.regenerate_coldkeypub(
|
108
110
|
ss58_address=ss58_address,
|
109
111
|
public_key=public_key_hex,
|
110
|
-
overwrite=
|
112
|
+
overwrite=overwrite,
|
111
113
|
)
|
112
114
|
if isinstance(new_coldkeypub, Wallet):
|
113
115
|
console.print(
|
@@ -125,6 +127,7 @@ async def regen_hotkey(
|
|
125
127
|
json_path: Optional[str],
|
126
128
|
json_password: Optional[str] = "",
|
127
129
|
use_password: Optional[bool] = False,
|
130
|
+
overwrite: Optional[bool] = False,
|
128
131
|
):
|
129
132
|
"""Creates a new hotkey under this wallet."""
|
130
133
|
json_str: Optional[str] = None
|
@@ -141,7 +144,7 @@ async def regen_hotkey(
|
|
141
144
|
seed=seed,
|
142
145
|
json=(json_str, json_password) if all([json_str, json_password]) else None,
|
143
146
|
use_password=use_password,
|
144
|
-
overwrite=
|
147
|
+
overwrite=overwrite,
|
145
148
|
)
|
146
149
|
if isinstance(new_hotkey, Wallet):
|
147
150
|
console.print(
|
@@ -158,13 +161,14 @@ async def new_hotkey(
|
|
158
161
|
wallet: Wallet,
|
159
162
|
n_words: int,
|
160
163
|
use_password: bool,
|
164
|
+
overwrite: Optional[bool] = False,
|
161
165
|
):
|
162
166
|
"""Creates a new hotkey under this wallet."""
|
163
167
|
try:
|
164
168
|
wallet.create_new_hotkey(
|
165
169
|
n_words=n_words,
|
166
170
|
use_password=use_password,
|
167
|
-
overwrite=
|
171
|
+
overwrite=overwrite,
|
168
172
|
)
|
169
173
|
except KeyFileError:
|
170
174
|
print_error("KeyFileError: File is not writable")
|
@@ -174,13 +178,14 @@ async def new_coldkey(
|
|
174
178
|
wallet: Wallet,
|
175
179
|
n_words: int,
|
176
180
|
use_password: bool,
|
181
|
+
overwrite: Optional[bool] = False,
|
177
182
|
):
|
178
183
|
"""Creates a new coldkey under this wallet."""
|
179
184
|
try:
|
180
185
|
wallet.create_new_coldkey(
|
181
186
|
n_words=n_words,
|
182
187
|
use_password=use_password,
|
183
|
-
overwrite=
|
188
|
+
overwrite=overwrite,
|
184
189
|
)
|
185
190
|
except KeyFileError:
|
186
191
|
print_error("KeyFileError: File is not writable")
|
@@ -190,13 +195,14 @@ async def wallet_create(
|
|
190
195
|
wallet: Wallet,
|
191
196
|
n_words: int = 12,
|
192
197
|
use_password: bool = True,
|
198
|
+
overwrite: Optional[bool] = False,
|
193
199
|
):
|
194
200
|
"""Creates a new wallet."""
|
195
201
|
try:
|
196
202
|
wallet.create_new_coldkey(
|
197
203
|
n_words=n_words,
|
198
204
|
use_password=use_password,
|
199
|
-
overwrite=
|
205
|
+
overwrite=overwrite,
|
200
206
|
)
|
201
207
|
except KeyFileError:
|
202
208
|
print_error("KeyFileError: File is not writable")
|
@@ -205,7 +211,7 @@ async def wallet_create(
|
|
205
211
|
wallet.create_new_hotkey(
|
206
212
|
n_words=n_words,
|
207
213
|
use_password=False,
|
208
|
-
overwrite=
|
214
|
+
overwrite=overwrite,
|
209
215
|
)
|
210
216
|
except KeyFileError:
|
211
217
|
print_error("KeyFileError: File is not writable")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: bittensor-cli
|
3
|
-
Version: 8.4.
|
3
|
+
Version: 8.4.3
|
4
4
|
Summary: Bittensor CLI
|
5
5
|
Home-page: https://github.com/opentensor/btcli
|
6
6
|
Author: bittensor.com
|
@@ -41,7 +41,7 @@ Requires-Dist: scalecodec==1.2.11
|
|
41
41
|
Requires-Dist: substrate-interface~=1.7.9
|
42
42
|
Requires-Dist: typer~=0.12
|
43
43
|
Requires-Dist: websockets>=14.1
|
44
|
-
Requires-Dist: bittensor-wallet>=
|
44
|
+
Requires-Dist: bittensor-wallet>=3.0.0
|
45
45
|
Requires-Dist: bt-decode==0.4.0
|
46
46
|
Provides-Extra: cuda
|
47
47
|
Requires-Dist: cubit>=1.1.0; extra == "cuda"
|
@@ -1,5 +1,5 @@
|
|
1
|
-
bittensor_cli/__init__.py,sha256=
|
2
|
-
bittensor_cli/cli.py,sha256=
|
1
|
+
bittensor_cli/__init__.py,sha256=BPag7sRvH5kJF-Fz2EwI1ZVlYOgFEdO6YHoOiRVrFiA,1217
|
2
|
+
bittensor_cli/cli.py,sha256=unsfKRvxROQ7KfF6HMrp4t1DqwAl4yIUMFgIzheG8pY,170420
|
3
3
|
bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
|
4
4
|
bittensor_cli/src/__init__.py,sha256=LpTjd5p40H08K4IbyJCNdLJhEcb8NuWXOwl5kSNYwjI,12355
|
5
5
|
bittensor_cli/src/bittensor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
@@ -19,13 +19,13 @@ bittensor_cli/src/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJ
|
|
19
19
|
bittensor_cli/src/commands/root.py,sha256=28mHTMkZe0X-62Sg6o9dG82m1bx5IAG9eXk9ZBr3Jjo,62256
|
20
20
|
bittensor_cli/src/commands/subnets.py,sha256=riR41_ajUVWlDoaTUQahPzZswtY2h72pMK0rNuPj2SM,33164
|
21
21
|
bittensor_cli/src/commands/sudo.py,sha256=bP9t0QpXmqHnscEvCFHgJ4a7vETyqG1Kuc2CIVQ5qus,8436
|
22
|
-
bittensor_cli/src/commands/wallets.py,sha256=
|
22
|
+
bittensor_cli/src/commands/wallets.py,sha256=V6Vcnt7Q3tFi02ugeIPIPF8BaraDwiIkHT3oZ-wfF7Q,60940
|
23
23
|
bittensor_cli/src/commands/weights.py,sha256=XHn0MLYUcEUtOkA_soIBJ5rqkpIliUVnyc4nzdPQslw,16276
|
24
24
|
bittensor_cli/src/commands/stake/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
|
-
bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=
|
25
|
+
bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=hu7ObsUkg6j6_1Bylqe3oBajV9gQmr6QlggXYTWwgjQ,28470
|
26
26
|
bittensor_cli/src/commands/stake/stake.py,sha256=7TyFtL5wnXvGvD-GckNrNTRdcu3RewAfx_JfEekugFU,56147
|
27
|
-
bittensor_cli-8.4.
|
28
|
-
bittensor_cli-8.4.
|
29
|
-
bittensor_cli-8.4.
|
30
|
-
bittensor_cli-8.4.
|
31
|
-
bittensor_cli-8.4.
|
27
|
+
bittensor_cli-8.4.3.dist-info/METADATA,sha256=MgdktN35M2FjxX60ZOmWgE3gYnPDAQ_Je1Xz6M68gRk,6786
|
28
|
+
bittensor_cli-8.4.3.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
29
|
+
bittensor_cli-8.4.3.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
|
30
|
+
bittensor_cli-8.4.3.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
|
31
|
+
bittensor_cli-8.4.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|