bittensor-cli 9.8.2__py3-none-any.whl → 9.8.4__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/cli.py +1 -7
- bittensor_cli/src/bittensor/subtensor_interface.py +8 -19
- bittensor_cli/src/bittensor/utils.py +1 -1
- bittensor_cli/src/commands/stake/move.py +13 -9
- {bittensor_cli-9.8.2.dist-info → bittensor_cli-9.8.4.dist-info}/METADATA +1 -1
- {bittensor_cli-9.8.2.dist-info → bittensor_cli-9.8.4.dist-info}/RECORD +9 -9
- {bittensor_cli-9.8.2.dist-info → bittensor_cli-9.8.4.dist-info}/WHEEL +0 -0
- {bittensor_cli-9.8.2.dist-info → bittensor_cli-9.8.4.dist-info}/entry_points.txt +0 -0
- {bittensor_cli-9.8.2.dist-info → bittensor_cli-9.8.4.dist-info}/top_level.txt +0 -0
bittensor_cli/cli.py
CHANGED
@@ -277,8 +277,6 @@ class Options:
|
|
277
277
|
)
|
278
278
|
rate_tolerance = typer.Option(
|
279
279
|
None,
|
280
|
-
"--slippage",
|
281
|
-
"--slippage-tolerance",
|
282
280
|
"--tolerance",
|
283
281
|
"--rate-tolerance",
|
284
282
|
help="Set the rate tolerance percentage for transactions (default: 0.05 for 5%).",
|
@@ -1257,8 +1255,6 @@ class CLIManager:
|
|
1257
1255
|
),
|
1258
1256
|
rate_tolerance: Optional[float] = typer.Option(
|
1259
1257
|
None,
|
1260
|
-
"--slippage",
|
1261
|
-
"--slippage-tolerance",
|
1262
1258
|
"--tolerance",
|
1263
1259
|
help="Set the rate tolerance percentage for transactions (e.g. 0.1 for 0.1%).",
|
1264
1260
|
),
|
@@ -1404,9 +1400,7 @@ class CLIManager:
|
|
1404
1400
|
wallet_hotkey: bool = typer.Option(False, *Options.wallet_hotkey.param_decls),
|
1405
1401
|
network: bool = typer.Option(False, *Options.network.param_decls),
|
1406
1402
|
use_cache: bool = typer.Option(False, "--cache"),
|
1407
|
-
rate_tolerance: bool = typer.Option(
|
1408
|
-
False, "--slippage", "--slippage-tolerance", "--tolerance"
|
1409
|
-
),
|
1403
|
+
rate_tolerance: bool = typer.Option(False, "--tolerance"),
|
1410
1404
|
safe_staking: bool = typer.Option(
|
1411
1405
|
False, "--safe-staking/--no-safe-staking", "--safe/--unsafe"
|
1412
1406
|
),
|
@@ -36,6 +36,7 @@ from bittensor_cli.src.bittensor.utils import (
|
|
36
36
|
decode_hex_identity_dict,
|
37
37
|
validate_chain_endpoint,
|
38
38
|
u16_normalized_float,
|
39
|
+
U16_MAX,
|
39
40
|
)
|
40
41
|
|
41
42
|
SubstrateClass = (
|
@@ -1526,28 +1527,16 @@ class SubtensorInterface:
|
|
1526
1527
|
5. Moving between coldkeys
|
1527
1528
|
"""
|
1528
1529
|
|
1529
|
-
|
1530
|
-
|
1531
|
-
origin = (origin_hotkey_ss58, origin_netuid)
|
1530
|
+
if origin_netuid is None:
|
1531
|
+
origin_netuid = 0
|
1532
1532
|
|
1533
|
-
|
1534
|
-
|
1535
|
-
destination = (destination_hotkey_ss58, destination_netuid)
|
1533
|
+
fee_rate = await self.query("Swap", "FeeRate", [origin_netuid])
|
1534
|
+
fee = amount * (fee_rate / U16_MAX)
|
1536
1535
|
|
1537
|
-
result =
|
1538
|
-
|
1539
|
-
method="get_stake_fee",
|
1540
|
-
params=[
|
1541
|
-
origin,
|
1542
|
-
origin_coldkey_ss58,
|
1543
|
-
destination,
|
1544
|
-
destination_coldkey_ss58,
|
1545
|
-
amount,
|
1546
|
-
],
|
1547
|
-
block_hash=block_hash,
|
1548
|
-
)
|
1536
|
+
result = Balance.from_rao(fee)
|
1537
|
+
result.set_unit(origin_netuid)
|
1549
1538
|
|
1550
|
-
return
|
1539
|
+
return result
|
1551
1540
|
|
1552
1541
|
async def get_scheduled_coldkey_swap(
|
1553
1542
|
self,
|
@@ -32,7 +32,7 @@ if TYPE_CHECKING:
|
|
32
32
|
from bittensor_cli.src.bittensor.chain_data import SubnetHyperparameters
|
33
33
|
from rich.prompt import PromptBase
|
34
34
|
|
35
|
-
BT_DOCS_LINK = "https://docs.
|
35
|
+
BT_DOCS_LINK = "https://docs.learnbittensor.org"
|
36
36
|
|
37
37
|
|
38
38
|
console = Console()
|
@@ -38,14 +38,16 @@ async def display_stake_movement_cross_subnets(
|
|
38
38
|
|
39
39
|
if origin_netuid == destination_netuid:
|
40
40
|
subnet = await subtensor.subnet(origin_netuid)
|
41
|
-
received_amount_tao = subnet.alpha_to_tao(amount_to_move)
|
42
|
-
|
41
|
+
received_amount_tao = subnet.alpha_to_tao(amount_to_move - stake_fee)
|
42
|
+
received_amount = subnet.tao_to_alpha(received_amount_tao)
|
43
43
|
|
44
|
-
if
|
45
|
-
print_error(
|
44
|
+
if received_amount < Balance.from_tao(0).set_unit(destination_netuid):
|
45
|
+
print_error(
|
46
|
+
f"Not enough Alpha to pay the transaction fee. The fee is {stake_fee}, "
|
47
|
+
f"which would set the total received to {received_amount}."
|
48
|
+
)
|
46
49
|
raise ValueError
|
47
50
|
|
48
|
-
received_amount = subnet.tao_to_alpha(received_amount_tao)
|
49
51
|
price = subnet.price.tao
|
50
52
|
price_str = (
|
51
53
|
str(float(price))
|
@@ -60,13 +62,15 @@ async def display_stake_movement_cross_subnets(
|
|
60
62
|
price_destination = dynamic_destination.price.tao
|
61
63
|
rate = price_origin / (price_destination or 1)
|
62
64
|
|
63
|
-
received_amount_tao = dynamic_origin.alpha_to_tao(amount_to_move)
|
64
|
-
received_amount_tao -= stake_fee
|
65
|
+
received_amount_tao = dynamic_origin.alpha_to_tao(amount_to_move - stake_fee)
|
65
66
|
received_amount = dynamic_destination.tao_to_alpha(received_amount_tao)
|
66
67
|
received_amount.set_unit(destination_netuid)
|
67
68
|
|
68
|
-
if received_amount < Balance.from_tao(0):
|
69
|
-
print_error(
|
69
|
+
if received_amount < Balance.from_tao(0).set_unit(destination_netuid):
|
70
|
+
print_error(
|
71
|
+
f"Not enough Alpha to pay the transaction fee. The fee is {stake_fee}, "
|
72
|
+
f"which would set the total received to {received_amount}."
|
73
|
+
)
|
70
74
|
raise ValueError
|
71
75
|
|
72
76
|
price_str = (
|
@@ -1,5 +1,5 @@
|
|
1
1
|
bittensor_cli/__init__.py,sha256=Lpv4NkbAQgwrfqFOnTMuR_S-fqGdaWCSLhxnFnGTHM0,1232
|
2
|
-
bittensor_cli/cli.py,sha256=
|
2
|
+
bittensor_cli/cli.py,sha256=ErbyBpp8amE4nOOsN8tvarf-JrW3Bx6F5MQJ4dHLuUI,231135
|
3
3
|
bittensor_cli/doc_generation_helper.py,sha256=GexqjEIKulWg84hpNBEchJ840oOgOi7DWpt447nsdNI,91
|
4
4
|
bittensor_cli/version.py,sha256=dU1xsa3mG5FPdhzvqlzDByNcCHmzcFQH3q1pQr4u76g,720
|
5
5
|
bittensor_cli/src/__init__.py,sha256=2UhjaM4VHfixjmMZvz5OkWn5DsO08WRnOtk_ZNDGTUo,33012
|
@@ -8,8 +8,8 @@ bittensor_cli/src/bittensor/balances.py,sha256=q5KkxF8wmUguWAFddEKstfDKTxPe5ISHp
|
|
8
8
|
bittensor_cli/src/bittensor/chain_data.py,sha256=_GATOCacWMN2jRurzn3hffJiq_l7AznGRkKePTAflwQ,44420
|
9
9
|
bittensor_cli/src/bittensor/minigraph.py,sha256=BIzmSVLfBYiRAeGD_i1LAC8Cw7zxp38a91SIFEPMqYc,10479
|
10
10
|
bittensor_cli/src/bittensor/networking.py,sha256=pZLMs8YXpZzDMLXWMBb_Bj6TVkm_q9khyY-lnbwVMuE,462
|
11
|
-
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=
|
12
|
-
bittensor_cli/src/bittensor/utils.py,sha256=
|
11
|
+
bittensor_cli/src/bittensor/subtensor_interface.py,sha256=iPpM0mGsRwc7iejBI9oChpFd8DgEw13-Yb1fflQyCb8,61886
|
12
|
+
bittensor_cli/src/bittensor/utils.py,sha256=iVsEtC2mod9Z5EwXKCODy2k0yiP2kDZqmm-hhn24S-M,47966
|
13
13
|
bittensor_cli/src/bittensor/extrinsics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
bittensor_cli/src/bittensor/extrinsics/registration.py,sha256=7ybqpJ7-Z_PTgj4boCOFxgfjMBCHv0JE7MNpJzJmyDc,66360
|
15
15
|
bittensor_cli/src/bittensor/extrinsics/root.py,sha256=C9WPssL2HpNK8u_IFPPr8TrdFgbLPTfkbAYzalfmbRM,19188
|
@@ -39,13 +39,13 @@ bittensor_cli/src/commands/stake/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRk
|
|
39
39
|
bittensor_cli/src/commands/stake/add.py,sha256=oEpWFnRWazaFsbKn06o4gwQ1JfFmn4AwxRNecimI3js,27614
|
40
40
|
bittensor_cli/src/commands/stake/children_hotkeys.py,sha256=lMiV-Z3SGZUEapdy0LRthFLx0RlFK0KVxytE47ybdEc,31746
|
41
41
|
bittensor_cli/src/commands/stake/list.py,sha256=tzjhiJucXgOGaw7TGt420nGosH85AEjvOimP1XXV3Xs,29038
|
42
|
-
bittensor_cli/src/commands/stake/move.py,sha256=
|
42
|
+
bittensor_cli/src/commands/stake/move.py,sha256=X8rphxkL5BBHJSNpNqY_o3fffCpSI0-yX03SlNXfX_A,34857
|
43
43
|
bittensor_cli/src/commands/stake/remove.py,sha256=DX7yPXs5n8Gp3O_Fwz8cMYI8CAiRp16gbKLwSCAoYmM,47341
|
44
44
|
bittensor_cli/src/commands/subnets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
45
45
|
bittensor_cli/src/commands/subnets/price.py,sha256=akXkbilWjQYqTYvtOhXngX_cVkU0Mv-Gl3kjce6dtl0,21490
|
46
46
|
bittensor_cli/src/commands/subnets/subnets.py,sha256=yM74ct5a9xHyD_TdSAmZL6XOtkT6zk6F67VvOe8Ou68,94070
|
47
|
-
bittensor_cli-9.8.
|
48
|
-
bittensor_cli-9.8.
|
49
|
-
bittensor_cli-9.8.
|
50
|
-
bittensor_cli-9.8.
|
51
|
-
bittensor_cli-9.8.
|
47
|
+
bittensor_cli-9.8.4.dist-info/METADATA,sha256=hDV0iqVT0Q9hb5joI0nb8hhrZMPcQPT1I5ij-P7rz_0,6601
|
48
|
+
bittensor_cli-9.8.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
49
|
+
bittensor_cli-9.8.4.dist-info/entry_points.txt,sha256=hBTLGLbVxmAKy69XSKaUZvjTCmyEzDGZKq4S8UOto8I,49
|
50
|
+
bittensor_cli-9.8.4.dist-info/top_level.txt,sha256=DvgvXpmTtI_Q1BbDZMlK90LFcGFCreN1daViEPV2iFw,14
|
51
|
+
bittensor_cli-9.8.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|