bittensor-cli 9.0.1__py3-none-any.whl → 9.0.2__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.
@@ -284,11 +284,7 @@ async def wallet_balance(
284
284
  """Retrieves the current balance of the specified wallet"""
285
285
  if ss58_addresses:
286
286
  coldkeys = ss58_addresses
287
- identities = await subtensor.query_all_identities()
288
- wallet_names = [
289
- f"{identities.get(coldkey, {'name': f'Provided address {i}'})['name']}"
290
- for i, coldkey in enumerate(coldkeys)
291
- ]
287
+ wallet_names = [f"Provided Address {i + 1}" for i in range(len(ss58_addresses))]
292
288
 
293
289
  elif not all_balances:
294
290
  if not wallet.coldkeypub_file.exists_on_device():
@@ -307,19 +303,29 @@ async def wallet_balance(
307
303
  wallet_names = [wallet.name]
308
304
 
309
305
  block_hash = await subtensor.substrate.get_chain_head()
310
- free_balances = await subtensor.get_balances(*coldkeys, block_hash=block_hash)
306
+ free_balances, staked_balances = await asyncio.gather(
307
+ subtensor.get_balances(*coldkeys, block_hash=block_hash),
308
+ subtensor.get_total_stake_for_coldkey(*coldkeys, block_hash=block_hash),
309
+ )
311
310
 
312
311
  total_free_balance = sum(free_balances.values())
312
+ total_staked_balance = sum(stake[0] for stake in staked_balances.values())
313
+ total_staked_with_slippage = sum(stake[1] for stake in staked_balances.values())
313
314
 
314
315
  balances = {
315
- name: (coldkey, free_balances[coldkey])
316
+ name: (
317
+ coldkey,
318
+ free_balances[coldkey],
319
+ staked_balances[coldkey][0],
320
+ staked_balances[coldkey][1],
321
+ )
316
322
  for (name, coldkey) in zip(wallet_names, coldkeys)
317
323
  }
318
324
 
319
325
  table = Table(
320
326
  Column(
321
327
  "[white]Wallet Name",
322
- style="bold bright_cyan",
328
+ style=COLOR_PALETTE["GENERAL"]["SUBHEADING_MAIN"],
323
329
  no_wrap=True,
324
330
  ),
325
331
  Column(
@@ -333,7 +339,31 @@ async def wallet_balance(
333
339
  style=COLOR_PALETTE["GENERAL"]["BALANCE"],
334
340
  no_wrap=True,
335
341
  ),
336
- title=f"\n [{COLOR_PALETTE['GENERAL']['HEADER']}]Wallet Coldkey Balance\nNetwork: {subtensor.network}",
342
+ Column(
343
+ "[white]Staked Value",
344
+ justify="right",
345
+ style=COLOR_PALETTE["STAKE"]["STAKE_ALPHA"],
346
+ no_wrap=True,
347
+ ),
348
+ Column(
349
+ "[white]Staked (w/slippage)",
350
+ justify="right",
351
+ style=COLOR_PALETTE["STAKE"]["STAKE_SWAP"],
352
+ no_wrap=True,
353
+ ),
354
+ Column(
355
+ "[white]Total Balance",
356
+ justify="right",
357
+ style=COLOR_PALETTE["GENERAL"]["BALANCE"],
358
+ no_wrap=True,
359
+ ),
360
+ Column(
361
+ "[white]Total (w/slippage)",
362
+ justify="right",
363
+ style=COLOR_PALETTE["GENERAL"]["BALANCE"],
364
+ no_wrap=True,
365
+ ),
366
+ title=f"\n[{COLOR_PALETTE['GENERAL']['HEADER']}]Wallet Coldkey Balance[/{COLOR_PALETTE['GENERAL']['HEADER']}]\n[{COLOR_PALETTE['GENERAL']['HEADER']}]Network: {subtensor.network}\n",
337
367
  show_footer=True,
338
368
  show_edge=False,
339
369
  border_style="bright_black",
@@ -343,17 +373,25 @@ async def wallet_balance(
343
373
  leading=True,
344
374
  )
345
375
 
346
- for name, (coldkey, free) in balances.items():
376
+ for name, (coldkey, free, staked, staked_slippage) in balances.items():
347
377
  table.add_row(
348
378
  name,
349
379
  coldkey,
350
380
  str(free),
381
+ str(staked),
382
+ str(staked_slippage),
383
+ str(free + staked),
384
+ str(free + staked_slippage),
351
385
  )
352
386
  table.add_row()
353
387
  table.add_row(
354
388
  "Total Balance",
355
389
  "",
356
390
  str(total_free_balance),
391
+ str(total_staked_balance),
392
+ str(total_staked_with_slippage),
393
+ str(total_free_balance + total_staked_balance),
394
+ str(total_free_balance + total_staked_with_slippage),
357
395
  )
358
396
  console.print(Padding(table, (0, 0, 0, 4)))
359
397
  await subtensor.substrate.close()
@@ -0,0 +1,18 @@
1
+ import re
2
+
3
+ def version_as_int(version):
4
+ _core_version = re.match(r"^\d+\.\d+\.\d+", version).group(0)
5
+ _version_split = _core_version.split(".")
6
+ __version_info__ = tuple(int(part) for part in _version_split)
7
+ _version_int_base = 1000
8
+ assert max(__version_info__) < _version_int_base
9
+
10
+ __version_as_int__: int = sum(
11
+ e * (_version_int_base**i) for i, e in enumerate(reversed(__version_info__))
12
+ )
13
+ assert __version_as_int__ < 2**31 # fits in int32
14
+ __new_signature_version__ = 360
15
+ return __version_as_int__
16
+
17
+ __version__ = "9.0.2"
18
+ __version_as_int__ = version_as_int(__version__)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: bittensor-cli
3
- Version: 9.0.1
3
+ Version: 9.0.2
4
4
  Summary: Bittensor CLI
5
5
  Home-page: https://github.com/opentensor/btcli
6
6
  Author: bittensor.com
@@ -25,7 +25,7 @@ Requires-Python: >=3.9
25
25
  Description-Content-Type: text/markdown
26
26
  Requires-Dist: wheel
27
27
  Requires-Dist: async-property==0.2.2
28
- Requires-Dist: async-substrate-interface>=1.0.0
28
+ Requires-Dist: async-substrate-interface>=1.0.3
29
29
  Requires-Dist: aiohttp~=3.10.2
30
30
  Requires-Dist: backoff~=2.2.1
31
31
  Requires-Dist: GitPython>=3.0.0
@@ -41,7 +41,7 @@ Requires-Dist: rich~=13.7
41
41
  Requires-Dist: scalecodec==1.2.11
42
42
  Requires-Dist: typer~=0.12
43
43
  Requires-Dist: websockets>=14.1
44
- Requires-Dist: bittensor-wallet>=3.0.3
44
+ Requires-Dist: bittensor-wallet>=3.0.4
45
45
  Requires-Dist: plotille
46
46
  Requires-Dist: pywry
47
47
  Requires-Dist: plotly
@@ -0,0 +1,35 @@
1
+ bittensor_cli/__init__.py,sha256=Lpv4NkbAQgwrfqFOnTMuR_S-fqGdaWCSLhxnFnGTHM0,1232
2
+ bittensor_cli/cli.py,sha256=hiCu9JQFnu22Q1WjpApkhzNvP9EuR3grNYXWcvGoufc,192627
3
+ bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
4
+ bittensor_cli/version.py,sha256=W091sz9aNjfMKBgfd7SGgZHim3RwQSv-M8lo7mgPIEY,621
5
+ bittensor_cli/src/__init__.py,sha256=rTtP85aCliJTLdWv2DYFNgw5Fi0KB2--80Xta5_WsXE,26427
6
+ bittensor_cli/src/bittensor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ bittensor_cli/src/bittensor/balances.py,sha256=EZI8hX-eCkTfuTZq5GMvRYU6DCdl8V_zyZIQWi05K5g,11084
8
+ bittensor_cli/src/bittensor/chain_data.py,sha256=WV_zX_05Zam1yp_oMX9VIYxu99cGPUGEnhCyH67vNtE,30856
9
+ bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
10
+ bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
11
+ bittensor_cli/src/bittensor/subtensor_interface.py,sha256=mprNkG462WW57eRUhMmDE4gHGuMoeIvBeQLLSxIppLI,53098
12
+ bittensor_cli/src/bittensor/utils.py,sha256=E57t4SiASuXCjiXLLU63vK6bK6aKqj9JtIIi9lDOi-k,46238
13
+ bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=3mJZ3hw_wZEa-8I0R8WVuKjMQi4Y9EV5FjTCvbY37Iw,63780
15
+ bittensor_cli/src/bittensor/extrinsics/root.py,sha256=N9Fg4VaveRRP1ZN4EZjIWCe04FpTNBKWFqx8USKp9uQ,19062
16
+ bittensor_cli/src/bittensor/extrinsics/transfer.py,sha256=FyrRo3yk-065toN4f-1Xes23CE5tqP5KU0dBJkKofUc,8476
17
+ bittensor_cli/src/bittensor/templates/table.j2,sha256=P2EFiksnO1cQsB8zjK6hVJwUryHTsLslzRE0YtobAV8,10601
18
+ bittensor_cli/src/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ bittensor_cli/src/commands/sudo.py,sha256=yjmUuOrKkz0Ft2TqHWl4Lw96aYRCEk9kdvtyXCTOASE,31295
20
+ bittensor_cli/src/commands/wallets.py,sha256=hv9gzh-zPS8gXzgJIfENQVR6BFYxh6abjxmHUjqMhsY,51086
21
+ bittensor_cli/src/commands/weights.py,sha256=uI7aACKD90JOtYt61VdKL76z7Fe_wh4WtdwMXL6ydD4,16269
22
+ bittensor_cli/src/commands/stake/__init__.py,sha256=uxomMv_QrYt5Qn3_X5UWFFh45ISjB0JmDmCFxVyX8nQ,6495
23
+ bittensor_cli/src/commands/stake/add.py,sha256=ZPFuvlTUT2z23urITj_RLUBe51jqyfZ8l22-zdd2Nzg,25074
24
+ bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=9CMc56eg_6-tpRz9x5ml4Brc5SSbhC7KDlJqYgQ4XiU,29576
25
+ bittensor_cli/src/commands/stake/list.py,sha256=AnzBhUjuwckFAXYwgv9Yk1JHUKu2w1h8_m8-hf77g80,28625
26
+ bittensor_cli/src/commands/stake/move.py,sha256=rFCHpkdyUc6tSp1YiJ3fOVG_s6La7YVwQPhXDIBD_FE,37406
27
+ bittensor_cli/src/commands/stake/remove.py,sha256=6RnxandM05xAG1QJ_vRtWRI0xlzfZC_4kEJgOPKua0M,47069
28
+ bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
29
+ bittensor_cli/src/commands/subnets/price.py,sha256=TWcRXUFeS_Q-pfyv0YIluAL8SE7d2gzTODK-9M2J5pw,29878
30
+ bittensor_cli/src/commands/subnets/subnets.py,sha256=ObB2g-iTCPkmrHomR0RHdvqX8FSHXaywSIoIFXko1h4,84118
31
+ bittensor_cli-9.0.2.dist-info/METADATA,sha256=a-FAYGb9717y58lnFPAtwbKdVBCDwC4edgLf7sQd-GI,6855
32
+ bittensor_cli-9.0.2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
33
+ bittensor_cli-9.0.2.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
34
+ bittensor_cli-9.0.2.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
35
+ bittensor_cli-9.0.2.dist-info/RECORD,,
@@ -1,34 +0,0 @@
1
- bittensor_cli/__init__.py,sha256=HHo0y7efQaZzbchvJjGXxKK-WcZqNIcpa0jk4g24xJw,1217
2
- bittensor_cli/cli.py,sha256=YnPDhy4K02HIdFrxX2CPUZtTHn5RK_IuljiiJsBZ9Yc,191835
3
- bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
4
- bittensor_cli/src/__init__.py,sha256=8tkruEnZA11TuELuJptD1d97jKzropC_onhyanCpnoI,26435
5
- bittensor_cli/src/bittensor/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- bittensor_cli/src/bittensor/balances.py,sha256=E-niENvR7lAaoS5ZyCmwl_9M-nspnkcuIxf_dHiJIDg,11078
7
- bittensor_cli/src/bittensor/chain_data.py,sha256=L8j3vOL3RhOKzyJM053w74Diil2UX_vR5IPedyLco3Q,30663
8
- bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
9
- bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
10
- bittensor_cli/src/bittensor/subtensor_interface.py,sha256=LqWrZBScOobW7CyEMNrtgvH1YOAvMOC8cns2BLEdPIg,52966
11
- bittensor_cli/src/bittensor/utils.py,sha256=E57t4SiASuXCjiXLLU63vK6bK6aKqj9JtIIi9lDOi-k,46238
12
- bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
- bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=3mJZ3hw_wZEa-8I0R8WVuKjMQi4Y9EV5FjTCvbY37Iw,63780
14
- bittensor_cli/src/bittensor/extrinsics/root.py,sha256=N9Fg4VaveRRP1ZN4EZjIWCe04FpTNBKWFqx8USKp9uQ,19062
15
- bittensor_cli/src/bittensor/extrinsics/transfer.py,sha256=FyrRo3yk-065toN4f-1Xes23CE5tqP5KU0dBJkKofUc,8476
16
- bittensor_cli/src/bittensor/templates/table.j2,sha256=P2EFiksnO1cQsB8zjK6hVJwUryHTsLslzRE0YtobAV8,10601
17
- bittensor_cli/src/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
- bittensor_cli/src/commands/sudo.py,sha256=Hdn0RX1NaZwYlaywbeiK-2fx5XkQuWedw4uVsgQQtLU,27969
19
- bittensor_cli/src/commands/wallets.py,sha256=MYj-kJRGuQ00aqwkVot69zdYrzvxhDS94qfM7K0mdAQ,49645
20
- bittensor_cli/src/commands/weights.py,sha256=uI7aACKD90JOtYt61VdKL76z7Fe_wh4WtdwMXL6ydD4,16269
21
- bittensor_cli/src/commands/stake/__init__.py,sha256=uxomMv_QrYt5Qn3_X5UWFFh45ISjB0JmDmCFxVyX8nQ,6495
22
- bittensor_cli/src/commands/stake/add.py,sha256=UhXPh8B8SRSE04MkFpQpDdGs5zSgfSC_DtWLpPeOGxc,25142
23
- bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=L1a7T8VHvvrmT29JiRJwfzukmv_WSV3LTzuoQFyycZg,29582
24
- bittensor_cli/src/commands/stake/list.py,sha256=EJoUGckyO9HzPkHJqwBi14e5HT-E0jTTKU_mPFEGKhw,29625
25
- bittensor_cli/src/commands/stake/move.py,sha256=PHr4u8coXsMd3IGgIkvcmEGauDBtrFpZF9WKHilDmKk,37424
26
- bittensor_cli/src/commands/stake/remove.py,sha256=IKUaoMWrjhZoD4Tp_sCeWMNJ9Wk4d8gjj0Lz7ahKhA4,43330
27
- bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
28
- bittensor_cli/src/commands/subnets/price.py,sha256=TWcRXUFeS_Q-pfyv0YIluAL8SE7d2gzTODK-9M2J5pw,29878
29
- bittensor_cli/src/commands/subnets/subnets.py,sha256=uIhfvw3Nt0V6HUiXrn1GWmbqVVQJwyY9nxyegeaOUKs,84142
30
- bittensor_cli-9.0.1.dist-info/METADATA,sha256=tSXW1ayn3OBwQlD0EoX36ZhO8FkrYw-dsiIgq0xC7RA,6855
31
- bittensor_cli-9.0.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
32
- bittensor_cli-9.0.1.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
33
- bittensor_cli-9.0.1.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
34
- bittensor_cli-9.0.1.dist-info/RECORD,,