bittensor.extrinsics.delegation#

Module Contents#

Functions#

delegate_extrinsic(subtensor, wallet[, delegate_ss58, ...])

Delegates the specified amount of stake to the passed delegate.

nominate_extrinsic(subtensor, wallet[, ...])

Becomes a delegate for the hotkey.

undelegate_extrinsic(subtensor, wallet[, ...])

Un-delegates stake from the passed delegate.

Attributes#

logger

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.

Parameters:
  • wallet (bittensor.wallet) – Bittensor wallet object.

  • delegate_ss58 (Optional[str]) – The ss58 address of the delegate.

  • amount (Union[Balance, float]) – Amount to stake as bittensor balance, or float interpreted as Tao.

  • 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.

  • prompt (bool) – If true, the call waits for confirmation from the user before proceeding.

  • subtensor (bittensor.subtensor) –

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:
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.

Parameters:
  • wallet (bittensor.wallet) – The wallet to become a delegate for.

  • subtensor (bittensor.subtensor) –

  • wait_for_finalization (bool) –

  • wait_for_inclusion (bool) –

Returns:

True if the transaction was successful.

Return type:

success (bool)

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.

Parameters:
  • wallet (bittensor.wallet) – Bittensor wallet object.

  • delegate_ss58 (Optional[str]) – The ss58 address of the delegate.

  • amount (Union[Balance, float]) – Amount to unstake as bittensor balance, or float interpreted as Tao.

  • 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.

  • prompt (bool) – If true, the call waits for confirmation from the user before proceeding.

  • subtensor (bittensor.subtensor) –

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: