bittensor.core.extrinsics.root#

Functions#

claim_root_extrinsic(subtensor, wallet, netuids, *[, ...])

Claims the root emissions for a coldkey.

root_register_extrinsic(subtensor, wallet, *[, ...])

Registers the neuron to the root network.

set_root_claim_type_extrinsic(subtensor, wallet, ...)

Sets the root claim type for the coldkey in provided wallet.

Module Contents#

bittensor.core.extrinsics.root.claim_root_extrinsic(subtensor, wallet, netuids, *, mev_protection=DEFAULT_MEV_PROTECTION, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True, wait_for_revealed_execution=True)#

Claims the root emissions for a coldkey.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – Subtensor instance to interact with the blockchain.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • netuids (bittensor.core.types.UIDs) – The netuids to claim root emissions for.

  • mev_protection (bool) – If True, encrypts and submits the transaction through the MEV Shield pallet to protect against front-running and MEV attacks. The transaction remains encrypted in the mempool until validators decrypt and execute it. If False, submits the transaction directly without encryption.

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

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

  • wait_for_revealed_execution (bool) – Whether to wait for the revealed execution of transaction if mev_protection used.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

bittensor.core.extrinsics.root.root_register_extrinsic(subtensor, wallet, *, mev_protection=DEFAULT_MEV_PROTECTION, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True, wait_for_revealed_execution=True)[source]#

Registers the neuron to the root network.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – Subtensor instance to interact with the blockchain.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • mev_protection (bool) – If True, encrypts and submits the transaction through the MEV Shield pallet to protect against front-running and MEV attacks. The transaction remains encrypted in the mempool until validators decrypt and execute it. If False, submits the transaction directly without encryption.

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

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

  • wait_for_revealed_execution (bool) – Whether to wait for the revealed execution of transaction if mev_protection used.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse

bittensor.core.extrinsics.root.set_root_claim_type_extrinsic(subtensor, wallet, new_root_claim_type, *, mev_protection=DEFAULT_MEV_PROTECTION, period=None, raise_error=False, wait_for_inclusion=True, wait_for_finalization=True, wait_for_revealed_execution=True)#

Sets the root claim type for the coldkey in provided wallet.

Parameters:
  • subtensor (bittensor.core.subtensor.Subtensor) – Subtensor instance to interact with the blockchain.

  • wallet (bittensor_wallet.Wallet) – Bittensor Wallet instance.

  • new_root_claim_type (Literal['Swap', 'Keep'] | RootClaimType | dict) – The new root claim type to set. Can be: - String: “Swap” or “Keep” - RootClaimType: RootClaimType.Swap, RootClaimType.Keep - Dict: {“KeepSubnets”: {“subnets”: [1, 2, 3]}} - Callable: RootClaimType.KeepSubnets([1, 2, 3])

  • mev_protection (bool) – If True, encrypts and submits the transaction through the MEV Shield pallet to protect against front-running and MEV attacks. The transaction remains encrypted in the mempool until validators decrypt and execute it. If False, submits the transaction directly without encryption.

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

  • raise_error (bool) – Raises a relevant exception rather than returning False if unsuccessful.

  • wait_for_inclusion (bool) – Whether to wait for the inclusion of the transaction.

  • wait_for_finalization (bool) – Whether to wait for the finalization of the transaction.

  • wait_for_revealed_execution (bool) – Whether to wait for the revealed execution of transaction if mev_protection used.

Returns:

The result object of the extrinsic execution.

Return type:

ExtrinsicResponse