|
21 | 21 | NeuronInfo,
|
22 | 22 | ProposalVoteData,
|
23 | 23 | SubnetHyperparameters,
|
| 24 | + SubnetIdentity, |
24 | 25 | SubnetInfo,
|
25 | 26 | WeightCommitInfo,
|
26 | 27 | decode_account_id,
|
|
34 | 35 | burned_register_extrinsic,
|
35 | 36 | register_extrinsic,
|
36 | 37 | register_subnet_extrinsic,
|
| 38 | + set_subnet_identity_extrinsic, |
37 | 39 | )
|
38 | 40 | from bittensor.core.extrinsics.asyncex.move_stake import (
|
39 | 41 | transfer_stake_extrinsic,
|
@@ -3188,6 +3190,44 @@ async def root_set_weights(
|
3188 | 3190 | wait_for_inclusion=wait_for_inclusion,
|
3189 | 3191 | )
|
3190 | 3192 |
|
| 3193 | + async def set_subnet_identity( |
| 3194 | + self, |
| 3195 | + wallet: "Wallet", |
| 3196 | + netuid: int, |
| 3197 | + subnet_identity: SubnetIdentity, |
| 3198 | + wait_for_inclusion: bool = False, |
| 3199 | + wait_for_finalization: bool = True, |
| 3200 | + ) -> tuple[bool, str]: |
| 3201 | + """ |
| 3202 | + Sets the identity of a subnet for a specific wallet and network. |
| 3203 | +
|
| 3204 | + Arguments: |
| 3205 | + wallet (Wallet): The wallet instance that will authorize the transaction. |
| 3206 | + netuid (int): The unique ID of the network on which the operation takes place. |
| 3207 | + subnet_identity (SubnetIdentity): The identity data of the subnet including attributes like name, GitHub |
| 3208 | + repository, contact, URL, discord, description, and any additional metadata. |
| 3209 | + wait_for_inclusion (bool): Indicates if the function should wait for the transaction to be included in the block. |
| 3210 | + wait_for_finalization (bool): Indicates if the function should wait for the transaction to reach finalization. |
| 3211 | +
|
| 3212 | + Returns: |
| 3213 | + tuple[bool, str]: A tuple where the first element is a boolean indicating success or failure of the |
| 3214 | + operation, and the second element is a message providing additional information. |
| 3215 | + """ |
| 3216 | + return await set_subnet_identity_extrinsic( |
| 3217 | + subtensor=self, |
| 3218 | + wallet=wallet, |
| 3219 | + netuid=netuid, |
| 3220 | + subnet_name=subnet_identity.subnet_name, |
| 3221 | + github_repo=subnet_identity.github_repo, |
| 3222 | + subnet_contact=subnet_identity.subnet_contact, |
| 3223 | + subnet_url=subnet_identity.subnet_url, |
| 3224 | + discord=subnet_identity.discord, |
| 3225 | + description=subnet_identity.description, |
| 3226 | + additional=subnet_identity.additional, |
| 3227 | + wait_for_inclusion=wait_for_inclusion, |
| 3228 | + wait_for_finalization=wait_for_finalization, |
| 3229 | + ) |
| 3230 | + |
3191 | 3231 | async def set_weights(
|
3192 | 3232 | self,
|
3193 | 3233 | wallet: "Wallet",
|
|
0 commit comments