bittensor.core.extrinsics.asyncex.staking#
Functions#
|
Adds the specified amount of stake to passed hotkey uid. |
|
Adds a stake to each |
Module Contents#
- async bittensor.core.extrinsics.asyncex.staking.add_stake_extrinsic(subtensor, wallet, old_balance=None, hotkey_ss58=None, netuid=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False, safe_staking=False, allow_partial_stake=False, rate_tolerance=0.005, period=None)[source]#
Adds the specified amount of stake to passed hotkey uid.
- Parameters:
subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – the initialized SubtensorInterface object to use
wallet (bittensor_wallet.Wallet) – Bittensor wallet object.
old_balance (Optional[bittensor.utils.balance.Balance]) – the balance prior to the staking
hotkey_ss58 (Optional[str]) – The ss58 address of the hotkey account to stake to defaults to the wallet’s hotkey.
netuid (Optional[int]) – The netuid of the stake to be added
amount (Optional[bittensor.utils.balance.Balance]) – Amount to stake as Bittensor balance, None if staking all.
wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.
wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.
safe_staking (bool) – If set, uses safe staking logic
allow_partial_stake (bool) – If set, allows partial stake
rate_tolerance (float) – The rate tolerance for safe staking
period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.
- Returns:
- Flag is True if extrinsic was finalized or included in the block. If we did not wait for
finalization/inclusion, the response is True.
- Return type:
success
- Raises:
SubstrateRequestException – Raised if the extrinsic fails to be included in the block within the timeout.
- async bittensor.core.extrinsics.asyncex.staking.add_stake_multiple_extrinsic(subtensor, wallet, hotkey_ss58s, netuids, old_balance=None, amounts=None, wait_for_inclusion=True, wait_for_finalization=False, period=None)[source]#
Adds a stake to each
hotkey_ss58
in the list, using each amount, from a common coldkey.- Parameters:
subtensor (bittensor.core.async_subtensor.AsyncSubtensor) – The initialized SubtensorInterface object.
wallet (bittensor_wallet.Wallet) – Bittensor wallet object for the coldkey.
old_balance (Optional[bittensor.utils.balance.Balance]) – The balance of the wallet prior to staking.
amounts (Optional[list[bittensor.utils.balance.Balance]]) – List of amounts to stake. If None, stake all to the first hotkey.
wait_for_inclusion (bool) – If set, waits for the extrinsic to enter a block before returning True, or returns False if the extrinsic fails to enter the block within the timeout.
wait_for_finalization (bool) – If set, waits for the extrinsic to be finalized on the chain before returning True, or returns False if the extrinsic fails to be finalized within the timeout.
period (Optional[int]) – The number of blocks during which the transaction will remain valid after it’s submitted. If the transaction is not included in a block within that number of blocks, it will expire and be rejected. You can think of it as an expiration date for the transaction.
- Returns:
- True if extrinsic was finalized or included in the block. True if any wallet was staked. If we did
not wait for finalization/inclusion, the response is True.
- Return type:
success