bittensor.extrinsics.delegation
#
Module Contents#
Functions#
|
Becomes a delegate for the hotkey. |
|
Delegates the specified amount of stake to the passed delegate. |
|
Un-delegates stake from the passed delegate. |
Attributes#
- bittensor.extrinsics.delegation.logger#
- bittensor.extrinsics.delegation.nominate_extrinsic(subtensor, wallet, wait_for_finalization=False, wait_for_inclusion=True)#
Becomes a delegate for the hotkey. :param wallet: The wallet to become a delegate for. :type wallet: bittensor.wallet
- bittensor.extrinsics.delegation.delegate_extrinsic(subtensor, wallet, delegate_ss58=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False, prompt=False)#
Delegates the specified amount of stake to the passed delegate. :param wallet: Bittensor wallet object. :type wallet: bittensor.wallet :param delegate_ss58: ss58 address of the delegate. :type delegate_ss58: Optional[str] :param amount: Amount to stake as bittensor balance, or float interpreted as Tao. :type amount: Union[Balance, float] :param wait_for_inclusion: 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.
- Parameters:
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.
prompt (bool) – If true, the call waits for confirmation from the user before proceeding.
subtensor (bittensor.subtensor) –
wallet (bittensor.wallet) –
delegate_ss58 (Optional[str]) –
amount (Union[bittensor.utils.balance.Balance, float]) –
wait_for_inclusion (bool) –
- Returns:
flag is true if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is true.
- Return type:
success (bool)
- Raises:
NotRegisteredError – If the wallet is not registered on the chain.
NotDelegateError – If the hotkey is not a delegate on the chain.
- bittensor.extrinsics.delegation.undelegate_extrinsic(subtensor, wallet, delegate_ss58=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False, prompt=False)#
Un-delegates stake from the passed delegate. :param wallet: Bittensor wallet object. :type wallet: bittensor.wallet :param delegate_ss58: ss58 address of the delegate. :type delegate_ss58: Optional[str] :param amount: Amount to unstake as bittensor balance, or float interpreted as Tao. :type amount: Union[Balance, float] :param wait_for_inclusion: 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.
- Parameters:
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.
prompt (bool) – If true, the call waits for confirmation from the user before proceeding.
subtensor (bittensor.subtensor) –
wallet (bittensor.wallet) –
delegate_ss58 (Optional[str]) –
amount (Union[bittensor.utils.balance.Balance, float]) –
wait_for_inclusion (bool) –
- Returns:
flag is true if extrinsic was finalized or uncluded in the block. If we did not wait for finalization / inclusion, the response is true.
- Return type:
success (bool)
- Raises:
NotRegisteredError – If the wallet is not registered on the chain.
NotDelegateError – If the hotkey is not a delegate on the chain.