bittensor.extrinsics.delegation#

Attributes#

Functions#

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

Becomes a delegate for the hotkey.

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

Delegates the specified amount of stake to the passed delegate.

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

Un-delegates stake from the passed delegate.

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

Decrease delegate take for the hotkey.

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

Increase delegate take for the hotkey.

Module Contents#

bittensor.extrinsics.delegation.logger#
bittensor.extrinsics.delegation.nominate_extrinsic(subtensor, wallet, wait_for_finalization=False, wait_for_inclusion=True)[source]#

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.delegate_extrinsic(subtensor, wallet, delegate_ss58=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False, prompt=False)[source]#

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.undelegate_extrinsic(subtensor, wallet, delegate_ss58=None, amount=None, wait_for_inclusion=True, wait_for_finalization=False, prompt=False)[source]#

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:
bittensor.extrinsics.delegation.decrease_take_extrinsic(subtensor, wallet, hotkey_ss58=None, take=0, wait_for_finalization=False, wait_for_inclusion=True)[source]#

Decrease delegate take for the hotkey.

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

  • hotkey_ss58 (Optional[str]) – The ss58 address of the hotkey account to stake to defaults to the wallet’s hotkey.

  • take (float) – The take of the hotkey.

  • 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.increase_take_extrinsic(subtensor, wallet, hotkey_ss58=None, take=0, wait_for_finalization=False, wait_for_inclusion=True)[source]#

Increase delegate take for the hotkey.

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

  • hotkey_ss58 (Optional[str]) – The ss58 address of the hotkey account to stake to defaults to the wallet’s hotkey.

  • take (float) – The take of the hotkey.

  • subtensor (bittensor.subtensor)

  • wait_for_finalization (bool)

  • wait_for_inclusion (bool)

Returns:

True if the transaction was successful.

Return type:

success (bool)