bittensor.core.chain_data.root_claim#

Classes#

KeepSubnetsDescriptor

Descriptor that allows callable syntax for KeepSubnets variant.

RootClaimType

Enumeration of root claim types in the Bittensor network.

Module Contents#

class bittensor.core.chain_data.root_claim.KeepSubnetsDescriptor#

Descriptor that allows callable syntax for KeepSubnets variant.

subnets: list[int]#
to_dict()#

Converts the descriptor to the required dictionary format.

Return type:

dict

class bittensor.core.chain_data.root_claim.RootClaimType#

Bases: str, enum.Enum

Enumeration of root claim types in the Bittensor network.

This enum defines how coldkeys manage their root alpha emissions: - Swap: Swap any alpha emission for TAO - Keep: Keep all alpha emission - KeepSubnets: Keep alpha emission for specified subnets, swap everything else

The values match exactly with the RootClaimTypeEnum defined in the Subtensor runtime.

Initialize self. See help(type(self)) for accurate signature.

Keep = 'Keep'#
KeepSubnets#
Swap = 'Swap'#
classmethod normalize(value)#

Normalizes a root claim type to a format suitable for Substrate calls.

This method handles various input formats: - String values (“Swap”, “Keep”) → returns string - Enum values (RootClaimType.Swap) → returns string - Dict values ({“KeepSubnets”: {“subnets”: [1, 2, 3]}}) → returns dict as-is - Callable KeepSubnets([1, 2, 3]) → returns dict

Parameters:

value (Literal['Swap', 'Keep'] | RootClaimType | dict) – The root claim type in any supported format.

Returns:

Normalized value - string for Swap/Keep or dict for KeepSubnets.

Raises:
  • ValueError – If the value is not a valid root claim type or KeepSubnets has no subnets.

  • TypeError – If the value type is not supported.

Return type:

str | dict