@@ -3119,6 +3119,9 @@ async def wait_for_block(self, block: Optional[int] = None):
3119
3119
bool: True if the target block was reached, False if timeout occurred.
3120
3120
3121
3121
Example:
3122
+ import bittensor as bt
3123
+ subtensor = bt.Subtensor()
3124
+
3122
3125
await subtensor.wait_for_block() # Waits for next block
3123
3126
await subtensor.wait_for_block(block=1234) # Waits for a specific block
3124
3127
"""
@@ -3380,27 +3383,27 @@ async def add_stake(
3380
3383
period : Optional [int ] = None ,
3381
3384
) -> bool :
3382
3385
"""
3383
- Adds the specified amount of stake to a neuron identified by the hotkey ``SS58`` address.
3384
- Staking is a fundamental process in the Bittensor network that enables neurons to participate actively and earn
3385
- incentives.
3386
+ Adds a stake from the specified wallet to the neuron identified by the SS58 address of its hotkey in specified subnet.
3387
+ Staking is a fundamental process in the Bittensor network that enables neurons to participate actively and earn incentives.
3386
3388
3387
3389
Args:
3388
- wallet (bittensor_wallet.Wallet): The wallet to be used for staking.
3389
- hotkey_ss58 (Optional[str]): The ``SS58`` address of the hotkey associated with the neuron.
3390
- netuid: subnet UID
3391
- amount (Balance): The amount of TAO to stake.
3392
- wait_for_inclusion (bool): Waits for the transaction to be included in a block.
3393
- wait_for_finalization (bool): Waits for the transaction to be finalized on the blockchain.
3394
- safe_staking (bool): If true, enables price safety checks to protect against fluctuating prices. The stake
3395
- will only execute if the price change doesn't exceed the rate tolerance. Default is False.
3396
- allow_partial_stake (bool): If true and safe_staking is enabled, allows partial staking when
3397
- the full amount would exceed the price threshold. If false, the entire stake fails if it would
3398
- exceed the threshold. Default is False.
3399
- rate_tolerance (float): The maximum allowed price change ratio when staking. For example,
3400
- 0.005 = 0.5% maximum price increase. Only used when safe_staking is True. Default is 0.005.
3401
- period (Optional[int]): The number of blocks during which the transaction will remain valid after it's
3402
- submitted. If the transaction is not included in a block within that number of blocks, it will expire
3403
- and be rejected. You can think of it as an expiration date for the transaction.
3390
+ wallet: The wallet to be used for staking.
3391
+ hotkey_ss58: The SS58 address of the hotkey associated with the neuron to which you intend to delegate your
3392
+ stake. If not specified, the wallet's hotkey will be used. Defaults to ``None``.
3393
+ netuid: The unique identifier of the subnet to which the neuron belongs.
3394
+ amount: The amount of TAO to stake.
3395
+ wait_for_inclusion: Waits for the transaction to be included in a block. Defaults to ``True``.
3396
+ wait_for_finalization: Waits for the transaction to be finalized on the blockchain. Defaults to ``False``.
3397
+ safe_staking: If true, enables price safety checks to protect against fluctuating prices. The stake will
3398
+ only execute if the price change doesn't exceed the rate tolerance. Default is ``False``.
3399
+ allow_partial_stake: If true and safe_staking is enabled, allows partial staking when the full amount would
3400
+ exceed the price tolerance. If false, the entire stake fails if it would exceed the tolerance.
3401
+ Default is ``False``.
3402
+ rate_tolerance: The maximum allowed price change ratio when staking. For example,
3403
+ 0.005 = 0.5% maximum price increase. Only used when safe_staking is True. Default is ``0.005``.
3404
+ period: The number of blocks during which the transaction will remain valid after it's submitted. If the
3405
+ transaction is not included in a block within that number of blocks, it will expire and be rejected. You
3406
+ can think of it as an expiration date for the transaction. Defaults to ``None``.
3404
3407
3405
3408
Returns:
3406
3409
bool: ``True`` if the staking is successful, False otherwise.
@@ -4428,6 +4431,7 @@ async def unstake(
4428
4431
allow_partial_stake : bool = False ,
4429
4432
rate_tolerance : float = 0.005 ,
4430
4433
period : Optional [int ] = None ,
4434
+ unstake_all : bool = False ,
4431
4435
) -> bool :
4432
4436
"""
4433
4437
Removes a specified amount of stake from a single hotkey account. This function is critical for adjusting
@@ -4451,6 +4455,7 @@ async def unstake(
4451
4455
period (Optional[int]): The number of blocks during which the transaction will remain valid after it's submitted. If
4452
4456
the transaction is not included in a block within that number of blocks, it will expire and be rejected.
4453
4457
You can think of it as an expiration date for the transaction.
4458
+ unstake_all: If true, unstakes all tokens. Default is ``False``. If `True` amount is ignored.
4454
4459
4455
4460
Returns:
4456
4461
bool: ``True`` if the unstaking process is successful, False otherwise.
@@ -4471,6 +4476,7 @@ async def unstake(
4471
4476
allow_partial_stake = allow_partial_stake ,
4472
4477
rate_tolerance = rate_tolerance ,
4473
4478
period = period ,
4479
+ unstake_all = unstake_all ,
4474
4480
)
4475
4481
4476
4482
async def unstake_multiple (
@@ -4482,6 +4488,7 @@ async def unstake_multiple(
4482
4488
wait_for_inclusion : bool = True ,
4483
4489
wait_for_finalization : bool = False ,
4484
4490
period : Optional [int ] = None ,
4491
+ unstake_all : bool = False ,
4485
4492
) -> bool :
4486
4493
"""
4487
4494
Performs batch unstaking from multiple hotkey accounts, allowing a neuron to reduce its staked amounts
@@ -4499,6 +4506,7 @@ async def unstake_multiple(
4499
4506
period (Optional[int]): The number of blocks during which the transaction will remain valid after it's submitted. If
4500
4507
the transaction is not included in a block within that number of blocks, it will expire and be rejected.
4501
4508
You can think of it as an expiration date for the transaction.
4509
+ unstake_all: If true, unstakes all tokens. Default is ``False``. If `True` amounts are ignored.
4502
4510
4503
4511
Returns:
4504
4512
bool: ``True`` if the batch unstaking is successful, False otherwise.
@@ -4515,6 +4523,7 @@ async def unstake_multiple(
4515
4523
wait_for_inclusion = wait_for_inclusion ,
4516
4524
wait_for_finalization = wait_for_finalization ,
4517
4525
period = period ,
4526
+ unstake_all = unstake_all ,
4518
4527
)
4519
4528
4520
4529
0 commit comments