TransactionApi

Struct TransactionApi 

Source
pub struct TransactionApi;

Implementations§

Source§

impl TransactionApi

Source

pub fn set_weights( &self, netuid: Netuid, dests: Dests, weights: Weights, version_key: VersionKey, ) -> StaticPayload<SetWeights>

— Sets the caller weights for the incentive mechanism. The call can be made from the hotkey account so is potentially insecure, however, the damage of changing weights is minimal if caught early. This function includes all the checks that the passed weights meet the requirements. Stored as u16s they represent rational values in the range [0,1] which sum to 1 and can be interpreted as probabilities. The specific weights determine how inflation propagates outward from this peer.

Note: The 16 bit integers weights should represent 1.0 as the max u16. However, the function normalizes all integers to u16_max anyway. This means that if the sum of all elements is larger or smaller than the amount of elements * u16_max, all elements will be corrected for this deviation.

§Args:
  • origin: (Origin):

    • The caller, a hotkey who wishes to set their weights.
  • netuid (u16):

    • The network uid we are setting these weights on.
  • dests (Vec):

    • The edge endpoint for the weight, i.e. j for w_ij.
  • ‘weights’ (Vec):

    • The u16 integer encoded weights. Interpreted as rational values in the range [0,1]. They must sum to in32::MAX.
  • ‘version_key’ ( u64 ):

    • The network version key to check if the validator is up to date.
§Event:
  • WeightsSet;
    • On successfully setting the weights on chain.
§Raises:
  • ‘MechanismDoesNotExist’:

    • Attempting to set weights on a non-existent network.
  • ‘NotRegistered’:

    • Attempting to set weights from a non registered account.
  • ‘WeightVecNotEqualSize’:

    • Attempting to set weights with uids not of same length.
  • ‘DuplicateUids’:

    • Attempting to set weights with duplicate uids.
    • ‘UidsLengthExceedUidsInSubNet’:
    • Attempting to set weights above the max allowed uids.
  • ‘UidVecContainInvalidOne’:

    • Attempting to set weights with invalid uids.
  • ‘WeightVecLengthIsLow’:

    • Attempting to set weights with fewer weights than min.
  • ‘MaxWeightExceeded’:

    • Attempting to set weights with max value exceeding limit.
Source

pub fn set_mechanism_weights( &self, netuid: Netuid, mecid: Mecid, dests: Dests, weights: Weights, version_key: VersionKey, ) -> StaticPayload<SetMechanismWeights>

— Sets the caller weights for the incentive mechanism for mechanisms. The call can be made from the hotkey account so is potentially insecure, however, the damage of changing weights is minimal if caught early. This function includes all the checks that the passed weights meet the requirements. Stored as u16s they represent rational values in the range [0,1] which sum to 1 and can be interpreted as probabilities. The specific weights determine how inflation propagates outward from this peer.

Note: The 16 bit integers weights should represent 1.0 as the max u16. However, the function normalizes all integers to u16_max anyway. This means that if the sum of all elements is larger or smaller than the amount of elements * u16_max, all elements will be corrected for this deviation.

§Args:
  • origin: (Origin):

    • The caller, a hotkey who wishes to set their weights.
  • netuid (u16):

    • The network uid we are setting these weights on.
  • mecid (u8):

    • The u8 mechnism identifier.
  • dests (Vec):

    • The edge endpoint for the weight, i.e. j for w_ij.
  • ‘weights’ (Vec):

    • The u16 integer encoded weights. Interpreted as rational values in the range [0,1]. They must sum to in32::MAX.
  • ‘version_key’ ( u64 ):

    • The network version key to check if the validator is up to date.
§Event:
  • WeightsSet;
    • On successfully setting the weights on chain.
§Raises:
  • ‘MechanismDoesNotExist’:

    • Attempting to set weights on a non-existent network.
  • ‘NotRegistered’:

    • Attempting to set weights from a non registered account.
  • ‘WeightVecNotEqualSize’:

    • Attempting to set weights with uids not of same length.
  • ‘DuplicateUids’:

    • Attempting to set weights with duplicate uids.
    • ‘UidsLengthExceedUidsInSubNet’:
    • Attempting to set weights above the max allowed uids.
  • ‘UidVecContainInvalidOne’:

    • Attempting to set weights with invalid uids.
  • ‘WeightVecLengthIsLow’:

    • Attempting to set weights with fewer weights than min.
  • ‘MaxWeightExceeded’:

    • Attempting to set weights with max value exceeding limit.
Source

pub fn batch_set_weights( &self, netuids: Netuids, weights: Weights, version_keys: VersionKeys, ) -> StaticPayload<BatchSetWeights>

— Allows a hotkey to set weights for multiple netuids as a batch.

§Args:
  • origin: (Origin):

    • The caller, a hotkey who wishes to set their weights.
  • netuids (Vec<Compact>):

    • The network uids we are setting these weights on.
  • weights (Vec<Vec<(Compact, Compact)>):

    • The weights to set for each network. [(uid, weight), …]
  • version_keys (Vec<Compact>):

    • The network version keys to check if the validator is up to date.
§Event:
  • WeightsSet;
    • On successfully setting the weights on chain.
  • BatchWeightsCompleted;
    • On success of the batch.
  • BatchCompletedWithErrors;
    • On failure of any of the weights in the batch.
  • BatchWeightItemFailed;
    • On failure for each failed item in the batch.
Source

pub fn commit_weights( &self, netuid: Netuid, commit_hash: CommitHash, ) -> StaticPayload<CommitWeights>

–– Used to commit a hash of your weight values to later be revealed.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The signature of the committing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • commit_hash (H256):

    • The hash representing the committed weights.
§Raises:
  • CommitRevealDisabled:

    • Attempting to commit when the commit-reveal mechanism is disabled.
  • TooManyUnrevealedCommits:

    • Attempting to commit when the user has more than the allowed limit of unrevealed commits.
Source

pub fn commit_mechanism_weights( &self, netuid: Netuid, mecid: Mecid, commit_hash: CommitHash, ) -> StaticPayload<CommitMechanismWeights>

–– Used to commit a hash of your weight values to later be revealed for mechanisms.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The signature of the committing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • mecid (u8):

    • The u8 mechanism identifier.
  • commit_hash (H256):

    • The hash representing the committed weights.
§Raises:
  • CommitRevealDisabled:

    • Attempting to commit when the commit-reveal mechanism is disabled.
  • TooManyUnrevealedCommits:

    • Attempting to commit when the user has more than the allowed limit of unrevealed commits.
Source

pub fn batch_commit_weights( &self, netuids: Netuids, commit_hashes: CommitHashes, ) -> StaticPayload<BatchCommitWeights>

— Allows a hotkey to commit weight hashes for multiple netuids as a batch.

§Args:
  • origin: (Origin):

    • The caller, a hotkey who wishes to set their weights.
  • netuids (Vec<Compact>):

    • The network uids we are setting these weights on.
  • commit_hashes (Vec):

    • The commit hashes to commit.
§Event:
  • WeightsSet;
    • On successfully setting the weights on chain.
  • BatchWeightsCompleted;
    • On success of the batch.
  • BatchCompletedWithErrors;
    • On failure of any of the weights in the batch.
  • BatchWeightItemFailed;
    • On failure for each failed item in the batch.
Source

pub fn reveal_weights( &self, netuid: Netuid, uids: Uids, values: Values, salt: Salt, version_key: VersionKey, ) -> StaticPayload<RevealWeights>

–– Used to reveal the weights for a previously committed hash.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The signature of the revealing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • uids (Vec<u16>):

    • The uids for the weights being revealed.
  • values (Vec<u16>):

    • The values of the weights being revealed.
  • salt (Vec<u16>):

    • The salt used to generate the commit hash.
  • version_key (u64):

    • The network version key.
§Raises:
  • CommitRevealDisabled:

    • Attempting to reveal weights when the commit-reveal mechanism is disabled.
  • NoWeightsCommitFound:

    • Attempting to reveal weights without an existing commit.
  • ExpiredWeightCommit:

    • Attempting to reveal a weight commit that has expired.
  • RevealTooEarly:

    • Attempting to reveal weights outside the valid reveal period.
  • InvalidRevealCommitHashNotMatch:

    • The revealed hash does not match any committed hash.
Source

pub fn reveal_mechanism_weights( &self, netuid: Netuid, mecid: Mecid, uids: Uids, values: Values, salt: Salt, version_key: VersionKey, ) -> StaticPayload<RevealMechanismWeights>

–– Used to reveal the weights for a previously committed hash for mechanisms.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The signature of the revealing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • mecid (u8):

    • The u8 mechanism identifier.
  • uids (Vec<u16>):

    • The uids for the weights being revealed.
  • values (Vec<u16>):

    • The values of the weights being revealed.
  • salt (Vec<u16>):

    • The salt used to generate the commit hash.
  • version_key (u64):

    • The network version key.
§Raises:
  • CommitRevealDisabled:

    • Attempting to reveal weights when the commit-reveal mechanism is disabled.
  • NoWeightsCommitFound:

    • Attempting to reveal weights without an existing commit.
  • ExpiredWeightCommit:

    • Attempting to reveal a weight commit that has expired.
  • RevealTooEarly:

    • Attempting to reveal weights outside the valid reveal period.
  • InvalidRevealCommitHashNotMatch:

    • The revealed hash does not match any committed hash.
Source

pub fn commit_crv3_mechanism_weights( &self, netuid: Netuid, mecid: Mecid, commit: Commit, reveal_round: RevealRound, ) -> StaticPayload<CommitCrv3MechanismWeights>

–– Used to commit encrypted commit-reveal v3 weight values to later be revealed.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The committing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • commit (Vec<u8>):

    • The encrypted compressed commit. The steps for this are:
      1. Instantiate [WeightsTlockPayload]
      2. Serialize it using the parity_scale_codec::Encode trait
      3. Encrypt it following the steps (here)[https://github.com/ideal-lab5/tle/blob/f8e6019f0fb02c380ebfa6b30efb61786dede07b/timelock/src/tlock.rs#L283-L336] to produce a [TLECiphertext<TinyBLS381>] type.
      4. Serialize and compress using the ark-serialize CanonicalSerialize trait.
  • reveal_round (u64):

    • The drand reveal round which will be avaliable during epoch n+1 from the current epoch.
§Raises:
  • CommitRevealV3Disabled:

    • Attempting to commit when the commit-reveal mechanism is disabled.
  • TooManyUnrevealedCommits:

    • Attempting to commit when the user has more than the allowed limit of unrevealed commits.

–– Used to commit encrypted commit-reveal v3 weight values to later be revealed for mechanisms.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The committing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • mecid (u8):

    • The u8 mechanism identifier.
  • commit (Vec<u8>):

    • The encrypted compressed commit. The steps for this are:
      1. Instantiate [WeightsTlockPayload]
      2. Serialize it using the parity_scale_codec::Encode trait
      3. Encrypt it following the steps (here)[https://github.com/ideal-lab5/tle/blob/f8e6019f0fb02c380ebfa6b30efb61786dede07b/timelock/src/tlock.rs#L283-L336] to produce a [TLECiphertext<TinyBLS381>] type.
      4. Serialize and compress using the ark-serialize CanonicalSerialize trait.
  • reveal_round (u64):

    • The drand reveal round which will be avaliable during epoch n+1 from the current epoch.
§Raises:
  • CommitRevealV3Disabled:

    • Attempting to commit when the commit-reveal mechanism is disabled.
  • TooManyUnrevealedCommits:

    • Attempting to commit when the user has more than the allowed limit of unrevealed commits.
Source

pub fn batch_reveal_weights( &self, netuid: Netuid, uids_list: UidsList, values_list: ValuesList, salts_list: SaltsList, version_keys: VersionKeys, ) -> StaticPayload<BatchRevealWeights>

–– The implementation for batch revealing committed weights.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The signature of the revealing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • uids_list (Vec<Vec<u16>>):

    • A list of uids for each set of weights being revealed.
  • values_list (Vec<Vec<u16>>):

    • A list of values for each set of weights being revealed.
  • salts_list (Vec<Vec<u16>>):

    • A list of salts used to generate the commit hashes.
  • version_keys (Vec<u64>):

    • A list of network version keys.
§Raises:
  • CommitRevealDisabled:

    • Attempting to reveal weights when the commit-reveal mechanism is disabled.
  • NoWeightsCommitFound:

    • Attempting to reveal weights without an existing commit.
  • ExpiredWeightCommit:

    • Attempting to reveal a weight commit that has expired.
  • RevealTooEarly:

    • Attempting to reveal weights outside the valid reveal period.
  • InvalidRevealCommitHashNotMatch:

    • The revealed hash does not match any committed hash.
  • InvalidInputLengths:

    • The input vectors are of mismatched lengths.
Source

pub fn decrease_take( &self, hotkey: Hotkey, take: Take, ) -> StaticPayload<DecreaseTake>

— Allows delegates to decrease its take value.

§Args:
  • ‘origin’: (::Origin):

    • The signature of the caller’s coldkey.
  • ‘hotkey’ (T::AccountId):

    • The hotkey we are delegating (must be owned by the coldkey.)
  • ‘netuid’ (u16):

    • Subnet ID to decrease take for
  • ‘take’ (u16):

    • The new stake proportion that this hotkey takes from delegations. The new value can be between 0 and 11_796 and should be strictly lower than the previous value. It T is the new value (rational number), the the parameter is calculated as [65535 * T]. For example, 1% would be [0.01 * 65535] = [655.35] = 655
§Event:
  • TakeDecreased;
    • On successfully setting a decreased take for this hotkey.
§Raises:
  • ‘NotRegistered’:

    • The hotkey we are delegating is not registered on the network.
  • ‘NonAssociatedColdKey’:

    • The hotkey we are delegating is not owned by the calling coldkey.
  • ‘DelegateTakeTooLow’:

    • The delegate is setting a take which is not lower than the previous.
Source

pub fn increase_take( &self, hotkey: Hotkey, take: Take, ) -> StaticPayload<IncreaseTake>

— Allows delegates to increase its take value. This call is rate-limited.

§Args:
  • ‘origin’: (::Origin):

    • The signature of the caller’s coldkey.
  • ‘hotkey’ (T::AccountId):

    • The hotkey we are delegating (must be owned by the coldkey.)
  • ‘take’ (u16):

    • The new stake proportion that this hotkey takes from delegations. The new value can be between 0 and 11_796 and should be strictly greater than the previous value. T is the new value (rational number), the the parameter is calculated as [65535 * T]. For example, 1% would be [0.01 * 65535] = [655.35] = 655
§Event:
  • TakeIncreased;
    • On successfully setting a increased take for this hotkey.
§Raises:
  • ‘NotRegistered’:

    • The hotkey we are delegating is not registered on the network.
  • ‘NonAssociatedColdKey’:

    • The hotkey we are delegating is not owned by the calling coldkey.
  • ‘DelegateTakeTooHigh’:

    • The delegate is setting a take which is not greater than the previous.
Source

pub fn add_stake( &self, hotkey: Hotkey, netuid: Netuid, amount_staked: AmountStaked, ) -> StaticPayload<AddStake>

— Adds stake to a hotkey. The call is made from a coldkey account. This delegates stake to the hotkey.

Note: the coldkey account may own the hotkey, in which case they are delegating to themselves.

§Args:
  • ‘origin’: (Origin):

    • The signature of the caller’s coldkey.
  • ‘hotkey’ (T::AccountId):

    • The associated hotkey account.
  • ‘netuid’ (u16):

    • Subnetwork UID
  • ‘amount_staked’ (u64):

    • The amount of stake to be added to the hotkey staking account.
§Event:
  • StakeAdded;
    • On the successfully adding stake to a global account.
§Raises:
  • ‘NotEnoughBalanceToStake’:

    • Not enough balance on the coldkey to add onto the global account.
  • ‘NonAssociatedColdKey’:

    • The calling coldkey is not associated with this hotkey.
  • ‘BalanceWithdrawalError’:

    • Errors stemming from transaction pallet.
Source

pub fn remove_stake( &self, hotkey: Hotkey, netuid: Netuid, amount_unstaked: AmountUnstaked, ) -> StaticPayload<RemoveStake>

Remove stake from the staking account. The call must be made from the coldkey account attached to the neuron metadata. Only this key has permission to make staking and unstaking requests.

§Args:
  • ‘origin’: (Origin):

    • The signature of the caller’s coldkey.
  • ‘hotkey’ (T::AccountId):

    • The associated hotkey account.
  • ‘netuid’ (u16):

    • Subnetwork UID
  • ‘amount_unstaked’ (u64):

    • The amount of stake to be added to the hotkey staking account.
§Event:
  • StakeRemoved;
    • On the successfully removing stake from the hotkey account.
§Raises:
  • ‘NotRegistered’:

    • Thrown if the account we are attempting to unstake from is non existent.
  • ‘NonAssociatedColdKey’:

    • Thrown if the coldkey does not own the hotkey we are unstaking from.
  • ‘NotEnoughStakeToWithdraw’:

    • Thrown if there is not enough stake on the hotkey to withdwraw this amount.
Source

pub fn serve_axon( &self, netuid: Netuid, version: Version, ip: Ip, port: Port, ip_type: IpType, protocol: Protocol, placeholder1: Placeholder1, placeholder2: Placeholder2, ) -> StaticPayload<ServeAxon>

Serves or updates axon /prometheus information for the neuron associated with the caller. If the caller is already registered the metadata is updated. If the caller is not registered this call throws NotRegistered.

§Args:
  • ‘origin’: (Origin):

    • The signature of the caller.
  • ‘netuid’ (u16):

    • The u16 network identifier.
  • ‘version’ (u64):

    • The bittensor version identifier.
  • ‘ip’ (u64):

    • The endpoint ip information as a u128 encoded integer.
  • ‘port’ (u16):

    • The endpoint port information as a u16 encoded integer.
  • ‘ip_type’ (u8):

    • The endpoint ip version as a u8, 4 or 6.
  • ‘protocol’ (u8):

    • UDP:1 or TCP:0
  • ‘placeholder1’ (u8):

    • Placeholder for further extra params.
  • ‘placeholder2’ (u8):

    • Placeholder for further extra params.
§Event:
  • AxonServed;
    • On successfully serving the axon info.
§Raises:
  • ‘MechanismDoesNotExist’:

    • Attempting to set weights on a non-existent network.
  • ‘NotRegistered’:

    • Attempting to set weights from a non registered account.
  • ‘InvalidIpType’:

    • The ip type is not 4 or 6.
  • ‘InvalidIpAddress’:

    • The numerically encoded ip address does not resolve to a proper ip.
  • ‘ServingRateLimitExceeded’:

    • Attempting to set prometheus information withing the rate limit min.
Source

pub fn serve_axon_tls( &self, netuid: Netuid, version: Version, ip: Ip, port: Port, ip_type: IpType, protocol: Protocol, placeholder1: Placeholder1, placeholder2: Placeholder2, certificate: Certificate, ) -> StaticPayload<ServeAxonTls>

Same as serve_axon but takes a certificate as an extra optional argument. Serves or updates axon /prometheus information for the neuron associated with the caller. If the caller is already registered the metadata is updated. If the caller is not registered this call throws NotRegistered.

§Args:
  • ‘origin’: (Origin):

    • The signature of the caller.
  • ‘netuid’ (u16):

    • The u16 network identifier.
  • ‘version’ (u64):

    • The bittensor version identifier.
  • ‘ip’ (u64):

    • The endpoint ip information as a u128 encoded integer.
  • ‘port’ (u16):

    • The endpoint port information as a u16 encoded integer.
  • ‘ip_type’ (u8):

    • The endpoint ip version as a u8, 4 or 6.
  • ‘protocol’ (u8):

    • UDP:1 or TCP:0
  • ‘placeholder1’ (u8):

    • Placeholder for further extra params.
  • ‘placeholder2’ (u8):

    • Placeholder for further extra params.
  • ‘certificate’ (Vec):

    • TLS certificate for inter neuron communitation.
§Event:
  • AxonServed;
    • On successfully serving the axon info.
§Raises:
  • ‘MechanismDoesNotExist’:

    • Attempting to set weights on a non-existent network.
  • ‘NotRegistered’:

    • Attempting to set weights from a non registered account.
  • ‘InvalidIpType’:

    • The ip type is not 4 or 6.
  • ‘InvalidIpAddress’:

    • The numerically encoded ip address does not resolve to a proper ip.
  • ‘ServingRateLimitExceeded’:

    • Attempting to set prometheus information withing the rate limit min.
Source

pub fn serve_prometheus( &self, netuid: Netuid, version: Version, ip: Ip, port: Port, ip_type: IpType, ) -> StaticPayload<ServePrometheus>

–– Set prometheus information for the neuron.

§Args:
  • ‘origin’: (Origin):

    • The signature of the calling hotkey.
  • ‘netuid’ (u16):

    • The u16 network identifier.
  • ‘version’ (u16):

    • The bittensor version identifier.
  • ‘ip’ (u128):

    • The prometheus ip information as a u128 encoded integer.
  • ‘port’ (u16):

    • The prometheus port information as a u16 encoded integer.
  • ‘ip_type’ (u8):

    • The ip type v4 or v6.
Source

pub fn register( &self, netuid: Netuid, block_number: BlockNumber, nonce: Nonce, work: Work, hotkey: Hotkey, coldkey: Coldkey, ) -> StaticPayload<Register>

–– Registers a new neuron to the subnetwork.

§Args:
  • ‘origin’: (Origin):

    • The signature of the calling hotkey.
  • ‘netuid’ (u16):

    • The u16 network identifier.
  • ‘block_number’ ( u64 ):

    • Block hash used to prove work done.
  • ‘nonce’ ( u64 ):

    • Positive integer nonce used in POW.
  • ‘work’ ( Vec ):

    • Vector encoded bytes representing work done.
  • ‘hotkey’ ( T::AccountId ):

    • Hotkey to be registered to the network.
  • ‘coldkey’ ( T::AccountId ):

    • Associated coldkey account.
§Event:
  • NeuronRegistered;
    • On successfully registering a uid to a neuron slot on a subnetwork.
§Raises:
  • ‘MechanismDoesNotExist’:

    • Attempting to register to a non existent network.
  • ‘TooManyRegistrationsThisBlock’:

    • This registration exceeds the total allowed on this network this block.
  • ‘HotKeyAlreadyRegisteredInSubNet’:

    • The hotkey is already registered on this network.
  • ‘InvalidWorkBlock’:

    • The work has been performed on a stale, future, or non existent block.
  • ‘InvalidDifficulty’:

    • The work does not match the difficulty.
  • ‘InvalidSeal’:

    • The seal is incorrect.
Source

pub fn root_register(&self, hotkey: Hotkey) -> StaticPayload<RootRegister>

Register the hotkey to root network

Source

pub fn burned_register( &self, netuid: Netuid, hotkey: Hotkey, ) -> StaticPayload<BurnedRegister>

User register a new subnetwork via burning token

Source

pub fn swap_hotkey( &self, hotkey: Hotkey, new_hotkey: NewHotkey, netuid: Netuid, ) -> StaticPayload<SwapHotkey>

The extrinsic for user to change its hotkey in subnet or all subnets.

Source

pub fn swap_coldkey( &self, old_coldkey: OldColdkey, new_coldkey: NewColdkey, swap_cost: SwapCost, ) -> StaticPayload<SwapColdkey>

The extrinsic for user to change the coldkey associated with their account.

§Arguments
  • origin - The origin of the call, must be signed by the old coldkey.
  • old_coldkey - The current coldkey associated with the account.
  • new_coldkey - The new coldkey to be associated with the account.
§Returns

Returns a DispatchResultWithPostInfo indicating success or failure of the operation.

§Weight

Weight is calculated based on the number of database reads and writes.

Source

pub fn set_childkey_take( &self, hotkey: Hotkey, netuid: Netuid, take: Take, ) -> StaticPayload<SetChildkeyTake>

Sets the childkey take for a given hotkey.

This function allows a coldkey to set the childkey take for a given hotkey. The childkey take determines the proportion of stake that the hotkey keeps for itself when distributing stake to its children.

§Arguments:
  • origin (::RuntimeOrigin):

    • The signature of the calling coldkey. Setting childkey take can only be done by the coldkey.
  • hotkey (T::AccountId):

    • The hotkey for which the childkey take will be set.
  • take (u16):

    • The new childkey take value. This is a percentage represented as a value between 0 and 10000, where 10000 represents 100%.
§Events:
  • ChildkeyTakeSet:
    • On successfully setting the childkey take for a hotkey.
§Errors:
  • NonAssociatedColdKey:
    • The coldkey does not own the hotkey.
  • InvalidChildkeyTake:
    • The provided take value is invalid (greater than the maximum allowed take).
  • TxChildkeyTakeRateLimitExceeded:
    • The rate limit for changing childkey take has been exceeded.
Source

pub fn sudo_set_tx_childkey_take_rate_limit( &self, tx_rate_limit: TxRateLimit, ) -> StaticPayload<SudoSetTxChildkeyTakeRateLimit>

Sets the transaction rate limit for changing childkey take.

This function can only be called by the root origin.

§Arguments:
  • origin - The origin of the call, must be root.
  • tx_rate_limit - The new rate limit in blocks.
§Errors:
  • BadOrigin - If the origin is not root.
Source

pub fn sudo_set_min_childkey_take( &self, take: Take, ) -> StaticPayload<SudoSetMinChildkeyTake>

Sets the minimum allowed childkey take.

This function can only be called by the root origin.

§Arguments:
  • origin - The origin of the call, must be root.
  • take - The new minimum childkey take value.
§Errors:
  • BadOrigin - If the origin is not root.
Source

pub fn sudo_set_max_childkey_take( &self, take: Take, ) -> StaticPayload<SudoSetMaxChildkeyTake>

Sets the maximum allowed childkey take.

This function can only be called by the root origin.

§Arguments:
  • origin - The origin of the call, must be root.
  • take - The new maximum childkey take value.
§Errors:
  • BadOrigin - If the origin is not root.
Source

pub fn register_network(&self, hotkey: Hotkey) -> StaticPayload<RegisterNetwork>

User register a new subnetwork

Source

pub fn dissolve_network( &self, coldkey: Coldkey, netuid: Netuid, ) -> StaticPayload<DissolveNetwork>

Remove a user’s subnetwork The caller must be the owner of the network

Source

pub fn set_children( &self, hotkey: Hotkey, netuid: Netuid, children: Children, ) -> StaticPayload<SetChildren>

Set a single child for a given hotkey on a specified network.

This function allows a coldkey to set a single child for a given hotkey on a specified network. The proportion of the hotkey’s stake to be allocated to the child is also specified.

§Arguments:
  • origin (::RuntimeOrigin):

    • The signature of the calling coldkey. Setting a hotkey child can only be done by the coldkey.
  • hotkey (T::AccountId):

    • The hotkey which will be assigned the child.
  • child (T::AccountId):

    • The child which will be assigned to the hotkey.
  • netuid (u16):

    • The u16 network identifier where the childkey will exist.
  • proportion (u64):

    • Proportion of the hotkey’s stake to be given to the child, the value must be u64 normalized.
§Events:
  • ChildAddedSingular:
    • On successfully registering a child to a hotkey.
§Errors:
  • MechanismDoesNotExist:
    • Attempting to register to a non-existent network.
  • RegistrationNotPermittedOnRootSubnet:
    • Attempting to register a child on the root network.
  • NonAssociatedColdKey:
    • The coldkey does not own the hotkey or the child is the same as the hotkey.
  • HotKeyAccountNotExists:
    • The hotkey account does not exist.
§Detailed Explanation of Checks:
  1. Signature Verification: Ensures that the caller has signed the transaction, verifying the coldkey.
  2. Root Network Check: Ensures that the delegation is not on the root network, as child hotkeys are not valid on the root.
  3. Network Existence Check: Ensures that the specified network exists.
  4. Ownership Verification: Ensures that the coldkey owns the hotkey.
  5. Hotkey Account Existence Check: Ensures that the hotkey account already exists.
  6. Child-Hotkey Distinction: Ensures that the child is not the same as the hotkey.
  7. Old Children Cleanup: Removes the hotkey from the parent list of its old children.
  8. New Children Assignment: Assigns the new child to the hotkey and updates the parent list for the new child.
Source

pub fn schedule_swap_coldkey( &self, new_coldkey: NewColdkey, ) -> StaticPayload<ScheduleSwapColdkey>

Schedules a coldkey swap operation to be executed at a future block.

This function allows a user to schedule the swapping of their coldkey to a new one at a specified future block. The swap is not executed immediately but is scheduled to occur at the specified block number.

§Arguments
  • origin - The origin of the call, which should be signed by the current coldkey owner.
  • new_coldkey - The account ID of the new coldkey that will replace the current one.
  • when - The block number at which the coldkey swap should be executed.
§Returns

Returns a DispatchResultWithPostInfo indicating whether the scheduling was successful.

§Errors

This function may return an error if:

  • The origin is not signed.
  • The scheduling fails due to conflicts or system constraints.
§Notes
  • The actual swap is not performed by this function. It merely schedules the swap operation.
  • The weight of this call is set to a fixed value and may need adjustment based on benchmarking.
§TODO
  • Implement proper weight calculation based on the complexity of the operation.
  • Consider adding checks to prevent scheduling too far into the future. TODO: Benchmark this call
Source

pub fn set_identity( &self, name: Name, url: Url, github_repo: GithubRepo, image: Image, discord: Discord, description: Description, additional: Additional, ) -> StaticPayload<SetIdentity>

–– Set prometheus information for the neuron.

§Args:
  • ‘origin’: (Origin):

    • The signature of the calling hotkey.
  • ‘netuid’ (u16):

    • The u16 network identifier.
  • ‘version’ (u16):

    • The bittensor version identifier.
  • ‘ip’ (u128):

    • The prometheus ip information as a u128 encoded integer.
  • ‘port’ (u16):

    • The prometheus port information as a u16 encoded integer.
  • ‘ip_type’ (u8):

    • The ip type v4 or v6.
Source

pub fn set_subnet_identity( &self, netuid: Netuid, subnet_name: SubnetName, github_repo: GithubRepo, subnet_contact: SubnetContact, subnet_url: SubnetUrl, discord: Discord, description: Description, logo_url: LogoUrl, additional: Additional, ) -> StaticPayload<SetSubnetIdentity>

–– Set the identity information for a subnet.

§Args:
  • origin - (::Origin):

    • The signature of the calling coldkey, which must be the owner of the subnet.
  • netuid (u16):

    • The unique network identifier of the subnet.
  • subnet_name (Vec):

    • The name of the subnet.
  • github_repo (Vec):

    • The GitHub repository associated with the subnet identity.
  • subnet_contact (Vec):

    • The contact information for the subnet.
Source

pub fn register_network_with_identity( &self, hotkey: Hotkey, identity: Identity, ) -> StaticPayload<RegisterNetworkWithIdentity>

User register a new subnetwork

Source

pub fn unstake_all(&self, hotkey: Hotkey) -> StaticPayload<UnstakeAll>

–– The implementation for the extrinsic unstake_all: Removes all stake from a hotkey account across all subnets and adds it onto a coldkey.

§Args:
  • origin - (::Origin):

    • The signature of the caller’s coldkey.
  • hotkey (T::AccountId):

    • The associated hotkey account.
§Event:
  • StakeRemoved;
    • On the successfully removing stake from the hotkey account.
§Raises:
  • NotRegistered:

    • Thrown if the account we are attempting to unstake from is non existent.
  • NonAssociatedColdKey:

    • Thrown if the coldkey does not own the hotkey we are unstaking from.
  • NotEnoughStakeToWithdraw:

    • Thrown if there is not enough stake on the hotkey to withdraw this amount.
  • TxRateLimitExceeded:

    • Thrown if key has hit transaction rate limit
Source

pub fn unstake_all_alpha( &self, hotkey: Hotkey, ) -> StaticPayload<UnstakeAllAlpha>

–– The implementation for the extrinsic unstake_all: Removes all stake from a hotkey account across all subnets and adds it onto a coldkey.

§Args:
  • origin - (::Origin):

    • The signature of the caller’s coldkey.
  • hotkey (T::AccountId):

    • The associated hotkey account.
§Event:
  • StakeRemoved;
    • On the successfully removing stake from the hotkey account.
§Raises:
  • NotRegistered:

    • Thrown if the account we are attempting to unstake from is non existent.
  • NonAssociatedColdKey:

    • Thrown if the coldkey does not own the hotkey we are unstaking from.
  • NotEnoughStakeToWithdraw:

    • Thrown if there is not enough stake on the hotkey to withdraw this amount.
  • TxRateLimitExceeded:

    • Thrown if key has hit transaction rate limit
Source

pub fn move_stake( &self, origin_hotkey: OriginHotkey, destination_hotkey: DestinationHotkey, origin_netuid: OriginNetuid, destination_netuid: DestinationNetuid, alpha_amount: AlphaAmount, ) -> StaticPayload<MoveStake>

–– The implementation for the extrinsic move_stake: Moves specified amount of stake from a hotkey to another across subnets.

§Args:
  • origin - (::Origin):

    • The signature of the caller’s coldkey.
  • origin_hotkey (T::AccountId):

    • The hotkey account to move stake from.
  • destination_hotkey (T::AccountId):

    • The hotkey account to move stake to.
  • origin_netuid (T::AccountId):

    • The subnet ID to move stake from.
  • destination_netuid (T::AccountId):

    • The subnet ID to move stake to.
  • alpha_amount (T::AccountId):

    • The alpha stake amount to move.
Source

pub fn transfer_stake( &self, destination_coldkey: DestinationColdkey, hotkey: Hotkey, origin_netuid: OriginNetuid, destination_netuid: DestinationNetuid, alpha_amount: AlphaAmount, ) -> StaticPayload<TransferStake>

Transfers a specified amount of stake from one coldkey to another, optionally across subnets, while keeping the same hotkey.

§Arguments
  • origin - The origin of the transaction, which must be signed by the origin_coldkey.
  • destination_coldkey - The coldkey to which the stake is transferred.
  • hotkey - The hotkey associated with the stake.
  • origin_netuid - The network/subnet ID to move stake from.
  • destination_netuid - The network/subnet ID to move stake to (for cross-subnet transfer).
  • alpha_amount - The amount of stake to transfer.
§Errors

Returns an error if:

  • The origin is not signed by the correct coldkey.
  • Either subnet does not exist.
  • The hotkey does not exist.
  • There is insufficient stake on (origin_coldkey, hotkey, origin_netuid).
  • The transfer amount is below the minimum stake requirement.
§Events

May emit a StakeTransferred event on success.

Source

pub fn swap_stake( &self, hotkey: Hotkey, origin_netuid: OriginNetuid, destination_netuid: DestinationNetuid, alpha_amount: AlphaAmount, ) -> StaticPayload<SwapStake>

Swaps a specified amount of stake from one subnet to another, while keeping the same coldkey and hotkey.

§Arguments
  • origin - The origin of the transaction, which must be signed by the coldkey that owns the hotkey.
  • hotkey - The hotkey whose stake is being swapped.
  • origin_netuid - The network/subnet ID from which stake is removed.
  • destination_netuid - The network/subnet ID to which stake is added.
  • alpha_amount - The amount of stake to swap.
§Errors

Returns an error if:

  • The transaction is not signed by the correct coldkey (i.e., coldkey_owns_hotkey fails).
  • Either origin_netuid or destination_netuid does not exist.
  • The hotkey does not exist.
  • There is insufficient stake on (coldkey, hotkey, origin_netuid).
  • The swap amount is below the minimum stake requirement.
§Events

May emit a StakeSwapped event on success.

Source

pub fn add_stake_limit( &self, hotkey: Hotkey, netuid: Netuid, amount_staked: AmountStaked, limit_price: LimitPrice, allow_partial: AllowPartial, ) -> StaticPayload<AddStakeLimit>

— Adds stake to a hotkey on a subnet with a price limit. This extrinsic allows to specify the limit price for alpha token at which or better (lower) the staking should execute.

In case if slippage occurs and the price shall move beyond the limit price, the staking order may execute only partially or not execute at all.

§Args:
  • ‘origin’: (Origin):

    • The signature of the caller’s coldkey.
  • ‘hotkey’ (T::AccountId):

    • The associated hotkey account.
  • ‘netuid’ (u16):

    • Subnetwork UID
  • ‘amount_staked’ (u64):

    • The amount of stake to be added to the hotkey staking account.
  • ‘limit_price’ (u64):

    • The limit price expressed in units of RAO per one Alpha.
  • ‘allow_partial’ (bool):

    • Allows partial execution of the amount. If set to false, this becomes fill or kill type or order.
§Event:
  • StakeAdded;
    • On the successfully adding stake to a global account.
§Raises:
  • ‘NotEnoughBalanceToStake’:

    • Not enough balance on the coldkey to add onto the global account.
  • ‘NonAssociatedColdKey’:

    • The calling coldkey is not associated with this hotkey.
  • ‘BalanceWithdrawalError’:

    • Errors stemming from transaction pallet.
Source

pub fn remove_stake_limit( &self, hotkey: Hotkey, netuid: Netuid, amount_unstaked: AmountUnstaked, limit_price: LimitPrice, allow_partial: AllowPartial, ) -> StaticPayload<RemoveStakeLimit>

— Removes stake from a hotkey on a subnet with a price limit. This extrinsic allows to specify the limit price for alpha token at which or better (higher) the staking should execute.

In case if slippage occurs and the price shall move beyond the limit price, the staking order may execute only partially or not execute at all.

§Args:
  • ‘origin’: (Origin):

    • The signature of the caller’s coldkey.
  • ‘hotkey’ (T::AccountId):

    • The associated hotkey account.
  • ‘netuid’ (u16):

    • Subnetwork UID
  • ‘amount_unstaked’ (u64):

    • The amount of stake to be added to the hotkey staking account.
  • ‘limit_price’ (u64):

    • The limit price expressed in units of RAO per one Alpha.
  • ‘allow_partial’ (bool):

    • Allows partial execution of the amount. If set to false, this becomes fill or kill type or order.
§Event:
  • StakeRemoved;
    • On the successfully removing stake from the hotkey account.
§Raises:
  • ‘NotRegistered’:

    • Thrown if the account we are attempting to unstake from is non existent.
  • ‘NonAssociatedColdKey’:

    • Thrown if the coldkey does not own the hotkey we are unstaking from.
  • ‘NotEnoughStakeToWithdraw’:

    • Thrown if there is not enough stake on the hotkey to withdwraw this amount.
Source

pub fn swap_stake_limit( &self, hotkey: Hotkey, origin_netuid: OriginNetuid, destination_netuid: DestinationNetuid, alpha_amount: AlphaAmount, limit_price: LimitPrice, allow_partial: AllowPartial, ) -> StaticPayload<SwapStakeLimit>

Swaps a specified amount of stake from one subnet to another, while keeping the same coldkey and hotkey.

§Arguments
  • origin - The origin of the transaction, which must be signed by the coldkey that owns the hotkey.
  • hotkey - The hotkey whose stake is being swapped.
  • origin_netuid - The network/subnet ID from which stake is removed.
  • destination_netuid - The network/subnet ID to which stake is added.
  • alpha_amount - The amount of stake to swap.
  • limit_price - The limit price expressed in units of RAO per one Alpha.
  • allow_partial - Allows partial execution of the amount. If set to false, this becomes fill or kill type or order.
§Errors

Returns an error if:

  • The transaction is not signed by the correct coldkey (i.e., coldkey_owns_hotkey fails).
  • Either origin_netuid or destination_netuid does not exist.
  • The hotkey does not exist.
  • There is insufficient stake on (coldkey, hotkey, origin_netuid).
  • The swap amount is below the minimum stake requirement.
§Events

May emit a StakeSwapped event on success.

Source

pub fn try_associate_hotkey( &self, hotkey: Hotkey, ) -> StaticPayload<TryAssociateHotkey>

Attempts to associate a hotkey with a coldkey.

§Arguments
  • origin - The origin of the transaction, which must be signed by the coldkey that owns the hotkey.
  • hotkey - The hotkey to associate with the coldkey.
§Note

Will charge based on the weight even if the hotkey is already associated with a coldkey.

Source

pub fn start_call(&self, netuid: Netuid) -> StaticPayload<StartCall>

Initiates a call on a subnet.

§Arguments
  • origin - The origin of the call, which must be signed by the subnet owner.
  • netuid - The unique identifier of the subnet on which the call is being initiated.
§Events

Emits a FirstEmissionBlockNumberSet event on success.

Source

pub fn associate_evm_key( &self, netuid: Netuid, evm_key: EvmKey, block_number: BlockNumber, signature: Signature, ) -> StaticPayload<AssociateEvmKey>

Attempts to associate a hotkey with an EVM key.

The signature will be checked to see if the recovered public key matches the evm_key provided.

The EVM key is expected to sign the message according to this formula to produce the signature:

keccak_256(hotkey ++ keccak_256(block_number))
§Arguments
  • origin - The origin of the transaction, which must be signed by the hotkey.
  • netuid - The netuid that the hotkey belongs to.
  • evm_key - The EVM key to associate with the hotkey.
  • block_number - The block number used in the signature.
  • signature - A signed message by the evm_key containing the hotkey and the hashed block_number.
§Errors

Returns an error if:

  • The transaction is not signed.
  • The hotkey does not belong to the subnet identified by the netuid.
  • The EVM key cannot be recovered from the signature.
  • The EVM key recovered from the signature does not match the given EVM key.
§Events

May emit a EvmKeyAssociated event on success

Source

pub fn recycle_alpha( &self, hotkey: Hotkey, amount: Amount, netuid: Netuid, ) -> StaticPayload<RecycleAlpha>

Recycles alpha from a cold/hot key pair, reducing AlphaOut on a subnet

§Arguments
  • origin - The origin of the call (must be signed by the coldkey)
  • hotkey - The hotkey account
  • amount - The amount of alpha to recycle
  • netuid - The subnet ID
§Events

Emits a TokensRecycled event on success.

Source

pub fn burn_alpha( &self, hotkey: Hotkey, amount: Amount, netuid: Netuid, ) -> StaticPayload<BurnAlpha>

Burns alpha from a cold/hot key pair without reducing AlphaOut

§Arguments
  • origin - The origin of the call (must be signed by the coldkey)
  • hotkey - The hotkey account
  • amount - The amount of alpha to burn
  • netuid - The subnet ID
§Events

Emits a TokensBurned event on success.

Source

pub fn set_pending_childkey_cooldown( &self, cooldown: Cooldown, ) -> StaticPayload<SetPendingChildkeyCooldown>

Sets the pending childkey cooldown (in blocks). Root only.

Source

pub fn remove_stake_full_limit( &self, hotkey: Hotkey, netuid: Netuid, limit_price: LimitPrice, ) -> StaticPayload<RemoveStakeFullLimit>

Removes all stake from a hotkey on a subnet with a price limit. This extrinsic allows to specify the limit price for alpha token at which or better (higher) the staking should execute. Without limit_price it remove all the stake similar to remove_stake extrinsic

Source

pub fn register_leased_network( &self, emissions_share: EmissionsShare, end_block: EndBlock, ) -> StaticPayload<RegisterLeasedNetwork>

Register a new leased network.

The crowdloan’s contributions are used to compute the share of the emissions that the contributors will receive as dividends.

The leftover cap is refunded to the contributors and the beneficiary.

§Args:
  • origin - (::Origin):

    • The signature of the caller’s coldkey.
  • emissions_share (Percent):

    • The share of the emissions that the contributors will receive as dividends.
  • end_block (Option<BlockNumberFor>):

    • The block at which the lease will end. If not defined, the lease is perpetual.
Source

pub fn terminate_lease( &self, lease_id: LeaseId, hotkey: Hotkey, ) -> StaticPayload<TerminateLease>

Terminate a lease.

The beneficiary can terminate the lease after the end block has passed and get the subnet ownership. The subnet is transferred to the beneficiary and the lease is removed from storage.

The hotkey must be owned by the beneficiary coldkey.

§Args:
  • origin - (::Origin):

    • The signature of the caller’s coldkey.
  • lease_id (LeaseId):

    • The ID of the lease to terminate.
  • hotkey (T::AccountId):

    • The hotkey of the beneficiary to mark as subnet owner hotkey.
Source

pub fn update_symbol( &self, netuid: Netuid, symbol: Symbol, ) -> StaticPayload<UpdateSymbol>

Updates the symbol for a subnet.

§Arguments
  • origin - The origin of the call, which must be the subnet owner or root.
  • netuid - The unique identifier of the subnet on which the symbol is being set.
  • symbol - The symbol to set for the subnet.
§Errors

Returns an error if:

  • The transaction is not signed by the subnet owner.
  • The symbol does not exist.
  • The symbol is already in use by another subnet.
§Events

Emits a SymbolUpdated event on success.

Source

pub fn commit_timelocked_weights( &self, netuid: Netuid, commit: Commit, reveal_round: RevealRound, commit_reveal_version: CommitRevealVersion, ) -> StaticPayload<CommitTimelockedWeights>

–– Used to commit timelock encrypted commit-reveal weight values to later be revealed.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The committing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • commit (Vec<u8>):

    • The encrypted compressed commit. The steps for this are:
      1. Instantiate [WeightsTlockPayload]
      2. Serialize it using the parity_scale_codec::Encode trait
      3. Encrypt it following the steps (here)[https://github.com/ideal-lab5/tle/blob/f8e6019f0fb02c380ebfa6b30efb61786dede07b/timelock/src/tlock.rs#L283-L336] to produce a [TLECiphertext<TinyBLS381>] type.
      4. Serialize and compress using the ark-serialize CanonicalSerialize trait.
  • reveal_round (u64):

    • The drand reveal round which will be avaliable during epoch n+1 from the current epoch.
  • commit_reveal_version (u16):

    • The client (bittensor-drand) version
Source

pub fn set_coldkey_auto_stake_hotkey( &self, netuid: Netuid, hotkey: Hotkey, ) -> StaticPayload<SetColdkeyAutoStakeHotkey>

Set the autostake destination hotkey for a coldkey.

The caller selects a hotkey where all future rewards will be automatically staked.

§Args:
  • origin - (::Origin):

    • The signature of the caller’s coldkey.
  • hotkey (T::AccountId):

    • The hotkey account to designate as the autostake destination.
Source

pub fn commit_timelocked_mechanism_weights( &self, netuid: Netuid, mecid: Mecid, commit: Commit, reveal_round: RevealRound, commit_reveal_version: CommitRevealVersion, ) -> StaticPayload<CommitTimelockedMechanismWeights>

–– Used to commit timelock encrypted commit-reveal weight values to later be revealed for a mechanism.

§Args:
  • origin: (<T as frame_system::Config>::RuntimeOrigin):

    • The committing hotkey.
  • netuid (u16):

    • The u16 network identifier.
  • mecid (u8):

    • The u8 mechanism identifier.
  • commit (Vec<u8>):

    • The encrypted compressed commit. The steps for this are:
      1. Instantiate [WeightsTlockPayload]
      2. Serialize it using the parity_scale_codec::Encode trait
      3. Encrypt it following the steps (here)[https://github.com/ideal-lab5/tle/blob/f8e6019f0fb02c380ebfa6b30efb61786dede07b/timelock/src/tlock.rs#L283-L336] to produce a [TLECiphertext<TinyBLS381>] type.
      4. Serialize and compress using the ark-serialize CanonicalSerialize trait.
  • reveal_round (u64):

    • The drand reveal round which will be avaliable during epoch n+1 from the current epoch.
  • commit_reveal_version (u16):

    • The client (bittensor-drand) version
Source

pub fn root_dissolve_network( &self, netuid: Netuid, ) -> StaticPayload<RootDissolveNetwork>

Remove a subnetwork The caller must be root

Source

pub fn claim_root(&self, subnets: Subnets) -> StaticPayload<ClaimRoot>

— Claims the root emissions for a coldkey.

§Args:
  • ‘origin’: (Origin):
    • The signature of the caller’s coldkey.
§Event:
  • RootClaimed;
    • On the successfully claiming the root emissions for a coldkey.
§Raises:
Source

pub fn set_root_claim_type( &self, new_root_claim_type: NewRootClaimType, ) -> StaticPayload<SetRootClaimType>

— Sets the root claim type for the coldkey.

§Args:
  • ‘origin’: (Origin):
    • The signature of the caller’s coldkey.
§Event:
  • RootClaimTypeSet;
    • On the successfully setting the root claim type for the coldkey.
Source

pub fn sudo_set_num_root_claims( &self, new_value: NewValue, ) -> StaticPayload<SudoSetNumRootClaims>

— Sets root claim number (sudo extrinsic). Zero disables auto-claim.

Source

pub fn sudo_set_root_claim_threshold( &self, netuid: Netuid, new_value: NewValue, ) -> StaticPayload<SudoSetRootClaimThreshold>

— Sets root claim threshold for subnet (sudo or owner origin).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CheckedConversion for T

Source§

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
Source§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
Source§

impl<T> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

Source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

Source§

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatedConversion for T

Source§

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
Source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

Source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

Source§

impl<T> MaybeSend for T
where T: Send,